:root {
  --bg: #04060c;
  --bg-2: #080c16;
  --panel: rgba(12, 18, 32, .72);
  --line: rgba(125, 249, 255, .12);
  --line-2: rgba(125, 249, 255, .24);
  --ice: #7df9ff;
  --ice-dim: #4fb8c4;
  --text: #dff7fb;
  --mute: #7d97a6;
  --mute-2: #4f6573;
  --amber: #ffb547;
  --coral: #ff5d73;
  --violet: #b7a6ff;
  --gold: #ffd36b;
  --ok: #6cf0b8;
  --head: "Chakra Petch", "Eurostile", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
  --pad: clamp(12px, 2vw, 22px);
}
[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text); font: 13px/1.5 var(--mono); overflow-x: clip;
  background-image: radial-gradient(90% 60% at 50% 0%, rgba(40, 90, 120, .18), transparent 60%), radial-gradient(60% 50% at 50% 100%, rgba(255, 93, 115, .05), transparent 70%);
  -webkit-font-smoothing: antialiased;
}
body::after { /* scanlines */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 50;
  background: repeating-linear-gradient(0deg, rgba(255,255,255,.018) 0 1px, transparent 1px 3px);
  mix-blend-mode: screen;
}
a { color: var(--ice); }
button { font: inherit; color: inherit; }
.k { font: 500 10px/1.2 var(--mono); letter-spacing: .18em; color: var(--mute); }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }

.brandbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 7px var(--pad); border-bottom: 1px solid var(--line); background: linear-gradient(90deg, rgba(255,181,71,.12), transparent 60%); font: 12px var(--mono); }
.bb-k { color: var(--amber); letter-spacing: .2em; }
.brandbar code { flex: 1 1 260px; min-width: 0; word-break: break-all; color: var(--text); }
.brandbar button, .brandbar a { border: 1px solid var(--line-2); background: none; padding: 3px 10px; cursor: pointer; text-decoration: none; font: 11px var(--mono); letter-spacing: .1em; color: var(--text); clip-path: polygon(6px 0, 100% 0, 100% calc(100% - 6px), calc(100% - 6px) 100%, 0 100%, 0 6px); }
.brandbar button:hover, .brandbar a:hover { border-color: var(--amber); color: var(--amber); }

.top { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px var(--pad) 10px; flex-wrap: wrap; }
.logo { display: flex; align-items: center; gap: 12px; color: var(--ice); min-width: 0; }
.logo svg { width: 38px; height: 38px; flex: none; filter: drop-shadow(0 0 8px rgba(125,249,255,.4)); }
.logo h1 { margin: 0; font: 700 24px/1 var(--head); letter-spacing: .08em; text-transform: uppercase; color: var(--text); }
.logo p { margin: 3px 0 0; font: 12px var(--mono); color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.status { display: flex; gap: 8px; flex-wrap: wrap; }
.st { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border: 1px solid var(--line); background: var(--panel); font: 11px var(--mono); letter-spacing: .08em; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); }
.st b { font-weight: 500; color: var(--text); }
.led { width: 8px; height: 8px; border-radius: 50%; background: var(--mute-2); box-shadow: 0 0 0 0 transparent; }
.led.live { background: var(--ok); box-shadow: 0 0 10px var(--ok); animation: blink 1.6s steps(2, end) infinite; }
.led.warn { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
@keyframes blink { 50% { opacity: .35; } }

/* ---------- deck ---------- */
.deck {
  position: relative; display: grid; gap: var(--pad); padding: 0 var(--pad) var(--pad);
  grid-template-columns: 250px minmax(0, 1fr) 360px; align-items: start;
}
.hud, .log { background: var(--panel); border: 1px solid var(--line); padding: 14px; backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.hud { display: flex; flex-direction: column; gap: 14px; }
.read { display: flex; flex-direction: column; gap: 4px; }
.read b { font: 600 34px/1 var(--head); color: var(--ice); letter-spacing: .02em; text-shadow: 0 0 18px rgba(125,249,255,.35); font-variant-numeric: tabular-nums; }
.read.sm b { font-size: 20px; text-shadow: none; color: var(--text); }
#spark { width: 100%; height: 44px; display: block; margin-top: 6px; }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 10px; padding-top: 12px; border-top: 1px solid var(--line); }
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 12px; border-top: 1px solid var(--line); }
.filters .k { width: 100%; }
.filters button { border: 1px solid var(--line-2); background: transparent; padding: 5px 9px; cursor: pointer; font: 11px var(--mono); color: var(--mute); }
.filters button:hover { color: var(--text); border-color: var(--ice-dim); }
.filters button.on { color: var(--bg); background: var(--ice); border-color: var(--ice); }
.legend { padding-top: 12px; border-top: 1px solid var(--line); }
.legend ul { list-style: none; margin: 8px 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; font-size: 11.5px; color: var(--mute); }
.legend li { display: flex; align-items: center; gap: 8px; }
.legend p { margin: 0 0 8px; font-size: 11px; line-height: 1.55; color: var(--mute); }
.legend .lf { color: var(--amber); font-weight: 500; }
.legend .ln { color: var(--violet); font-weight: 500; }
.dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; flex: none; }
.c0 { background: var(--ice); box-shadow: 0 0 8px var(--ice); }
.cn { background: var(--violet); box-shadow: 0 0 8px var(--violet); }
.c1 { background: var(--amber); box-shadow: 0 0 8px var(--amber); }
.c2 { background: var(--coral); box-shadow: 0 0 8px var(--coral); }
.cu { border: 1.5px solid var(--mute); }
.cg { background: var(--gold); transform: rotate(45deg); border-radius: 1px; box-shadow: 0 0 8px var(--gold); }

/* ---------- scope ---------- */
.scope-wrap { display: flex; justify-content: center; min-width: 0; }
.scope { position: relative; width: min(100%, calc(100svh - 120px)); aspect-ratio: 1; max-width: 920px; min-width: 0; }
#radar { position: absolute; inset: 0; width: 100%; height: 100%; display: block; cursor: crosshair; touch-action: manipulation; }
.scope-tip { position: absolute; left: 0; top: 0; pointer-events: none; padding: 8px 10px; background: rgba(4,6,12,.92); border: 1px solid var(--line-2); font: 11.5px/1.45 var(--mono); white-space: nowrap; z-index: 3; }
.scope-tip b { font: 600 14px var(--head); letter-spacing: .04em; }
.scope-empty { position: absolute; left: 50%; top: 62%; transform: translateX(-50%); font: 12px var(--mono); letter-spacing: .16em; color: var(--mute); text-transform: uppercase; }
.toasts { position: absolute; left: 2%; top: 2%; display: flex; flex-direction: column; gap: 6px; z-index: 4; max-width: 70%; }
.toast { border: 1px solid rgba(255,211,107,.6); background: rgba(20,16,4,.88); color: var(--gold); font: 600 12px var(--head); letter-spacing: .14em; padding: 7px 12px; cursor: pointer; text-align: left; animation: slide .3s ease-out; box-shadow: 0 0 24px rgba(255,211,107,.18); }
.row:focus-visible { outline: 1px solid var(--ice); outline-offset: -1px; }
.pause { position: absolute; right: 2%; bottom: 2%; width: 36px; height: 36px; border: 1px solid var(--line-2); background: var(--panel); cursor: pointer; font-size: 11px; color: var(--mute); }
.pause[aria-pressed="true"] { color: var(--amber); border-color: var(--amber); }

/* ---------- log ---------- */
.log { display: flex; flex-direction: column; max-height: calc(100svh - 110px); min-height: 380px; }
.log-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.log h2 { margin: 0; font: 600 15px var(--head); letter-spacing: .14em; text-transform: uppercase; }
.log input { width: 50%; min-width: 0; background: rgba(4,6,12,.6); border: 1px solid var(--line-2); color: var(--text); font: 11.5px var(--mono); padding: 6px 8px; outline: none; }
.log input:focus { border-color: var(--ice); }
.rows { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; min-height: 0; scrollbar-width: thin; scrollbar-color: var(--line-2) transparent; }
.row { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 2px 10px; align-items: center; padding: 8px 6px; border-bottom: 1px solid rgba(125,249,255,.06); cursor: pointer; transition: background .15s; }
.row:hover, .row.sel { background: rgba(125,249,255,.06); }
.row.sel { box-shadow: inset 2px 0 0 var(--ice); }
.row.fresh { animation: fresh 1.6s ease-out; }
@keyframes fresh { from { background: rgba(125,249,255,.18); } to { background: transparent; } }
.row .age { font: 11px var(--mono); color: var(--mute); text-align: right; font-variant-numeric: tabular-nums; }
.row .id { min-width: 0; }
.row .sym { font: 600 14px/1.1 var(--head); letter-spacing: .03em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row .nm { font-size: 11px; color: var(--mute); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.row .pips { display: flex; gap: 4px; align-items: center; justify-content: flex-end; }
.pip { min-width: 18px; padding: 1px 5px; font: 600 10px/1.5 var(--mono); text-align: center; border: 1px solid; }
.pip.f { color: var(--coral); border-color: rgba(255,93,115,.5); }
.pip.f1 { color: var(--amber); border-color: rgba(255,181,71,.5); }
.pip.o { color: var(--violet); border-color: rgba(183,166,255,.45); }
.pip.u { color: var(--mute); border-color: var(--line-2); }
.pip.g { color: var(--bg); background: var(--gold); border-color: var(--gold); }
.row .bar { grid-column: 2 / -1; height: 3px; background: rgba(125,249,255,.08); position: relative; overflow: hidden; }
.row .bar i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--ice-dim), var(--ice)); }
.row.dim { opacity: .35; }
.rows .empty { padding: 30px 8px; text-align: center; color: var(--mute); letter-spacing: .12em; font-size: 11px; text-transform: uppercase; }

/* ---------- dossier ---------- */
.dossier {
  position: absolute; right: var(--pad); top: 0; width: 400px; max-height: calc(100svh - 110px); overflow-y: auto; z-index: 8;
  background: #060a14; border: 1px solid var(--line-2); padding: 18px; scrollbar-width: thin;
  clip-path: polygon(16px 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%, 0 16px);
  box-shadow: 0 30px 80px rgba(0,0,0,.6);
  animation: slide .28s ease-out;
}
@keyframes slide { from { transform: translateX(20px); opacity: 0; } }
.d-close { position: absolute; right: 12px; top: 12px; border: 1px solid var(--line-2); background: none; width: 30px; height: 30px; cursor: pointer; color: var(--mute); }
.d-close:hover { color: var(--text); border-color: var(--ice); }
.d-head h2 { margin: 6px 0 0; font: 700 30px/1.05 var(--head); letter-spacing: .03em; padding-right: 36px; word-break: break-word; }
.d-name { margin: 2px 0 10px; color: var(--mute); word-break: break-word; }
.d-mint { display: flex; gap: 8px; align-items: flex-start; }
.d-mint code { flex: 1; min-width: 0; word-break: break-all; font-size: 11.5px; color: var(--ice); }
.d-mint button, .d-actions button { border: 1px solid var(--line-2); background: none; cursor: pointer; padding: 3px 9px; font: 11px var(--mono); letter-spacing: .1em; color: var(--text); }
.d-mint button:hover, .d-actions button:hover:not(:disabled) { border-color: var(--ice); color: var(--ice); }
.d-links { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.d-links a { font-size: 11px; text-decoration: none; border: 1px solid var(--line); padding: 3px 9px; color: var(--text); }
.d-links a:hover { border-color: var(--ice); color: var(--ice); }
.d-disclaim { margin: 14px 0; padding: 9px 11px; border-left: 2px solid var(--amber); background: rgba(255,181,71,.06); font-size: 11.5px; color: #e9d9b8; }
.d-curve { margin-bottom: 12px; }
.d-curve .cv-top { display: flex; justify-content: space-between; font-size: 11px; color: var(--mute); margin-bottom: 5px; }
.d-curve .cv-bar { height: 8px; background: rgba(125,249,255,.08); position: relative; overflow: hidden; }
.d-curve .cv-bar i { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--ice-dim), var(--ice)); box-shadow: 0 0 12px var(--ice); }
.d-curve .cv-bar i.g { background: var(--gold); box-shadow: 0 0 12px var(--gold); }
.sigs { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sig { padding: 10px 11px; border: 1px solid var(--line); background: rgba(12,18,32,.6); }
.sig .s-top { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.tone { font: 700 9.5px/1.6 var(--mono); letter-spacing: .14em; padding: 0 6px; border: 1px solid; flex: none; }
.tone.flag { color: var(--coral); border-color: rgba(255,93,115,.6); }
.tone.note { color: var(--violet); border-color: rgba(183,166,255,.5); }
.tone.ok { color: var(--ok); border-color: rgba(108,240,184,.45); }
.tone.info { color: var(--ice-dim); border-color: rgba(125,249,255,.3); }
.tone.unknown { color: var(--mute); border-color: var(--line-2); }
.sig .s-label { font: 600 13px var(--head); letter-spacing: .03em; }
.sig .s-val { margin-left: auto; font-size: 12px; color: var(--text); text-align: right; word-break: break-word; }
.sig.flag { border-color: rgba(255,93,115,.35); background: rgba(255,93,115,.05); }
.sig p { margin: 6px 0 0; font-size: 11.5px; line-height: 1.5; color: var(--mute); }
.sig .s-src { margin-top: 4px; font-size: 10px; color: var(--mute-2); letter-spacing: .04em; }
.d-holders { margin-top: 14px; }
.d-holders h3 { margin: 0 0 8px; font: 600 12px var(--head); letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }
.hbar { display: grid; grid-template-columns: 74px minmax(0, 1fr) 54px; gap: 8px; align-items: center; font-size: 10.5px; margin-bottom: 3px; }
.hbar .w { color: var(--mute); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hbar .w.t { color: var(--amber); }
.hbar .b { height: 6px; background: rgba(125,249,255,.08); position: relative; }
.hbar .b i { position: absolute; inset: 0 auto 0 0; background: var(--ice-dim); }
.hbar .b i.curve { background: var(--mute-2); }
.hbar .b i.launcher { background: var(--amber); }
.hbar .p { text-align: right; font-variant-numeric: tabular-nums; }
.d-actions { display: flex; gap: 10px; align-items: center; margin-top: 14px; flex-wrap: wrap; }
.d-actions span { font-size: 11px; color: var(--mute); }
.d-actions button:disabled { opacity: .45; cursor: default; }

/* ---------- glossary / footer ---------- */
.glossary { padding: clamp(30px, 5vw, 60px) var(--pad); max-width: 1280px; margin: 0 auto; }
.glossary h2 { margin: 0; font: 700 clamp(24px, 3.4vw, 36px)/1.1 var(--head); letter-spacing: .06em; text-transform: uppercase; }
.g-lead { color: var(--mute); max-width: 720px; margin: 10px 0 22px; }
.g-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.g-grid article { padding: 16px; border: 1px solid var(--line); background: var(--panel); }
.g-grid h3 { margin: 0 0 6px; font: 600 15px var(--head); letter-spacing: .05em; color: var(--ice); }
.g-grid p { margin: 0; font-size: 12px; line-height: 1.6; color: var(--mute); }
.foot { max-width: 1280px; margin: 0 auto; padding: 22px var(--pad) 36px; border-top: 1px solid var(--line); color: var(--mute); font-size: 11.5px; }
.foot p { margin: 0 0 6px; }
.f-sm { color: var(--mute-2); }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .deck { grid-template-columns: minmax(0, 1fr) 340px; }
  .hud { grid-column: 1 / -1; grid-row: 2; display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
  .hud .grid2 { border-top: 0; padding-top: 0; grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .hud .filters { grid-column: 1 / 3; }
  .scope-wrap { grid-column: 1; grid-row: 1; }
  .log { grid-column: 2; grid-row: 1; }
}
@media (max-width: 820px) {
  .deck { grid-template-columns: minmax(0, 1fr); }
  .scope-wrap, .log, .hud { grid-column: 1; grid-row: auto; }
  .scope-wrap { order: 1; } .hud { order: 2; } .log { order: 3; }
  .legend p { font-size: 10.5px; }
  .read b { font-size: 28px; }
  .scope { width: 100%; }
  .hud { display: flex; }
  .hud .grid2 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .log { max-height: 70svh; }
  .g-grid { grid-template-columns: minmax(0, 1fr); }
  .hide-s { display: none; }
  .dossier { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; max-height: 82svh; padding: 16px 14px calc(16px + env(safe-area-inset-bottom)); clip-path: none; border-left: 0; border-right: 0; animation: up .28s ease-out; }
  @keyframes up { from { transform: translateY(30px); opacity: 0; } }
  .logo p { display: none; }
}
@media (max-width: 420px) {
  .read b { font-size: 28px; }
  .read.sm b { font-size: 17px; }
  .logo h1 { font-size: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  .led.live, .row.fresh, .dossier { animation: none; }
}
