/* SI-assisted: written with Claude (Anthropic) during the 2026 NASA Space Apps Challenge. */
/* Gallery B2. Tokens and sizes from design/B2-mockup.dc.html; skeleton from the apple-hig-web skill. */

:root{
  --bg:#f5f5f7;--solid:#ffffff;--panel:rgba(245,245,247,.72);--line:rgba(0,0,0,.1);--fill:rgba(0,0,0,.05);
  --track:rgba(118,118,128,.12);--thumb:#ffffff;--text:#1d1d1f;--soft:#424245;--muted:#6e6e73;--acc:#0066cc;
  --btn:#0071e3;--on-btn:#ffffff;--chip-on:#1d1d1f;--on-chip:#ffffff;--warn:#7d4a00;--warnbg:rgba(154,91,0,.1);
  --ring:rgba(0,0,0,.08);--focus:#0066cc;--ok:#1f7a3a;--ph:#e8e8ed;--panel-pop:rgba(245,245,247,.94);
  --hover:rgba(118,118,128,.2);--press:rgba(118,118,128,.28);--btn-press:#0060c4;--chip-on-press:#48484a;--thumb-press:#e5e5ea;--chip-line:rgba(0,0,0,.45);
  --hdr-h:56px;--dock-h:62px;
  --motion:cubic-bezier(.2,.8,.2,1);
  color-scheme:light dark;
}
@media (prefers-color-scheme:dark){
  :root{
    --bg:#000000;--solid:#1c1c1e;--panel:rgba(28,28,30,.72);--line:rgba(255,255,255,.12);--fill:rgba(255,255,255,.08);
    --track:rgba(118,118,128,.24);--thumb:#636366;--text:#f5f5f7;--soft:#d2d2d7;--muted:#a1a1a6;--acc:#2997ff;
    --btn:#0071e3;--on-btn:#ffffff;--chip-on:#f5f5f7;--on-chip:#000000;--warn:#ffd60a;--warnbg:rgba(255,214,10,.14);
    --ring:rgba(255,255,255,.1);--focus:#5eb0ff;--ok:#30d158;--ph:#1c1c1e;--panel-pop:rgba(28,28,30,.94);
    --hover:rgba(118,118,128,.34);--press:rgba(118,118,128,.44);--btn-press:#0060c4;--chip-on-press:#c7c7cc;--thumb-press:#7a7a7e;--chip-line:rgba(255,255,255,.4);
  }
}
/* Increased contrast: muted text and borders get stronger, panels turn solid (skill §6). */
@media (prefers-contrast:more){
  :root{--muted:#48484a;--soft:#2c2c2e;--line:rgba(0,0,0,.6);--ring:rgba(0,0,0,.55);--fill:rgba(0,0,0,.1);--track:#e3e3e8;--warn:#7a4800;--acc:#004fa3;--btn:#0060c4;--btn-press:#004a99;--chip-line:rgba(0,0,0,.6)}
}
@media (prefers-contrast:more) and (prefers-color-scheme:dark){
  :root{--muted:#d1d1d6;--soft:#f2f2f7;--line:rgba(255,255,255,.65);--ring:rgba(255,255,255,.6);--fill:rgba(255,255,255,.16);--track:#3a3a3c;--warn:#ffe066;--acc:#64b5ff;--btn:#0060c4;--btn-press:#004a99;--chip-line:rgba(255,255,255,.65)}
}

*{box-sizing:border-box}
html,body{margin:0;height:100%;overflow:hidden}
body{height:100dvh;background:var(--bg);color:var(--text);font:400 15px/1.47 -apple-system,BlinkMacSystemFont,'SF Pro Text',Inter,system-ui,sans-serif;-webkit-font-smoothing:antialiased;-webkit-text-size-adjust:100%}
button,input,select{font:inherit;color:inherit}
button{-webkit-tap-highlight-color:transparent}
[hidden]{display:none !important}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px}
/* A popover gets focus programmatically as a whole; a ring round the panel would read as a selection. */
.pop:focus-visible{outline:none}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* One scroll: the window never scrolls, only .scroll does (skill §1). */
.shell{height:100dvh;display:flex;flex-direction:column}
.scroll{flex:1;min-height:0;overflow:auto;overflow-x:hidden;overscroll-behavior:contain}
/* The header offset sits on the content, not on the scroller: a focused header control then never scrolls the grid (F1). */
main *,footer *{scroll-margin-top:calc(var(--hdr-h) + 12px)}

/* Header: sticky inside the scroller, content passes under it. */
.hdr{position:sticky;top:0;z-index:20;display:flex;align-items:center;gap:16px;height:var(--hdr-h);padding:0 max(40px, calc((100% - 1440px) / 2 + 40px)); /* main's column (4L3) */
  background:var(--panel);-webkit-backdrop-filter:blur(20px) saturate(1.4);backdrop-filter:blur(20px) saturate(1.4);border-bottom:1px solid var(--line)}
.brand{min-width:0;overflow:hidden;text-overflow:ellipsis;font-size:15px;font-weight:600;letter-spacing:-.01em;white-space:nowrap}
.search{position:relative;flex:1;min-width:0;max-width:480px;margin:0 auto}
.search input{width:100%;height:34px;padding:0 12px 0 34px;border-radius:10px;border:0;background:var(--track);appearance:none;-webkit-appearance:none}
.search input::placeholder{color:var(--soft);opacity:1}
.search input::-webkit-search-cancel-button{cursor:pointer}
.search svg{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:var(--soft);pointer-events:none}
@media (prefers-contrast:more){.search input{border:1px solid var(--line)}}

.btn{height:34px;padding:0 14px;border-radius:999px;border:0;background:var(--track);display:inline-flex;align-items:center;justify-content:center;gap:8px;font-weight:500;font-size:14px;cursor:pointer;white-space:nowrap;text-decoration:none;color:var(--text)}
.btn.primary{background:var(--btn);color:var(--on-btn)}
@media (prefers-contrast:more){.btn{border:1px solid var(--line)}}
.hdr-end{display:flex;align-items:center;gap:16px;justify-content:flex-end} /* never narrower than its controls: at 1024 the brand gives way, not Filters */
/* At 1024 and wider the brand and the right-hand controls are equal sides, so the search sits on the page's centre (4L12).
   From 1024 to 1199 that holds only with the short status label below; the right side cannot shrink past its controls (5H1). */
@media (min-width:1024px){.brand,.hdr-end{flex:1 1 0}.hdr .search{flex:0 1 480px;margin:0}}
.hdr .filt{min-width:129px;justify-content:flex-start} /* room for a two-digit badge: the pill, its label and the search never move (4L4) */
.num{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--btn);color:var(--on-btn);font-size:12px;font-weight:600;line-height:20px;text-align:center;font-variant-numeric:tabular-nums}
.fresh{flex:none;display:inline-flex;align-items:center;gap:8px;color:var(--soft);font-size:12px;white-space:nowrap;background:none;border:0;padding:0 10px;height:34px;border-radius:999px;cursor:pointer}
.fresh .short{display:none}
@media (min-width:1024px) and (max-width:1199px){.fresh .long{display:none}.fresh .short{display:inline}.hdr-end{gap:12px}} /* "16 Nov" and a 12 px gap: the search stays centred, bordered buttons too (5H1, 6L8) */
.dot{width:7px;height:7px;border-radius:50%;background:var(--ok);flex:none}
.dot.warn{background:var(--warn)}

/* Popovers: one open at a time (skill §6). Animate only transform and opacity. */
.scrim{position:fixed;left:0;right:0;bottom:0;top:var(--hdr-h);z-index:24;background:transparent;opacity:0;transition:opacity .14s var(--motion)}
.scrim.is-open{opacity:1;transition-duration:.18s}
.pop{position:fixed;z-index:26;top:calc(var(--hdr-h) + 8px);right:var(--pop-right,24px);width:380px;max-height:calc(100dvh - var(--hdr-h) - 24px);overflow:auto;overscroll-behavior:contain;
  padding:18px;border-radius:18px;border:1px solid var(--line);background:var(--panel-pop);-webkit-backdrop-filter:blur(30px) saturate(1.4);backdrop-filter:blur(30px) saturate(1.4);
  box-shadow:0 24px 64px rgba(0,0,0,.18);display:flex;flex-direction:column;gap:16px;
  opacity:0;transform:translateY(-6px);transform-origin:top right;transition:opacity .16s var(--motion),transform .16s var(--motion)}
.pop.is-open{opacity:1;transform:none;transition-duration:.22s}
.pop:not(.is-open){pointer-events:none}
.pop fieldset{border:0;margin:0;padding:0;min-width:0;display:flex;flex-direction:column;gap:2px}
.pop legend{padding:0;margin-bottom:6px;font-size:12px;font-weight:600;color:var(--soft)}
.opt{display:flex;align-items:center;gap:10px;min-height:34px;padding:0 8px;border-radius:8px;cursor:pointer;font-size:14px}
.opt input{width:16px;height:16px;accent-color:var(--btn);margin:0;flex:none}
.opt span{flex:1;min-width:0}
.opt small{color:var(--soft);font-size:13px;font-variant-numeric:tabular-nums}
.popfoot{position:sticky;bottom:-18px;z-index:1;display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0 -18px -18px;padding:12px 18px 18px;border-top:1px solid var(--line);background:var(--solid)}
.link{background:none;border:0;padding:0;color:var(--acc);cursor:pointer;font-size:14px;text-align:left}
.pop .sortpop{display:none}
.pop.status{width:340px;gap:10px}
.pop.status h2{margin:0;font-size:14px;font-weight:600}
.pop.status dl{margin:0;display:grid;grid-template-columns:max-content 1fr;gap:6px 14px;font-size:13px}
.pop.status dt{color:var(--soft)}
.pop.status dd{margin:0;min-width:0;overflow-wrap:anywhere}

main{max-width:1440px;margin:0 auto;padding:16px 40px 0}
/* The page's large title (D-H): the HIG large-title proportions, 34/41 bold, in the page's own system font. */
.ltitle{margin:0;font-size:34px;line-height:41px;font-weight:700;color:var(--text);overflow-wrap:anywhere;text-wrap:balance} /* no word alone on the last line (4L1) */
.bar{display:flex;flex-wrap:wrap;align-items:center;gap:12px 16px;padding:8px 0 20px}
.chips{display:flex;flex-wrap:wrap;gap:8px}
.chip{height:34px;padding:0 14px;border-radius:999px;border:1px solid var(--line);background:transparent;display:inline-flex;align-items:center;gap:8px;font-size:14px;font-weight:500;cursor:pointer;white-space:nowrap}
.chip[aria-pressed="true"]{background:var(--chip-on);border-color:var(--chip-on);color:var(--on-chip)}
.chip:not([aria-pressed="true"]){border-color:var(--chip-line)}
.chip svg{flex:none}
.result{margin:0;font-size:14px;color:var(--soft);font-variant-numeric:tabular-nums}
.result b{color:var(--text);font-weight:600}
.result .of{color:var(--soft);font-size:12px}
.spacer{flex:1}
.sortd{display:flex;gap:8px;align-items:center}
.sel{height:34px;padding:0 10px;border-radius:999px;border:0;background:var(--track);font-size:14px;font-weight:500;cursor:pointer}
@media (prefers-contrast:more){.sel{border:1px solid var(--line)}}
.dens{display:inline-flex;padding:2px;border-radius:9px;background:var(--track)}
.dens button{width:36px;height:30px;border:0;border-radius:7px;background:transparent;color:var(--soft);display:grid;place-items:center;cursor:pointer}
.dens button[aria-pressed="true"]{background:var(--thumb);color:var(--text);box-shadow:0 1px 3px rgba(0,0,0,.12)}

.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:40px 24px}
/* Until boot (5R1): what cannot work yet waits, and the empty grid holds the footer below the fold, so nothing jumps when the
   data lands. The class is set by an inline script, so a page without JavaScript holds nothing. */
html.loading :is(.bar,.hdr-end,#filt-dock,footer){visibility:hidden}
html.loading #dock #filt-dock{visibility:visible;pointer-events:none} /* the dock stays whole while it waits; the pill is inert (6L3, E C-3) */
html.nostart :is(.hdr .search,.hdr-end,.bar,#dock,.fwrap li:has(> #export),.fchecks){display:none} /* gallery.js did not run: as without JavaScript (6L5) */
html.loading .grid:empty{min-height:100dvh}
.grid.large{grid-template-columns:repeat(2,minmax(0,1fr));gap:48px 32px}
.card{display:flex;flex-direction:column;min-width:0;content-visibility:auto;contain-intrinsic-size:auto 440px}
.grid.large .card{contain-intrinsic-size:auto 700px}
/* Title and team stack at the top; the second title line is reserved BELOW the team line,
   so a one-line title never leaves a gap above the team and images still line up across a row. */
.head{min-height:calc(16px * 1.3 * 2 + 2px + 18px);margin-bottom:10px}
.ttl{margin:0;font-size:16px;font-weight:600;line-height:1.3;letter-spacing:-.01em;display:-webkit-box;-webkit-line-clamp:2;line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.team{margin:2px 0 0;color:var(--soft);font-size:13px;line-height:18px;height:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.media{position:relative;aspect-ratio:16/9;border-radius:12px;overflow:hidden;background:#0b0b10;box-shadow:0 0 0 1px var(--ring)}
@media (prefers-color-scheme:light){.media{background:var(--track)}} /* a light page loads into its own fill, not black slabs (5R2) */
.hit{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:none;cursor:zoom-in;display:block;border-radius:inherit}
.hit img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
/* The ring sits inside the image box (the box clips outside rings) and stays visible on dark and light shots. */
.hit:focus-visible{outline:none}
.hit:focus-visible::after{content:'';position:absolute;inset:0;border-radius:inherit;pointer-events:none;box-shadow:inset 0 0 0 3px var(--focus),inset 0 0 0 6px #fff}
/* Hover preview: instant swap, no transition; JS adds .peek after a 400 ms dwell (fine pointers only). */
.hit .f2{display:none}
.media.peek .f2{display:block}
.ph{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px;padding:12px;text-align:center;color:#fff;font-size:13px;background:#05070f center/cover no-repeat}
.ph svg{color:#d2d2d7;flex:none}
.star,.go{position:absolute;top:8px;width:34px;height:34px;border-radius:999px;border:0;background:rgba(255,255,255,.86);-webkit-backdrop-filter:blur(16px) saturate(1.4);backdrop-filter:blur(16px) saturate(1.4);color:#1d1d1f;display:grid;place-items:center;cursor:pointer;opacity:0;text-decoration:none}
.star{right:8px}
.go{right:48px}
.star:focus-visible,.go:focus-visible,.star.on{opacity:1}
.star.on{color:#a34700}
.star svg{fill:none}
.star.on svg{fill:currentColor}
@media (hover:none){.star,.go{opacity:1}}
.star,.go,.two{z-index:2}
.two{position:absolute;left:8px;bottom:8px;display:flex;gap:3px;padding:5px 6px;border-radius:999px;background:rgba(0,0,0,.6);pointer-events:none}
.two i{width:5px;height:5px;border-radius:50%;background:#fff}
.two i+i{opacity:.55}
.media.peek .two i{opacity:.55}
.media.peek .two i+i{opacity:1}
.sum{margin:10px 0 0;color:var(--soft);font-size:13px;line-height:1.45;display:-webkit-box;-webkit-line-clamp:1;line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;overflow-wrap:anywhere}
.grid.large .sum{-webkit-line-clamp:2;line-clamp:2}
.badges{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.badges:empty{display:none}
.b{padding:2px 9px;border-radius:999px;background:var(--fill);color:var(--soft);font-size:12px;font-weight:500}
.b.warn{color:var(--warn);background:var(--warnbg)}
.grid.f-webgl .b.gl{display:none}
.empty{padding:64px 24px;text-align:center;color:var(--soft);border-radius:20px;border:1px dashed var(--line);display:flex;flex-direction:column;align-items:center;gap:12px}
.empty.bare{border:0} /* no data: a message and an action, no container (5N5) */
.empty a{color:var(--acc)}
/* A readable measure for the echo; only the user's query is clamped (D-1), so "Nothing matches" never takes its lines. */
.empty strong{color:var(--text);max-width:min(100%,36em);overflow-wrap:anywhere}
.empty strong .q{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden;padding-inline:.4em} /* the centred ellipsis overflows a little: the padding keeps it whole (4L2) */

footer{margin-top:72px;border-top:1px solid var(--line)}
.fwrap{max-width:1440px;margin:0 auto;padding:28px 40px 40px;display:grid;grid-template-columns:minmax(0,2fr) minmax(0,1fr) minmax(0,1fr);gap:40px;color:var(--soft);font-size:12px;line-height:1.5}
.fwrap h2{margin:0;font-size:12px;font-weight:600;color:var(--text)}
.fwrap p{margin:8px 0 0;max-width:64ch}
.fwrap ul{list-style:none;margin:8px 0 0;padding:0;display:flex;flex-direction:column;gap:6px}
.stat{display:flex;justify-content:space-between;gap:12px}
.stat b{font-weight:500;color:var(--text);font-variant-numeric:tabular-nums}
.fwrap a{color:var(--acc);text-decoration:none}
.fwrap .link{font-size:12px}

.dock{display:none}

/* Viewer: opens with transform and opacity only. On exit the panel (120 ms) leaves before the scrim (160 ms). */
.viewer{position:fixed;inset:0;z-index:40;color:#f5f5f7}
.vscrim{position:absolute;inset:0;background:#000;opacity:0;transition:opacity .16s var(--motion)}
.vpanel{position:absolute;inset:0;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:auto minmax(0,1fr);opacity:0;transform:translateY(14px);transition:opacity .12s var(--motion),transform .12s var(--motion)}
.viewer.is-open .vscrim{opacity:1;transition-duration:.18s}
.viewer.is-open .vpanel{opacity:1;transform:none;transition-duration:.22s}
.vbar{display:flex;align-items:center;gap:12px;height:56px;padding:0 12px;border-bottom:1px solid rgba(255,255,255,.12)}
.vbtn{width:36px;height:36px;border-radius:999px;border:0;background:rgba(255,255,255,.14);color:#f5f5f7;display:grid;place-items:center;cursor:pointer;flex:none}
.vbtn:disabled{opacity:.4;cursor:default}
.viewer :focus-visible{outline-color:#5eb0ff}
.vname{flex:1;min-width:0;line-height:1.25}
.vname strong{display:block;font-size:15px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vname span{display:block;font-size:12px;color:#c7c7cc;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.vpos{font-size:13px;color:#c7c7cc;font-variant-numeric:tabular-nums;white-space:nowrap}
.vbody{display:grid;grid-template-columns:minmax(0,1fr) 340px;min-height:0;background:#111113}
.stage{display:flex;align-items:center;justify-content:center;padding:24px;min-height:0;min-width:0;background:#000}
/* The toggle sits directly under the image, and the pair is centred as one block. */
.fig{display:flex;flex-direction:column;align-items:center;gap:12px;max-width:100%;min-width:0}
.frame{max-width:100%;display:flex;justify-content:center}
.frame img{display:block;max-width:100%;max-height:calc(100dvh - 56px - 48px - 30px - 12px);width:auto;height:auto;border-radius:8px}
.frame .ph{position:static;width:min(100%,1600px,calc((100dvh - 56px - 48px - 30px - 12px) * 16 / 9));aspect-ratio:16/9;border-radius:8px;font-size:14px}
.fig:has(> .frame > .ph),.fig:has(> .frame > .ph) > .frame{width:100%}
.vctrl{display:flex;justify-content:safe center}
.vseg{display:inline-flex;gap:2px;padding:2px;border-radius:9px;background:rgba(118,118,128,.32);max-width:100%}
.vseg button{height:30px;padding:0 14px;border-radius:7px;border:0;background:transparent;color:#f5f5f7;font-size:13px;font-weight:500;cursor:pointer;white-space:nowrap}
/* A long start label is cut with an ellipsis; the full label is in its title and in the "Start button" row. */
#v-f1{flex:none}
#v-f2{min-width:0;overflow:hidden;text-overflow:ellipsis}
.vseg .sm{display:none}
/* The short pair, chosen by fit in gallery.js (4L6). */
.vseg.short .lg{display:none}
.vseg.short .sm{display:inline}
.vseg button[aria-pressed="true"]{background:#636366}
.vinfo{overflow:auto;overscroll-behavior:contain;padding:24px;border-left:1px solid rgba(255,255,255,.12);background:#111113;display:flex;flex-direction:column;gap:16px}
.vtitle{margin:0;font-size:18px;font-weight:600;line-height:1.3;letter-spacing:-.01em;color:#f5f5f7;overflow-wrap:anywhere}
/* The full team name, wrapped, under the heading: the bar copy is one line with an ellipsis. */
.vinfo .vteam{margin-top:-12px;color:#c7c7cc;font-size:13px;line-height:1.4}
.vinfo p{margin:0;color:#d2d2d7;font-size:14px;line-height:1.55;white-space:pre-line;overflow-wrap:anywhere}
.vacts{display:flex;flex-wrap:wrap;gap:8px}
.vacts .btn{background:rgba(255,255,255,.14);color:#f5f5f7;border:0;max-width:100%;gap:4px}
.vacts .btn > span{min-width:0;overflow:hidden;text-overflow:ellipsis} /* a long label ends in an ellipsis on very narrow viewers */
.vacts .btn > span + span{flex:none} /* the ↗ is the last thing to go */
.vacts .btn.primary{background:var(--btn);color:#fff}
.meta{margin:0;display:grid;grid-template-columns:max-content 1fr;gap:8px 16px;font-size:13px;padding-top:16px;border-top:1px solid rgba(255,255,255,.12)}
.meta dt{color:#c7c7cc}
.meta dd{margin:0;color:#e5e5ea;min-width:0;overflow-wrap:anywhere}
.meta .code{display:block;margin-top:2px;font-size:12px;color:#c7c7cc;overflow-wrap:break-word}

@media (max-width:1100px){
  .grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .card,.grid.large .card{contain-intrinsic-size:auto 520px}
  .vbody{grid-template-columns:minmax(0,1fr) 300px}
}

/* Below 1024: search and Filters move into the floating bottom dock (skill §2, §4). */
@media (max-width:1023px){
  :root{--hdr-h:44px}
  main *,footer *{scroll-margin-bottom:calc(var(--dock-h) + 24px + env(safe-area-inset-bottom))} /* focus never lands under the dock (5H3) */
  .hdr{padding:0 16px;justify-content:space-between}
  .hdr .search,.hdr .filt{display:none}
  .dock{display:flex;gap:8px;position:fixed;left:12px;right:12px;bottom:calc(12px + env(safe-area-inset-bottom));z-index:25;padding:8px;border-radius:18px;border:1px solid var(--line);
    background:var(--panel);-webkit-backdrop-filter:blur(20px) saturate(1.4);backdrop-filter:blur(20px) saturate(1.4);box-shadow:0 12px 32px rgba(0,0,0,.14)}
  .dock .search{margin:0;max-width:none;flex:1}
  .dock .search input{height:44px;border-radius:12px}
  .dock .btn{height:44px}
  .scrim{top:0;z-index:24;background:rgb(0 0 0 / .45)}
  /* Status drops from the header: the dock has nothing to do with it, so it goes under the scrim too. */
  body:has(#pop-status:not([hidden])) .dock{z-index:23}
  .pop{left:12px;right:12px;top:auto;width:auto;bottom:calc(var(--dock-h) + 12px + 8px + env(safe-area-inset-bottom));
    max-height:calc(100dvh - var(--dock-h) - 12px - 8px - 12px - env(safe-area-inset-bottom) - 12px)}
  /* From the dock the filters menu rises; the status popover still drops from the header. */
  #pop-filters:not(.is-open){transform:translateY(8px);transform-origin:bottom center}
  .pop.status{top:calc(var(--hdr-h) + 8px);bottom:auto;width:auto;max-height:calc(100dvh - var(--hdr-h) - 24px)}
  .fwrap{padding-bottom:calc(var(--dock-h) + 12px + 28px + env(safe-area-inset-bottom))}
  .vbar{height:52px}
}
@media (min-width:301px) and (max-width:1023px){.dock .filt{min-width:105px;justify-content:flex-start}} /* no filter, one or twelve: the pill, its label and the search never move (4L5, 5H4); at ≤ 300 the search needs the room */
@media (min-width:768px) and (max-width:1023px){.hdr{padding:0 40px}} /* the brand starts on the content's edge (5H5) */
@media (max-width:767px){
  .fresh .long{display:none}
  .fresh .short{display:inline}
  main{padding:8px 16px 0}
  .bar{padding:4px 0 16px;gap:8px 12px}
  .ltitle{font-size:28px;line-height:34px;margin-bottom:4px}
  .bar .spacer,.bar .sortd{display:none}
  .grid,.grid.large{grid-template-columns:minmax(0,1fr);gap:32px}
  .head{min-height:0}
  .team:empty{display:none} /* one column aligns no rows: no empty line under the title (5H6) */
  .card,.grid.large .card{contain-intrinsic-size:auto 640px}
  .fwrap{grid-template-columns:minmax(0,1fr);gap:24px;padding-left:16px;padding-right:16px}
  .pop .sortpop{display:flex}
  .star,.go{opacity:1}
  .go{right:58px}
  .vpos{display:none}
}
/* The phone viewer stacks, the screenshot over the details, except on a phone lying on its side: there the screenshot alone fills
   the window, so it keeps the split of ≥ 768 (8F2, BU8-5). The two queries are the complement of 6L1's height and orientation. */
@media (max-width:767px) and (min-height:501px),(max-width:767px) and (orientation:portrait){
  .vctrl{padding:0 16px}
  .vbody{grid-template-columns:minmax(0,1fr);grid-auto-rows:max-content;overflow:auto;overscroll-behavior:contain;align-content:start}
  .stage{padding:0 0 16px;display:block;min-height:auto}
  .fig{max-width:none;gap:12px;align-items:stretch}
  .frame{display:block}
  .frame img{width:100%;max-height:none;border-radius:0}
  .frame .ph{width:100%;border-radius:0}
  .vinfo{border-left:0;border-top:1px solid rgba(255,255,255,.12);overflow:visible;padding:20px 16px calc(24px + env(safe-area-inset-bottom))}
}

/* Tall windows (portrait tablets, a tall desktop window) stack the viewer as phones do: the screenshot on top at full width,
   the details below, on the 40 px edge of 5H5. The height, not the shape, tells 1366×1024 (stacks) from 1024×768 (6V1, E C-1). */
@media (min-width:768px) and (min-height:800px) and (max-aspect-ratio:3/2){
  .vctrl{padding:0 40px}
  .vbody{--vres:272px;grid-template-columns:minmax(0,1fr);grid-auto-rows:max-content;overflow:auto;overscroll-behavior:contain;align-content:start}
  .stage{padding:0 0 16px;display:block;min-height:auto}
  .fig{max-width:none;gap:12px;align-items:stretch}
  .frame{display:block}
  /* The image is capped so the title and "Open app" stay above the fold on browser windows with toolbars (7V1, BU7-2, E7-1);
     --vres is the height kept for the bar, the toggle, the title and the actions. The text keeps a readable measure (E7-2) and
     starts on the letterboxed image's left edge, never inside the 40 px edge (8F5, E8-2). */
  .frame img{width:min(100%,calc((100dvh - var(--vres)) * 16 / 9));height:auto;max-height:none;margin-inline:auto;border-radius:0}
  .frame .ph{width:min(100%,calc((100dvh - var(--vres)) * 16 / 9));margin-inline:auto;border-radius:0}
  .vinfo{border-left:0;border-top:1px solid rgba(255,255,255,.12);overflow:visible;padding:24px max(40px,calc((100% - min(100%,calc((100dvh - var(--vres)) * 16 / 9))) / 2))}
  .vinfo > :not(.vacts){max-width:36em}
}
/* A coarse pointer makes the toggle and the buttons 44 px, so a two-line title with the toggle needs more room (8F1, BU8-1). */
@media (min-width:768px) and (min-height:800px) and (max-aspect-ratio:3/2) and (pointer:coarse){.vbody{--vres:296px}}

/* Two columns when a phone lies on its side: a 16:9 card in one column is taller than the band between header and dock (6L1, BU D3).
   Landscape only: a phone upright at 200 % (195×422) keeps one column, or its cards would be 65 px wide. */
@media (max-width:767px) and (max-height:500px) and (orientation:landscape){.grid,.grid.large{grid-template-columns:repeat(2,minmax(0,1fr))}}

/* Touch targets and input size (skill §4): on narrow windows and coarse pointers. */
@media (max-width:767px),(pointer:coarse){
  input,select,textarea{font-size:16px}
  .btn,.chip,.sel,.fresh{height:44px;min-height:44px}
  .opt{min-height:44px}
  .opt input{width:20px;height:20px}
  .star,.go{width:44px;height:44px}
  .dens button{width:44px;height:40px}
  .vbtn{width:44px;height:44px}
  .vseg button{height:44px}
  .link{min-height:44px}
  .fwrap li > a{display:inline-flex;align-items:center;min-height:44px} /* the four Links rows share one rhythm (6L6) */
  .hdr :focus-visible{outline-offset:-2px} /* a 44 px control fills the 44 px header: the ring goes inside, not off screen (4L10) */
}

/* Very narrow windows (200 % zoom on a phone): the card's open-in-new-tab button would cover the image; the viewer has it. */
/* The viewer bar wraps so the name keeps a row of its own; Reset all stays on one line and Show wraps under it if needed. */
@media (max-width:300px){
  .card .go{display:none}
  .vbar{flex-wrap:wrap;height:auto;row-gap:0;padding:4px 12px 8px}
  .vname{order:9;flex-basis:100%}
  #v-prev{margin-left:auto}
  .popfoot{flex-wrap:wrap}
  #reset-menu{white-space:nowrap}
  #v-f1,#v-f2{flex:1 1 0;min-width:0;overflow:hidden;text-overflow:ellipsis}
  .vseg{flex:1} /* the track takes the row, so the short labels never round down into an ellipsis */
  .vseg button{padding:0 6px}
  .fresh{padding:0 4px} /* the brand keeps its room */
  .brand span{display:none} /* "Space Apps" (D-2, 4L8) */
  .ltitle{font-size:22px;line-height:28px} /* 2 lines at 200 % on a phone (D-1, 4L9) */
}

/* Pressing and sliding on a control does not select page text (T4). */
.btn,.chip,.fresh,.opt,.vbtn,.vseg button,.dens button{-webkit-user-select:none;user-select:none}

/* Hover only where a real hover exists (skill: no sticky hover on touch). */
@media (hover:hover) and (pointer:fine){
  .btn:hover{background:var(--hover)}
  .btn.primary:hover{background:var(--btn);filter:brightness(1.08)}
  .fresh:hover,.link:hover,.fwrap a:hover{text-decoration:underline}
  .opt:hover{background:var(--fill)}
  .chip:not([aria-pressed="true"]):hover{background:var(--fill)}
  .vbtn:not(:disabled):hover{background:rgba(255,255,255,.22)}
  .vacts .btn:not(.primary):hover{background:rgba(255,255,255,.22);filter:none}
  .card:hover .star,.card:hover .go{opacity:1}
}

/* Press feedback: the surface tone changes on :active, instantly, no scale, no transition. Works on touch too. */
/* The card image: ::before, because ::after is the focus ring; z-index:1 to sit above the absolutely positioned image. */
.hit:active::before{content:'';position:absolute;inset:0;z-index:1;border-radius:inherit;background:rgba(118,118,128,.2);pointer-events:none}
.btn:active{background:var(--press)}
/* An open popover's trigger keeps the press tone while its panel is open. */
.filt[aria-expanded="true"],.fresh[aria-expanded="true"]{background:var(--press)}
.fresh[aria-expanded="true"]{text-decoration:none}
.fresh:active,.opt:active{background:var(--press)}
.link:active{opacity:.6}
.btn.primary:active{background:var(--btn-press);filter:none}
.chip:active{background:var(--press)}
/* Same specificity as the unpressed-chip hover rule, and later, so a mouse press shows the press tone. */
.chip:not([aria-pressed="true"]):active{background:var(--press)}
.chip[aria-pressed="true"]:active{background:var(--chip-on-press);border-color:var(--chip-on-press)}
.star:active,.go:active{background:rgba(214,214,220,.97)}
.dens button:active{background:var(--press)}
.dens button[aria-pressed="true"]:active{background:var(--thumb-press)}
.vbtn:not(:disabled):active{background:rgba(255,255,255,.3)}
.vseg button:active{background:rgba(255,255,255,.2)}
.vseg button[aria-pressed="true"]:active{background:#7a7a7e}
.vacts .btn:active{background:rgba(255,255,255,.28);filter:none}
.vacts .btn:not(.primary):active{background:rgba(255,255,255,.28);filter:none} /* beats the secondary-button hover rule */
.vacts .btn.primary:active{background:var(--btn-press)}

/* Solid fallbacks last, so they win over every .pop/.dock background above (skill §1). */
@supports not ((backdrop-filter:blur(1px)) or (-webkit-backdrop-filter:blur(1px))){.hdr,.pop,.dock{background:var(--solid)}}
@media (prefers-reduced-transparency:reduce),(prefers-contrast:more){.hdr,.pop,.dock{background:var(--solid);-webkit-backdrop-filter:none;backdrop-filter:none}}

@media (prefers-reduced-motion:reduce){
  *,*::before,*::after{transition:none !important;animation:none !important}
}
