@font-face{font-family:Manrope;src:url('/fonts/manrope-latin.woff2') format('woff2');font-weight:200 800;font-display:swap}
/* The HUD frame, after gitGud.: one geometry (an inset, a bar height, the same gap to the stage), deep-ink panels in both
   themes, the map full-bleed under them. The plain px custom properties are read by map.js as the camera's safe area. */
:root{--purple:#0969bd;--ink:#152e48;--bg:#edf5fa;--paper:#f8fbfd;--line:#c0d4e1;--muted:#47627a;--body-size:18px;--small-size:14px;--mono-size:14px;--h1-size:44px;--h2-size:28px;--h3-size:21px;color-scheme:light;font:14px/1.5 Manrope,sans-serif;
 --inset:8px;--bar:48px;--deck:48px;--rail:56px;--panel:300px;--peek:0px;--warn:0px;--hud-top:calc(var(--inset) * 2 + var(--bar));--stage-top:calc(var(--hud-top) + var(--warn));--hud-bottom:calc(var(--inset) * 2 + var(--deck));
 --hud-panel:#0f2438;--hud-glass:rgb(15 36 56/.88);--hud-edge:#071522;--hud-hi:rgb(255 255 255/.09);--hud-ink:#eaf4fd;--hud-dim:#a9bfd3;--hud-rule:rgb(255 255 255/.14);--hud-wash:rgb(255 255 255/.06);--hud-wash-strong:rgb(255 255 255/.11);--hud-track:rgb(255 255 255/.18);--hud-accent:#80c6ff;--hud-cache:#4c7da8;--hud-gold:#f0cc7a;--hud-good:#8fd3a8;--hud-error:#ffb2a3;--hud-shadow:0 12px 28px -16px rgb(9 18 26/.6),0 2px 6px -3px rgb(9 18 26/.28);--hud-ease:cubic-bezier(.2,.8,.2,1)}
[data-theme=dark]{--purple:#80c6ff;--ink:#e8f3ff;--bg:#0b1726;--paper:#112236;--line:#34536e;--muted:#a8bdd2;--hud-panel:#09131f;--hud-glass:rgb(9 19 31/.86);--hud-edge:#2f4d66;--hud-hi:rgb(255 255 255/.06);--hud-shadow:0 14px 32px -16px rgb(0 0 0/.8);color-scheme:dark}
*{box-sizing:border-box}html,body{height:100%;min-height:0;margin:0;overflow:hidden!important;overscroll-behavior:none}body{display:block;padding:0;background:var(--bg);color:var(--ink)}[hidden]{display:none!important}button,input,textarea,select,summary{font:inherit}button,select{min-height:44px;border:1px solid var(--line);background:var(--paper);color:var(--ink);border-radius:6px;padding:8px 12px}button,summary{cursor:pointer}button:hover{color:var(--purple)}:focus-visible,.content-focus:focus{outline:3px solid var(--purple);outline-offset:3px}.sr-only{position:absolute!important;width:1px;height:1px;clip-path:inset(50%);overflow:hidden;white-space:nowrap}.skip{z-index:30}.port-app{position:relative;height:var(--port-viewport-height,100dvh);transform:translateY(var(--port-viewport-top,0px));width:100%;margin:0;overflow:hidden}
.stage,#map-panel{position:absolute;inset:0;min-height:0;min-width:0;overflow:hidden}#map-panel{display:flex;flex-direction:column}#map{height:100%;width:100%;min-height:0;flex:1}#map-panel>h1{margin:0}
kbd{font:var(--mono-size) 'IBM Plex Mono',monospace;margin-left:8px;color:var(--muted)}

/* ---- The material: one recipe for the band, the console bar and its sheet; frosted on the map, where they float over the canvas ---- */
.masthead,.port-console,.hud-sheet,.hud-tip{background:var(--hud-panel);color:var(--hud-ink);border-radius:10px;box-shadow:inset 0 1px 0 var(--hud-hi),0 0 0 1px var(--hud-edge),var(--hud-shadow)}
/* The console bar stays solid: its field is measured against a solid backing (text-contrast). */
html[data-hud=map] .masthead{background:var(--hud-glass);-webkit-backdrop-filter:blur(14px) saturate(1.25);backdrop-filter:blur(14px) saturate(1.25)}
.masthead :focus-visible,.port-console :focus-visible,.hud-rail :focus-visible{outline:3px solid var(--hud-accent);outline-offset:2px}.hud-rail :focus-visible{outline-color:var(--purple)}
.masthead button,.port-console button{box-shadow:none}

/* ---- Top band: mark and place line | readout | profile ---- */
.masthead{position:absolute;z-index:8;top:var(--inset);left:var(--inset);right:var(--inset);height:var(--bar);display:grid;grid-template-columns:minmax(0,1.5fr) auto minmax(max-content,1fr);align-items:center;gap:12px;min-width:0;padding:0 7px 0 10px}
.hud-left,.hud-right{display:flex;align-items:center;min-width:0}.hud-right{justify-content:flex-end}
.wordmark{display:inline-flex;align-items:center;flex-shrink:0;height:36px;padding:0 8px 0 4px;color:var(--hud-ink);font-size:22px;font-weight:750;letter-spacing:-1px;white-space:nowrap;cursor:default}.wordmark img{width:44px;height:32px;object-fit:contain;margin-right:5px}.wordmark span{color:var(--hud-ink)}.wordmark span span,.wordmark b{color:var(--hud-accent)}
.hud-joint{position:relative;flex:none;align-self:stretch;width:9px;margin:8px 0}.hud-joint::before{content:'';position:absolute;left:50%;top:0;bottom:0;width:1.5px;margin-left:-.75px;border-radius:1px;background:linear-gradient(transparent,color-mix(in srgb,var(--hud-accent) 50%,transparent) 32% 68%,transparent)}.hud-joint::after{content:'';position:absolute;left:50%;top:50%;width:7px;height:7px;margin:-3.5px 0 0 -3.5px;box-sizing:border-box;border:1.5px solid var(--hud-accent);border-radius:50%;background:var(--hud-panel)}
.hud-where{flex:1;align-self:stretch;min-width:0;display:flex;align-items:center;gap:10px;margin-left:4px;overflow:hidden;font:600 15px/1 'IBM Plex Mono',monospace;white-space:nowrap;color:var(--hud-accent)}.hud-where>*{flex-shrink:0}.where-key{font-weight:500;color:var(--hud-dim)}#where-name{font:650 15px/1 Manrope,sans-serif;color:var(--hud-ink)}
/* The place line never ends in an ellipsis: what does not fit leaves (shell.js fitWhere), the open activity's step dots always stay. */
.hud-where #beat-dots{display:flex;align-items:center;justify-content:center;min-width:44px;min-height:44px;padding:0 6px;border:0;border-radius:7px;background:transparent;color:var(--hud-ink);font:inherit}.hud-where #beat-dots[hidden]{display:none}
.hud-where #beat-dots:hover{background:var(--hud-wash);color:var(--hud-ink)}#beat-dots .beat-progress{display:flex;align-items:center;gap:6px;white-space:nowrap;font:600 15px/1 'IBM Plex Mono',monospace}#beat-dots i{display:block;width:6px;height:6px;border-radius:50%;border:1.5px solid var(--hud-accent);transition:background-color .2s var(--hud-ease),transform .24s cubic-bezier(.2,1.4,.4,1)}#beat-dots .done{background:var(--hud-accent)}#beat-dots .current{background:var(--hud-gold);border-color:var(--hud-gold);transform:scale(1.35)}

/* The readout: three instruments read as one sentence. Not a control: each total explains itself on hover or focus. */
.hud-readout{display:flex;align-items:center;height:44px;padding:0 2px;border-radius:7px;color:var(--hud-ink);font:500 13px/1 'IBM Plex Mono',monospace;font-variant-numeric:tabular-nums;white-space:nowrap;cursor:default}
.hud-stat{display:flex;align-items:center;gap:8px;height:44px;min-width:44px;padding:0 12px;border-radius:6px}.hud-stat:focus-visible{outline-offset:2px}
.hud-stat-key{font:600 12px/1 'IBM Plex Mono',monospace;letter-spacing:.12em;text-transform:uppercase;color:var(--hud-dim);transition:color .18s var(--hud-ease)}.hud-stat:is(:hover,:focus) .hud-stat-key{color:var(--hud-ink)}
.hud-stat strong{font:650 15px/1 'IBM Plex Mono',monospace;color:var(--hud-ink)}.hud-of{margin:0 1px;color:var(--hud-dim);font-weight:400}
/* Ten segments filled to the share of layers laid; the cached part (prior knowledge) is tinted. The gaps are a mask, so the fill stays one gradient. */
.hud-meter{position:relative;overflow:hidden;width:82px;height:4px;background:linear-gradient(90deg,var(--hud-accent) calc(var(--share,0) * 100%),var(--hud-cache) 0 calc((var(--share,0) + var(--cached,0)) * 100%),var(--hud-track) 0);-webkit-mask:repeating-linear-gradient(90deg,#000 0 calc(10% - 2px),transparent 0 10%);mask:repeating-linear-gradient(90deg,#000 0 calc(10% - 2px),transparent 0 10%)}
.hud-meter::after{content:'';position:absolute;inset:0;background:linear-gradient(90deg,transparent,color-mix(in srgb,var(--hud-ink) 85%,transparent),transparent);transform:translateX(-100%);opacity:0}
html[data-motion=on] .hud-stat-layers:is(:hover,:focus) .hud-meter::after{animation:hud-sweep .7s var(--hud-ease) .05s both}@keyframes hud-sweep{0%{transform:translateX(-100%);opacity:1}100%{transform:translateX(100%);opacity:1}}
.hud-pips{width:78px;height:9px;overflow:visible}.hud-pips path{fill:var(--hud-track);transform-box:fill-box;transform-origin:center}.hud-pips path.is-built{fill:var(--hud-gold)}
html[data-motion=on] .hud-stat-images:is(:hover,:focus) .hud-pips path{animation:hud-lift .42s var(--hud-ease) calc(var(--i) * 45ms) both}@keyframes hud-lift{40%{transform:translateY(-2px);filter:brightness(1.35)}100%{transform:none}}
.hud-stat-images .hud-stat-key{color:var(--hud-gold)}.hud-stat-incidents[data-open="0"] strong{color:var(--hud-dim)}.hud-stat-incidents:not([data-open="0"]) strong{color:var(--hud-error)}
.hud-readout .hud-joint{margin:10px 0}
/* The card of details hangs under the bar's centre after a short intent delay, so crossing the readout flashes no card. */
.hud-tip{position:absolute;z-index:9;top:calc(100% + 8px);left:50%;display:flex;flex-direction:column;gap:8px;width:min(340px,calc(100vw - 16px));padding:12px 14px 13px;font:500 14px/1.5 Manrope,system-ui,sans-serif;color:var(--hud-dim);white-space:normal;text-align:left;pointer-events:none;opacity:0;visibility:hidden;transform:translate(-50%,-4px);transition:opacity .14s var(--hud-ease),transform .14s var(--hud-ease),visibility 0s linear .14s}
.hud-stat:is(:hover,:focus) .hud-tip{opacity:1;visibility:visible;transform:translate(-50%,0);transition:opacity .16s var(--hud-ease) .12s,transform .16s var(--hud-ease) .12s,visibility 0s linear .12s}html[data-motion=off] .hud-tip{transition:none!important;transform:translate(-50%,0)}
.hud-tip-title{font:650 15px/1.3 Manrope,system-ui,sans-serif;color:var(--hud-ink)}.hud-tip-lead{display:block}
.hud-tip-rows{display:grid;grid-template-columns:auto minmax(36px,1fr) auto;align-items:center;column-gap:12px;row-gap:5px;padding-top:9px;border-top:1px solid var(--hud-rule)}.hud-tip-rows:empty{display:none}.hud-tip-row{display:contents}
.hud-tip-label{min-width:0;color:var(--hud-ink);white-space:nowrap}.hud-tip-row:not(:has(.hud-tip-bar)) .hud-tip-label{grid-column:1/3}.hud-tip-label b{font:600 13px/1 'IBM Plex Mono',monospace;color:var(--hud-dim);margin-right:8px}
.hud-tip-value{font:600 13px/1.6 'IBM Plex Mono',monospace;font-variant-numeric:tabular-nums;color:var(--hud-dim);text-align:right}.hud-tip-bar{height:3px;border-radius:2px;background:linear-gradient(90deg,var(--hud-accent) calc(var(--share,0) * 100%),var(--hud-track) 0)}
.hud-tip-pip{width:8px;height:9px;margin-right:7px;vertical-align:-1px;fill:var(--hud-track)}.hud-tip-row[data-state=built] .hud-tip-pip{fill:var(--hud-gold)}.hud-tip-row[data-state=built] .hud-tip-value{color:var(--hud-gold)}.hud-tip-row[data-state=closed] :is(.hud-tip-label,.hud-tip-value){color:var(--hud-dim)}

/* The profile chip: initials in a disc and the learner's name where there is room. */
.hud-profile{display:inline-flex;align-items:center;gap:8px;max-width:220px;height:44px;padding:0 14px 0 4px;border:1px solid var(--hud-rule);border-radius:999px;background:var(--hud-wash);color:var(--hud-ink);font:650 15px/1 Manrope,system-ui,sans-serif}.hud-profile:hover{border-color:var(--hud-dim);background:var(--hud-wash-strong);color:var(--hud-ink)}
.hud-avatar{display:grid;place-items:center;flex-shrink:0;min-width:34px;height:34px;padding:0 4px;border-radius:17px;background:var(--hud-accent);color:#0b1b2b;font:700 13px/1 'IBM Plex Mono',monospace}.hud-profile-name{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.hud-profile-name:empty{display:none}.hud-profile:has(.hud-profile-name:empty){padding-right:4px}

/* ---- Left rail: « carte », then the districts as stations (30 px glyphs in 44 px targets), the current one ringed ---- */
.hud-rail{position:absolute;z-index:6;left:var(--inset);top:var(--stage-top);bottom:var(--hud-bottom);width:var(--rail);display:flex;flex-direction:column;align-items:center;gap:2px;min-height:0;padding:6px 0 8px;border:1px solid var(--line);border-radius:10px;background:var(--paper)}
.hud-rail-map{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;flex-shrink:0;width:46px;min-height:44px;padding:5px 0 4px;border-radius:7px;color:var(--muted);text-decoration:none;font:600 13px/1 'IBM Plex Mono',monospace;letter-spacing:.04em;transition:background-color .18s var(--hud-ease),color .18s var(--hud-ease)}.hud-rail-map:hover,.hud-rail-map[aria-current]{color:var(--ink);background:color-mix(in srgb,var(--purple) 10%,transparent)}.hud-rail-map svg{width:22px;height:22px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.hud-rail-line{flex:1;min-height:0;width:100%;display:flex;flex-direction:column;justify-content:center;margin:0;padding:0;list-style:none}
.hud-rail-line li{position:relative;flex:0 1 44px;min-height:34px;display:grid;place-items:center}
/* The lane: each station draws its share of the quay route, solid where the image is built, faint ahead. */
.hud-rail-line li::before{content:'';position:absolute;left:50%;top:0;bottom:0;width:2px;margin-left:-1px;background:color-mix(in srgb,var(--lane) 55%,transparent)}.hud-rail-line li[data-state=closed]::before{background:color-mix(in srgb,var(--muted) 22%,transparent)}.hud-rail-line li:first-child::before{top:50%}.hud-rail-line li:last-child::before{bottom:50%}
.hud-rail-stop{position:relative;display:grid;place-items:center;width:44px;height:100%;max-height:44px;aspect-ratio:1;border-radius:50%;color:inherit;text-decoration:none}.hud-rail-stop svg{display:block;width:30px;height:30px;overflow:visible;transition:transform .18s var(--hud-ease)}a.hud-rail-stop:hover svg{transform:scale(1.12)}
.hud-rail-face{fill:var(--paper);stroke:var(--lane);stroke-width:2}.hud-rail-num{font:700 14px 'IBM Plex Mono',monospace;letter-spacing:-.5px;fill:var(--lane)}
.hud-rail li[data-state=built] .hud-rail-face{fill:var(--lane)}.hud-rail li[data-state=built] .hud-rail-num{fill:var(--paper)}
.hud-rail li[data-state=open] .hud-rail-face{fill:color-mix(in srgb,var(--lane) 14%,var(--paper))}
.hud-rail li[data-state=closed] .hud-rail-face{stroke:var(--line);stroke-width:1.6;stroke-dasharray:3 3.4}.hud-rail li[data-state=closed] .hud-rail-num{fill:var(--muted);opacity:.8}
.hud-rail li[data-head] .hud-rail-stop svg{filter:drop-shadow(0 0 0 transparent)}.hud-rail li[data-head] .hud-rail-stop::before{content:'';position:absolute;width:38px;height:38px;border-radius:50%;box-shadow:0 0 0 2px var(--paper),0 0 0 4px var(--ink)}
.hud-rail-tip{position:absolute;left:calc(50% + 28px);top:50%;z-index:2;width:max-content;max-width:260px;padding:7px 10px;border-radius:8px;background:var(--hud-panel);color:var(--hud-ink);box-shadow:inset 0 1px 0 var(--hud-hi),0 0 0 1px var(--hud-edge),var(--hud-shadow);font:650 14px/1.4 Manrope,system-ui,sans-serif;white-space:normal;opacity:0;visibility:hidden;transform:translate(-4px,-50%);pointer-events:none;transition:opacity .14s var(--hud-ease),transform .14s var(--hud-ease),visibility 0s linear .14s}.hud-rail-tip small{display:block;font-weight:500;color:var(--hud-dim)}
.hud-rail li:is(:hover,:focus-within) .hud-rail-tip,.hud-rail-map:is(:hover,:focus-visible)+.hud-rail-tip{opacity:1;visibility:visible;transform:translate(0,-50%);transition-delay:0s}

/* ---- Right panel (the map only): Fiche / Journal / Réponses; the former floating card ---- */
#preview{position:absolute;z-index:3;right:var(--inset);top:var(--stage-top);bottom:var(--hud-bottom);width:var(--panel);display:grid;grid-template-rows:auto auto minmax(0,1fr);min-width:0;min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--paper);box-shadow:0 10px 26px -18px rgb(16 30 42/.5)}
.preview-peek,.preview-handle{display:none;grid-row:1;grid-column:1}
.hud-panel-tabs{grid-row:2;grid-column:1;display:flex;gap:2px;margin:8px;padding:3px;border:1px solid var(--line);border-radius:8px;background:color-mix(in srgb,var(--purple) 7%,transparent)}
.hud-panel-tabs [role=tab]{flex:1;min-width:0;min-height:44px;padding:5px 6px;border:1px solid transparent;border-radius:5px;background:transparent;color:var(--muted);font:650 15px/1.3 Manrope,sans-serif}.hud-panel-tabs [role=tab]:hover{color:var(--ink)}.hud-panel-tabs [aria-selected=true]{border-color:var(--line);background:var(--paper);color:var(--ink)}.hud-panel-tabs :focus-visible{outline-offset:2px}
/* A panel that scrolls shows it at the cut edge: covers in the panel's paper ride with the content and hide an ink shade fixed to the edge until there is something beyond it. */
.hud-tab-panel{grid-row:3;grid-column:1;min-width:0;min-height:0;overflow:auto;overscroll-behavior:contain;padding:14px 18px 18px;background:linear-gradient(var(--paper) 40%,transparent) top/100% 24px no-repeat local,linear-gradient(transparent,var(--paper) 60%) bottom/100% 24px no-repeat local,radial-gradient(farthest-side at 50% 0,color-mix(in srgb,var(--ink) 14%,transparent),transparent) top/100% 9px no-repeat,radial-gradient(farthest-side at 50% 100%,color-mix(in srgb,var(--ink) 14%,transparent),transparent) bottom/100% 9px no-repeat var(--paper)}.hud-tab-panel:focus-visible{outline-offset:-3px}
#panel-fiche{display:flex;flex-direction:column;gap:14px}.preview-kind{font:600 13px/1.2 'IBM Plex Mono',monospace;letter-spacing:.06em;text-transform:uppercase;color:var(--purple)}.preview-district{display:block;margin-top:6px;font:600 14px/1.3 'IBM Plex Mono',monospace;color:var(--muted)}
#preview h2{font-size:26px;line-height:1.2;letter-spacing:-.7px;margin:8px 0 0;overflow-wrap:anywhere;text-wrap:balance}
.preview-status{display:flex;align-items:center;gap:8px;margin:0;font:600 14px/1.3 'IBM Plex Mono',monospace;color:var(--muted)}.preview-status i{width:8px;height:8px;border-radius:50%;background:var(--purple)}.preview-status[data-status=done] i{background:#2a8a55}.preview-status[data-status=locked] i{background:var(--muted)}.preview-status[data-status=cached] i{background:var(--hud-cache)}
.preview-order{margin:0;padding-top:14px;border-top:1px solid var(--line);font-size:15px;line-height:1.5;color:var(--muted)}.preview-order-key{display:block;margin-bottom:4px;font:600 12px/1.4 'IBM Plex Mono',monospace;letter-spacing:.08em;text-transform:uppercase}.preview-order-title{display:block;font:650 15px/1.4 Manrope,sans-serif;color:var(--ink)}
#preview .preview-open{display:flex;align-items:center;justify-content:center;gap:12px;min-height:44px;padding:10px 16px;border:0;border-radius:6px;background:var(--purple);color:var(--paper);font:700 15px/1.2 Manrope,sans-serif;text-decoration:none}#preview .preview-open:hover{background:var(--ink);color:var(--paper)}
.jr-log{margin:0;padding:0;list-style:none}.jr-log a{position:relative;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:2px 10px;min-height:44px;padding:9px 6px 9px 12px;border-left:2px solid transparent;border-bottom:1px solid var(--line);color:var(--ink);text-decoration:none;font-size:15px;line-height:1.4}.jr-log a:hover,.jr-log a:focus-visible{background:color-mix(in srgb,var(--purple) 8%,transparent)}.jr-log a[aria-current=true]{border-left-color:var(--purple);background:color-mix(in srgb,var(--purple) 8%,transparent)}
.jr-log code{grid-column:2;grid-row:1;font:600 13px 'IBM Plex Mono',monospace;color:#8a6208;align-self:center}[data-theme=dark] .jr-log code{color:var(--hud-gold)}.jr-copy{grid-column:1;grid-row:1;min-width:0;overflow-wrap:anywhere}.jr-meta{grid-column:1/-1;display:flex;flex-wrap:wrap;gap:2px 12px;font:13px/1.4 'IBM Plex Mono',monospace;color:var(--muted)}.jr-meta [data-district]{color:var(--lane)}
.hud-foot{display:flex;margin-top:10px}.hud-foot a{display:inline-flex;align-items:center;min-height:44px;color:var(--purple);font:650 15px/1.3 Manrope,sans-serif;text-underline-offset:4px}
.hud-empty{margin:0;color:var(--muted);font-size:15px}.hud-group{margin:0 0 18px}.hud-group h3{margin:0 0 4px;font:600 13px/1.4 'IBM Plex Mono',monospace;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}.hud-group :is(a,button){display:flex;align-items:center;justify-content:flex-start;width:100%;min-height:44px;padding:8px 6px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:transparent;color:var(--ink);font:15px/1.4 Manrope,sans-serif;text-align:left;text-decoration:none}.hud-group :is(a,button):hover{color:var(--purple)}.hud-group time{font:inherit}

/* ---- Map: the canvas runs under the panels; its camera frames the safe area (map.js framingArea) ---- */
.port-camera{right:calc(var(--panel) + 3 * var(--inset));bottom:calc(var(--hud-bottom) + 4px)}html:not([data-hud=map]) .port-camera{display:none}
.chart-title{position:absolute;left:calc(var(--rail) + 4 * var(--inset));bottom:calc(var(--hud-bottom) + 24px);pointer-events:none;color:var(--ink)}.chart-title>span{font:14px 'IBM Plex Mono',monospace;letter-spacing:1px}.chart-title p{font-size:28px;line-height:1.2;font-weight:750;margin:12px 0}.stage:has(#map[data-focus-district]:not([data-focus-district="0"])) .chart-title{display:none}

/* ---- Activities: the stage between the band, the rail and the console bar; the map stays rendered and inert behind ---- */
#content-panel{position:absolute;z-index:4;top:var(--stage-top);bottom:var(--hud-bottom);left:calc(var(--rail) + 2 * var(--inset));right:var(--inset);max-width:1320px;margin-inline:auto;display:grid;grid-template-rows:44px minmax(0,1fr);min-height:0;overflow:hidden;border:1px solid var(--line);border-radius:10px;background:var(--paper);box-shadow:0 18px 40px -28px rgb(0 0 0/.35)}
html:not([data-hud=map]) #map-panel{filter:brightness(.65);pointer-events:none}html:not([data-hud=map]) #port-title{display:none}
.stage-bar{display:flex;align-items:center;gap:12px;min-width:0;padding:0 16px 0 8px;border-bottom:1px solid var(--line)}#port-back{display:inline-flex;align-items:center;flex-shrink:0;min-height:44px;padding:0 10px;color:var(--purple);font-size:var(--small-size);text-decoration:none;white-space:nowrap}#stage-title{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--muted);font-size:var(--small-size)}
#main{height:100%;min-height:0;width:100%;max-width:none;margin:0;padding:24px;overflow:auto;overscroll-behavior:contain;grid-row:2}#main:focus{outline-offset:-3px}
/* The stage's own top row now separates a beat from the band: its first line needs less air above it (a checkpoint keeps its own). */
@media(min-width:700px){#main.port-beats .port-beat{padding-top:8px}}

/* ---- Console: one bar at the foot of every screen; its output and completions unfold upward as a sheet of the same material ---- */
.port-console{position:absolute;z-index:8;left:var(--inset);right:var(--inset);bottom:var(--inset);height:var(--deck);min-width:0;transition:box-shadow .18s var(--hud-ease)}.port-console:has(#command:focus){outline:3px solid var(--hud-accent);outline-offset:2px}
#console-form{display:flex;align-items:center;gap:12px;height:100%;min-width:0;padding:0 2px 0 16px;border:0;background:transparent}
.prompt{flex-shrink:0;font:600 16px/1 'IBM Plex Mono',monospace;color:var(--hud-accent)}
#command{flex:1;min-width:0;width:0;height:44px;min-height:44px;padding:0;border:0;outline:0;background:transparent;color:var(--hud-ink);font:var(--mono-size) 'IBM Plex Mono',monospace;box-shadow:none}#command::placeholder{color:var(--hud-dim);opacity:1}
.hud-console-keys{display:flex;gap:3px;flex-shrink:0}.hud-console-keys kbd{display:inline-block;min-width:22px;margin:0;padding:3px 5px;border:1px solid var(--hud-rule);border-radius:4px;font:500 12px/1 'IBM Plex Mono',monospace;text-align:center;color:var(--hud-dim)}
#execute{flex-shrink:0;height:44px;min-height:44px;padding:0 16px;border:0;border-radius:7px;background:var(--hud-accent);color:#0b1b2b;font:700 15px/1 Manrope,system-ui,sans-serif}#execute:hover{background:#b0dcff;color:#0b1b2b}
/* The sheet floats 6 px above the bar (and above the open activity's own footer, --lift, so its primary action stays visible; on the map
   above the bottom sheet's peek, --dock, which stays readable and clickable), sized to its content up to 45% of the screen (a third on
   short landscapes); folded, it is out of view, out of the tab order and silent. It starts at the stage's edge, beside the rail,
   never over it (no rail: the bar's own edge). */
.hud-sheet{--sheet-x:calc(var(--rail) + min(var(--rail),var(--inset)));--sheet-cap:45dvh;position:absolute;left:var(--sheet-x);bottom:calc(100% + var(--dock,0px) + 6px + var(--lift,0px));width:min(calc(100% - var(--sheet-x)),880px);display:none;flex-direction:column;max-height:min(var(--sheet-cap),calc(var(--port-viewport-height,100dvh) - var(--hud-top) - var(--hud-bottom) - var(--lift,0px) - var(--dock,0px) - 12px));overflow:hidden;transform-origin:bottom}@media(max-height:500px){.hud-sheet{--sheet-cap:33dvh;width:min(calc(100% - var(--sheet-x) - var(--panel) - 2 * var(--inset)),880px)}}
.port-console[data-open=true] .hud-sheet{display:flex;animation:hud-unfold .2s var(--hud-ease)}@keyframes hud-unfold{from{opacity:0;transform:translateY(8px)}}.hud-sheet:has(#console-output:empty):has(#completions:empty){display:none}
#console-output{flex:1 1 auto;min-height:0;margin:0;padding:10px 16px 12px;overflow:auto;border:0;background:transparent;color:#e4f0f5;font:var(--mono-size)/22px 'IBM Plex Mono',monospace;white-space:pre-wrap;scroll-padding:8px}#console-output:empty{display:none}#console-output>span{display:block}#console-output .gloss{display:block;color:#b8d2e4;margin-top:6px}#console-output .error{color:var(--hud-error)}#console-output .command{color:var(--hud-gold)}#console-output .status{color:#b8d2e4}
#console-output .console-hit{display:block;min-height:44px;padding:10px 4px;color:#b5d9e7;background:transparent;border:0;text-align:left;font:var(--mono-size)/22px 'IBM Plex Mono',monospace;text-decoration:underline;overflow-wrap:anywhere}
#console-output:focus-visible{outline:3px solid var(--hud-accent);outline-offset:-3px}
#completions{display:flex;gap:6px;flex-wrap:wrap;max-height:132px;overflow:auto;padding:10px 12px;border-top:1px solid var(--hud-rule)}#completions:empty{display:none}#completions button{min-height:44px;padding:4px 12px;border:1px solid var(--hud-rule);border-radius:6px;background:var(--hud-wash);color:var(--hud-ink);font:var(--mono-size) 'IBM Plex Mono',monospace}#completions button:hover{background:var(--hud-wash-strong);color:var(--hud-ink)}

#toast{position:fixed;z-index:15;top:calc(var(--hud-top) + 8px);left:50%;translate:-50% 0;max-width:calc(100vw - 32px);padding:12px 20px;background:var(--ink);color:var(--paper);border-radius:8px;font-size:14px}#toast:empty{display:none}/* The saving warning takes its own row under the band (--warn, set by shell.js): the stage starts below it, as on gitGud. */
html .storage-feedback:not([hidden]){position:absolute;z-index:10;top:var(--hud-top);left:var(--inset);right:var(--inset);max-height:25%;overflow:auto;border:1px solid #e5c28a;border-radius:10px}[data-theme=dark] .storage-feedback:not([hidden]){border-color:#79603a}.port-popover{position:fixed;inset:calc(var(--hud-top) - 4px) var(--inset) auto auto;margin:0;width:min(340px,calc(100vw - 24px));max-height:calc(var(--port-viewport-height,100dvh) - var(--hud-top) - 8px);overflow:auto;padding:16px;background:var(--paper);color:var(--ink);border:1px solid var(--line);border-radius:14px;box-shadow:0 18px 60px #10253630;z-index:12}.port-popover small{display:block;font-size:14px;color:var(--muted)}.port-popover button,.port-popover a{min-height:44px;font-size:14px}.port-popover>button,.port-popover>a{display:flex;align-items:center;width:100%;text-align:left;background:transparent;border:0;color:var(--ink);text-decoration:none}.port-popover .language-switch,.port-preferences{display:flex;gap:8px}.port-preferences{flex-wrap:wrap}.port-preferences button{flex:1 1 40%}.language-switch button{min-width:44px}.port-popover .language-switch{padding-block:8px}.port-popover [aria-pressed=true]{border-color:var(--purple);color:var(--purple)}.port-popover>.port-menu-profile{flex-direction:column;align-items:flex-start;justify-content:center;gap:2px;padding-block:6px}.port-popover .port-menu-other{padding:12px}.port-popover .port-menu-other a{display:flex;align-items:center}.port-popover svg{width:20px;height:20px}.port-popover #motion-toggle{color:var(--purple)}#modal button,#modal input:not([type=checkbox]),#modal select,#modal summary{min-height:44px;font-size:14px}#main.teacher-main{overflow:auto}

/* ---- Narrower desktops and tablets: the rail keeps its glyphs, the readout drops its labels, the profile chip its name ---- */
@media(max-width:1179px){.masthead{grid-template-columns:minmax(106px,1fr) auto auto;gap:8px}.hud-stat{padding:0 9px}.hud-meter{width:56px}.hud-pips{width:56px}.hud-profile{max-width:150px}:root{--panel:260px}}
@media(max-width:1099px){.hud-stat-key{display:none}.hud-meter{display:none}.hud-rail-map span{display:none}.hud-rail-map{min-height:44px}.hud-pips{width:62px}}
@media(max-width:979px){.hud-where #where-name,.hud-where .where-key{display:none}.hud-profile-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.hud-profile{padding:0 4px;max-width:44px}}
@media(max-width:1099px){:root{--rail:48px}.hud-rail{padding-inline:0}.hud-rail-map{width:44px}}
/* The Fiche card leaves the side below 860 px: a bottom sheet over the console bar. Its rest is a handle and a peek (kind, title, action);
   opened, it shows Fiche / Journal / Réponses. Phones and the portrait tablet share it; the tablet's sheet starts beside the rail. */
@media(max-width:859px) and (min-height:500px){
 :root{--panel:0px;--peek:108px}html[data-hud=map]:not([data-port-arrival=true]){--dock:calc(var(--inset) + var(--peek))}
 #preview{--sheet-open:min(60dvh,calc(var(--port-viewport-height,100dvh) - var(--stage-top) - var(--hud-bottom) - 8px));top:auto;left:calc(var(--rail) + 2 * var(--inset));right:var(--inset);bottom:var(--hud-bottom);width:auto;height:var(--peek);max-height:none;display:grid;grid-template-columns:minmax(0,1fr);grid-template-rows:52px 54px minmax(0,1fr);overflow:hidden;border-radius:16px 16px 10px 10px;transition:height .24s var(--hud-ease)}
 #preview[data-sheet=open]{height:var(--sheet-open);grid-template-rows:52px auto minmax(0,1fr)}
 #preview[data-dragging=true]{transition:none}
 .preview-handle{display:grid;place-items:center;grid-row:1;grid-column:1;align-self:center;justify-self:center;width:calc(100% - 16px);height:44px;min-height:44px;padding:0;border:0;background:transparent;border-radius:15px 15px 0 0;touch-action:none;color:var(--muted)}
 .preview-handle::before{content:'';width:36px;height:4px;border-radius:4px;background:var(--muted)}.preview-handle:hover::before{background:var(--purple)}
 #preview .preview-peek{display:flex;align-items:center;gap:8px;grid-row:2;grid-column:1;height:54px;min-height:54px;padding:0 94px 0 12px;font:650 15px/1.3 Manrope,sans-serif;border-radius:0;overflow:hidden;text-overflow:clip}
 /* A title wraps to two lines (the peek keeps its measured 54 px) and only clamps beyond them. */
 #preview .preview-peek span{display:block}.peek-kind{flex:none;color:var(--purple)}.peek-title{min-width:0;display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:2;overflow:hidden;line-height:1.2}.preview-peek i{flex:none;width:8px;height:8px;border-radius:50%;background:var(--purple)}.preview-peek i[data-status=done]{background:var(--correct)}.preview-peek i[data-status=locked]{background:var(--muted)}
 #preview[data-sheet=peek] #panel-fiche{display:contents!important;overflow:visible}#preview[data-sheet=peek] #panel-fiche>*:not(#open-node){display:none}
 #preview[data-sheet=peek] :is(.hud-panel-tabs,.hud-tab-panel:not(#panel-fiche)){display:none}
 #preview[data-sheet=peek] #open-node{position:absolute;right:6px;bottom:5px;height:44px;min-height:44px;padding:0 10px;border-radius:7px;font-size:15px;background:transparent;color:var(--purple);box-shadow:none}
 #preview[data-sheet=peek] #open-node span{display:inline}
 #preview[data-sheet=open] .preview-peek{display:none}#preview[data-sheet=open] .hud-panel-tabs{display:flex;grid-row:2;margin:4px 8px 8px}
 #preview[data-sheet=open] .hud-tab-panel{grid-row:3;margin:6px;padding:6px 10px 14px;scroll-padding:8px}
 #preview[data-sheet=open] #open-node{position:static;flex-shrink:0;min-height:44px}
 /* Rings in the sheet: the peek and the scroller are flush with its clip, so theirs sit inside; every other ring fits the 6 px margins. */
 #preview :focus-visible{outline:3px solid var(--purple);outline-offset:2px}#preview :is(.preview-peek,.hud-tab-panel):focus-visible{outline-offset:-3px}
 .port-camera{right:12px;bottom:calc(var(--hud-bottom) + var(--peek) + 8px)}.chart-title{display:none}
}
/* Compact frames (phones, and screens turned sideways or shortened by a keyboard): thinner gaps and bars, no rail. The activity's own
   top row would cost 44 px of reading height here: its back link rides in the band instead, as an arrow after the mark. */
@media(max-width:699px),(max-height:499px){
 :root{--inset:4px;--bar:44px;--deck:44px;--rail:0px}
 .hud-rail{display:none}#content-panel{z-index:auto;left:var(--inset);max-width:none;grid-template-rows:minmax(0,1fr)}.hud-profile,.hud-stat,#command,#execute{height:44px}
 .stage-bar{display:contents}#stage-title{display:none}#main{grid-row:auto;padding:8px}#content-panel #port-back{position:fixed;z-index:9;top:var(--inset);left:calc(var(--inset) + 60px);justify-content:center;width:44px;height:var(--bar);padding:0;border-radius:7px;background:var(--hud-wash);font-size:0;color:var(--hud-accent)}#port-back::before{content:'←';font-size:22px;line-height:1}#port-back:focus-visible{outline-color:var(--hud-accent)}html:not([data-hud=map]) .hud-where{margin-left:44px}
 .wordmark{padding:0 4px}.hud-where #where-name,.hud-where .where-key{display:none}.hud-console-keys{display:none}#console-form{padding-left:12px;gap:8px}#execute{padding:0 12px}
 .port-popover{top:calc(var(--hud-top) - 4px);right:var(--inset)}.chart-title,.hud-tip{display:none}
 /* The 2-4 px inset leaves no room for a ring outside a control at the viewport edge: the band's and the bar's rings sit inside (Exécuter in the ink, on its accent). */
 .masthead :focus-visible,.port-console :focus-visible,.port-console:has(#command:focus){outline-offset:-3px}#execute:focus-visible{outline-color:var(--hud-panel)}
}
@media(max-width:699px){
 :root{--panel:0px}
 .masthead{grid-template-columns:auto minmax(0,1fr) auto;gap:4px;padding:0 4px}
 .wordmark{font-size:18px}.wordmark-name{display:none}
 html:not([data-hud=map]) .hud-readout{visibility:hidden;width:0;padding:0;overflow:hidden}html[data-hud=map] .hud-where{display:none}
 .hud-readout{justify-self:center;padding:0}.hud-stat{padding:0 6px}.hud-readout .hud-joint{display:none}.hud-stat-key,.hud-pips,.hud-meter{display:none}
}
/* Small phones: the bars take 18% of a 568 px screen, so the open beat gives back the air its own phone layout allowed itself. */
@media(max-width:699px) and (max-height:620px){:root{--inset:2px}#main.port-beats .port-beat{padding-top:4px;gap:10px}#main.port-beats .screen-navigation{min-height:56px}#main.port-beats[data-beat-type=lab-terminal] .beat-body{grid-template-rows:minmax(64px,auto) minmax(110px,1fr)}#main.port-beats[data-beat-type=lab-terminal] .lab-terminal{min-height:110px}}
/* Short landscapes (phones turned sideways): the Fiche stays at the side. */
@media(max-height:499px) and (min-width:700px){:root{--panel:242px;--peek:0px}#preview{top:var(--stage-top);bottom:var(--hud-bottom);left:auto;right:var(--inset);width:var(--panel);height:auto}.hud-pips{width:56px}.hud-profile-name{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}.hud-profile{max-width:44px;padding:0 4px}}
@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}.masthead,.port-console,.hud-sheet{-webkit-backdrop-filter:none!important;backdrop-filter:none!important;background:var(--hud-panel)!important}}html[data-motion=off] *,html[data-motion=off] *::before,html[data-motion=off] *::after{animation:none!important;transition:none!important}html[data-motion=off] :is(.masthead,.port-console){-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--hud-panel)}
#main.teacher-main{display:flex;flex-direction:column;gap:14px;overflow:hidden}
#main.teacher-main>*{flex-shrink:0}
#main.teacher-main #teacher-results{flex:1 1 0;min-height:0;overflow:hidden}
#main.teacher-main:has(.teacher-access){overflow:auto}
@media(max-height:500px){#main.teacher-main{overflow:auto}#main.teacher-main #teacher-results{flex:0 0 auto;min-height:280px;overflow:visible}}
:root{--mono-size:15px}
#modal #copy-code{display:block;width:100%;min-width:0;max-width:100%;min-height:96px;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;font:var(--mono-size)/1.65 'IBM Plex Mono',monospace;padding:14px;resize:vertical}
#modal #copy-code-note{font-size:var(--body-size)}
#console-output :is(.search-result-meta,.search-result-label,.search-result-meta span){font:var(--mono-size)/22px 'IBM Plex Mono',monospace;color:#b8d2e4}
#console-output .ref-row p{font:var(--mono-size)/22px 'IBM Plex Mono',monospace;color:#e4f0f5;margin-block:8px}
#console-output .ref-command{display:flex;align-items:center;gap:12px}
#console-output .ref-command code{flex:1;min-width:0;font:var(--mono-size)/22px 'IBM Plex Mono',monospace;color:#e4f0f5;background:transparent;overflow-wrap:anywhere}
#console-output .copy-button{min-width:44px;flex-shrink:0}
#console-output .ref-command .copy-button,#console-output .console-hit{scroll-margin:8px}
:root{--small-size:15px}
#port-back,#stage-title{font-size:var(--small-size)}
/* The optional editing tools reserve their own space below the harbour. */
.port-app:has(~.live-text-bar){height:calc(var(--port-viewport-height,100dvh) - var(--live-text-height,76px))}
body>.live-text-bar{bottom:calc(100dvh - var(--port-viewport-height,100dvh) - var(--port-viewport-top,0px) + 8px)}

/* The Fiche is a district image, its crew and three measures; all the ink before Ouvrir stays out of the Tab order. */
.preview-heading{display:flex;align-items:center;justify-content:space-between;gap:8px}.preview-heading .preview-status{font-size:14px}.preview-image{--quay:var(--paper);display:flex;flex-direction:column;align-items:center;color:var(--tone);margin:-4px 0 -8px}.preview-image>svg:first-child{display:block;width:100%;height:146px;overflow:visible}.preview-image code{font:13px/1.5 'IBM Plex Mono',monospace;color:var(--muted)}.preview-selected{fill:color-mix(in srgb,var(--ink) 7%,transparent);stroke:var(--ink);stroke-width:2.5;vector-effect:non-scaling-stroke;stroke-linejoin:round}.preview-crew{margin:0;font:14px/1.5 Manrope,sans-serif;color:var(--muted);overflow-wrap:anywhere}.preview-progress{display:grid;grid-template-columns:auto minmax(24px,1fr) auto;align-items:center;gap:7px 10px}.preview-progress .hud-tip-label{font:14px/1.4 Manrope,sans-serif;color:var(--muted)}.preview-progress .hud-tip-value{color:var(--ink)}.preview-progress .hud-tip-bar{background:linear-gradient(90deg,var(--purple) calc(var(--share) * 100%),var(--line) 0)}.preview-command{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;gap:5px 8px;padding-top:10px;border-top:1px solid var(--line)}.preview-command>span{grid-row:1;grid-column:1;font:12px/1.4 'IBM Plex Mono',monospace;color:var(--muted)}.preview-command code{grid-row:2;grid-column:1/-1;font:13px/1.5 'IBM Plex Mono',monospace;color:var(--purple);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:none;padding:0}.preview-command kbd{grid-row:1;grid-column:2;margin:0;font:12px/1.4 'IBM Plex Mono',monospace;color:var(--muted)}
.hud-rail-progress{fill:none;stroke:var(--lane);stroke-width:1.7;transform:rotate(-90deg)}.hud-rail-cache{stroke:var(--hud-cache)}.hud-rail-notch{fill:var(--hud-gold);stroke:var(--paper);stroke-width:1}.hud-rail li.is-highlighted .hud-rail-stop svg{filter:drop-shadow(0 0 4px var(--lane))}.image-stack.is-district-highlighted{filter:drop-shadow(0 0 7px var(--tone))}.district-label.is-district-highlighted{filter:drop-shadow(0 0 4px var(--purple))}
/* A gain lights only the new part of the segmented meter. Every accent is a single pass. */
.hud-stat-layers.is-gaining .hud-meter::after{left:var(--gain-from);right:calc(100% - var(--gain-to));animation:hud-sweep .36s var(--hud-ease) both}.hud-pips path.is-departing{animation:hud-tag-pop .36s var(--hud-ease) both}.hud-stat-incidents.is-alert strong{animation:hud-incident .36s var(--hud-ease) both}
@keyframes hud-tag-pop{40%{transform:scale(1.65);fill:#fff2ba;filter:drop-shadow(0 0 4px var(--hud-gold))}100%{transform:scale(1)}}@keyframes hud-incident{40%{transform:scale(1.18);text-shadow:0 0 12px var(--hud-error)}100%{transform:scale(1)}}
.wordmark{position:relative}.wordmark::after{content:'';position:absolute;left:33px;top:1px;width:21px;height:19px;pointer-events:none;opacity:0;transform-origin:50% 100%;background:center/contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 42'%3E%3Cpath d='M22 40C20 15 5 7 2 18M22 40C24 11 39 3 42 14M22 40V2' fill='none' stroke='%2380c6ff' stroke-width='3' stroke-linecap='round'/%3E%3C/svg%3E")}.wordmark.is-spouting::after{animation:hud-spout .38s var(--hud-ease) both}@keyframes hud-spout{0%{opacity:0;transform:scaleY(.1)}35%{opacity:1;transform:scaleY(1)}100%{opacity:0;transform:translateY(-4px) scale(.9)}}
html[data-motion=on] .hud-stat-layers:is(:hover,:focus) .hud-meter::after{animation-duration:.36s}html[data-motion=on] .hud-stat-images:is(:hover,:focus) .hud-pips path{animation-duration:.32s;animation-delay:0s}
/* The map's picture keeps its viewport. Only the one pane's clip opens, anchored to the Fiche's right edge. */
@media(min-width:700px) and (min-height:500px){
 html[data-hud=map] #preview,html:not([data-hud=map]) #content-panel{view-transition-name:port-pane}
 #map-panel{view-transition-name:port-world}.masthead{view-transition-name:port-band}.port-console{view-transition-name:port-console}.hud-rail{view-transition-name:port-rail}
 ::view-transition{pointer-events:none}::view-transition-group(*){animation:none}::view-transition-old(root){animation:none;opacity:0}::view-transition-new(root){animation:none}
 ::view-transition-old(port-pane),::view-transition-new(port-pane){width:auto;height:auto;inset:0 0 auto auto;mix-blend-mode:normal}
 ::view-transition-group(port-pane){z-index:1}::view-transition-group(port-band),::view-transition-group(port-console),::view-transition-group(port-rail){z-index:2}
 ::view-transition-old(port-world){animation:none;opacity:0}::view-transition-new(port-world){animation:none}
 ::view-transition-old(port-band),::view-transition-old(port-console),::view-transition-old(port-rail){animation:none;opacity:0}::view-transition-new(port-band),::view-transition-new(port-console),::view-transition-new(port-rail){animation:none}
 html[data-fold=open]::view-transition-old(port-pane){z-index:1;transform:translate(var(--pane-x),var(--pane-y));animation:port-fade-out .22s ease-in .12s both}
 html[data-fold=open]::view-transition-new(port-pane){animation:port-reveal .5s cubic-bezier(.4,0,.2,1) both}
 html[data-fold=close]::view-transition-old(port-pane){transform:translate(var(--pane-x),var(--pane-y));animation:port-conceal .5s cubic-bezier(.4,0,.2,1) both,port-fade-out .2s ease-in .28s both}
 html[data-fold=close]::view-transition-new(port-pane){z-index:1;animation:port-fade-in .22s ease-out .24s both}
}
@keyframes port-reveal{from{clip-path:inset(var(--pc-t) var(--pc-r) var(--pc-b) var(--pc-l) round 10px)}to{clip-path:inset(0 round 10px)}}@keyframes port-conceal{from{clip-path:inset(0 round 10px)}to{clip-path:inset(var(--pc-t) var(--pc-r) var(--pc-b) var(--pc-l) round 10px)}}@keyframes port-fade-out{to{opacity:0}}@keyframes port-fade-in{from{opacity:0}}
@media(max-width:699px),(max-height:499px){.preview-image,.preview-crew,.preview-progress,.preview-command{display:none}.preview-heading{display:contents}.preview-heading .preview-status{display:flex}}
@media(min-width:860px) and (min-height:500px){#preview .preview-open{position:sticky;bottom:5px;z-index:1;flex-shrink:0;box-shadow:0 14px 0 10px var(--paper),0 -6px 12px 2px var(--paper)}}

@media(max-width:359px){.where-word{display:none}}
/* Desktop rail: the introduction's four chapters as Roman-numeral stops above the districts, a hairline between; each group trims its own lane.
   Twelve stops and a hairline fit every desktop height by stepping the stop size down (--stop), never by scrolling: the hover cards hang outside the rail. */
@media(min-width:700px) and (min-height:500px){
 .hud-rail{--stop:44px}
 .hud-rail-line li{flex:0 0 var(--stop);min-height:var(--stop)}.hud-rail-stop{width:var(--stop);height:var(--stop);max-height:none}.hud-rail-stop svg{width:calc(var(--stop) * .68);height:calc(var(--stop) * .68)}
 .hud-rail-line li[data-start]::before{top:50%}.hud-rail-line li[data-end]::before{bottom:50%}
 .hud-rail-line li.hud-rail-rule{flex:0 0 14px;min-height:14px}.hud-rail-line li.hud-rail-rule::before{left:13px;right:13px;top:50%;bottom:auto;width:auto;height:1px;margin:0;background:var(--line)}
 .hud-rail li[data-intro] .hud-rail-num{font-size:12px;letter-spacing:-.6px}
 .hud-rail li[data-state=read] .hud-rail-face{fill:color-mix(in srgb,var(--lane) 32%,var(--paper))}
}
@media(min-width:700px) and (min-height:500px) and (max-height:799px){.hud-rail{--stop:40px}}
@media(min-width:700px) and (min-height:500px) and (max-height:699px){.hud-rail{--stop:32px}.hud-rail-line li.hud-rail-rule{flex-basis:10px;min-height:10px}}
@media(min-width:700px) and (min-height:500px) and (max-height:599px){.hud-rail{--stop:24px}.hud-rail-stop svg{width:22px;height:22px}.hud-rail-line li.hud-rail-rule{flex-basis:8px;min-height:8px}}
/* The phone keeps its instruments on every screen; on the map the district stations ride as the band's second row. */
#execute>svg{display:none}
@media(max-width:699px) and (min-height:500px){
 /* --bar stays plain px (map.js reads it as the camera's top): the 44 px band plus the 56 px strip under it. */
 :root{--peek:108px}html[data-hud=map]{--bar:100px}
 .masthead{height:44px;grid-template-columns:minmax(0,1fr) auto 44px;gap:4px;padding:0 2px}
 .wordmark{padding:0;width:32px}.wordmark img{width:32px;height:28px;margin:0}.wordmark::after{left:18px}
 html[data-hud=map] .hud-where,.hud-where{display:flex;margin-left:2px;gap:6px;overflow:visible}.hud-where .hud-joint,.hud-where .where-key,.hud-where #beat-dots{display:none}
 .hud-where #where-name{display:block}.hud-where #where-name[hidden]{display:none}
 html:not([data-hud=map]) .hud-where{margin-left:46px}
 #content-panel #port-back{left:calc(var(--inset) + 36px)}
 #content-panel{z-index:9}.port-console{z-index:10}
 html:not([data-hud=map]) .hud-readout,.hud-readout{visibility:visible;width:auto;overflow:visible;padding:0}
 .hud-stat{padding:0 4px;gap:4px;min-width:44px;flex-direction:column;justify-content:center}
 .hud-stat .hud-stat-key,.hud-total,.hud-stat-images strong,.hud-stat-incidents[data-open="0"]{display:none}
 .hud-stat-layers strong{font-size:15px}.hud-meter{display:block;width:28px;height:3px}.hud-pips{display:block;width:56px;height:10px}
 .hud-profile{width:44px;min-width:44px;border:0;background:transparent}
 #preview{left:var(--inset)}
 /* The strip: the band's second row in its material (square seam, one shadow under both), so band and stations read as one instrument panel.
    On that dark material the stations take the dark theme's tokens and lane tones (beats.css), in either theme. */
 html[data-hud=map] .masthead{border-radius:10px 10px 0 0;box-shadow:inset 0 1px 0 var(--hud-hi),0 0 0 1px var(--hud-edge)}
 html[data-hud=map] .hud-rail{--paper:var(--hud-panel);--ink:var(--hud-ink);--line:var(--hud-rule);--muted:var(--hud-dim);--purple:var(--hud-accent);--district-1:#80c6ff;--district-2:#e5ba68;--district-3:#91bbef;--district-4:#7cd1d2;--district-5:#9bcea4;--district-6:#d3b286;--district-7:#cfabe2;--district-8:#e5b097;
  display:flex;flex-direction:row;top:calc(var(--inset) + 44px);bottom:auto;right:var(--inset);width:auto;height:56px;padding:0 3px;border:0;border-radius:0 0 10px 10px;background:var(--hud-glass);-webkit-backdrop-filter:blur(14px) saturate(1.25);backdrop-filter:blur(14px) saturate(1.25);box-shadow:0 0 0 1px var(--hud-edge),var(--hud-shadow)}
 html[data-motion=off][data-hud=map] .hud-rail{-webkit-backdrop-filter:none;backdrop-filter:none;background:var(--hud-panel)}
 @media(prefers-reduced-motion:reduce){html[data-hud=map] .hud-rail{-webkit-backdrop-filter:none!important;backdrop-filter:none!important;background:var(--hud-panel)!important}}
 html[data-hud=map] .hud-rail .hud-rail-map{display:none}
 html[data-hud=map] .hud-rail .hud-rail-line{flex-direction:row;justify-content:flex-start;width:100%;min-width:0;height:54px;min-height:54px;margin-top:1px;padding:5px;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain;scroll-snap-type:x mandatory;scrollbar-width:none;mask-image:linear-gradient(90deg,transparent,#000 var(--cut-start,0px),#000 calc(100% - var(--cut-end,0px)),transparent)}
 html[data-hud=map] .hud-rail .hud-rail-line::-webkit-scrollbar{display:none}html[data-hud=map] .hud-rail .hud-rail-line[data-cut-start]{--cut-start:12px}html[data-hud=map] .hud-rail .hud-rail-line[data-cut-end]{--cut-end:12px}
 html[data-hud=map] .hud-rail .hud-rail-line li{flex:1 0 44px;min-width:44px;min-height:44px;height:44px;scroll-snap-align:center}
 html[data-hud=map] .hud-rail .hud-rail-stop{width:44px;height:44px;min-width:44px;max-height:none;aspect-ratio:auto}
 html[data-hud=map] .hud-rail .hud-rail-stop svg{width:36px;height:36px}html[data-hud=map] .hud-rail .hud-rail-num{font-size:15px}
 html[data-hud=map] .hud-rail .hud-rail-line li::before{left:0;right:0;top:50%;bottom:auto;width:auto;height:2px;margin:0}html[data-hud=map] .hud-rail .hud-rail-line li:first-child::before{left:50%}html[data-hud=map] .hud-rail .hud-rail-line li:last-child::before{right:50%}
 html[data-hud=map] .hud-rail li[data-head] .hud-rail-stop::before{width:36px;height:36px;box-shadow:0 0 0 1px var(--paper),0 0 0 3px var(--ink)}
 html[data-hud=map] .hud-rail .hud-rail-tip{display:none}
 .port-camera button,.port-popover :is(button,a){font-size:15px}
 #execute{width:44px;min-width:44px;padding:0;display:grid;place-items:center}#execute>span{display:none}#execute>svg{display:block;width:22px;height:22px;fill:currentColor}
 #console-form{padding-left:10px;gap:6px}.hud-sheet{--sheet-x:0px}
 html[data-hud=map] #preview,html:not([data-hud=map]) #content-panel{view-transition-name:port-pane}
 #map-panel{view-transition-name:port-world}.masthead{view-transition-name:port-band}.port-console{view-transition-name:port-console}
 ::view-transition{pointer-events:none}::view-transition-group(*){animation:none}::view-transition-old(root){animation:none;opacity:0}::view-transition-new(root){animation:none}
 ::view-transition-old(port-pane),::view-transition-new(port-pane){width:auto;height:auto;inset:0 0 auto auto;mix-blend-mode:normal}
 ::view-transition-group(port-pane){z-index:1}::view-transition-group(port-band),::view-transition-group(port-console){z-index:2}
 ::view-transition-old(port-world),::view-transition-old(port-band),::view-transition-old(port-console){animation:none;opacity:0}::view-transition-new(port-world),::view-transition-new(port-band),::view-transition-new(port-console){animation:none}
 html[data-fold=open]::view-transition-old(port-pane){z-index:1;transform:translate(var(--pane-x),var(--pane-y));animation:port-fade-out .12s ease-in .08s both}
 html[data-fold=open]::view-transition-new(port-pane){animation:port-reveal .28s cubic-bezier(.4,0,.2,1) both}
 html[data-fold=close]::view-transition-old(port-pane){transform:translate(var(--pane-x),var(--pane-y));animation:port-conceal .28s cubic-bezier(.4,0,.2,1) both,port-fade-out .12s ease-in .16s both}
 html[data-fold=close]::view-transition-new(port-pane){z-index:1;animation:port-fade-in .12s ease-out .16s both}
}
