/* DawnTrend — zinc neutrals + one blue accent. Dark is the default theme. */
:root, :root[data-theme='dark'] {
  color-scheme: dark;
  --bg: #09090b;
  --side: #0c0c0e;
  --surface: #111113;
  --surface-2: #18181b;
  --surface-3: #202024;
  --line: #27272a;
  --line-soft: #1d1d21;
  --grid: #1f1f23;
  --text: #fafafa;
  --text-2: #a1a1aa;
  --muted: #71717a;
  --accent: #3b82f6;
  --accent-hi: #60a5fa;
  --accent-soft: rgba(59, 130, 246, .12);
  --accent-ink: #ffffff;
  --s1: #3987e5; --s2: #d95926; --s3: #199e70; --s4: #c98500;
  --s5: #d55181; --s6: #008300; --s7: #9085e9; --s8: #e66767;
  --good: #34d399; --bad: #f87171; --warn: #fbbf24;
  --pos: #3987e5; --neg: #e66767;
  --shadow: 0 1px 0 rgba(255,255,255,.03) inset, 0 12px 32px rgba(0,0,0,.35);
}
:root[data-theme='light'] {
  color-scheme: light;
  --bg: #ffffff; --side: #fafafa; --surface: #ffffff; --surface-2: #f4f4f5; --surface-3: #ececee;
  --line: #e4e4e7; --line-soft: #f0f0f2; --grid: #efeff1;
  --text: #09090b; --text-2: #52525b; --muted: #71717a;
  --accent: #2563eb; --accent-hi: #1d4ed8; --accent-soft: rgba(37, 99, 235, .08);
  --s1: #2a78d6; --s2: #eb6834; --s3: #1baf7a; --s4: #eda100;
  --s5: #e87ba4; --s6: #008300; --s7: #4a3aa7; --s8: #e34948;
  --good: #059669; --bad: #dc2626; --warn: #b45309;
  --pos: #2a78d6; --neg: #e34948;
  --shadow: 0 1px 2px rgba(9,9,11,.04), 0 8px 24px rgba(9,9,11,.06);
}
:root {
  --font: 'Inter', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --display: 'Space Grotesk', 'Inter', ui-sans-serif, system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --r: 12px; --r-sm: 8px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 14.5px/1.55 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.num { font-variant-numeric: tabular-nums; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; vertical-align: -3px; }
h1, h2, h3 { letter-spacing: -.02em; }

/* ---------- shell (top nav) ---------- */
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 24px; }
.top { position: sticky; top: 0; z-index: 30; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); }
.top-row { display: flex; align-items: center; gap: 24px; height: 60px; }
.brand b { font-weight: 600; color: var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font: 600 18px var(--display); letter-spacing: -.025em; color: var(--text); white-space: nowrap; }
.logo { color: var(--text); flex: none; }
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { text-decoration: none; color: var(--text-2); padding: 7px 12px; border-radius: var(--r-sm); font-weight: 500; font-size: 14px; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--surface-2); }
.nav a[aria-current='page'] { color: var(--text); background: var(--surface-2); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn { width: 34px; height: 34px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--line); background: var(--surface); cursor: pointer; color: var(--text-2); flex: none; }
.icon-btn:hover { color: var(--text); background: var(--surface-2); }
#app { padding-top: 8px; padding-bottom: 32px; outline: none; min-height: 70vh; }
#app > .page-head:first-child, #app > .back:first-child { margin-top: 32px; }
.foot { border-top: 1px solid var(--line); margin-top: 32px; padding: 18px 0 32px; color: var(--muted); font-size: 12.5px; }
.foot-row { display: flex; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; align-items: center; }
.conn { display: inline-flex; align-items: center; gap: 8px; color: var(--text-2); font-weight: 500; }
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); display: inline-block; box-shadow: 0 0 0 3px color-mix(in srgb, var(--good) 20%, transparent); flex: none; }
.status-dot.off { background: var(--warn); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warn) 20%, transparent); }

/* ---------- hero ---------- */
.hero { position: relative; text-align: center; padding: 72px 0 30px; }
.hero::before { content: ''; position: absolute; inset: 0; z-index: -1; pointer-events: none; background-image: linear-gradient(var(--line-soft) 1px, transparent 1px), linear-gradient(90deg, var(--line-soft) 1px, transparent 1px); background-size: 32px 32px; mask-image: radial-gradient(60% 70% at 50% 35%, #000, transparent 75%); -webkit-mask-image: radial-gradient(60% 70% at 50% 35%, #000, transparent 75%); }
.eyebrow { display: inline-flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-2); border: 1px solid var(--line); background: var(--surface); padding: 5px 12px; border-radius: 99px; }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--good); animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--good) 60%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px transparent; } }
.hero h1 { font: 600 clamp(36px, 6.2vw, 66px)/1.02 var(--display); letter-spacing: -.045em; margin: 20px auto 16px; max-width: 900px; }
.hero h1 u { text-decoration: none; background-image: linear-gradient(var(--accent), var(--accent)); background-size: 100% 4px; background-position: 0 92%; background-repeat: no-repeat; padding-bottom: 2px; }
.hero .lede { margin: 0 auto 28px; font-size: 17px; }
.hero .prompt-form { max-width: 760px; margin: 0 auto; text-align: left; }
.hero .prompt-examples { justify-content: center; margin-top: 16px; }

/* ---------- ticker ---------- */
.ticker { overflow: hidden; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); margin: 26px 0 0; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; gap: 30px; padding: 10px 0; width: max-content; animation: scroll 70s linear infinite; }
.ticker:hover .ticker-track { animation-play-state: paused; }
@keyframes scroll { to { transform: translateX(-50%); } }
.tick { display: inline-flex; gap: 8px; align-items: center; font-size: 13.5px; white-space: nowrap; text-decoration: none; }
.tick b { font-weight: 500; }
.tick .logo-box.sm, .tick .monogram.sm { width: 22px; height: 22px; border-radius: 6px; }
.tick .logo-box.sm img { width: 15px; height: 15px; }

/* ---------- spotlight ---------- */
.spot { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.spot .card-plot .spark { height: 110px; }
.spot .trend-card { border-color: color-mix(in srgb, var(--accent) 25%, var(--line)); }

/* ---------- page heads ---------- */
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; flex-wrap: wrap; margin-bottom: 22px; }
.page-kicker { font: 500 11.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin: 0 0 10px; display: inline-flex; gap: 8px; align-items: center; }
.page-head h1 { font: 600 clamp(30px, 4.4vw, 46px)/1.04 var(--display); letter-spacing: -.035em; margin: 0 0 10px; }
.accent-period { color: var(--accent); }
.lede { color: var(--text-2); font-size: 16px; margin: 0; max-width: 640px; }

/* ---------- buttons & controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--r-sm); padding: 9px 14px; font-weight: 500; font-size: 14px; cursor: pointer; background: var(--accent); color: var(--accent-ink); text-decoration: none; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--accent-hi); }
.btn.ghost { background: var(--surface); color: var(--text); border-color: var(--line); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.small { padding: 6px 10px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn[aria-pressed='true'].ghost { background: var(--surface-2); border-color: var(--muted); }
.text-link { color: var(--text-2); text-decoration: none; display: inline-flex; align-items: center; gap: 6px; font-weight: 500; font-size: 14px; }
.text-link:hover { color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-size: 13px; font-weight: 500; }
.seg button:hover { color: var(--text); }
.seg button[aria-pressed='true'] { background: var(--surface); color: var(--text); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(0,0,0,.2); }
.sel, .input { border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 8px 10px; font-size: 13.5px; color: var(--text); }
.input { width: 100%; outline: none; }
.input:focus, .sel:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }
.chip, .example { border: 1px solid var(--line); background: var(--surface); color: var(--text-2); border-radius: 99px; padding: 5px 12px; font-size: 13px; cursor: pointer; }
.chip:hover, .example:hover { color: var(--text); border-color: var(--muted); }
.chip[aria-pressed='true'] { background: var(--text); color: var(--bg); border-color: var(--text); }
.tiny-badge { font: 500 11px var(--mono); border: 1px solid var(--line); border-radius: 6px; padding: 2px 7px; color: var(--text-2); background: var(--surface-2); letter-spacing: .02em; white-space: nowrap; }

/* ---------- search ---------- */
.search-surface { margin-bottom: 26px; }
.prompt-form { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 6px 6px 6px 14px; box-shadow: var(--shadow); color: var(--muted); }
.prompt-form:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft), var(--shadow); }
.prompt-form input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 16px; padding: 9px 0; color: var(--text); }
.prompt-form input::placeholder { color: var(--muted); }
.prompt-examples { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.prompt-examples > span { color: var(--muted); font-size: 13px; margin-right: 2px; }

/* ---------- panels, kpis ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 18px 20px; min-width: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.panel-head h2 { font: 600 16px/1.3 var(--display); margin: 0; }
.panel-head p { margin: 3px 0 0; color: var(--muted); font-size: 13px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); padding: 14px 16px; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.kpi strong { font: 600 26px/1.1 var(--display); letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kpi strong.txt { font-size: 18px; line-height: 1.25; white-space: normal; }
.kpi strong small { font-size: 14px; color: var(--muted); font-weight: 500; }
.kpi strong a { text-decoration: none; }
.kpi strong a:hover { color: var(--accent); }
.metric-label { font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kpi-context { color: var(--muted); font-size: 12.5px; }
.up { color: var(--good); } .down { color: var(--bad); } .flat { color: var(--text-2); }
.row-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.note { color: var(--muted); font-size: 12.5px; margin: 10px 0 0; }
.banner { border: 1px solid var(--line); background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 14px; color: var(--text-2); font-size: 13.5px; margin: 0 0 14px; display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.banner.err { border-color: color-mix(in srgb, var(--bad) 50%, var(--line)); color: var(--bad); }
.banner.info { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); background: var(--accent-soft); }
.empty { text-align: center; color: var(--text-2); padding: 40px 16px; }
.empty h2, .empty h3 { color: var(--text); margin: 0 0 6px; font-family: var(--display); }
.skeleton { background: linear-gradient(90deg, var(--surface) 25%, var(--surface-2) 50%, var(--surface) 75%); background-size: 200% 100%; animation: sheen 1.3s infinite; border-radius: var(--r); border: 1px solid var(--line); min-height: 180px; }
@keyframes sheen { to { background-position: -200% 0; } }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; flex-wrap: wrap; margin: 30px 0 14px; }
.section-head h2 { font: 600 20px/1.2 var(--display); margin: 0; }
.section-head p { margin: 4px 0 0; color: var(--muted); font-size: 13.5px; }
.cols-2 { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
.cols-2.even { grid-template-columns: 1fr 1fr; }

/* ---------- entity logos ---------- */
.logo-box { width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--line); background: #fff; display: grid; place-items: center; overflow: hidden; flex: none; }
.logo-box img { width: 26px; height: 26px; object-fit: contain; display: block; }
.logo-box.lg { width: 56px; height: 56px; border-radius: 14px; }
.logo-box.lg img { width: 36px; height: 36px; }
.logo-box.sm { width: 26px; height: 26px; border-radius: 7px; }
.logo-box.sm img { width: 17px; height: 17px; }
.monogram { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 600 14px var(--display); background: var(--surface-3); color: var(--text-2); border: 1px solid var(--line); flex: none; }
.monogram.topic { background: var(--accent-soft); color: var(--accent); border-color: color-mix(in srgb, var(--accent) 30%, var(--line)); }
.monogram.lg { width: 56px; height: 56px; border-radius: 14px; font-size: 19px; }
.monogram.sm { width: 26px; height: 26px; border-radius: 7px; font-size: 10.5px; }

/* ---------- filters ---------- */
#filters { margin-bottom: 14px; }
.filter-top, .filter-bottom { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; align-items: center; }
.filter-bottom { justify-content: flex-start; margin-top: 10px; }
.filter-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-search { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 0 10px; color: var(--muted); }
.filter-search input { border: 0; outline: none; background: transparent; padding: 8px 0; width: 170px; color: var(--text); font-size: 13.5px; }
.filter-context { color: var(--muted); font-size: 12.5px; margin-left: auto; }

/* ---------- entity cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.trend-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); transition: border-color .15s, transform .15s, box-shadow .15s; min-width: 0; }
.trend-card:hover { border-color: color-mix(in srgb, var(--text) 22%, var(--line)); transform: translateY(-2px); box-shadow: var(--shadow); }
.card-link { display: flex; flex-direction: column; gap: 12px; padding: 16px; text-decoration: none; height: 100%; }
.card-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.card-id { min-width: 0; flex: 1; }
.card-id h3 { margin: 0; font: 600 16.5px/1.25 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-org { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.type-pill { font-size: 11.5px; font-weight: 500; border-radius: 6px; padding: 2px 8px; border: 1px solid var(--line); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.about { color: var(--text-2); font-size: 13.5px; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.9em; }
.card-plot .spark { height: 64px; }
.no-history { display: grid; place-items: center; height: 64px; color: var(--muted); font-size: 12.5px; border: 1px dashed var(--line); border-radius: var(--r-sm); }
.card-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.card-stats > div { min-width: 0; }
.card-stats strong { display: block; font: 600 18px/1.2 var(--display); margin-top: 3px; white-space: nowrap; }
.card-stats strong small { font-size: 12px; font-weight: 500; color: var(--muted); }
.align-right { text-align: right; }
.card-foot { display: flex; justify-content: space-between; align-items: center; color: var(--muted); font-size: 12px; gap: 8px; }
.score-ring { --v: 0; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--accent) calc(var(--v) * 1%), var(--surface-3) 0); flex: none; }
.score-ring span { width: 30px; height: 30px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font: 600 12.5px var(--display); }
.score-ring.lg { width: 64px; height: 64px; }
.score-ring.lg span { width: 52px; height: 52px; font-size: 20px; }

/* status badges — Exploding gets the one accent fill (blue = breakout) */
.badge { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 500; border-radius: 99px; padding: 2px 9px; border: 1px solid var(--line); color: var(--text-2); background: var(--surface-2); white-space: nowrap; }
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.Exploding { background: var(--accent); border-color: var(--accent); color: #fff; }
.badge.Growing { color: var(--good); }
.badge.Declining { color: var(--bad); }
.badge.Peaked { color: var(--warn); }
.badge.New { color: var(--accent); }

/* label badges (site lookup) */
.lbl { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; }
.lbl i { width: 8px; height: 8px; border-radius: 2px; }
.lbl small { color: var(--muted); font: 400 11px var(--mono); }

/* ---------- charts ---------- */
.spark { width: 100%; display: block; }
svg.mini { width: 100px; height: 28px; display: block; }
.chart { position: relative; min-height: 120px; }
.chart svg { display: block; width: 100%; overflow: visible; }
.chart .axis text { fill: var(--muted); font-size: 11px; font-family: var(--mono); }
.chart .gridline { stroke: var(--grid); stroke-width: 1; }
.chart .series { fill: none; stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.chart .draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw 1s ease-out forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.chart .fitline { fill: none; stroke: var(--text-2); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .75; }
.chart .proj-band { fill: var(--text-2); opacity: .05; }
.chart .baseline { stroke: var(--muted); stroke-dasharray: 2 3; stroke-width: 1; }
.chart .cross { stroke: var(--muted); stroke-width: 1; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.tip { position: absolute; pointer-events: none; background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 8px 10px; font-size: 12px; box-shadow: var(--shadow); min-width: 170px; z-index: 5; opacity: 0; transition: opacity .1s; }
.tip .row { display: flex; justify-content: space-between; gap: 14px; align-items: center; }
.tip .sw { display: inline-block; width: 10px; height: 3px; border-radius: 2px; margin-right: 6px; vertical-align: middle; }
.tip .title { color: var(--muted); margin-bottom: 4px; font-family: var(--mono); font-size: 11px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-2); margin-top: 12px; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 14px; height: 3px; border-radius: 2px; display: inline-block; }
.legend i.dash { background: repeating-linear-gradient(90deg, var(--text-2) 0 4px, transparent 4px 7px) !important; }
details.tv summary { cursor: pointer; color: var(--muted); font-size: 12.5px; margin-top: 12px; }
details.tv .table-wrap { margin-top: 8px; max-height: 320px; }

/* donut */
.donut-wrap { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 20px; align-items: center; }
.donut { position: relative; }
.donut svg { width: 100%; height: auto; display: block; }
.donut path { stroke: var(--surface); stroke-width: 2; transition: opacity .15s; }
.donut.hovering path:not(.on) { opacity: .3; }
.donut-center { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; }
.donut-center strong { font: 600 21px/1.1 var(--display); }
.donut-center span { color: var(--muted); font-size: 11.5px; max-width: 110px; }
.donut-legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; font-size: 13px; }
.donut-legend li { display: grid; grid-template-columns: 12px minmax(0, 1fr) auto auto; gap: 8px; align-items: center; padding: 4px 6px; border-radius: 6px; cursor: default; }
.donut-legend li.on { background: var(--surface-2); }
.donut-legend i { width: 10px; height: 10px; border-radius: 3px; }
.donut-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.donut-legend b { font-weight: 600; font-variant-numeric: tabular-nums; }
.donut-legend small { color: var(--muted); font-variant-numeric: tabular-nums; min-width: 48px; text-align: right; }

/* diverging bars */
.bars { display: grid; gap: 8px; font-size: 13px; }
.bar-row { display: grid; grid-template-columns: minmax(90px, 160px) minmax(0, 1fr) 70px; gap: 10px; align-items: center; }
.bar-row > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.bar-track { position: relative; height: 14px; }
.bar-track::before { content: ''; position: absolute; left: 50%; top: -3px; bottom: -3px; width: 1px; background: var(--muted); opacity: .6; }
.bar-fill { position: absolute; top: 1px; bottom: 1px; border-radius: 4px; }
.bar-fill.pos { left: 50%; background: var(--pos); border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bar-fill.neg { right: 50%; background: var(--neg); border-top-right-radius: 0; border-bottom-right-radius: 0; }
.bar-row b { text-align: right; font-weight: 600; font-variant-numeric: tabular-nums; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--r); background: var(--surface); }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th, td { padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; vertical-align: middle; }
th { font: 500 11px var(--mono); color: var(--muted); text-transform: uppercase; letter-spacing: .06em; background: var(--surface-2); position: sticky; top: 0; z-index: 1; }
th button { all: unset; cursor: pointer; }
th button:hover { color: var(--text); }
td.r, th.r { text-align: right; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-2) 70%, transparent); }
tbody tr:last-child td { border-bottom: 0; }
.kw { font-weight: 500; text-decoration: none; display: inline-flex; align-items: center; gap: 8px; }
.kw:hover { color: var(--accent); }
.entity-cell { display: flex; align-items: center; gap: 10px; }
.entity-cell a { text-decoration: none; font-weight: 500; }
.entity-cell a:hover { color: var(--accent); }
.entity-cell small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.table-period { display: block; color: var(--muted); font-size: 11.5px; }
.swatch { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
input[type='checkbox'] { accent-color: var(--accent); width: 15px; height: 15px; cursor: pointer; }
.meter { width: 64px; height: 6px; border-radius: 3px; background: var(--surface-3); display: inline-block; vertical-align: middle; overflow: hidden; margin-right: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); border-radius: 3px; }

/* ---------- detail ---------- */
.back { color: var(--text-2); text-decoration: none; font-size: 13.5px; display: inline-flex; gap: 6px; }
.back:hover { color: var(--text); }
.detail-search { margin: 14px 0 22px; }
.detail-loading { min-height: 420px; }
.detail-head { display: flex; justify-content: space-between; gap: 16px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 18px; }
.detail-id { display: flex; gap: 16px; align-items: center; min-width: 0; }
.detail-head h1 { font: 600 clamp(28px, 4vw, 42px)/1.05 var(--display); letter-spacing: -.03em; margin: 6px 0 6px; }
.detail-head p { margin: 0; color: var(--text-2); max-width: 640px; }
.detail-lower { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-top: 16px; }
.insight-panel h2 { font: 600 20px/1.2 var(--display); margin: 6px 0 8px; }
.insight-panel > p { color: var(--text-2); margin: 0 0 14px; }
.insight-facts { display: grid; gap: 10px; }
.insight-facts > div { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 10px; }
.insight-facts span { color: var(--muted); font-size: 13px; }
.insight-facts strong { text-align: right; font-weight: 600; }
.insight-facts small { display: block; color: var(--muted); font-weight: 400; font-size: 12px; }
.related-list { display: grid; gap: 2px; margin-bottom: 12px; max-height: 360px; overflow: auto; }
.related-row { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto 64px; gap: 10px; align-items: center; padding: 7px 8px; border-radius: 6px; font-size: 13.5px; }
.related-row:hover { background: var(--surface-2); }
.related-row a { text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.related-row span { color: var(--muted); }
.related-row strong { text-align: right; }
.score-card { display: flex; gap: 16px; align-items: center; }
.score-break { display: grid; gap: 8px; margin-top: 14px; }
.score-break div { display: grid; grid-template-columns: 120px minmax(0, 1fr) 36px; gap: 10px; align-items: center; font-size: 12.5px; color: var(--text-2); }
.score-break .track { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.score-break .track i { display: block; height: 100%; background: var(--accent); }
.score-break b { text-align: right; font-weight: 600; color: var(--text); }

/* ---------- bulk ---------- */
.bulk-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-bottom: 8px; }
.bulk-input textarea { width: 100%; min-height: 190px; resize: vertical; border: 1px solid var(--line); background: var(--bg); border-radius: var(--r-sm); padding: 12px; font: 13.5px/1.7 var(--mono); outline: none; color: var(--text); }
.bulk-input textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.bulk-run { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 10px; }
.preset-panel { display: flex; flex-direction: column; gap: 6px; }
.preset { display: flex; justify-content: space-between; align-items: center; gap: 10px; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; color: var(--muted); }
.preset:hover { border-color: var(--muted); background: var(--surface-2); color: var(--text); }
.preset b { color: var(--text); font-weight: 500; display: block; }
.preset small { color: var(--muted); font-size: 12px; }

/* ---------- industries ---------- */
.formula { font-size: 13px; color: var(--text-2); display: grid; gap: 12px; align-content: start; }
.formula h2 { font: 600 16px var(--display); margin: 0; color: var(--text); }
.formula code { display: block; font: 12px/1.65 var(--mono); background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; color: var(--text); white-space: normal; }
.formula dl { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; }
.formula dt { color: var(--muted); }
.formula dd { margin: 0; }
.findings { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.findings li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; color: var(--text-2); font-size: 14px; }
.findings li b { color: var(--text); font-weight: 600; }
.findings .ic { width: 26px; height: 26px; border-radius: 7px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); font: 600 12px var(--mono); }
.ind-link { text-decoration: none; font-weight: 500; display: inline-flex; gap: 8px; align-items: center; }
.ind-link:hover { color: var(--accent); }
.logo-stack { display: inline-flex; }
.logo-stack > * { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.logo-stack > *:first-child { margin-left: 0; }
.bench { display: grid; grid-template-columns: minmax(0, 1fr) 230px auto; gap: 8px; }
.bench-out { margin-top: 14px; }
.verdict { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.verdict > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; }
.verdict strong { font: 600 22px var(--display); display: block; }

/* ---------- method ---------- */
.method-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.method-card h2 { font: 600 16px var(--display); margin: 8px 0 6px; }
.method-card p { margin: 0; color: var(--text-2); font-size: 13.5px; }
.method-number { font: 500 12px var(--mono); color: var(--accent); }
.method-source { margin-top: 16px; display: grid; gap: 8px; }
.method-source h2 { font: 600 16px var(--display); margin: 0; }
.method-source p { margin: 0; color: var(--text-2); }

.fade-in { animation: fadeUp .35s ease both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .cols-2, .cols-2.even, .detail-lower, .bulk-layout, .spot { grid-template-columns: 1fr; }
  .filter-context { margin-left: 0; }
}
@media (max-width: 640px) {
  .wrap { padding: 0 16px; }
  .top-row { gap: 12px; }
  .brand span { display: none; }
  .nav a { padding: 7px 9px; font-size: 13.5px; }
  .hero { padding-top: 44px; }
}
@media (max-width: 560px) {
  .prompt-form { flex-wrap: wrap; padding: 8px; }
  .prompt-form input { width: calc(100% - 40px); }
  .prompt-form .btn { width: 100%; }
  .donut-wrap { grid-template-columns: 1fr; }
  .donut { max-width: 210px; margin: 0 auto; width: 100%; }
  .bench { grid-template-columns: 1fr; }
  .card-stats strong { font-size: 16px; }
  .filter-search input { width: 120px; }
  .bar-row { grid-template-columns: 90px minmax(0, 1fr) 56px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before { animation: none !important; transition: none !important; }
  .chart .draw { stroke-dashoffset: 0; }
}

/* ---------- omnibox ---------- */
.omni-wrap { position: relative; max-width: 760px; margin: 0 auto; text-align: left; }
.detail-search .omni-wrap { max-width: none; }
.omni { position: absolute; left: 0; right: 0; top: calc(100% + 8px); z-index: 25; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: 0 24px 60px rgba(0,0,0,.45); padding: 6px; max-height: min(70vh, 560px); overflow: auto; }
.omni-label { font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 10px 4px; }
.omni-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 10px; border-radius: var(--r-sm); text-decoration: none; }
.omni-row:hover, .omni-row.active, .omni-morph:hover, .omni-morph.active { background: var(--surface-2); }
.omni-id { min-width: 0; display: grid; }
.omni-id b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-id small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.omni-right { display: inline-flex; align-items: center; gap: 10px; font-size: 13px; }
.omni-right b { min-width: 52px; text-align: right; font-weight: 600; }
.omni-morph { display: block; text-decoration: none; border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent-soft) 60%, var(--surface)); border-radius: var(--r-sm); padding: 10px 12px 12px; margin-bottom: 4px; animation: morph .22s ease both; }
@keyframes morph { from { opacity: 0; transform: scale(.985); } }
.omni-intent { display: inline-block; font: 500 10.5px var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--accent); margin-bottom: 8px; }
.morph-body { display: flex; align-items: center; gap: 12px; min-width: 0; }
.morph-body .omni-id { flex: 1; }
.morph-body > b { min-width: 56px; text-align: right; }
.morph-spark { width: 140px; flex: none; }
.morph-spark .spark { height: 40px; }
.morph-media { width: 84px; height: 48px; border-radius: 6px; overflow: hidden; background: var(--surface-3); flex: none; }
.morph-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.morph-terms { display: flex; flex-wrap: wrap; gap: 6px; flex: 1; min-width: 0; }
.term { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; background: var(--surface); }
.term i { width: 8px; height: 3px; border-radius: 2px; }
.term i.unk { background: transparent; border: 1px dashed var(--muted); height: 8px; width: 8px; border-radius: 50%; }
.morph-chart { width: 200px; height: 54px; flex: none; }
.omni-foot { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; font: 400 11px var(--mono); color: var(--muted); padding: 8px 10px 4px; border-top: 1px solid var(--line); margin-top: 6px; }

/* preview image banner (entity + site pages) */
.media-banner { position: relative; display: block; height: 180px; border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); margin-bottom: 16px; background: var(--surface-2); }
.media-banner img { width: 100%; height: 100%; object-fit: cover; display: block; }
.media-banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 45%, rgba(0,0,0,.55)); }
.media-banner span { position: absolute; left: 14px; bottom: 10px; z-index: 1; color: #fff; font-size: 12.5px; display: inline-flex; gap: 6px; align-items: center; }
@media (max-width: 640px) {
  .morph-spark, .morph-chart, .morph-media { display: none; }
  .omni-right svg { display: none; }
  .media-banner { height: 120px; }
}

/* ---------- markets ---------- */
.uni-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); margin-top: 8px; }
.uni-card { text-decoration: none; }
.uni-mark { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; font: 600 11px var(--mono); background: var(--accent-soft); color: var(--accent); border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); flex: none; }
.entity-cell .tiny-badge { margin-left: 2px; }
.tiny-badge.ai { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.mover { grid-template-columns: auto minmax(0, 1fr) auto 70px; text-decoration: none; }
.mover-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text) !important; }
.mover-name small { color: var(--muted); font: 400 11px var(--mono); }
.netbar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--surface-3); width: 100%; min-width: 80px; }
.netbar i { display: block; height: 100%; }
.netbar i.u { background: var(--pos); }
.netbar i.d { background: var(--neg); margin-left: auto; }
.card-link > .netbar { margin-top: -4px; }
td .netbar { width: 110px; display: inline-flex; vertical-align: middle; }

/* ---------- product shots ---------- */
.product-shot { display: grid; place-items: center; background: radial-gradient(120% 90% at 50% 20%, #ffffff, #eef0f3); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; flex: none; }
:root[data-theme='dark'] .product-shot, :root:not([data-theme]) .product-shot { background: radial-gradient(120% 90% at 50% 20%, #26272c, #141417); }
.product-shot img { width: 100%; height: 100%; object-fit: contain; padding: 8%; display: block; }
.product-shot.thumb { width: 84px; height: 64px; border-radius: 8px; }
.product-shot.thumb img { padding: 6%; }
.product-shot.card { width: 120px; height: 96px; }
.card-plot.with-shot { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; }
.product-feature { order: 3; margin: 0; display: grid; gap: 6px; }
.product-feature:not(:has(.product-shot:not([hidden]))) { display: none; }
.product-feature .product-shot { width: 280px; height: 200px; }
.product-feature figcaption { color: var(--muted); font-size: 12px; }
.product-feature figcaption a { color: var(--accent); }
.detail-head { align-items: center; }
@media (max-width: 640px) {
  .product-feature .product-shot { width: 100%; height: 180px; }
  .product-feature { order: 0; width: 100%; }
  .product-shot.card { width: 88px; height: 72px; }
}
.detail-head { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "id shot" "actions shot"; align-items: end; gap: 14px 28px; }
.detail-head > .detail-id { grid-area: id; }
.detail-head > .row-actions { grid-area: actions; align-self: start; }
.detail-head > .product-feature { grid-area: shot; order: 0; }
@media (max-width: 640px) {
  .detail-head { grid-template-columns: 1fr; grid-template-areas: "shot" "id" "actions"; }
}
.chanbar { display: flex; height: 12px; border-radius: 6px; overflow: hidden; margin: 8px 0 4px; background: var(--surface-3); }
.chanbar i { display: block; height: 100%; }
.scatter { width: 100%; height: auto; display: block; }
.scatter .q { stroke: var(--muted); stroke-dasharray: 3 3; }
.scatter text { fill: var(--muted); font: 11px var(--mono); }

.shares { display: grid; gap: 10px; margin-top: 4px; }
.share-row { display: grid; grid-template-columns: minmax(130px, 200px) minmax(0, 1fr) 44px; gap: 10px; align-items: center; font-size: 13px; }
.share-row small { display: block; color: var(--muted); font-size: 11.5px; }
.share-track { height: 10px; border-radius: 5px; background: var(--surface-3); overflow: hidden; }
.share-track i { display: block; height: 100%; border-radius: 5px; }
.share-row b { text-align: right; }
