/* Layout: brand header, price hero + tile grid, then titled sections of cards on a 2-column auto-fit grid. Dark-first, light supported. */
:root {
  color-scheme: dark;
  --page: #0e0f12;
  --surface: #17181c;
  --surface-2: #202127;
  --ink: #f5f5f2;
  --ink-2: #c3c2b7;
  --muted: #8b8a84;
  --grid: #2a2b30;
  --axis: #3a3b40;
  --line: rgba(255,255,255,0.08);
  --accent: #9085e9;
  --buy: #3987e5;
  --sell: #e66767;
  --burn: #d95926;
  --up: #2fbf71;
  --down: #f06a6a;
  --c-whale: #3987e5; --c-large: #d95926; --c-retail: #199e70; --c-normie: #c98500;
  --c-bots: #d55181; --c-cex: #2c9a2c; --c-protocol: #9085e9; --c-team: #e66767; --c-infra: #8b8a84;
  --font: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --r: 14px;
  --shadow: 0 1px 0 rgba(255,255,255,0.03) inset, 0 8px 24px rgba(0,0,0,0.18);
}
:root[data-theme="light"] {
  color-scheme: light;
  --page: #f3f3ef; --surface: #ffffff; --surface-2: #f2f1ed; --ink: #111111; --ink-2: #4c4b47; --muted: #77756f;
  --grid: #e6e5df; --axis: #c9c8c0; --line: rgba(17,17,17,0.09); --accent: #4a3aa7;
  --buy: #2a78d6; --sell: #e34948; --burn: #eb6834; --up: #12803d; --down: #c83434;
  --c-whale: #2a78d6; --c-large: #eb6834; --c-retail: #1baf7a; --c-normie: #eda100;
  --c-bots: #e87ba4; --c-cex: #008300; --c-protocol: #4a3aa7; --c-team: #e34948; --c-infra: #898781;
  --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --page: #f3f3ef; --surface: #ffffff; --surface-2: #f2f1ed; --ink: #111111; --ink-2: #4c4b47; --muted: #77756f;
    --grid: #e6e5df; --axis: #c9c8c0; --line: rgba(17,17,17,0.09); --accent: #4a3aa7;
    --buy: #2a78d6; --sell: #e34948; --burn: #eb6834; --up: #12803d; --down: #c83434;
    --c-whale: #2a78d6; --c-large: #eb6834; --c-retail: #1baf7a; --c-normie: #eda100;
    --c-bots: #e87ba4; --c-cex: #008300; --c-protocol: #4a3aa7; --c-team: #e34948; --c-infra: #898781;
    --shadow: 0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.05);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--page); color: var(--ink); font-family: var(--font); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent); }
button, select, input { font: inherit; color: inherit; }
.wrap { max-width: 1280px; margin: 0 auto; padding-inline: max(16px, 2.5vw); padding-block: 22px 48px; display: flex; flex-direction: column; gap: 22px; }

/* header */
.top { display: flex; flex-wrap: wrap; gap: 12px 24px; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 14px; align-items: center; min-width: 0; }
.mark { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; font-size: 20px; color: #fff; background: linear-gradient(140deg, var(--accent), var(--buy)); flex: none; }
.brand h1 { margin: 0; font-size: clamp(20px, 2.6vw, 26px); font-weight: 800; letter-spacing: -0.02em; }
.sub { margin: 1px 0 0; color: var(--ink-2); font-size: 13px; }
.status { display: flex; align-items: center; gap: 10px; color: var(--ink-2); font-size: 12.5px; font-variant-numeric: tabular-nums; flex-wrap: wrap; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.live { background: var(--up); animation: pulse 2s infinite; }
.dot.warn { background: #eda100; }
.dot.err { background: var(--down); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--up) 55%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1.6fr); gap: 12px; }
@media (max-width: 900px) { .hero { grid-template-columns: 1fr; } }
.price-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.price-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.price-top > div:first-child { display: flex; flex-direction: column; }
.price { font-family: var(--mono); font-size: clamp(30px, 4vw, 40px); font-weight: 600; letter-spacing: -0.02em; line-height: 1.1; }
.changes { display: flex; gap: 12px; font-size: 12px; font-variant-numeric: tabular-nums; }
.changes em { font-style: normal; color: var(--muted); margin-right: 3px; }
.changes b { font-family: var(--mono); font-weight: 600; }
.spark { height: 74px; position: relative; }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 640px) { .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tile { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; min-width: 0; box-shadow: var(--shadow); }
.k { font-size: 11.5px; color: var(--muted); letter-spacing: 0.02em; }
.tile .v { font-family: var(--mono); font-size: 20px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .s { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.flash-up { animation: fu 1s ease-out; } .flash-down { animation: fd 1s ease-out; }
@keyframes fu { from { color: var(--up); } to { color: inherit; } }
@keyframes fd { from { color: var(--down); } to { color: inherit; } }
.up { color: var(--up); } .down { color: var(--down); }
.pulse { margin: 0; font-size: 15px; line-height: 1.55; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 10px; padding: 12px 16px; max-width: 100%; }
.pulse:empty { display: none; }
.pulse b { font-family: var(--mono); font-weight: 600; }

/* sections + cards */
.section { display: flex; flex-direction: column; gap: 12px; }
.section h2 { margin: 0; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; }
.bar.tight { gap: 6px 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 440px), 1fr)); gap: 12px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 16px 18px; display: flex; flex-direction: column; gap: 8px; min-width: 0; box-shadow: var(--shadow); }
.card.wide { grid-column: 1 / -1; }
.card h3 { margin: 0; font-size: 15px; font-weight: 700; }
.note { margin: 0; font-size: 12px; color: var(--muted); max-width: 85ch; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { background: none; border: 0; padding: 6px 12px; cursor: pointer; color: var(--ink-2); font-size: 13px; font-weight: 500; }
.seg.small button { padding: 4px 9px; font-size: 12px; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); font-weight: 700; box-shadow: inset 0 -2px 0 var(--accent); }
.ghost { background: none; border: 1px solid var(--line); border-radius: 9px; padding: 5px 10px; cursor: pointer; color: var(--ink-2); font-size: 12px; }
.ghost:hover, .seg button:hover { color: var(--ink); }
.ghost[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
button:focus-visible, select:focus-visible, input:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.mini { font-size: 12px; color: var(--ink-2); display: inline-flex; align-items: center; gap: 6px; }
.mini select { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 3px 6px; }
.filters { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--ink-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.sw.buy { background: var(--buy); } .sw.sell { background: var(--sell); } .sw.burn { background: var(--burn); }
.chart { position: relative; min-height: 200px; }
.chart.tall { min-height: 300px; }
.chart svg { display: block; overflow: visible; }
.chart text, .spark text { fill: var(--muted); font-size: 11px; font-family: var(--font); }
.chart .lbl { fill: var(--ink); font-size: 12.5px; font-weight: 500; }
.chart .val { fill: var(--ink); font-size: 11.5px; font-family: var(--mono); font-weight: 500; }
.empty { color: var(--muted); font-size: 13px; padding: 26px 0; text-align: center; }

/* chips, tables, lists */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px; font-size: 12px; cursor: pointer; background: var(--surface); color: var(--ink-2); }
.chip[aria-pressed="true"] { background: var(--surface-2); color: var(--ink); }
.chip[aria-pressed="false"] { opacity: 0.5; }
.chip i, .gdot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex: none; }
.tablewrap { overflow: auto; max-height: 380px; border: 1px solid var(--line); border-radius: 10px; }
.tablewrap.tall { max-height: 520px; }
.tbl { width: 100%; border-collapse: collapse; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.tbl th { position: sticky; top: 0; background: var(--surface); z-index: 1; color: var(--muted); font-weight: 600; font-size: 11.5px; text-align: right; padding: 8px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl td { text-align: right; padding: 7px 10px; border-bottom: 1px solid var(--line); white-space: nowrap; }
.tbl .l { text-align: left; }
.tbl tbody tr:last-child td { border-bottom: 0; }
.tbl tbody tr:hover td { background: var(--surface-2); }
.tbl tr.new td { animation: rowin 1.4s ease-out; }
@keyframes rowin { from { background: color-mix(in srgb, var(--accent) 24%, transparent); } to { background: transparent; } }
.num { font-family: var(--mono); }
.addr { font-family: var(--mono); font-size: 12px; color: var(--ink); background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline dotted var(--muted); text-underline-offset: 3px; }
.lab { display: block; color: var(--muted); font-size: 11px; max-width: 20rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side { display: inline-flex; align-items: center; gap: 4px; font-weight: 700; font-size: 12px; }
.side.B { color: var(--up); } .side.S { color: var(--down); }
.grp { display: inline-flex; align-items: center; gap: 6px; }
.list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; max-height: 380px; overflow: auto; }
.list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; align-items: center; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; font-size: 12.5px; background: var(--surface); }
.list li.empty-row { display: block; border: 0; color: var(--muted); text-align: center; padding: 20px 0; }
.list .who { min-width: 0; overflow: hidden; }
.list .amt { font-family: var(--mono); font-weight: 600; text-align: right; }
.list .t { color: var(--muted); font-family: var(--mono); font-size: 11px; }
.list .rank { color: var(--muted); font-family: var(--mono); min-width: 1.6em; }
.trio { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.trio.two { grid-template-columns: 1fr 1fr; }
.trio div { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; min-width: 0; }
.trio .v { font-family: var(--mono); font-size: 17px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* deep dive */
.deep { padding-top: 18px; border-top: 1px solid var(--line); }
.take { margin: 0; font-size: 15px; line-height: 1.55; max-width: 80ch; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 12px; }
.findings li { border-left: 2px solid var(--accent); padding: 2px 0 2px 12px; display: flex; flex-direction: column; gap: 3px; }
.findings b { font-weight: 700; }
.findings span { color: var(--ink-2); font-size: 12.5px; }
.stack { display: flex; height: 30px; border-radius: 8px; overflow: hidden; gap: 2px; }
.stack div { min-width: 2px; }
.search { background: var(--page); border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; width: min(100%, 280px); }
.facts { margin: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px 22px; }
.facts div { display: flex; flex-direction: column; gap: 3px; }
.facts dt { font-weight: 700; font-size: 13px; }
.facts dd { margin: 0; color: var(--ink-2); font-size: 12.5px; }
.pill { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: 11px; }
.pill i { width: 6px; height: 6px; border-radius: 50%; }
.foot p { margin: 0; color: var(--muted); font-size: 12px; max-width: 95ch; }

/* overlays */
.tip { position: fixed; z-index: 50; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font-size: 12px; box-shadow: 0 10px 30px rgba(0,0,0,0.28); min-width: 160px; max-width: 280px; }
.tip .th { color: var(--muted); margin-bottom: 4px; font-weight: 600; }
.tip .tr { display: flex; gap: 8px; align-items: center; font-variant-numeric: tabular-nums; line-height: 1.6; }
.tip .tr b { margin-left: auto; font-weight: 600; font-family: var(--mono); }
.drawer { position: fixed; inset: 0 0 0 auto; width: min(440px, 100vw); background: var(--surface); border-left: 1px solid var(--line); z-index: 40; box-shadow: -14px 0 44px rgba(0,0,0,0.35); overflow: auto; }
.drawer-in { padding: 22px; display: flex; flex-direction: column; gap: 10px; position: relative; }
.drawer h3 { margin: 0; font-family: var(--mono); font-size: 14px; word-break: break-all; padding-right: 64px; }
.drawer h4 { margin: 8px 0 0; font-size: 13px; }
.close { position: absolute; top: 18px; right: 18px; }

@media (max-width: 640px) { .hide-sm { display: none; } .trio { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { .dot.live, .tbl tr.new td, .flash-up, .flash-down { animation: none; } }
