:root {
  --bg: #090b12;
  --bg2: #0e111b;
  --panel: #131725;
  --panel2: #1a1f31;
  --line: #262c42;
  --line2: #343c58;
  --ink: #eef1fa;
  --dim: #9aa3bd;
  --dim2: #626b86;
  --cyan: #4de3ff;
  --violet: #9b7bff;
  --gold: #ffd166;
  --green: #3ddc97;
  --red: #ff6b7a;
  --amber: #ffb547;
  --head: "Space Grotesk", "Segoe UI", sans-serif;
  --sans: "Inter", "Segoe UI", system-ui, sans-serif;
  --mono: "JetBrains Mono", Consolas, monospace;
  --r: 14px;
}
* { box-sizing: border-box; }
html { color-scheme: dark; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--ink); font: 14px/1.5 var(--sans); }
body { display: flex; flex-direction: column; background:
  radial-gradient(900px 500px at 85% -10%, #4de3ff14, transparent 60%),
  radial-gradient(800px 600px at -10% 110%, #9b7bff14, transparent 60%), var(--bg); }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
.mono { font-family: var(--mono); }
.dim { color: var(--dim); }
.pos { color: var(--green); }
.neg { color: var(--red); }
h1, h2, h3 { font-family: var(--head); margin: 0; letter-spacing: -.01em; }
h2 { font-size: 15px; display: flex; align-items: center; gap: 8px; }
h2 small { font: 500 11px var(--sans); color: var(--dim2); margin-left: auto; text-transform: uppercase; letter-spacing: .08em; }

/* ---------- top bar ---------- */
.top { display: flex; align-items: center; gap: 20px; padding: 12px 20px; border-bottom: 1px solid var(--line); background: #0b0e17cc; backdrop-filter: blur(8px); position: sticky; top: 0; z-index: 10; }
.brand { display: flex; align-items: center; gap: 11px; }
.logo { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font: 700 16px var(--head); color: #0b0d14;
  background: linear-gradient(135deg, var(--cyan), var(--violet)); box-shadow: 0 0 22px #4de3ff44; }
.brand-t { display: flex; flex-direction: column; line-height: 1.1; }
.brand-t b { font: 700 17px var(--head); }
.brand-t small { color: var(--dim2); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; }
.cmd { display: flex; align-items: center; gap: 12px; flex: 1; max-width: 420px; min-width: 0; }
.ring { --p: 0; width: 46px; height: 46px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--gold) calc(var(--p) * 1%), var(--line) 0); }
.ring span { width: 38px; height: 38px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font: 700 16px var(--head); color: var(--gold); }
.cmd-meta { flex: 1; min-width: 0; }
.cmd-row { display: flex; justify-content: space-between; gap: 8px; font-size: 12px; }
.cmd-row b { font: 600 14px var(--head); color: var(--gold); }
.xpbar { height: 7px; border-radius: 9px; background: var(--line); overflow: hidden; margin-top: 5px; }
.xpbar i { display: block; height: 100%; width: 0; border-radius: 9px; background: linear-gradient(90deg, var(--gold), #ff9f43); transition: width .8s; }
.chips { margin-left: auto; display: flex; gap: 8px; align-items: center; }
.chip { padding: 6px 11px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
#chip-online.ok { color: var(--green); }
.kill { padding: 8px 13px; border-radius: 10px; font: 600 12px var(--head); letter-spacing: .04em; border: 1px solid #ff6b7a66; color: var(--red); background: #ff6b7a12; }
.kill:hover { background: #ff6b7a26; }
.kill.on { background: var(--red); color: #1a0508; }

/* ---------- shell ---------- */
.shell { flex: 1; display: flex; min-height: 0; }
.side { width: 178px; flex: none; padding: 16px 10px; border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 4px; }
.side button { display: flex; align-items: center; gap: 11px; padding: 10px 12px; border-radius: 11px; color: var(--dim); font-weight: 500; text-align: left; }
.side button span { font-size: 17px; width: 22px; text-align: center; }
.side button:hover { background: var(--panel); color: var(--ink); }
.side button.on { background: linear-gradient(90deg, #4de3ff1c, #9b7bff10); color: var(--ink); box-shadow: inset 2px 0 0 var(--cyan); }
main { flex: 1; overflow: auto; padding: 22px 26px 40px; outline: none; }
.page-h { display: flex; align-items: flex-end; gap: 16px; margin-bottom: 18px; }
.page-h h1 { font-size: 26px; }
.page-h p { margin: 0; color: var(--dim); }

.grid { display: grid; gap: 16px; }
.g-hq { grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); }
.card { background: linear-gradient(180deg, var(--panel), var(--bg2)); border: 1px solid var(--line); border-radius: var(--r); padding: 16px; min-width: 0; }
.card > h2 { margin-bottom: 12px; }
.stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

/* ---------- hero ---------- */
.hero { display: flex; gap: 22px; align-items: center; padding: 20px; background:
  radial-gradient(500px 200px at 0% 0%, #ffd16618, transparent 70%), linear-gradient(180deg, var(--panel), var(--bg2)); }
.hero .ring { width: 92px; height: 92px; }
.hero .ring span { width: 78px; height: 78px; font-size: 32px; }
.hero h1 { font-size: 24px; }
.hero .sub { color: var(--dim); margin: 2px 0 10px; }
.hero .xpbar { height: 10px; }
.hero-stats { display: flex; gap: 22px; margin-top: 12px; flex-wrap: wrap; }
.hero-stats div { font-size: 12px; color: var(--dim); }
.hero-stats b { display: block; font: 600 18px var(--head); color: var(--ink); }

/* ---------- quests ---------- */
.quest { display: flex; gap: 12px; align-items: center; padding: 11px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.quest + .quest { margin-top: 8px; }
.quest .qi { font-size: 22px; width: 38px; height: 38px; display: grid; place-items: center; border-radius: 10px; background: var(--panel2); flex: none; }
.quest .qb { flex: 1; min-width: 0; }
.quest .qn { font-weight: 600; display: flex; gap: 8px; align-items: center; }
.quest .qd { color: var(--dim); font-size: 12px; }
.quest .pbar { height: 6px; border-radius: 9px; background: var(--line); overflow: hidden; margin-top: 7px; }
.quest .pbar i { display: block; height: 100%; background: linear-gradient(90deg, var(--cyan), var(--violet)); border-radius: 9px; transition: width .8s; }
.quest .qx { font: 600 12px var(--mono); color: var(--gold); white-space: nowrap; text-align: right; }
.quest .qx small { display: block; color: var(--dim2); font-weight: 400; }
.quest.done { border-color: #3ddc9755; background: #3ddc970d; }
.quest.done .pbar i { background: var(--green); }
.quest.done .qi { background: #3ddc9722; }
.quest.locked { opacity: .45; filter: grayscale(.8); }
.tag { font: 600 10px var(--sans); letter-spacing: .06em; text-transform: uppercase; padding: 2px 7px; border-radius: 6px; background: var(--panel2); color: var(--dim); }
.tag.ok { background: #3ddc9722; color: var(--green); }

/* ---------- squad ---------- */
.squad { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.agent { text-align: left; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; transition: transform .15s, border-color .15s; }
.agent:hover { transform: translateY(-2px); border-color: var(--line2); }
.agent .ah { display: flex; align-items: center; gap: 10px; }
.agent .av { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; font-size: 19px; background: var(--panel2); position: relative; flex: none; }
.agent .av::after { content: ""; position: absolute; right: -3px; bottom: -3px; width: 11px; height: 11px; border-radius: 50%; border: 2px solid var(--bg2); background: var(--dim2); }
.agent.live .av::after { background: var(--green); box-shadow: 0 0 8px var(--green); }
.agent.stale .av::after { background: var(--amber); }
.agent.dead .av::after, .agent.down .av::after { background: var(--red); }
.agent .an { font-weight: 600; line-height: 1.2; }
.agent .ac { font-size: 11px; color: var(--dim2); }
.agent .lv { margin-left: auto; font: 600 11px var(--mono); color: var(--gold); background: #ffd16614; padding: 2px 7px; border-radius: 6px; }
.agent .as { font-size: 12px; color: var(--dim); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agent .need { font-size: 11px; color: var(--amber); }

/* ---------- feed ---------- */
.feed { display: flex; flex-direction: column; gap: 6px; max-height: 640px; overflow: auto; }
.ev { display: grid; grid-template-columns: 50px 22px 1fr; gap: 8px; align-items: start; font-size: 12.5px; padding: 6px 8px; border-radius: 9px; }
.ev:hover { background: var(--bg2); }
.ev .t { color: var(--dim2); font: 11px var(--mono); padding-top: 1px; }
.ev .tx { color: var(--ink); overflow-wrap: anywhere; }
.ev .who { color: var(--dim2); font-size: 11px; }
.ev.result .tx, .ev.level .tx { color: var(--gold); }
.ev.skip .tx { color: var(--dim); }
.ev.new { animation: evin .6s ease-out; }
@keyframes evin { from { opacity: 0; transform: translateY(-6px); } }
.filters { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.filters button { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); font-size: 12px; color: var(--dim); }
.filters button.on { border-color: var(--cyan); color: var(--cyan); background: #4de3ff12; }

/* ---------- brain map ---------- */
.brain-wrap { position: relative; display: grid; grid-template-columns: 1fr 320px; gap: 16px; }
.brain { position: relative; height: calc(100vh - 170px); min-height: 520px; padding: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 50%, #131a2d, var(--bg2) 70%); }
.brain svg { width: 100%; height: 100%; display: block; }
.brain .col-label { font: 600 10px var(--sans); letter-spacing: .14em; text-transform: uppercase; fill: var(--dim2); }
.link { fill: none; stroke: var(--line2); stroke-width: 1.4; opacity: .55; transition: opacity .2s, stroke-width .2s; }
.link.live { opacity: .9; stroke-dasharray: 5 7; animation: flow 1.1s linear infinite; }
.link.k-data.live { stroke: var(--cyan); }
.link.k-signal.live { stroke: var(--violet); }
.link.k-order.live { stroke: var(--gold); }
.link.k-gate { stroke-dasharray: 2 5; }
.link.k-gate.live { stroke: var(--red); }
.link.k-view.live { stroke: #4de3ff55; animation-duration: 2.2s; }
.link.dim { opacity: .08; }
.link.hi { opacity: 1; stroke-width: 2.6; }
@keyframes flow { to { stroke-dashoffset: -24; } }
.node { cursor: pointer; outline: none; }
.node:focus-visible circle.body { stroke: var(--cyan); stroke-width: 2.5; }
.node circle.halo { fill: none; stroke-width: 2; }
.node.live circle.halo { stroke: var(--green); filter: drop-shadow(0 0 6px #3ddc97); animation: pulse 2.4s ease-in-out infinite; }
.node.stale circle.halo { stroke: var(--amber); }
.node.dead circle.halo, .node.down circle.halo { stroke: var(--red); opacity: .7; }
.node.idle circle.halo { stroke: var(--line2); }
.node circle.body { fill: var(--panel2); stroke: var(--line2); }
.node text.ic { font-size: 19px; text-anchor: middle; dominant-baseline: central; }
.node text.lb { font: 600 11.5px var(--sans); fill: var(--ink); text-anchor: middle; }
.node.dim { opacity: .25; }
.node.sel circle.body { stroke: var(--cyan); stroke-width: 2.5; }
@keyframes pulse { 50% { opacity: .45; } }
.legend { position: absolute; left: 14px; bottom: 12px; display: flex; gap: 14px; font-size: 11px; color: var(--dim); flex-wrap: wrap; }
.legend i { display: inline-block; width: 18px; height: 3px; border-radius: 2px; margin-right: 5px; vertical-align: middle; }
.drawer h3 { font-size: 20px; display: flex; gap: 10px; align-items: center; }
.drawer .st { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 3px 9px; border-radius: 99px; background: var(--bg2); border: 1px solid var(--line); margin: 8px 0; }
.drawer .kv { display: grid; grid-template-columns: 90px 1fr; gap: 6px 10px; font-size: 12.5px; margin: 12px 0; }
.drawer .kv dt { color: var(--dim2); }
.drawer .kv dd { margin: 0; overflow-wrap: anywhere; }
.conn { font-size: 12.5px; padding: 6px 9px; border-radius: 8px; background: var(--bg2); margin-top: 5px; display: flex; gap: 8px; cursor: pointer; }
.conn:hover { background: var(--panel2); }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--dim2); flex: none; margin-top: 6px; }
.dot.live { background: var(--green); box-shadow: 0 0 6px var(--green); }
.dot.stale { background: var(--amber); }
.dot.dead, .dot.down { background: var(--red); }

/* ---------- story path ---------- */
.story { position: relative; padding-left: 26px; }
.story::before { content: ""; position: absolute; left: 10px; top: 8px; bottom: 8px; width: 2px; background: var(--line); }
.story .quest { position: relative; }
.story .quest::before { content: ""; position: absolute; left: -22px; top: 50%; width: 12px; height: 12px; margin-top: -6px; border-radius: 50%; background: var(--panel2); border: 2px solid var(--line2); }
.story .quest.done::before { background: var(--green); border-color: var(--green); box-shadow: 0 0 8px var(--green); }
.story .quest.current::before { background: var(--cyan); border-color: var(--cyan); box-shadow: 0 0 10px var(--cyan); }
.trophies { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.trophy { text-align: center; padding: 14px 10px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.trophy .ti { font-size: 30px; filter: grayscale(1); opacity: .35; }
.trophy b { display: block; font: 600 13px var(--head); margin-top: 4px; }
.trophy small { color: var(--dim2); font-size: 11px; }
.trophy.got { border-color: #ffd16655; background: radial-gradient(circle at 50% 0%, #ffd1661c, var(--bg2) 70%); }
.trophy.got .ti { filter: none; opacity: 1; }
.ranks { display: flex; gap: 6px; flex-wrap: wrap; }
.rank { padding: 6px 10px; border-radius: 9px; background: var(--bg2); border: 1px solid var(--line); font-size: 12px; color: var(--dim2); }
.rank.got { color: var(--gold); border-color: #ffd16644; }
.rank.cur { background: var(--gold); color: #1d1503; font-weight: 600; }

/* ---------- pulse ---------- */
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.meter { margin: 10px 0 4px; }
.meter .lbl { display: flex; justify-content: space-between; font-size: 12px; color: var(--dim); }
.meter .bar { display: flex; height: 14px; border-radius: 8px; overflow: hidden; background: var(--line); margin-top: 4px; }
.meter .bar i { display: block; height: 100%; transition: width .8s; }
.meter .bar .l { background: linear-gradient(90deg, #ff6b7a, #ff8f6b); }
.meter .bar .s { background: linear-gradient(90deg, #3ddc97, #4de3ff); }
.big { font: 700 26px var(--head); }
.rows { display: flex; flex-direction: column; gap: 3px; max-height: 420px; overflow: auto; }
.row { display: grid; grid-template-columns: 54px 60px 1fr auto; gap: 8px; font-size: 12.5px; padding: 5px 8px; border-radius: 8px; align-items: center; }
.row:nth-child(odd) { background: var(--bg2); }
.row .t { color: var(--dim2); font: 11px var(--mono); }
.row .c { font-weight: 600; }
.row .u { font-family: var(--mono); text-align: right; }
.row .w { color: var(--dim2); font: 11px var(--mono); }
table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
th { text-align: left; color: var(--dim2); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; padding: 6px 8px; border-bottom: 1px solid var(--line); }
td { padding: 7px 8px; border-bottom: 1px solid #1d2235; font-family: var(--mono); }
td:first-child { font-family: var(--sans); font-weight: 600; }

/* ---------- fund ---------- */
.books { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; }
.book .bh { display: flex; justify-content: space-between; align-items: center; }
.book .eq { font: 700 24px var(--head); margin: 6px 0 2px; }
.book svg { width: 100%; height: 54px; display: block; margin: 8px 0; }
.book .bs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: 11px; color: var(--dim2); }
.book .bs b { display: block; color: var(--ink); font: 600 14px var(--mono); }
.verdict { font: 600 10px var(--sans); padding: 3px 8px; border-radius: 6px; letter-spacing: .06em; background: var(--panel2); color: var(--dim); }
.verdict.good { background: #3ddc9722; color: var(--green); }
.verdict.bad { background: #ff6b7a22; color: var(--red); }

/* ---------- toasts + modal ---------- */
#toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { padding: 11px 15px; border-radius: 12px; background: var(--panel2); border: 1px solid var(--line2); box-shadow: 0 10px 30px #0008; font-size: 13px; animation: tin .3s; max-width: 340px; }
.toast.xp { border-color: #ffd16677; }
.toast.xp b { color: var(--gold); }
@keyframes tin { from { transform: translateY(12px); opacity: 0; } }
.modal { position: fixed; inset: 0; background: #05060acc; display: grid; place-items: center; z-index: 60; }
.modal.hidden { display: none; }
.modal-box { background: var(--panel); border: 1px solid var(--line2); border-radius: 18px; padding: 28px; max-width: 420px; text-align: center; }
.levelup .big-lvl { font: 700 72px var(--head); color: var(--gold); text-shadow: 0 0 30px #ffd16688; line-height: 1; margin: 10px 0; }
.btn { padding: 9px 18px; border-radius: 10px; background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #0b0d14; font-weight: 600; margin-top: 14px; }
.btn.ghost { background: var(--panel2); color: var(--ink); border: 1px solid var(--line2); }
.empty { color: var(--dim2); font-size: 13px; padding: 14px; text-align: center; }

@media (max-width: 1100px) {
  .g-hq, .brain-wrap, .g-3, .g-2 { grid-template-columns: 1fr; }
  .cmd { display: none; }
}
@media (max-width: 720px) {
  .shell { flex-direction: column-reverse; }
  .side { width: auto; flex-direction: row; overflow-x: auto; border-right: 0; border-top: 1px solid var(--line); padding: 6px; }
  .side button { flex-direction: column; gap: 2px; font-size: 11px; padding: 6px 10px; }
  main { padding: 16px; }
  .chips .chip:not(#chip-streak) { display: none; }
  .hero { flex-direction: column; text-align: center; }
}

/* ---------- polish ---------- */
main > * { animation: up .35s ease both; }
main > *:nth-child(2) { animation-delay: .05s; }
main > *:nth-child(3) { animation-delay: .1s; }
@keyframes up { from { opacity: 0; transform: translateY(8px); } }
.xpbar i, .axp i { position: relative; overflow: hidden; }
.xpbar i::after, .axp i::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #ffffff66, transparent); transform: translateX(-100%); animation: shine 2.8s ease-in-out infinite; }
@keyframes shine { 60%, 100% { transform: translateX(100%); } }
.card { box-shadow: 0 1px 0 #ffffff08 inset, 0 12px 30px -18px #000; }
.axp { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.axp i { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), #ff9f43); border-radius: 4px; }
.btn.sm { padding: 6px 12px; margin: 0; font-size: 12px; }
.brain-reset { position: absolute; top: 12px; right: 12px; }
.brain .bg { cursor: default; }
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.confetti i { position: absolute; top: 55%; width: 8px; height: 12px; border-radius: 2px; animation: boom 2.2s cubic-bezier(.2,.7,.3,1) forwards; }
@keyframes boom { to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)); opacity: 0; } }

/* ---------- neural brain ---------- */
.mind { position: relative; height: calc(100vh - 170px); min-height: 540px; padding: 0; overflow: hidden;
  background: radial-gradient(circle at 50% 45%, #18203a 0%, #0c0f1a 55%, #07080e 100%); }
.mind canvas { position: absolute; inset: 0; cursor: grab; touch-action: none; }
.mind::before { content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image: radial-gradient(#ffffff22 1px, transparent 1px), radial-gradient(#ffffff14 1px, transparent 1px);
  background-size: 120px 120px, 47px 47px; background-position: 0 0, 23px 31px; }
.mind-hud { position: absolute; top: 14px; left: 14px; display: flex; gap: 10px; pointer-events: none; }
.mind-stat { padding: 8px 12px; border-radius: 12px; background: #0b0e17cc; border: 1px solid var(--line); backdrop-filter: blur(6px); }
.mind-stat b { display: block; font: 700 20px var(--head); }
.mind-stat span { font-size: 11px; color: var(--dim); }
.mind-legend { position: absolute; top: 14px; right: 14px; display: flex; flex-direction: column; gap: 4px; }
.mind-legend button { display: flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 9px; font-size: 12px; background: #0b0e17cc; border: 1px solid var(--line); opacity: .45; text-align: left; }
.mind-legend button.on { opacity: 1; }
.mind-legend i { width: 9px; height: 9px; border-radius: 50%; box-shadow: 0 0 8px currentColor; }
.mind-info { position: absolute; left: 14px; bottom: 70px; width: 300px; padding: 12px 14px; border-radius: 12px; background: #0b0e17dd; border: 1px solid var(--line); backdrop-filter: blur(6px); font-size: 13px; }
.mi-h { display: flex; align-items: center; gap: 8px; font: 600 15px var(--head); }
.mi-dot { width: 11px; height: 11px; border-radius: 50%; box-shadow: 0 0 10px currentColor; }
.mi-n { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 8px; }
.mi-n span { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--panel2); color: var(--dim); }
.mind-time { position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 12px; background: #0b0e17dd; border: 1px solid var(--line); backdrop-filter: blur(6px); }
.play { width: 34px; height: 34px; border-radius: 50%; flex: none; background: linear-gradient(135deg, var(--cyan), var(--violet)); color: #0b0d14; font-size: 14px; font-weight: 700; box-shadow: 0 0 16px #4de3ff55; }
.mind-time input { flex: 1; accent-color: var(--cyan); }
.mind-time .mono { font-size: 12px; color: var(--dim); min-width: 110px; text-align: right; }
input[type=range] { height: 4px; }
@media (max-width: 720px) { .mind-info { display: none; } .mind-legend { display: none; } }

/* ---------- squad control: start / stop ---------- */
.dayb { padding: 8px 13px; border-radius: 10px; font: 700 12px var(--head); letter-spacing: .04em; color: #0b0d14;
  background: linear-gradient(135deg, var(--green), var(--cyan)); box-shadow: 0 0 18px #3ddc9733; transition: transform .15s, box-shadow .15s; }
.dayb:hover { transform: translateY(-1px); box-shadow: 0 0 26px #3ddc9766; }
.dayb:disabled { opacity: .5; cursor: wait; }
.dayb.big { margin-left: auto; padding: 11px 18px; font-size: 14px; }
.toast.bad { border-color: #ff6b7a77; }
.pill { display: inline-flex; align-items: center; gap: 4px; font: 600 11px var(--sans); padding: 3px 9px; border-radius: 99px; white-space: nowrap; margin-right: 4px; }
.pill.on { background: #3ddc9720; color: var(--green); }
.pill.off { background: var(--panel2); color: var(--dim2); }
.pill.lock { background: #ffb54720; color: var(--amber); }
.pill.ret { background: #9b7bff20; color: var(--violet); }
.pw { padding: 6px 11px; border-radius: 9px; font: 600 12px var(--sans); border: 1px solid var(--line2); background: var(--panel2); transition: background .15s, transform .1s; }
.pw:hover { transform: translateY(-1px); }
.pw:disabled, .pw.busy { opacity: .5; cursor: wait; }
.pw.go { background: #3ddc971c; border-color: #3ddc9766; color: var(--green); }
.pw.go:hover { background: #3ddc9738; }
.pw.term { color: var(--cyan); border-color: #4de3ff44; }
.pw.term:hover { background: #4de3ff1c; }
.pw.stop { background: #ff6b7a14; border-color: #ff6b7a55; color: var(--red); }
.pw.stop:hover { background: #ff6b7a2c; }
.pw.x { color: var(--dim); }
.agent { cursor: pointer; }
.agent.on { border-color: #3ddc9744; }
.agent .aw { display: flex; align-items: center; gap: 6px; justify-content: space-between; }
.agent .aw .pill { overflow: hidden; text-overflow: ellipsis; }
.agent .pws { display: flex; gap: 4px; flex: none; }
.agent .pws .pw { padding: 3px 8px; }
.ctl { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 10px; }
.cbot { padding: 14px; border-radius: 13px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 10px; cursor: pointer; transition: transform .15s, border-color .15s; }
.cbot:hover { transform: translateY(-2px); border-color: var(--line2); }
.cbot.on { border-color: #3ddc9755; background: linear-gradient(160deg, #3ddc970d, var(--bg2) 60%); }
.cb-h { display: flex; gap: 11px; align-items: center; }
.cb-h b { display: block; font: 600 14px var(--head); }
.cb-h small { display: block; font-size: 11.5px; color: var(--dim2); line-height: 1.35; }
.cb-h .av, .det-h .av { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; font-size: 21px; background: var(--panel2); flex: none; }
.cbot.on .av, .det-h .av.on { box-shadow: 0 0 0 2px var(--green), 0 0 16px #3ddc9755; animation: breathe 2.6s ease-in-out infinite; }
@keyframes breathe { 50% { box-shadow: 0 0 0 2px var(--green), 0 0 4px #3ddc9722; } }
.cb-s { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.cb-b { display: flex; gap: 6px; margin-top: auto; }
.lock-note { margin-top: 12px; font-size: 12px; color: var(--dim); padding: 9px 12px; border-radius: 10px; background: #ffb5470d; border: 1px dashed #ffb54744; }
.book.click { cursor: pointer; transition: transform .15s, border-color .15s; }
.book.click:hover { transform: translateY(-2px); border-color: var(--line2); }

/* glow by state: on = green, retired = purple, off = grey */
.book.on, .cbot.on { border-color: #3ddc9770; box-shadow: 0 0 0 1px #3ddc9726, 0 0 22px #3ddc9726; }
.book.retired { border-color: #9b7bff55; box-shadow: 0 0 18px #9b7bff1f; opacity: .8; }
.book.off, .cbot.off { border-color: var(--line); filter: saturate(.55); }
.book.off:hover, .cbot.off:hover { filter: none; }
.warnbox { color: var(--amber); line-height: 1.7; }

/* ---------- bot detail ---------- */
.modal-box.wide { max-width: 1040px; width: calc(100vw - 32px); max-height: calc(100vh - 40px); text-align: left; padding: 0; display: flex; flex-direction: column; overflow: hidden; }
.det { display: flex; flex-direction: column; min-height: 0; flex: 1; }
.det-h { display: flex; gap: 14px; align-items: center; padding: 20px 22px 14px; }
.det-h .av.big { width: 58px; height: 58px; font-size: 30px; border-radius: 16px; }
.det-act { display: flex; gap: 6px; align-self: flex-start; }
.banner { margin: 0 22px; padding: 11px 14px; border-radius: 12px; font: 600 14px var(--head); background: var(--panel2); display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.banner span { font: 400 12px var(--sans); }
.banner.good { background: #3ddc9718; color: var(--green); }
.banner.warn { background: #ffb54718; color: var(--amber); }
.banner.info { background: #4de3ff14; color: var(--cyan); }
.banner.bad { background: #ff6b7a18; color: var(--red); }
.det-body { overflow-y: auto; padding: 14px 22px 22px; min-height: 0; }
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { padding: 12px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); }
.tile span { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--dim2); }
.tile b { display: block; font: 700 21px var(--head); margin: 2px 0; }
.tile small { color: var(--dim2); font-size: 11.5px; }
.tile.good b, .hb-l b.good { color: var(--green); }
.tile.bad b, .hb-l b.bad { color: var(--red); }
.tile.warn b, .hb-l b.warn { color: var(--amber); }
.tile.info b, .hb-l b.info { color: var(--cyan); }
.dgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.dsec { padding: 14px; border-radius: 13px; background: var(--bg2); border: 1px solid var(--line); min-width: 0; }
.dsec.cards, .dsec.chips, .dsec.chart, .dsec.notes { grid-column: 1 / -1; }
.notes p { display: flex; gap: 9px; margin: 0 0 8px; font-size: 13.5px; line-height: 1.5; }
.notes p span { flex: none; }
.notes p.good { color: var(--green); font-weight: 600; }
.chart-h { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.chart-h b { font: 700 20px var(--head); }
.chart-h span { font-size: 12px; }
svg.chart { width: 100%; height: auto; display: block; }
.dsec h3 { font-size: 14px; margin-bottom: 10px; }
.empty.sm { padding: 6px; font-size: 12.5px; text-align: left; }
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.pcard { padding: 11px 12px; border-radius: 11px; background: var(--panel); border: 1px solid var(--line); }
.pcard.good { border-color: #3ddc9755; }
.pcard.bad { border-color: #ff6b7a55; }
.pc-h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.pc-h .big { font: 700 18px var(--head); }
.pcard.good .big { color: var(--green); }
.pcard.bad .big { color: var(--red); }
.pc-l { font-size: 11.5px; color: var(--dim); margin-top: 6px; }
.cbar { position: relative; height: 6px; border-radius: 4px; background: var(--panel2); margin-top: 8px; }
.cbar::after { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--line2); }
.cbar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; background: var(--cyan); }
.cbar i.good { background: var(--green); }
.cbar i.bad { background: var(--red); }
.lrows { display: flex; flex-direction: column; gap: 4px; max-height: 340px; overflow-y: auto; }
.lrow { display: flex; align-items: center; gap: 9px; padding: 7px 9px; border-radius: 9px; background: var(--panel); font-size: 13px; }
.lrow .li { flex: none; width: 20px; text-align: center; }
.lrow .lt { flex: 1; min-width: 0; }
.lrow .lt b { font-weight: 600; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .lt small { display: block; color: var(--dim2); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lrow .t { font: 11px var(--mono); color: var(--dim2); flex: none; }
.lrow .lv { font: 600 12.5px var(--mono); flex: none; }
.lrow.good .lv { color: var(--green); }
.lrow.bad .lv { color: var(--red); }
.lrow.warn .lv { color: var(--amber); }
.lrow a, .pc-h a { color: inherit; text-decoration: none; }
.lrow a:hover, .pc-h a:hover { color: var(--cyan); text-decoration: underline; }
.hbar { margin-bottom: 11px; }
.hb-l { display: flex; justify-content: space-between; font-size: 12.5px; margin-bottom: 4px; }
.hb-l b { font: 600 12.5px var(--mono); }
.track { position: relative; height: 8px; border-radius: 5px; background: var(--panel2); }
.track i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--cyan); transition: width .5s; }
.track i.good { background: var(--green); }
.track i.bad { background: var(--red); }
.track i.warn { background: var(--amber); }
.track i.dim { background: var(--dim2); }
.track em { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--gold); border-radius: 2px; }
.hbar small { font-size: 10.5px; }
.chipz { display: flex; flex-wrap: wrap; gap: 6px; }
.chipz span { padding: 4px 10px; border-radius: 99px; background: var(--panel); border: 1px solid var(--line); font: 12px var(--mono); }
.chipz span.good { border-color: #3ddc9755; color: var(--green); }
.chipz span.bad { border-color: #ff6b7a55; color: var(--red); }
.lastw { margin: 0; padding: 10px; border-radius: 9px; background: #05060a; font: 11.5px/1.5 var(--mono); color: var(--dim); white-space: pre-wrap; max-height: 220px; overflow: auto; }
@media (max-width: 760px) {
  .dgrid { grid-template-columns: 1fr; }
  .det-h { flex-wrap: wrap; }
  .chips .dayb { display: none; }
  .tiles { grid-template-columns: 1fr 1fr; }
  .det-h, .det-body { padding-left: 14px; padding-right: 14px; }
  .banner { margin: 0 14px; }
}

/* ---------- free web version: locks, guest, new pages ---------- */
.hidden { display: none !important; }
.chip.guest { border-color: #9b7bff66; color: var(--violet); }
.pw.lockd, .dayb.lockd { background: var(--panel2); border: 1px dashed #9b7bff66; color: var(--violet); box-shadow: none; filter: none; }
.pw.lockd:hover, .dayb.lockd:hover { background: #9b7bff1c; }
.lockpop { padding: 6px 4px; max-width: 340px; }
.lp-ic { position: relative; width: 74px; height: 74px; margin: 0 auto 12px; border-radius: 20px; display: grid; place-items: center; font-size: 36px;
  background: linear-gradient(135deg, #9b7bff33, #4de3ff22); box-shadow: 0 0 30px #9b7bff33; animation: lpwob 2.4s ease-in-out infinite; }
.lp-ic span { position: absolute; right: -8px; bottom: -8px; font-size: 22px; }
@keyframes lpwob { 50% { transform: rotate(-4deg) scale(1.04); } }
.soon { position: relative; border-style: dashed; }
.soon-badge { position: absolute; top: 14px; right: 16px; font: 700 11px var(--head); letter-spacing: .06em; padding: 4px 10px; border-radius: 99px; background: #ffd16622; color: var(--gold); }
.dials { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; margin-top: 14px; }
.dial { padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; opacity: .85; }
.dial span { font-size: 20px; }
.dial small { color: var(--dim2); font-size: 11.5px; line-height: 1.35; }
.fake-slider { height: 6px; border-radius: 4px; background: var(--panel2); margin-top: 8px; position: relative; }
.fake-slider i { position: absolute; left: 0; top: 0; bottom: 0; width: 55%; border-radius: 4px; background: linear-gradient(90deg, var(--cyan), var(--violet)); }
.fake-slider i::after { content: ""; position: absolute; right: -6px; top: -4px; width: 14px; height: 14px; border-radius: 50%; background: #fff; }
.lb { display: flex; flex-direction: column; gap: 6px; }
.lb-row { display: flex; align-items: center; gap: 12px; padding: 11px 14px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); cursor: pointer; transition: transform .15s, border-color .15s; }
.lb-row:hover { transform: translateX(3px); border-color: var(--line2); }
.lb-row.retired { opacity: .7; }
.lb-rank { font: 700 18px var(--head); width: 36px; text-align: center; }
.lb-name { flex: 1; min-width: 0; }
.lb-name b { display: block; }
.lb-name small { color: var(--dim2); font-size: 11.5px; }
.lb-score { font: 700 16px var(--mono); }

/* ---------- arena: my bots, strategy lab, sign-up, admin ---------- */
button.chip.guest { cursor: pointer; font: inherit; font-size: 12px; }
.cbot.newbot { align-items: center; justify-content: center; text-align: center; border-style: dashed; gap: 4px; min-height: 150px; color: var(--dim); }
.cbot.newbot span { font-size: 28px; color: var(--cyan); }
.cbot.newbot:hover { border-color: var(--cyan); color: var(--ink); }
.cbot.newbot.full { cursor: default; }
.cbot.newbot small { font-size: 11.5px; color: var(--dim2); }
.ub-pnl { margin-left: auto; font: 700 15px var(--mono); }
.lab { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 16px; align-items: start; }
.lab-side { position: sticky; top: 84px; }
.presets { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 8px; }
.preset { text-align: left; padding: 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; }
.preset small { color: var(--dim2); font-size: 11.5px; line-height: 1.35; }
.preset.on { border-color: var(--cyan); box-shadow: 0 0 0 1px #4de3ff44, 0 0 18px #4de3ff22; }
h3.dg { font-size: 13px; color: var(--dim); margin: 14px 0 8px; }
.dialz { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px; }
.dialx { padding: 11px 12px; border-radius: 12px; background: var(--bg2); border: 1px solid var(--line); display: flex; flex-direction: column; gap: 6px; }
.dx-h { display: flex; justify-content: space-between; gap: 8px; font-size: 13px; }
.dx-h b { font: 600 12.5px var(--mono); color: var(--cyan); white-space: nowrap; }
.dialx small { color: var(--dim2); font-size: 11px; line-height: 1.35; }
.dialx input[type=range] { width: 100%; accent-color: var(--violet); cursor: pointer; }
.avs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.avb { width: 38px; height: 38px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line); font-size: 20px; }
.avb.on { border-color: var(--cyan); box-shadow: 0 0 12px #4de3ff44; }
.namein { width: 100%; padding: 10px 12px; border-radius: 10px; background: var(--bg2); border: 1px solid var(--line2); color: var(--ink); font: inherit; }
.namein:focus { outline: none; border-color: var(--cyan); }
.dayb.launch { width: 100%; margin: 12px 0 0; }
.lockpop.signup { max-width: 380px; }
.perks { list-style: none; padding: 0; margin: 10px 0 14px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; text-align: left; font-size: 12.5px; }
.perks li { padding: 6px 9px; border-radius: 9px; background: var(--bg2); }
.lockpop .btn.ghost { margin-left: 6px; }
.lb-av { font-size: 22px; width: 30px; text-align: center; }
.lb-row.me { border-color: #4de3ff66; box-shadow: 0 0 16px #4de3ff1f; }
.you { font: 700 9.5px var(--head); letter-spacing: .08em; padding: 2px 6px; border-radius: 5px; background: var(--cyan); color: #0b0d14; vertical-align: middle; }
.ins { display: grid; grid-template-columns: 1.4fr 1fr auto auto; gap: 10px; align-items: center; padding: 8px 10px; border-radius: 10px; background: var(--bg2); margin-bottom: 5px; font-size: 12.5px; }
.ins b { font: 600 12px var(--mono); }
.setz { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 4px; }
.setx { display: flex; flex-direction: column; gap: 3px; font-size: 11.5px; color: var(--dim); }
.setx input { padding: 7px 9px; border-radius: 8px; background: var(--bg2); border: 1px solid var(--line2); color: var(--ink); font: 13px var(--mono); }
@media (max-width: 1000px) { .lab { grid-template-columns: 1fr; } .lab-side { position: static; } }
@media (max-width: 600px) { .setz, .perks { grid-template-columns: 1fr; } .ins { grid-template-columns: 1fr 1fr; } }

/* ---------- energy ⚡ + live pill ---------- */
.livepill { border-color: #ff6b7a66; color: #ff8a96; font-weight: 700; letter-spacing: .04em; animation: livep 2s ease-in-out infinite; }
.livepill.delayed { border-color: #ffb54766; color: var(--amber); animation: none; }
@keyframes livep { 50% { box-shadow: 0 0 12px #ff6b7a55; } }
.chip.energy { display: inline-flex; align-items: center; gap: 6px; border-color: #ffd16655; color: var(--gold); }
.chip.energy b { font: 700 12px var(--mono); min-width: 28px; }
.enbar { width: 56px; height: 6px; border-radius: 4px; background: var(--panel2); overflow: hidden; display: inline-block; position: relative; }
.enbar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--gold), #ffe9a8); border-radius: 4px; transition: width .6s; }
.chip.energy.low { animation: livep 1.2s ease-in-out infinite; }
.chip.energy.empty { color: var(--dim2); border-color: var(--line); }
.chip.energy.empty .enbar i { background: var(--dim2); }
.delaynote { padding: 9px 14px; border-radius: 11px; background: #ffb54714; border: 1px dashed #ffb54766; color: var(--amber); font-size: 13px; margin-bottom: 14px; }
.delaynote a { color: var(--gold); font-weight: 600; }

.side .legal { margin-top: auto; padding: 14px 10px 4px; font-size: 10.5px; line-height: 1.6; color: var(--dim2); }
.side .legal a { color: var(--dim); }
.lockpop a { color: var(--cyan); }

/* ---------- neural brain v3 ---------- */
.mind-hud { pointer-events: auto; align-items: flex-start; }
.mind-search { position: relative; width: 250px; }
.mind-search input { width: 100%; padding: 10px 12px; border-radius: 12px; background: #0b0e17cc; border: 1px solid var(--line); color: var(--ink); font: 13px var(--sans); backdrop-filter: blur(6px); }
.mind-search input:focus { outline: none; border-color: var(--cyan); }
.ms-res { position: absolute; top: calc(100% + 4px); left: 0; right: 0; display: flex; flex-direction: column; border-radius: 12px; overflow: hidden; background: #0b0e17f2; border: 1px solid var(--line); z-index: 3; }
.ms-res:empty { display: none; }
.ms-res button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; font-size: 13px; text-align: left; }
.ms-res button:hover { background: var(--panel2); }
.ms-res i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.ms-res small { margin-left: auto; color: var(--dim2); font-size: 11px; }
.mind-think { position: absolute; top: 74px; left: 14px; max-width: 520px; display: flex; align-items: center; gap: 8px; padding: 7px 12px; border-radius: 99px; background: #0b0e17cc; border: 1px solid var(--line); font-size: 12px; color: var(--dim); backdrop-filter: blur(6px); pointer-events: none; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mind-think b { color: var(--cyan); font-weight: 600; margin-right: 4px; }
.mt-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 10px var(--cyan); flex: none; }
.mind-think.blip { animation: mthink .9s ease-out; }
.mind-think.blip .mt-dot { animation: mdot .9s ease-out; }
@keyframes mthink { from { border-color: var(--cyan); box-shadow: 0 0 18px #4de3ff44; } }
@keyframes mdot { 30% { transform: scale(1.8); } }
.mind-zoom { position: absolute; right: 14px; bottom: 76px; display: flex; flex-direction: column; gap: 4px; }
.mind-zoom button { width: 34px; height: 34px; border-radius: 10px; background: #0b0e17cc; border: 1px solid var(--line); font-size: 16px; backdrop-filter: blur(6px); }
.mind-zoom button:hover { border-color: var(--cyan); color: var(--cyan); }
.mind-tip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 8px 11px; border-radius: 11px; background: #0b0e17ee; border: 1px solid var(--line2); box-shadow: 0 8px 24px #0008; display: flex; flex-direction: column; gap: 1px; max-width: 220px; font-size: 12px; opacity: 0; transition: opacity .12s; }
.mind-tip.on { opacity: 1; }
.mind-tip b { font: 600 13.5px var(--head); }
.mind-tip span { color: var(--dim); }
.mind-tip small { color: var(--dim2); font-size: 11px; }
.mi-n button { font-size: 11px; padding: 2px 7px; border-radius: 6px; background: var(--panel2); color: var(--dim); }
.mi-n button:hover { color: var(--ink); background: var(--line2); }
.mind-time .btn.sm { margin: 0; }
@media (max-width: 900px) { .mind-search { width: 170px; } .mind-think { display: none; } }
@media (max-width: 720px) { .mind-hud .mind-stat:nth-child(n+2) { display: none; } .mind-zoom { bottom: 120px; } }

/* ---------- K3 chart ---------- */
.kchart { position: relative; }
.kc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 6px; flex-wrap: wrap; }
.kc-head b { font: 700 24px var(--head); margin-right: 8px; }
.kc-chg { font: 600 12.5px var(--mono); padding: 3px 8px; border-radius: 7px; }
.kc-chg.up { background: #3ddc9722; color: var(--green); }
.kc-chg.down { background: #ff6b7a22; color: var(--red); }
.kc-head small { display: block; color: var(--dim2); font-size: 11.5px; margin-top: 3px; }
.kc-tabs { display: flex; gap: 3px; padding: 3px; border-radius: 10px; background: var(--panel); border: 1px solid var(--line); }
.kc-tabs button { padding: 4px 10px; border-radius: 7px; font: 600 11.5px var(--sans); color: var(--dim); }
.kc-tabs button.on { background: var(--panel2); color: var(--ink); }
.kc-svg { width: 100%; height: auto; display: block; cursor: crosshair; }
.kc-grid { stroke: #ffffff0d; }
.kc-base { stroke: #ffffff30; stroke-dasharray: 4 5; }
.kc-ylab { fill: var(--dim2); font: 10.5px var(--mono); }
.kc-start { fill: var(--dim); }
.kc-xlab { fill: var(--dim2); font: 10.5px var(--sans); }
.kc-dot { stroke: #0b0d14; stroke-width: 1.5; }
.kc-live { animation: kclive 1.6s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
@keyframes kclive { 50% { opacity: .45; transform: scale(1.5); } }
.kc-cross { display: none; pointer-events: none; }
.kc-vx, .kc-hy { stroke: #ffffff55; stroke-dasharray: 3 4; }
.kc-pt { stroke: #fff; stroke-width: 2; }
.kc-yval { fill: #0b0d14; font: 700 10.5px var(--mono); }
.kc-tip { position: absolute; left: 0; top: 0; min-width: 170px; padding: 9px 12px; border-radius: 11px; background: #0b0e17f0; border: 1px solid var(--line2); box-shadow: 0 10px 28px #000a;
  display: flex; flex-direction: column; gap: 2px; font-size: 12px; pointer-events: none; opacity: 0; transition: opacity .1s; }
.kc-tip.on { opacity: 1; }
.kc-tip b { font: 700 15px var(--head); }
.kc-trade { margin: 4px 0 2px; padding: 5px 7px; border-radius: 8px; background: var(--panel2); display: flex; flex-direction: column; }
.kc-trade small { color: var(--dim); font-size: 11px; }

/* brain boot + ticker spacing */
.mind-think { top: 88px; }
.mind-boot { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px;
  background: radial-gradient(600px 400px at 50% 50%, #1a2040, #0b0d16 70%); transition: opacity .8s ease, transform .9s ease; }
.mind-boot.gone { opacity: 0; transform: scale(1.15); pointer-events: none; }
.mind-boot b { font: 700 18px var(--head); letter-spacing: .02em; }
.mind-boot span { color: var(--dim); font-size: 12.5px; font-family: var(--mono); }
.mb-core { position: relative; width: 120px; height: 120px; margin-bottom: 8px; }
.mb-core::before { content: ""; position: absolute; inset: 42px; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff, #ffd166 30%, #8a6a1f);
  box-shadow: 0 0 30px #ffd166aa; animation: mbcore 1.4s ease-in-out infinite; }
.mb-core i { position: absolute; inset: 0; border-radius: 50%; border: 2px solid #4de3ff; opacity: 0; animation: mbring 2.1s ease-out infinite; }
.mb-core i:nth-child(2) { animation-delay: .7s; border-color: #9b7bff; }
.mb-core i:nth-child(3) { animation-delay: 1.4s; border-color: #3ddc97; }
@keyframes mbcore { 50% { transform: scale(1.18); box-shadow: 0 0 50px #ffd166; } }
@keyframes mbring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(1.2); opacity: 0; } }

/* ---------- HQ extras ---------- */
.hq-duo { display: grid; grid-template-columns: 1fr; gap: 16px; }
.hq-mini { padding-bottom: 10px; }
.mini-mind { position: relative; height: 230px; border-radius: 12px; overflow: hidden; background: radial-gradient(400px 220px at 50% 50%, #151b33, #0b0d16 75%); cursor: pointer; }
.mini-mind canvas { position: absolute; inset: 0; }
.hq-duo h2 small a { color: var(--cyan); text-decoration: none; }
#tk-chart .kc-head b { font-size: 20px; }
.today .td-bars { display: flex; align-items: flex-end; gap: 2px; height: 70px; }
.td-b { flex: 1; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; gap: 1px; min-width: 2px; }
.td-b i { display: block; border-radius: 2px; }
.td-b .th { background: #4de3ff55; }
.td-b .tr { background: var(--green); box-shadow: 0 0 6px #3ddc9777; }
.td-b:last-child .th { background: var(--cyan); animation: livep 2s infinite; }
.td-axis { display: flex; justify-content: space-between; font: 10.5px var(--mono); color: var(--dim2); margin-top: 4px; }
button.chip#chip-sound { cursor: pointer; font-size: 13px; }
@media (max-width: 1250px) { .hq-duo { grid-template-columns: 1fr; } }
/* sparklines */
.cb-spark { width: 100%; height: 30px; display: block; }
.cb-spark rect { fill: #4de3ff66; }
.cb-spark .l { fill: none; stroke-width: 1.8; vector-effect: non-scaling-stroke; }
.cb-spark.up .l { stroke: var(--green); } .cb-spark.up .a { fill: #3ddc9722; }
.cb-spark.down .l { stroke: var(--red); } .cb-spark.down .a { fill: #ff6b7a1f; }
/* trade toasts */
.toast.buy { border-color: #4de3ff77; } .toast.buy b { color: var(--cyan); }
.toast.win { box-shadow: 0 0 22px #3ddc9744; }
.toast.loss { border-color: #ff6b7a66; }
/* podium */
.podium { display: flex; justify-content: center; align-items: flex-end; gap: 14px; margin: 4px 0 18px; }
.pod { width: 170px; display: flex; flex-direction: column; align-items: center; gap: 2px; text-align: center; animation: podup .7s cubic-bezier(.2,1.4,.4,1) both; }
.pod-av { font-size: 34px; width: 64px; height: 64px; border-radius: 18px; display: grid; place-items: center; background: var(--panel2); margin-bottom: 4px; }
.pod b { font: 600 14px var(--head); } .pod small { color: var(--dim2); font-size: 11px; } .pod span { font: 700 14px var(--mono); }
.pod-step { width: 100%; margin-top: 8px; border-radius: 12px 12px 4px 4px; display: grid; place-items: center; font-size: 28px; }
.pod.p1 .pod-step { height: 96px; background: linear-gradient(180deg, #ffd16655, #ffd16612); border: 1px solid #ffd16677; }
.pod.p2 .pod-step { height: 70px; background: linear-gradient(180deg, #d9e2f055, #d9e2f010); border: 1px solid #d9e2f055; }
.pod.p3 .pod-step { height: 52px; background: linear-gradient(180deg, #e0995155, #e0995110); border: 1px solid #e0995166; }
.pod.p1 .pod-av { box-shadow: 0 0 0 2px #ffd166, 0 0 24px #ffd16688; animation: breatheG 2.4s ease-in-out infinite; }
@keyframes breatheG { 50% { box-shadow: 0 0 0 2px #ffd166, 0 0 8px #ffd16633; } }
@keyframes podup { from { opacity: 0; transform: translateY(40px) scale(.9); } }
.mv { font: 700 10.5px var(--mono); width: 34px; text-align: center; color: var(--dim2); }
.mv.up { color: var(--green); } .mv.down { color: var(--red); } .mv.new { color: var(--violet); font-size: 9.5px; }
/* simulate */
#simres { margin-top: 10px; }
.sim-sum { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; margin-bottom: 8px; }
.sim-sum div { padding: 8px; border-radius: 10px; background: var(--bg2); font-size: 11px; color: var(--dim2); text-align: center; }
.sim-sum b { display: block; font: 700 17px var(--head); color: var(--ink); }
.sim-list { max-height: 260px; }
@media (max-width: 600px) { .pod { width: 31%; } .pod-av { width: 48px; height: 48px; font-size: 26px; } }

.ub-pnl small { display: block; font: 600 11px var(--mono); text-align: right; opacity: .8; }
.kc-tip b small { font: 500 11px var(--sans); }

/* HQ: feed fills whatever height the left column sets */
.g-hq > .stack:last-child .feed { max-height: 600px; transition: max-height .3s; }

/* ---------- animated nav icons (living line art instead of emojis) ---------- */
.side button span.ni { width: 22px; height: 22px; display: grid; place-items: center; font-size: 0; }
.ni svg { width: 21px; height: 21px; overflow: visible; }
.side button.on .ni, .side button:hover .ni { color: var(--cyan); filter: drop-shadow(0 0 5px #4de3ff88); }
.ni .draw, .ni .flow, .ni .beat { stroke-dasharray: 80; stroke-dashoffset: 0; }
body:not(.booted) .ni .draw { stroke-dashoffset: 80; }
body.booted:not(.fast) .ni .draw { animation: nidraw 1.1s ease-out both; }
body.booted:not(.fast) .side button:nth-child(2) .ni * { animation-delay: .06s; } body.booted:not(.fast) .side button:nth-child(3) .ni * { animation-delay: .12s; }
body.booted:not(.fast) .side button:nth-child(4) .ni * { animation-delay: .18s; } body.booted:not(.fast) .side button:nth-child(5) .ni * { animation-delay: .24s; }
body.booted:not(.fast) .side button:nth-child(6) .ni * { animation-delay: .3s; } body.booted:not(.fast) .side button:nth-child(7) .ni * { animation-delay: .36s; }
body.booted:not(.fast) .side button:nth-child(8) .ni * { animation-delay: .42s; } body.booted:not(.fast) .side button:nth-child(9) .ni * { animation-delay: .48s; }
@keyframes nidraw { from { stroke-dashoffset: 80; } to { stroke-dashoffset: 0; } }
/* each icon has a small life of its own when it's the page you're on (or hovered) */
.ni .sweep, .ni .orbit, .ni .gear, .ni .blink, .ni .bub, .ni .spark, .ni .ping, .ni .scroll { transform-box: view-box; transform-origin: 12px 12px; }
.side button.on .ni-hq .sweep, .side button:hover .ni-hq .sweep { transform-origin: 12px 16.5px; animation: nisweep 2.4s linear infinite; }
@keyframes nisweep { to { transform: rotate(360deg); } }
.side button.on .ni-bots .blink, .side button:hover .ni-bots .blink { transform-origin: 12px 12.8px; animation: niblink 3.2s infinite; }
@keyframes niblink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.ni .ping { animation: niping 2s ease-in-out infinite; }
@keyframes niping { 50% { opacity: .35; } }
.side button.on .ni-lab .bub, .side button:hover .ni-lab .bub { animation: nibub 1.6s ease-in infinite; }
.side button.on .ni-lab .b2, .side button:hover .ni-lab .b2 { animation-delay: .7s; }
@keyframes nibub { from { transform: translateY(0); opacity: 1; } to { transform: translateY(-7px); opacity: 0; } }
.ni .spark { opacity: 0; }
.side button.on .ni-board .spark, .side button:hover .ni-board .spark, .side button.on .ni-quests .spark, .side button:hover .ni-quests .spark { animation: nispark 1.8s ease-in-out infinite; }
@keyframes nispark { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1.15); } }
.side button.on .ni-mind .orbit, .side button:hover .ni-mind .orbit { animation: nisweep 3.4s linear infinite; }
.side button.on .ni-mind .o2, .side button:hover .ni-mind .o2 { animation-duration: 5s; animation-direction: reverse; }
.side button.on .ni-brain .flow, .side button:hover .ni-brain .flow { stroke-dasharray: 3 3; animation: niflow .8s linear infinite; }
@keyframes niflow { to { stroke-dashoffset: -6; } }
.side button.on .ni-pulse .beat, .side button:hover .ni-pulse .beat { stroke-dasharray: 34 60; animation: nibeat 1.4s linear infinite; }
@keyframes nibeat { from { stroke-dashoffset: 94; } to { stroke-dashoffset: 0; } }
.side button.on .ni-log .scroll, .side button:hover .ni-log .scroll { animation: niscroll 1.8s ease-in-out infinite; }
@keyframes niscroll { 50% { transform: translateY(-1.6px); } }
.side button.on .ni-admin .gear, .side button:hover .ni-admin .gear { animation: nisweep 6s linear infinite; }

/* ---------- boot screen ---------- */
.boot { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; background: radial-gradient(800px 500px at 50% 45%, #141a33, #07080d 72%);
  transition: opacity .7s ease, transform .8s ease, filter .8s ease; }
.boot.out { opacity: 0; transform: scale(1.06); filter: blur(6px); pointer-events: none; }
.boot-core { width: min(440px, 88vw); display: flex; flex-direction: column; align-items: center; gap: 18px; }
.boot-logo { width: 104px; height: 104px; filter: drop-shadow(0 0 22px #4de3ff55); }
.boot-logo .bl-frame { stroke-dasharray: 400; stroke-dashoffset: 400; animation: bldraw 1s ease-out forwards; }
.boot-logo .bl-k { stroke-dasharray: 160; stroke-dashoffset: 160; animation: bldraw .8s .35s ease-out forwards; }
.boot-logo .bl-3 { stroke-dasharray: 120; stroke-dashoffset: 120; animation: bldraw .8s .6s ease-out forwards; }
@keyframes bldraw { to { stroke-dashoffset: 0; } }
.boot-term { width: 100%; min-height: 128px; font: 12.5px/1.75 var(--mono); color: var(--dim); }
.bt-row { display: flex; gap: 9px; animation: btin .25s ease-out; }
.bt-p { color: var(--green); width: 12px; }
.bt-row:first-child .bt-p { color: var(--cyan); }
.bt-row b { color: var(--ink); font-weight: 600; }
.bt-row:last-child .bt-t::after { content: "▍"; color: var(--cyan); animation: btcur .8s steps(1) infinite; margin-left: 2px; }
@keyframes btcur { 50% { opacity: 0; } }
@keyframes btin { from { opacity: 0; transform: translateX(-6px); } }
.boot-bar { width: 100%; height: 3px; border-radius: 3px; background: #ffffff12; overflow: hidden; }
.boot-bar i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--cyan), var(--violet)); box-shadow: 0 0 12px var(--cyan); transition: width .35s ease; }
/* the desk slides in behind the boot screen */
body.booted:not(.fast) .top { animation: deskin .7s ease-out both; }
body.booted:not(.fast) .side { animation: deskside .7s .05s ease-out both; }
body.booted:not(.fast) main { animation: deskin .8s .12s ease-out both; }
@keyframes deskin { from { opacity: 0; transform: translateY(-10px); } }
@keyframes deskside { from { opacity: 0; transform: translateX(-16px); } }

@media (max-width: 720px) { .side .legal { display: none; } }

/* ---------- nav icons: always alive, each its own colour ---------- */
.ni-hq { --ic: #4de3ff; } .ni-bots { --ic: #3ddc97; } .ni-lab { --ic: #7cf2c9; } .ni-board { --ic: #ffd166; } .ni-quests { --ic: #ff9f43; }
.ni-mind { --ic: #9b7bff; } .ni-brain { --ic: #ff7ac6; } .ni-pulse { --ic: #ff6b7a; } .ni-log { --ic: #9fb3d9; } .ni-admin { --ic: #c38bff; }
.side button .ni { color: var(--ic); opacity: .82; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ic) 45%, transparent)); transition: opacity .2s, filter .2s, transform .2s; }
.side button:hover .ni, .side button.on .ni { color: var(--ic); opacity: 1; filter: drop-shadow(0 0 7px var(--ic)); transform: scale(1.08); }
.side button.on { box-shadow: inset 2px 0 0 var(--cyan); }
.ni-hq .sweep { transform-origin: 12px 16.5px; animation: nisweep 2.8s linear infinite; }
.ni-bots .blink { transform-origin: 12px 12.8px; animation: niblink 3.4s infinite; }
.ni-lab .bub { animation: nibub 1.8s ease-in infinite; } .ni-lab .b2 { animation-delay: .8s; }
.ni-board .spark { animation: nispark 2.2s ease-in-out infinite; }
.ni-quests .spark { animation: nispark 2.6s .6s ease-in-out infinite; }
.ni-mind .orbit { animation: nisweep 3.6s linear infinite; } .ni-mind .o2 { animation-duration: 5.2s; animation-direction: reverse; }
.ni-brain .flow { stroke-dasharray: 3 3; animation: niflow 1s linear infinite; }
.ni-pulse .beat { stroke-dasharray: 34 60; animation: nibeat 1.6s linear infinite; }
.ni-log .scroll { animation: niscroll 2s ease-in-out infinite; }
.ni-admin .gear { animation: nisweep 7s linear infinite; }
@media (prefers-reduced-motion: reduce) { .ni * { animation: none !important; } }
