@font-face{font-family:Kitsune;src:url('/site-assets/NotoSans-Regular.woff2') format('woff2'),url('/site-assets/NotoSans-Regular.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:Kitsune;src:url('/site-assets/NotoSans-Bold.woff2') format('woff2'),url('/site-assets/NotoSans-Bold.ttf') format('truetype');font-weight:700;font-display:swap}
:root{color-scheme:dark;--bg:#0b101a;--panel:#111b29;--ink:#f3f0e9;--muted:#b6c2d1;--orange:#ffb373;--cyan:#a1d9dc;--line:#3d4b5e;--read-scale:1;font-family:Kitsune,system-ui,sans-serif;font-synthesis:none;background:var(--bg);color:var(--ink)}
*{box-sizing:border-box}[hidden]{display:none!important}html{scroll-padding-top:120px}body{margin:0;font-size:calc(1rem * var(--read-scale))}body[data-size=large]{--read-scale:1.15}body[data-size=largest]{--read-scale:1.3}body[data-contrast=true]{--bg:#000;--panel:#0b0b0b;--ink:#fff;--muted:#eee;--orange:#ffc48c;--cyan:#bff;--line:#a5a5a5}a{color:inherit;text-decoration:none}a:hover{color:var(--orange)}button{font:inherit;cursor:pointer}button:disabled{cursor:default;opacity:.45}a:focus-visible,button:focus-visible,summary:focus-visible{outline:3px solid var(--orange);outline-offset:5px}[tabindex='-1']:focus{outline:none}img{display:block;max-width:100%;height:auto}h1,h2,h3,p,figure{margin:0}h1,h2{font-weight:400;letter-spacing:-.045em;line-height:1.13}h1,h2[tabindex]{font-size:clamp(2.4rem,4.4vw,4.1rem)}h3{font-size:1.22em;line-height:1.4}p,li,dd{line-height:1.75}em{font-family:Georgia,serif;font-weight:400;color:var(--orange)}
.header{max-width:1540px;margin:auto;display:flex;align-items:center;justify-content:space-between;gap:24px;padding:20px 40px;border-bottom:1px solid var(--line);min-height:105px}.brand{display:flex;align-items:center;gap:15px;flex-shrink:0;font-weight:700;font-size:1.06em;letter-spacing:.06em}.brand img{width:64px;height:64px}.brand small{display:block;color:var(--muted);font-size:.57em;letter-spacing:.12em;margin-top:5px}.header-actions{display:flex;gap:22px;align-items:center;font-size:.8em}.development{color:var(--muted);white-space:nowrap}.dot{display:inline-block;width:6px;height:6px;border-radius:50%;background:var(--cyan);vertical-align:middle;margin-right:6px}.hub-layout{max-width:1540px;margin:auto;display:grid;grid-template-columns:250px minmax(0,1fr);gap:50px;padding:36px 40px 60px}.sidebar{position:sticky;top:24px;align-self:start}.sidebar nav{display:flex;flex-direction:column;gap:8px}.sidebar nav a{display:flex;align-items:center;gap:12px;min-height:52px;padding:12px 13px;border:1px solid transparent;font-size:.82em;border-radius:6px;line-height:1.5}.sidebar nav a>span{color:var(--muted);font-size:.78em;min-width:20px}.sidebar nav a small{font-size:.55em;letter-spacing:.08em;color:var(--cyan);margin-left:auto;white-space:nowrap}.sidebar nav a:hover{background:var(--panel)}.sidebar nav a[aria-current=page]{background:var(--panel);border-color:var(--line);color:var(--orange)}.menu-help,.sidebar-foot{color:var(--muted);font-size:.7em;line-height:1.8;margin:30px 13px 0}.sidebar-foot{border-top:1px solid var(--line);padding-top:25px}main{min-width:0}.panel{padding:20px 0 40px;scroll-margin-top:20px}.panel+.panel{margin-top:50px;border-top:1px solid var(--line);padding-top:50px}.js .panel{margin:0;border:0;padding-top:20px}.eyebrow,.index{font-size:.67em;font-weight:700;letter-spacing:.11em;line-height:1.7;color:var(--orange)}.eyebrow{margin-bottom:20px}.lead{font-size:1.03em;color:var(--muted);max-width:750px;margin-top:24px}.fine{font-size:.76em;color:var(--muted);margin-top:20px}.welcome-top{display:grid;grid-template-columns:1fr .85fr;align-items:center;gap:36px}.welcome-top h1{font-size:clamp(2.4rem,3.3vw,3.5rem)}.welcome-image img{width:100%;aspect-ratio:16/9;object-fit:contain;border:1px solid var(--line);border-radius:8px}.welcome-image figcaption{font-size:.63em;color:var(--muted);margin-top:10px;line-height:1.7}.menu-cards{display:grid;gap:14px;margin-top:38px}.menu-cards a{display:block;background:var(--panel);border:1px solid var(--line);border-radius:8px;padding:23px 26px}.menu-cards a:hover{border-color:var(--orange);color:var(--ink)}.menu-cards h2{font-size:1.35em;letter-spacing:-.02em;margin-top:10px;display:flex;align-items:center;justify-content:space-between;gap:20px}.menu-cards p{font-size:.83em;color:var(--muted);margin-top:9px}.menu-cards .play-card{border-color:#99633b;background:#211b19}body[data-contrast=true] .menu-cards .play-card{background:#111;border-color:var(--orange)}.notice{font-size:.78em;color:var(--muted);border-left:2px solid var(--orange);padding-left:18px;margin-top:26px}
.button,.quiet,.chip{display:inline-flex;align-items:center;justify-content:center;gap:14px;min-height:44px;padding:11px 18px;border:1px solid var(--line);border-radius:6px;font-size:.82em;line-height:1.5;background:var(--panel);color:var(--ink)}.primary{background:var(--orange);border-color:var(--orange);color:#101825;font-weight:700}.primary:hover{background:#ffd8b6;color:#101825}.secondary{color:var(--orange)}.secondary:hover,.quiet:hover,.chip:hover{border-color:var(--orange);color:var(--orange)}.chip[aria-pressed=true],#contrast-toggle[aria-pressed=true]{background:var(--orange);color:#101825;border-color:var(--orange)}.panel-actions{display:flex;gap:16px;align-items:center;flex-wrap:wrap;margin-top:25px}.info-copy{max-width:850px;margin-top:30px}.body-copy p{margin-bottom:22px;color:var(--muted)}.body-copy p:first-child{color:var(--ink)}.small-note{font-size:.8em;border-left:2px solid var(--orange);padding-left:18px}.pillars{display:grid;grid-template-columns:repeat(3,1fr);gap:28px;margin-block:36px}.pillars article{border-top:1px solid var(--line);padding-top:20px}.pillars .index{color:var(--cyan);font-size:.62em}.pillars h3{margin-block:15px}.pillars p{font-size:.83em;color:var(--muted)}.filter-row{display:flex;gap:10px;flex-wrap:wrap;margin-block:25px}.gallery-navigation{display:flex;align-items:center;justify-content:space-between;gap:16px;margin-block:20px}#gallery-status{font-size:.77em;color:var(--muted);text-align:center}.gallery{display:grid;grid-template-columns:1fr 1fr;gap:30px;margin-top:30px}.js .gallery{display:block;margin-top:0}.gallery figure{background:var(--panel);border:1px solid var(--line);border-radius:8px;overflow:hidden}.gallery figure>a{display:block;cursor:zoom-in}.gallery img{width:100%;aspect-ratio:16/9;object-fit:contain;background:#000}.gallery figcaption{padding:24px}.gallery figcaption h3{font-size:1.15em}.gallery figcaption p{font-size:.75em;color:var(--orange);margin-top:8px}.gallery figcaption span{display:block;font-size:.83em;color:var(--muted);margin-top:10px;line-height:1.7}.thumbnails{display:flex;flex-wrap:wrap;gap:10px;margin-top:18px}.thumbnail{border:2px solid var(--line);background:var(--panel);border-radius:5px;padding:3px;width:98px;min-height:56px}.thumbnail img{width:100%;aspect-ratio:16/9;object-fit:cover}.thumbnail[aria-pressed=true]{border-color:var(--orange)}
.prototype-cards{display:grid;grid-template-columns:1fr 1fr;gap:24px;margin-top:32px}.prototype-cards article{min-width:0;border:1px solid var(--line);background:var(--panel);border-radius:8px;padding:20px;display:flex;flex-direction:column;align-items:start}.prototype-art{width:100%;min-height:230px;padding:24px;display:flex;flex-direction:column;justify-content:space-between;border:1px solid var(--line);background:#17383b;color:#ffce84}.prototype-art span{font-size:.6em;font-weight:700;letter-spacing:.12em}.prototype-art strong{font-size:clamp(2.3rem,3.1vw,3.3rem);line-height:1.1;letter-spacing:-.04em}.starbase-art{background:#181d3e;color:#bbd3ff}.prototype-cards h3{margin-top:24px}.prototype-cards p{font-size:.86em;color:var(--muted);margin:14px 0 23px;flex:1}.prototype-cards .button{width:100%}.standalone-link{font-size:.75em;text-decoration:underline;text-underline-offset:4px;margin-top:18px;min-height:30px}.play-help{border-top:1px solid var(--line);margin-top:32px;padding-top:26px}.play-help p{font-size:.85em;color:var(--muted);margin-top:14px}details{border:1px solid var(--line);padding:16px 20px;border-radius:6px;margin-top:24px}summary{cursor:pointer;line-height:1.6;font-size:.9em;min-height:32px}.session-toolbar{display:flex;align-items:center;flex-wrap:wrap;gap:20px;margin:28px 0 18px}#game-status{font-size:.8em;color:var(--muted)}#game-host iframe{width:100%;height:760px;border:1px solid var(--line);border-radius:6px;background:#0b101a;display:block}.engine-facts{display:grid;max-width:800px;margin-block:35px}.engine-facts div{padding-block:18px;border-top:1px solid var(--line);display:flex;justify-content:space-between;gap:25px}dt{font-size:.83em;color:var(--muted)}dd{font-size:.83em;margin:0;text-align:right}#support .primary{margin-top:30px}.text-link{display:inline-block;min-height:44px;margin-top:25px;font-size:.85em;text-decoration:underline;text-underline-offset:5px}fieldset{border:1px solid var(--line);padding:14px 22px;max-width:650px;margin-block:30px 22px;border-radius:6px}legend{font-size:.9em;padding-inline:8px}fieldset .filter-row{margin:10px 0}#reset-reading{margin-top:20px}.access-list{padding-left:24px;margin-top:30px}.access-list li{font-size:.9em;color:var(--muted);margin-bottom:14px}
.skip{position:absolute;top:-100px;left:20px;z-index:100;background:var(--ink);color:var(--bg);padding:15px}.skip:focus{top:15px}.sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}dialog{width:min(1400px,95vw);max-height:95vh;border:1px solid var(--line);border-radius:8px;background:var(--bg);color:var(--ink);padding:24px;overflow:auto}dialog::backdrop{background:#000d}.dialog-header{display:flex;align-items:center;justify-content:space-between;gap:20px;margin-bottom:20px}.dialog-header h2{font-size:1.4em;letter-spacing:-.02em}dialog img{max-height:70vh;object-fit:contain;width:100%;background:#000}dialog p{font-size:.8em;color:var(--muted);margin-top:18px}
@media(min-width:1650px){.hub-layout{gap:65px;grid-template-columns:260px minmax(0,1fr)}}
@media(max-width:1100px){.header{padding-inline:24px}.hub-layout{grid-template-columns:210px minmax(0,1fr);padding-inline:24px;gap:28px}.welcome-top{grid-template-columns:1fr}.welcome-image{max-width:650px}.welcome-image img{aspect-ratio:16/9}.pillars{grid-template-columns:1fr}.prototype-art{min-height:205px;padding:18px}.prototype-cards{gap:16px}.prototype-cards article{padding:16px}.development{display:none}}
@media(max-width:760px){.header{position:sticky;top:0;z-index:5;background:var(--bg);padding:12px 20px;gap:12px;flex-wrap:wrap;min-height:85px}.brand{font-size:.94em;gap:10px}.brand img{width:46px;height:46px}.brand small{font-size:.55em}.header-actions{gap:10px;font-size:.8em}.header-actions .quiet{padding:9px 12px}.header-actions>a{padding:7px 4px}.hub-layout{display:block;padding:24px 20px 40px}.sidebar{position:static;border-bottom:1px solid var(--line);margin-bottom:26px;padding-bottom:20px}.sidebar nav a{min-height:48px;font-size:.95em}.sidebar .menu-help,.sidebar-foot{display:none}.js body[data-menu-open=false] .sidebar{display:none}.panel{padding:10px 0 30px}.js .panel{padding-top:5px}.welcome-top{gap:28px}.welcome-top h1,h2[tabindex]{font-size:clamp(2.1rem,7.5vw,3rem)}.eyebrow{font-size:.63em}.lead{font-size:.95em}.menu-cards{margin-top:26px}.menu-cards a{padding:20px}.menu-cards h2{font-size:1.2em}.gallery-navigation{gap:10px}.gallery-navigation .quiet{font-size:.72em;padding:10px}.gallery figcaption{padding:18px}.gallery{grid-template-columns:1fr}.thumbnail{width:80px;min-height:49px}.prototype-cards{grid-template-columns:1fr;gap:24px}.prototype-art{min-height:205px}.prototype-art strong{font-size:2.7rem}.engine-facts div{flex-direction:column;gap:6px}dd{text-align:left}.dialog-header{align-items:start}.dialog-header h2{font-size:1em}dialog{padding:16px}.dialog-header .button{font-size:.75em;padding:9px 12px}#game-host iframe{height:780px}.session-toolbar{align-items:start;gap:14px}}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important;transition:none!important;animation:none!important}}

@media(min-width:761px){#menu-toggle{display:none}}
@media(min-width:1101px){.menu-cards{grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.menu-cards a{padding:22px}.menu-cards h2{font-size:1.18em;align-items:start}}

/* Keep the whole playable surface and both thumbs in the visual viewport. */
body[data-prototype-active="true"] .header,body[data-prototype-active="true"] .sidebar,body[data-prototype-active="true"] #play>.eyebrow,body[data-prototype-active="true"] #play>h2,body[data-prototype-active="true"] #play>.lead{display:none}
body[data-prototype-active="true"] .hub-layout{display:block;max-width:none;padding:0}
body[data-prototype-active="true"] .panel{padding:0}
body[data-prototype-active="true"] #game-session{height:100vh;height:100dvh;display:flex;flex-direction:column}
body[data-prototype-active="true"] .session-toolbar{height:56px;min-height:56px;box-sizing:border-box;margin:0;padding:6px 10px;border-bottom:1px solid var(--line)}
body[data-prototype-active="true"] #game-status{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
body[data-prototype-active="true"] #game-host{flex:1;min-height:0}
body[data-prototype-active="true"] #game-host iframe{height:100%;border:0;border-radius:0}
body[data-prototype-active="true"] #game-session>.fine{display:none}
body[data-prototype-expanded="true"] .session-toolbar{display:none}

.music-room{max-width:760px;margin-top:28px;padding:24px;background:var(--panel);border:1px solid var(--line);border-radius:8px}.music-room label{display:block;margin-bottom:10px}.music-room select{width:100%;min-height:48px;padding:10px;border:1px solid var(--line);border-radius:5px;background:var(--bg);color:var(--ink);font:inherit}.music-room audio{display:block;width:100%;margin-top:20px}.music-room details{margin-top:24px}.music-room summary{min-height:44px;cursor:pointer}.midi-downloads{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;list-style:none;padding:0}.midi-downloads a{display:flex;align-items:center;min-height:44px;text-decoration:underline}.music-room select:focus-visible{outline:3px solid var(--orange);outline-offset:3px}@media(max-width:480px){.music-room{padding:16px}.midi-downloads{grid-template-columns:1fr}}

/* Phone hub: reachable routes, an overlay menu and room for the content. */
.button,.quiet,.chip,.thumbnail,.mobile-nav a,.sidebar nav a{touch-action:manipulation}
.mobile-nav{display:none}body[data-image-open=true]{overflow:hidden}
.gallery figure>a{touch-action:pan-y pinch-zoom}.gallery-touch-hint{display:none}
@media (max-width:760px), (max-width:1000px) and (max-height:500px) and (pointer:coarse){
 html{scroll-padding-top:calc(var(--hub-header-height,72px) + 12px)}
 body{padding-bottom:calc(76px + env(safe-area-inset-bottom,0px))}
 .header{position:sticky;top:0;z-index:8;background:var(--bg);min-height:72px;flex-wrap:nowrap;padding:max(10px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) 10px max(16px,env(safe-area-inset-left));gap:10px}
 .brand{font-size:.8em;min-width:0;flex-shrink:1;letter-spacing:.04em;line-height:1.25}.brand img{width:40px;height:40px;flex:none}.brand small{font-size:.56em;letter-spacing:.06em}
 .header-actions{flex:none}.header-actions>[data-route=accessibility]{display:none}#menu-toggle{display:inline-flex;align-items:center;justify-content:center;min-width:64px;min-height:44px;padding:8px 12px;font-size:14px}
 .hub-layout{display:block;padding:22px max(16px,env(safe-area-inset-right)) 24px max(16px,env(safe-area-inset-left))}
 .sidebar{position:static}
 .js body[data-menu-open=false] .sidebar{display:none}
 .js .panel{padding-top:5px}
 .js body[data-menu-open=true] .sidebar{position:fixed;z-index:10;top:calc(var(--hub-header-height,72px) + 8px);left:max(12px,env(safe-area-inset-left));right:max(12px,env(safe-area-inset-right));max-height:calc(100dvh - var(--hub-header-height,72px) - 100px - env(safe-area-inset-bottom,0px));overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:10px;background:var(--panel);padding:8px;margin:0;box-shadow:0 16px 45px #000a}
 .sidebar nav{gap:3px}.sidebar nav a{min-height:48px;padding:10px 12px;font-size:.9em}
 .mobile-nav{position:fixed;z-index:7;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));inset:auto 0 0;background:var(--bg);border-top:1px solid var(--line);padding:5px max(8px,env(safe-area-inset-right)) calc(5px + env(safe-area-inset-bottom,0px)) max(8px,env(safe-area-inset-left));gap:4px}
 .mobile-nav a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;min-height:54px;padding:4px 2px;font-size:12px;border:1px solid transparent;border-radius:7px;line-height:1.3}
 .mobile-nav svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}.mobile-nav a[aria-current=page]{color:var(--orange);background:var(--panel);border-color:var(--line)}
 .eyebrow{margin-bottom:12px}.welcome-top{gap:22px}.lead{margin-top:18px;line-height:1.65}.fine{font-size:.84em}.welcome-top .fine{margin-top:14px}.welcome-image img{aspect-ratio:16/9;object-fit:contain}.welcome-image figcaption{font-size:.75em}
 .panel-actions{gap:12px}.panel-actions .button{width:100%;justify-content:center;min-height:48px}.menu-cards{gap:12px}.menu-cards a{padding:18px}
 .filter-row{gap:8px}.chip,.quiet,.standalone-link,summary{min-height:44px}.standalone-link{display:inline-flex;align-items:center}
 .gallery-navigation{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;gap:10px;margin-block:16px}.gallery-navigation .quiet{padding:8px;font-size:18px;min-width:48px}.gallery-nav-label{display:none}#gallery-status{font-size:.84em;line-height:1.5}
 .gallery figcaption{padding:16px}.gallery figcaption span{font-size:.9em}.gallery figcaption p{font-size:.83em}.js .gallery-touch-hint{display:block;font-size:.8em;color:var(--muted);margin:10px 0 0}
 .thumbnails{flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;padding:4px 2px 10px;gap:8px;scrollbar-width:thin}.thumbnail{flex:0 0 76px;min-height:49px}
 .music-room{padding:16px}.music-room select{font-size:16px;min-width:0}.music-room audio{min-width:0}details{padding:14px}fieldset{min-width:0;padding-inline:14px}
 dialog[open]{position:fixed;inset:0;width:100%;max-width:none;height:100dvh;max-height:100dvh;margin:0;border:0;border-radius:0;padding:max(16px,env(safe-area-inset-top)) max(16px,env(safe-area-inset-right)) max(16px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));display:flex;flex-direction:column;gap:16px}
 .dialog-header{flex:none;gap:12px;margin:0}.dialog-header h2{font-size:1.1em;overflow-wrap:anywhere}.dialog-header .button{flex:none;min-height:44px}.dialog-header+p{margin:0}dialog img{flex:1;min-height:0;max-height:none;object-fit:contain}dialog p{flex:none;margin:0;font-size:.85em}
 body[data-prototype-active=true]{padding-bottom:0}body[data-prototype-active=true] .mobile-nav{display:none}
}
@media(max-width:380px){.welcome-top h1,h2[tabindex]{font-size:2rem}.brand small{letter-spacing:0}.prototype-art strong{font-size:2.3rem}}

/* Keep a whole screenshot in view before scrolling on a small phone. */
@media (max-width:760px), (max-width:1000px) and (max-height:500px) and (pointer:coarse){
 #gallery>h2{font-size:clamp(1.7rem,5.5vw,2.2rem)}#gallery>h2 br{display:none}
 #gallery>.lead{font-size:.9em;line-height:1.5;margin-top:12px}
 #gallery-tools>.filter-row{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:6px;margin:12px 0 0}
 #gallery-tools .gallery-navigation{margin:12px 0}
 #gallery-tools .chip{padding:8px 2px;font-size:.78em;line-height:1.25}
 body[data-size=largest] #gallery-tools>.filter-row{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media (max-width:1000px) and (max-height:500px) and (pointer:coarse){
 .header{min-height:52px;padding-top:max(4px,env(safe-area-inset-top));padding-bottom:4px}.brand img{width:32px;height:32px}.brand small{display:none}
 .mobile-nav{padding-top:2px;padding-bottom:calc(2px + env(safe-area-inset-bottom,0px))}.mobile-nav a{min-height:44px;gap:2px}
 body{padding-bottom:calc(60px + env(safe-area-inset-bottom,0px))}
 #gallery>.eyebrow,#gallery>.lead{display:none}#gallery>h2{position:absolute;width:1px;height:1px;margin:0;padding:0;overflow:hidden;clip-path:inset(50%)}
 #gallery-tools{display:flex;gap:16px;align-items:center;justify-content:space-between;margin-bottom:12px}
 #gallery-tools>.filter-row{flex:1;margin:0}#gallery-tools .gallery-navigation{width:42%;margin:0}
 #gallery .gallery img{height:calc(100dvh - 200px);aspect-ratio:auto;object-fit:contain}
}

/* The game owns its menu: the parent retains only a loading/error escape. */
body[data-prototype-active=true] .session-toolbar{position:absolute;z-index:30;top:8px;left:8px;height:auto;min-height:0;padding:0;background:none;border:0}
body[data-prototype-active=true][data-prototype-ready=true] .session-toolbar{display:none}

/* Keep every part of the fleet capture visible across mixed source ratios. */
.gallery figure[data-tags~=ships] img{object-fit:contain;background:#171f2b}

.original-image-link{flex:none;display:inline-flex;align-items:center;min-height:44px}
#gallery-credits{margin-top:20px}#gallery-credits a{overflow-wrap:anywhere}

/* The enlarged viewer shares the gallery selection and keeps controls in reach. */
#image-dialog[open]{display:flex;flex-direction:column;height:94dvh;max-height:94dvh;gap:10px;box-sizing:border-box}
#image-dialog .dialog-header{flex:none;margin:0}
#dialog-image{flex:1;min-height:60px;max-height:none;object-fit:contain;touch-action:pan-y pinch-zoom}
.viewer-navigation{flex:none;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px}
.viewer-navigation button{min-width:44px;min-height:44px;padding:8px 10px;font-size:.9em}
#viewer-status{margin:0;text-align:center;font-size:.85em;line-height:1.3}
.viewer-info{flex:none;min-width:0}#dialog-caption{margin:0}.viewer-info .original-image-link{margin-top:4px}
@media(max-width:760px),(max-width:1000px) and (max-height:500px) and (pointer:coarse){#image-dialog[open]{height:100dvh;max-height:100dvh}}
@media(max-height:500px){#image-dialog[open]{padding:8px;gap:8px}#image-dialog .dialog-header h2{font-size:1em}.viewer-info{display:flex;align-items:center;gap:12px}#dialog-caption{flex:1;font-size:12px}.viewer-info .original-image-link{flex:none;font-size:12px;margin:0}}

/* A full-window inspection stage keeps original pixels available at any zoom. */
#image-dialog[open]{position:fixed;inset:12px;margin:0;width:calc(100vw - 24px);max-width:none;height:calc(100dvh - 24px);max-height:none;padding:12px;gap:8px;overflow:hidden}
#image-dialog .dialog-header h2{font-size:1.05em;line-height:1.2;margin:0}
.viewer-toolbar{flex:none;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 16px}
.viewer-navigation{display:flex;flex:none;gap:8px}.viewer-navigation button,.viewer-zoom-controls button{min-width:44px;min-height:44px;padding:6px 10px;font-size:.85em}
#viewer-position{white-space:nowrap}.viewer-zoom-controls{display:flex;align-items:center;gap:6px;flex:none}.viewer-zoom-controls output{min-width:4.2ch;text-align:center;font-variant-numeric:tabular-nums;font-size:.85em}
#viewer-stage{position:relative;flex:1;min-height:80px;min-width:0;overflow:hidden;background:#000;touch-action:none;user-select:none;-webkit-user-select:none;cursor:default}
#viewer-stage[data-zoomed=true]{cursor:grab}#viewer-stage[data-dragging=true]{cursor:grabbing}#viewer-stage:focus-visible{outline:3px solid var(--orange);outline-offset:-3px}
#viewer-stage #dialog-image{position:absolute;left:50%;top:50%;display:block;flex:none;min-height:0;max-height:none;max-width:none;margin:0;object-fit:fill;transform-origin:center;pointer-events:none;will-change:transform}
.viewer-info{display:flex;align-items:flex-start;gap:12px}.viewer-info .original-image-link{margin:0;flex:none;font-size:.85em}#viewer-details{flex:1;min-width:0;margin:0;padding:0;border:0;background:none;font-size:.85em}#viewer-details summary{min-height:44px;display:list-item;padding:8px 0}#viewer-details[open]{max-height:25dvh;overflow:auto;overscroll-behavior:contain}#viewer-details p{margin:0 0 8px;font-size:1em;line-height:1.5}
@media(max-width:760px),(max-width:1000px) and (max-height:500px) and (pointer:coarse){#image-dialog[open]{inset:0;width:100vw;height:100dvh;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));border:0}.viewer-toolbar{justify-content:center}}

/* Keep every viewer control in the fullscreen modal, including phone safe areas. */
#image-dialog[data-fullscreen=true][open]{inset:0;width:100%;height:100dvh;max-height:100dvh;padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));border:0;border-radius:0}
.viewer-zoom-controls{flex-wrap:wrap;max-width:100%;justify-content:center}.viewer-fullscreen{display:inline-flex;align-items:center;justify-content:center}.viewer-fullscreen svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.viewer-fullscreen svg[hidden]{display:none}.viewer-fullscreen[aria-pressed=true]{color:var(--orange);border-color:var(--orange)}
