:root {
  --bg: #06030d;
  --panel: rgba(14, 10, 28, 0.86);
  --panel-2: rgba(22, 16, 42, 0.9);
  --line: rgba(190, 160, 255, 0.14);
  --line-2: rgba(190, 160, 255, 0.24);
  --text: #ece8ff;
  --text-2: rgba(236, 232, 255, 0.66);
  --text-3: rgba(236, 232, 255, 0.42);
  --pink: #ff2bd6;
  --cyan: #22e6ff;
  --lime: #a3ff3c;
  --gold: #ffd23f;
  --up: #39ff9c;
  --down: #ff3d71;
  --accent: #22e6ff;
  --display: Orbitron, 'JetBrains Mono', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --ui: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: var(--bg); color: var(--text); font-family: var(--ui); font-size: 14px; -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }
.ic { flex: none; display: block; }
.muted { color: var(--text-2); }
.small { font-size: 12px; }
.up { color: var(--up) !important; }
.down { color: var(--down) !important; }
.mono { font-family: var(--mono); }
::selection { background: rgba(255, 43, 214, 0.35); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: rgba(190, 160, 255, 0.2); border-radius: 8px; }
::-webkit-scrollbar-track { background: transparent; }

#scene { position: fixed; inset: 0; width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
#scene:active { cursor: grabbing; }

/* ─── HUD ─────────────────────────────────────────── */
.hud-top { position: fixed; top: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px; pointer-events: none; z-index: 10; }
.hud-top > * { pointer-events: auto; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-logo { font-family: var(--display); font-weight: 900; font-size: 30px; letter-spacing: 0.08em; color: #fff; text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink), 0 0 40px rgba(255, 43, 214, 0.6); }
.brand-sub { font-family: var(--mono); font-size: 11px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--text-2); padding-left: 12px; border-left: 1px solid var(--line-2); }
.hud-x { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line-2); text-decoration: none; font-size: 15px; transition: 0.2s; }
.hud-x:hover { border-color: var(--pink); box-shadow: 0 0 16px rgba(255, 43, 214, 0.5); }
.hud-right { display: flex; align-items: center; gap: 10px; }
.ca-chip, .live-chip, .clock { display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(10px); font-family: var(--mono); font-size: 12px; }
.ca-chip { max-width: 290px; transition: 0.2s; }
.ca-chip b { color: #04120a; background: linear-gradient(135deg, #d9ffb0, var(--lime)); padding: 2px 7px; border-radius: 6px; font-size: 11px; letter-spacing: 0.08em; }
.ca-chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ca-chip:hover { border-color: rgba(163, 255, 60, 0.5); box-shadow: 0 0 20px rgba(163, 255, 60, 0.2); }
.live-chip { letter-spacing: 0.12em; color: var(--text-2); }
.live-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 10px var(--up); animation: pulse 1.6s infinite; }
.live-chip.off i { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
@keyframes pulse { 50% { opacity: 0.35; } }

.ticker { position: fixed; left: 0; right: 0; bottom: 86px; height: 30px; overflow: hidden; z-index: 9; pointer-events: none; mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.ticker-track { display: inline-flex; gap: 34px; white-space: nowrap; font-family: var(--mono); font-size: 12px; line-height: 30px; animation: tick 70s linear infinite; padding-left: 100%; }
.ticker-track span b { color: #fff; margin-right: 6px; }
.ticker-track i { font-style: normal; display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 7px; vertical-align: 1px; }
@keyframes tick { to { transform: translateX(-100%); } }

.dock { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; padding: 7px; border-radius: 18px; background: var(--panel); border: 1px solid var(--line); backdrop-filter: blur(14px); box-shadow: 0 20px 60px -20px rgba(0, 0, 0, 0.8), 0 0 0 1px rgba(255, 43, 214, 0.05); z-index: 10; max-width: calc(100vw - 24px); }
.dock > button { display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; color: var(--text-2); font-size: 13px; font-weight: 600; transition: 0.18s; white-space: nowrap; }
.dock > button:hover, .dock > button.on { color: #fff; background: rgba(190, 160, 255, 0.1); }
.dock > button.on { box-shadow: inset 0 0 0 1px rgba(34, 230, 255, 0.35); color: var(--cyan); }
.x-glyph { font-size: 15px; width: 18px; text-align: center; }
.dock-sep { width: 1px; height: 26px; background: var(--line-2); margin: 0 4px; }
.dock-crew { display: flex; gap: 4px; }
.crew-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 12px 0 8px; border-radius: 12px; font-size: 13px; font-weight: 700; color: var(--text-2); transition: 0.18s; }
.crew-btn .av { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 9px; font-family: var(--display); font-size: 12px; color: #05030b; background: var(--c); box-shadow: 0 0 14px color-mix(in srgb, var(--c) 60%, transparent); }
.crew-btn small { display: block; font-family: var(--mono); font-size: 10.5px; font-weight: 600; }
.crew-btn:hover { background: rgba(190, 160, 255, 0.08); color: #fff; }
.crew-btn.on { background: color-mix(in srgb, var(--c) 14%, transparent); color: #fff; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 50%, transparent); }

#tip { position: fixed; z-index: 12; pointer-events: none; transform: translate(14px, 14px); padding: 7px 11px; border-radius: 9px; background: var(--panel-2); border: 1px solid var(--line-2); font-size: 12px; font-weight: 600; white-space: nowrap; backdrop-filter: blur(8px); }

#bubbles { position: fixed; inset: 0; pointer-events: none; z-index: 8; }
.bubble { position: absolute; left: 0; top: 0; max-width: 240px; padding: 9px 12px 9px; border-radius: 14px 14px 14px 4px; background: rgba(10, 7, 22, 0.92); border: 1px solid color-mix(in srgb, var(--c) 55%, transparent); box-shadow: 0 0 22px color-mix(in srgb, var(--c) 30%, transparent); font-size: 13px; line-height: 1.35; transform: translate(-10%, -100%); animation: pop 0.35s cubic-bezier(0.2, 1.4, 0.4, 1); will-change: left, top; }
.bubble b { display: block; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.1em; text-transform: uppercase; color: var(--c); margin-bottom: 2px; }
.bubble.out { opacity: 0; transform: translate(-10%, -120%); transition: 0.4s; }
@keyframes pop { from { opacity: 0; transform: translate(-10%, -60%) scale(0.85); } }

#toasts { position: fixed; top: 64px; right: 20px; display: flex; flex-direction: column; gap: 8px; z-index: 60; pointer-events: none; }
.toast { --c: var(--cyan); min-width: 220px; max-width: 320px; padding: 10px 14px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); border-left: 3px solid var(--c); backdrop-filter: blur(12px); animation: slideIn 0.3s ease; box-shadow: 0 14px 40px -12px rgba(0, 0, 0, 0.7); }
.toast b { display: block; font-size: 13px; }
.toast span { display: block; font-size: 12px; color: var(--text-2); margin-top: 2px; }
.toast.out { opacity: 0; transform: translateX(20px); transition: 0.4s; }
@keyframes slideIn { from { opacity: 0; transform: translateX(30px); } }

/* ─── Modal ───────────────────────────────────────── */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(3, 1, 8, 0.6); backdrop-filter: blur(6px); padding: 16px; }
.modal-card { width: min(440px, 100%); background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 18px; padding: 18px 20px; box-shadow: 0 30px 80px -20px #000; }
.modal-card header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; font-family: var(--display); letter-spacing: 0.06em; }
.modal-card header button { font-size: 22px; color: var(--text-2); width: 30px; height: 30px; border-radius: 8px; }
.modal-card header button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.keys { display: grid; gap: 8px; }
.keys div { display: flex; align-items: center; gap: 6px; }
.keys span { margin-left: 8px; color: var(--text-2); }
kbd { display: inline-grid; place-items: center; min-width: 26px; height: 24px; padding: 0 7px; border-radius: 6px; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); border-bottom-width: 2px; font-family: var(--mono); font-size: 11px; }

/* ─── Loader & corridor intro ────────────────────── */
#loader { position: fixed; inset: 0; z-index: 100; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 22px; padding: 20px; background: radial-gradient(ellipse at 50% 45%, #1a0a2a 0%, #07030f 60%, #030107 100%); transition: opacity 0.9s, visibility 0.9s; }
#loader.gone { opacity: 0; visibility: hidden; }
.boot-logo { font-family: var(--display); font-weight: 900; font-size: clamp(56px, 12vw, 92px); letter-spacing: 0.12em; color: #fff; text-shadow: 0 0 8px var(--pink), 0 0 22px var(--pink), 0 0 50px rgba(255, 43, 214, 0.55); animation: flicker 4s infinite; }
@keyframes flicker { 0%, 18%, 22%, 62%, 64%, 100% { opacity: 1; } 20%, 63% { opacity: 0.55; } }
.load-bar { width: min(260px, 70vw); height: 3px; border-radius: 3px; background: rgba(255, 255, 255, 0.08); overflow: hidden; }
.load-bar i { display: block; width: 40%; height: 100%; background: linear-gradient(90deg, var(--pink), var(--cyan)); border-radius: 3px; animation: loadSlide 1.1s ease-in-out infinite; }
@keyframes loadSlide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.load-txt { font-family: var(--mono); font-size: 12px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-2); }
.boot-btn { width: 170px; height: 58px; border-radius: 14px; font-family: var(--display); font-weight: 800; font-size: 16px; letter-spacing: 0.14em; border: 1.5px solid rgba(255, 43, 214, 0.6); color: #fff; background: rgba(255, 255, 255, 0.02); box-shadow: 0 0 30px -6px rgba(255, 43, 214, 0.6); }

#intro-ui { position: fixed; inset: 0; z-index: 20; pointer-events: none; opacity: 0; transition: opacity 0.8s; }
#intro-ui.show { opacity: 1; }
body:not(.intro) #intro-ui { display: none; }
.intro-brand { position: absolute; top: 18px; left: 22px; font-family: var(--display); font-weight: 900; font-size: 28px; letter-spacing: 0.1em; color: #fff; text-shadow: 0 0 6px var(--pink), 0 0 18px var(--pink); }
.enter-hint { position: absolute; left: 50%; bottom: 7vh; transform: translateX(-50%); pointer-events: auto; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 14px 26px; border-radius: 16px; background: rgba(10, 6, 20, 0.7); border: 1px solid rgba(255, 43, 214, 0.45); backdrop-filter: blur(10px); font-family: var(--display); font-weight: 800; font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase; color: #fff; box-shadow: 0 0 40px -10px rgba(255, 43, 214, 0.7); animation: hintPulse 2.2s ease-in-out infinite; transition: border-color 0.2s, box-shadow 0.2s; }
.enter-hint i { width: 8px; height: 8px; border-radius: 50%; background: var(--pink); box-shadow: 0 0 12px var(--pink); margin-bottom: 4px; }
.enter-hint span { font-family: var(--mono); font-size: 10.5px; font-weight: 600; letter-spacing: 0.14em; color: var(--text-3); }
.enter-hint:hover, body.door-hover .enter-hint { border-color: var(--cyan); box-shadow: 0 0 50px -8px rgba(34, 230, 255, 0.7); }
@keyframes hintPulse { 50% { transform: translateX(-50%) translateY(-4px); } }

body.intro .hud-top, body.intro .dock, body.intro .ticker, body.intro #bubbles { opacity: 0; pointer-events: none; }
body.intro .hud-top > *, body.intro .dock * { pointer-events: none !important; }
.hud-top, .dock, .ticker, #bubbles { transition: opacity 0.8s 0.3s; }

/* ─── OS ──────────────────────────────────────────── */
#os { position: fixed; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 64px 28px 28px; background: rgba(3, 1, 8, 0.55); backdrop-filter: blur(3px); animation: fadeIn 0.35s ease; }
@keyframes fadeIn { from { opacity: 0; } }
.os-top { position: absolute; top: 14px; left: 20px; right: 20px; display: flex; align-items: center; gap: 12px; }
.os-exit { display: inline-flex; align-items: center; gap: 8px; height: 38px; padding: 0 16px; border-radius: 12px; background: var(--panel-2); border: 1px solid var(--line-2); font-weight: 600; }
.os-exit:hover { border-color: var(--accent); }
.os-who { font-family: var(--mono); font-size: 12px; color: var(--text-2); }
.os-who b { color: var(--accent); }
.os-seats { margin-left: auto; display: flex; gap: 6px; }
.os-seats button { height: 34px; padding: 0 12px; border-radius: 10px; font-size: 12px; font-weight: 700; color: var(--text-2); border: 1px solid var(--line); background: var(--panel); }
.os-seats button.on { color: #05030b; background: var(--c); border-color: var(--c); }
.os-monitor { position: relative; width: min(1180px, 100%); height: min(740px, 100%); padding: 14px; border-radius: 22px; background: linear-gradient(160deg, #1b1728, #0a0812); border: 1px solid rgba(255, 255, 255, 0.08); box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.6), 0 0 60px -10px color-mix(in srgb, var(--accent) 45%, transparent), 0 40px 100px -30px #000; animation: rise 0.45s cubic-bezier(0.2, 0.9, 0.3, 1); }
@keyframes rise { from { opacity: 0; transform: translateY(26px) scale(0.97); } }
.os-screen { position: relative; width: 100%; height: 100%; border-radius: 12px; overflow: hidden; background: #07050f; container-type: size; }
.os-wall { position: absolute; inset: 0; background: radial-gradient(ellipse at 20% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 55%), radial-gradient(ellipse at 100% 100%, rgba(255, 43, 214, 0.16), transparent 50%), linear-gradient(180deg, #0a0717, #05030b); }
.os-wall::before { content: ''; position: absolute; left: -50%; right: -50%; bottom: 0; height: 55%; background-image: linear-gradient(color-mix(in srgb, var(--accent) 30%, transparent) 1px, transparent 1px), linear-gradient(90deg, color-mix(in srgb, var(--accent) 30%, transparent) 1px, transparent 1px); background-size: 60px 60px; transform: perspective(400px) rotateX(62deg); transform-origin: bottom; mask-image: linear-gradient(transparent, #000 70%); opacity: 0.35; }
.os-wall-logo { position: absolute; right: 5%; top: 42%; transform: translateY(-50%); font-family: var(--display); font-weight: 900; font-size: clamp(60px, 14cqw, 180px); letter-spacing: 0.1em; color: transparent; -webkit-text-stroke: 1px color-mix(in srgb, var(--accent) 35%, transparent); opacity: 0.6; user-select: none; }
.os-icons { position: absolute; left: 18px; top: 18px; bottom: 70px; display: grid; grid-auto-flow: column; grid-template-rows: repeat(auto-fill, 92px); gap: 6px 10px; align-content: start; }
.os-icon { width: 86px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 8px 4px; border-radius: 12px; font-size: 11.5px; font-weight: 600; text-align: center; color: var(--text); text-shadow: 0 1px 4px #000; }
.os-icon .tile { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 14px; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 30%, #151024), #0e0a1a); border: 1px solid color-mix(in srgb, var(--c) 45%, transparent); color: var(--c); box-shadow: 0 6px 20px -6px color-mix(in srgb, var(--c) 50%, transparent); transition: 0.2s; }
.os-icon:hover { background: rgba(255, 255, 255, 0.06); }
.os-icon:hover .tile { transform: translateY(-2px) scale(1.04); }
.os-wins { position: absolute; inset: 0 0 52px 0; pointer-events: none; }
.os-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 52px; display: flex; align-items: center; gap: 6px; padding: 0 10px; background: rgba(8, 6, 18, 0.88); border-top: 1px solid var(--line); backdrop-filter: blur(14px); z-index: 5; }
.os-start { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 12px; border-radius: 10px; font-family: var(--display); font-weight: 900; letter-spacing: 0.08em; color: var(--accent); }
.os-start:hover, .os-start.on { background: rgba(255, 255, 255, 0.07); }
.os-tasks { flex: 1; display: flex; gap: 4px; overflow-x: auto; min-width: 0; }
.os-task { display: inline-flex; align-items: center; gap: 7px; height: 36px; padding: 0 11px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--text-2); white-space: nowrap; border-bottom: 2px solid transparent; }
.os-task:hover { background: rgba(255, 255, 255, 0.06); }
.os-task.on { color: #fff; background: rgba(255, 255, 255, 0.07); border-bottom-color: var(--accent); }
.os-tray { display: flex; align-items: center; gap: 10px; font-family: var(--mono); font-size: 11.5px; color: var(--text-2); padding: 0 6px; white-space: nowrap; }
.os-tray .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--up); box-shadow: 0 0 8px var(--up); }
.os-menu { position: absolute; left: 10px; bottom: 60px; width: 290px; padding: 10px; border-radius: 16px; background: rgba(12, 9, 26, 0.96); border: 1px solid var(--line-2); box-shadow: 0 30px 70px -20px #000; z-index: 6; animation: rise 0.25s ease; }
.os-menu h4 { margin: 4px 8px 8px; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.16em; color: var(--text-3); text-transform: uppercase; }
.os-menu button { display: flex; align-items: center; gap: 11px; width: 100%; padding: 8px; border-radius: 10px; text-align: left; }
.os-menu button:hover { background: rgba(255, 255, 255, 0.06); }
.os-menu button .tile { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.os-menu button b { display: block; font-size: 13px; }
.os-menu button span { display: block; font-size: 11.5px; color: var(--text-3); }

.win { position: absolute; display: flex; flex-direction: column; min-width: 300px; min-height: 200px; border-radius: 14px; overflow: hidden; background: rgba(11, 8, 23, 0.95); border: 1px solid var(--line-2); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9); pointer-events: auto; resize: both; animation: winIn 0.22s ease; max-width: 100%; max-height: 100%; }
@keyframes winIn { from { opacity: 0; transform: scale(0.96); } }
.win.focus { border-color: color-mix(in srgb, var(--accent) 45%, transparent); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.9), 0 0 30px -12px var(--accent); }
.win.max { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
.win.min { display: none; }
.win-h { flex: none; display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 8px 0 12px; background: linear-gradient(180deg, rgba(255, 255, 255, 0.05), transparent); border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.win-h:active { cursor: grabbing; }
.win-h .ttl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 700; color: var(--text); flex: 1; min-width: 0; }
.win-h .ttl .ic { color: var(--c, var(--accent)); }
.win-btns { display: flex; gap: 2px; }
.win-btns button { width: 28px; height: 26px; border-radius: 7px; color: var(--text-2); font-size: 15px; line-height: 1; display: grid; place-items: center; }
.win-btns button:hover { background: rgba(255, 255, 255, 0.08); color: #fff; }
.win-btns button[data-close]:hover { background: #ff3d71; }
.win-b { flex: 1; min-height: 0; overflow: auto; position: relative; }

/* ─── App kit ─────────────────────────────────────── */
.app { padding: 16px; display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.app.flush { padding: 0; gap: 0; }
.row { display: flex; align-items: center; gap: 8px; }
.between { justify-content: space-between; }
.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.h1 { font-family: var(--display); font-weight: 900; letter-spacing: 0.05em; margin: 0; }
.label { font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text-3); }
.card { background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 10px; font-size: 12.5px; font-weight: 700; background: rgba(255, 255, 255, 0.06); border: 1px solid var(--line-2); color: var(--text); transition: 0.15s; white-space: nowrap; text-decoration: none; }
.btn:hover { background: rgba(255, 255, 255, 0.1); border-color: var(--accent); }
.btn.pri { background: var(--accent); border-color: var(--accent); color: #05030b; }
.btn.pri:hover { filter: brightness(1.12); }
.btn.sm { height: 28px; padding: 0 9px; font-size: 11.5px; border-radius: 8px; }
.btn.icon { width: 34px; padding: 0; }
.btn.sm.icon { width: 28px; }
.btn.on { border-color: var(--accent); color: var(--accent); }
.inp { height: 36px; padding: 0 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); border: 1px solid var(--line-2); outline: 0; min-width: 0; font-size: 13px; }
.inp:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 20%, transparent); }
.inp.mono { font-family: var(--mono); font-size: 12.5px; }
select.inp { padding-right: 6px; }
.tabs { display: flex; gap: 4px; padding: 3px; background: rgba(0, 0, 0, 0.3); border: 1px solid var(--line); border-radius: 11px; width: max-content; max-width: 100%; overflow-x: auto; }
.tabs button { height: 28px; padding: 0 11px; border-radius: 8px; font-size: 12px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.tabs button.on { background: rgba(255, 255, 255, 0.1); color: #fff; }
.chain { display: inline-flex; align-items: center; gap: 5px; height: 20px; padding: 0 7px; border-radius: 6px; font-family: var(--mono); font-size: 10px; font-weight: 700; letter-spacing: 0.06em; color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.tok { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tok img, .tok .ph { width: 30px; height: 30px; border-radius: 50%; flex: none; object-fit: cover; background: #1b1530; }
.tok .ph { display: grid; place-items: center; font-family: var(--display); font-size: 12px; color: var(--c, #fff); }
.tok b { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tok > div > span { display: block; font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 160px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.tbl th { position: sticky; top: 0; z-index: 1; text-align: right; padding: 8px 10px; font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; font-weight: 600; color: var(--text-3); text-transform: uppercase; background: rgba(11, 8, 23, 0.98); border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl th:first-child, .tbl td:first-child { text-align: left; }
.tbl td { padding: 8px 10px; text-align: right; border-bottom: 1px solid rgba(190, 160, 255, 0.06); font-family: var(--mono); white-space: nowrap; }
.tbl tbody tr { cursor: pointer; transition: background 0.12s; }
.tbl tbody tr:hover { background: rgba(255, 255, 255, 0.04); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; }
.stat { padding: 10px 12px; border-radius: 10px; background: rgba(255, 255, 255, 0.03); border: 1px solid var(--line); }
.stat b { display: block; font-family: var(--mono); font-size: 15px; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar { height: 8px; border-radius: 8px; background: var(--down); overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--up); border-radius: 8px 0 0 8px; }
.sig { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 12.5px; }
.sig i { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.sig.good i { background: var(--up); box-shadow: 0 0 8px var(--up); }
.sig.warn i { background: var(--gold); box-shadow: 0 0 8px var(--gold); }
.sig.bad i { background: var(--down); box-shadow: 0 0 8px var(--down); }
.gauge { position: relative; width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--g) calc(var(--v) * 1%), rgba(255, 255, 255, 0.07) 0); flex: none; }
.gauge::before { content: ''; position: absolute; inset: 7px; border-radius: 50%; background: #0c0918; }
.gauge b { position: relative; font-family: var(--display); font-size: 22px; }
.empty { display: grid; place-items: center; gap: 8px; padding: 40px 16px; text-align: center; color: var(--text-3); }
.spin { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line-2); border-top-color: var(--accent); animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.disclaimer { font-size: 11px; color: var(--text-3); }
.copyable { cursor: pointer; }
.copyable:hover { color: var(--accent); }

/* ─── Trade app ───────────────────────────────────── */
.trade { display: grid; grid-template-columns: minmax(0, 1fr) 300px; height: 100%; min-height: 0; }
.trade-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; border-right: 1px solid var(--line); }
.trade-top { display: flex; align-items: center; gap: 10px; padding: 10px 12px; flex-wrap: wrap; }
.t-logo { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex: none; }
.t-sym { font-family: var(--display); font-size: 20px; letter-spacing: 0.04em; color: #fff; }
.t-price { margin-left: auto; text-align: right; font-family: var(--mono); }
.t-price b { display: block; font-size: 22px; color: #fff; border-radius: 6px; padding: 0 4px; }
.t-price span { font-size: 12px; }
.t-price .live-badge { display: block; margin-top: 2px; font-size: 10.5px; letter-spacing: 0.04em; color: var(--gold); }
.t-price .live-badge.on { color: var(--up); }
.flash-up { animation: flashUp 0.8s ease; }
.flash-down { animation: flashDown 0.8s ease; }
@keyframes flashUp { 0% { background: rgba(57, 255, 156, 0.35); } }
@keyframes flashDown { 0% { background: rgba(255, 61, 113, 0.35); } }
.trade-chart { position: relative; flex: 1; min-height: 260px; background: #0b0b12; }
.trade-chart iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.trade-side { overflow-y: auto; padding: 10px; display: flex; flex-direction: column; gap: 10px; background: rgba(0, 0, 0, 0.2); }
.tcard { border: 1px solid var(--line); border-radius: 12px; padding: 12px; background: rgba(255, 255, 255, 0.025); }
.tcard:empty { display: none; }
.order { border-color: rgba(57, 255, 156, 0.35); box-shadow: 0 0 30px -18px #39ff9c; display: flex; flex-direction: column; gap: 10px; }
.order.selling { border-color: rgba(255, 61, 113, 0.4); box-shadow: 0 0 30px -18px #ff3d71; }
.side-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.side-tabs button { height: 36px; border-radius: 9px; font-family: var(--mono); font-weight: 800; letter-spacing: 0.12em; color: var(--text-2); border: 1px solid var(--line-2); }
.side-tabs button[data-side="buy"].on { background: #39ff9c; border-color: #39ff9c; color: #04120a; }
.side-tabs button[data-side="sell"].on { background: #ff3d71; border-color: #ff3d71; color: #1a0208; }
.amount { display: flex; align-items: center; gap: 8px; height: 46px; padding: 0 12px; border-radius: 10px; background: rgba(0, 0, 0, 0.4); border: 1px solid var(--line-2); font-family: var(--mono); color: var(--text-3); }
.amount:focus-within { border-color: var(--accent); }
.amount input { flex: 1; min-width: 0; background: none; border: 0; outline: 0; font-family: var(--mono); font-size: 18px; color: #fff; }
.quick { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.quick button { height: 28px; border-radius: 8px; font-family: var(--mono); font-size: 11.5px; border: 1px solid var(--line-2); color: var(--text-2); }
.quick button:hover { color: #fff; border-color: var(--accent); }
.exec { height: 46px; border-radius: 11px; font-family: var(--mono); font-weight: 800; font-size: 15px; letter-spacing: 0.1em; background: #39ff9c; color: #04120a; box-shadow: 0 0 24px -8px #39ff9c; transition: filter 0.15s; }
.selling .exec { background: #ff3d71; color: #1a0208; box-shadow: 0 0 24px -8px #ff3d71; }
.exec:hover { filter: brightness(1.1); }
.exec:disabled { opacity: 0.4; cursor: not-allowed; }
.pnl-big { font-family: var(--mono); font-size: 22px; font-weight: 800; margin: 6px 0 8px; color: #fff; }
.pnl-big small { font-size: 13px; font-weight: 600; }
.kv { display: flex; justify-content: space-between; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.kv span { color: var(--text-2); }
.kv b { font-family: var(--mono); font-weight: 600; text-align: right; }
.pos-row { display: flex; justify-content: space-between; align-items: center; width: 100%; margin-top: 6px; padding: 7px 9px; border-radius: 9px; border: 1px solid var(--line); font-family: var(--mono); font-size: 12px; text-align: left; }
.pos-row:hover, .pos-row.on { border-color: var(--accent); background: rgba(255, 255, 255, 0.04); }
@media (max-width: 760px) {
  .trade { grid-template-columns: 1fr; grid-template-rows: minmax(300px, 55%) auto; overflow-y: auto; }
  .trade-main { border-right: 0; border-bottom: 1px solid var(--line); }
  .trade-side { overflow: visible; }
}

@media (max-width: 760px) {
  .hide-sm { display: none !important; }
  .hud-top { padding: 10px 12px; }
  .brand-logo { font-size: 24px; }
  .brand-sub { display: none; }
  .ca-chip { max-width: 150px; }
  .dock { bottom: 10px; gap: 2px; padding: 5px; border-radius: 16px; }
  .dock > button span:not(.x-glyph) { display: none; }
  .dock > button { padding: 0 11px; height: 42px; }
  .crew-btn { padding: 0 6px; height: 42px; }
  .crew-btn .nm { display: none; }
  .dock-sep { margin: 0 2px; }
  .ticker { bottom: 70px; }
  #os { padding: 58px 0 0; }
  .os-top { top: 10px; left: 10px; right: 10px; }
  .os-who { display: none; }
  .os-monitor { height: 100%; border-radius: 16px 16px 0 0; padding: 6px; }
  .os-icons { grid-auto-flow: row; grid-template-columns: repeat(4, 1fr); grid-template-rows: none; right: 12px; left: 12px; }
  .os-icon { width: auto; }
  .win { left: 0 !important; top: 0 !important; width: 100% !important; height: 100% !important; border-radius: 0; resize: none; }
  .os-tray .clk { display: none; }
  .enter-hint { bottom: 12vh; font-size: 12px; padding: 12px 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; }
}
