:root {
  --ice: #f4f8ff; --white: #ffffff; --navy: #0b1f3a; --navy2: #14335e; --ink: #10233f; --mute: #5d7190;
  --blue: #2f7bff; --cyan: #00c2ff; --glow: rgba(47,123,255,.22); --line: #d6e3f7; --warn: #ff4d6d; --ok: #10c48a; --gold: #ffb627;
  --cut: 14px; --r: 6px;
  --head: 'Rajdhani', 'Segoe UI', sans-serif; --body: 'Inter', 'Segoe UI', sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body {
  font-family: var(--body); color: var(--ink); min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 85% -10%, rgba(0,194,255,.18), transparent 60%),
    radial-gradient(900px 500px at -10% 10%, rgba(47,123,255,.14), transparent 60%),
    linear-gradient(180deg, #ffffff 0%, var(--ice) 60%, #e9f1fe 100%);
  background-attachment: fixed;
}
body::before { /* faint HUD grid */
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0; opacity: .5;
  background-image: linear-gradient(rgba(47,123,255,.05) 1px, transparent 1px), linear-gradient(90deg, rgba(47,123,255,.05) 1px, transparent 1px);
  background-size: 48px 48px;
}
button, input, textarea, select { font: inherit; }
img { max-width: 100%; }

/* ---------- top bar */
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 24px; padding: 12px 28px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line);
}
.brand { display: flex; gap: 10px; align-items: center; }
.brand img { width: 38px; height: 38px; }
.brand b { font-family: var(--head); font-size: 22px; letter-spacing: .18em; color: var(--navy); display: block; line-height: 1; }
.brand small { font-size: 11px; letter-spacing: .12em; color: var(--mute); text-transform: uppercase; }
nav { display: flex; gap: 4px; margin: 0 auto; }
nav button {
  border: 0; background: none; cursor: pointer; padding: 10px 18px; font-family: var(--head); font-weight: 700; font-size: 16px;
  letter-spacing: .14em; text-transform: uppercase; color: var(--mute); position: relative;
}
nav button.on { color: var(--navy); }
nav button.on::after { content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px; height: 3px; background: linear-gradient(90deg, var(--blue), var(--cyan)); box-shadow: 0 0 12px var(--glow); }
nav button:hover { color: var(--blue); }
.who { display: flex; gap: 10px; align-items: center; font-size: 13px; color: var(--mute); }
.who a { color: var(--blue); text-decoration: none; font-weight: 600; }
.badge-mode { font-family: var(--head); letter-spacing: .12em; font-weight: 700; font-size: 12px; padding: 4px 10px; background: var(--navy); color: #fff; clip-path: polygon(8px 0, 100% 0, calc(100% - 8px) 100%, 0 100%); }

main { position: relative; z-index: 1; max-width: 1320px; margin: 0 auto; padding: 28px 28px 120px; }

/* ---------- panels */
.panel {
  background: var(--white); border: 1px solid var(--line); position: relative; padding: 20px 22px;
  clip-path: polygon(var(--cut) 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%, 0 var(--cut));
  box-shadow: 0 10px 30px -18px rgba(11,31,58,.35);
}
.panel::before { content: ''; position: absolute; left: 0; top: 0; width: 64px; height: 3px; background: linear-gradient(90deg, var(--blue), var(--cyan)); }
.dark { background: linear-gradient(135deg, var(--navy) 0%, var(--navy2) 100%); color: #eaf3ff; border-color: transparent; }
.dark .mute { color: #9cb6dc; }
h1, h2, h3 { font-family: var(--head); text-transform: uppercase; letter-spacing: .12em; margin: 0; color: var(--navy); }
.dark h2, .dark h3 { color: #fff; }
h1 { font-size: clamp(28px, 4vw, 44px); letter-spacing: .1em; }
h2 { font-size: 18px; margin-bottom: 14px; display: flex; align-items: center; gap: 10px; }
h2 .count { font-size: 13px; color: var(--blue); }
h3 { font-size: 17px; letter-spacing: .06em; text-transform: none; }
.mute { color: var(--mute); font-size: 13px; }
.kicker { font-family: var(--head); font-weight: 700; letter-spacing: .3em; font-size: 12px; color: var(--blue); text-transform: uppercase; }
.grid { display: grid; gap: 20px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.span2 { grid-column: span 2; }
.hero { display: flex; justify-content: space-between; align-items: end; gap: 20px; margin-bottom: 22px; flex-wrap: wrap; }

/* ---------- buttons */
.btn {
  border: 0; cursor: pointer; font-family: var(--head); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 15px;
  padding: 12px 22px; color: #fff; background: linear-gradient(90deg, var(--blue), #1a5cff); box-shadow: 0 8px 20px -8px var(--blue);
  clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); transition: transform .12s, filter .12s;
}
.btn:hover { transform: translateY(-1px); filter: brightness(1.08); }
.btn.ghost { background: var(--ice); color: var(--navy); box-shadow: none; border: 1px solid var(--line); }
.btn.small { padding: 8px 14px; font-size: 13px; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-family: var(--head); font-weight: 700; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; padding: 3px 10px; border: 1px solid var(--line); color: var(--navy2); background: var(--ice); }
.chip.blue { background: var(--blue); color: #fff; border-color: var(--blue); }
.chip.warn { background: var(--warn); color: #fff; border-color: var(--warn); }
.chip.ok { background: var(--ok); color: #fff; border-color: var(--ok); }
.chip.gold { background: var(--gold); color: var(--navy); border-color: var(--gold); }

/* ---------- pilot cards */
.pilot { display: grid; grid-template-columns: 92px 1fr; gap: 18px; align-items: center; }
.avatar { width: 92px; height: 92px; display: grid; place-items: center; font-family: var(--head); font-size: 40px; font-weight: 700; color: #fff; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.rank { font-family: var(--head); font-weight: 700; letter-spacing: .2em; color: var(--cyan); font-size: 13px; text-transform: uppercase; }
.pilot h3 { font-size: 30px; text-transform: uppercase; letter-spacing: .1em; color: #fff; }
.xpbar { height: 8px; background: rgba(255,255,255,.12); margin: 10px 0 6px; position: relative; overflow: hidden; }
.xpbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--cyan), var(--blue)); box-shadow: 0 0 14px var(--cyan); }
.stats { display: flex; gap: 18px; margin-top: 12px; flex-wrap: wrap; }
.stat b { display: block; font-family: var(--head); font-size: 26px; line-height: 1; color: #fff; }
.stat span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: #9cb6dc; }
.mission { margin-top: 16px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,.12); }
.mission .what { font-family: var(--head); font-size: 20px; font-weight: 700; color: #fff; letter-spacing: .04em; }
.mission .areas { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.mission .areas code { font-size: 12px; background: rgba(0,194,255,.14); color: #bfefff; padding: 2px 8px; }
.state { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin-right: 6px; background: var(--ok); box-shadow: 0 0 10px var(--ok); }
.state.testing { background: var(--gold); box-shadow: 0 0 10px var(--gold); }
.state.idle { background: #8aa0c0; box-shadow: none; }

/* ---------- live + radar */
.live { display: flex; align-items: center; gap: 18px; }
.live .big { font-family: var(--head); font-size: 34px; font-weight: 700; letter-spacing: .08em; line-height: 1; }
.pulse { width: 18px; height: 18px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 rgba(16,196,138,.6); animation: pulse 2s infinite; flex: none; }
.pulse.off { background: var(--gold); animation: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 16px rgba(16,196,138,0); } 100% { box-shadow: 0 0 0 0 rgba(16,196,138,0); } }
.radar-item { border-left: 3px solid var(--warn); padding: 10px 14px; background: #fff5f7; margin-bottom: 10px; }
.radar-item b { color: var(--warn); font-family: var(--head); letter-spacing: .1em; text-transform: uppercase; }
.radar-clear { display: flex; align-items: center; gap: 12px; color: var(--ok); font-family: var(--head); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.work-row { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px dashed var(--line); font-size: 14px; }
.work-row:last-child { border: 0; }
.dot { width: 10px; height: 10px; flex: none; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }

/* ---------- feed */
.feed { display: grid; gap: 18px; }
.brief { display: grid; grid-template-columns: 260px 1fr; gap: 0; padding: 0; overflow: hidden; }
.brief .pic { background: linear-gradient(135deg, var(--navy), #1d4fa8); min-height: 170px; display: grid; place-items: center; position: relative; }
.brief .pic img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }
.brief .pic .sigil { font-family: var(--head); font-weight: 700; font-size: 64px; color: rgba(255,255,255,.18); letter-spacing: .1em; }
.brief .txt { padding: 20px 24px; }
.brief .txt p { line-height: 1.6; margin: 10px 0 0; }
.lesson { margin-top: 12px; font-size: 13px; padding: 8px 12px; background: #f1f0ff; border-left: 3px solid #7c5cff; }
.meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }

/* ---------- board */
.cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.col-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; }
.card { padding: 16px 18px; margin-bottom: 14px; }
.card .shot { margin: 10px -18px -6px; aspect-ratio: 16/9; overflow: hidden; background: var(--ice); }
.card .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card p { font-size: 14px; line-height: 1.55; margin: 8px 0 0; white-space: pre-wrap; }
.reacts { display: flex; gap: 6px; margin-top: 12px; flex-wrap: wrap; }
.react { border: 1px solid var(--line); background: var(--ice); cursor: pointer; padding: 4px 10px; font-size: 12px; font-weight: 600; color: var(--navy2); display: inline-flex; gap: 6px; align-items: center; }
.react:hover { border-color: var(--blue); color: var(--blue); }
.react svg { width: 14px; height: 14px; }

/* ---------- comms */
.comm { display: grid; grid-template-columns: 170px 1fr; gap: 18px; padding: 16px 20px; margin-bottom: 14px; }
.callsign { font-family: var(--head); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; font-size: 15px; color: var(--navy); }
.arrow { color: var(--blue); font-family: var(--head); font-weight: 700; letter-spacing: .1em; font-size: 13px; text-transform: uppercase; }
.type-handoff { --c: var(--blue); } .type-heads-up { --c: var(--warn); } .type-question { --c: var(--gold); } .type-shoutout { --c: var(--ok); }
.comm { border-left: 4px solid var(--c, var(--blue)); }
.comm .chip { background: var(--c); color: #fff; border-color: var(--c); }
.agents { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 14px; margin-bottom: 22px; }
.agent { padding: 14px 16px; }
.agent .kind { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); font-weight: 600; }

/* ---------- brains */
.brain { padding: 22px; }
.brain .glyph { width: 54px; height: 54px; float: right; }
.brain ul { padding: 0; margin: 14px 0 0; list-style: none; }
.brain li { font-size: 13px; line-height: 1.5; padding: 8px 0; border-top: 1px dashed var(--line); }
.brain .actions { display: flex; gap: 10px; margin-top: 16px; flex-wrap: wrap; }
.meter { display: flex; gap: 16px; margin-top: 10px; }
.meter b { font-family: var(--head); font-size: 26px; color: var(--navy); display: block; line-height: 1; }
.meter span { font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--mute); }

/* ---------- modal + forms */
.modal { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; background: rgba(11,31,58,.55); backdrop-filter: blur(6px); padding: 16px; }
.modal .panel { width: min(560px, 100%); max-height: 90vh; overflow: auto; }
label { display: block; font-family: var(--head); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; font-size: 13px; color: var(--navy2); margin: 14px 0 6px; }
input, textarea, select { width: 100%; border: 1px solid var(--line); background: var(--ice); padding: 12px 14px; font-size: 15px; color: var(--ink); outline: none; }
input:focus, textarea:focus, select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px var(--glow); }
textarea { min-height: 110px; resize: vertical; }
.row { display: flex; gap: 10px; justify-content: flex-end; margin-top: 18px; }
.drop { border: 2px dashed var(--line); padding: 16px; text-align: center; color: var(--mute); font-size: 13px; cursor: pointer; margin-top: 6px; }
.drop.has { border-color: var(--blue); }
.drop img { max-height: 160px; display: block; margin: 0 auto; }
.toast { position: fixed; bottom: 26px; left: 50%; transform: translateX(-50%); z-index: 60; background: var(--navy); color: #fff; padding: 14px 24px; font-family: var(--head); font-weight: 700; letter-spacing: .12em; text-transform: uppercase; box-shadow: 0 10px 30px -10px var(--navy); clip-path: polygon(10px 0, 100% 0, calc(100% - 10px) 100%, 0 100%); }
.loading { display: grid; place-items: center; gap: 14px; padding: 120px 0; font-family: var(--head); letter-spacing: .3em; text-transform: uppercase; color: var(--mute); }
.loading span { width: 46px; height: 46px; border: 3px solid var(--line); border-top-color: var(--blue); border-radius: 50%; animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.signin { max-width: 520px; margin: 80px auto; text-align: center; padding: 40px; }
.signin img { width: 90px; }
.enter { animation: enter .35s ease both; }
@keyframes enter { from { opacity: 0; transform: translateY(8px); } }

/* ---------- phones */
@media (max-width: 1000px) {
  .g3, .cols, .agents { grid-template-columns: 1fr 1fr; }
  .span2 { grid-column: auto; }
}
@media (max-width: 720px) {
  .top { padding: 10px 16px; gap: 10px; backdrop-filter: none; background: rgba(255,255,255,.97); justify-content: space-between; }
  nav { position: fixed; bottom: 0; left: 0; right: 0; justify-content: space-around; background: rgba(255,255,255,.95); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); backdrop-filter: blur(14px); }
  nav button { padding: 10px 6px; font-size: 13px; letter-spacing: .08em; }
  main { padding: 18px 16px 110px; }
  .g2, .g3, .cols, .agents { grid-template-columns: 1fr; }
  .brief, .comm { grid-template-columns: 1fr; }
  .brief .pic { min-height: 150px; }
  .pilot { grid-template-columns: 70px 1fr; }
  .avatar { width: 70px; height: 70px; font-size: 30px; }
  .who .name { display: none; }
}

/* ---------- hologram showcase */
.holo { position: relative; z-index: 1; height: min(56vh, 520px); margin: 0; overflow: hidden;
  background: radial-gradient(700px 360px at 50% 85%, rgba(0,194,255,.28), transparent 70%), linear-gradient(180deg, #06142a 0%, #0b1f3a 55%, #14335e 100%);
  border-bottom: 1px solid #1d4fa8; }
.holo canvas { position: absolute; inset: 0; width: 100% !important; height: 100% !important; }
.holo::after { content: ''; position: absolute; inset: 0; pointer-events: none; background: repeating-linear-gradient(0deg, rgba(95,212,255,.05) 0 1px, transparent 1px 4px); }
.holo-tag { position: absolute; left: max(28px, calc(50% - 632px)); bottom: 32px; z-index: 2; color: #eaf6ff; }
.holo-tag .kicker { color: var(--cyan); }
.holo-title { font-family: var(--head); font-weight: 700; font-size: clamp(28px, 4vw, 48px); letter-spacing: .1em; text-transform: uppercase; text-shadow: 0 0 24px rgba(0,194,255,.6); }
.holo-sub { font-size: 13px; letter-spacing: .16em; text-transform: uppercase; color: #9cb6dc; }
.holo-dots { position: absolute; right: max(28px, calc(50% - 632px)); bottom: 38px; z-index: 2; display: flex; gap: 6px; }
.holo-dots i { width: 22px; height: 3px; background: rgba(255,255,255,.25); }
.holo-dots i.on { background: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.holo-next { position: absolute; right: max(20px, calc(50% - 640px)); top: 50%; transform: translateY(-50%); z-index: 2; width: 48px; height: 48px; border: 1px solid rgba(95,212,255,.5); background: rgba(11,31,58,.5); color: #fff; font-size: 28px; cursor: pointer; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.holo-next:hover { background: var(--blue); }
@media (max-width: 720px) { .holo { height: 46vh; } .holo-tag { left: 16px; bottom: 20px; } .holo-dots { right: 16px; bottom: 26px; } }

/* ---------- connections */
.conn { display: flex; flex-direction: column; }
.conn-head { display: flex; gap: 14px; align-items: flex-start; }
.conn-head h3 { margin-bottom: 4px; }
.conn-logo { flex: none; width: 46px; height: 46px; display: grid; place-items: center; font-family: var(--head); font-weight: 700; letter-spacing: .06em; color: #fff; background: linear-gradient(135deg, var(--navy), var(--blue)); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.saved { margin-top: 12px; padding: 10px 12px; background: var(--ice); border-left: 3px solid var(--line); font-size: 14px; }
.saved.ok { border-left-color: var(--ok); }
.saved.bad { border-left-color: var(--warn); }
.saved b { margin-left: 6px; }
.conn-actions { justify-content: flex-start; margin-top: auto; padding-top: 14px; flex-wrap: wrap; }
a.btn { text-decoration: none; display: inline-block; }

/* ---------- hover explainers */
.tip { position: fixed; z-index: 80; max-width: 300px; padding: 10px 13px; background: var(--navy); color: #eaf6ff; font: 500 13px/1.45 var(--body); box-shadow: 0 12px 30px -10px rgba(11,31,58,.6); border-left: 3px solid var(--cyan); pointer-events: none; }
[data-tip] { cursor: help; }
button[data-tip], a[data-tip] { cursor: pointer; }

/* ---------- Zuko */
.zuko-fab { display: none; position: fixed; right: 24px; bottom: 24px; z-index: 40; border: 0; cursor: pointer; padding: 15px 24px; font: 700 15px var(--head); letter-spacing: .18em; color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--blue)); box-shadow: 0 0 0 3px rgba(0,194,255,.25), 0 14px 30px -10px var(--blue); clip-path: polygon(12px 0, 100% 0, calc(100% - 12px) 100%, 0 100%); }
body.ready .zuko-fab:not([hidden]) { display: block; }
.zuko { position: fixed; right: 20px; bottom: 20px; z-index: 45; width: min(440px, calc(100vw - 32px)); height: min(640px, calc(100vh - 110px)); display: flex; flex-direction: column;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 30px 60px -20px rgba(11,31,58,.55); }
.zuko-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 18px; background: linear-gradient(135deg, var(--navy), var(--navy2)); color: #fff; }
.zuko-head b { font: 700 22px var(--head); letter-spacing: .2em; }
.zuko-head .kicker { color: var(--cyan); }
.zuko-x { background: none; border: 0; color: #fff; font-size: 28px; cursor: pointer; line-height: 1; }
.zuko-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--ice); }
.zmsg { max-width: 88%; padding: 10px 13px; font-size: 14px; line-height: 1.55; }
.zmsg.me { align-self: flex-end; background: var(--blue); color: #fff; }
.zmsg.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-left: 3px solid var(--cyan); }
.zmsg.bot b { font: 700 12px var(--head); letter-spacing: .2em; color: var(--blue); display: block; margin-bottom: 4px; }
.zuko-chips { display: flex; gap: 6px; flex-wrap: wrap; padding: 8px 14px 0; }
.zuko-form { display: flex; gap: 8px; padding: 12px 14px 14px; align-items: flex-end; }
.zuko-form textarea { min-height: 46px; height: 46px; resize: none; }
@media (max-width: 720px) { .zuko-fab { bottom: 84px; right: 14px; } .zuko { right: 8px; bottom: 76px; height: calc(100vh - 150px); } }

/* ---------- header fits narrower screens */
@media (max-width: 1500px) { nav button { padding: 10px 11px; letter-spacing: .1em; font-size: 15px; } .top { gap: 14px; padding: 12px 18px; } .brand small { display: none; } }
@media (max-width: 1150px) and (min-width: 721px) { nav button { padding: 8px 7px; font-size: 13px; letter-spacing: .06em; } .who .name { display: none; } }
.brand { flex: none; } .who { flex: none; white-space: nowrap; }
