:root {
  color-scheme: dark;
  --bg: #0f172a;
  --surface: #1e293b;
  --raised: #263449;
  --line: #38465c;
  --text: #f1f5f9;
  --muted: #b6c2d3;
  --accent: #c4b5fd;
  --primary: #7c3aed;
  --green: #6ee7b7;
  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--text); font: .875rem/1.5 var(--font); height: 100svh; display: flex; flex-direction: column; }
button, input { font: inherit; }
button, a, input, summary { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled { cursor: default; opacity: .38; }
a { color: var(--accent); text-underline-offset: .22em; }
a:hover { color: #e1d9ff; }
button:focus-visible, a:focus-visible, summary:focus-visible, input:focus-visible, [tabindex]:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; }
::selection { background: #6d28d9; color: white; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; clip-path: inset(50%); overflow: hidden; white-space: nowrap; }
.skip-link { position: absolute; left: 16px; top: -90px; background: var(--surface); padding: 12px; z-index: 20; }
.skip-link:focus { top: 8px; }
.topbar { min-height: 56px; padding: 8px 24px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid var(--line); }
.identity { display: flex; align-items: center; gap: 14px; flex-shrink: 0; }
.brand { color: var(--text); text-decoration: none; font-size: 1rem; font-weight: 800; }
.brand-divider { width: 1px; height: 16px; background: var(--line); }
h1 { font-size: .875rem; font-weight: 550; margin: 0; }
.tagline { color: var(--muted); margin: 0; font-size: .75rem; }
nav { margin-left: auto; display: flex; gap: 20px; }
nav a { color: var(--muted); font-size: .75rem; padding: 8px 0; }
main { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 0 24px; }
.search-desk { padding: 16px 0 4px; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 4px 4px 4px 16px; background: var(--surface); border: 1px solid #60718a; border-radius: 8px; }
.search-field:focus-within { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.search-field>svg { width: 22px; height: 22px; fill: none; stroke: var(--muted); stroke-width: 1.6; flex-shrink: 0; }
.search-field input { flex: 1; width: 0; min-width: 0; height: 44px; background: transparent; border: 0; outline: none; color: var(--text); font-size: 1rem; caret-color: var(--green); }
.search-field input:focus-visible { outline: none; }
input::placeholder { color: var(--muted); opacity: 1; }
kbd { font: .75rem var(--font); border: 1px solid var(--line); border-radius: 4px; padding: 1px 6px; color: var(--muted); }
#submit-search { min-height: 44px; padding: 0 24px; background: var(--primary); border: 0; border-radius: 5px; color: #fff; font-weight: 650; }
#submit-search:hover { background: #6d28d9; }
.search-under { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.examples { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.examples>span { color: var(--muted); font-size: .6875rem; margin-right: 4px; }
.examples button { border: 0; padding: 8px 6px; min-height: 36px; background: none; color: var(--muted); font-size: .75rem; text-decoration: underline; text-decoration-color: #60718a; text-underline-offset: 4px; }
.examples button:hover { color: var(--accent); }
#search-hint { font-size: .6875rem; color: var(--muted); margin: 0; flex-shrink: 0; }
.filterbar { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); gap: 12px; min-height: 48px; }
.filters { display: flex; gap: 4px; min-width: 0; }
.filters button { min-height: 44px; padding: 8px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--muted); white-space: nowrap; font-size: .8125rem; }
.filters button:first-child { padding-left: 4px; }
.filters button:hover { color: var(--text); }
.filters button[aria-pressed=true] { border-color: var(--accent); color: var(--accent); font-weight: 650; }
.filters span { font-size: .6875rem; margin-left: 4px; font-variant-numeric: tabular-nums; }
.text-button { border: 0; background: none; color: var(--accent); padding: 8px 0; min-height: 44px; font-size: .75rem; white-space: nowrap; }
.atlas { display: grid; grid-template-columns: var(--shelf-width, 38%) 18px minmax(0, 1fr); flex: 1; min-height: 0; gap: 0; }
.shelf { display: flex; flex-direction: column; min-height: 0; min-width: 0; padding-top: 16px; }
.shelf-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.shelf-meta { display: flex; align-items: center; gap: 12px; }
.shelf-meta #reset { min-height: 32px; padding: 4px 0; font-size: .6875rem; }
.shelf-heading h2 { margin: 0; font-size: .875rem; font-weight: 600; }
#count-flow { color: var(--accent); font-variant-numeric: tabular-nums; font-size: .75rem; }
#status { color: var(--muted); font-size: .6875rem; margin: 4px 0 12px; min-height: 17px; }
.shelf-scroll { overflow: auto; flex: 1; min-height: 0; padding: 6px 8px 12px 0; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #51627c transparent; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 12px; align-content: start; }
.slide-card { min-width: 0; padding: 0; background: none; border: 0; text-align: left; position: relative; display: flex; flex-direction: column; isolation: isolate; border-radius: 4px; }
.slide-paper { display: block; aspect-ratio: 16/9; position: relative; width: 100%; background: var(--raised); border: 1px solid #596478; border-radius: 4px; transform-origin: 10% 90%; }
.slide-paper::before, .slide-paper::after { content: ''; position: absolute; inset: -4px 4px 4px; border: 1px solid #536179; border-radius: 4px; background: #263247; z-index: -1; }
.slide-paper::before { inset: -7px 8px 7px; background: #1a263b; }
.slide-paper img { width: 100%; height: 100%; display: block; object-fit: cover; border-radius: 3px; }
.slide-card.is-selected .slide-paper { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.slide-card.is-hovered .slide-paper { border-color: var(--green); }
.card-rank { position: absolute; left: 5px; top: 5px; min-width: 23px; padding: 1px 5px; border-radius: 3px; background: #0f172ae8; color: #fff; font-size: .6875rem; font-variant-numeric: tabular-nums; }
.card-state { position: absolute; right: 5px; bottom: 5px; background: #45316b; color: #fff; font-size: .6875rem; padding: 1px 5px; border-radius: 3px; }
.card-label { font-size: .8125rem; font-weight: 550; margin-top: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.35; overflow-wrap: anywhere; }
.card-caption { color: var(--muted); font-size: .6875rem; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; margin-top: 3px; }
.slide-card.is-selected .card-label { color: var(--accent); }
.more { display: block; width: 100%; min-height: 44px; margin-top: 20px; border: 1px solid var(--line); border-radius: 5px; background: transparent; font-size: .75rem; color: var(--muted); }
.more:hover { border-color: var(--accent); color: var(--accent); }
.shelf-hint { color: var(--muted); font-size: .6875rem; margin: 8px 0; flex-shrink: 0; }
.shelf-hint span { margin: 0 4px; }
.viewer { min-width: 0; min-height: 0; overflow: auto; padding: 10px 0 16px 24px; border-left: 1px solid var(--line); scrollbar-width: thin; scrollbar-color: #51627c transparent; }
.viewer-top { position: sticky; top: 0; z-index: 3; background: var(--bg); display: flex; justify-content: space-between; align-items: center; min-height: 44px; gap: 8px; }
.view-meta { display: flex; gap: 12px; align-items: center; color: var(--muted); font-size: .6875rem; white-space: nowrap; }
#view-mode { color: var(--green); }
#view-position { font-variant-numeric: tabular-nums; }
.viewer-tools { display: flex; gap: 4px; align-items: center; }
.viewer-tools button { min-width: 36px; min-height: 36px; padding: 6px 10px; background: none; border: 1px solid var(--line); border-radius: 4px; font-size: .6875rem; display: flex; align-items: center; justify-content: center; gap: 6px; }
.viewer-tools button:hover:not(:disabled) { background: var(--raised); border-color: #71819a; }
.viewer-tools svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.viewer-heading { margin: 8px 0 10px; }
.viewer-info { margin-bottom: 20px; }
.viewer-heading h2 { font-size: 1.25rem; letter-spacing: -.02em; line-height: 1.35; margin: 0; overflow-wrap: anywhere; text-wrap: balance; }
#viewer-subtitle { font-size: .75rem; color: var(--muted); margin: 5px 0 0; }
.stage-wrap { padding: 0 8px 8px 0; }
.page-stack { position: relative; isolation: isolate; perspective: 1400px; }
.page-stack::before, .page-stack::after { content: ''; position: absolute; inset: 5px -4px -5px 4px; background: #596073; border: 1px solid #737d92; border-radius: 5px; z-index: -1; }
.page-stack::before { inset: 9px -8px -9px 8px; background: #2b384d; border-color: #48566d; }
.stage { position: relative; width: 100%; aspect-ratio: 16/9; background: var(--surface); border-radius: 5px; border: 1px solid #7b8495; overflow: hidden; transform-origin: left center; box-shadow: 0 12px 28px #050a1540; }
#preview-image { display: block; width: 100%; height: 100%; object-fit: contain; }
#live-host { position: absolute; inset: 0; background: var(--surface); }
#live-host iframe { display: block; width: 100%; height: 100%; border: 0; }
.stage-empty { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; color: var(--muted); padding: 20px; text-align: center; }
.stage-empty svg { width: 100px; height: 70px; stroke: #71819a; stroke-width: 1; fill: none; }
.stage-empty p { margin: 0; font-size: .8125rem; }
.stage-play { position: absolute; right: 12px; bottom: 12px; display: flex; gap: 7px; align-items: center; min-height: 40px; padding: 8px 12px; border: 1px solid #b9a3ed; border-radius: 5px; background: #362455; color: #fff; font-size: .75rem; box-shadow: 0 4px 12px #0004; }
.stage-play:hover { background: #4b3475; }
.stage-play svg { width: 14px; height: 14px; fill: currentColor; }
#hover-label { position: absolute; left: 12px; top: 12px; background: #0f172aed; color: var(--green); padding: 4px 8px; border-radius: 4px; font-size: .6875rem; }
#live-status { font-size: .6875rem; color: var(--muted); min-height: 17px; margin: 8px 0; }
.quick-description { display: flex; gap: 16px; justify-content: space-between; align-items: flex-start; }
#description { font-size: .8125rem; color: var(--muted); margin: 0; max-width: 65ch; }
#source-link { font-size: .75rem; padding: 0 0 8px; flex-shrink: 0; min-height: 36px; }
#reason-block { margin-top: 8px; }
#reason-block h3 { display: none; font-size: .6875rem; font-weight: 500; color: var(--muted); margin: 0 0 5px; }
#reason { color: var(--green); margin: 0; font-size: .8125rem; max-width: 70ch; }
.criteria { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.criterion { border: 1px solid var(--line); padding: 2px 6px; border-radius: 3px; font-size: .6875rem; color: var(--muted); }
.criterion.negative { color: #fcd34d; }
.trace { font-size: .75rem; color: var(--muted); margin-top: 4px; }
summary { cursor: pointer; padding: 10px 0; min-height: 36px; }
summary:hover { color: var(--accent); }
.trace ul { padding-left: 18px; margin: 0; }
.trace li { margin: 7px 0; overflow-wrap: anywhere; }
#guidance { margin-bottom: 12px; padding: 8px 10px; background: var(--surface); border-radius: 4px; font-size: .75rem; }
#guidance p { margin: 0; color: var(--muted); }
#guidance button { border: 0; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: .6875rem; min-height: 32px; padding: 5px 8px 5px 0; }
.empty { grid-column: 1/-1; padding: 24px 8px; }
.empty h3 { font-size: 1rem; margin: 0 0 8px; }
.empty p { color: var(--muted); margin: 0 0 16px; font-size: .8125rem; }
.empty button, .retry { background: var(--primary); color: white; padding: 10px 14px; min-height: 44px; border: 0; border-radius: 5px; }
.notice { padding: 16px; background: var(--surface); }
footer { display: flex; justify-content: space-between; padding: 8px 24px; border-top: 1px solid var(--line); color: var(--muted); font-size: .6875rem; }
#flight-layer { position: fixed; inset: 0; pointer-events: none; z-index: 10; overflow: hidden; }
.flying-page { position: absolute; pointer-events: none; transform-origin: left bottom; }
.flying-page img { width: 100%; aspect-ratio: 16/9; border-radius: 4px; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .slide-paper { transition: transform 180ms cubic-bezier(.16,1,.3,1), box-shadow 180ms; }
  .slide-card:hover .slide-paper { transform: translateY(-4px) rotate(-1.5deg); box-shadow: 0 8px 14px #0005; }
}
@media (min-width: 1000px) {
  .atlas.focus-mode { grid-template-columns: 184px 18px minmax(0,1fr); }
  .focus-mode .cards { grid-template-columns: 1fr; }
  .focus-mode .stage-wrap { max-width: min(100%, 1280px); margin-inline: auto; }
  .focus-mode .viewer-heading h2 { font-size: 1.125rem; }
}
@media (min-width: 761px) and (min-height: 621px) {
  .stage-wrap { max-width: min(100%, calc((100svh - 565px) * 1.7778)); margin-inline: auto; }
}
@media (max-width: 999px) {
  .viewer-tools .expand { display: none; }
}
@media (max-width: 1150px) {

  .cards { grid-template-columns: repeat(2,minmax(0,1fr)); }
  .viewer { padding-left: 16px; }
  .tagline, #search-hint { display: none; }
}
@media (max-width: 760px) {
  body { height: auto; min-height: 100svh; }
  main { min-height: auto; padding: 0 12px; }
  .topbar { min-height: 44px; padding: 4px 12px; gap: 8px; }
  .identity { gap: 8px; }
  nav { gap: 12px; }
  nav a { font-size: .6875rem; }
  .search-desk { padding-top: 10px; }
  .search-field { gap: 8px; padding-left: 10px; }
  .search-field>svg, .search-field>kbd { display: none; }
  #submit-search { padding-inline: 16px; }
  .search-under { overflow: auto; scrollbar-width: none; }
  .examples { flex-wrap: nowrap; white-space: nowrap; gap: 8px; }
  .examples>span { display: none; }
  .examples button { min-height: 40px; }
  .filterbar { flex-wrap: wrap; gap: 0; padding-bottom: 0; }
  .filters { width: 100%; justify-content: space-between; }
  .filters button { padding: 8px 6px; font-size: .75rem; }
  .filters span { margin-left: 2px; }
  .shelf-meta { gap: 10px; }
  #guidance { display: flex; align-items: center; gap: 6px; overflow: auto; white-space: nowrap; padding: 4px 8px; margin-bottom: 4px; }
  #guidance p { display: none; }
  #guidance button { flex-shrink: 0; }
  .atlas { display: flex; flex-direction: column; gap: 0; min-height: auto; }
  .shelf { padding-top: 10px; }
  .shelf-heading h2 { font-size: .8125rem; }
  #status { margin-bottom: 5px; }
  .shelf-scroll { display: flex; flex: none; gap: 12px; padding: 8px 2px 8px; scroll-snap-type: x proximity; }
  .cards { display: flex; gap: 12px; flex-shrink: 0; }
  .slide-card { width: 142px; flex-shrink: 0; scroll-snap-align: start; }
  .card-label { -webkit-line-clamp: 1; font-size: .75rem; }
  .card-caption { display: none; }
  .more { width: 100px; flex-shrink: 0; margin: 0; padding: 8px; font-size: .75rem; }
  .shelf-hint { display: none; }
  .viewer { border-left: 0; border-top: 0; padding: 6px 0 16px; overflow: visible; min-height: auto; }
  .viewer-heading { margin: 4px 0 10px; }
  .viewer-info { margin-bottom: 16px; }
  .viewer-heading h2 { font-size: 1.125rem; }
  .viewer-tools button { min-height: 44px; min-width: 44px; }
  .viewer-tools .expand { display: none; }
  #close-live kbd { display: none; }
  #source-link { min-height: 44px; }
  .stage-play { min-height: 44px; right: 8px; bottom: 8px; }
  .keyboard-hint { display: none; }
  .empty { white-space: normal; width: min(330px, calc(100vw - 32px)); }
  footer { padding: 10px 12px; }
  footer>span:last-child { display: none; }
}
@media (max-height: 620px) and (min-width: 761px) {
  body { height: auto; min-height: 100svh; }
  .atlas { min-height: 420px; }
  .shelf-scroll { max-height: 65svh; }
  .viewer { overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* The top desk explains the search; the lower divider allocates reading space. */
.discovery-desk { display: grid; grid-template-columns: minmax(260px, .32fr) minmax(0, .68fr); gap: 16px; padding-top: 8px; flex-shrink: 0; }
.search-desk { min-width: 0; padding: 4px 0 0; }
.search-under { display: block; }
#search-hint { margin-top: 8px; }
.ontology-panel { min-width: 0; border-left: 1px solid var(--line); padding-left: 20px; }
.graph-heading { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.graph-heading h2 { font-size: .75rem; margin: 0; font-weight: 600; }
.graph-tools { display: flex; gap: 4px; }
.graph-tools button { background: transparent; color: var(--muted); border: 1px solid transparent; border-radius: 4px; min-height: 32px; padding: 4px 8px; font-size: .6875rem; }
.graph-tools button[aria-pressed=true] { border-color: var(--line); color: var(--accent); }
.graph-canvas { height: 142px; position: relative; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #60718a transparent; }
#ontology-graph { display: block; width: 100%; height: 100%; overflow: hidden; }
.ontology-panel[data-mode=proof] #ontology-graph { min-width: 0; }
.atlas.focus-mode #pane-divider { visibility: hidden; }
.graph-links path { fill: none; stroke: #9f8dce; stroke-width: .7; opacity: .17; }
.graph-node circle { fill: var(--accent); }
.graph-node.facet circle { fill: var(--green); }
.graph-node.slide circle { fill: #b6c2d3; }
.graph-node.query circle, .graph-node.evidence circle { fill: #fcd34d; }
.graph-node { transition: opacity 200ms ease; }
.graph-node:hover circle { stroke: white; stroke-width: 3; }
.graph-label { fill: var(--text); font-size: 13px; font-family: var(--font); font-weight: 550; }
.graph-sub { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.ontology-panel[data-mode=proof] .graph-links path { stroke: var(--green); opacity: .55; stroke-width: 1.3; }
.graph-columns { position: absolute; inset: auto 0 0; display: grid; grid-template-columns: repeat(3,1fr); text-align: center; color: var(--muted); font-size: .625rem; pointer-events: none; }
#graph-summary { margin: 4px 0 8px; color: var(--muted); font-size: .6875rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#graph-empty { position: absolute; inset: 40% 0 auto; text-align: center; margin: 0; font-size: .75rem; }
#pane-divider { cursor: col-resize; touch-action: none; position: relative; outline-offset: -3px; }
#pane-divider::before { content: ''; position: absolute; width: 1px; inset: 0 auto 0 8px; background: var(--line); }
#pane-divider span { display: block; position: absolute; width: 5px; height: 36px; top: 45%; left: 6px; border-radius: 4px; background: #60718a; }
#pane-divider:hover span, #pane-divider:focus-visible span, .resizing #pane-divider span { background: var(--accent); }
.resizing { user-select: none; cursor: col-resize; }
.resizing iframe { pointer-events: none; }
.viewer { border-left: 0; padding-left: 16px; }
@media (max-width: 1000px) and (min-width: 761px) {
  .discovery-desk { gap: 14px; }
  .ontology-panel { padding-left: 12px; }
  .search-field>svg, .search-field>kbd { display: none; }
  .search-field input { font-size: .875rem; }
  #submit-search { padding-inline: 14px; }
}
@media (max-width: 760px) {
  .discovery-desk { display: flex; flex-direction: column; gap: 6px; padding-top: 0; }
  .search-desk { padding-top: 10px; }
  .ontology-panel { border: 0; border-top: 1px solid var(--line); padding: 6px 0 0; }
  .graph-canvas { height: 124px; }
  .graph-tools button { min-height: 36px; }
  #graph-summary { margin-bottom: 4px; }
  #pane-divider { display: none; }
  .viewer { padding-left: 0; }
}

.graph-pan-hint { display: none; color: var(--muted); font-size: .625rem; margin: 0; }


.search-field { gap: 8px; padding: 3px 3px 3px 10px; border-radius: 6px; }
.search-field input { height: 32px; font-size: .8125rem; }
.search-field>svg { width: 17px; height: 17px; }
.search-field>kbd { display: none; }
#submit-search { min-height: 32px; padding-inline: 14px; font-size: .75rem; }
.examples { gap: 0 6px; }
.examples>span { display: none; }
.examples button { min-height: 28px; padding: 4px 0; font-size: .6875rem; }
#search-hint { margin-top: 4px; }
.graph-tools button { min-height: 28px; }
@media (max-width: 760px) {
  .search-field input { height: 36px; font-size: 1rem; }
  #submit-search { min-height: 36px; }
  .graph-tools button { min-height: 36px; }
  .examples button { min-height: 32px; }
}

/* Keep the slide header to a title row and a single-line summary. */
.shelf { container-type: inline-size; }
@container (max-width: 310px) { .cards { grid-template-columns: 1fr; } .shelf-heading { flex-wrap: wrap; gap: 0; } .shelf-hint { display: none; } }
.viewer-top { flex-shrink: 0; min-height: 36px; gap: 8px; }
.view-meta { min-width: 0; gap: 8px; }
.viewer-heading { min-width: 0; margin: 0; }
.viewer-heading h2, .focus-mode .viewer-heading h2 { font-size: 1rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#viewer-subtitle, #view-mode { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.viewer-tools { flex-shrink: 0; }
.viewer-tools #source-link { min-height: 32px; padding: 6px 4px; font-size: .6875rem; display: flex; align-items: center; }
.viewer-info { margin: 2px 0 10px; flex-shrink: 0; }
#reason-block { margin: 0; }
#description, #reason { font-size: .75rem; line-height: 1.4; max-width: none; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.viewer-info.has-query .quick-description { display: none; }
#live-status { margin: 5px 0 0; line-height: 1.3; min-height: 14px; flex-shrink: 0; }
.trace { flex-shrink: 0; }
.trace summary { padding: 5px 0; min-height: 28px; }
@media (min-width: 761px) and (min-height: 621px) {
  .viewer { display: flex; flex-direction: column; padding-bottom: 8px; }
  .stage-wrap, .focus-mode .stage-wrap { container-type: size; flex: 1; min-height: 160px; width: 100%; max-width: none; margin: 0; padding: 0 8px 12px 0; }
  .page-stack { width: min(100%, calc(100cqh * 1.7777778)); margin-inline: auto; }
}
@media (max-width: 760px) {
  .viewer-top { flex-wrap: wrap; gap: 2px 8px; }
  .viewer-heading h2 { font-size: .9375rem; }
  .viewer-tools { margin-left: auto; }
  .viewer-tools #source-link { min-height: 44px; }
  .viewer-info { margin-bottom: 10px; }
}
