/* Real miniature pages resting on the left canvas, not a second editor. */
.script-map,
.script-map-toggle {
  position: fixed;
  left: 14px;
  z-index: 30;
  color: var(--v21-ink, var(--ink, #282b29));
  font-family: var(--ui, system-ui, sans-serif);
}
.script-map-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100px;
  min-height: 30px;
  padding: 6px 10px;
  border: 0;
  border-radius: var(--xd-control-radius, 8px);
  background: color-mix(in srgb, var(--surface, #fff) 76%, transparent);
  font: 600 12px/1.35 var(--ui, system-ui, sans-serif);
  cursor: pointer;
}
.script-map-toggle::after { content: '+'; font-size: 15px; font-weight: 400; opacity: .6; }
.script-map-toggle[aria-expanded="true"]::after { content: '−'; }
.script-map-toggle:hover { background: color-mix(in srgb, var(--surface, #fff) 94%, transparent); }
.script-map {
  width: 110px;
  bottom: 78px;
  display: flex;
  flex-direction: column;
  min-height: 0;
}
.script-map[hidden] { display: none; }
.script-map-count {
  flex: none;
  padding: 0 8px 10px;
  font-size: 10px;
  line-height: 1.4;
  font-weight: 500;
  opacity: .68;
}
.script-map-list {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, currentColor 22%, transparent) transparent;
  margin: 0;
  padding: 3px 10px 14px 5px;
  list-style: none;
  scroll-behavior: auto;
}
.script-map-list > li { margin: 0 0 14px; padding: 0; }
.script-map-page {
  appearance: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: 500 10px/1.3 var(--ui, system-ui, sans-serif);
  text-align: center;
}
.script-map-preview {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 8.5 / 11;
  overflow: hidden;
  border-radius: 1px;
  background: #fff;
  box-shadow: 3px 2px 6px rgb(18 22 24 / 18%);
  pointer-events: none;
  user-select: none;
  contain: layout paint;
}
.script-map-page-label { opacity: .65; }
.script-map-preview:not([data-rendered]) { visibility: hidden; }
.script-map-page[aria-current="page"] .script-map-preview {
  outline: 2px solid var(--v21-accent, var(--rose, #a95553));
  outline-offset: 2px;
}
.script-map-page[aria-current="page"] .script-map-page-label { opacity: 1; font-weight: 700; }
.script-map-page:hover .script-map-page-label { opacity: 1; }
.script-map-toggle:focus-visible,
.script-map-page:focus-visible { outline: 2px solid currentColor; outline-offset: 4px; }

/* Tools retain the accepted shared camera composition; the map steps aside. */
html.booting :is(.script-map, .script-map-toggle),
body:is(.ghost-mode, [data-ghost="true"], .project-shelf-open, .file-commands-open, .experience-open, .settings-open, .palette-open, .storygit-open) :is(.script-map, .script-map-toggle) {
  display: none !important;
}
@media (max-width: 1099px) {
  .script-map, .script-map-toggle { left: 10px; }
  .script-map { width: 104px; bottom: 70px; }
  .script-map-toggle { width: 96px; }
}
@media (prefers-reduced-motion: reduce) {
  body:not(.pref-full-motion) .script-map, body:not(.pref-full-motion) .script-map * { scroll-behavior: auto !important; }
}
@media print {
  .script-map, .script-map-toggle { display: none !important; }
}
