/* Look ▾ (look.js): a column of rows (Edges, See-through, Cut with its axis, flip and position
   controls) in the toolbar popover; the toolbar button shows the accent while any is on. */
.look-pop {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 260px;
  padding: 8px;
}

.look-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.look-row[hidden] {
  display: none;
}

.look-row + .look-row {
  padding-top: 6px;
  border-top: 1px solid var(--sv-border);
}

/* Styled like View ▾'s "Turn by itself" (shots.css .sv-turn): the box first, then its name. */
.look-switch {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 0 4px;
  font-weight: 550;
  cursor: pointer;
}

.look-switch input {
  order: -1;
}

/* See-through with nothing selected (look.js): unavailable, its name still readable. */
.look-switch:has(input:disabled) {
  color: var(--sv-muted);
}

.look-switch:has(input:disabled),
.look-switch input:disabled {
  cursor: default;
}

.look-switch input,
.look-cut__pos input {
  margin: 0;
  accent-color: var(--sv-accent);
  cursor: pointer;
}

.look-cut__tools {
  display: flex;
  gap: 6px;
}

.look-cut__axes {
  display: flex;
  flex: 1;
  gap: 2px;
}

#viewer .look-cut__axes button {
  flex: 1;
  padding: 0;
}

.look-cut__pos {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 4px;
  color: var(--sv-muted);
  font-size: 12px;
}

.look-cut__pos input {
  flex: 1;
  min-width: 0;
  height: 24px;
}

.look-cut__pos output {
  width: 3.5em;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* Cut off: its axis tools stay usable (a pick turns it on) but read as secondary; the position
   text keeps full contrast. */
.look-row.is-off .look-cut__tools {
  opacity: 0.6;
}

/* Dragging Position (look.js): all but its slider fades and lets clicks through, so the cut the
   popover covers shows. base.css drops the fade's transitions for reduced motion. */
.look-pop,
.look-row,
.look-row > * {
  transition: opacity 120ms ease-out, background-color 120ms ease-out, border-color 120ms ease-out, box-shadow 120ms ease-out;
}

.look-pop.is-scrubbing {
  border-color: transparent;
  background-color: transparent;
  box-shadow: none;
  pointer-events: none;
}

.look-pop.is-scrubbing .look-row:not(#look-cut),
.look-pop.is-scrubbing #look-cut > :not(.look-cut__pos) {
  opacity: 0.25;
}

.look-pop.is-scrubbing #look-cut {
  border-top-color: transparent;
}

.look-pop.is-scrubbing .look-cut__pos {
  border-radius: 8px;
  background: var(--sv-surface);
  box-shadow: var(--sv-shadow);
  pointer-events: auto;
}

#viewer .sv-dock #look-btn.is-on {
  color: var(--sv-accent);
  background: var(--sv-accent-soft);
}

/* 44px touch targets. */
@media (pointer: coarse) {
  .look-switch {
    min-height: 44px;
  }

  .look-switch input {
    width: 22px;
    height: 22px;
  }

  #viewer .look-cut__tools button {
    min-height: 44px;
  }

  .look-cut__pos input {
    height: 44px;
  }
}

/* Phones: as wide as the screen allows, above the toolbar's centre (dock.css). */
@media (max-width: 760px), (max-width: 1023px) and (max-height: 520px) and (min-aspect-ratio: 301/200) {
  .look-pop {
    width: min(320px, calc(100vw - 24px));
  }
}
