/* Shots ▾ (shots.js): Save this view, the saved shots (fly there, rename ✎, delete ✕), Play / Stop
   tour; and View ▾'s "Turn by itself" switch. */
.sv-shots {
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 260px;
}

/* Left-aligned: .sv-shots raises these past dock.css's centred `#viewer .sv-dock button`. */
#viewer .sv-shots .sv-shots__save,
#viewer .sv-shots .sv-shots__tour {
  justify-content: flex-start;
}

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

.sv-shots__list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: min(320px, 40vh);
  /* Room for the 2px focus ring at its 2px offset (base.css), which the scroller would clip; the
     negative margin keeps the rows where they were. */
  margin: -4px;
  padding: 4px;
  overflow-y: auto;
  list-style: none;
}

.sv-shots__row {
  display: flex;
  align-items: center;
  gap: 2px;
}

#viewer .sv-shots .sv-shots__go {
  flex: 1;
  min-width: 0;
  justify-content: flex-start;
  font-weight: 450;
}

.sv-shots__go span {
  overflow: hidden;
  text-overflow: ellipsis;
}

#viewer .sv-shots__icon {
  flex: none;
  width: 32px;
  padding: 0;
  color: var(--sv-muted);
}

#viewer .sv-shots__name {
  flex: 1;
  min-width: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--sv-border-strong);
  border-radius: 8px;
  background: var(--sv-surface);
}

.sv-shots__empty {
  margin: 4px 12px;
  color: var(--sv-faint);
  font-size: 13px;
}

@media (pointer: coarse) {
  #viewer .sv-shots button,
  #viewer .sv-shots__name {
    min-height: 44px;
  }

  #viewer .sv-shots__icon {
    width: 44px;
  }
}

@media (max-width: 760px), (max-width: 1023px) and (max-height: 520px) and (min-aspect-ratio: 301/200) {
  .sv-shots {
    width: min(360px, calc(100vw - 24px));
  }
}

/* The stage's "Tour playing" pill: the hidden/isolated pill (viewport.css .sv-visibility), 12 px
   under it when both show; a notice (.sv-toast) covers it while it shows. */
.sv-tour {
  z-index: 2;
}

.sv-stage:has(.sv-visibility:not([hidden], .sv-tour)) .sv-tour {
  top: calc(56px + 34px + 12px);
}

@media (pointer: coarse) {
  .sv-stage:has(.sv-visibility:not([hidden], .sv-tour)) .sv-tour {
    top: calc(56px + 52px + 12px);
  }
}

@media (max-width: 760px), (max-width: 1023px) and (max-height: 520px) and (min-aspect-ratio: 301/200) {
  .sv-stage:has(.sv-visibility:not([hidden], .sv-tour)) .sv-tour {
    top: calc(max(10px, env(safe-area-inset-top)) + 76px + 46px);
  }

  @media (pointer: coarse) {
    .sv-stage:has(.sv-visibility:not([hidden], .sv-tour)) .sv-tour {
      top: calc(max(10px, env(safe-area-inset-top)) + 76px + 64px);
    }
  }
}

/* View ▾: the presets in a row, "Turn by itself" under them. */
.sv-dock__toggle[aria-expanded="true"] + #sv-dock-views {
  display: grid;
  grid-template-columns: repeat(4, auto);
}

.sv-turn {
  display: flex;
  grid-column: 1 / -1;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  margin-top: 2px;
  padding: 0 12px;
  border-top: 1px solid var(--sv-border);
  font-weight: 550;
  cursor: pointer;
}

.sv-turn input {
  margin: 0;
  accent-color: var(--sv-accent);
}

@media (pointer: coarse) {
  .sv-turn {
    min-height: 44px;
  }

  .sv-turn input {
    width: 22px;
    height: 22px;
  }
}
