/* Self-hosted fonts (Latin subset, WOFF2). No requests to Google: visitors' browsers only talk to genx.study. */
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/oswald-500.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/oswald-600.woff2') format('woff2'); }
@font-face { font-family: 'Oswald'; font-style: normal; font-weight: 700; font-display: swap; src: url('../fonts/oswald-700.woff2') format('woff2'); }
@font-face { font-family: 'Special Elite'; font-style: normal; font-weight: 400; font-display: optional; src: url('../fonts/special-elite-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/plex-mono-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Mono'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/plex-mono-600.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 400; font-display: swap; src: url('../fonts/plex-sans-400.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 500; font-display: swap; src: url('../fonts/plex-sans-500.woff2') format('woff2'); }
@font-face { font-family: 'IBM Plex Sans'; font-style: normal; font-weight: 600; font-display: swap; src: url('../fonts/plex-sans-600.woff2') format('woff2'); }

/* Project Latchkey — styles.
   Layout: one centered column (max 560px) that turns into a different room every few questions;
   the dossier is paper on a dark desk. Deliberate single dark look. */
:root {
  color-scheme: dark;
  --void: #0B0B0A; --charcoal: #1A1A18; --graphite: #2B2A27; --line: #3A3833;
  --beige: #CFC6B0; --paper: #EDE7D9; --paper-2: #E4DDCC; --paper-3: #F7F3EA;
  --ink: #1C1B19; --ink-quiet: #5A5448;
  --amber: #FFB000; --phosphor: #7FB77E; --redline: #E5594E; --steel: #7C8A92; --brass: #C9A24B;
  --text: #EDE7D9; --text-quiet: #A8A196;
  --signal: var(--amber); --room-bg: var(--charcoal);
  --f-mono: 'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
  --f-head: 'Oswald', 'Arial Narrow', 'Helvetica Neue', sans-serif;
  --f-type: 'Special Elite', 'Courier New', Courier, monospace;
  --f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}
body.room-media   { --room-bg: #15120E; }
body.room-field   { --room-bg: #1C1814; --signal: #E0A040; }
body.room-radio   { --room-bg: #0E1110; --signal: var(--phosphor); }
body.room-screen  { --room-bg: #141516; --signal: #D8DEE2; }
body.room-alert   { --room-bg: #120D0C; --signal: var(--redline); }
body.room-network { --room-bg: #070A07; --signal: var(--phosphor); }
body.room-vault   { --room-bg: #0D0C0A; --signal: var(--brass); }

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--room-bg); color: var(--text); font-family: var(--f-body); font-size: 16px; line-height: 1.5; transition: background-color .8s ease; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
[hidden] { display: none !important; }
/* On paper, "red" is a darker ink red and focus rings are ink, so both stay readable on beige. */
.paper, .folder-cover { --redline: #A62B22; }
.paper :focus-visible { outline-color: var(--ink); }
.sr-live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.grain { position: fixed; inset: -10%; pointer-events: none; z-index: 50; opacity: .05;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite; }
@keyframes grain { 0%{transform:translate(0,0)} 25%{transform:translate(-3%,2%)} 50%{transform:translate(2%,-3%)} 75%{transform:translate(-2%,-1%)} 100%{transform:translate(1%,3%)} }

.shell { min-height: 100%; display: flex; flex-direction: column; padding-inline: 16px; padding-block: 12px calc(80px + env(safe-area-inset-bottom, 0px)); }
.column { position: relative; z-index: 1; width: 100%; max-width: 560px; margin-inline: auto; display: flex; flex-direction: column; gap: 16px; flex: 1; }

/* HUD */
.hud { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--signal); min-height: 44px; }
.hud-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.hud-phase { text-transform: uppercase; }
.readout { background: none; border: none; padding: 0; text-align: left; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: var(--text-quiet); min-height: 20px; }
.readout[data-live="true"] { text-decoration: underline dotted; text-underline-offset: 3px; }
.icon-btn { width: 44px; height: 44px; flex: none; display: grid; place-items: center; background: transparent; border: 1px solid var(--line); border-radius: 6px; color: var(--beige); }
.icon-btn[aria-pressed="true"] { color: var(--signal); border-color: var(--signal); }

.stage { flex: 1; display: flex; flex-direction: column; }
.scene { display: flex; flex-direction: column; gap: 20px; animation: sceneIn .35s ease both; }
@keyframes sceneIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.scene.powerdown { animation: powerdown .5s ease-in forwards; }
@keyframes powerdown { 0% { transform: scale(1); filter: brightness(1); } 60% { transform: scaleY(.02); filter: brightness(3); } 100% { transform: scale(0); opacity: 0; } }

.eyebrow { font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; color: var(--signal); text-transform: uppercase; }
.q-prompt { font-weight: 500; font-size: clamp(24px, 6.4vw, 32px); line-height: 1.22; margin: 0; text-wrap: balance; color: var(--text); }
.q-sub { margin: 0; color: var(--text-quiet); font-size: 15px; }

/* ambient layers */
.amb { position: fixed; pointer-events: none; z-index: 0; }
.amb.flicker { inset: 0 0 auto 0; height: 40vh; background: radial-gradient(ellipse at 50% 0%, rgba(230,240,255,.10), transparent 70%); animation: flick 1.4s steps(1) 1 both; }
@keyframes flick { 0%{opacity:0} 10%{opacity:1} 14%{opacity:.2} 20%{opacity:1} 26%{opacity:.4} 32%{opacity:1} 100%{opacity:1} }
.amb.tvglow { inset: auto 0 0 0; height: 60vh; background: radial-gradient(ellipse at 50% 100%, rgba(120,160,255,.10), transparent 65%); animation: tvglow 3s ease-in-out infinite; }
@keyframes tvglow { 50% { opacity: .6; } }
.amb.lamp { left: -20vw; top: -20vh; width: 90vw; height: 70vh; background: radial-gradient(circle, rgba(255,190,110,.13), transparent 60%); }
.amb.radar { right: -30vmin; bottom: -30vmin; width: 90vmin; height: 90vmin; border-radius: 50%; opacity: .5;
  background: repeating-radial-gradient(circle, transparent 0 11.5%, rgba(127,183,126,.14) 11.5% 12%), conic-gradient(from 0deg, rgba(127,183,126,.22), transparent 18%, transparent);
  animation: sweep 6s linear infinite; }
@keyframes sweep { to { transform: rotate(360deg); } }
.amb.overhead { inset: 0 0 auto 0; height: 55vh; background: radial-gradient(ellipse at 50% -10%, rgba(235,240,245,.16), transparent 62%); }
.amb.alarm { inset: 0; background: radial-gradient(ellipse at 50% 0%, rgba(200,55,45,.28), transparent 60%); animation: alarm 1.6s ease-in-out infinite; }
@keyframes alarm { 50% { opacity: .35; } }
.amb.scan { inset: 0; background: repeating-linear-gradient(0deg, rgba(127,183,126,.035) 0 1px, transparent 1px 4px); }
.amb.vignette { inset: 0; background: radial-gradient(ellipse at center, transparent 45%, rgba(0,0,0,.6)); }

/* ---------- BOOT ---------- */
.crt { position: relative; background: #050505; border-radius: 22px; padding: 18px; border: 10px solid #22211E; box-shadow: inset 0 0 0 2px #0F0F0D, 0 20px 50px rgba(0,0,0,.6); }
.crt-screen { position: relative; min-height: min(340px, 42vh); border-radius: 14px; padding: 20px 18px; overflow: hidden; background: radial-gradient(ellipse at center, #16120A 0%, #070605 75%); animation: crtOn .9s ease-out both; }
.crt-screen::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.28) 0 1px, transparent 1px 3px); }
@keyframes crtOn { 0% { transform: scaleY(.004) scaleX(.3); filter: brightness(4); } 40% { transform: scaleY(.004) scaleX(1); } 100% { transform: none; filter: none; } }
.boot-text { margin: 0; font-family: var(--f-mono); font-size: 14px; line-height: 1.75; color: var(--amber); white-space: pre-wrap; text-shadow: 0 0 6px rgba(255,176,0,.45); }
.boot-text .dim { color: #9C7A2A; text-shadow: none; }
.redact { background: var(--amber); color: var(--amber); padding: 0 2px; }
.cursor { display: inline-block; width: 9px; height: 16px; background: var(--amber); vertical-align: -3px; animation: blink 1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.boot-foot { display: flex; flex-direction: column; gap: 14px; }
.boot-foot p { margin: 0; }
.tagline { font-family: var(--f-type); font-size: 19px; line-height: 1.4; color: var(--paper); }
.counter { font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; color: var(--text-quiet); }

.btn { min-height: 56px; border-radius: 6px; border: none; background: var(--signal); color: var(--ink); font-family: var(--f-head); font-weight: 600; font-size: 18px; letter-spacing: .14em; text-transform: uppercase; padding: 0 22px; transition: transform .12s, filter .12s; }
.btn:active { transform: translateY(2px); filter: brightness(.9); }
.btn-ghost { min-height: 48px; border-radius: 6px; background: transparent; color: var(--paper); border: 1px solid #5A5448; font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; padding: 0 16px; }
.btn[disabled], .btn-ghost[disabled] { opacity: .45; cursor: not-allowed; }
.privacy-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: var(--beige); }
.privacy-strip a { color: var(--beige); }

/* ---------- PAPER ---------- */
.paper { background: var(--paper); color: var(--ink); border-radius: 3px; padding: 22px 20px 24px; box-shadow: 0 1px 0 var(--beige), 0 18px 40px rgba(0,0,0,.45); position: relative; }
.paper .eyebrow { color: var(--ink-quiet); }
.form-head { display: flex; flex-direction: column; gap: 4px; border-bottom: 2px solid var(--ink); padding-bottom: 12px; margin-bottom: 18px; }
.form-head h2 { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: 24px; letter-spacing: .04em; line-height: 1.1; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.field label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-quiet); text-transform: uppercase; }
.field input, .field select { background: transparent; border: none; border-bottom: 2px solid var(--ink); border-radius: 0; padding: 8px 2px; font-family: var(--f-type); font-size: 24px; color: var(--ink); width: 100%; }
.field select { font-size: 19px; appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 14px) 55%, calc(100% - 8px) 55%; background-size: 6px 6px; background-repeat: no-repeat; }
.field input:focus, .field select:focus { outline: none; border-bottom-color: var(--redline); }
.field input:focus-visible, .field select:focus-visible { outline: 3px solid var(--ink); outline-offset: 4px; }
.field .hint { font-size: 13px; color: var(--ink-quiet); }
.error { color: var(--redline); font-size: 14px; font-weight: 500; min-height: 20px; margin: 0; }

.tier-card { text-align: center; align-items: center; padding-top: 12vh; }
.stamp { display: inline-block; border: 3px solid var(--redline); border-radius: 4px; padding: 4px 12px; font-family: var(--f-head); font-weight: 700; letter-spacing: .14em; color: var(--redline); text-transform: uppercase; transform: rotate(-6deg); }
.stamp.slam { animation: slam .45s cubic-bezier(.2,1.6,.4,1) both; }
@keyframes slam { 0% { transform: rotate(-6deg) scale(2.4); opacity: 0; } 60% { opacity: 1; } 100% { transform: rotate(-6deg) scale(1); opacity: .9; } }
.stamp.orange { border-color: #C9661C; color: #C9661C; }

/* ---------- ROOM CARDS & MILESTONES ---------- */
.room-card { flex: 1; justify-content: center; align-items: flex-start; min-height: 60vh; }
.room-num { font-family: var(--f-mono); font-size: 13px; letter-spacing: .2em; color: var(--signal); }
.room-name { font-family: var(--f-head); font-weight: 700; font-size: clamp(46px, 14vw, 76px); line-height: .92; margin: 0; text-transform: uppercase; color: var(--paper); text-wrap: balance; }
.room-rule { width: 120px; height: 3px; background: var(--signal); }
.room-meta { font-family: var(--f-mono); font-size: 12px; letter-spacing: .12em; color: var(--text-quiet); display: flex; flex-direction: column; gap: 4px; }
.glitch { animation: glitch .5s steps(2) 1; }
@keyframes glitch { 0% { transform: translate(0); clip-path: inset(0); } 20% { transform: translate(-6px, 2px); clip-path: inset(10% 0 60% 0); } 40% { transform: translate(5px,-2px); clip-path: inset(50% 0 20% 0); } 60% { transform: translate(-3px,1px); clip-path: inset(0); } 100% { transform: none; } }
.terminal { background: #0B0B0A; border: 1px solid var(--line); border-radius: 8px; padding: 18px; font-family: var(--f-mono); font-size: 16px; line-height: 1.6; color: var(--signal); min-height: 120px; }
.terminal p { margin: 0 0 10px; }
.terminal .you { color: var(--paper); }
.diag { display: flex; flex-direction: column; gap: 10px; background: #0E0D0B; border: 1px solid var(--line); border-radius: 8px; padding: 16px; }
.meters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 18px; }
.meter { display: flex; flex-direction: column; gap: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; color: var(--text-quiet); }
.meter-track { height: 6px; background: var(--graphite); overflow: hidden; }
.meter-fill { height: 100%; width: 10%; background: var(--signal); transition: width .5s ease; }
.redacted-val { font-family: var(--f-mono); font-size: 11px; color: var(--redline); letter-spacing: .12em; }
.good { font-family: var(--f-mono); font-size: clamp(56px, 18vw, 96px); color: var(--phosphor); text-shadow: 0 0 18px rgba(127,183,126,.5); margin: 0; }
.fade-black { position: fixed; inset: 0; background: #000; z-index: 40; display: grid; place-items: center; font-family: var(--f-mono); color: var(--amber); animation: fadeIn 1.2s ease both; padding: 16px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ---------- CHASSIS: KEYS ---------- */
.keys { display: flex; flex-direction: column; gap: 10px; }
.key { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 60px; padding: 12px 16px; text-align: left;
  background: linear-gradient(#D8CFBA, #C4BAA2); color: var(--ink); border: 1px solid #8F8672; border-radius: 8px;
  box-shadow: 0 4px 0 #857C68, 0 6px 10px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.5);
  font-size: 17px; font-weight: 500; transition: transform .1s, box-shadow .1s; }
.key:active, .key[aria-pressed="true"] { transform: translateY(4px); box-shadow: 0 0 0 #857C68, 0 1px 3px rgba(0,0,0,.35), inset 0 1px 0 rgba(255,255,255,.4); }
.kno { flex: none; width: 28px; height: 28px; display: grid; place-items: center; border-radius: 4px; background: var(--ink); color: var(--beige); font-family: var(--f-mono); font-size: 13px; }
.key[aria-pressed="true"] .kno { background: var(--signal); color: var(--ink); }
.key .ksub { display: block; font-size: 13px; font-weight: 400; opacity: .9; }
/* dark / steel / vault skins */
.keys.dark .key, .keys.vault .key { background: linear-gradient(#2E3431, #232826); color: var(--paper); border-color: #0A0C0B; box-shadow: 0 4px 0 #0A0C0B, 0 6px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(255,255,255,.08); }
.keys.dark .kno { background: #0A0C0B; color: var(--phosphor); }
.keys.vault .key { background: linear-gradient(#26231E, #1B1915); border-color: #5E4E2A; box-shadow: 0 4px 0 #3D331C, 0 6px 10px rgba(0,0,0,.5), inset 0 1px 0 rgba(201,162,75,.18); }
.keys.vault .kno { background: #0D0C0A; color: var(--brass); border: 1px solid #5E4E2A; }
.keys.steel .key { background: linear-gradient(#D5DADC, #AEB5B9); border-color: #6F777B; box-shadow: 0 4px 0 #6F777B, 0 6px 10px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.7); }
.keys.dark .key:active, .keys.dark .key[aria-pressed="true"], .keys.vault .key:active, .keys.vault .key[aria-pressed="true"] { box-shadow: 0 0 0 #000, inset 0 1px 0 rgba(255,255,255,.05); }
/* VCR deck */
.deck { background: linear-gradient(#3A3A3C, #202022); border-radius: 10px; padding: 14px; border: 1px solid #0C0C0D; box-shadow: 0 14px 30px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 12px; }
.deck-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.deck-slot { flex: 1; height: 26px; border-radius: 3px; background: #0A0A0B; box-shadow: inset 0 2px 4px #000; }
.deck-clock { font-family: var(--f-mono); font-size: 15px; color: #6CF08A; background: #0A0A0B; padding: 2px 8px; border-radius: 3px; letter-spacing: .08em; text-shadow: 0 0 6px rgba(108,240,138,.6); animation: blink 1s steps(1) infinite; }
.keys.vcr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.keys.vcr .key { flex-direction: column; align-items: flex-start; gap: 6px; min-height: 84px; background: linear-gradient(#C9CBCE, #9EA2A6); border-color: #55595D; box-shadow: 0 4px 0 #55595D, 0 6px 10px rgba(0,0,0,.4), inset 0 1px 0 rgba(255,255,255,.6); font-family: var(--f-mono); font-size: 14px; letter-spacing: .08em; }
.keys.vcr .key:last-child:nth-child(odd) { grid-column: 1 / -1; }
.keys.vcr .kicon { width: 28px; height: 18px; }
/* cassette piano keys */
.tapedeck { position: relative; background: linear-gradient(#2A2825, #1A1917); border-radius: 10px; padding: 14px; box-shadow: 0 14px 30px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 14px; }
.cassette { position: relative; height: 92px; margin-right: 96px; border-radius: 8px; background: #E9E2D0; border: 2px solid #2A2825; display: flex; align-items: center; justify-content: space-around; padding: 0 24px; }
.cassette::before { content: "C-90 · SIDE A · FOR YOU"; position: absolute; top: 8px; left: 14px; right: 14px; font-family: var(--f-type); font-size: 12px; color: var(--ink); border-bottom: 1px solid #B7AE98; padding-bottom: 2px; white-space: nowrap; overflow: hidden; }
.reel { width: 34px; height: 34px; border-radius: 50%; border: 6px dotted #2A2825; margin-top: 18px; animation: sweep 4s linear infinite; }
.pencil { position: absolute; top: 38px; right: 14px; width: 84px; height: 48px; background: none; border: none; padding: 0; }
.pencil::before { content: ""; position: absolute; left: 0; right: 0; top: 18px; height: 12px; border-radius: 2px; background: linear-gradient(90deg, #E8B04A 0 78%, #E9C9A0 78% 92%, #333 92%); transform: rotate(-24deg); }
.keys.cassette .key { background: linear-gradient(#EFEFEA, #C9C7BE); border-color: #77756C; }
/* switches (single) */
.keys.switch { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.keys.switch .key { flex-direction: column; align-items: center; text-align: center; gap: 10px; min-height: 130px; background: linear-gradient(#171C18, #0D100E); color: var(--paper); border-color: #2C332F; box-shadow: 0 6px 14px rgba(0,0,0,.5); font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; }
.rocker { width: 34px; height: 56px; border-radius: 6px; background: #2C332F; position: relative; box-shadow: inset 0 2px 4px #000; }
.rocker::after { content: ""; position: absolute; left: 4px; right: 4px; top: 4px; height: 24px; border-radius: 4px; background: linear-gradient(#5A625D, #3A413D); transition: top .15s; }
.keys.switch .key[aria-pressed="true"] .rocker::after { top: 28px; background: var(--phosphor); box-shadow: 0 0 10px var(--phosphor); }
.keys.switch .key .kno { display: none; }
/* final keys */
.keys.final { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.keys.final .key { min-height: 110px; justify-content: center; text-align: center; font-family: var(--f-head); font-size: 20px; letter-spacing: .1em; background: linear-gradient(#26231E, #1B1915); color: var(--paper); border-color: #5E4E2A; box-shadow: 0 5px 0 #3D331C, 0 8px 14px rgba(0,0,0,.5); }
.keys.final .kno { display: none; }
/* map */
.mapsheet { position: relative; border-radius: 4px; padding: 16px; background:
  linear-gradient(rgba(237,231,217,.9), rgba(237,231,217,.9)),
  repeating-linear-gradient(90deg, transparent 0 58px, rgba(90,84,72,.35) 58px 60px),
  repeating-linear-gradient(0deg, transparent 0 58px, rgba(90,84,72,.35) 58px 60px), #EDE7D9;
  color: var(--ink); box-shadow: 0 16px 36px rgba(0,0,0,.5); }
.mapsheet::before { content: ""; position: absolute; inset: 0; pointer-events: none; background:
  linear-gradient(135deg, transparent 48%, rgba(200,55,45,.35) 48.5%, rgba(200,55,45,.35) 49.5%, transparent 50%),
  radial-gradient(circle at 78% 22%, rgba(127,183,126,.35) 0 16%, transparent 17%); }
.mapsheet .key { background: rgba(247,243,234,.95); box-shadow: 0 3px 0 #9C9380, 0 4px 8px rgba(0,0,0,.2); }
.claim { display: flex; flex-direction: column; gap: 12px; }
/* answering machine */
.machine { background: linear-gradient(#302E2A, #22211E); border-radius: 14px; padding: 16px; border: 1px solid #0F0F0D; box-shadow: 0 12px 30px rgba(0,0,0,.55); display: flex; flex-direction: column; gap: 14px; }
.machine-top { display: flex; align-items: center; gap: 12px; }
.lcd { flex: 1; background: #8FA27D; color: #1E2A17; border-radius: 4px; padding: 8px 10px; font-family: var(--f-mono); font-size: 14px; letter-spacing: .08em; box-shadow: inset 0 2px 4px rgba(0,0,0,.35); }
.led { width: 12px; height: 12px; border-radius: 50%; background: var(--redline); box-shadow: 0 0 10px var(--redline); animation: blink 1.1s steps(1) infinite; }
.tape { font-family: var(--f-type); font-size: 17px; color: var(--beige); line-height: 1.5; margin: 0; }
.tape .static { color: var(--steel); letter-spacing: .2em; }

/* ---------- CHASSIS: PICK ---------- */
.cabinet { background: linear-gradient(#CFC6B0, #B9AF97); border-radius: 8px; padding: 14px 12px 16px; border: 1px solid #8F8672; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.cabinet-label { display: flex; justify-content: center; margin-bottom: 12px; }
.cabinet-label span { font-family: var(--f-type); font-size: 13px; color: var(--ink); background: var(--paper-3); border: 1px solid #8F8672; padding: 2px 12px; }
.picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; }
.pick { position: relative; min-height: 84px; padding: 22px 12px 12px; text-align: left; border: none; color: var(--ink); font-family: var(--f-type); font-size: 15px; line-height: 1.3; transition: transform .15s, box-shadow .15s; min-width: 0; overflow-wrap: anywhere; }
.pick:last-child:nth-child(odd) { grid-column: 1 / -1; }
/* folders */
.picks.folders .pick { background: #D9B96E; border-radius: 0 6px 6px 6px; box-shadow: 0 2px 0 #A88A43; }
.picks.folders .pick::before { content: attr(data-tab); position: absolute; left: 0; top: -12px; height: 14px; padding: 0 10px; background: inherit; border-radius: 5px 5px 0 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; line-height: 16px; color: #6B5620; }
.picks.folders .pick[aria-pressed="true"] { transform: translateY(-8px); background: #E7C97F; box-shadow: 0 8px 14px rgba(0,0,0,.35); }
/* evidence board */
.cork { border-radius: 8px; padding: 18px 14px; border: 10px solid #5B4128; background: #B98A58 radial-gradient(rgba(0,0,0,.12) 1px, transparent 1.5px) 0 0 / 6px 6px; box-shadow: 0 14px 30px rgba(0,0,0,.5); }
.picks.evidence .pick { background: var(--paper-3); padding-top: 26px; box-shadow: 0 6px 10px rgba(0,0,0,.3); background-image: linear-gradient(transparent 22px, rgba(200,55,45,.4) 22px 23px, transparent 23px), repeating-linear-gradient(transparent 0 23px, rgba(90,110,160,.25) 23px 24px); }
.picks.evidence .pick:nth-child(odd) { transform: rotate(-1.5deg); } .picks.evidence .pick:nth-child(even) { transform: rotate(1.2deg); }
.picks.evidence .pick::before { content: ""; position: absolute; top: 6px; left: 50%; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, #F26A5D, #9E1F16); box-shadow: 0 2px 3px rgba(0,0,0,.4); }
.picks.evidence .pick[aria-pressed="true"] { transform: scale(1.04) rotate(0); outline: 3px solid var(--redline); outline-offset: 2px; }
/* tags */
.picks.tags .pick { background: #E9DFC6; border-radius: 4px 14px 14px 4px; padding: 14px 14px 14px 30px; min-height: 60px; font-family: var(--f-type); box-shadow: 0 3px 6px rgba(0,0,0,.35); }
.picks.tags .pick::before { content: ""; position: absolute; left: 10px; top: 50%; width: 10px; height: 10px; margin-top: -5px; border-radius: 50%; background: var(--room-bg); box-shadow: inset 0 0 0 2px #9C9380; }
.picks.tags .pick[aria-pressed="true"] { background: var(--signal); }
/* vault */
.picks.vault .pick { background: #1B1915; color: var(--paper); border: 1px solid #5E4E2A; border-radius: 6px; padding: 16px 14px; min-height: 64px; font-family: var(--f-body); font-size: 16px; }
.picks.vault .pick[aria-pressed="true"] { background: #2A2419; border-color: var(--brass); box-shadow: 0 0 0 1px var(--brass) inset; }

/* ---------- CHASSIS: FORM ---------- */
.checklist { display: flex; flex-direction: column; gap: 4px; border: none; margin: 0; padding: 0; }
.checklist legend { padding: 0; margin-bottom: 14px; font-weight: 500; font-size: clamp(22px, 5.8vw, 28px); line-height: 1.25; color: var(--ink); text-wrap: balance; }
.check { display: flex; align-items: center; gap: 14px; min-height: 52px; padding: 6px 4px; border-bottom: 1px dashed #B3AA95; font-family: var(--f-type); font-size: 18px; color: var(--ink); cursor: pointer; }
.check input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.box { flex: none; position: relative; width: 26px; height: 26px; border: 2px solid var(--ink); }
.check input:checked + .box::after { content: "X"; position: absolute; inset: -8px -4px 0 2px; font-family: var(--f-type); font-size: 32px; line-height: 1; color: var(--redline); }
.check input:focus-visible + .box { outline: 3px solid var(--redline); outline-offset: 3px; }

/* ---------- CHASSIS: DIAL ---------- */
.tuner { background: linear-gradient(#262B28, #1A1E1C); border: 1px solid #0A0C0B; border-radius: 12px; padding: 18px; display: flex; gap: 18px; align-items: center; box-shadow: 0 12px 30px rgba(0,0,0,.5); flex-wrap: wrap; }
.tuner.tv { background: linear-gradient(#5B4632, #3D2E20); border-color: #22190F; }
.tvscreen { flex: 1 1 100%; height: 120px; border-radius: 18px / 26px; background: radial-gradient(ellipse at center, #33403F, #0B0F10 80%); border: 8px solid #1A140E; display: grid; place-items: center; font-family: var(--f-mono); font-size: 15px; color: #CFE3E6; text-align: center; padding: 8px 16px; position: relative; overflow: hidden; }
.tvscreen::after { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(0,0,0,.25) 0 1px, transparent 1px 3px); }
.tvscreen.snow { background: #111 url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='120' height='120'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='1.4' numOctaves='1'/></filter><rect width='100%' height='100%' filter='url(%23n)' opacity='.9'/></svg>"); }
.knob-wrap { flex: none; display: flex; flex-direction: column; align-items: center; gap: 8px; margin-inline: auto; }
.knob { width: 120px; height: 120px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4A504C, #1B1F1D 70%); box-shadow: 0 6px 14px rgba(0,0,0,.6), inset 0 2px 2px rgba(255,255,255,.1); position: relative; transition: transform .45s cubic-bezier(.3,1.4,.5,1); }
.tv .knob { background: radial-gradient(circle at 40% 35%, #E5DCC6, #9C9179 70%); }
.knob::after { content: ""; position: absolute; left: 50%; top: 10px; width: 4px; height: 32px; margin-left: -2px; border-radius: 2px; background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.tv .knob::after { background: var(--ink); box-shadow: none; }
.knob-ticks { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: #B5C0C6; }
.stations { flex: 1 1 220px; display: flex; flex-direction: column; gap: 6px; border: none; margin: 0; padding: 0; min-width: 0; }
.station { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 12px; border-radius: 6px; font-family: var(--f-mono); font-size: 14px; color: var(--paper); cursor: pointer; border: 1px solid transparent; }
.station input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.station .ch { flex: none; font-size: 11px; color: var(--steel); width: 38px; }
.tv .station .ch { color: #D8C9A8; }
.station:has(input:checked) { border-color: var(--signal); background: rgba(255,255,255,.05); }
.station:has(input:checked) .ch { color: var(--signal); }
.station:has(input:focus-visible) { outline: 3px solid var(--signal); outline-offset: 2px; }

/* ---------- CHASSIS: SLIDER ---------- */
.scope { background: #0A0D0B; border: 10px solid #232826; border-radius: 12px; overflow: hidden; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.scope canvas { display: block; width: 100%; height: 170px; }
.vu { background: linear-gradient(#EFE6CF, #D9CDAE); border: 10px solid #2B2A27; border-radius: 10px; padding: 12px 12px 0; box-shadow: 0 12px 30px rgba(0,0,0,.5); }
.vu svg { display: block; width: 100%; height: auto; }
.brass { height: 90px; border-radius: 10px; background: linear-gradient(#26231E, #14120F); border: 1px solid #5E4E2A; display: grid; place-items: center; font-family: var(--f-type); font-size: 22px; color: var(--brass); }
.slider-out { font-family: var(--f-mono); font-size: 15px; color: var(--signal); text-align: center; min-height: 24px; margin: 0; }
.range { width: 100%; appearance: none; height: 44px; background: transparent; }
.range::-webkit-slider-runnable-track { height: 6px; background: #2C332F; border-radius: 3px; }
.range::-moz-range-track { height: 6px; background: #2C332F; border-radius: 3px; }
.range::-webkit-slider-thumb { appearance: none; width: 34px; height: 34px; margin-top: -14px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #59605B, #1E2220); border: 2px solid var(--signal); }
.range::-moz-range-thumb { width: 30px; height: 30px; border-radius: 50%; background: #2E3431; border: 2px solid var(--signal); }
.range-labels { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 11px; letter-spacing: .06em; color: var(--steel); gap: 4px; }
.range-labels span { flex: 1; text-align: center; } .range-labels span:first-child { text-align: left; } .range-labels span:last-child { text-align: right; }

/* ---------- CHASSIS: TOGGLES (multi) ---------- */
.panel { background: linear-gradient(#2A2A28, #1C1C1A); border-radius: 10px; padding: 12px; border: 1px solid #0C0C0B; box-shadow: 0 12px 30px rgba(0,0,0,.5); display: flex; flex-direction: column; gap: 6px; }
.tog { display: flex; align-items: center; gap: 14px; min-height: 58px; padding: 8px 10px; border-radius: 6px; cursor: pointer; color: var(--paper); font-size: 16px; }
.tog input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tog .sw { flex: none; width: 52px; height: 30px; border-radius: 16px; background: #0D0D0C; box-shadow: inset 0 2px 4px #000; position: relative; }
.tog .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: linear-gradient(#8A857A, #5C584F); transition: left .15s, background .15s; }
.tog input:checked + .sw::after { left: 25px; background: var(--signal); box-shadow: 0 0 8px var(--signal); }
.tog input:focus-visible + .sw { outline: 3px solid var(--signal); outline-offset: 3px; }
.tog.excl { border-top: 1px dashed #4A4843; margin-top: 4px; padding-top: 12px; }
/* redact skin */
.paper .tog { color: var(--ink); font-family: var(--f-type); font-size: 18px; border-bottom: 1px dashed #B3AA95; border-radius: 0; }
.paper .tog .sw { display: none; }
.paper .tog .bar { flex: none; width: 70px; height: 22px; border: 2px solid var(--ink); position: relative; }
.paper .tog input:checked ~ .bar { background: var(--ink); }
.paper .tog input:focus-visible ~ .bar { outline: 3px solid var(--redline); outline-offset: 3px; }
.paper .tog input:checked ~ .bar::after { content: "GUARDED"; position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: var(--paper); }

/* ---------- CHASSIS: TERMINAL ---------- */
.dos { background: #050805; border: 10px solid #1D211D; border-radius: 12px; padding: 16px; font-family: var(--f-mono); color: var(--phosphor); box-shadow: 0 12px 30px rgba(0,0,0,.55); text-shadow: 0 0 6px rgba(127,183,126,.45); display: flex; flex-direction: column; gap: 6px; position: relative; overflow: hidden; }
.dos::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(0,0,0,.3) 0 1px, transparent 1px 3px); }
.dos .path { font-size: 13px; opacity: .8; }
.dos .dprompt { font-size: 19px; line-height: 1.4; margin: 0 0 8px; color: #BFE5BE; }
.cmd { display: flex; gap: 10px; align-items: flex-start; min-height: 48px; padding: 10px 8px; width: 100%; text-align: left; background: transparent; border: 1px solid transparent; color: var(--phosphor); font-family: var(--f-mono); font-size: 15px; line-height: 1.35; position: relative; z-index: 1; }
.cmd:hover, .cmd[aria-pressed="true"] { background: var(--phosphor); color: #050805; text-shadow: none; }
.cmd .cn { flex: none; }
.mac { background: #F4F4F4; color: #111; border: 2px solid #111; border-radius: 6px; box-shadow: 6px 6px 0 rgba(0,0,0,.6); overflow: hidden; font-family: var(--f-body); }
.mac-title { height: 26px; display: flex; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 12px; font-weight: 600; background: repeating-linear-gradient(0deg, #111 0 1px, #F4F4F4 1px 3px); position: relative; }
.mac-title span { background: #F4F4F4; padding: 0 10px; }
.mac-body { padding: 18px 16px 16px; display: flex; flex-direction: column; gap: 14px; }
.mac-msg { display: flex; gap: 14px; align-items: flex-start; }
.mac-msg p { margin: 0; font-size: 19px; line-height: 1.35; font-weight: 500; }
.mac-icon { flex: none; width: 40px; height: 40px; border: 2px solid #111; border-radius: 4px; display: grid; place-items: center; font-family: var(--f-mono); font-weight: 700; }
.mac-btns { display: flex; flex-direction: column; gap: 8px; }
.macbtn { min-height: 48px; border: 2px solid #111; border-radius: 12px; background: #F4F4F4; color: #111; font-family: var(--f-body); font-size: 16px; font-weight: 500; }
.macbtn.default { box-shadow: 0 0 0 3px #F4F4F4, 0 0 0 5px #111; margin: 4px 5px; }
.macbtn[aria-pressed="true"], .macbtn:active { background: #111; color: #F4F4F4; }

/* toast */
.toast { position: fixed; left: 50%; bottom: calc(76px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); z-index: 60; max-width: min(520px, calc(100% - 32px)); width: max-content; background: #0B0B0A; border: 1px solid var(--signal); color: var(--signal); font-family: var(--f-mono); font-size: 13px; letter-spacing: .06em; padding: 10px 14px; border-radius: 4px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.toast[hidden] { display: none !important; }

/* processing */
.proc-lines { font-family: var(--f-mono); font-size: 14px; line-height: 1.8; color: var(--amber); min-height: 150px; margin: 0; white-space: pre-wrap; }
.skip { align-self: flex-start; }

/* ---------- DOSSIER ---------- */
.folder-cover { position: relative; min-height: 420px; width: 100%; border: none; border-radius: 4px 14px 6px 6px; background: linear-gradient(160deg, #D2AE62, #BC9749); color: var(--ink); padding: 36px 24px; text-align: left; display: flex; flex-direction: column; justify-content: space-between; box-shadow: 0 20px 50px rgba(0,0,0,.55), inset 0 0 0 1px rgba(0,0,0,.12); margin-top: 18px; }
.folder-cover::before { content: ""; position: absolute; left: 0; top: -18px; width: 42%; height: 22px; border-radius: 8px 8px 0 0; background: #D2AE62; }
.cover-top { display: flex; flex-direction: column; gap: 8px; }
.cover-top .eyebrow { color: #3D2C08; }
.cover-name { font-family: var(--f-type); font-size: 26px; }
.cover-open { font-family: var(--f-mono); font-size: 13px; letter-spacing: .16em; }
.cover-stamp { position: absolute; right: 18px; top: 44%; font-size: 22px; --redline: #5E1510; }
.dossier { display: flex; flex-direction: column; gap: 22px; }
.dossier.opening { animation: unfold .6s ease-out both; transform-origin: top center; }
@keyframes unfold { from { transform: perspective(900px) rotateX(-18deg); opacity: 0; } to { transform: none; opacity: 1; } }
.d-head { display: flex; flex-direction: column; gap: 6px; border-bottom: 2px solid var(--ink); padding-bottom: 14px; }
.d-head-row { display: flex; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-quiet); }
.d-title { font-family: var(--f-head); font-weight: 600; font-size: 22px; letter-spacing: .04em; line-height: 1.1; margin: 0; }
.d-sub { font-family: var(--f-mono); font-size: 12px; letter-spacing: .16em; }
.d-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 16px; }
.d-field { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.d-field span:first-child { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-quiet); }
.d-field span:last-child { font-family: var(--f-type); font-size: 16px; overflow-wrap: anywhere; }
.d-class { position: relative; display: flex; flex-direction: column; gap: 8px; padding-top: 18px; border-top: 1px dashed #9C9380; }
.d-class-name { font-family: var(--f-head); font-weight: 700; font-size: clamp(38px, 12vw, 60px); line-height: .95; text-transform: uppercase; margin: 0; padding-right: 8px; text-wrap: balance; }
/* stamp sits in the eyebrow row, never over the classification name */
.d-class { padding-top: 34px !important; }
.d-class .stamp { position: absolute; right: 0; top: 10px; font-size: 16px; transform: rotate(-6deg); }
.d-share { font-family: var(--f-type); font-size: 17px; line-height: 1.45; padding-left: 12px; border-left: 3px solid var(--ink); margin: 0; }
.traits { display: flex; flex-direction: column; gap: 12px; background: var(--paper-2); border-radius: 3px; padding: 16px 14px 18px; }
.traits-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--f-mono); }
.traits-head span:first-child { font-size: 11px; letter-spacing: .16em; font-weight: 600; }
.traits-head span:last-child { font-size: 11px; letter-spacing: .1em; color: var(--ink-quiet); }
.trait { display: flex; flex-direction: column; gap: 5px; }
.trait-row { display: flex; justify-content: space-between; font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; font-variant-numeric: tabular-nums; }
.trait-track { height: 8px; background: var(--beige); }
.trait-fill { height: 8px; background: #3A3833; width: 0; transition: width .9s cubic-bezier(.2,.8,.2,1); }
.trait.top .trait-row { font-weight: 600; }
.trait.top .trait-fill { background: var(--amber); box-shadow: inset 0 0 0 1px var(--ink); }
.d-sec { display: flex; flex-direction: column; gap: 4px; }
.d-sec h3 { margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; font-weight: 600; }
.d-sec p { margin: 0; font-size: 15px; line-height: 1.55; }
.obs { background: var(--ink); color: var(--paper); border-radius: 3px; padding: 16px 14px; font-family: var(--f-mono); font-size: 13px; line-height: 1.55; display: flex; flex-direction: column; gap: 10px; }
.obs h3 { margin: 0; font-size: 11px; letter-spacing: .16em; color: var(--amber); }
.obs p { margin: 0; }
.cmp { border: 1px solid #9C9380; border-radius: 3px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.scene .cmp { border-color: var(--line); background: #0E0D0B; color: var(--paper); }
.cmp-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cmp-head h3 { margin: 0; font-family: var(--f-mono); font-size: 11px; letter-spacing: .16em; }
.sample { font-family: var(--f-head); font-size: 12px; letter-spacing: .14em; color: var(--redline); border: 2px solid var(--redline); padding: 1px 6px; transform: rotate(-3deg); }
.cmp-rows { display: flex; flex-direction: column; gap: 7px; }
.cmp-row { display: grid; grid-template-columns: minmax(0, 9fr) minmax(0, 8fr) 36px; align-items: center; gap: 8px; font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.cmp-row span:last-child { text-align: right; }
.cmp-row.mine { font-weight: 600; }
.cmp-bar { height: 8px; background: var(--beige); }
.scene .cmp-bar { background: var(--graphite); }
.cmp-bar div { height: 8px; background: #3A3833; }
.scene .cmp-bar div { background: #6F6A60; }
.cmp-row.mine .cmp-bar div { background: var(--amber); box-shadow: inset 0 0 0 1px var(--ink); }
.cmp-note { margin: 0; font-size: 12px; color: var(--ink-quiet); line-height: 1.4; }
.scene > .cmp .cmp-note, #cmpSlot .cmp-note { color: var(--text-quiet); }
.printout { background: var(--paper-3); padding: 16px 28px; border-left: 2px dotted #9C9380; border-right: 2px dotted #9C9380; font-family: var(--f-mono); font-size: 12px; line-height: 1.7; letter-spacing: .04em; display: flex; flex-direction: column; gap: 2px; }
.printout h3 { margin: 0 0 4px; font-size: 11px; letter-spacing: .14em; }
.printout div { display: flex; justify-content: space-between; gap: 10px; font-variant-numeric: tabular-nums; }
.printout small { font-size: 11px; color: var(--ink-quiet); line-height: 1.4; margin-top: 6px; }
.actions { display: flex; flex-direction: column; gap: 10px; }
.actions-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.record { display: flex; flex-direction: column; gap: 12px; border-top: 1px solid var(--line); padding-top: 20px; }
.record p { margin: 0; }
.row-link { display: flex; align-items: center; justify-content: space-between; min-height: 52px; padding: 0 16px; background: var(--graphite); border-radius: 6px; color: var(--paper); border: none; width: 100%; text-align: left; }
.row-link.type { font-family: var(--f-type); font-size: 16px; }
.row-link.mono { font-family: var(--f-mono); font-size: 13px; letter-spacing: .08em; }
.row-link em { font-style: normal; color: var(--amber); }
.fine { font-family: var(--f-mono); font-size: 11px; color: #9C9380; line-height: 1.5; margin: 0; }

/* modals */
.modal { position: fixed; inset: 0; z-index: 80; background: rgba(5,5,4,.9); display: flex; align-items: flex-start; justify-content: center; overflow-y: auto; padding: calc(16px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); }
.modal[hidden] { display: none !important; }
.modal-inner { width: 100%; max-width: 520px; display: flex; flex-direction: column; gap: 14px; }
.modal-bar { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; align-self: flex-start; }
.seg button { min-height: 44px; padding: 0 14px; background: transparent; border: none; font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; color: var(--text-quiet); }
.seg button[aria-pressed="true"] { background: var(--amber); color: var(--ink); }
.card-img { width: 100%; height: auto; border-radius: 6px; box-shadow: 0 20px 50px rgba(0,0,0,.6); background: #141412; }
.card-status { font-family: var(--f-mono); font-size: 12px; color: var(--beige); line-height: 1.5; margin: 0; }
.sim-table { width: 100%; border-collapse: collapse; font-family: var(--f-mono); font-size: 12px; font-variant-numeric: tabular-nums; }
.sim-table th, .sim-table td { text-align: left; padding: 7px 4px; border-bottom: 1px solid var(--line); }
.sim-table td:not(:first-child), .sim-table th:not(:first-child) { text-align: right; }
.sim-bar { display: inline-block; height: 6px; background: var(--amber); vertical-align: middle; margin-right: 6px; }
.sim-pass { color: var(--phosphor); } .sim-fail { color: var(--redline); }

/* dev bar */
.devbar { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); z-index: 70; display: flex; flex-direction: column-reverse; align-items: flex-start; gap: 8px; max-width: calc(100vw - 24px); font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--text-quiet); }
.dev-toggle { min-height: 36px; min-width: 52px; padding: 0 12px; border-radius: 18px; border: 1px solid var(--line); background: rgba(11,11,10,.92); color: var(--beige); font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; opacity: .75; }
.dev-toggle[aria-expanded="true"] { opacity: 1; border-color: var(--amber); color: var(--amber); }
.dev-panel { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px; background: rgba(11,11,10,.97); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.6); }
.dev-panel[hidden] { display: none !important; }
.dev-panel span { width: 100%; }
.dev-panel button, .dev-panel select { min-height: 40px; padding: 0 10px; background: transparent; border: 1px solid var(--line); border-radius: 4px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; color: var(--beige); }
.dev-panel select option { background: #111; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .grain, .amb, .reel { animation: none !important; }
}

/* ======================= SITE PAGES (Archive, Privacy) ======================= */
body.site { min-height: 100%; display: flex; flex-direction: column; }
.skip-link { position: absolute; left: 16px; top: -60px; background: var(--amber); color: var(--ink); padding: 10px 14px; z-index: 90; font-family: var(--f-mono); }
.skip-link:focus { top: 12px; }
.site-head { position: relative; z-index: 2; display: flex; justify-content: space-between; align-items: center; gap: 12px 20px; flex-wrap: wrap; padding: 14px 16px; max-width: 1080px; width: 100%; margin: 0 auto; border-bottom: 1px solid var(--line); }
.site-mark { display: flex; flex-direction: column; gap: 2px; text-decoration: none; font-family: var(--f-mono); letter-spacing: .16em; }
.site-mark span:first-child { color: var(--amber); font-size: 13px; font-weight: 600; }
.site-mark span:last-child { color: var(--text-quiet); font-size: 11px; letter-spacing: .1em; }
.site-head nav { display: flex; gap: 4px; flex-wrap: wrap; }
.site-head nav a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 12px; border-radius: 6px; color: var(--paper); text-decoration: none; font-family: var(--f-mono); font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.site-head nav a:hover { background: var(--graphite); }
.site-head nav a[aria-current="page"] { color: var(--amber); box-shadow: inset 0 -2px 0 var(--amber); }
.site-main { position: relative; z-index: 1; flex: 1; width: 100%; max-width: 1080px; margin: 0 auto; padding-inline: 16px; padding-block: 28px 48px; display: flex; flex-direction: column; gap: 40px; }
.site-foot { position: relative; z-index: 1; border-top: 1px solid var(--line); padding-inline: 16px; padding-block: 20px 28px; text-align: center; font-family: var(--f-mono); font-size: 12px; color: var(--text-quiet); display: flex; flex-direction: column; gap: 6px; }
.site-foot p { margin: 0; } .site-foot a { color: var(--beige); }
.lead { font-size: 18px; line-height: 1.6; color: var(--paper); max-width: 62ch; margin: 0; }

.arch-hero { display: flex; flex-direction: column; gap: 16px; }
.arch-hero h1 { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: clamp(52px, 14vw, 104px); line-height: .9; text-transform: uppercase; color: var(--paper); }
.sample-banner { margin: 0; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-family: var(--f-mono); font-size: 12px; color: var(--beige); }
.counters { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin: 8px 0 0; }
.counters div { background: #11100E; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column-reverse; gap: 4px; }
.counters dt { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-quiet); }
.counters dd { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: 40px; line-height: 1; color: var(--amber); font-variant-numeric: tabular-nums; }
.pop-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.pop-tabs a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 14px; border: 1px solid var(--line); border-radius: 6px; color: var(--paper); text-decoration: none; font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; }
.pop-tabs a[aria-current="page"] { background: var(--amber); border-color: var(--amber); color: var(--ink); }
.section-chips { display: flex; gap: 6px; flex-wrap: wrap; position: static; top: env(safe-area-inset-top, 0px); z-index: 3; background: rgba(26,26,24,.94); padding-block: 10px; margin-block: -10px; }
.section-chips a { font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--beige); text-decoration: none; padding: 8px 10px; border-radius: 4px; border: 1px solid var(--line); }
.section-chips a:hover { border-color: var(--amber); color: var(--amber); }
.arch-section { display: flex; flex-direction: column; gap: 14px; scroll-margin-top: 70px; }
.arch-section h2 { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: 30px; letter-spacing: .04em; text-transform: uppercase; color: var(--paper); display: flex; align-items: center; gap: 14px; }
.arch-section h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.fiche-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); gap: 14px; }
.fiche { position: relative; background: #12110F; border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 4px; padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fiche.wide { max-width: 760px; }
.fiche h3 { margin: 0; font-family: var(--f-body); font-weight: 500; font-size: 17px; line-height: 1.35; padding-right: 36px; text-wrap: balance; }
.fiche-ref { position: absolute; top: 14px; right: 14px; font-family: var(--f-mono); font-size: 11px; color: var(--text-quiet); }
.fiche-n { margin: 0; font-family: var(--f-mono); font-size: 11px; color: var(--text-quiet); line-height: 1.5; }
.bars { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bars li { display: grid; grid-template-columns: minmax(0, 1fr) 42px; grid-template-areas: "label val" "track track"; gap: 4px 8px; align-items: end; }
.b-label { grid-area: label; font-size: 14px; line-height: 1.3; color: var(--paper); }
.b-val { grid-area: val; text-align: right; font-family: var(--f-mono); font-size: 13px; color: var(--amber); font-variant-numeric: tabular-nums; }
.b-track { grid-area: track; display: block; height: 6px; background: var(--graphite); border-radius: 1px; overflow: hidden; }
.b-track span { display: block; height: 100%; background: var(--amber); }
.forming { display: flex; flex-direction: column; gap: 8px; }
.forming-label { font-family: var(--f-mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--beige); }
.forming .b-track span { background: repeating-linear-gradient(90deg, var(--steel) 0 6px, transparent 6px 9px); }
.arch-cta { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; border-top: 1px solid var(--line); padding-top: 28px; }
.arch-cta .btn { display: inline-flex; align-items: center; text-decoration: none; }

.doc { max-width: 68ch; display: flex; flex-direction: column; gap: 14px; }
.doc h1 { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: clamp(38px, 9vw, 60px); line-height: 1; text-transform: uppercase; color: var(--paper); text-wrap: balance; }
.doc h2 { margin: 18px 0 0; font-family: var(--f-head); font-weight: 600; font-size: 24px; letter-spacing: .04em; color: var(--amber); text-transform: uppercase; }
.doc p, .doc li { font-size: 17px; line-height: 1.65; color: var(--paper); margin: 0; }
.doc ul { margin: 0; padding-left: 1.2em; display: flex; flex-direction: column; gap: 8px; }
.doc a { color: var(--amber); }
.doc strong { color: #FFF4DD; }

/* Archive-still-forming card inside the experience */
.forming-card { border: 1px dashed var(--steel); border-radius: 4px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.scene .forming-card { background: #0E0D0B; }
.paper .forming-card { border-color: #9C9380; background: transparent; }
.paper .forming-card .fiche-n, .paper .forming-card .forming-label { color: var(--ink-quiet); }
.paper .b-track { background: var(--beige); } .paper .forming .b-track span { background: repeating-linear-gradient(90deg, #5A5448 0 6px, transparent 6px 9px); }

/* ======================= PUBLIC FILE PAGE ======================= */
.page-file .site-main { max-width: 600px; gap: 22px; }
.file-wrap { display: flex; flex-direction: column; gap: 22px; }
.file-cta { display: flex; align-items: center; justify-content: center; text-decoration: none; }
.page-file .dossier { margin-top: 6px; }
.page-file .d-title { font-size: 22px; }
.stamp.edition { position: absolute; right: 16px; top: -12px; font-size: 14px; background: var(--paper); }
.file-join { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; border-top: 1px solid var(--line); padding-top: 22px; }
.file-join .btn { display: inline-flex; align-items: center; text-decoration: none; }
.file-owner { border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; font-family: var(--f-mono); font-size: 12px; color: var(--text-quiet); }
.file-owner summary { cursor: pointer; min-height: 32px; display: flex; align-items: center; }
.file-owner form { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.file-owner input { min-height: 48px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 0 12px; font-family: var(--f-mono); font-size: 16px; color: var(--paper); letter-spacing: .1em; }
.file-owner .btn-ghost { align-self: flex-start; }

/* ======================= DOSSIER: PUBLIC LINK + EMAIL ======================= */
.pubbox { display: flex; flex-direction: column; gap: 10px; border: 1px solid var(--amber); border-radius: 6px; padding: 14px; background: #14120C; }
.pubbox p { margin: 0; font-size: 15px; line-height: 1.5; }
.pubbox .linkline { display: flex; gap: 8px; align-items: stretch; flex-wrap: wrap; }
.pubbox input { flex: 1 1 220px; min-width: 0; min-height: 44px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 0 10px; font-family: var(--f-mono); font-size: 13px; color: var(--paper); }
.pubbox .code { font-family: var(--f-mono); font-size: 22px; letter-spacing: .14em; color: var(--amber); background: #0B0B0A; border: 1px dashed var(--amber); border-radius: 4px; padding: 10px 12px; text-align: center; user-select: all; }
.optin { display: flex; flex-direction: column; gap: 10px; background: var(--graphite); border-radius: 6px; padding: 16px; }
.optin h3 { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: 20px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper); }
.optin p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-quiet); }
.optin form { display: flex; gap: 8px; flex-wrap: wrap; }
.optin input[type=email] { flex: 1 1 220px; min-width: 0; min-height: 48px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 0 12px; font-size: 16px; color: var(--paper); }
.optin .btn { min-height: 48px; font-size: 16px; }

/* ======================= MEMORY VAULT ======================= */
.vault-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.vault-actions .btn, .vault-link { display: inline-flex; align-items: center; text-decoration: none; }
.section-chips a[aria-current="page"] { border-color: var(--amber); color: var(--amber); }
.mem-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.memcard { background: var(--paper-3); color: var(--ink); border-radius: 3px; padding: 14px 16px 12px; display: flex; flex-direction: column; gap: 10px; box-shadow: 0 8px 20px rgba(0,0,0,.35);
  background-image: linear-gradient(transparent 30px, rgba(200,55,45,.35) 30px 31px, transparent 31px), repeating-linear-gradient(transparent 0 25px, rgba(90,110,160,.16) 25px 26px); }
.memcard header, .memcard footer { display: flex; justify-content: space-between; gap: 10px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; color: var(--ink-quiet); }
.memcard p { margin: 0; font-family: var(--f-type); font-size: 17px; line-height: 1.55; overflow-wrap: anywhere; }
.memcard.big { max-width: 720px; padding: 20px 22px 16px; }
.memcard.big p { font-size: 21px; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; font-family: var(--f-mono); font-size: 12px; color: var(--text-quiet); margin-top: 8px; }
.pager a { color: var(--amber); min-height: 44px; display: inline-flex; align-items: center; }

/* memory submission (inside the experience) */
.memform { display: flex; flex-direction: column; gap: 14px; }
.memform textarea { width: 100%; min-height: 180px; resize: vertical; background: transparent; border: none; border-top: 1px solid #B3AA95; padding: 12px 2px; font-family: var(--f-type); font-size: 19px; line-height: 1.55; color: var(--ink);
  background-image: repeating-linear-gradient(transparent 0 28px, rgba(90,110,160,.2) 28px 29px); background-attachment: local; }
.memform textarea:focus { outline: 2px solid var(--redline); outline-offset: 4px; }
.memcount { font-family: var(--f-mono); font-size: 11px; color: var(--ink-quiet); text-align: right; font-variant-numeric: tabular-nums; }
.memcount.over { color: var(--redline); }
.tagrow { display: flex; flex-wrap: wrap; gap: 6px; border: none; margin: 0; padding: 0; }
.tagrow legend { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; color: var(--ink-quiet); margin-bottom: 8px; padding: 0; }
.tagrow label { position: relative; }
.tagrow input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.tagrow span { display: inline-flex; align-items: center; min-height: 40px; padding: 0 12px; border: 1px solid #9C9380; border-radius: 20px; font-family: var(--f-mono); font-size: 12px; color: var(--ink); cursor: pointer; }
.tagrow input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tagrow input:focus-visible + span { outline: 3px solid var(--redline); outline-offset: 2px; }
.consent { display: flex; gap: 12px; align-items: flex-start; font-size: 15px; line-height: 1.5; color: var(--ink); cursor: pointer; }
.consent input { width: 24px; height: 24px; flex: none; margin-top: 2px; accent-color: var(--ink); }
.memnote { margin: 0; font-size: 14px; line-height: 1.5; color: var(--ink-quiet); border-left: 3px solid var(--redline); padding-left: 10px; }

/* ======================= ADMIN ======================= */
.admin .site-head nav { align-items: center; }
.inline-form { display: inline; margin: 0; }
.navbtn { min-height: 44px; padding: 0 12px; background: none; border: 1px solid var(--line); border-radius: 6px; color: var(--beige); font-family: var(--f-mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.admin-main { gap: 22px; }
.admin-narrow { max-width: 460px; }
.admin-form { display: flex; flex-direction: column; gap: 8px; }
.admin-form label, .mod-edit label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-quiet); margin-top: 8px; }
.admin-form input, .mod-edit textarea, .mod-edit select { min-height: 48px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-size: 16px; color: var(--paper); }
.admin-form .btn { margin-top: 14px; }
.admin-head { display: flex; flex-direction: column; gap: 10px; }
.admin-head h1 { margin: 0; font-family: var(--f-head); font-weight: 700; font-size: clamp(32px, 7vw, 48px); text-transform: uppercase; color: var(--paper); }
.admin-head p { margin: 0; max-width: 70ch; color: var(--paper); line-height: 1.55; }
.admin-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.admin-actions a { display: inline-flex; align-items: center; text-decoration: none; }
.admin-flash { border-left: 3px solid var(--phosphor); padding: 8px 12px; background: #101510; color: #CFE8CE !important; }
.mod-list { display: flex; flex-direction: column; gap: 14px; }
.mod-item { background: #12110F; border: 1px solid var(--line); border-radius: 6px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.mod-item header { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-family: var(--f-mono); font-size: 11px; color: var(--text-quiet); }
.flag { display: inline-block; margin-left: 6px; padding: 2px 8px; border-radius: 10px; background: rgba(200,55,45,.18); color: #FF9D93; font-size: 11px; }
.mod-text { margin: 0; font-family: var(--f-type); font-size: 18px; line-height: 1.55; color: var(--paper); overflow-wrap: anywhere; }
.mod-orig { font-size: 13px; color: var(--text-quiet); } .mod-orig p { margin: 6px 0 0; }
.mod-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.mod-actions form { margin: 0; }
.mod-actions .btn { min-height: 44px; font-size: 15px; }
.mod-edit summary, .mod-orig summary { cursor: pointer; font-family: var(--f-mono); font-size: 12px; color: var(--beige); min-height: 32px; display: flex; align-items: center; }
.mod-edit form { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.mod-edit textarea { font-family: var(--f-type); line-height: 1.5; resize: vertical; }
.mod-edit .btn { align-self: flex-start; margin-top: 8px; min-height: 44px; font-size: 15px; }

/* Admin · Phase 7 pages */
.admin-nav { display: flex; flex-wrap: wrap; gap: 4px 6px; }
.admin-nav a { min-height: 40px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 6px; color: var(--beige); font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; text-decoration: none; }
.site-head .admin-nav a[aria-current="page"] { background: var(--amber); color: var(--ink); box-shadow: none; }
.admin-warn { border-left: 3px solid var(--amber); padding: 8px 12px; background: #1A150A; color: #F3DDAA !important; }
.admin-warn a { color: inherit; }
.admin .btn { --signal: var(--amber); min-height: 48px; font-size: 16px; }
.admin a.btn, .admin a.btn-ghost { display: inline-flex; align-items: center; text-decoration: none; }
.btn-ghost.small { min-height: 36px; padding: 0 10px; font-size: 11px; }
.adm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 14px; align-items: start; }
.adm-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--line); border-radius: 4px; max-width: 100%; }
.adm-table { width: 100%; border-collapse: collapse; font-size: 14px; color: var(--paper); }
.adm-table th, .adm-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.adm-table thead th { font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--text-quiet); background: #12110F; white-space: nowrap; }
.adm-table tbody th { font-weight: 500; color: var(--text-quiet); white-space: nowrap; }
.adm-table tr:last-child td, .adm-table tr:last-child th { border-bottom: none; }
.adm-table a { color: var(--paper); }
.adm-table tr.off td { opacity: .5; }
.adm-table tr.bad td, .adm-table tr.bad th { background: rgba(200,55,45,.12); }
.adm-table input[type=text], .adm-table input[type=number], .adm-table input[type=password] { min-height: 40px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; font-size: 15px; color: var(--paper); width: 100%; min-width: 150px; }
.adm-table input.w-num { width: 56px; min-width: 56px; text-align: center; padding: 6px 2px; font-variant-numeric: tabular-nums; }
.adm-table input.w-short { min-width: 90px; }
.adm-table tr.blankrow td { background: #0F0F0D; }
.adm-table.opts td:first-child { text-align: center; }
.adm-table.opts input[type=checkbox] { width: 20px; height: 20px; accent-color: var(--amber); }
.qedit, .stack-form { display: flex; flex-direction: column; gap: 8px; max-width: 980px; }
.qedit > label, .qedit .qedit-row label, .stack-form label { display: flex; flex-direction: column; gap: 6px; font-family: var(--f-mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--text-quiet); margin-top: 8px; }
.qedit input[type=text], .qedit input[type=number], .qedit input:not([type]), .qedit textarea, .qedit select,
.stack-form input[type=text], .stack-form input[type=number], .stack-form input[type=password], .stack-form textarea, .stack-form select { min-height: 48px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-family: var(--f-body); font-size: 16px; letter-spacing: 0; text-transform: none; color: var(--paper); width: 100%; }
.qedit textarea, .stack-form textarea { line-height: 1.5; resize: vertical; }
.qedit h2 { margin: 18px 0 0; font-family: var(--f-head); text-transform: uppercase; color: var(--paper); }
.qedit .btn, .stack-form .btn { align-self: flex-start; margin-top: 12px; }
.qedit-row { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 200px), 1fr)); gap: 8px 14px; }
.qedit fieldset { border: 1px solid var(--line); border-radius: 4px; padding: 10px 14px 14px; margin: 10px 0 0; }
.qedit legend { font-size: 13px; color: var(--text-quiet); padding: 0 6px; }
.qedit .qedit-row .w-num { max-width: 110px; text-align: center; }
.loglist { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--paper); overflow-wrap: anywhere; }
.loglist span { font-family: var(--f-mono); font-size: 11px; color: var(--text-quiet); margin-right: 6px; }
.admin .bars li { grid-template-columns: minmax(0, 1fr) auto; }
.admin .b-val { white-space: nowrap; }
.admin .arch-section h3 { font-family: var(--f-body); font-size: 17px; color: var(--paper); margin: 12px 0 0; }
@media (max-width: 640px) { .admin-nav a { font-size: 11px; padding: 0 8px; } }
.adm-table td:last-child form, .adm-table td:last-child .btn-ghost { white-space: nowrap; }
.adm-table td { min-width: 70px; }
.adm-table.opts td:nth-child(2) input { min-width: 220px; }
.pct-tag { font-size: 11px; letter-spacing: .08em; color: var(--redline); margin-right: 4px; font-weight: 600; }
.pct-note { margin: 6px 0 0; font-family: var(--f-mono); font-size: 11px; color: var(--ink-quiet); line-height: 1.5; }

/* Phase 8 accessibility */
@media (min-width: 768px) { .section-chips { position: sticky; } }
.form-confirm { margin-top: 14px; width: 100%; }
.boot-foot { animation: fadein .6s ease both; }
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .boot-foot { animation: none; } }
.fiche h2 { margin: 0; font-family: var(--f-body); font-weight: 500; font-size: 17px; line-height: 1.35; color: var(--paper); }
.adm-table-wrap:focus-visible { outline: 3px solid var(--amber); }

/* Archive comparison panels are dark even inside the paper dossier. */
.scene .cmp { --redline: #E5594E; }
.scene .cmp .cmp-note { color: var(--text-quiet); }
@media (max-width: 380px) { .d-class { padding-top: 56px !important; } .d-class .stamp { top: 4px; font-size: 14px; } }

/* Newsletter and GenX Alliance links (public pages) */
.community { position: relative; z-index: 1; width: 100%; max-width: 760px; margin: 8px auto 0; padding: 0 16px 28px; display: flex; flex-direction: column; gap: 18px; }
.news-box { display: flex; flex-direction: column; gap: 10px; background: var(--graphite); border: 1px solid var(--line); border-top: 3px solid var(--amber); border-radius: 6px; padding: 18px 16px; }
.news-box h2, .gx-links h2 { margin: 0; font-family: var(--f-head); font-weight: 600; font-size: 22px; letter-spacing: .06em; text-transform: uppercase; color: var(--paper); }
.news-box p { margin: 0; font-size: 15px; line-height: 1.5; color: var(--text-quiet); }
.news-box form { display: flex; gap: 8px; flex-wrap: wrap; }
.news-box input[type=email] { flex: 1 1 220px; min-width: 0; min-height: 48px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 0 12px; font-size: 16px; color: var(--paper); }
.news-box .btn { min-height: 48px; font-size: 16px; --signal: var(--amber); }
.gx-links h2 { font-size: 16px; }
.gx-links ul { list-style: none; margin: 10px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 8px; }
.gx-links li { display: flex; flex-direction: column; gap: 4px; border: 1px solid var(--line); border-radius: 6px; padding: 12px 14px; }
.gx-links a { color: var(--amber); font-family: var(--f-mono); font-size: 14px; letter-spacing: .06em; text-transform: uppercase; text-decoration: none; min-height: 24px; }
.gx-links a:hover { text-decoration: underline; }
.gx-links li span { font-size: 13px; line-height: 1.45; color: var(--text-quiet); }
.stack-form input[type=url], .stack-form input[type=email] { min-height: 48px; background: #0B0B0A; border: 1px solid var(--line); border-radius: 4px; padding: 10px 12px; font-family: var(--f-body); font-size: 16px; color: var(--paper); width: 100%; text-transform: none; letter-spacing: 0; }
.stack-form h3 { margin: 14px 0 0; font-family: var(--f-body); font-size: 16px; color: var(--paper); }
