:root {
  --paper: #0A0A0B;
  --grid: #1A1A1C;
  --line: #2A2A2E;
  --frame: #3A3A40;
  --ring: #4A4A52;
  --ink: #F2F2F2;
  --ink-2: #B8B8BE;
  --mute: #7A7A82;
  --dot: #5A5A62;
  --red: #FF2D2D;
  --red-soft: #FF6B6B;
  --red-wash: rgba(255, 45, 45, 0.12);
  --red-glow: rgba(255, 45, 45, 0.45);
  --plate: rgba(14, 14, 16, 0.88);
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  --sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --cell: 36px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; color: var(--ink); font-family: var(--sans); }
body {
  min-height: 100dvh; font-size: 14.5px; line-height: 1.5; -webkit-font-smoothing: antialiased;
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: var(--cell) var(--cell);
  background-position: -1px -1px;
}
button, input { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
ul, ol { margin: 0; padding: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--red); outline-offset: 2px; }

.label, .tag, .tagline, .legend, .btn, .meta-caps, .status-pill {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .26em; font-weight: 400;
}
.label {
  display: flex; align-items: center; gap: 10px;
  font-size: 10.5px; color: var(--mute); margin-bottom: 12px;
}
.label::after {
  content: ""; flex: 1; height: 1px; background: var(--line); min-width: 24px;
}
.meta { font-size: 12.5px; color: var(--mute); line-height: 1.45; }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: .02em; }

.page {
  max-width: 1480px; margin: 0 auto;
  padding: calc(18px + env(safe-area-inset-top)) 22px calc(32px + env(safe-area-inset-bottom));
}

.layout { display: grid; gap: 32px; }
.console { display: grid; gap: 22px; align-content: start; }
.brand { order: -1; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1.15fr) 380px; gap: 56px; align-items: start; }
  .radar-zone { position: sticky; top: 18px; }
}
@media (max-width: 999px) {
  .page { padding-left: 16px; padding-right: 16px; }
  .layout { display: flex; flex-direction: column; gap: 22px; }
  .console { display: contents; }
  .brand { order: 0; } .hunt { order: 1; } .radar-zone { order: 2; }
  .block { order: 3; } .foot { order: 4; }
}

.brand { text-align: right; padding-top: 4px; }
.brand-row {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px;
}
.mark { width: 28px; height: 28px; flex: none; color: var(--ink); }
.mark .tip { fill: var(--red); filter: drop-shadow(0 0 4px var(--red-glow)); }
.wordmark {
  display: inline-block; font-family: var(--mono); font-weight: 700; color: var(--ink); text-decoration: none;
  font-size: clamp(32px, 4.6vw, 48px); line-height: 1; letter-spacing: .4em; margin-right: -.4em;
}
.rule {
  position: relative; height: 2px; background: var(--ink);
  margin: 18px 0 12px auto; width: min(100%, 340px);
}
.rule i {
  position: absolute; right: -5px; top: -4px; width: 10px; height: 10px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: pulse-dot 2.4s var(--ease) infinite;
}
.tagline { font-size: 11px; color: var(--ink-2); letter-spacing: .32em; }
.brand-meta {
  display: flex; align-items: center; justify-content: flex-end; gap: 14px; margin-top: 14px;
}
.status-pill {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 10px; letter-spacing: .22em; color: var(--ink-2);
  border: 1px solid var(--frame); padding: 6px 10px 6px 8px; background: var(--plate);
}
.status-pill .led {
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 0 0 var(--red-glow);
  animation: pulse-dot 2.4s var(--ease) infinite;
}
@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 var(--red-glow); }
  50% { box-shadow: 0 0 0 7px transparent; }
}
@media (max-width: 999px) {
  .brand { text-align: left; }
  .brand-row { justify-content: flex-start; }
  .rule { margin-left: 0; width: calc(100% - 6px); }
  .brand-meta { justify-content: flex-start; flex-wrap: wrap; }
  .wordmark { font-size: clamp(30px, 9vw, 40px); }
}

.btn {
  height: 44px; padding: 0 16px; font-size: 11px; letter-spacing: .22em; cursor: pointer; white-space: nowrap;
  background: transparent; border: 1px solid var(--ink); border-radius: 0; color: var(--ink);
  transition: background .15s var(--ease), color .15s var(--ease), border-color .15s var(--ease), transform .15s var(--ease);
}
.btn:hover { background: rgba(255,255,255,.06); }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: var(--ink); color: var(--paper); border-color: var(--ink);
}
.btn.primary:hover { background: #FFFFFF; color: #000; }
.btn:disabled { opacity: .45; cursor: progress; transform: none; }
.link-btn {
  background: none; border: 0; padding: 2px 0 2px 8px; cursor: pointer;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px;
}
.icon-btn {
  width: 40px; height: 40px; flex: none; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 1px solid var(--ink); border-radius: 0; color: var(--ink);
  transition: background .15s var(--ease);
}
.icon-btn:hover { background: rgba(255,255,255,.06); }

.hunt-row { display: grid; grid-template-columns: 1fr auto; }
.hunt input {
  min-width: 0; height: 44px; padding: 0 14px; border-radius: 0; font-family: var(--mono); font-size: 14px;
  background: var(--plate); border: 1px solid var(--ink); border-right: 0; color: var(--ink);
}
.hunt input::placeholder { color: var(--mute); letter-spacing: 0; text-transform: none; font-family: var(--sans); font-size: 13.5px; }
.hunt input:focus { outline: none; box-shadow: inset 0 -2px 0 var(--red); }
.hunt-msg { margin-top: 8px; font-size: 12.5px; color: var(--ink-2); }
.hunt-msg:empty { display: none; }
.hunt-msg.error { color: var(--red); }

.radar-zone { position: relative; }
.radar-wrap {
  position: relative; aspect-ratio: 1 / 1; width: 100%; max-height: 78vh; margin: 0 auto;
  background: rgba(8, 8, 10, 0.65);
  border: 1px solid var(--frame);
  box-shadow: inset 0 0 80px rgba(0,0,0,.35);
}
.radar-wrap::before, .radar-wrap::after {
  content: ""; position: absolute; width: 12px; height: 12px; pointer-events: none; z-index: 2;
  border-color: var(--ink); border-style: solid; border-width: 0;
}
.radar-wrap::before { top: -1px; left: -1px; border-top-width: 2px; border-left-width: 2px; }
.radar-wrap::after { bottom: -1px; right: -1px; border-bottom-width: 2px; border-right-width: 2px; }
.radar-corners { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.radar-corners i {
  position: absolute; width: 12px; height: 12px;
  border-color: var(--ink); border-style: solid; border-width: 0;
}
.radar-corners i:nth-child(1) { top: -1px; right: -1px; border-top-width: 2px; border-right-width: 2px; }
.radar-corners i:nth-child(2) { bottom: -1px; left: -1px; border-bottom-width: 2px; border-left-width: 2px; }
#radar { width: 100%; height: 100%; display: block; touch-action: manipulation; }
.tag {
  position: absolute; font-size: 10px; color: var(--mute); pointer-events: none;
  letter-spacing: .2em; z-index: 2; background: rgba(10,10,11,.75); padding: 3px 6px;
}
.tag-tl { top: 10px; left: 10px; }
.tag-bl { bottom: 10px; left: 10px; }
.tag-br { bottom: 10px; right: 10px; }
.legend {
  list-style: none; padding: 0; margin: 14px 0 0;
  display: flex; flex-wrap: wrap; gap: 8px 18px;
  font-size: 10px; color: var(--ink-2); letter-spacing: .18em;
}
.legend li { display: inline-flex; align-items: center; gap: 8px; }
.sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.sw.idle { background: var(--dot); }
.sw.low { background: var(--ink); }
.sw.caution { border: 1.75px solid var(--red); width: 10px; height: 10px; background: transparent; }
.sw.high {
  background: var(--red);
  box-shadow: 0 0 0 2px var(--paper), 0 0 8px var(--red-glow), 0 0 0 3.5px rgba(255,45,45,.25);
}
.sw.hunter { background: var(--ink); border-radius: 0; transform: rotate(45deg); width: 7px; height: 7px; }

.block {
  background: var(--plate);
  border: 1px solid var(--frame);
  padding: 16px 16px 14px;
  position: relative;
}
.block::before {
  content: ""; position: absolute; top: -1px; left: -1px; width: 8px; height: 8px;
  border-top: 2px solid var(--ink); border-left: 2px solid var(--ink); pointer-events: none;
}
.hunters { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 12px; }
.hunter { display: grid; grid-template-columns: 32px 1fr; gap: 3px 12px; align-items: center; }
.hunter .badge {
  grid-row: span 2; width: 32px; height: 32px; display: grid; place-items: center;
  border: 1px solid var(--ink); font-family: var(--mono); font-size: 11px; letter-spacing: 0;
  background: transparent; color: var(--ink);
  transition: background .2s var(--ease), color .2s var(--ease);
}
.hunter.busy .badge { background: var(--ink); color: var(--paper); }
.hunter .what { font-family: var(--mono); font-size: 12px; letter-spacing: .03em; }
.hunter.idle .what { color: var(--mute); }
.hunter .bar { height: 2px; background: var(--line); overflow: hidden; }
.hunter .bar i {
  display: block; height: 100%; width: 0; background: var(--ink);
  transition: width .55s linear; position: relative;
}
.hunter.busy .bar i::after {
  content: ""; position: absolute; right: 0; top: -2px; width: 6px; height: 6px;
  border-radius: 50%; background: var(--red);
  box-shadow: 0 0 6px var(--red-glow);
}

.feed {
  list-style: none; padding: 0; margin: 0; max-height: 360px;
  overflow-y: auto; overscroll-behavior: contain;
  scrollbar-width: thin; scrollbar-color: var(--frame) transparent;
}
.feed li + li { border-top: 1px solid var(--line); }
.feed .row {
  display: grid; grid-template-columns: 10px 1fr auto; gap: 12px; align-items: baseline;
  width: 100%; padding: 10px 0; background: none; border: 0; text-align: left;
  font-size: 13px; line-height: 1.4; color: var(--ink);
  transition: color .15s var(--ease);
}
.feed button.row { cursor: pointer; }
.feed button.row:hover .txt { color: var(--red); }
.feed .tick { width: 6px; height: 6px; border-radius: 50%; background: var(--dot); transform: translateY(-1px); }
.feed .k-flag .tick { background: var(--red); box-shadow: 0 0 6px var(--red-glow); }
.feed .k-caution .tick { background: transparent; border: 1.5px solid var(--red); width: 7px; height: 7px; }
.feed .k-clear .tick { background: var(--ink); }
.feed .k-scan .tick, .feed .k-dispatch .tick {
  background: var(--ink); border-radius: 0; transform: rotate(45deg); width: 6px; height: 6px;
}
.feed .k-sys .txt { color: var(--mute); }
.feed .ago { font-family: var(--mono); color: var(--mute); font-size: 10.5px; letter-spacing: .08em; }

.foot { font-size: 12px; color: var(--mute); max-width: 58ch; line-height: 1.55; }

.case-layer { position: fixed; inset: 0; z-index: 50; display: flex; align-items: flex-end; justify-content: center; }
.case-layer[hidden] { display: none; }
.scrim {
  position: absolute; inset: 0; background: rgba(5, 5, 6, .84);
}
.case {
  position: relative; width: 100%; max-height: 92dvh; display: flex; flex-direction: column;
  background: #0E0E10; border-top: 2px solid var(--ink); outline: none;
  animation: sheet-up .28s var(--ease);
  box-shadow: 0 -24px 80px rgba(0,0,0,.5);
}
@media (min-width: 1000px) {
  .case-layer { justify-content: flex-end; align-items: stretch; }
  .case {
    width: 460px; max-height: none; height: 100%;
    border-top: 0; border-left: 2px solid var(--ink);
    animation-name: drawer-in; box-shadow: -24px 0 80px rgba(0,0,0,.5);
  }
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.case-head {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 18px 20px 14px; border-bottom: 1px solid var(--line);
  background: linear-gradient(180deg, #121214 0%, #0E0E10 100%);
}
.case-head .label { margin-bottom: 6px; }
.case-head .label::after { display: none; }
.case-id { min-width: 0; }
.case-head h2 {
  font-family: var(--mono); font-weight: 700; font-size: 20px; line-height: 1.25;
  letter-spacing: .01em; word-break: break-word;
}
.addr { display: flex; align-items: center; color: var(--mute); margin-top: 4px; min-width: 0; }
.addr .mono { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.case-body { overflow-y: auto; padding: 22px 20px 10px; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; contain: content; }
.case-body.loading .verdict, .case-body.loading .meter { opacity: .35; }

.verdict {
  display: grid; grid-template-columns: auto 1fr;
  grid-template-rows: auto auto; column-gap: 18px; row-gap: 4px; align-items: end;
}
.risk-num {
  grid-row: span 2; font-family: var(--mono); font-weight: 700;
  font-size: clamp(64px, 12vw, 76px); line-height: .82; letter-spacing: -0.04em; white-space: nowrap;
}
.risk-num small {
  display: block; margin: 10px 0 0; font-size: 10.5px; font-weight: 400;
  letter-spacing: .24em; text-transform: uppercase; color: var(--mute);
}
.risk-label {
  font-family: var(--mono); text-transform: uppercase; letter-spacing: .18em;
  font-size: 11.5px; font-weight: 500; align-self: end;
}
.verdict .meta { align-self: start; }
.lvl-high { color: var(--red); text-shadow: 0 0 18px var(--red-glow); }

.meter {
  display: grid; grid-template-columns: repeat(20, 1fr); gap: 3px;
  margin: 20px 0 16px; height: 12px;
}
.meter i {
  background: var(--line);
  transform-origin: left center;
  animation: meter-in .4s var(--ease) both;
  animation-delay: calc(var(--i, 0) * 14ms);
}
.meter i.on { background: var(--ink); }
.meter.high i.on {
  background: var(--red);
  box-shadow: 0 0 8px rgba(255,45,45,.35);
}
@keyframes meter-in {
  from { transform: scaleX(.2); opacity: .3; }
  to { transform: scaleX(1); opacity: 1; }
}
.blurb { color: var(--ink-2); font-size: 13.5px; line-height: 1.5; max-width: 48ch; }
.blurb:empty { display: none; }

.case-sec { margin-top: 28px; }
.checks { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.checks li {
  display: grid; grid-template-columns: 22px 1fr; gap: 1px 12px;
  padding: 11px 0; border-bottom: 1px solid var(--line);
}
.checks .ico {
  grid-row: span 2; width: 20px; height: 20px; display: grid; place-items: center;
  margin-top: 1px; border: 1px solid var(--ink); background: transparent; color: var(--ink);
}
.checks .flag .ico {
  background: var(--red); border-color: var(--red); color: #fff;
  box-shadow: 0 0 10px var(--red-glow);
}
.checks .note .ico { border-color: var(--mute); color: var(--mute); }
.checks .lbl { font-size: 13.5px; font-weight: 500; }
.checks .det { font-size: 12.5px; color: var(--ink-2); line-height: 1.4; }
.notes { margin: 0; padding: 0; list-style: none; font-size: 13.5px; }
.notes li { position: relative; padding: 5px 0 5px 18px; color: var(--ink-2); }
.notes li::before {
  content: ""; position: absolute; left: 2px; top: 12px;
  width: 6px; height: 6px; border-radius: 50%; background: var(--red);
  box-shadow: 0 0 6px var(--red-glow);
}
.notes.good li::before { background: var(--ink); box-shadow: none; }
.callout { font-size: 13.5px; padding: 12px 14px; border: 1px solid var(--line); line-height: 1.45; }
.callout.warn { border-color: var(--red); background: var(--red-wash); }
.past { list-style: none; padding: 0; margin: 8px 0 0; font-family: var(--mono); font-size: 11.5px; }
.past li {
  padding: 6px 0; display: flex; justify-content: space-between; gap: 10px;
  border-bottom: 1px dashed var(--line);
}
.past .dead { color: var(--red); }
.past .muted { color: var(--mute); }
.creature { margin: 26px 0 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.creature summary { cursor: pointer; margin: 0; color: var(--ink); list-style: none; }
.creature summary::-webkit-details-marker { display: none; }
.creature .meta { margin: 8px 0 10px; }
.scope {
  background: #08080A;
  padding: 10px;
  border: 1px solid var(--frame);
  position: relative;
  background-image:
    linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 22px 22px;
}
.scope::before, .scope::after {
  content: ""; position: absolute; width: 10px; height: 10px; border-color: var(--red); border-style: solid; z-index: 1;
}
.scope::before { top: 4px; left: 4px; border-width: 1.5px 0 0 1.5px; }
.scope::after { bottom: 4px; right: 4px; border-width: 0 1.5px 1.5px 0; }
#creatureCanvas { width: 100%; height: min(360px, 52vw); min-height: 280px; display: block; touch-action: none; }
.case-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 8px;
  padding: 14px 20px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: #0E0E10;
}
.case-actions .primary { grid-column: 1 / -1; }

@media (prefers-reduced-motion: reduce) {
  .case { animation: none; }
  .hunter .bar i { transition: none; }
  .rule i, .status-pill .led { animation: none; }
  .meter i { animation: none; }
  .btn { transition: none; }
}

/* ---------- track record + rap sheets ---------- */
.link-pill { text-decoration: none; color: var(--ink-2); }
.link-pill:hover { color: var(--red); border-color: var(--red); }
.track-badge {
  display: inline-block; margin: 0 0 12px; padding: 7px 10px; background: var(--red); color: #fff;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .2em; text-transform: uppercase;
}
.track-note a, .cluster a { color: var(--ink); }
.track-note { margin: -4px 0 12px; }
.cluster { margin-top: 12px; padding: 12px 14px; border: 1px solid var(--line); }
.cluster.warn { border-color: var(--red); background: var(--red-wash); }
.cluster p { margin: 0 0 8px; }
.cluster p:last-child { margin-bottom: 0; }
.cluster-alert { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .22em; text-transform: uppercase; color: var(--red); }
.cluster-tally { font-family: var(--mono); font-size: 13px; }
.cluster-tally b { font-size: 18px; margin-right: 2px; }
.cluster-tally .red, .red { color: var(--red); }
.feed .k-rugger .tick, .feed .k-miss .tick { background: var(--red); border-radius: 0; box-shadow: 0 0 6px var(--red-glow); }
.feed .k-rugger .txt { color: var(--red); }
.feed .k-caught .tick { background: var(--red); box-shadow: 0 0 0 3px var(--red-wash); }
.feed .k-miss .txt { color: var(--ink-2); }

/* sub pages (/record, /dev/<wallet>) */
.sub { max-width: 1040px; margin: 0 auto; padding: calc(24px + env(safe-area-inset-top)) 20px calc(40px + env(safe-area-inset-bottom)); }
.sub-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 28px; }
.sub-head .wordmark { font-size: 26px; }
.sub-nav { display: flex; gap: 10px; }
.sub h1 { font-family: var(--mono); font-size: clamp(26px, 4.5vw, 40px); font-weight: 700; letter-spacing: .02em; margin: 0 0 8px; }
.sub .lede { color: var(--ink-2); max-width: 64ch; margin: 0 0 24px; line-height: 1.55; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 28px; }
.stat { border: 1px solid var(--frame); background: var(--plate); padding: 14px; }
.stat .n { font-family: var(--mono); font-size: 30px; font-weight: 700; line-height: 1.1; }
.stat .n.red { color: var(--red); }
.stat .k { font-family: var(--mono); font-size: 10px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); margin-top: 6px; }
.stat .d { font-size: 12px; color: var(--mute); margin-top: 4px; line-height: 1.4; }
.rec-sec { margin-bottom: 32px; }
.rec-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.rec-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 16px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.rec-list .sym { font-family: var(--mono); font-weight: 700; font-size: 15px; }
.rec-list .sym a { color: var(--ink); text-decoration: none; }
.rec-list .sym a:hover { color: var(--red); }
.rec-list .why { font-size: 12.5px; color: var(--mute); grid-column: 1 / -1; }
.rec-list .lead { font-family: var(--mono); font-size: 13px; color: var(--red); white-space: nowrap; text-align: right; }
.rec-list .proof { grid-column: 1 / -1; display: flex; gap: 14px; flex-wrap: wrap; }
.rec-list .proof a { font-family: var(--mono); font-size: 10.5px; letter-spacing: .15em; text-transform: uppercase; color: var(--ink-2); }
.rec-list .proof a:hover { color: var(--red); }
.empty { color: var(--mute); font-size: 13.5px; padding: 14px 0; border-top: 1px solid var(--line); }
.sub .mono-block { font-family: var(--mono); font-size: 13px; word-break: break-all; color: var(--ink-2); }
