/* TellTales UI - server-rendered, no JavaScript (except the login page's auth.js).
   Three themes (light, dark, blackout) plus system default. Chart colour tokens
   (series/cat/diverging/heatmap) are the validated data-viz palette; the brand
   green is reserved for the mark, the CTA and active states; the creator/origin
   roles keep their own crimson. */
@import url("https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap");

:root {
  color-scheme: light;
  --bg: #f4f5f7; --sidebar: #fafafb; --card: #ffffff; --head: #f6f6f8;
  --grid-line: rgba(14, 18, 28, .055);
  --text: #0b0d12; --secondary: #4b5565; --muted: #5d6675; --faint: #6b7280;
  --line: rgba(14, 18, 28, .08); --card-border: rgba(14, 18, 28, .10); --row: transparent;
  --hover: rgba(14, 18, 28, .04); --nav-fg: #0b0d12;
  --brand: #16a34a; --brand-hover: #15803d; --brand-fg: #052e16; --brand-soft: rgba(22, 163, 74, .12); --brand-ink: #15803d;
  --creator: #e0243a; --creator-soft: rgba(224, 36, 58, .10); --creator-ink: #b8182c;
  --nav-active: var(--brand-soft); --nav-border: rgba(22, 163, 74, .25);
  --cta: var(--brand); --cta-hover: var(--brand-hover); --cta-fg: var(--brand-fg);
  --input: #ffffff; --input-border: rgba(14, 18, 28, .13); --icon-bg: #f1f2f5; --muted-bg: #eceef2;
  --shadow: 0 1px 2px rgba(14, 18, 28, .04); --shadow-pop: 0 12px 32px rgba(14, 18, 28, .08);
  --focus: #2563eb; --link: #1d4ed8;
  /* QR panel: deliberately the same in every theme, cameras need dark-on-light. */
  --qr-bg: #ffffff; --qr-fg: #000000;
  --series-1: #2a78d6; --series-prior: #898781; --grid: #e9e8e3; --axis: #c3c2b7; --axis-ink: #898781;
  --cat-1: #2a78d6; --cat-2: #eb6834; --cat-3: #1baf7a; --bub-none: #d3d2cb;
  --dv-n4: #962222; --dv-n3: #c93636; --dv-n2: #e46561; --dv-n1: #ee918c; --dv-0: #b5b4ac;
  --dv-p1: #86b6ef; --dv-p2: #5598e7; --dv-p3: #2a78d6; --dv-p4: #184f95;
  --hm-0: #f0efec; --hm-1: #cde2fb; --hm-2: #9ec5f4; --hm-3: #6da7ec; --hm-4: #2a78d6; --hm-5: #184f95;
  --good: #0ca30c; --good-ink: #006300; --good-soft: rgba(0, 179, 106, .10);
  --warn: #fab219; --warn-ink: #8a5a00; --warn-soft: #fff8e6;
  --bad: #d03b3b; --bad-ink: #b42323; --bad-soft: #fef2f2;
  --info: #2563eb; --info-ink: #1d4ed8; --info-soft: #eff6ff;
  --lose-soft: rgba(241, 77, 110, .10);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg: #101012; --sidebar: #131316; --card: #19191d; --head: #1d1d22;
    --grid-line: rgba(255, 255, 255, .04);
    --text: #f5f5f7; --secondary: #b6b6be; --muted: #a3a3ab; --faint: #8e8e97;
    --line: rgba(255, 255, 255, .07); --card-border: rgba(255, 255, 255, .09); --row: transparent;
    --hover: rgba(255, 255, 255, .05); --nav-fg: #f5f5f7;
    --brand: #4ade80; --brand-hover: #6ee7a0; --brand-fg: #052e16; --brand-soft: rgba(74, 222, 128, .14); --brand-ink: #4ade80;
    --creator: #ff3b4e; --creator-soft: rgba(255, 59, 78, .14); --creator-ink: #ff6b7a;
    --nav-active: var(--brand-soft); --nav-border: rgba(74, 222, 128, .28);
    --input: #141417; --input-border: rgba(255, 255, 255, .11); --icon-bg: #222227; --muted-bg: #232329;
    --shadow: none; --shadow-pop: 0 16px 40px rgba(0, 0, 0, .45);
    --focus: #7fb2ff; --link: #8db8ff;
    --series-1: #3987e5; --series-prior: #6f6e69; --grid: #262624; --axis: #383835; --axis-ink: #898781;
    --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --bub-none: #4a4a45;
    --dv-n4: #f29b97; --dv-n3: #e05a58; --dv-n2: #b83636; --dv-n1: #8c2c2c; --dv-0: #5c5b56;
    --dv-p1: #184f95; --dv-p2: #256abf; --dv-p3: #3987e5; --dv-p4: #86b6ef;
    --hm-0: #232321; --hm-1: #104281; --hm-2: #1c5cab; --hm-3: #3987e5; --hm-4: #6da7ec; --hm-5: #b7d3f6;
    --good-ink: #3ccb5a; --good-soft: rgba(12, 163, 12, .14);
    --warn-ink: #f7b733; --warn-soft: rgba(250, 178, 25, .10);
    --bad-ink: #f47b7b; --bad-soft: rgba(239, 68, 68, .12);
    --info-ink: #8db8ff; --info-soft: rgba(59, 130, 246, .12);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101012; --sidebar: #131316; --card: #19191d; --head: #1d1d22;
  --grid-line: rgba(255, 255, 255, .04);
  --text: #f5f5f7; --secondary: #b6b6be; --muted: #a3a3ab; --faint: #8e8e97;
  --line: rgba(255, 255, 255, .07); --card-border: rgba(255, 255, 255, .09); --row: transparent;
  --hover: rgba(255, 255, 255, .05); --nav-fg: #f5f5f7;
  --brand: #4ade80; --brand-hover: #6ee7a0; --brand-fg: #052e16; --brand-soft: rgba(74, 222, 128, .14); --brand-ink: #4ade80;
  --creator: #ff3b4e; --creator-soft: rgba(255, 59, 78, .14); --creator-ink: #ff6b7a;
  --nav-active: var(--brand-soft); --nav-border: rgba(74, 222, 128, .28);
  --input: #141417; --input-border: rgba(255, 255, 255, .11); --icon-bg: #222227; --muted-bg: #232329;
  --shadow: none; --shadow-pop: 0 16px 40px rgba(0, 0, 0, .45);
  --focus: #7fb2ff; --link: #8db8ff;
  --series-1: #3987e5; --series-prior: #6f6e69; --grid: #262624; --axis: #383835; --axis-ink: #898781;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --bub-none: #4a4a45;
  --dv-n4: #f29b97; --dv-n3: #e05a58; --dv-n2: #b83636; --dv-n1: #8c2c2c; --dv-0: #5c5b56;
  --dv-p1: #184f95; --dv-p2: #256abf; --dv-p3: #3987e5; --dv-p4: #86b6ef;
  --hm-0: #232321; --hm-1: #104281; --hm-2: #1c5cab; --hm-3: #3987e5; --hm-4: #6da7ec; --hm-5: #b7d3f6;
  --good-ink: #3ccb5a; --good-soft: rgba(12, 163, 12, .14);
  --warn-ink: #f7b733; --warn-soft: rgba(250, 178, 25, .10);
  --bad-ink: #f47b7b; --bad-soft: rgba(239, 68, 68, .12);
  --info-ink: #8db8ff; --info-soft: rgba(59, 130, 246, .12);
}
:root[data-theme="blackout"] {
  color-scheme: dark;
  --bg: #000000; --sidebar: #000000; --card: #0a0a0a; --head: #0d0d0d;
  --grid-line: rgba(255, 255, 255, .055);
  --text: #ffffff; --secondary: #c4c4c8; --muted: #ababb0; --faint: #93939a;
  --line: rgba(255, 255, 255, .10); --card-border: rgba(255, 255, 255, .12); --row: transparent;
  --hover: rgba(255, 255, 255, .06); --nav-fg: #ffffff;
  --brand: #4ade80; --brand-hover: #6ee7a0; --brand-fg: #052e16; --brand-soft: rgba(74, 222, 128, .16); --brand-ink: #4ade80;
  --creator: #ff3b4e; --creator-soft: rgba(255, 59, 78, .16); --creator-ink: #ff6b7a;
  --nav-active: var(--brand-soft); --nav-border: rgba(74, 222, 128, .32);
  --input: #050505; --input-border: rgba(255, 255, 255, .15); --icon-bg: #141414; --muted-bg: #161616;
  --shadow: none; --shadow-pop: 0 16px 40px rgba(0, 0, 0, .7);
  --focus: #8db8ff; --link: #9cc2ff;
  --series-1: #3987e5; --series-prior: #6f6e69; --grid: #202020; --axis: #343434; --axis-ink: #8f8f8a;
  --cat-1: #3987e5; --cat-2: #d95926; --cat-3: #199e70; --bub-none: #4a4a45;
  --dv-n4: #f29b97; --dv-n3: #e05a58; --dv-n2: #b83636; --dv-n1: #8c2c2c; --dv-0: #5c5b56;
  --dv-p1: #184f95; --dv-p2: #256abf; --dv-p3: #3987e5; --dv-p4: #86b6ef;
  --hm-0: #1a1a1a; --hm-1: #104281; --hm-2: #1c5cab; --hm-3: #3987e5; --hm-4: #6da7ec; --hm-5: #b7d3f6;
  --good-ink: #42d463; --good-soft: rgba(12, 163, 12, .16);
  --warn-ink: #f9bd3f; --warn-soft: rgba(250, 178, 25, .12);
  --bad-ink: #f98383; --bad-soft: rgba(239, 68, 68, .14);
  --info-ink: #9cc2ff; --info-soft: rgba(59, 130, 246, .14);
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  background-color: var(--bg); color: var(--text);
  background-image: linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 28px 28px; background-position: -1px -1px;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", sans-serif; font-size: 13px; line-height: 1.5;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-decoration: none; }
a.link { color: var(--link); font-weight: 500; display: inline-flex; align-items: center; gap: 4px; }
a.link:hover { text-decoration: underline; }
a.link svg { width: 12px; height: 12px; }
code, .mono { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 11.5px; }
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: 19px; letter-spacing: -.02em; line-height: 1.25; }
p { margin: 0 0 6px; }
p:last-child { margin-bottom: 0; }
svg { display: inline-block; vertical-align: middle; }
kbd { font-family: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 6px; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; padding: 8px 12px; border-radius: 8px; background: var(--card); color: var(--text); border: 1px solid var(--card-border); font-weight: 600; }
.skip:focus { left: 8px; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12px; }
.nowrap { white-space: nowrap; }
.center { text-align: center; justify-content: center; }
.num, .tabular { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100dvh; }
.sidebar {
  background: var(--sidebar); border-right: 1px solid var(--line);
  display: flex; flex-direction: column; padding: 12px 10px 48px; gap: 2px; position: sticky; top: 0; height: 100dvh;
}
.brand { display: flex; align-items: center; gap: 9px; padding: 2px 6px 10px; }
/* Brand mark: the mask line art in the theme's brand colour, no tile. */
.brand-mark { height: 32px; width: 20px; color: var(--brand); display: grid; place-items: center; flex: none; }
.brand-mark svg { height: 32px; width: auto; }
.brand-mark.lg { height: 72px; width: 44px; } .brand-mark.lg svg { height: 72px; }
:root[data-theme="blackout"] .brand-mark { color: var(--text); }
.brand-text b { display: block; font-size: 14px; font-weight: 600; letter-spacing: -.01em; line-height: 1.2; }
.brand-text small { color: var(--faint); font-size: 11px; }
.search { position: relative; }
.search input {
  width: 100%; height: 32px; border-radius: 8px; border: 1px solid var(--input-border); background: var(--input);
  color: var(--text); padding: 0 44px 0 30px; font: inherit; font-size: 12.5px;
}
.search input::placeholder { color: var(--faint); }
.search input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.search svg { position: absolute; left: 9px; top: 9px; width: 14px; height: 14px; color: var(--faint); pointer-events: none; }
.search .kbd { position: absolute; right: 7px; top: 7px; height: 18px; padding: 0 5px; border-radius: 5px; border: 1px solid var(--input-border); color: var(--faint); font-size: 10.5px; line-height: 16px; background: var(--card); }
.sidebar .search { margin: 2px 0 8px; }
.nav-group { margin-top: 6px; }
.nav-group.nav-end { margin-top: auto; }
.nav-title { font-size: 10.5px; font-weight: 600; color: var(--faint); padding: 6px 8px 4px; letter-spacing: .08em; text-transform: uppercase; }
.nav { display: grid; gap: 1px; }
.nav a {
  display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px;
  color: var(--secondary); font-weight: 500; border: 1px solid transparent; font-size: 13px;
}
.nav a:hover { background: var(--hover); color: var(--text); }
.nav a.active { background: var(--nav-active); color: var(--nav-fg); border-color: var(--nav-border); }
.nav svg { width: 15px; height: 15px; flex: none; color: var(--muted); }
.nav a.active svg { color: var(--brand-ink); } .nav a:hover svg { color: var(--text); }

.main { min-width: 0; display: flex; flex-direction: column; }
.mobile-top { display: none; }
.topbar {
  height: 48px; display: flex; align-items: center; gap: 12px; padding: 0 20px;
  border-bottom: 1px solid var(--line); background: var(--sidebar); position: sticky; top: 0; z-index: 5;
}
.crumbs { display: flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; min-width: 0; font-size: 12.5px; }
.crumbs a:hover { color: var(--text); }
.crumbs .here { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crumbs svg { width: 13px; height: 13px; color: var(--faint); flex: none; }
.content { padding: 16px 20px 64px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; max-width: 1440px; width: 100%; align-content: start; }
.page-head { display: grid; gap: 2px; padding: 2px 0; }
.page-head .lede { color: var(--muted); max-width: 72ch; margin: 0; }
.section-title { font-size: 14px; color: var(--secondary); margin: 6px 0 -4px; }
.section-label { display: flex; align-items: center; gap: 10px; margin: 6px 0 -2px; }
.section-label span { font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; color: var(--faint); white-space: nowrap; }
.section-label::after { content: ""; flex: 1; height: 1px; background: var(--line); }

/* status bar (desktop) and tab bar (mobile) */
.statusbar {
  position: fixed; left: 232px; right: 0; bottom: 0; height: 36px; z-index: 6;
  display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 0 20px;
  background: var(--sidebar); border-top: 1px solid var(--line); font-size: 12px; color: var(--secondary);
}
.status-left, .status-right { display: flex; align-items: center; gap: 12px; min-width: 0; }
.live { display: inline-flex; align-items: center; gap: 7px; color: var(--text); font-weight: 500; }
.live-dot { width: 7px; height: 7px; border-radius: 99px; background: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.statusbar .sep { width: 1px; height: 14px; background: var(--line); }
.statusbar b { color: var(--text); font-weight: 600; }
.status-links { display: flex; gap: 14px; }
.status-links a { color: var(--muted); } .status-links a:hover { color: var(--text); }
.theme-pick { display: inline-flex; gap: 2px; padding: 2px; border-radius: 8px; border: 1px solid var(--input-border); background: var(--input); }
.theme-pick a { width: 26px; height: 22px; border-radius: 6px; display: grid; place-items: center; color: var(--muted); }
.theme-pick a:hover { color: var(--text); background: var(--hover); }
.theme-pick a.active { background: var(--nav-active); color: var(--brand-ink); box-shadow: inset 0 0 0 1px var(--nav-border); }
.theme-pick svg { width: 13px; height: 13px; }
.tabbar { display: none; }

/* ---------- cards & tiles ---------- */
.grid { display: grid; gap: 12px; }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-wide { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.stack { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; align-content: start; }
.card {
  background: var(--card); border: 1px solid var(--card-border); border-radius: 12px; padding: 14px 16px;
  box-shadow: var(--shadow); min-width: 0;
}
.card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2, .card-head h3 { font-size: 14px; }
.card-head h2 .muted { font-weight: 500; }
.card-title { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; min-width: 0; flex: 1 1 160px; }
.card-head .sub { color: var(--muted); font-size: 12px; }
.card-right { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ico {
  width: 24px; height: 24px; border-radius: 7px; background: var(--icon-bg); border: 1px solid var(--card-border);
  display: grid; place-items: center; color: var(--text); flex: none;
}
.ico svg { width: 13px; height: 13px; }
.ico.brand { background: var(--brand-soft); color: var(--brand-ink); border-color: transparent; }
.ico.lg { width: 40px; height: 40px; border-radius: 11px; margin: 0 auto 8px; } .ico.lg svg { width: 18px; height: 18px; }
.tile { padding: 12px 14px; }
.tile .label { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 12px; color: var(--secondary); }
.tile .label .ico { width: 22px; height: 22px; border-radius: 6px; } .tile .label .ico svg { width: 12px; height: 12px; }
.tile .value { font-size: 24px; font-weight: 600; letter-spacing: -.02em; margin: 10px 0 1px; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile .note { color: var(--muted); font-size: 12px; }
.hero { font-size: 28px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.dim { display: grid; } .dim .tile .value { color: var(--muted); }
.empty { text-align: center; padding: 28px 12px; color: var(--muted); display: grid; gap: 6px; justify-items: center; }
.empty.tight { padding: 6px 0; text-align: left; justify-items: start; }
.empty h1 { color: var(--text); }
.notice { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.page-foot { margin: 0; }
.foot-note { margin: 10px 0 0; }

/* token / wallet header */
.token-row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.token-row > * { min-width: 0; }
.token-name { min-width: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 1px; max-width: 100%; flex: 1 1 200px; }
.token-name a.ext, .token-name .mono { overflow-wrap: anywhere; word-break: break-all; }
.token-name h1 .muted { font-weight: 500; }
.token-price { margin-left: auto; text-align: right; }
.chips-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.chips-row.tight { margin-top: 3px; gap: 4px; }
.chips-row .card-right { margin-left: auto; }
a.ext { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: 12px; }
a.ext:hover { color: var(--text); }
a.ext svg { width: 12px; height: 12px; }

/* ---------- chips, pills, status ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px; height: 22px; padding: 0 8px; border-radius: 999px;
  background: var(--muted-bg); color: var(--secondary); font-size: 11.5px; font-weight: 500; white-space: nowrap;
  border: 1px solid transparent; font-variant-numeric: tabular-nums;
}
.chip svg { width: 11px; height: 11px; flex: none; }
.chip .avatar { width: 13px; height: 13px; border-radius: 4px; }
.chip.blue { background: var(--info-soft); color: var(--info-ink); }
.chip.strong { background: var(--card); color: var(--text); border-color: var(--card-border); font-weight: 600; }
.chip.warn, .chip.fresh { background: var(--warn-soft); color: var(--warn-ink); }
.chip.creator-linked, .chip.role-origin { background: var(--creator-soft); color: var(--creator-ink); }
.chip.role-creator { background: var(--creator); color: #fff; }
.chip.role-funder { background: var(--info-soft); color: var(--info-ink); }
.chip.role-exchange, .chip.role-bridge, .chip.role-known { background: var(--muted-bg); color: var(--text); }
a.chip:hover { border-color: var(--input-border); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.pill.up { background: var(--good-soft); color: var(--good-ink); }
.pill.down { background: var(--lose-soft); color: var(--bad-ink); }
.pill svg { width: 10px; height: 10px; }
.insight { display: flex; gap: 10px; align-items: flex-start; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--card-border); flex-wrap: wrap; }
.insight + .insight { margin-top: 6px; }
.insight .tag { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; display: inline-flex; gap: 5px; align-items: center; white-space: nowrap; padding-top: 2px; }
.insight .tag svg { width: 13px; height: 13px; }
.insight > span:not(.tag) { flex: 1 1 240px; min-width: 0; }
.insight.good { background: var(--good-soft); } .insight.good .tag { color: var(--good-ink); }
.insight.warn { background: var(--warn-soft); } .insight.warn .tag { color: var(--warn-ink); }
.insight.bad { background: var(--bad-soft); } .insight.bad .tag { color: var(--bad-ink); }
.insight.info { background: var(--info-soft); } .insight.info .tag { color: var(--info-ink); }
.verdict { align-items: center; } .verdict b { font-weight: 600; }
.running { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; align-items: center; padding: 7px 10px; border-radius: 8px; background: var(--info-soft); border: 1px solid var(--card-border); min-width: 220px; }
.running .spin { color: var(--info-ink); display: grid; place-items: center; } .running .spin svg { width: 13px; height: 13px; animation: spin 1.4s linear infinite; }
.running-text { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; font-size: 12px; color: var(--secondary); }
.running-text b { color: var(--text); }
.running-text .count { color: var(--muted); font-variant-numeric: tabular-nums; }
.running .bar { grid-column: 1 / -1; height: 3px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.running .bar .fill { height: 100%; background: var(--series-1); border-radius: 99px; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .running .spin svg { animation: none; } }

/* ---------- forms & buttons ---------- */
.analyze { display: flex; gap: 8px; flex-wrap: wrap; align-items: flex-end; }
.analyze input[type=text], .analyze input[type=number] {
  height: 36px; border-radius: 9px; border: 1px solid var(--input-border); background: var(--input);
  color: var(--text); padding: 0 11px; font: inherit;
}
.analyze input[type=text] { flex: 1 1 320px; }
.analyze input[type=number] { width: 110px; }
.analyze input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field { display: inline-flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); }
.btn {
  height: 36px; padding: 0 14px; border-radius: 9px; border: 1px solid transparent; background: var(--cta); color: var(--cta-fg);
  font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .22);
}
.btn:hover { background: var(--cta-hover); }
.btn.ghost { background: var(--card); color: var(--text); border-color: var(--input-border); box-shadow: none; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12px; border-radius: 8px; gap: 6px; }
.btn.lg { height: 44px; padding: 0 16px; font-size: 14px; border-radius: 10px; width: 100%; justify-content: center; }
.btn svg { width: 14px; height: 14px; flex: none; } .btn.sm svg { width: 12px; height: 12px; } .btn.lg svg { width: 16px; height: 16px; }
form.inline { display: inline-flex; margin: 0; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; margin: 0 -8px; padding: 0 8px; }
.table-wrap.tall { max-height: 560px; overflow-y: auto; }
table.data { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.data th {
  text-align: left; color: var(--muted); font-weight: 500; font-size: 11.5px; padding: 4px 8px 7px; white-space: nowrap;
  border-bottom: 1px solid var(--card-border); background: var(--card);
}
table.data.sticky thead th { position: sticky; top: 0; z-index: 1; }
table.data td { padding: 7px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.data tbody tr:last-child td { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--hover); }
table.data td:first-child, table.data th:first-child { padding-left: 4px; }
table.data td:last-child, table.data th:last-child { padding-right: 4px; }
table.data .num { text-align: right; }
table.data td.num b { font-weight: 600; display: block; }
table.data td.num small { display: block; font-size: 11px; }
table.data td.wrap { white-space: normal; }
td.clip { max-width: 280px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
tr.residual td, tr.residual b { color: var(--muted); font-weight: 500; }
tr.residual .fill { background: var(--series-prior); }
tr.creator-row td { background: var(--creator-soft); }
.who { display: flex; align-items: center; gap: 8px; }
.who b { font-weight: 600; display: block; line-height: 1.2; }
.who small { color: var(--faint); font-size: 10.5px; }
.avatar { width: 26px; height: 26px; border-radius: 7px; flex: none; display: inline-block; }
.avatar.token { object-fit: cover; background: var(--muted-bg); border: 1px solid var(--card-border); }
.avatar.xs { width: 16px; height: 16px; border-radius: 4px; }
.avatar.sm { width: 22px; height: 22px; border-radius: 6px; }
.avatar.lg { width: 40px; height: 40px; border-radius: 11px; }
.stack-cell { display: grid; gap: 2px; justify-items: start; }
.ident { display: inline-grid; gap: 0; line-height: 1.25; }
.ident b { font-weight: 600; }
.ident small { color: var(--faint); font-size: 10.5px; }
a.node-link:hover .ident b { text-decoration: underline; }
.up-ink { color: var(--good-ink); } .down-ink { color: var(--bad-ink); }
.txlink { color: var(--link); font-weight: 500; white-space: nowrap; display: inline-flex; align-items: center; gap: 3px; font-size: 12px; }
.txlink:hover { text-decoration: underline; }
.txlink svg { width: 11px; height: 11px; }
.gini { display: flex; gap: 10px; align-items: baseline; margin: 0 0 8px; flex-wrap: wrap; }
.gini b { font-size: 20px; font-weight: 600; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* bars: allocation, meter, retained, progress */
.alloc { display: flex; align-items: center; gap: 8px; min-width: 140px; }
.alloc .track { flex: 1; height: 5px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.alloc .fill { height: 100%; border-radius: 99px; background: var(--series-1); }
.alloc span { width: 44px; text-align: right; color: var(--secondary); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.meter { height: 5px; border-radius: 99px; background: var(--info-soft); position: relative; margin: 10px 0 5px; }
.meter .fill { position: absolute; inset: 0 auto 0 0; border-radius: 99px; background: var(--series-1); }
.meter .ci { position: absolute; top: -3px; height: 11px; border-left: 1px solid var(--axis-ink); border-right: 1px solid var(--axis-ink); }
.retain { display: grid; gap: 3px; min-width: 160px; }
.retain .track { height: 5px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.retain .fill { height: 100%; border-radius: 99px; background: var(--series-1); }
.retain span { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.retain b { color: var(--text); font-weight: 600; }
.progress { height: 5px; border-radius: 99px; background: var(--info-soft); overflow: hidden; margin: 10px 0 6px; }
.progress .fill { height: 100%; background: var(--series-1); border-radius: 99px; }
.progress-card .stage { font-size: 18px; font-weight: 600; letter-spacing: -.01em; margin: 4px 0; }

/* facts (label / value rows) and mini tiles */
.facts { display: grid; grid-template-columns: minmax(0, 1fr); margin: 8px 0 10px; }
.facts.wide { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 0 20px; margin: 8px 0; }
.fact { display: flex; justify-content: space-between; gap: 10px; padding: 5px 0; border-bottom: 1px solid var(--line); font-size: 12.5px; align-items: center; min-width: 0; }
.fact .k { color: var(--muted); flex: none; }
.fact .v { font-variant-numeric: tabular-nums; text-align: right; min-width: 0; display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.fact .v b { font-weight: 600; }
.minis { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 6px; margin: 10px 0 0; }
.mini { display: grid; gap: 1px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--head); }
.mini .k { font-size: 11px; color: var(--muted); }
.mini .v { font-size: 15px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.origins-row { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; margin-top: 10px; }
.origin-pill { display: inline-flex; align-items: center; gap: 8px; padding: 4px 9px 4px 7px; border: 1px solid var(--card-border); border-radius: 8px; font-size: 12px; }
.launch-line { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; color: var(--secondary); font-size: 12.5px; margin: 10px 0 0; }
.launch-line svg { width: 13px; height: 13px; color: var(--brand-ink); flex: none; }
.launch-line > span:first-of-type { flex: 1 1 220px; min-width: 0; }
.launch-line b { color: var(--text); font-variant-numeric: tabular-nums; }
.bundle .card-head .sub { display: inline-flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.bundle-part { padding: 10px 0; border-top: 1px solid var(--line); }
.bundle-part:first-of-type { border-top: 0; padding-top: 0; }
.bundle-wallet { border-color: var(--brand-soft); box-shadow: 0 0 0 1px var(--brand-soft); }
.edge-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* funding waves */
.waves { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.wave { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; }
.wave-when { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.wave-stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.wave-funders { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.chart .launch { stroke: var(--brand-ink); stroke-width: 1.5; }

/* trail (vertical breadcrumb) */
.trail { list-style: none; margin: 2px 0 0; padding: 0 0 0 18px; position: relative; }
.trail::before { content: ""; position: absolute; left: 5px; top: 8px; bottom: 10px; width: 2px; background: var(--line); border-radius: 2px; }
.trail li { position: relative; padding: 0 0 12px; }
.trail li::before { content: ""; position: absolute; left: -18px; top: 5px; width: 10px; height: 10px; border-radius: 99px; background: var(--card); border: 2px solid var(--axis-ink); }
.trail li.here::before { background: var(--brand); border-color: var(--brand); }
.trail li:last-child { padding-bottom: 0; }
.trail-node { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.trail-edge { color: var(--muted); font-size: 11.5px; margin-top: 3px; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.trail-edge svg { width: 11px; height: 11px; }

/* ---------- holder map + panel ---------- */
.hmap { display: grid; grid-template-columns: minmax(0, 2fr) minmax(250px, 1fr); gap: 12px; align-items: start; }
.hpanels { display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--card-border); border-radius: 10px; background: var(--head); min-height: 180px; }
.hpanel { display: none; padding: 12px 14px; scroll-margin-top: 64px; }
.hpanel:target { display: block; }
.hpanel-default { display: block; order: -1; }
.hpanel:target ~ .hpanel-default { display: none; }
.hpanel-head { display: flex; gap: 8px; align-items: center; }
.hpanel-head b { font-weight: 600; }
.hpanel-big { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin: 8px 0 0; font-variant-numeric: tabular-nums; }
.hpanel .facts { margin: 4px 0 10px; }
.hpanel .btn { width: 100%; justify-content: center; }
.hpanel-hint { display: flex; gap: 8px; align-items: center; color: var(--secondary); font-size: 12.5px; margin-bottom: 10px; }
.hpanel-hint b { color: var(--text); }

/* ---------- charts ---------- */
.chart { margin: 0; }
.chart svg { width: 100%; height: auto; display: block; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; }
.chart .baseline { stroke: var(--axis); stroke-width: 1; }
.chart .tick { fill: var(--axis-ink); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart .val { fill: var(--text); font-size: 12px; font-weight: 600; font-variant-numeric: tabular-nums; }
.chart .s1 { fill: var(--series-1); }
.chart .s2 { fill: var(--series-prior); }
.chart .col:hover .s1, .chart .col:hover .s2 { opacity: .78; }
.chart .hit { fill: transparent; }
.chart-note { margin: 6px 0 0; }
.legend { display: flex; gap: 12px; flex-wrap: wrap; color: var(--secondary); font-size: 12px; margin-top: 8px; align-items: center; }
.legend.stack { flex-direction: column; align-items: flex-start; gap: 6px; margin-top: 0; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend b { color: var(--text); font-weight: 600; }
.legend .k1 { background: var(--series-1); } .legend .k2 { background: var(--series-prior); }
.chart .track { fill: var(--muted-bg); }
.chart .dv-n4, .legend .dv-n4 { fill: var(--dv-n4); background: var(--dv-n4); }
.chart .dv-n3, .legend .dv-n3 { fill: var(--dv-n3); background: var(--dv-n3); }
.chart .dv-n2, .legend .dv-n2 { fill: var(--dv-n2); background: var(--dv-n2); }
.chart .dv-n1, .legend .dv-n1 { fill: var(--dv-n1); background: var(--dv-n1); }
.chart .dv-0, .legend .dv-0 { fill: var(--dv-0); background: var(--dv-0); }
.chart .dv-p1, .legend .dv-p1 { fill: var(--dv-p1); background: var(--dv-p1); }
.chart .dv-p2, .legend .dv-p2 { fill: var(--dv-p2); background: var(--dv-p2); }
.chart .dv-p3, .legend .dv-p3 { fill: var(--dv-p3); background: var(--dv-p3); }
.chart .dv-p4, .legend .dv-p4 { fill: var(--dv-p4); background: var(--dv-p4); }
.chart .col:hover [class^="dv-"] { opacity: .78; }
.chart .hm0, .legend .hm0 { fill: var(--hm-0); background: var(--hm-0); }
.chart .hm1, .legend .hm1 { fill: var(--hm-1); background: var(--hm-1); }
.chart .hm2, .legend .hm2 { fill: var(--hm-2); background: var(--hm-2); }
.chart .hm3, .legend .hm3 { fill: var(--hm-3); background: var(--hm-3); }
.chart .hm4, .legend .hm4 { fill: var(--hm-4); background: var(--hm-4); }
.chart .hm5, .legend .hm5 { fill: var(--hm-5); background: var(--hm-5); }
.chart .col:hover [class^="hm"] { stroke: var(--text); stroke-width: 1.5; }
.legend .ramp { display: inline-flex; gap: 2px; align-items: center; }
.legend .ramp i { margin: 0; border-radius: 2px; }
.chart .line { fill: none; stroke: var(--series-1); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .area { fill: var(--series-1); opacity: .10; }
.chart .guide { stroke: var(--axis); stroke-width: 1; opacity: 0; }
.chart .mk, .chart .end { fill: var(--series-1); stroke: var(--card); stroke-width: 2; }
.chart .mk { opacity: 0; }
.chart .pt:hover .mk, .chart .pt:hover .guide { opacity: 1; }
.chart .bub { stroke: var(--card); stroke-width: 2; transition: opacity .12s; }
.chart .bub.c0, .legend .bub.c0 { fill: var(--cat-1); background: var(--cat-1); }
.chart .bub.c1, .legend .bub.c1 { fill: var(--cat-2); background: var(--cat-2); }
.chart .bub.c2, .legend .bub.c2 { fill: var(--cat-3); background: var(--cat-3); }
.chart .bub.cx, .legend .bub.cx { fill: var(--series-prior); background: var(--series-prior); }
.chart .bub.cn, .legend .bub.cn { fill: var(--bub-none); background: var(--bub-none); }
.legend i.bub { border-radius: 99px; }
.chart a:hover .bub { opacity: .78; }
.chart a:focus-visible { outline: none; } .chart a:focus-visible .bub { stroke: var(--focus); stroke-width: 3; }
.chart .bub-label { fill: var(--text); font-size: 12px; font-weight: 600; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; pointer-events: none; font-variant-numeric: tabular-nums; }
details.tableview { margin-top: 8px; color: var(--secondary); font-size: 12px; }
details.tableview summary { cursor: pointer; color: var(--muted); font-weight: 500; }
details.tableview summary:hover { color: var(--text); }
details.tableview table { margin-top: 6px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
details.tableview td, details.tableview th { padding: 3px 12px 3px 0; text-align: left; border-bottom: 1px solid var(--line); }
details.tableview th { color: var(--muted); font-weight: 500; }

/* dox graph */
.dox .edge-line { fill: none; stroke: var(--axis); stroke-width: 1.25; }
.dox .edge-hit { fill: none; stroke: transparent; stroke-width: 14; }
.dox .edge:hover .edge-line { stroke: var(--text); stroke-width: 1.5; }
.dox .edge-label { fill: var(--axis-ink); font-size: 10.5px; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; font-variant-numeric: tabular-nums; }
.dox .edge:hover .edge-label { fill: var(--text); }
.dox .dn-hit { fill: transparent; }
.dox .dn { stroke: var(--card); stroke-width: 2; }
.dn.dn-bundler.b0 { fill: var(--cat-1); background: var(--cat-1); }
.dn.dn-bundler.b1 { fill: var(--cat-2); background: var(--cat-2); }
.dn.dn-bundler.b2 { fill: var(--cat-3); background: var(--cat-3); }
.dn.dn-bundler.bx { fill: var(--series-prior); background: var(--series-prior); }
.dn.dn-creator { fill: var(--creator); background: var(--creator); }
.dox .dn-funder { fill: var(--card); stroke: var(--series-1); stroke-width: 2.5; }
.dox .dn-origin { fill: var(--card); stroke: var(--creator); stroke-width: 2.5; }
.dox .dn-exchange, .dox .dn-bridge, .dox .dn-known { fill: var(--bub-none); stroke: var(--axis-ink); stroke-width: 1.5; }
.legend i.dn { border-radius: 99px; width: 11px; height: 11px; box-sizing: border-box; }
.legend i.dn-funder { background: var(--card); border: 2.5px solid var(--series-1); }
.legend i.dn-origin { background: var(--card); border: 2.5px solid var(--creator); }
.legend i.dn-exchange { background: var(--bub-none); border: 1.5px solid var(--axis-ink); }
.dox a:hover .dn { opacity: .8; }
.dox .dn-label { fill: var(--secondary); font-size: 11px; font-family: ui-monospace, "SF Mono", Menlo, monospace; paint-order: stroke; stroke: var(--card); stroke-width: 3px; stroke-linejoin: round; }
.dox .dn-label.named { font-family: Inter, system-ui, sans-serif; font-weight: 600; fill: var(--text); }
.dox a:hover .dn-label { fill: var(--text); }

/* ---------- traits & evidence ---------- */
.trait h3 { font-size: 13px; }
.trait-head { display: flex; justify-content: space-between; gap: 8px; align-items: center; }
.trait .big { font-size: 22px; font-weight: 600; letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.trait p { margin: 5px 0 0; color: var(--secondary); font-size: 12.5px; }
.evidence { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 5px; }
.evidence li { display: flex; gap: 8px; align-items: baseline; font-size: 12px; color: var(--secondary); }
.evidence li .avatar { align-self: center; }
.evidence a { color: var(--link); font-weight: 500; white-space: nowrap; }
.evidence a:hover { text-decoration: underline; }
.steps { margin: 0; padding-left: 18px; display: grid; gap: 6px; }

/* ---------- login ---------- */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card { width: min(400px, 100%); display: grid; gap: 10px; padding: 28px 28px 22px; box-shadow: var(--shadow-pop); justify-items: stretch; }
.auth-logo { display: grid; place-items: center; margin-bottom: 4px; }
.auth-card h1 { font-size: 20px; text-align: center; }
.auth-sub { text-align: center; margin: 0 0 6px; }
#auth-error { margin: 0; padding: 8px 12px; border-radius: 8px; background: var(--bad-soft); color: var(--bad-ink); border: 1px solid var(--card-border); font-size: 12.5px; }
#auth-error[hidden] { display: none; }
.auth-divider { display: flex; align-items: center; gap: 10px; margin: 4px 0; color: var(--faint); font-size: 10.5px; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-options { display: grid; gap: 8px; }
.auth-options .btn.lg { justify-content: flex-start; text-align: left; height: auto; min-height: 44px; padding: 7px 14px; }
.auth-options .btn.lg span { display: grid; line-height: 1.2; }
.auth-options .btn.lg small { color: var(--muted); font-weight: 400; font-size: 11.5px; }
.auth-opt summary { list-style: none; cursor: pointer; }
.auth-opt summary::-webkit-details-marker { display: none; }
.auth-opt[open] summary { border-color: var(--focus); }
.auth-form { display: grid; gap: 6px; padding: 10px 2px 4px; }
.auth-form label { font-size: 12px; font-weight: 500; color: var(--secondary); }
.auth-form input { height: 38px; border-radius: 9px; border: 1px solid var(--input-border); background: var(--input); color: var(--text); padding: 0 12px; font: inherit; }
.auth-form input:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.auth-form .btn { justify-content: center; }
.auth-alt { text-align: center; margin: 4px 0 0; font-size: 12.5px; color: var(--muted); }
.auth-alt a { color: var(--brand-ink); font-weight: 600; } .auth-alt a:hover { text-decoration: underline; }
.auth-foot { display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--faint); font-size: 11.5px; margin: 6px 0 0; }
.auth-foot svg { width: 13px; height: 13px; color: var(--brand-ink); }
.auth-social { display: flex; justify-content: center; gap: 6px; }
.auth-social a { width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; color: var(--muted); border: 1px solid transparent; }
.auth-social a:hover { color: var(--text); background: var(--hover); border-color: var(--line); }
.auth-social svg { width: 14px; height: 14px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-wide, .g3 { grid-template-columns: 1fr; }
  .hmap { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .app { grid-template-columns: 1fr; grid-template-rows: auto 1fr; align-content: start; }
  .sidebar, .statusbar, .skip { display: none; }
  .mobile-top { display: flex; align-items: center; gap: 10px; padding: 8px 12px; background: var(--sidebar); border-bottom: 1px solid var(--line); }
  .mobile-top .brand { padding: 0; gap: 7px; flex: none; }
  .mobile-top .search { flex: 1; }
  .mobile-top .search input { padding-right: 10px; }
  .topbar { height: 40px; padding: 0 12px; position: static; }
  .tabbar {
    display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
    background: var(--sidebar); border-top: 1px solid var(--line); padding: 4px 4px calc(4px + env(safe-area-inset-bottom));
  }
  .tabbar a { display: grid; justify-items: center; gap: 2px; padding: 6px 2px; border-radius: 8px; color: var(--muted); font-size: 10.5px; font-weight: 500; }
  .tabbar a svg { width: 18px; height: 18px; }
  .tabbar a.active { color: var(--brand-ink); background: var(--nav-active); }
  .content { padding: 12px 12px 84px; gap: 10px; }
  .g4, .g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-wide, .g4.plans { grid-template-columns: 1fr; }
  .card { padding: 12px 12px; border-radius: 10px; }
  .tile { padding: 10px 12px; } .tile .value { font-size: 20px; margin-top: 6px; } .tile .note { font-size: 11px; }
  .token-price { margin-left: 0; text-align: left; width: 100%; }
  .hero { font-size: 24px; }
  .hide-m { display: none; }
  table.data { font-size: 12px; }
  table.data td, table.data th { padding: 6px 6px; }
  .table-wrap.tall { max-height: none; }
  .facts.wide { grid-template-columns: 1fr; }
  .wave-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hpanel .btn { height: 38px; }
  .insight { flex-direction: column; gap: 4px; }
  .insight > span:not(.tag) { flex-basis: auto; }
  .chips-row .card-right { margin-left: 0; width: 100%; }
  .card-right { margin-left: 0; }
  .hpanel-big { font-size: 20px; }
  .auth-card { padding: 22px 18px 18px; }
}

/* ---------- account ---------- */
.card.narrow { max-width: 520px; }
form.stack { display: grid; gap: 10px; }
form.stack input[type=text] { height: 40px; border-radius: 10px; border: 1px solid var(--input-border); background: var(--input); color: var(--text); padding: 0 12px; font: inherit; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.usage-row { display: grid; grid-template-columns: 130px 1fr auto; gap: 10px; align-items: center; margin-top: 8px; font-size: 13px; }
.usage-row .track { height: 6px; border-radius: 99px; background: var(--muted-bg); overflow: hidden; }
.usage-row .fill { height: 100%; background: var(--brand); border-radius: 99px; }
ul.plain { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 8px; font-size: 13px; }
ul.plain svg { width: 14px; height: 14px; vertical-align: -2px; }
#form-error { color: var(--bad-ink); margin: 0; font-size: 13px; }

/* icons inside tables and table views stay inline-sized */
details.tableview svg, table.data td svg, .tableview a svg { width: 12px; height: 12px; vertical-align: -1px; }

/* ---------- upgrade & invoices ---------- */
.plans { align-items: stretch; }
.plan { display: flex; flex-direction: column; }
.plan.current { border-color: var(--nav-border); box-shadow: inset 0 0 0 1px var(--nav-border), var(--shadow); }
.plan .card-head h2 { text-transform: capitalize; }
.plan-price { font-size: 24px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.plan-price small { font-size: 12px; font-weight: 500; color: var(--muted); letter-spacing: 0; }
.plan ul.plain.allow { margin: 10px 0; gap: 5px; font-size: 12.5px; color: var(--secondary); }
.plan ul.plain.allow b { color: var(--text); font-variant-numeric: tabular-nums; }
.plan form { margin-top: auto; }
.plan form .btn { width: 100%; justify-content: center; }
.chip.good { background: var(--good-soft); color: var(--good-ink); }
.pay-amount { font-size: 32px; font-weight: 600; letter-spacing: -.02em; line-height: 1.1; margin: 2px 0 0; font-variant-numeric: tabular-nums; }
.pay-amount small { font-size: 14px; font-weight: 500; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.pay-amount + p { margin-top: 2px; }
.pay-actions { display: grid; gap: 12px; justify-items: center; margin: 4px 0 12px; }
.pay-actions .btn { width: 100%; max-width: 260px; justify-content: center; }
.qr { display: inline-block; padding: 12px; border-radius: 10px; background: var(--qr-bg); color: var(--qr-fg); line-height: 0; border: 1px solid var(--card-border); }
.qr svg { display: block; max-width: 100%; height: auto; }
.qr.unavailable { line-height: normal; background: var(--muted-bg); color: var(--muted); padding: 24px; }
.addr-line { margin: 8px 0 0; }
.addr-line code { display: block; overflow-wrap: anywhere; word-break: break-all; margin-top: 2px; }
.select-all { user-select: all; -webkit-user-select: all; }
.gap-top { margin-top: 10px; }

/* Research tabs (admin dashboard / client view) */
nav.tabs { display: flex; gap: 4px; margin: 0 0 10px; border-bottom: 1px solid var(--line); }
nav.tabs .tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 12.5px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; text-decoration: none; }
nav.tabs .tab svg { width: 13px; height: 13px; }
nav.tabs .tab:hover { color: var(--text); }
nav.tabs .tab.active { color: var(--text); border-bottom-color: var(--brand); }

/* Copy and drag guard (with assets/guard.js): page text isn't selectable;
   inputs and addresses are, so search and payments keep working. */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea { -webkit-user-select: text; user-select: text; }
img, svg, a { -webkit-user-drag: none; }
[data-copy], .select-all { cursor: copy; border-bottom: 1px dashed var(--line); }
.copied { position: relative; }
.copied::after { content: "Copied"; position: absolute; left: 50%; top: -24px; transform: translateX(-50%); background: var(--text); color: var(--bg, #0b0d12); font: 600 11px/1 system-ui, sans-serif; padding: 5px 7px; border-radius: 6px; white-space: nowrap; }

/* Public front page (signed out). */
body.lp { min-height: 100vh; }
.lp-top { max-width: 1120px; margin: 0 auto; padding: 18px 20px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.lp-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-size: 16px; }
.lp-nav { display: flex; align-items: center; gap: 18px; font-size: 13px; }
.lp-nav a { color: var(--secondary); text-decoration: none; }
.lp-nav a:hover { color: var(--text); }
.lp-nav a.btn { color: var(--brand-fg); }
.lp-nav svg { width: 14px; height: 14px; }
.lp-hero { max-width: 820px; margin: 0 auto; padding: 56px 20px 40px; text-align: center; }
.brand-mark.xl { height: 120px; width: 72px; margin: 0 auto 18px; } .brand-mark.xl svg { height: 120px; }
.lp-hero h1 { font-size: clamp(30px, 5vw, 48px); line-height: 1.08; letter-spacing: -.03em; margin: 0 0 14px; }
.lp-lead { font-size: 16px; color: var(--secondary); margin: 0 auto 26px; max-width: 680px; }
.lp-search { display: flex; gap: 8px; max-width: 620px; margin: 0 auto; }
.lp-search input { flex: 1; height: 42px; border-radius: 10px; border: 1px solid var(--input-border); background: var(--input); color: var(--text); padding: 0 14px; font: inherit; font-size: 14px; }
.lp-search .btn { height: 42px; }
.lp-note { color: var(--muted); font-size: 12.5px; margin-top: 12px; }
.lp-section { max-width: 1120px; margin: 0 auto; padding: 36px 20px; }
.lp-section h2 { font-size: 22px; letter-spacing: -.02em; margin: 0 0 16px; }
.lp-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.lp-grid.three { grid-template-columns: repeat(3, 1fr); }
.lp-card h3 { font-size: 15px; margin: 0 0 6px; }
.lp-card p { color: var(--secondary); font-size: 13px; margin: 0; }
.lp-stat { display: flex; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.lp-stat b { font-size: 28px; color: var(--brand); letter-spacing: -.02em; }
.lp-stat span { color: var(--muted); font-size: 12px; }
.lp-plan { display: flex; flex-direction: column; gap: 10px; }
.lp-plan h3 { text-transform: capitalize; }
.lp-price { font-size: 26px; font-weight: 700; } .lp-price small { font-size: 12px; color: var(--muted); font-weight: 500; }
.lp-plan ul { flex: 1; font-size: 13px; } .lp-plan li svg { width: 13px; height: 13px; color: var(--brand); vertical-align: -2px; }
.lp-faq { display: grid; gap: 8px; max-width: 820px; }
.lp-faq summary { cursor: pointer; font-weight: 600; }
.lp-faq p { color: var(--secondary); margin: 8px 0 0; }
.lp-cta { text-align: center; padding: 48px 20px; }
.lp-cta h2 { font-size: 26px; margin: 0 0 16px; }
.lp-foot { max-width: 1120px; margin: 0 auto; padding: 24px 20px 40px; display: flex; gap: 18px; color: var(--muted); font-size: 12.5px; border-top: 1px solid var(--line); }
.lp-foot a { color: var(--muted); }
@media (max-width: 760px) {
  .lp-nav a:not(.btn):not([aria-label]) { display: none; }
  .lp-grid, .lp-grid.three { grid-template-columns: 1fr; }
  .lp-search { flex-direction: column; }
}

.lp-cta .btn.lg { width: auto; display: inline-flex; padding: 0 28px; }
.lp-foot { flex-wrap: wrap; }
@media (max-width: 760px) { .lp-search input { flex: none; } }

/* Account settings rows (theme, support, log out); the only place to reach them on phones. */
.settings-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.settings-row:first-of-type { border-top: 0; }
.settings-row > span { color: var(--secondary); font-size: 13px; }

/* Inline forms wrap instead of pushing their button out of the card. */
form.inline { flex-wrap: wrap; gap: 8px; align-items: center; max-width: 100%; }
form.inline input[type="text"] { flex: 1 1 160px; min-width: 0; }
/* iOS Safari zooms into any field under 16px; phones get 16px fields. */
@media (max-width: 760px) {
  input, select, textarea { font-size: 16px !important; }
}
@media (max-width: 760px) { .grid.stack-m { grid-template-columns: 1fr; } }
