:root{color-scheme:dark;--ink:#0e1118;--panel:#151a24;--raise:#1c2331;--line:#2a3242;--text:#e8ecf3;--muted:#9aa6b6;--acc:#8a7cff;--gold:#e8b44a;--bad:#ff7a7a;--good:#9be38a;
  --nx-move:150ms;--nx-fade:150ms;--nx-ease:linear(0,0.0022,0.0161,0.0488,0.1035,0.18,0.2752,0.384,0.5,0.616,0.7248,0.82,0.8965,0.9512,0.9839,0.9978,1)}
*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--ink);color:var(--text);font:13px system-ui,"Segoe UI",sans-serif;overflow:hidden}
button,select,input{font:inherit;color:inherit}
:root{--bg:var(--ink);--card:var(--panel);--dim:var(--muted)}
*{min-width:0;box-sizing:border-box}html,body{height:100%;overflow:hidden}body{display:flex;flex-direction:column;font-size:14px}body>.bar{height:auto;display:block;padding:10px 16px;-webkit-app-region:no-drag}.bar h1{font-size:21px}.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}.sp{flex:1}#sub{font-size:12px;color:var(--muted)}nav{display:flex;gap:6px;flex-wrap:wrap;margin-top:10px}button,select,input,textarea,summary{font:inherit;color:inherit}button,select{cursor:pointer}button{display:inline-flex;align-items:center;justify-content:center;gap:6px;border:1px solid var(--line);border-radius:8px;background:var(--raise);padding:8px 12px;transition:background 150ms var(--nx-ease),border-color 150ms var(--nx-ease)}button:hover{border-color:var(--acc)}button:disabled{opacity:.45;cursor:default}button.primary,[aria-current=true],[aria-pressed=true]{background:var(--acc);color:#fff}button.warn{color:var(--bad)}svg{width:16px;height:16px;flex:none;fill:none;stroke:currentColor;stroke-width:1.7}#badge{padding:7px 16px;background:#292233;color:#d9caff;font-size:12px;flex:none}#view{overflow:auto;flex:1;padding:20px clamp(12px,3vw,36px);scrollbar-gutter:stable}#view>section{max-width:1220px;margin:auto}h2{font-size:24px;line-height:1.25;margin:0 0 16px}h3{margin:0 0 10px;font-size:16px}p{line-height:1.6}.muted,small{color:var(--muted)}.card{padding:18px;background:var(--panel);border:1px solid var(--line);border-radius:12px;margin-bottom:14px}.grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}.two{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}.metric{font-size:27px;font-variant-numeric:tabular-nums}.money{color:var(--gold)}label{display:grid;gap:6px;margin:10px 0}input,textarea,select{max-width:100%;background:#0e1118;border:1px solid var(--line);border-radius:7px;padding:8px}input:not([type=checkbox]),textarea{width:100%}input[type=checkbox]{accent-color:var(--acc)}textarea{min-height:70px;resize:vertical}form{max-width:680px}table{border-collapse:collapse;width:100%;table-layout:fixed;font-size:13px}td,th{text-align:left;padding:10px;border-bottom:1px solid var(--line);vertical-align:top}td,th,p,pre,button,small,label,h2,h3,summary{overflow-wrap:anywhere}pre{white-space:pre-wrap;font-size:12px}img{display:block;max-width:100%;width:100%;border-radius:8px}.candidate{padding:12px;cursor:pointer}.candidate:focus,.candidate.selected{outline:2px solid var(--acc)}.candidate .row{gap:5px}.candidate button{padding:5px 8px}.candidate input{padding:5px}.pin{max-width:330px;margin:20px auto}.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.keypad button{padding:14px;font-size:18px}.pin input{text-align:center;font-size:24px;letter-spacing:12px}.strip{display:flex;height:25px;gap:1px;margin:14px 0}.strip i{flex:1;min-width:0}.attentive{background:var(--acc)}.active{background:var(--gold)}.paused{background:#445066}.legend span{display:inline-flex;align-items:center;gap:5px;font-size:12px}.legend i{width:9px;height:9px;display:inline-block}progress{accent-color:var(--acc);width:100%;height:12px}.timeline{display:flex;flex-wrap:wrap;gap:6px;font-size:12px;margin:12px 0}.timeline span{border-bottom:2px solid var(--line);padding:4px}.timeline .current{color:#d2c8ff;border-color:var(--acc)}.notes{padding-left:20px}.chart{width:100%;height:190px;background:#0e1118;border-radius:8px}#message{position:fixed;bottom:12px;right:12px;max-width:calc(100vw - 24px);padding:10px 16px;border-radius:8px;background:#312545;box-shadow:0 4px 20px #0008;pointer-events:none}#message:empty{display:none}#xall{display:flex;gap:6px;flex-wrap:wrap}#xall input{width:160px}.tree{padding-left:16px;border-left:1px solid var(--line)}.story{min-height:160px;padding:18px;position:relative;border-radius:10px;overflow:hidden}.style-ledger,.style-scoreboard{font-variant-numeric:tabular-nums;font-family:monospace}.style-telegram,.style-terminal{font-family:monospace;letter-spacing:1px}.style-field-notes,.style-letter{font-family:Georgia,serif;font-style:italic}.style-illuminated:first-letter{font-size:2em;color:var(--gold)}.style-broadcast,.style-bulletin{font-weight:750}.style-case-file{border-left:3px solid #a8b8ce}.style-ship-s-log,.style-almanac{font-family:Georgia,serif}.style-myth,.style-liturgy{font-family:Georgia,serif;line-height:1.9}.style-whisper{font-size:13px;letter-spacing:1px}.style-chorus{font-weight:600;line-height:2}.fx-ember-edge{box-shadow:inset 0 0 25px #e8874088}.fx-heat-haze{background:repeating-linear-gradient(2deg,#a85d3522 0 5px,transparent 6px 11px)}.fx-ink-bleed{text-shadow:0 0 5px #bc9efb}.fx-typewriter{animation:reveal 3s steps(32) both}.fx-scanline-crt{background:repeating-linear-gradient(0deg,#0007 0 1px,#91ce9c11 2px 4px)}.fx-frost-creep{box-shadow:inset 0 0 30px #a3d7ed77;border:1px solid #bedaf2}.fx-aurora-wash{background:linear-gradient(120deg,#658f6633,#8a7cff55,#edaa3033);background-size:200% 200%;animation:wash 6s ease infinite alternate}.fx-eclipse-rim{box-shadow:inset 0 0 4px 2px #edc878,0 0 15px #8a7cff44}.fx-glitch-slice{text-shadow:2px 0 #fc809566,-2px 0 #71e4eb66}.fx-parchment-burn{background:radial-gradient(ellipse,#423224,#1b1715);box-shadow:inset 0 0 24px #d1852c66}.fx-rain-glass{background:repeating-linear-gradient(105deg,transparent 0 16px,#c4deed18 17px 18px);backdrop-filter:blur(4px)}.fx-neon-flicker{border:1px solid #af8dfb;animation:neon 4s ease infinite}@keyframes reveal{from{clip-path:inset(0 100% 0 0)}to{clip-path:inset(0)}}@keyframes wash{to{background-position:100% 100%}}@keyframes neon{0%,94%,98%{box-shadow:inset 0 0 10px #8a7cff66}96%,100%{box-shadow:inset 0 0 2px #8a7cff22}}@media(max-width:1000px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){.two,.grid{grid-template-columns:minmax(0,1fr)}#view{padding:14px 10px}.bar .row{gap:7px}.bar h1{font-size:19px}.bar #sub{width:calc(100% - 110px)}.bar button{padding:6px 9px}td,th{padding:7px;font-size:12px}.metric{font-size:24px}.card{padding:13px}}@media(prefers-reduced-motion:reduce){*{animation:none!important;transition:none!important}}

.symbol-label{display:inline-flex;gap:6px;align-items:center}
.category-row{padding:0;overflow:hidden}.category-row>summary{display:flex;align-items:center;gap:10px;padding:13px 16px;cursor:pointer;list-style:none}.category-row>summary::before{content:'\203a';font-size:20px;color:var(--muted)}.category-row[open]>summary::before{transform:rotate(90deg)}.category-row>summary small{margin-left:auto;text-align:right}.category-row>form,.category-row>details{margin:16px;max-width:680px}.category-row[open]>summary{border-bottom:1px solid var(--line)}
#header-menu{position:relative}#header-menu>summary{display:none}.header-controls{display:flex;align-items:center;gap:6px}
@media(max-width:599px){
 body>.bar{padding:8px 10px}.bar>.row{flex-wrap:nowrap}.bar #sub{width:auto;flex:1;font-size:11px}.bar .sp{display:none}.bar h1{margin:0}.bar #lock{flex:none}
 #header-menu>summary{display:flex;align-items:center;justify-content:center;list-style:none;border:1px solid var(--line);border-radius:8px;padding:8px;cursor:pointer}#header-menu>summary::-webkit-details-marker{display:none}
 #header-menu:not([open])>.header-controls{display:none}#header-menu[open]>.header-controls{position:absolute;z-index:10;right:0;top:calc(100% + 6px);display:flex;flex-direction:column;align-items:stretch;width:210px;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:10px;box-shadow:0 8px 24px #0008}#xall{flex-direction:column}#xall button{width:100%}
 #nav{flex-wrap:nowrap;gap:6px;margin-top:8px;padding-bottom:2px}#nav button{flex:1;white-space:nowrap;padding:8px;min-height:34px}#nav .nav-label{display:none}.category-row>summary{flex-wrap:wrap;gap:6px}.category-row>summary small{margin-left:20px;text-align:left;width:100%}
}


body>.bar{padding-top:max(10px,env(safe-area-inset-top));padding-left:max(12px,env(safe-area-inset-left));padding-right:max(12px,env(safe-area-inset-right))}#view{padding-bottom:calc(20px + env(safe-area-inset-bottom) + var(--keyboard,0px))}button,input,select,summary,.candidate button{min-height:44px}textarea{scroll-margin-bottom:100px}.contractor-frame{width:100%;height:calc(100vh - 240px);min-height:400px;border:1px solid var(--line);border-radius:12px}.trading-card{position:relative;isolation:isolate;overflow:hidden;border:1px solid #ac92dd;border-radius:14px;padding:10px;display:grid;gap:6px;min-height:480px;background:linear-gradient(145deg,#382657,#125f64);margin-bottom:12px}.card-shader{position:absolute;inset:0;width:100%;height:100%;z-index:-1}.card-part{padding:7px;border:1px solid #ad9aff44;border-radius:7px;overflow-wrap:anywhere;font-size:12px}.card-part[data-card-part=name]{font-size:18px}.card-part[data-card-part=art] img{height:150px;object-fit:contain}.text-glow{text-shadow:0 0 6px currentColor}.text-outline{text-shadow:1px 1px #000}.shader-fallback .card-shader{visibility:hidden}#nav{flex-wrap:wrap}#nav .nav-label{display:inline}#nav button{white-space:normal;flex:0 1 auto}button,summary{touch-action:manipulation}.candidate{cursor:default}@media(min-width:601px) and (max-width:900px){.grid{grid-template-columns:repeat(2,minmax(0,1fr))}}@media(max-width:600px){#nav button{min-height:44px}.grid{grid-template-columns:minmax(0,1fr)}.trading-card{max-width:380px;margin-inline:auto}.bar h1{font-size:18px}#header-menu>summary{min-width:44px}.candidate button{padding:8px}}

.card-part{min-height:44px}
.email-switch{display:flex;align-items:center;gap:10px;min-height:44px;cursor:pointer}
input[type=checkbox]{width:20px;height:20px;min-height:20px;flex:none;margin:0;padding:0}
.dev-chip{display:inline-flex;align-items:center;border:1px solid var(--acc);border-radius:6px;padding:3px 6px;color:#d9caff;font-size:11px;white-space:nowrap}
.dev-label{color:var(--gold)}
.mode-switch{display:inline-flex;align-items:center;gap:4px;flex:none}
.mode-switch button{padding-inline:9px}
.bar h1{margin:0}
#message{bottom:calc(12px + env(safe-area-inset-bottom))}
@media(max-width:599px){
 .bar:has(.mode-switch) #sub,.bar:has(.mode-switch) .sp{display:none}
 .bar:has(.mode-switch)>.row{gap:5px}
 .bar:has(.mode-switch) h1{font-size:17px}
 .mode-switch{gap:3px}.mode-switch button{padding:6px}
 #nav{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
 #nav button{flex:none;white-space:nowrap}
 #nav .nav-label{display:none}
}
