/* Shared research dashboard system. Loaded after the legacy component styles. */
:root {
  --bg: #0c111b;
  --bg-raised: #101722;
  --surface: #141d2b;
  --surface-2: #1a2535;
  --surface-hover: #202d40;
  --border: #304057;
  --border-soft: #243146;
  --text: #edf2f9;
  --text-dim: #b3bfd0;
  --text-muted: #94a3b8;
  --accent: #a5b4fc;
  --accent-2: #a5b4fc;
  --green: #22c55e;
  --red: #f87171;
  --shadow: 0 8px 28px #0002;
}
html { scroll-padding-top: 140px; }
body, body:has(.dash-shell) { background: var(--bg); font-size: 15px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
button, input, select { font: inherit; }
button, summary, a, input { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
.skip-link { position: fixed; top: -80px; left: 16px; z-index: 100; padding: 12px 20px; background: var(--text); color: var(--bg); border-radius: 6px; }
.skip-link:focus { top: 10px; }
.site-header { position: sticky; top: 0; z-index: 30; background: #101722f5; backdrop-filter: blur(16px); border-bottom: 1px solid var(--border-soft); }
.masthead { min-height: 78px; padding: 16px 36px; max-width: 1536px; margin: auto; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.nav-brand { display: inline-flex; align-items: center; gap: 12px; font-size: 20px; font-weight: 700; letter-spacing: -.5px; line-height: 1.25; }
.brand-mark { display: grid; place-content: center; position: relative; background: #a5b4fc; color: #172038; width: 38px; height: 38px; border-radius: 10px; font-size: 24px; }
.brand-mark span { position: absolute; right: 5px; bottom: 2px; font-size: 17px; opacity: .6; }
.brand-secondary { font-weight: 450; }
.nav-brand small { display: block; font-size: 10px; font-weight: 500; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-muted); margin-top: 4px; }
.masthead-actions { display: flex; align-items: center; gap: 22px; font-size: 12px; }
.source-link { color: var(--text-dim); }
.dev-badge { background: #e9ba5610; color: #e7c584; border: 1px solid #e9ba5626; text-transform: none; font-weight: 500; font-size: 11px; padding: 3px 8px; }
.navbar { position: static; backdrop-filter: none; background: none; border: 0; border-top: 1px solid var(--border-soft); padding: 0 36px; min-height: 49px; gap: 24px; }
.nav-links { width: 100%; max-width: 1464px; margin-inline: auto; gap: 28px; flex-wrap: nowrap; overflow-x: auto; align-self: stretch; }
.nav-links a { font-size: 13px; display: flex; align-items: center; min-height: 48px; white-space: nowrap; border-bottom: 2px solid transparent; color: var(--text-muted); }
.nav-links a[aria-current="page"] { border-color: var(--accent); color: var(--text); }
.nav-caption { font-size: 11px; color: var(--text-muted); white-space: nowrap; }
.tools-menu { position: relative; }
.tools-menu summary { cursor: pointer; color: var(--text-dim); padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; }
.tools-popover { position: absolute; right: 0; top: 38px; width: 215px; padding: 8px; display: grid; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); }
.tools-popover a, .tools-popover button { padding: 10px; text-align: left; font-size: 13px; color: var(--text-dim); border-radius: 5px; }
.tools-popover a:hover { background: var(--surface-2); text-decoration: none; }
.container, main.container:has(.dash-shell) { width: 100%; max-width: 1536px; padding: 32px 36px 64px; margin: 0 auto; min-width: 0; }
.dash-shell { margin-top: 0; }
h1, .page-hero h1 { font-size: clamp(28px, 3vw, 40px); line-height: 1.18; letter-spacing: -1.3px; font-weight: 650; }
h2, body .block-head h2 { font-size: 20px; font-weight: 600; letter-spacing: -.4px; line-height: 1.35; }
h3 { letter-spacing: -.15px; }
.eyebrow { color: var(--accent); font-size: 10px; letter-spacing: 1.8px; font-weight: 650; text-transform: uppercase; margin-bottom: 10px; }
.page-hero { margin: 4px 0 24px; }
.page-hero-subtitle { max-width: 74ch; font-size: 14px; line-height: 1.7; margin-top: 12px; color: var(--text-dim); }
.page-hero-meta { margin-top: 17px; font-size: 12px; flex-wrap: wrap; gap: 18px; }
.coverage-label { color: var(--text-dim); padding-right: 18px; border-right: 1px solid var(--border); }
.section-nav { display: flex; gap: 24px; border-bottom: 1px solid var(--border-soft); margin: 0 0 28px; overflow-x: auto; }
.section-nav a { color: var(--text-muted); white-space: nowrap; font-size: 12px; padding: 12px 0; }
.section-nav a:hover { color: var(--text); }
body .block, .dash-shell .block { margin-bottom: 36px; scroll-margin-top: 150px; }
.block-head { align-items: center; flex-wrap: wrap; margin-bottom: 16px; gap: 12px; }
.block-head .sub { font-size: 12px; color: var(--text-muted); max-width: 70ch; }
.section-description { color: var(--text-muted); font-size: 13px; margin: 5px 0 0; }
.kpi-grid-compact { grid-template-columns: repeat(5, minmax(0,1fr)); gap: 12px; }
.kpi-grid-compact .kpi { min-height: 110px; padding: 18px; border-color: var(--border-soft); border-radius: 10px; }
.kpi, .network-card { box-shadow: none; }
.kpi:hover { transform: none; border-color: var(--border); box-shadow: none; }
.kpi-grid-compact .kpi-label, .kpi-label { font-size: 12px; font-weight: 500; color: var(--text-dim); line-height: 1.5; }
.kpi-grid-compact .kpi-value, .kpi-grid-compact .kpi-hero .kpi-value, .kpi-grid-compact .kpi-value.accent-2 { font-size: clamp(23px,2.3vw,32px); font-weight: 600; color: var(--text); letter-spacing: -.8px; margin-top: 16px; }
.kpi-grid-compact .kpi-hero { border-top: 2px solid var(--accent); }
.kpi-grid-compact .kpi-hero .kpi-value .decimal { font-size: .66em; }
.kpi-grid-compact .kpi-spark { opacity: .15; pointer-events: none; }
.kpi-grid-compact .kpi-foot { font-size: 10px; padding-top: 12px; line-height: 1.45; position: relative; z-index: 1; }
.kpi-value .suffix { font-size: .7em; }
.view-switch { display: inline-flex; padding: 4px; gap: 3px; background: var(--bg-raised); border: 1px solid var(--border-soft); border-radius: 8px; }
.view-switch button { border: 0; border-radius: 5px; padding: 7px 16px; font-size: 12px; font-weight: 500; color: var(--text-muted); background: none; cursor: pointer; min-height: 34px; }
.view-switch button[aria-pressed="true"] { background: #29354c; color: var(--text); box-shadow: 0 1px 3px #0003; }
.search-wrap .search-input { min-width: 280px; min-height: 42px; font-size: 13px; background: var(--bg-raised); border-color: var(--border); border-radius: 8px; }
.search-wrap .search-input:focus { outline: 2px solid var(--accent); outline-offset: 2px; }
.table-hint { font-size: 11px; color: var(--text-muted); margin: 0 0 10px; }
.pj-table-wrap, .table-wrap, .compute-table-wrap, .news-table-wrap { border-radius: 10px; border: 1px solid var(--border-soft); background: var(--surface); max-width: 100%; overflow-x: auto; }
table { font-variant-numeric: tabular-nums; }
.dash-shell table.pj { min-width: 1100px; }
.dash-shell table.pj thead th { background: #192435; color: var(--text-dim); font-size: 11px; font-weight: 550; letter-spacing: 0; text-transform: none; padding-top: 16px; padding-bottom: 16px; border-bottom-color: var(--border); }
.dash-shell table.pj tbody td { padding-top: 17px; padding-bottom: 17px; font-size: 13px; border-bottom: 1px solid var(--border-soft); }
.dash-shell table.pj tbody tr { background: var(--surface); }
.dash-shell table.pj tbody tr:hover { background: var(--surface-hover); }
.dash-shell table.pj thead th.sorted { background: #222e47; color: #c7d2fe; }
#projects-table { --pj-logo-w: 56px; }
#projects-table thead th.logo-th { font-size: 10px; }
#projects-table thead th.name-th, #projects-table thead th.logo-th { background: #192435; }
#projects-table .name-cell { min-width: 160px; max-width: 190px; }
#projects-table .chain-cell { width: 140px; max-width: 140px; }
#projects-table .chain-cell .badge, #projects-table .badge.consensus { white-space: normal; text-align: left; text-transform: none; font-size: 10px; line-height: 1.5; letter-spacing: 0; max-width: 140px; background: #ffffff05; color: var(--text-dim); border-color: var(--border-soft); border-radius: 4px; }
.row-id .name, .row-id .name a { font-size: 13px; font-weight: 600; }
.row-id .sym { font-size: 10px; margin-top: 3px; letter-spacing: .5px; }
.dash-shell table.pj .num { font-family: inherit; font-variant-numeric: tabular-nums; }
.na { color: var(--text-muted); }
.delta-inline.flat, .delta.flat { color: #72818e; }
#projects-table[data-view="compute"] :is(th,td):nth-child(n+7):nth-child(-n+9),
#projects-table[data-view="markets"] :is(th,td):nth-child(n+3):nth-child(-n+6),
#projects-table[data-view="markets"] :is(th,td):nth-child(10) { display: none; }
.dash-shell #projects-table[data-view="compute"], .dash-shell #projects-table[data-view="markets"] { min-width: 760px; }
#projects-row-count { font-variant-numeric: tabular-nums; }
.lab-card, .chart-card, .market-summary-section, .centralized-lab-card, .stat-card, .network-card { border-color: var(--border-soft); box-shadow: none; }
.lab-card { border-radius: 10px; }
.lab-card-pct { font-size: 32px; }
.lab-card-label { color: var(--text-dim); }
.lab-card-link:hover, .network-card:hover { transform: none; box-shadow: none; border-color: var(--accent); }
.range-group button { min-height: 36px; min-width: 42px; }
.chart-box { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; }
body .pr-layout { gap: 28px; grid-template-columns: 178px minmax(0,1fr); }
body .side-rail { top: 150px; max-height: calc(100vh - 180px); border-left: 0; padding-left: 0; }
body .side-rail a, body .side-rail .rail-current { margin-left: 0; padding: 10px 12px; font-size: 12px; border-left: 0; border-radius: 6px; color: var(--text-dim); }
body .side-rail .rail-current { background: #a5b4fc13; color: var(--accent); text-shadow: none; }
body .side-rail a:hover { background: var(--surface); padding-left: 12px; }
body .about-card, body .vis-card, body .social-card, body .venue-card { border-color: var(--border-soft); border-radius: 10px; box-shadow: none; }
body .about-card { background: var(--surface); padding: 24px; }
body .about-desc, body .about-scope { font-size: 14px; line-height: 1.75; }
body .about-freshness { font-size: 12px; color: var(--text-dim); border-left: 2px solid var(--border); padding-left: 10px; }
body .social-card::before { display: none; }
body .social-card:hover { transform: none; }
body .vis-head { gap: 12px; flex-wrap: wrap; }
body .vis-head h3 { margin: 0; }
.projects-table th, .compute-table th, .metrics-table th, .news-table th { background: #192435; color: var(--text-dim); text-transform: none; font-size: 12px; letter-spacing: 0; }
.projects-table td, .compute-table td, .metrics-table td { padding: 14px 16px; }
.container > .subtitle { margin-bottom: 24px; }
.methodology { max-width: 860px; margin: 0 auto; font-size: 15px; line-height: 1.85; }
.methodology h1 { max-width: 22ch; margin-bottom: 20px; }
.methodology h2 { margin-top: 40px; padding-top: 26px; border-top: 1px solid var(--border-soft); font-size: 21px; }
.methodology p, .methodology li { color: var(--text-dim); }
.methodology strong { color: var(--text); }
.methodology .formula { background: var(--surface); padding: 18px; overflow-wrap: anywhere; border-radius: 8px; }
.empty-state { background: var(--surface); border: 1px dashed var(--border); border-radius: 10px; padding: 36px 24px; }
.footer { border-top: 1px solid var(--border-soft); background: var(--bg-raised); padding: 32px 24px; font-size: 12px; }
.newsletter { margin-bottom: 18px; }
.newsletter-input { min-height: 40px; }
.newsletter-button { min-height: 40px; background: #a5b4fc; color: #172038; border-color: #a5b4fc; }
.footer p.footer-disclaimer { max-width: 680px; font-size: 11px; line-height: 1.7; }
@media (max-width: 1100px) {
  .nav-caption { display: none; }
  .kpi-grid-compact { grid-template-columns: repeat(3,minmax(0,1fr)); }
  .kpi-grid-compact .kpi:nth-child(n+4) { grid-column: auto; }
}
@media (max-width: 760px) {
  .masthead { padding: 15px 20px; min-height: 74px; }
  .masthead-actions { gap: 10px; }
  .masthead-actions .source-link { display: none; }
  .navbar { padding: 0 20px; }
  .nav-links { gap: 24px; width: 100%; }
  .container, main.container:has(.dash-shell) { padding: 24px 20px 48px; }
  body .pr-layout { display: block; }
  body .side-rail { display: none; }
  .page-hero h1 { font-size: 32px; max-width: 18ch; }
  .page-hero-meta { gap: 10px 16px; }
  .coverage-label { border: 0; width: 100%; padding: 0; }
  .section-nav { gap: 24px; }
  .kpi-grid-compact { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
  .kpi-grid-compact .kpi { padding: 16px; min-height: 110px; }
  .kpi-grid-compact .kpi:last-child { grid-column: 1 / -1; min-height: 100px; }
  .kpi-grid-compact .kpi-value, .kpi-grid-compact .kpi-hero .kpi-value, .kpi-grid-compact .kpi-value.accent-2 { font-size: 27px; }
  .kpi-grid-compact .kpi-label { font-size: 11px; }
  .table-toolbar.redesign { align-items: stretch; }
  .view-switch { width: 100%; }
  .view-switch button { flex: 1; min-height: 38px; padding-inline: 10px; }
  .search-wrap, .search-wrap .search-input { width: 100%; min-width: 0; }
  .block-head { align-items: flex-start; }
  .block-head-actions { flex-wrap: wrap; }
  #projects-table thead th.name-th, #projects-table tbody tr td.name-cell { position: static; }
  body .about-card { padding: 20px; }
  .newsletter { display: flex; flex-wrap: wrap; gap: 10px; }
  .newsletter-label { width: 100%; }
  .newsletter-input { min-width: 0; flex: 1; }
}
@media (max-width: 420px) {
  .nav-brand { font-size: 17px; gap: 8px; }
  .nav-brand small { font-size: 8px; letter-spacing: 1px; }
  .brand-mark { width: 32px; height: 32px; font-size: 22px; }
  .dev-badge { font-size: 9px; padding: 3px 5px; }
  .tools-menu summary { padding: 6px; font-size: 11px; }
  .masthead, .navbar, .container, main.container:has(.dash-shell) { padding-inline: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}
/* Keep the first comparison rows within reach on laptop displays. */
@media (min-width: 761px) {
  .masthead { min-height: 68px; padding-block: 12px; }
  .page-hero { margin-bottom: 12px; }
  .page-hero-subtitle { max-width: 90ch; margin-top: 8px; }
  .page-hero-meta { margin-top: 10px; }
  .section-nav { margin-bottom: 22px; }
  .section-nav a { padding-block: 9px; }
  .kpi-grid-compact .kpi { min-height: 110px; padding: 16px; }
  .dash-shell #overview { margin-bottom: 28px; }
}
.masthead .source-link { border: 0; background: none; padding: 0; text-transform: none; letter-spacing: 0; font-weight: 500; font-size: 12px; }
@media (max-width: 760px) {
  .kpi-grid-compact .kpi-value .unit { display: block; margin: 6px 0 0; font-size: 12px; }
}
/* Data should be readable immediately, including deep rows in long tables. */
table.pj tbody tr { animation: none; opacity: 1; }
.gpu-filter-btn { min-height: 40px; }
.gpu-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #172038; }
.project-main { min-width: 0; }
.project-section-nav { margin-bottom: 26px; }
.section-nav[hidden] { display: none; }
.card-grid { display: grid; gap: 24px; margin-top: 28px; }
.openrouter-provider { background: var(--surface); border: 1px solid var(--border-soft); border-radius: 10px; padding: 24px; min-width: 0; }
.openrouter-provider .card-header { justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 16px; margin-bottom: 18px; }
.openrouter-provider .card-header h2 { font-size: 19px; margin-bottom: 4px; }
.openrouter-provider .stat-value { font-size: 13px; padding: 4px 10px; background: var(--surface-2); border-radius: 5px; white-space: nowrap; }
.openrouter-provider .muted, .openrouter-volume { font-size: 13px; color: var(--text-dim); line-height: 1.7; margin: 0 0 20px; }
.openrouter-volume span { display: block; }
.muted-link { font-size: 12px; color: var(--text-muted); }
.data-table { width: 100%; border-collapse: collapse; text-align: left; font-size: 13px; }
.data-table th { padding: 12px 14px; font-size: 11px; color: var(--text-dim); background: var(--surface-2); white-space: nowrap; }
.data-table td { padding: 14px; border-top: 1px solid var(--border-soft); }
@media (max-width: 760px) {
  .openrouter-provider { padding: 18px; }
  .openrouter-provider .data-table { min-width: 420px; }
}
/* Freshness is a quality state, not a negative market move. */
.highlight-outdated .outdated { color: var(--text-dim) !important; text-decoration: underline dotted #d9b676; text-underline-offset: 5px; }
.freshness-key { margin-left: 8px; text-decoration: underline dotted #d9b676; text-underline-offset: 4px; }
body .gpu-filter-btn.active { background: var(--accent); border-color: var(--accent); color: #172038; }
body .gpu-filter-btn:hover { border-color: var(--accent); }
