/* =====================================================================
   KALI KOOKER PROJECTS — interface stylesheet
   Dark technical UI: thin lines, monospace numerics, one accent color.
   ===================================================================== */
:root {
  --bg: #07090d;
  --bg-2: #0b0f16;
  --panel: rgba(11, 15, 22, 0.86);
  --panel-solid: #0c1119;
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);
  --text: #e6ebf3;
  --text-2: #9aa7bd;
  --text-3: #5f6b80;
  --accent: #4C8DFF;
  --accent-2: rgba(76, 141, 255, 0.18);
  --accent-glow: 0 0 0 1px rgba(76,141,255,.35), 0 0 22px rgba(76,141,255,.25);
  --ok: #43c98a;
  --warn: #e8b33c;
  --bad: #ff5a5a;
  --sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  --mono: "SF Mono", "JetBrains Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --hdr-h: 48px;
  --rail-w: 232px;
  --panel-w: 340px;
  --bottom-h: 132px;
  --ease: cubic-bezier(.22,.61,.36,1);
  --ease-io: cubic-bezier(.65,0,.35,1);
}
*, *::before, *::after { box-sizing: border-box; }
[hidden], .hidden { display: none !important; }
html, body { height: 100%; margin: 0; background: var(--bg); color: var(--text); font: 13px/1.45 var(--sans); -webkit-font-smoothing: antialiased; overflow: hidden; }
#gl { touch-action: none; }
#rail, #panel .panel-body, .drawer, .manual-body, #mx-layers, .controls, #select { touch-action: pan-x pan-y; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
kbd { font: 10px/1 var(--mono); border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 4px; color: var(--text-2); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.dim { color: var(--text-3); font-weight: 400; }
.val { color: var(--accent); }
.row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
::selection { background: rgba(76,141,255,.35); }
:focus-visible { outline: 1.5px solid var(--accent); outline-offset: 2px; }

#gl { position: fixed; inset: 0; width: 100%; height: 100%; display: block; z-index: 0; }
#webgl-fail { position: fixed; inset: 0; display: grid; place-items: center; z-index: 50; background: var(--bg); }
#webgl-fail .card { max-width: 480px; border: 1px solid var(--line); padding: 28px 32px; }

/* ---------- Range inputs ---------- */
input[type=range] { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; background: transparent; margin: 0; }
input[type=range]::-webkit-slider-runnable-track { height: 2px; background: var(--line-2); border-radius: 1px; }
input[type=range]::-moz-range-track { height: 2px; background: var(--line-2); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent); margin-top: -5px; transition: box-shadow .15s; }
input[type=range]::-moz-range-thumb { width: 12px; height: 12px; border-radius: 50%; background: var(--bg); border: 1.5px solid var(--accent); }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:focus::-webkit-slider-thumb { box-shadow: var(--accent-glow); }
input[type=range].danger::-webkit-slider-thumb { border-color: var(--bad); }
input[type=search], select { background: var(--bg-2); border: 1px solid var(--line); border-radius: 4px; padding: 6px 8px; width: 100%; color: var(--text); outline: none; }
input[type=search]:focus, select:focus { border-color: var(--accent); }
select { width: auto; padding: 3px 6px; font-family: var(--mono); font-size: 11px; }

/* ---------- Generic buttons ---------- */
.ghost { border: 1px solid var(--line-2); border-radius: 4px; padding: 6px 10px; color: var(--text-2); transition: border-color .15s, color .15s, background .15s; letter-spacing: .02em; }
.ghost:hover { border-color: var(--accent); color: var(--text); background: var(--accent-2); }
.ghost.on { border-color: var(--accent); color: var(--accent); background: var(--accent-2); }
.ghost.tiny { padding: 4px 8px; font-size: 11px; }
.ghost.danger { border-color: rgba(255,90,90,.45); color: #ff8a8a; }
.ghost.danger:hover { background: rgba(255,90,90,.12); border-color: var(--bad); }
.icon-btn { width: 30px; height: 30px; border-radius: 4px; border: 1px solid var(--line); color: var(--text-2); display: inline-grid; place-items: center; font-size: 14px; transition: .15s; }
.icon-btn:hover { border-color: var(--accent); color: var(--text); }
.btn-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.btn-grid .ghost { text-align: left; font-size: 11px; padding: 5px 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }
.brand-mark { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid var(--accent); position: relative; flex: none; }
.brand-mark::after { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--accent); }
.brand-mark.small { width: 12px; height: 12px; border-width: 1px; }
.brand-mark.small::after { inset: 3.5px; }
.brand-name { letter-spacing: .28em; font-weight: 500; font-size: 12px; }

/* =====================================================================
   INTRO
   ===================================================================== */
.overlay { position: fixed; inset: 0; z-index: 40; }
#intro { background: transparent; display: grid; place-items: center; transition: opacity 1.1s var(--ease-io); }
body[data-screen="intro"] .about-fab { opacity: 0; pointer-events: none; }
#intro.fade { opacity: 0; pointer-events: none; }
.intro-title { text-align: center; opacity: 0; transform: translateY(10px); transition: opacity 1.2s var(--ease), transform 1.2s var(--ease); position: relative; z-index: 2; }
#intro.show-title .intro-title { opacity: 1; transform: none; }
.intro-word { font-size: clamp(22px, 4.2vw, 46px); font-weight: 200; letter-spacing: .42em; color: #fff; display: inline-flex; gap: 0; }
.intro-word span { display: inline-block; opacity: 0; transform: translateX(-14px); transition: opacity .9s var(--ease), transform .9s var(--ease); }
#intro.show-title .intro-word span { opacity: 1; transform: none; }
.intro-word.sheen span { background: linear-gradient(100deg, #fff 30%, #dfe8ff 45%, #7fb0ff 50%, #dfe8ff 55%, #fff 70%); background-size: 280% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 1.5s var(--ease) 1 forwards; }
@keyframes sheen { from { background-position: 120% 0; } to { background-position: -120% 0; } }
.intro-sub { margin-top: 14px; font: 10px/1 var(--mono); letter-spacing: .38em; color: var(--text-3); opacity: 0; transition: opacity 1s var(--ease) .6s; }
#intro.show-title .intro-sub { opacity: 1; }
#intro-skip { position: absolute; right: 22px; bottom: 20px; opacity: 0; transition: opacity .6s; }
#intro.skippable #intro-skip { opacity: .7; }

/* =====================================================================
   SCREENS
   ===================================================================== */
.screen { position: fixed; inset: 0; z-index: 10; }
#select { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: clamp(20px, 4vh, 44px); padding: 24px; pointer-events: none; transition: opacity .7s var(--ease); overflow-y: auto; }
#select .select-head { margin-top: auto; }
#select .select-foot { margin-bottom: auto; padding-bottom: 8px; }
#select > * { pointer-events: auto; }
#select.leaving { opacity: 0; }
#select.entering { animation: fadeIn .8s var(--ease) both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.select-head { text-align: center; display: grid; gap: 12px; justify-items: center; }
.select-head .brand-name { font-size: clamp(14px, 1.8vw, 20px); font-weight: 300; }
.select-tag { color: var(--text-2); font-size: 13px; max-width: 520px; }
.cards { display: grid; grid-template-columns: repeat(2, minmax(280px, 440px)); gap: clamp(16px, 3vw, 40px); width: 100%; max-width: 980px; justify-content: center; }
.module-card { position: relative; text-align: left; border: 1px solid var(--line); border-radius: 8px; background: rgba(9, 12, 18, .55); backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px); overflow: hidden; transition: transform .45s var(--ease), border-color .3s, box-shadow .45s var(--ease); color: var(--text); display: grid; }
.module-card:hover, .module-card:focus-visible { transform: translateY(-6px); border-color: rgba(76,141,255,.6); box-shadow: 0 24px 50px -30px rgba(76,141,255,.45), var(--accent-glow); }
.card-window { aspect-ratio: 16/10; background: transparent; position: relative; }
.card-window::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(9,12,18,.9), transparent 45%); pointer-events: none; }
.card-body { padding: 16px 20px 20px; display: grid; gap: 8px; border-top: 1px solid var(--line); background: rgba(9,12,18,.85); }
.card-kicker { font: 10px/1 var(--mono); color: var(--accent); letter-spacing: .3em; }
.module-card h2 { margin: 0; font-weight: 400; font-size: 20px; letter-spacing: .02em; }
.module-card p { margin: 0; color: var(--text-2); font-size: 12.5px; }
.spec-strip { font-size: 11px; color: var(--text-3); border-top: 1px dashed var(--line); padding-top: 10px; margin-top: 4px; letter-spacing: .02em; }
.select-foot { display: grid; gap: 14px; justify-items: center; }
.about-entry { border: 1px solid var(--line-2); border-radius: 999px; padding: 9px 22px; color: var(--text-2); letter-spacing: .12em; font-size: 12px; text-transform: uppercase; opacity: .75; transition: .3s var(--ease); }
.about-entry:hover { opacity: 1; color: #fff; border-color: var(--accent); box-shadow: var(--accent-glow); }
.select-hint { font-size: 10.5px; color: var(--text-3); letter-spacing: .04em; }

/* =====================================================================
   MODULE SHELL
   ===================================================================== */
#module { pointer-events: none; transition: opacity .6s var(--ease); }
#module > * { pointer-events: auto; }
#module.entering { animation: fadeIn .8s var(--ease) both; }
#module.leaving { opacity: 0; }
#hdr { position: absolute; top: 0; left: 0; right: 0; height: var(--hdr-h); display: flex; align-items: center; gap: 14px; padding: 0 12px; background: linear-gradient(to bottom, rgba(7,9,13,.92), rgba(7,9,13,.6)); border-bottom: 1px solid var(--line); z-index: 5; }
.hdr-btn { border: 1px solid var(--line); border-radius: 4px; padding: 6px 10px; color: var(--text-2); font-size: 12px; transition: .15s; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.hdr-btn:hover { border-color: var(--accent); color: var(--text); }
.hdr-btn.on { border-color: var(--accent); color: var(--accent); }
#btn-back .arrow { transition: transform .2s; display: inline-block; }
#btn-back:hover .arrow { transform: translateX(-3px); }
.hdr-brand { display: flex; align-items: center; gap: 10px; }
.hdr-sep { color: var(--text-3); }
.hdr-context { color: var(--text-2); letter-spacing: .06em; font-size: 12px; }
.hdr-center { flex: 1; display: flex; justify-content: center; }
.subswitch { display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 999px; padding: 3px; }
.subswitch button { border-radius: 999px; padding: 5px 14px; font-size: 11px; letter-spacing: .14em; color: var(--text-2); transition: .2s; }
.subswitch button.on { background: var(--accent-2); color: var(--accent); }
.sw-sep { color: var(--text-3); font-size: 11px; }
.hdr-right { display: flex; gap: 8px; align-items: center; }
.speaker .spk-icon { display: inline-grid; place-items: center; }
.speaker.muted .spk-icon path[id] { opacity: .15; }
.spk-level { width: 34px; height: 6px; border: 1px solid var(--line-2); border-radius: 2px; overflow: hidden; display: inline-block; }
.spk-level i { display: block; height: 100%; width: 0%; background: var(--accent); transition: width .06s linear; }

#rail { position: absolute; top: calc(var(--hdr-h) + 10px); left: 10px; width: var(--rail-w); bottom: calc(var(--bottom-h) + 10px); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px; display: grid; gap: 12px; align-content: start; overflow-y: auto; z-index: 4; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.rail-group { display: grid; gap: 6px; }
.rail-title { font: 10px/1 var(--mono); letter-spacing: .24em; color: var(--text-3); display: flex; justify-content: space-between; align-items: center; }
.rail-hint { font-size: 10.5px; color: var(--text-3); }
.toggle-list { display: grid; gap: 3px; }
.toggle { display: flex; align-items: center; gap: 8px; padding: 4px 6px; border-radius: 4px; color: var(--text-2); font-size: 12px; cursor: pointer; transition: .15s; width: 100%; text-align: left; }
.toggle:hover { background: rgba(255,255,255,.04); color: var(--text); }
.toggle i { width: 24px; height: 12px; border: 1px solid var(--line-2); border-radius: 999px; position: relative; flex: none; transition: .2s; }
.toggle i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); transition: .2s; }
.toggle.on i { border-color: var(--accent); background: var(--accent-2); }
.toggle.on i::after { left: 14px; background: var(--accent); }
.results { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; max-height: 160px; overflow: auto; }
.results li { padding: 4px 6px; border-radius: 3px; font-size: 11px; cursor: pointer; color: var(--text-2); }
.results li:hover { background: var(--accent-2); color: var(--text); }

#panel { position: absolute; top: calc(var(--hdr-h) + 10px); right: 10px; width: var(--panel-w); max-height: calc(100% - var(--hdr-h) - var(--bottom-h) - 20px); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; z-index: 4; display: flex; flex-direction: column; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); animation: slideIn .35s var(--ease) both; }
@keyframes slideIn { from { opacity: 0; transform: translateX(14px); } to { opacity: 1; transform: none; } }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; padding: 12px 12px 10px; border-bottom: 1px solid var(--line); gap: 8px; }
.p-name { font-size: 16px; font-weight: 500; }
.p-term { font-size: 10.5px; color: var(--text-3); margin-top: 2px; }
.panel-body { overflow-y: auto; padding: 10px 12px 14px; display: grid; gap: 12px; }
.p-block { display: grid; gap: 5px; }
.p-label { font: 10px/1 var(--mono); letter-spacing: .22em; color: var(--text-3); }
.p-text { color: var(--text-2); font-size: 12.5px; }
.live { border-collapse: collapse; width: 100%; font-size: 11.5px; }
.live td { padding: 3px 0; border-bottom: 1px solid var(--line); color: var(--text-2); }
.live td:last-child { text-align: right; color: var(--accent); white-space: nowrap; }
.stress { display: grid; gap: 4px; }
.sbar { display: grid; grid-template-columns: 110px 1fr 46px; gap: 8px; align-items: center; font-size: 10.5px; color: var(--text-2); }
.sbar .track { height: 6px; background: rgba(255,255,255,.06); border-radius: 3px; overflow: hidden; }
.sbar .fill { height: 100%; width: 0%; background: var(--ok); transition: width .12s linear, background .3s; }
.sbar .fill.warn { background: var(--warn); }
.sbar .fill.bad { background: var(--bad); }
.sbar .fill.broken { background: repeating-linear-gradient(45deg, var(--bad) 0 4px, #7a1c1c 4px 8px); }
.sbar .num { text-align: right; font-family: var(--mono); }

#hud { position: absolute; left: calc(var(--rail-w) + 20px); right: calc(var(--panel-w) + 20px); top: calc(var(--hdr-h) + 10px); display: grid; gap: 6px; z-index: 3; pointer-events: none; grid-template-columns: 1fr 1fr; }
#hud canvas { width: 100%; height: auto; display: block; }
#hud #gauges { grid-column: 1 / -1; }
#hud #graphs:last-child { grid-column: 1 / -1; }
@media (max-width: 1400px) { #hud { grid-template-columns: 1fr; } }
@media (max-height: 900px) { #hud canvas { max-height: 22vh; object-fit: contain; } }
#hud.hide-gauges #gauges, #hud.hide-graphs #graphs { display: none; }

#bottom { position: absolute; left: 10px; right: 10px; bottom: 10px; height: var(--bottom-h); background: var(--panel); border: 1px solid var(--line); border-radius: 6px; z-index: 4; display: grid; grid-template-rows: auto 1fr; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.time-ctl { display: flex; align-items: center; gap: 14px; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.time-scale, .time-scrub { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 120px; }
.time-scale input, .time-scrub input { flex: 1; }
.tiny-label { font-size: 9.5px; letter-spacing: .2em; color: var(--text-3); white-space: nowrap; }
.controls { display: flex; gap: 10px 18px; align-items: center; padding: 6px 12px; overflow-x: auto; overflow-y: hidden; }
.ctl { display: grid; gap: 2px; min-width: 130px; flex: 1 1 130px; max-width: 220px; }
.ctl label { font: 9.5px/1 var(--mono); letter-spacing: .18em; color: var(--text-3); display: flex; justify-content: space-between; }
.ctl label .val { color: var(--accent); letter-spacing: 0; }
.ctl.btn { min-width: auto; flex: 0 0 auto; }
.ctl.btn .ghost { white-space: nowrap; }
.ctl.sel select { width: 100%; }
.ctl.seg { display: grid; }
.seg-row { display: inline-flex; border: 1px solid var(--line-2); border-radius: 4px; overflow: hidden; }
.seg-row button { padding: 5px 9px; font: 10.5px var(--mono); color: var(--text-2); border-right: 1px solid var(--line); transition: .15s; }
.seg-row button:last-child { border-right: 0; }
.seg-row button.on { background: var(--accent-2); color: var(--accent); }
.seg-row button:hover { color: var(--text); }
.ctl.hold .ghost:active { background: var(--accent-2); border-color: var(--accent); color: var(--accent); }

#stress-bars { position: absolute; right: 10px; bottom: calc(var(--bottom-h) + 20px); width: 300px; background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 10px 12px; z-index: 4; display: grid; gap: 6px; }
#stress-bars .p-label { margin-bottom: 2px; }
#fail-report { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(560px, 92vw); background: rgba(12, 8, 8, .96); border: 1px solid rgba(255,90,90,.6); border-radius: 8px; padding: 22px 24px; z-index: 30; box-shadow: 0 30px 80px -20px rgba(255,90,90,.35); animation: popIn .4s var(--ease) both; }
@keyframes popIn { from { opacity: 0; transform: translate(-50%, -46%) scale(.98); } to { opacity: 1; transform: translate(-50%, -50%); } }
#fail-report h2 { margin: 0 0 6px; color: #ff8a8a; font-weight: 500; letter-spacing: .08em; font-size: 15px; }
#fail-report .fr-sub { color: var(--text-2); font-size: 12px; margin-bottom: 14px; }
#fail-report table { width: 100%; border-collapse: collapse; font-size: 12px; }
#fail-report td { padding: 5px 0; border-bottom: 1px solid var(--line); }
#fail-report td:last-child { text-align: right; color: #ffb0b0; }
#fail-report .row { margin-top: 16px; justify-content: flex-end; }

/* =====================================================================
   DRAWERS (mixer, physics log) & SHEET (manual)
   ===================================================================== */
.drawer { position: fixed; top: var(--hdr-h); right: 0; bottom: 0; width: 380px; max-width: 100vw; background: var(--panel-solid); border-left: 1px solid var(--line); z-index: 20; display: flex; flex-direction: column; box-shadow: -20px 0 60px -30px rgba(0,0,0,.8); animation: drawerIn .35s var(--ease) both; }
.drawer.left { right: auto; left: 0; border-left: 0; border-right: 1px solid var(--line); animation-name: drawerInL; }
@keyframes drawerIn { from { transform: translateX(30px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawerInL { from { transform: translateX(-30px); opacity: 0; } to { transform: none; opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 10px 14px; border-bottom: 1px solid var(--line); flex: none; }
.drawer-title { font-size: 11px; letter-spacing: .24em; display: flex; gap: 10px; align-items: baseline; }
.drawer-title .dim { letter-spacing: 0; font-size: 10px; }
#physlog-body { margin: 0; padding: 12px 14px; font-size: 11px; line-height: 1.5; overflow: auto; color: var(--text-2); white-space: pre; flex: 1; }
#physlog-body b { color: var(--accent); font-weight: 500; }
#physlog-body .k { color: var(--text-3); }

.mixer-master { padding: 12px 14px; display: grid; gap: 10px; border-bottom: 1px solid var(--line); }
.mute-big { border: 1px solid var(--line-2); border-radius: 4px; padding: 10px; letter-spacing: .2em; color: var(--text-2); transition: .2s; display: flex; justify-content: center; gap: 10px; align-items: center; }
.mute-big.on { background: rgba(255,90,90,.15); border-color: var(--bad); color: #ff8a8a; }
.fader { display: grid; grid-template-columns: 90px 1fr 46px; gap: 8px; align-items: center; font: 10px var(--mono); letter-spacing: .16em; color: var(--text-3); }
.fader .val { text-align: right; letter-spacing: 0; font-size: 11px; }
.sel { display: inline-flex; align-items: center; gap: 6px; font: 10px var(--mono); letter-spacing: .16em; color: var(--text-3); }
.mixer-scopes { padding: 10px 14px; display: grid; gap: 6px; border-bottom: 1px solid var(--line); }
.mixer-scopes canvas { width: 100%; height: auto; display: block; border: 1px solid var(--line); border-radius: 3px; background: #05070b; }
#mx-layers { overflow-y: auto; padding: 8px 14px 16px; display: grid; gap: 4px; }
.mx-group { font: 9.5px var(--mono); letter-spacing: .24em; color: var(--text-3); margin: 10px 0 4px; }
.layer { display: grid; grid-template-columns: 96px 1fr 30px 30px; gap: 6px; align-items: center; }
.layer .name { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.layer .name i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); opacity: .3; flex: none; }
.layer.active .name i { opacity: 1; box-shadow: 0 0 8px var(--accent); }
.layer .sm { width: 30px; height: 22px; border: 1px solid var(--line); border-radius: 3px; font: 10px var(--mono); color: var(--text-3); transition: .15s; }
.layer .sm.on-solo { border-color: var(--warn); color: var(--warn); background: rgba(232,179,60,.12); }
.layer .sm.on-mute { border-color: var(--bad); color: var(--bad); background: rgba(255,90,90,.12); }
.layer.muted-by-solo .name { opacity: .4; }

.sheet { position: fixed; inset: 0; z-index: 25; background: rgba(4, 6, 10, .78); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); display: grid; place-items: center; padding: 20px; animation: fadeIn .3s var(--ease) both; }
.sheet-inner { width: min(1100px, 100%); height: min(820px, 100%); background: var(--panel-solid); border: 1px solid var(--line); border-radius: 8px; display: flex; flex-direction: column; overflow: hidden; }
.manual-layout { display: grid; grid-template-columns: 240px 1fr; flex: 1; min-height: 0; }
.toc { border-right: 1px solid var(--line); overflow-y: auto; padding: 12px 0; }
.toc button { display: block; width: 100%; text-align: left; padding: 7px 16px; color: var(--text-2); font-size: 12px; border-left: 2px solid transparent; transition: .15s; }
.toc button:hover { color: var(--text); background: rgba(255,255,255,.03); }
.toc button.on { color: var(--accent); border-left-color: var(--accent); }
.toc .toc-h { font: 9.5px var(--mono); letter-spacing: .24em; color: var(--text-3); padding: 14px 16px 4px; }
.manual-body { overflow-y: auto; padding: 24px 36px 48px; max-width: 860px; color: var(--text-2); font-size: 14px; line-height: 1.65; scroll-behavior: smooth; }
.manual-body h1 { font-weight: 300; font-size: 26px; letter-spacing: .02em; color: var(--text); margin: 0 0 8px; }
.manual-body h2 { font-weight: 400; font-size: 18px; color: var(--text); margin: 32px 0 8px; padding-top: 16px; border-top: 1px solid var(--line); }
.manual-body h3 { font-weight: 500; font-size: 14px; color: var(--text); margin: 20px 0 6px; letter-spacing: .04em; }
.manual-body p { margin: 0 0 12px; }
.manual-body ul, .manual-body ol { padding-left: 20px; margin: 0 0 12px; }
.manual-body li { margin-bottom: 4px; }
.manual-body code, .manual-body .eq { font-family: var(--mono); font-size: 12.5px; color: var(--text); background: rgba(255,255,255,.04); padding: 1px 5px; border-radius: 3px; }
.manual-body .eq { display: block; padding: 10px 14px; margin: 8px 0 12px; border-left: 2px solid var(--accent); white-space: pre-wrap; }
.manual-body table { border-collapse: collapse; width: 100%; margin: 8px 0 16px; font-size: 12.5px; }
.manual-body th, .manual-body td { text-align: left; padding: 6px 8px; border-bottom: 1px solid var(--line); }
.manual-body th { color: var(--text-3); font: 10px var(--mono); letter-spacing: .18em; }
.manual-body td.mono, .manual-body .num { font-family: var(--mono); }
.manual-body figure { margin: 12px 0 18px; border: 1px solid var(--line); border-radius: 6px; padding: 12px; background: rgba(0,0,0,.25); }
.manual-body figure svg { width: 100%; height: auto; display: block; }
.manual-body figcaption { font-size: 11px; color: var(--text-3); margin-top: 8px; font-family: var(--mono); }
.manual-body a.jump { color: var(--accent); text-decoration: none; border-bottom: 1px dashed rgba(76,141,255,.5); cursor: pointer; }
.manual-body a.jump:hover { border-bottom-style: solid; }
.manual-body a.jump::after { content: " ⌖"; font-size: 11px; opacity: .8; }
.manual-body .callout { border: 1px solid var(--line); border-radius: 6px; padding: 10px 14px; margin: 10px 0 14px; background: rgba(76,141,255,.05); font-size: 13px; }
.manual-body dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0 0 12px; }
.manual-body dt { color: var(--text); font-family: var(--mono); font-size: 12.5px; }
.manual-body dd { margin: 0; }

/* =====================================================================
   TOOLTIP, LABELS, TOAST
   ===================================================================== */
.tooltip { position: fixed; z-index: 15; pointer-events: none; background: rgba(7,9,13,.92); border: 1px solid var(--line-2); border-radius: 4px; padding: 5px 9px; font-size: 11.5px; color: var(--text); transform: translate(12px, 12px); white-space: nowrap; }
.tooltip .tt-term { color: var(--text-3); font: 10px var(--mono); margin-left: 6px; }
#labels { position: fixed; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.plabel { position: absolute; transform: translate(-50%, -100%); font: 10px var(--mono); letter-spacing: .06em; color: var(--text-2); background: rgba(7,9,13,.7); border: 1px solid var(--line); padding: 2px 6px; border-radius: 3px; white-space: nowrap; }
.plabel::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 12px; background: var(--line-2); }
.toast { position: fixed; left: 50%; bottom: calc(var(--bottom-h) + 26px); transform: translate(-50%, 10px); background: rgba(7,9,13,.94); border: 1px solid var(--line-2); border-radius: 4px; padding: 8px 14px; font-size: 12px; color: var(--text); opacity: 0; transition: .3s var(--ease); z-index: 60; pointer-events: none; max-width: 80vw; text-align: center; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* =====================================================================
   ABOUT THE CREATOR
   ===================================================================== */
.about-fab { position: fixed; right: 18px; bottom: 18px; z-index: 70; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 14px; border-radius: 999px; border: 1px solid rgba(255,255,255,.28); color: #dfe7f5; background: rgba(5, 11, 26, .55); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); opacity: .55; letter-spacing: .1em; font-size: 11.5px; text-transform: uppercase; transition: opacity .35s var(--ease), border-color .35s, box-shadow .45s var(--ease), transform .35s var(--ease); }
.about-fab:hover, .about-fab:focus-visible { opacity: 1; border-color: var(--accent); box-shadow: 0 0 0 1px rgba(76,141,255,.4), 0 0 28px rgba(76,141,255,.35); color: #fff; transform: translateY(-1px); }
.fab-ring { width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid currentColor; position: relative; flex: none; }
.fab-ring::after { content: ""; position: absolute; inset: 3px; border-radius: 50%; background: currentColor; }
body.about-open .about-fab { opacity: 0; pointer-events: none; }

.about { position: fixed; inset: 0; z-index: 80; }
.about-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 15, .45); backdrop-filter: blur(14px) brightness(.55); -webkit-backdrop-filter: blur(14px) brightness(.55); opacity: 0; transition: opacity .6s var(--ease); }
.about.open .about-backdrop { opacity: 1; }
.about-panel { position: absolute; inset: 0; overflow: hidden; background: linear-gradient(180deg, #050B1A 0%, #0A1633 100%); clip-path: circle(0% at calc(100% - 38px) calc(100% - 38px)); transition: clip-path .6s var(--ease-io); }
.about.open .about-panel { clip-path: circle(150% at calc(100% - 38px) calc(100% - 38px)); }
.about.closing .about-panel { transition-duration: .5s; clip-path: circle(0% at calc(100% - 38px) calc(100% - 38px)); }
.about-panel::before { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse 70% 60% at 50% 45%, transparent 40%, #02060F 100%); pointer-events: none; z-index: 1; }
.about-atmo { position: absolute; inset: 0; overflow: hidden; }
.about-grid { position: absolute; inset: -60px; background-image: linear-gradient(rgba(76,141,255,.10) 1px, transparent 1px), linear-gradient(90deg, rgba(76,141,255,.10) 1px, transparent 1px); background-size: 64px 64px; animation: gridDrift 40s linear infinite; opacity: .55; mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%); -webkit-mask-image: radial-gradient(ellipse 70% 70% at 50% 50%, #000 30%, transparent 100%); }
@keyframes gridDrift { from { transform: translate(0, 0); } to { transform: translate(64px, 64px); } }
.about-aurora { position: absolute; inset: -20%; background: radial-gradient(ellipse 40% 30% at 30% 40%, rgba(76,141,255,.22), transparent 70%), radial-gradient(ellipse 35% 40% at 70% 65%, rgba(40,90,200,.20), transparent 70%), radial-gradient(ellipse 50% 30% at 55% 25%, rgba(120,170,255,.10), transparent 70%); filter: blur(30px); animation: aurora 22s var(--ease-io) infinite alternate; }
@keyframes aurora { from { transform: translate(-3%, -2%) rotate(-2deg) scale(1); } to { transform: translate(3%, 3%) rotate(2deg) scale(1.08); } }
.about-bloom { position: absolute; left: 50%; top: 42%; width: 70vmin; height: 70vmin; transform: translate(-50%, -50%); background: radial-gradient(circle, rgba(76,141,255,.28), rgba(76,141,255,.06) 40%, transparent 70%); filter: blur(10px); pointer-events: none; }
#about-canvas { position: absolute; inset: 0; width: 100%; height: 100%; opacity: .55; }
.about-close { position: absolute; top: 18px; right: 18px; z-index: 3; width: 40px; height: 40px; border-color: rgba(255,255,255,.3); color: #fff; font-size: 20px; background: rgba(5,11,26,.4); }
.about-close:hover { border-color: #fff; box-shadow: 0 0 0 1px rgba(255,255,255,.3); }
.about-content { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 40px 24px; gap: 0; }
.about [data-stagger] { opacity: 0; transform: translateY(18px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.about.open [data-stagger] { opacity: 1; transform: none; }
.about.open [data-stagger]:nth-of-type(1) { transition-delay: .25s; }
.about.open [data-stagger]:nth-of-type(2) { transition-delay: .38s; }
.about.open [data-stagger]:nth-of-type(3) { transition-delay: .55s; }
.about.open [data-stagger]:nth-of-type(4) { transition-delay: .68s; }
.about.open [data-stagger]:nth-of-type(5) { transition-delay: .85s; }
.about-kicker { font: 11px/1 var(--mono); letter-spacing: .46em; color: #C7D3EA; margin-bottom: 34px; }
.about-name { margin: 0; font-weight: 200; font-size: clamp(30px, 6vw, 68px); letter-spacing: .18em; color: #FFFFFF; line-height: 1.1; }
.about-name .sheen { display: inline-block; }
.about.open .about-name .sheen { background: linear-gradient(100deg, #fff 38%, #e8efff 47%, #9cc0ff 50%, #e8efff 53%, #fff 62%); background-size: 260% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: sheen 1.8s var(--ease) .7s 1 both; }
.about-rule { width: min(360px, 60vw); height: 1px; margin: 30px 0 38px; position: relative; }
.about-rule i { position: absolute; left: 50%; top: 0; height: 1px; width: 0; background: linear-gradient(90deg, transparent, var(--accent) 20%, #fff 50%, var(--accent) 80%, transparent); transform: translateX(-50%); transition: width 1.1s var(--ease-io) .6s; box-shadow: 0 0 12px rgba(76,141,255,.6); }
.about.open .about-rule i { width: 100%; }
.about-lines { display: grid; gap: 18px; font-size: clamp(14px, 1.7vw, 19px); }
.about-line { display: inline-flex; align-items: center; gap: 14px; justify-content: center; }
.about-link { color: #FFFFFF; text-decoration: none; position: relative; padding-bottom: 3px; letter-spacing: .04em; cursor: pointer; }
.about-link::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform .35s var(--ease); box-shadow: 0 0 10px rgba(76,141,255,.7); }
.about-link:hover::after, .about-link:focus-visible::after { transform: scaleX(1); }
.about .copy { font: 10px var(--mono); letter-spacing: .2em; text-transform: uppercase; color: #C7D3EA; border: 1px solid rgba(199,211,234,.35); border-radius: 3px; padding: 4px 8px; transition: .25s; }
.about .copy:hover, .about .copy:focus-visible { color: #fff; border-color: var(--accent); box-shadow: 0 0 14px rgba(76,141,255,.35); }
.about .copy.done { color: var(--accent); border-color: var(--accent); }
.about-wordmark { margin-top: 56px; font-size: 11px; letter-spacing: .38em; text-transform: uppercase; color: #C7D3EA; opacity: .8; }

/* =====================================================================
   RESPONSIVE
   ===================================================================== */
@media (max-width: 1100px) {
  :root { --panel-w: 300px; --rail-w: 210px; }
  #hud { right: 20px; }
}
@media (max-width: 860px) {
  :root { --bottom-h: 150px; }
  .cards { grid-template-columns: minmax(260px, 440px); }
  .hdr-brand .brand-name, .spk-label, #btn-log { display: none; }
  #rail { width: 200px; }
  #hud { left: 220px; right: 10px; }
  #panel { width: min(340px, calc(100vw - 20px)); }
  .manual-layout { grid-template-columns: 1fr; }
  .toc { display: flex; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); padding: 6px; }
  .toc button { width: auto; white-space: nowrap; border-left: 0; border-bottom: 2px solid transparent; }
  .toc button.on { border-bottom-color: var(--accent); }
  .toc .toc-h { display: none; }
  .manual-body { padding: 18px; }
  .about-fab { width: 40px; padding: 0; justify-content: center; }
  .about-fab .fab-label { display: none; }
  .about-fab:hover, .about-fab:focus-visible { width: auto; padding: 0 16px 0 14px; }
  .about-fab:hover .fab-label, .about-fab:focus-visible .fab-label { display: inline; }
}
@media (max-width: 640px) {
  :root { --bottom-h: 168px; }
  #select { padding-top: 32px; -webkit-overflow-scrolling: touch; }
  .hdr-context, .hdr-sep { display: none; }
  #hdr { gap: 8px; padding: 0 8px; }
  .hdr-btn { padding: 6px 8px; }
  #hud { top: calc(var(--hdr-h) + 6px); }
  #rail { display: none; }
  #rail.mobile-open { display: grid; left: 10px; right: 10px; width: auto; }
  #hud { left: 10px; right: 10px; }
  #hud canvas { max-height: 90px; }
  .drawer { width: 100vw; }
  .about-panel { clip-path: inset(100% 0 0 0); transition: clip-path .6s var(--ease-io); }
  .about.open .about-panel { clip-path: inset(0 0 0 0); }
  .about.closing .about-panel { clip-path: inset(100% 0 0 0); }
  .about-content { justify-content: flex-start; padding-top: 18vh; }
  .about-lines { font-size: 13px; }
  .about-line { flex-wrap: wrap; }
  #stress-bars { width: calc(100vw - 20px); }
  .time-ctl { flex-wrap: wrap; gap: 6px 12px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .about-panel { clip-path: none !important; opacity: 0; transition: opacity .3s !important; }
  .about.open .about-panel { opacity: 1; }
  .about [data-stagger] { transform: none; }
}
