/* Visual style adapted from the LaicaPro // MDL Dispatch prototype (teammate) */
:root {
  --bg: #050914;
  --panel: #0b1222;
  --panel-2: #0f1a2e;
  --line: #1e293b;
  --line-2: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --dim: #64748b;
  --accent: #22d3ee;
  --accent-2: #06b6d4;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f43f5e;
  --indigo: #818cf8;
  --stat-tech: #fbbf24;
  --stat-analysis: #34d399;
  --stat-speed: #22d3ee;
  --stat-calm: #818cf8;
  --radius: 14px;
  --font-display: 'Space Grotesk', system-ui, sans-serif;
  --font-sans: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font-sans); font-size: 15px; color-scheme: dark; }
body {
  min-height: 100vh;
  background-image:
    linear-gradient(to right, rgba(34, 211, 238, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(34, 211, 238, 0.045) 1px, transparent 1px);
  background-size: 32px 32px;
}
h1, h2, h3, h4 { margin: 0 0 .5rem; font-family: var(--font-display); letter-spacing: -.01em; }
p { margin: 0 0 .5rem; line-height: 1.45; }
small { color: var(--muted); }
code { font-family: var(--font-mono); background: var(--panel-2); padding: 1px 5px; border-radius: 4px; }
.hidden { display: none !important; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.screen { max-width: 1320px; margin: 0 auto; padding: 18px; }

/* ---------- App header (brand + steps) ---------- */
.app-header { position: sticky; top: 0; z-index: 40; display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 12px 22px; background: rgba(5, 9, 20, .9); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 12px; margin-right: auto; }
.brand-icon { width: 44px; height: 44px; border-radius: 12px; overflow: hidden; border: 1px solid rgba(34, 211, 238, .5); line-height: 0; }
.brand-icon svg { width: 100%; height: 100%; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; display: flex; gap: 8px; align-items: center; }
.brand-sub { color: var(--muted); font-size: .78rem; }
.tag-event { font-family: var(--font-mono); font-size: .65rem; color: var(--warn); border: 1px solid rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .08); padding: 2px 6px; border-radius: 6px; letter-spacing: .05em; }
.steps { display: flex; gap: 6px; flex-wrap: wrap; }
.step { font-size: .82rem; padding: 7px 12px; border-radius: 10px; border: 1px solid var(--line); color: var(--dim); background: var(--panel); }
.step.active { color: #a5f3fc; border-color: rgba(34, 211, 238, .55); background: rgba(6, 182, 212, .1); }
.step.done { color: var(--muted); }

/* ---------- Generic ---------- */
.btn { background: var(--accent); color: #04121a; border: 0; border-radius: 10px; padding: 10px 16px; font-size: .95rem; font-weight: 700; cursor: pointer; font-family: var(--font-sans); }
.btn:hover { filter: brightness(1.1); }
.btn:disabled { background: #1e293b; color: #64748b; cursor: not-allowed; filter: none; }
.btn.ghost { background: var(--panel); border: 1px solid var(--line-2); color: var(--text); }
.btn.big { padding: 14px 24px; font-size: 1.05rem; }
.btn.small { padding: 6px 10px; font-size: .82rem; }
.btn.go { background: #10b981; color: #022c22; width: 100%; letter-spacing: .04em; }
.btn.go:disabled { background: #1e293b; color: #64748b; }

.card { background: rgba(11, 18, 34, .88); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; }
.chip { display: inline-block; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 2px 7px; font-size: .74rem; color: var(--muted); margin: 2px 2px 0 0; white-space: nowrap; font-family: var(--font-mono); }
.chip.good { color: #6ee7b7; border-color: rgba(52, 211, 153, .4); background: rgba(16, 185, 129, .08); }
.chip.bad { color: #fda4af; border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .08); }
.chip.warn { color: #fcd34d; border-color: rgba(251, 191, 36, .45); background: rgba(251, 191, 36, .08); }
.chip.price { color: #6ee7b7; font-weight: 700; }
.info { color: var(--muted); font-size: .9rem; }
.kicker { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.lvl-tag { display: inline-block; font-family: var(--font-mono); font-size: .72rem; letter-spacing: .08em; padding: 3px 8px; border-radius: 6px; border: 1px solid; background: rgba(5, 9, 20, .75); }
.lvl-tag.easy { color: #6ee7b7; border-color: rgba(52, 211, 153, .6); }
.lvl-tag.medium { color: #fcd34d; border-color: rgba(251, 191, 36, .6); }
.lvl-tag.hard { color: #fda4af; border-color: rgba(244, 63, 94, .6); }

.bar { height: 8px; background: #0a1020; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.bar > div { height: 100%; background: var(--accent); width: 0; transition: width .2s; border-radius: 999px; }
.bar.good > div { background: var(--good); }
.bar.warn > div { background: var(--warn); }
.bar.bad > div { background: var(--bad); }

/* ---------- Menu ---------- */
.menu-hero { padding: 28px; margin-bottom: 20px; border: 1px solid rgba(34, 211, 238, .25); border-radius: 18px; background: linear-gradient(120deg, rgba(8, 47, 73, .35), rgba(5, 9, 20, .6)); }
.menu-hero h1 { font-size: 2.3rem; line-height: 1.1; margin: 10px 0; }
.menu-hero p { color: var(--muted); max-width: 760px; }
.menu-hero b { color: var(--accent); }
.loop { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.loop span { background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; padding: 6px 10px; font-size: .82rem; font-family: var(--font-mono); color: #a5f3fc; }
.levels { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; }
.level-card { cursor: pointer; padding: 0; overflow: hidden; display: flex; flex-direction: column; transition: transform .12s, border-color .12s; }
.level-card:hover { transform: translateY(-3px); border-color: rgba(34, 211, 238, .55); }
.level-img { position: relative; height: 210px; background-size: cover; background-position: center; }
.level-img::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(5, 9, 20, .1) 30%, rgba(5, 9, 20, .95)); }
.level-img .lvl-tag { position: absolute; top: 12px; left: 12px; z-index: 1; }
.level-img .level-title { position: absolute; left: 14px; bottom: 10px; z-index: 1; }
.level-title h3 { font-size: 1.45rem; margin: 0; }
.level-title small { color: var(--accent); }
.level-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.level-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fact { border: 1px solid var(--line); background: rgba(5, 9, 20, .6); border-radius: 10px; padding: 8px 10px; }
.fact .k { font-size: .74rem; color: var(--muted); }
.fact .v { font-family: var(--font-mono); font-weight: 700; }

/* ---------- Design ---------- */
.topbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; padding: 12px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(11, 18, 34, .88); }
.topbar h2 { margin: 0; flex: 1; font-size: 1.25rem; }
.design-layout { display: grid; grid-template-columns: 1fr 360px; gap: 18px; align-items: start; }
.design-side { position: sticky; top: 76px; display: flex; flex-direction: column; gap: 12px; }
.section-title { margin: 22px 0 4px; display: flex; align-items: center; gap: 8px; }
.section-title .req, .req { font-size: .68rem; color: var(--warn); font-weight: 600; font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .06em; border: 1px solid rgba(251, 191, 36, .4); padding: 1px 6px; border-radius: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; margin-top: 8px; }
.opt-card { background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; cursor: pointer; text-align: left; color: var(--text); font: inherit; display: flex; flex-direction: column; gap: 5px; transition: border-color .12s, background .12s; }
.opt-card:hover { border-color: rgba(34, 211, 238, .5); }
.opt-card.selected { border-color: rgba(251, 191, 36, .8); background: rgba(120, 53, 15, .18); box-shadow: inset 0 0 0 1px rgba(251, 191, 36, .25); }
.opt-card.disabled { opacity: .4; cursor: not-allowed; }
.opt-card .name { font-weight: 700; font-family: var(--font-display); }
.opt-card .desc { font-size: .84rem; color: var(--muted); }
.stat-row { margin-bottom: 10px; }
.stat-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: .84rem; margin-bottom: 4px; }
.stat-row .top b { font-family: var(--font-mono); font-size: .8rem; text-align: right; }
.msgs { display: flex; flex-direction: column; gap: 6px; font-size: .84rem; }
.msg { padding: 8px 10px; border-radius: 10px; line-height: 1.35; }
.msg.err { background: rgba(244, 63, 94, .08); border: 1px solid rgba(244, 63, 94, .45); }
.msg.warn { background: rgba(251, 191, 36, .07); border: 1px solid rgba(251, 191, 36, .4); }
.msg.ok { background: rgba(16, 185, 129, .08); border: 1px solid rgba(52, 211, 153, .45); color: #a7f3d0; }
.info.mini { margin: -6px 0 10px; font-size: .78rem; font-family: var(--font-mono); }

.ship-viewer { position: relative; padding-bottom: 8px; }
.viewer-head { display: flex; justify-content: space-between; align-items: baseline; }
.viewer-head small { font-family: var(--font-mono); }
.ship-viewer canvas { width: 100%; height: 230px; display: block; border-radius: 10px; border: 1px solid var(--line); background: radial-gradient(circle at 50% 50%, #0d1a3a, #04070f); }
.viewer-banner { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%) translateY(6px); opacity: 0; background: rgba(8, 47, 73, .95); border: 1px solid var(--accent); color: #fff; padding: 4px 12px; border-radius: 999px; font-size: .84rem; font-weight: 700; transition: opacity .2s, transform .2s; pointer-events: none; white-space: nowrap; }
.viewer-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.viewer-banner.remove { background: rgba(76, 5, 25, .95); border-color: var(--bad); }

/* ---------- Crew: seats, radar, candidates ---------- */
.crew-console { display: grid; grid-template-columns: 1fr 170px; gap: 14px; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius); background: rgba(5, 9, 20, .7); margin: 10px 0 6px; }
.slots { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; align-content: start; }
.slot { display: flex; align-items: center; gap: 10px; text-align: left; font: inherit; color: var(--text); border-radius: 10px; padding: 8px; cursor: pointer; min-height: 66px; }
.slot.empty { background: rgba(15, 23, 42, .4); border: 1px dashed #475569; justify-content: center; text-align: center; }
.slot.empty:hover { border-color: var(--accent); }
.slot.filled { background: rgba(8, 51, 68, .3); border: 1px solid rgba(34, 211, 238, .45); }
.slot.filled:hover { border-color: rgba(244, 63, 94, .6); background: rgba(76, 5, 25, .2); }
.slot-text { display: flex; flex-direction: column; min-width: 0; }
.slot-label { font-size: .66rem; text-transform: uppercase; letter-spacing: .07em; color: var(--warn); font-weight: 700; font-family: var(--font-mono); }
.slot-who { font-weight: 700; font-size: .9rem; }
.slot small { font-family: var(--font-mono); font-size: .7rem; }
.avatar { display: inline-block; width: 46px; height: 46px; border-radius: 10px; overflow: hidden; border: 1px solid var(--line-2); flex-shrink: 0; background: var(--panel-2); line-height: 0; }
.avatar svg { width: 100%; height: 100%; display: block; }
.avatar.lg { width: 58px; height: 58px; }
.avatar.sm { width: 36px; height: 36px; border-radius: 8px; }
.radar-box { display: flex; flex-direction: column; align-items: center; justify-content: center; border: 1px solid var(--line); background: rgba(15, 23, 42, .5); border-radius: 10px; padding: 4px; }
.radar-box small { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .06em; }
.crew-group { margin-top: 16px; scroll-margin-top: 80px; }
.crew-group-head h4 { margin: 0 0 2px; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.crew-card { gap: 8px; }
.crew-top { display: flex; align-items: center; gap: 10px; }
.crew-top .who { flex: 1; min-width: 0; }
.crew-top .who .name { display: block; }
.crew-top .who small { color: var(--accent); font-size: .76rem; }
.crew-mid { display: grid; grid-template-columns: 1fr 74px; gap: 8px; align-items: center; }
.sgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 10px; }
.sg { font-family: var(--font-mono); font-size: .68rem; color: var(--muted); }
.sg .row { display: flex; justify-content: space-between; margin-bottom: 2px; }
.sg .row b { color: var(--text); }
.sg.top .row span { color: var(--text); font-weight: 700; }
.sg-track { height: 5px; border-radius: 999px; background: #1e293b; overflow: hidden; }
.sg-fill { height: 100%; border-radius: 999px; }
.sg-fill.tech { background: var(--stat-tech); } .sg-fill.analysis { background: var(--stat-analysis); }
.sg-fill.speed { background: var(--stat-speed); } .sg-fill.calm { background: var(--stat-calm); }
.in-seat { color: #6ee7b7; font-size: .78rem; font-family: var(--font-mono); }

/* ---------- Launch ---------- */
.launch { text-align: center; padding-top: 60px; min-height: 82vh; position: relative; overflow: hidden; border-radius: 18px; background-size: cover; background-position: center; }
.launch::before { content: ''; position: absolute; inset: 0; background: rgba(5, 9, 20, .6); }
.launch > * { position: relative; }
.launch .rocket { font-size: 5rem; display: inline-block; animation: liftoff 3s ease-in forwards; animation-delay: 1s; }
.launch .count { font-size: 2.6rem; font-weight: 800; margin: 16px 0; min-height: 3rem; font-family: var(--font-mono); color: var(--accent); }
@keyframes liftoff { 0% { transform: translateY(0); } 15% { transform: translateY(4px) rotate(-1deg); } 100% { transform: translateY(-120vh); } }

/* ---------- Mission ---------- */
.dashboard { display: grid; grid-template-columns: 140px 1.3fr repeat(5, 1fr) auto; gap: 10px; align-items: stretch; margin-bottom: 10px; }
.dash { background: rgba(11, 18, 34, .9); border: 1px solid var(--line); border-radius: 12px; padding: 8px 10px; }
.dash .label { font-size: .68rem; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); }
.dash .value { font-size: 1.1rem; font-weight: 700; margin: 3px 0 5px; font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.dash.time .value { font-size: 1.6rem; color: var(--accent); }
.dash.integrity { border-color: rgba(34, 211, 238, .4); }
.dash.integrity .bar { height: 14px; }
.dash.integrity.danger { border-color: var(--bad); animation: pulse 1s infinite; }
.dash.points .value { color: var(--warn); font-size: 1.45rem; }
.dash.off { border-color: rgba(244, 63, 94, .6); background: rgba(76, 5, 25, .25); }
@keyframes pulse { 50% { box-shadow: 0 0 0 3px rgba(244, 63, 94, .35); } }
.dash-actions { display: flex; flex-direction: column; gap: 6px; justify-content: center; }

.status-strip { display: flex; flex-wrap: wrap; gap: 8px; min-height: 0; margin-bottom: 10px; }
.status-chip { font-family: var(--font-mono); font-size: .8rem; padding: 6px 10px; border-radius: 10px; border: 1px solid; animation: pulse-chip 1s infinite; }
.status-chip.blackout { color: #fecdd3; border-color: var(--bad); background: rgba(76, 5, 25, .5); }
.status-chip.comms { color: #fde68a; border-color: var(--warn); background: rgba(120, 53, 15, .35); }
.status-chip.sensors { color: #c7d2fe; border-color: var(--indigo); background: rgba(49, 46, 129, .35); }
.status-chip.crewout { color: #fbcfe8; border-color: #f472b6; background: rgba(131, 24, 67, .3); }
@keyframes pulse-chip { 50% { opacity: .75; } }

.mission-body { display: grid; grid-template-columns: 1fr 370px; gap: 12px; }
.map-wrap { position: relative; background: #040811; border: 1px solid var(--line); border-radius: var(--radius); min-height: 470px; overflow: hidden; }
.map-wrap canvas { width: 100%; height: 100%; display: block; position: absolute; inset: 0; cursor: pointer; }
.map-title { position: absolute; left: 14px; top: 10px; pointer-events: none; }
.map-title h3 { font-size: 1rem; margin: 2px 0 0; }
.map-hint { position: absolute; left: 12px; bottom: 8px; font-size: .78rem; color: var(--muted); pointer-events: none; }
.paused-banner { position: absolute; top: 12px; left: 50%; transform: translateX(-50%); background: rgba(120, 53, 15, .6); border: 1px solid var(--warn); padding: 4px 12px; border-radius: 999px; font-size: .84rem; font-family: var(--font-mono); }
.blackout-overlay { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; background: rgba(2, 4, 10, .78); color: #fecdd3; font-family: var(--font-mono); text-align: center; pointer-events: none; }
.blackout-overlay b { font-size: 1.6rem; letter-spacing: .08em; color: var(--bad); }
.side { display: flex; flex-direction: column; gap: 10px; max-height: 640px; }
.side .card { overflow: auto; }
.side h3 { font-size: 1rem; }
.events-list { display: flex; flex-direction: column; gap: 8px; min-height: 60px; }
.ev-item { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; color: var(--text); font: inherit; width: 100%; }
.ev-item:hover { border-color: var(--accent); }
.ev-item.working { cursor: default; border-color: rgba(34, 211, 238, .4); }
.ev-item.positive { border-left: 4px solid var(--good); }
.ev-item.negative { border-left: 4px solid var(--bad); }
.ev-item .row { display: flex; justify-content: space-between; gap: 6px; align-items: center; margin-bottom: 4px; }
.ev-item .row small { font-family: var(--font-mono); color: var(--warn); }
.ev-item .bar { height: 5px; }
.log { display: flex; flex-direction: column; gap: 6px; font-size: .8rem; }
.log .entry { border: 1px solid var(--line); border-left: 3px solid var(--line-2); border-radius: 8px; padding: 6px 8px; background: rgba(5, 9, 20, .5); }
.log .entry.success { border-left-color: var(--good); }
.log .entry.fail { border-left-color: var(--bad); }
.log .entry.ignored { border-left-color: var(--warn); }
.log .entry.main { background: rgba(251, 191, 36, .05); }
.log .entry b { font-family: var(--font-sans); }

.crew-bar { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 10px; margin-top: 12px; }
.crew-tile { background: rgba(11, 18, 34, .9); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.crew-tile.busy { border-color: rgba(34, 211, 238, .45); }
.crew-tile.out { border-color: rgba(244, 114, 182, .6); background: rgba(131, 24, 67, .15); }
.crew-tile .who { display: flex; gap: 10px; align-items: center; }
.crew-tile .who .names { flex: 1; min-width: 0; }
.crew-tile .who b { display: block; font-family: var(--font-display); }
.crew-tile .who small { font-size: .74rem; }
.badge { font-family: var(--font-mono); font-size: .64rem; font-weight: 700; padding: 2px 6px; border-radius: 6px; border: 1px solid; white-space: nowrap; }
.badge.free { color: #6ee7b7; border-color: rgba(52, 211, 153, .5); background: rgba(16, 185, 129, .1); }
.badge.busy { color: #a5f3fc; border-color: rgba(34, 211, 238, .5); background: rgba(6, 182, 212, .1); }
.badge.tired { color: #fcd34d; border-color: rgba(251, 191, 36, .5); background: rgba(251, 191, 36, .1); }
.badge.out { color: #fbcfe8; border-color: rgba(244, 114, 182, .6); background: rgba(131, 24, 67, .3); }
.stat4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; margin: 8px 0 6px; text-align: center; font-family: var(--font-mono); }
.stat4 div { background: rgba(5, 9, 20, .6); border: 1px solid var(--line); border-radius: 6px; padding: 3px 0; font-size: .62rem; color: var(--muted); }
.stat4 b { display: block; font-size: .9rem; }
.stat4 .tech b { color: var(--stat-tech); } .stat4 .analysis b { color: var(--stat-analysis); }
.stat4 .speed b { color: var(--stat-speed); } .stat4 .calm b { color: var(--stat-calm); }
.crew-tile .status { font-size: .76rem; color: var(--muted); margin-top: 4px; min-height: 1.1em; }
.crew-tile .fat { display: flex; justify-content: space-between; font-family: var(--font-mono); font-size: .7rem; color: var(--muted); }
.crew-tile .bar { height: 5px; margin-top: 3px; }

/* Objectives (scripted main events) */
.objectives-card { border-color: rgba(251, 191, 36, .45); }
.objectives { display: flex; flex-direction: column; gap: 6px; }
.objective { display: flex; gap: 8px; align-items: center; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; text-align: left; font: inherit; color: var(--text); width: 100%; }
.objective .obj-icon { font-size: 1.25rem; }
.objective .obj-body { flex: 1; display: flex; flex-direction: column; }
.objective .obj-body small { font-family: var(--font-mono); font-size: .7rem; }
.objective.upcoming { opacity: .55; }
.objective.active { border: 1px solid var(--warn); background: rgba(120, 53, 15, .3); cursor: pointer; animation: pulse-gold 1s infinite; }
.objective.working { border-color: rgba(34, 211, 238, .5); }
.objective.success { border-color: rgba(52, 211, 153, .5); }
.objective.fail, .objective.ignored, .objective.missed { border-color: rgba(244, 63, 94, .5); }
.obj-timer { color: var(--warn); font-weight: 700; font-family: var(--font-mono); }
@keyframes pulse-gold { 50% { box-shadow: 0 0 0 3px rgba(251, 191, 36, .3); } }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; background: rgba(3, 7, 18, .82); backdrop-filter: blur(5px); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 12px; }
.modal-box { background: #0b1222; border: 1px solid var(--line-2); border-radius: 16px; max-width: 780px; width: 100%; max-height: 92vh; overflow: auto; padding: 18px; }
.modal-box.main { border: 1px solid var(--warn); }
.modal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.modal-head h3 { flex: 1; margin: 0; font-size: 1.3rem; }
.modal-head .icon { font-size: 2rem; }
.tag-main, .tag-kind { font-family: var(--font-mono); font-size: .66rem; letter-spacing: .08em; padding: 2px 8px; border-radius: 6px; border: 1px solid; }
.tag-main { color: var(--warn); border-color: rgba(251, 191, 36, .6); background: rgba(251, 191, 36, .1); }
.tag-kind.neg { color: #fda4af; border-color: rgba(244, 63, 94, .55); background: rgba(244, 63, 94, .08); }
.tag-kind.pos { color: #6ee7b7; border-color: rgba(52, 211, 153, .55); background: rgba(16, 185, 129, .08); }
.learn { background: rgba(8, 47, 73, .35); border: 1px solid rgba(34, 211, 238, .35); border-radius: 10px; padding: 8px 10px; font-size: .86rem; color: #bae6fd; }
.risk { background: rgba(244, 63, 94, .07); border: 1px solid rgba(244, 63, 94, .35); border-radius: 10px; padding: 8px 10px; font-size: .84rem; color: #fecdd3; }
.options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 6px 0 12px; }
.option { background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 10px; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.option.selected { border-color: var(--accent); background: rgba(8, 51, 68, .45); }
.option span { display: block; font-size: .78rem; color: var(--muted); margin-top: 4px; }
.req-chip { display: inline-block; font-family: var(--font-mono); font-size: .72rem; padding: 2px 7px; border-radius: 6px; margin-top: 6px; border: 1px solid; }
.req-chip.tech { color: var(--stat-tech); border-color: rgba(251, 191, 36, .5); }
.req-chip.analysis { color: var(--stat-analysis); border-color: rgba(52, 211, 153, .5); }
.req-chip.speed { color: var(--stat-speed); border-color: rgba(34, 211, 238, .5); }
.req-chip.calm { color: var(--stat-calm); border-color: rgba(129, 140, 248, .5); }
.picks { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.pick { display: grid; grid-template-columns: 40px 1fr 62px; gap: 2px 10px; align-items: center; background: var(--panel-2); border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 10px; text-align: left; color: var(--text); font: inherit; cursor: pointer; }
.pick:hover:not(:disabled) { border-color: var(--accent); }
.pick:disabled { opacity: .4; cursor: not-allowed; }
.pick .avatar { grid-row: span 2; }
.pick .chance { font-size: 1.35rem; font-weight: 800; text-align: right; grid-row: span 2; font-family: var(--font-mono); }
.pick .chance.hi { color: var(--good); }
.pick .chance.mid { color: var(--warn); }
.pick .chance.lo { color: var(--bad); }
.pick .breakdown { font-size: .7rem; color: var(--muted); grid-column: 2; }
.pick .spec { font-family: var(--font-mono); font-size: .62rem; color: #04121a; background: var(--accent); padding: 0 4px; border-radius: 4px; margin-left: 4px; }

/* ---------- Toasts ---------- */
#toasts { position: fixed; right: 12px; bottom: 12px; display: flex; flex-direction: column; gap: 8px; z-index: 60; max-width: 390px; width: calc(100% - 24px); }
.toast { background: rgba(11, 18, 34, .97); border: 1px solid var(--line-2); border-left: 4px solid var(--accent); border-radius: 12px; padding: 10px 12px; font-size: .84rem; box-shadow: 0 10px 30px rgba(0, 0, 0, .5); animation: slidein .2s ease-out; }
.toast.success { border-left-color: var(--good); }
.toast.fail { border-left-color: var(--bad); }
.toast.ignored { border-left-color: var(--warn); }
.toast.main { border-left-color: var(--warn); }
.toast.status { border-left-color: #f472b6; }
.toast b { display: block; margin-bottom: 2px; }
.toast .fx { color: #a5f3fc; margin-top: 3px; font-family: var(--font-mono); font-size: .76rem; }
.toast .why { color: var(--muted); font-size: .74rem; margin-top: 3px; }
.toast .hint { color: #fde68a; font-size: .78rem; margin-top: 3px; }
@keyframes slidein { from { transform: translateX(30px); opacity: 0; } }

/* ---------- Report ---------- */
.report-head { position: relative; display: flex; gap: 24px; align-items: center; margin-bottom: 16px; flex-wrap: wrap; padding: 22px; border-radius: 18px; overflow: hidden; border: 1px solid var(--line); background-size: cover; background-position: center; }
.report-head::before { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 9, 20, .95) 30%, rgba(5, 9, 20, .55)); }
.report-head > * { position: relative; }
.grade { width: 130px; height: 130px; border-radius: 20px; display: flex; align-items: center; justify-content: center; font-size: 5rem; font-weight: 900; color: #050914; font-family: var(--font-display); }
.grade.A { background: #34d399; } .grade.B { background: #a3e635; } .grade.C { background: #fbbf24; } .grade.D { background: #fb923c; } .grade.F { background: #f43f5e; }
.report-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.report-grid ul { margin: 0; padding-left: 18px; line-height: 1.5; }
.score-row { margin-bottom: 10px; }
.score-row .top { display: flex; justify-content: space-between; font-size: .88rem; }
.score-row .top b { font-family: var(--font-mono); }
.actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pts { font-size: .72rem; font-weight: 700; padding: 0 6px; border-radius: 6px; font-family: var(--font-mono); }
.pts.up { color: #6ee7b7; background: rgba(16, 185, 129, .12); } .pts.down { color: #fda4af; background: rgba(244, 63, 94, .12); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .design-layout { grid-template-columns: 1fr; }
  .design-side { position: static; order: -1; }
  .dashboard { grid-template-columns: repeat(4, 1fr); }
  .dash.integrity { grid-column: span 2; }
  .mission-body { grid-template-columns: 1fr; }
  .side { max-height: none; }
  .report-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .dashboard { grid-template-columns: repeat(2, 1fr); }
  .options, .picks { grid-template-columns: 1fr; }
  .map-wrap { min-height: 340px; }
  .crew-console { grid-template-columns: 1fr; }
  .steps { display: none; }
}

/* ---------- Dispatch-style event window (full screen) ---------- */
.avatar.xl { width: 72px; height: 72px; border-radius: 12px; }
.avatar.lg { width: 56px; height: 56px; }
.modal.dsp-mode { padding: 10px; align-items: stretch; }
.modal-box.dsp { max-width: 1560px; width: 100%; height: calc(100vh - 20px); max-height: none; padding: 12px; display: grid; grid-template-rows: auto 1fr; gap: 10px; overflow: hidden; background: #070d1b; border-color: var(--line-2); }
.modal-box.dsp.main { border-color: rgba(251, 191, 36, .7); }
.dsp-top { display: flex; align-items: center; gap: 14px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: 14px; background: linear-gradient(90deg, rgba(8, 47, 73, .45), #0b1222); }
.dsp-icon { font-size: 2.4rem; line-height: 1; }
.dsp-title { flex: 1; min-width: 0; }
.dsp-title h2 { margin: 2px 0 0; font-size: 1.5rem; }
.dsp-title small { font-family: var(--font-mono); }
.dsp-timer { text-align: center; padding: 4px 14px; border-radius: 10px; border: 1px solid rgba(251, 191, 36, .5); background: rgba(120, 53, 15, .25); }
.dsp-timer small { display: block; font-family: var(--font-mono); font-size: .62rem; color: var(--warn); letter-spacing: .1em; }
.dsp-timer b { font-family: var(--font-mono); font-size: 1.5rem; color: var(--warn); }
.dsp-body { display: grid; grid-template-columns: minmax(280px, 1fr) minmax(360px, 1.15fr) minmax(400px, 1.3fr); gap: 10px; min-height: 0; }
.dsp-panel { background: #0b1222; border: 1px solid var(--line-2); border-radius: 14px; padding: 12px 14px; min-height: 0; overflow: auto; }
.panel-head { margin: -12px -14px 10px; padding: 8px 14px; font-family: var(--font-mono); font-size: .76rem; letter-spacing: .1em; font-weight: 700; color: #cbd5e1; border-bottom: 1px solid var(--line-2);
  background: repeating-linear-gradient(to bottom, transparent 0 4px, rgba(148, 163, 184, .08) 4px 5px), #0f1a2e; border-radius: 14px 14px 0 0; position: sticky; top: -12px; z-index: 1; }
.panel-head.mid { margin: 14px -14px 10px; border-radius: 0; border-top: 1px solid var(--line-2); position: static; }
.panel-head small { color: var(--muted); }
.case-text { font-size: 1.02rem; }
.req-list { list-style: none; margin: 0 0 10px; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.req-list li { display: flex; gap: 10px; align-items: flex-start; font-size: 1.02rem; line-height: 1.35; }
.req-list li::before { content: '>'; color: var(--dim); font-family: var(--font-mono); }
.req-ico { width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%; display: grid; place-items: center; font-size: .9rem; border: 2px solid var(--c); background: #0f1a2e; }
.verb { font-weight: 800; }
.verb.speed { color: var(--stat-speed); } .verb.analysis { color: var(--stat-analysis); }
.verb.tech { color: var(--stat-tech); } .verb.calm { color: var(--stat-calm); }
.req-levels { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.req-levels .req-chip { margin: 0; font-size: .78rem; }
.req-levels .req-chip b { color: var(--text); }
.ideal { font-size: .84rem; }
details.learn { cursor: pointer; margin-top: 8px; }
details.learn summary { font-weight: 600; }

.dsp-center { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.dsp-radar { width: 100%; display: flex; justify-content: center; }
.dsp-radar svg { width: min(100%, 330px); height: auto; }
.dsp-legend { display: flex; gap: 16px; font-size: .78rem; font-family: var(--font-mono); flex-wrap: wrap; justify-content: center; }
.dsp-legend i { display: inline-block; width: 14px; height: 10px; border-radius: 3px; margin-right: 4px; vertical-align: -1px; }
.lg-req { color: var(--warn); } .lg-req i { border: 2px dashed var(--warn); background: rgba(251, 191, 36, .15); }
.lg-team { color: var(--accent); } .lg-team i { background: rgba(34, 211, 238, .5); border: 2px solid var(--accent); }
.dsp-slots { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
.dsp-slot { min-height: 74px; border-radius: 12px; display: flex; align-items: center; gap: 10px; padding: 8px 10px; font: inherit; color: var(--text); text-align: left; }
.dsp-slot span { display: flex; flex-direction: column; }
.dsp-slot small { color: var(--muted); font-size: .72rem; }
.dsp-slot.empty { border: 1px dashed #475569; color: var(--dim); }
.dsp-slot .plus { font-size: 1.6rem; width: 44px; height: 44px; border-radius: 10px; border: 1px dashed #475569; display: grid !important; place-items: center; }
.dsp-slot.filled { border: 1px solid rgba(251, 191, 36, .7); background: rgba(120, 53, 15, .25); cursor: pointer; }
.dsp-slot.filled:hover { border-color: var(--bad); }
.dsp-slot .rm { color: #fda4af !important; }
.dsp-verdict { width: 100%; border: 1px solid var(--line-2); border-radius: 12px; padding: 10px 12px; background: #0f1a2e; }
.dsp-verdict.empty { color: var(--muted); font-size: .86rem; text-align: center; }
.v-top { display: flex; justify-content: space-between; align-items: baseline; font-size: .8rem; color: var(--muted); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .05em; }
.v-top b { font-size: 1.7rem; letter-spacing: 0; }
.dsp-verdict.hi .v-top b { color: var(--good); } .dsp-verdict.mid .v-top b { color: var(--warn); } .dsp-verdict.lo .v-top b { color: var(--bad); }
.v-bar { height: 8px; border-radius: 999px; background: #1e293b; overflow: hidden; margin: 4px 0 6px; }
.v-bar span { display: block; height: 100%; border-radius: 999px; background: var(--good); }
.dsp-verdict.mid .v-bar span { background: var(--warn); } .dsp-verdict.lo .v-bar span { background: var(--bad); }
.v-lines { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .72rem; font-family: var(--font-mono); }
.v-lines .pos { color: #a7f3d0; } .v-lines .neg { color: #fda4af; }
.v-approach { font-size: .8rem; color: var(--muted); margin-top: 6px; }
.dsp-actions { display: grid; grid-template-columns: 1fr 1.7fr; gap: 8px; width: 100%; margin-top: auto; }
.dsp-actions .btn { font-family: var(--font-mono); text-transform: uppercase; letter-spacing: .04em; padding: 12px; }
kbd { font-family: var(--font-mono); font-size: .66rem; padding: 1px 5px; border-radius: 4px; background: rgba(251, 191, 36, .9); color: #1c1917; margin-right: 6px; }

.dsp-right { display: flex; flex-direction: column; gap: 8px; }
.dsp-right .info.small { margin: 0; }
.mk-need { display: inline-block; width: 3px; height: 12px; background: var(--warn); vertical-align: -2px; }
.mk-gap { display: inline-block; width: 14px; height: 8px; vertical-align: 0; background: repeating-linear-gradient(45deg, rgba(244, 63, 94, .85) 0 3px, rgba(244, 63, 94, .35) 3px 6px); border-radius: 2px; }
.crew-list { display: flex; flex-direction: column; gap: 8px; }
.crew-pick { display: grid; grid-template-columns: 76px 1fr; gap: 12px; align-items: center; padding: 10px; border-radius: 12px; border: 1px solid var(--line-2); background: #0f1a2e; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: border-color .1s, transform .1s; }
.crew-pick:hover:not(:disabled) { border-color: var(--accent); transform: translateX(-3px); }
.crew-pick.selected { border-color: var(--warn); background: rgba(120, 53, 15, .3); box-shadow: 0 0 0 2px rgba(251, 191, 36, .3); }
.crew-pick:disabled { opacity: .45; cursor: not-allowed; }
.cp-face { position: relative; }
.cp-check { position: absolute; right: -4px; bottom: -4px; width: 22px; height: 22px; border-radius: 50%; background: var(--warn); color: #1c1917; display: grid; place-items: center; font-weight: 900; font-size: .8rem; }
.cp-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cp-head { display: flex; justify-content: space-between; align-items: center; gap: 6px; }
.cp-head b { font-family: var(--font-display); font-size: 1.05rem; }
.cp-info small { font-size: .72rem; color: var(--muted); }
.cp-info .spec { font-family: var(--font-mono); font-size: .6rem; color: #1c1917; background: var(--warn); padding: 0 4px; border-radius: 4px; }
.cs-row { display: grid; grid-template-columns: 54px 1fr 40px; gap: 8px; align-items: center; font-family: var(--font-mono); font-size: .7rem; }
.cs-k { color: var(--muted); white-space: nowrap; }
.cs-track { position: relative; height: 9px; border-radius: 999px; background: #1e293b; }
.cs-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 999px; }
.cs-fill.speed { background: var(--stat-speed); } .cs-fill.analysis { background: var(--stat-analysis); }
.cs-fill.tech { background: var(--stat-tech); } .cs-fill.calm { background: var(--stat-calm); }
.cs-gap { position: absolute; top: 0; bottom: 0; background: repeating-linear-gradient(45deg, rgba(244, 63, 94, .85) 0 3px, rgba(244, 63, 94, .35) 3px 6px); border-radius: 0 999px 999px 0; }
.cs-need { position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px; background: var(--warn); border-radius: 2px; box-shadow: 0 0 4px rgba(251, 191, 36, .8); }
.cs-v { text-align: right; font-weight: 700; }
.cs-v small { color: var(--dim); font-weight: 400; }
.cs-row.miss .cs-v { color: #fda4af; }
.cs-row.ok .cs-v { color: var(--text); }
@media (max-width: 1100px) {
  .modal-box.dsp { height: auto; max-height: none; overflow: visible; }
  .modal.dsp-mode { overflow: auto; align-items: flex-start; }
  .dsp-body { grid-template-columns: 1fr; }
  .dsp-panel { overflow: visible; }
}
.hero-laika { display: flex; gap: 18px; align-items: center; }
.hero-laika .avatar { width: 110px; height: 110px; border-radius: 18px; }
.dsp-radar svg { width: min(100%, 330px, 38vh); }
.dsp-actions { position: sticky; bottom: -12px; background: #0b1222; padding: 8px 0 2px; }
.modal.dsp-mode ~ #toasts { left: 12px; right: auto; }
@media (max-height: 820px) {
  .v-lines { display: none; }
  .dsp-slot { min-height: 58px; padding: 6px 8px; }
  .dsp-slot .avatar.lg { width: 44px; height: 44px; }
  .crew-pick { grid-template-columns: 60px 1fr; padding: 8px; }
  .crew-pick .avatar.xl { width: 58px; height: 58px; }
  .dsp-title h2 { font-size: 1.25rem; }
  .dsp-icon { font-size: 1.9rem; }
}
.lg-num { color: var(--dim); }

/* =====================================================================
   v4 — Kid-friendly UI: full-screen hangar, crew step, HUD, fewer numbers
   ===================================================================== */
.screen.full { max-width: none; padding: 0; }
.ico { display: inline-block; vertical-align: -0.2em; flex-shrink: 0; }
.ico.flip { transform: scaleX(-1); }
.glass { background: rgba(7, 13, 27, .78); border: 1px solid rgba(148, 163, 184, .22); border-radius: 18px; backdrop-filter: blur(8px); }
.q { width: 20px; height: 20px; border-radius: 50%; border: 1px solid var(--line-2); background: #0f1a2e; color: var(--muted); font: 700 .72rem var(--font-sans); cursor: pointer; margin-left: 6px; padding: 0; line-height: 18px; }
.q:hover, .q.on { background: var(--accent); color: #04121a; border-color: var(--accent); }
.hs-help { margin: 6px 0 2px; font-size: .84rem; color: #cbd5e1; background: rgba(8, 47, 73, .5); border: 1px solid rgba(34, 211, 238, .3); border-radius: 10px; padding: 8px 10px; line-height: 1.4; display: flex; flex-direction: column; gap: 4px; }
.coins { display: inline-flex; gap: 3px; }
.coins i { width: 11px; height: 11px; border-radius: 50%; border: 2px solid #78716c; }
.coins i.on { background: #fbbf24; border-color: #fbbf24; box-shadow: 0 0 6px rgba(251, 191, 36, .5); }
.h-step { font-family: var(--font-mono); font-weight: 800; font-size: .85rem; color: #04121a; background: var(--accent); border-radius: 8px; padding: 4px 8px; }
.alert-pill { display: flex; align-items: center; gap: 10px; padding: 10px 16px; border-radius: 14px; border: 1px solid rgba(244, 63, 94, .6); background: rgba(76, 5, 25, .85); color: #fecdd3; font: 600 .95rem var(--font-sans); cursor: pointer; text-align: left; }
.alert-pill.ok { border-color: rgba(52, 211, 153, .6); background: rgba(6, 78, 59, .85); color: #d1fae5; cursor: default; }

/* Hangar */
.hangar { position: relative; height: calc(100vh - 70px); min-height: 560px; overflow: hidden; background: radial-gradient(ellipse at 40% 45%, #0f1f45 0%, #050914 70%); }
.hangar canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.h-title { position: absolute; top: 16px; left: 16px; display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.h-title b { display: block; font-family: var(--font-display); font-size: 1.25rem; }
.h-title small { color: var(--muted); }
.h-back { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); display: none; }
.h-stats { position: absolute; top: 16px; right: 16px; width: min(330px, 30vw); padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: calc(100% - 260px); overflow: auto; }
.hs-row { display: flex; gap: 10px; align-items: flex-start; }
.hs-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: #0f1a2e; color: var(--accent); flex-shrink: 0; }
.hs-ico.good { color: var(--good); } .hs-ico.warn { color: var(--warn); } .hs-ico.bad { color: var(--bad); } .hs-ico.off { color: var(--dim); }
.hs-main { flex: 1; min-width: 0; }
.hs-label { font: 600 .9rem var(--font-sans); display: flex; align-items: center; margin-bottom: 5px; }
.hs-bar { position: relative; height: 12px; border-radius: 999px; background: #1e293b; overflow: visible; }
.hs-bar > span { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .35s ease; }
.hs-bar.good > span { background: var(--good); } .hs-bar.warn > span { background: var(--warn); } .hs-bar.bad > span { background: var(--bad); }
.hs-bar.off > span { background: transparent; }
.hs-bar.off { background: repeating-linear-gradient(45deg, #1e293b 0 6px, #0f172a 6px 12px); }
.hs-bar > i { position: absolute; top: -4px; bottom: -4px; width: 3px; margin-left: -1.5px; background: #fff; border-radius: 2px; box-shadow: 0 0 6px rgba(255, 255, 255, .7); }
.h-alert { position: absolute; left: 50%; transform: translateX(-50%); bottom: 236px; max-width: min(620px, 90vw); z-index: 2; }
.h-tray { position: absolute; left: 16px; right: 16px; bottom: 16px; height: 206px; padding: 10px 12px; display: grid; grid-template-rows: auto auto 1fr; gap: 6px; }
.h-tabs { display: flex; gap: 6px; overflow-x: auto; }
.h-tab { display: flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--line-2); background: #0f1a2e; color: var(--muted); font: 600 .9rem var(--font-sans); cursor: pointer; white-space: nowrap; }
.h-tab:hover { color: var(--text); border-color: var(--accent); }
.h-tab.active { color: #04121a; background: var(--warn); border-color: var(--warn); }
.h-tab.warn:not(.active) { border-color: var(--bad); color: #fda4af; }
.h-cat-help { color: var(--muted); font-size: .86rem; display: flex; align-items: center; gap: 6px; }
.h-options { display: flex; gap: 10px; overflow-x: auto; align-items: stretch; padding-bottom: 2px; }
.h-opt { flex: 0 0 230px; display: flex; flex-direction: column; gap: 6px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line-2); background: #0b1222; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .1s, border-color .1s; }
.h-opt:hover { transform: translateY(-3px); border-color: var(--accent); }
.h-opt.selected { border-color: var(--warn); background: rgba(120, 53, 15, .3); }
.h-opt-name { font: 700 .98rem var(--font-display); display: flex; gap: 6px; align-items: center; color: #fff; }
.h-opt-name .ico { color: var(--warn); }
.h-opt-desc { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.h-opt-tags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; }
.tag { display: inline-flex; align-items: center; gap: 4px; font-size: .72rem; padding: 2px 7px; border-radius: 999px; border: 1px solid; }
.tag.up { color: #6ee7b7; border-color: rgba(52, 211, 153, .45); }
.tag.down { color: #fda4af; border-color: rgba(244, 63, 94, .45); }
.tag.mid { color: #cbd5e1; border-color: var(--line-2); }
.mini-bar { height: 8px; border-radius: 999px; background: #1e293b; overflow: hidden; }
.mini-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.h-next { position: absolute; right: 16px; bottom: 236px; padding: 14px 22px; font-size: 1.05rem; display: flex; gap: 8px; align-items: center; }

/* Crew step */
.crewstep { display: flex; flex-direction: column; gap: 14px; }
.cs-top { display: flex; align-items: center; gap: 16px; }
.cs-title { display: flex; align-items: center; gap: 12px; flex: 1; }
.cs-title b { display: block; font: 700 1.35rem var(--font-display); }
.cs-title small { color: var(--muted); }
.cs-money { display: flex; align-items: center; gap: 10px; width: 260px; color: var(--warn); }
.cs-money .hs-bar { flex: 1; }
.cs-seats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.seat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border-radius: 18px; border: 2px dashed #475569; background: rgba(11, 18, 34, .7); color: var(--text); font: inherit; cursor: pointer; }
.seat.filled { border-style: solid; border-color: rgba(34, 211, 238, .5); }
.seat.active { border-color: var(--warn); box-shadow: 0 0 0 3px rgba(251, 191, 36, .25); }
.seat-label { font: 700 .75rem var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--warn); display: flex; gap: 6px; align-items: center; }
.seat .avatar.seat-av { width: 96px; height: 96px; border-radius: 18px; }
.seat-empty { width: 96px; height: 96px; border-radius: 18px; display: grid; place-items: center; color: #475569; border: 1px dashed #475569; }
.seat b { font: 700 1.05rem var(--font-display); }
.cs-body { display: grid; grid-template-columns: 1fr 300px; gap: 14px; align-items: start; }
.cs-cands-head { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; margin-bottom: 10px; }
.cs-cands-head > b { font: 700 1.1rem var(--font-display); }
.cs-cands-head .hs-help { flex-basis: 100%; }
.cand-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.cand { position: relative; display: grid; grid-template-columns: 110px 1fr; gap: 14px; padding: 14px; border-radius: 18px; border: 2px solid var(--line-2); background: #0b1222; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .1s, border-color .1s; }
.cand:hover { transform: translateY(-3px); border-color: var(--accent); }
.cand.selected { border-color: var(--warn); background: rgba(120, 53, 15, .3); }
.cand .avatar.cand-av { width: 110px; height: 110px; border-radius: 18px; }
.cand-info { display: flex; flex-direction: column; gap: 4px; }
.cand-info b { font: 700 1.2rem var(--font-display); }
.cand-info small { color: var(--muted); display: flex; gap: 4px; align-items: center; }
.cand-bio { font-size: .8rem; color: var(--muted); line-height: 1.3; }
.cand .coins { position: absolute; top: 12px; right: 12px; }
.cand-check { position: absolute; left: 6px; top: 6px; width: 28px; height: 28px; border-radius: 50%; background: var(--warn); color: #1c1917; display: grid; place-items: center; }
.kstats { display: flex; flex-direction: column; gap: 5px; margin: 4px 0; }
.kstat { display: grid; grid-template-columns: 18px 1fr; gap: 8px; align-items: center; }
.kbar { height: 10px; border-radius: 999px; background: #1e293b; overflow: hidden; }
.kbar span { display: block; height: 100%; border-radius: 999px; }
.kstat.speed { color: var(--stat-speed); } .kstat.speed .kbar span { background: var(--stat-speed); }
.kstat.analysis { color: var(--stat-analysis); } .kstat.analysis .kbar span { background: var(--stat-analysis); }
.kstat.tech { color: var(--stat-tech); } .kstat.tech .kbar span { background: var(--stat-tech); }
.kstat.calm { color: var(--stat-calm); } .kstat.calm .kbar span { background: var(--stat-calm); }
.cs-side { padding: 14px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; position: sticky; top: 86px; }
.cs-radar { display: flex; justify-content: center; }
.cs-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; font-size: .8rem; }
.cs-legend .speed { color: var(--stat-speed); } .cs-legend .analysis { color: var(--stat-analysis); }
.cs-legend .tech { color: var(--stat-tech); } .cs-legend .calm { color: var(--stat-calm); }
@media (max-width: 900px) {
  .h-stats { width: 220px; }
  .cs-body { grid-template-columns: 1fr; }
}
.h-actionbar { position: absolute; left: 16px; right: 16px; bottom: 234px; display: flex; justify-content: center; align-items: center; gap: 12px; pointer-events: none; }
.h-actionbar > * { pointer-events: auto; }
.h-alert { position: static; transform: none; max-width: 620px; }
.h-next { position: static; margin-left: auto; }
.h-actionbar .h-alert { margin-left: auto; }
.h-next { width: auto !important; flex: 0 0 auto; }

/* Mission full screen + HUD */
.mission-full { position: relative; height: calc(100vh - 70px); min-height: 560px; overflow: hidden; background: #03060f; }
.mission-full > canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: pointer; }
.hud-top { position: absolute; top: 14px; left: 14px; right: 14px; display: flex; gap: 12px; align-items: stretch; pointer-events: none; }
.hud-top > * { pointer-events: auto; }
.hud-rings { display: flex; gap: 10px; padding: 8px 12px; }
.ring { position: relative; width: 58px; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.ring > svg { width: 52px; height: 52px; transform: rotate(-90deg); }
.ring-bg { fill: rgba(15, 26, 46, .9); stroke: #1e293b; stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--good); stroke-width: 5; stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dasharray .3s, stroke .3s; }
.ring.warn .ring-fg { stroke: var(--warn); }
.ring.bad .ring-fg { stroke: var(--bad); }
.ring.danger { animation: pulse-ring 0.9s infinite; border-radius: 50%; }
@keyframes pulse-ring { 50% { filter: drop-shadow(0 0 8px rgba(244, 63, 94, .9)); } }
.ring-ico { position: absolute; top: 16px; left: 50%; transform: translateX(-50%); color: #e2e8f0; line-height: 0; }
.ring small { font-size: .7rem; color: var(--muted); }
#r-sci .ring-fg { stroke: var(--stat-analysis); }
#r-sci.bad .ring-fg, #r-sci.warn .ring-fg { stroke: #60a5fa; }
.hud-progress { flex: 1; padding: 10px 18px 12px; display: flex; flex-direction: column; justify-content: center; gap: 10px; min-width: 0; }
.hp-label { font: 600 .98rem var(--font-sans); display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-label .now { color: #1c1917; background: var(--warn); border-radius: 999px; padding: 1px 8px; font-size: .78rem; animation: pulse-gold 1s infinite; }
.hp-track { position: relative; height: 8px; border-radius: 999px; background: #1e293b; margin: 6px 14px; }
.hp-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, #0891b2, #22d3ee); }
.hp-mark { position: absolute; top: 50%; transform: translate(-50%, -50%); width: 32px; height: 32px; border-radius: 50%; border: 2px solid #475569; background: #0b1222; color: #64748b; display: grid; place-items: center; padding: 0; cursor: default; }
.hp-mark.active { border-color: var(--warn); color: var(--warn); background: #3a2a0c; cursor: pointer; animation: pulse-gold 1s infinite; width: 38px; height: 38px; }
.hp-mark.working { border-color: var(--accent); color: var(--accent); }
.hp-mark.success { border-color: var(--good); color: #04121a; background: var(--good); }
.hp-mark.fail, .hp-mark.ignored, .hp-mark.missed { border-color: var(--bad); color: #04121a; background: var(--bad); }
.hud-pause { width: 56px; display: grid; place-items: center; color: var(--text); cursor: pointer; }
.hud-pause:hover { border-color: var(--accent); }
.hud-status { position: absolute; top: 110px; left: 14px; display: flex; flex-direction: column; gap: 6px; align-items: flex-start; }
.hud-status .status-chip { display: inline-flex; gap: 6px; align-items: center; font-family: var(--font-sans); font-weight: 600; }
.hud-hint { position: absolute; left: 50%; transform: translateX(-50%); bottom: 132px; padding: 8px 14px; border-radius: 999px; background: rgba(8, 47, 73, .85); border: 1px solid rgba(34, 211, 238, .5); color: #cffafe; font-size: .9rem; display: flex; gap: 6px; align-items: center; animation: pulse-chip 1.6s infinite; }
.hud-crew { position: absolute; left: 50%; transform: translateX(-50%); bottom: 14px; display: flex; gap: 14px; padding: 10px 18px; }
.hc { display: flex; flex-direction: column; align-items: center; gap: 2px; width: 84px; }
.hc-av { position: relative; width: 64px; height: 64px; }
.hc-av .avatar { width: 54px; height: 54px; border-radius: 50%; position: absolute; left: 5px; top: 5px; border: none; }
.hc-ring { position: absolute; inset: 0; width: 64px; height: 64px; transform: rotate(-90deg); }
.hc-ring circle { fill: none; stroke: var(--good); stroke-width: 3.5; stroke-linecap: round; stroke-dasharray: 100 100; transition: stroke-dasharray .4s; }
.hc.tired .hc-ring circle { stroke: var(--warn); }
.hc.busy .hc-ring circle { stroke: var(--accent); }
.hc.out .hc-ring circle { stroke: #f472b6; }
.hc.out .avatar, .hc.busy .avatar { filter: saturate(.6) brightness(.8); }
.hc b { font: 700 .8rem var(--font-display); }
.hc-state { font-size: .66rem; color: var(--muted); }
.hc.busy .hc-state { color: var(--accent); } .hc.tired .hc-state { color: var(--warn); } .hc.out .hc-state { color: #f9a8d4; } .hc.free .hc-state { color: var(--good); }
.mission-full .paused-banner { top: 120px; display: flex; gap: 6px; align-items: center; }
.mission-full .blackout-overlay { gap: 6px; font-family: var(--font-sans); }
.mission-full .blackout-overlay .ico { color: var(--bad); }

/* Kid toasts & effect chips */
.toast.kid { display: flex; gap: 10px; align-items: flex-start; font-size: .9rem; }
.toast.kid b { font-size: .98rem; }
.kt-ico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0; background: #0f1a2e; }
.toast.success .kt-ico { color: var(--good); } .toast.fail .kt-ico, .toast.bad .kt-ico { color: var(--bad); }
.toast.main .kt-ico { color: var(--warn); } .toast.status .kt-ico { color: var(--accent); }
.toast.bad { border-left-color: var(--bad); }
.fx-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.fx-chip { display: inline-flex; gap: 4px; align-items: center; font-size: .74rem; padding: 2px 8px; border-radius: 999px; border: 1px solid; }
.fx-chip.good { color: #6ee7b7; border-color: rgba(52, 211, 153, .45); background: rgba(16, 185, 129, .08); }
.fx-chip.bad { color: #fda4af; border-color: rgba(244, 63, 94, .45); background: rgba(244, 63, 94, .08); }

/* Event window tweaks for v4 */
.dsp-icon { width: 58px; height: 58px; border-radius: 16px; display: grid; place-items: center; background: #0f1a2e; border: 2px solid var(--line-2); }
.dsp-icon.neg { color: #fda4af; border-color: rgba(244, 63, 94, .6); }
.dsp-icon.pos { color: #6ee7b7; border-color: rgba(52, 211, 153, .6); }
.dsp-icon.main { color: var(--warn); border-color: rgba(251, 191, 36, .7); }
.ring.timer { width: 52px; }
.ring.timer .ring-fg { stroke: var(--warn); }
.ring.timer .ring-ico { top: 16px; }
.dsp-verdict .v-top b { font-family: var(--font-display); }
.c-team { color: var(--accent); } .c-req { color: var(--warn); }
.dsp-slot .plus .ico { color: #64748b; }
.cs-row { grid-template-columns: 20px 1fr; }
.cs-k { display: grid; place-items: center; }
.badge.free { color: #6ee7b7; } .badge.busy { color: #a5f3fc; } .badge.tired { color: #fcd34d; } .badge.out { color: #fbcfe8; }
.risk { display: flex; flex-direction: column; gap: 4px; }
.req-ico { color: var(--c); }

/* Kid menu */
.kid-menu { display: flex; flex-direction: column; gap: 18px; max-width: 1100px; margin: 0 auto; }
.km-hero { display: flex; gap: 24px; align-items: center; padding: 26px; border-radius: 22px; border: 1px solid rgba(34, 211, 238, .25); background: linear-gradient(120deg, rgba(8, 47, 73, .45), rgba(5, 9, 20, .6)); }
.km-hero .avatar.km-laika { width: 150px; height: 150px; border-radius: 26px; }
.km-hero h1 { font-size: 2.4rem; line-height: 1.1; margin: 8px 0; }
.km-hero p { color: #cbd5e1; font-size: 1.1rem; }
.km-steps { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.km-steps span { display: inline-flex; gap: 8px; align-items: center; padding: 8px 14px; border-radius: 999px; background: var(--panel); border: 1px solid var(--line-2); color: #a5f3fc; font-weight: 600; }
.km-mission { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 8px; padding: 34px; min-height: 280px; border-radius: 22px; border: 2px solid rgba(251, 191, 36, .5); background-size: cover; background-position: center; color: var(--text); font: inherit; text-align: left; cursor: pointer; transition: transform .12s, border-color .12s; }
.km-mission:hover { transform: translateY(-3px); border-color: var(--warn); }
.km-mission h2 { font-size: 2.3rem; margin: 0; }
.km-mission p { color: #cbd5e1; font-size: 1.1rem; max-width: 460px; }
.km-play { margin-top: auto; display: inline-flex; gap: 8px; align-items: center; width: auto !important; padding: 14px 32px; font-size: 1.2rem; }
.km-locked { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.km-lock { display: flex; align-items: center; gap: 12px; padding: 20px; border-radius: 18px; border: 1px solid var(--line-2); background-size: cover; background-position: center; color: var(--muted); }
.km-lock b { color: #cbd5e1; flex: 1; }

/* Launch */
.launch .rocket { color: #fde68a; filter: drop-shadow(0 0 22px rgba(251, 146, 60, .8)); }
.launch .count { font-size: 4rem; }
#l-msg { display: flex; gap: 8px; align-items: center; justify-content: center; font-size: 1.1rem; color: #e2e8f0; }

/* Kid report */
.kid-report { max-width: 1100px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.kr-head { display: flex; gap: 26px; align-items: center; padding: 26px; border-radius: 22px; border: 1px solid var(--line); background: linear-gradient(90deg, rgba(5, 9, 20, .96) 35%, rgba(5, 9, 20, .5)), var(--bg) center / cover; }
.kr-head h1 { font-size: 2.2rem; margin: 6px 0; }
.kr-head p { color: #cbd5e1; font-size: 1.05rem; }
.kr-stars { display: flex; gap: 6px; }
.kr-stars span { color: #334155; }
.kr-stars span.on { color: #fbbf24; filter: drop-shadow(0 0 8px rgba(251, 191, 36, .6)); }
.kr-stars span.on svg { fill: #fbbf24; }
.kr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.kr-card { padding: 18px; display: flex; flex-direction: column; gap: 12px; }
.kr-reason { display: flex; gap: 10px; align-items: center; font-size: 1rem; }
.kr-reason.good .ico { color: var(--good); } .kr-reason.bad .ico { color: var(--bad); }
.kr-laika, .kr-real { flex-direction: row; align-items: flex-start; }
.kr-laika p, .kr-real p { margin: 4px 0 0; color: #cbd5e1; }
.kr-real .ico { color: var(--accent); margin-top: 2px; }
.kid-report .actions .btn { display: inline-flex; gap: 8px; align-items: center; width: auto; }
@media (max-width: 800px) { .kr-grid, .km-locked { grid-template-columns: 1fr; } .km-hero { flex-direction: column; text-align: center; } }
