/* ═══════════════════════════════════════════════════════════════
   Blinq Research — Leverage-Risk Scanner — Styles
   Blinq brand kit · dark theme · brand green #00D492
   ═══════════════════════════════════════════════════════════════ */

/* ── Reset & Base ────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Blinq surfaces — DARK theme */
  --bg-deep:        #0b0d0f;  /* navbar / footer / deepest */
  --bg-mid:         #0e1013;  /* app canvas */
  --bg-surface:     #1a2027;  /* cards / panels */
  --bg-glass:       rgba(255,255,255,0.04);
  --bg-glass-hover: rgba(255,255,255,0.07);
  --border:         rgba(255,255,255,0.08);
  --text:           #ffffff;
  --text-muted:     rgba(255,255,255,0.6);
  --text-dim:       rgba(255,255,255,0.75);

  /* Blinq brand + semantic colours */
  --brand:         #00D492;  /* Blinq green — primary */
  --brand-hover:   #00bf7b;
  --brand-active:  #00a66b;
  --green:   #00D492;        /* positive · safe */
  --yellow:  #e09b2b;        /* warn-amber */
  --orange:  #f97316;
  --red:     #ff3f5e;        /* negative */
  --blue:    #338cfe;        /* info-blue */
  --purple:  #a855f7;
  --teal:    #00D492;

  /* Category colours */
  --cat-elections:   #818cf8;
  --cat-geopolitics: #ec4899;
  --cat-sports:      #00D492;
  --cat-crypto:      #e09b2b;
  --cat-econ:        #2dd4bf;
  --cat-other:       #94a3b8;

  --radius:  12px;           /* Blinq --radius-card */
  --radius-sm: 6px;
  --shadow:  0 4px 24px rgba(0,0,0,0.6);
  --glow-blue: 0 0 24px rgba(0,212,146,0.18);  /* brand glow */
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg-mid);
  color: var(--text);
  min-height: 100vh;
  background-image:
    radial-gradient(ellipse 60% 40% at 20% 0%, rgba(0,212,146,0.08) 0%, transparent 60%),
    radial-gradient(ellipse 50% 30% at 80% 100%, rgba(0,212,146,0.04) 0%, transparent 60%);
}

.hidden { display: none !important; }

/* ── Loading Screen ──────────────────────────────────────────── */
#loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80vh;
}
.loader-wrap { text-align: center; }
.spinner {
  width: 48px;
  height: 48px;
  border: 3px solid var(--border);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loader-text { font-size: 1.1rem; font-weight: 500; color: var(--text); }
.loader-sub  { margin-top: 8px; color: var(--text-muted); font-size: 0.85rem; }
.loader-sub code {
  background: var(--bg-surface);
  padding: 2px 8px;
  border-radius: 4px;
  font-family: 'Space Mono', ui-monospace, monospace;
  color: var(--brand);
}

/* ── Header ──────────────────────────────────────────────────── */
.site-header {
  background: rgba(11,13,15,0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.header-brand { display: flex; align-items: center; gap: 14px; }
.brand-icon { font-size: 2rem; line-height: 1; }
.brand-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand-lockup { height: 36px; width: auto; display: block; }
.brand-word {
  font-size: 1.32rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #fff;
  line-height: 1;
}
.brand-divider { width: 1px; height: 30px; background: var(--border); }
.header-meta a.meta-chip { text-decoration: none; cursor: pointer; transition: border-color .2s, color .2s; }
.header-meta a.meta-chip:hover { color: var(--text); border-color: rgba(0,212,146,0.4); }

/* ── Blinq Research hero ─────────────────────────────────────── */
.research-hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: 56px 24px 36px;
  position: relative;
}
.research-hero::after {
  content: "";
  position: absolute;
  left: 24px; right: 24px; bottom: 0;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,212,146,0.5), transparent);
}
.research-hero-inner { max-width: 880px; }
.research-kicker { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.research-tag {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--brand);
}
.research-no {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  color: var(--text-muted);
  padding: 3px 10px;
  border: 1px solid var(--border);
  border-radius: 999px;
}
.research-title {
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.12;
  padding-bottom: 0.12em;
  background: linear-gradient(105deg, #ffffff 0%, #ffffff 58%, #00D492 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.research-lede {
  margin-top: 18px;
  max-width: 720px;
  font-size: 1.02rem;
  line-height: 1.6;
  color: var(--text-dim);
}
.research-lede strong { color: var(--text); font-weight: 600; }
.research-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.rm-chip {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 5px 12px;
}
.rm-accent {
  color: #5ce0b0;
  background: rgba(0,212,146,0.1);
  border-color: rgba(0,212,146,0.3);
}
.section-nav-label {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--brand);
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.brand-title {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(120deg, #00D492, #00ad89);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.brand-sub { font-size: 0.75rem; color: var(--text-muted); margin-top: 2px; }
.header-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.meta-chip {
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.72rem;
  font-weight: 500;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-dim);
}
.note-chip {
  background: rgba(0,212,146,0.1);
  border-color: rgba(0,212,146,0.3);
  color: #5ce0b0;
}

/* ── Cards ───────────────────────────────────────────────────── */
.card {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  backdrop-filter: blur(12px);
  padding: 24px;
  box-shadow: var(--shadow);
  transition: background-color 0.2s, border-color 0.2s;
}
.card:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.15);
}

/* ── Summary Grid ────────────────────────────────────────────── */
.summary-grid {
  max-width: 1600px;
  margin: 28px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
}
.summary-card {
  padding: 20px 22px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.card-icon { font-size: 1.8rem; flex-shrink: 0; }
.card-value {
  font-size: 2rem;
  font-weight: 800;
  font-family: 'Space Mono', ui-monospace, monospace;
  line-height: 1;
  color: var(--text);
}
.card-label {
  font-size: 0.73rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 4px;
}
.risk-card  { border-color: rgba(234,179,8,0.2); }
.danger-card { border-color: rgba(239,68,68,0.3); }
.danger-card .card-value { color: var(--red); }
.riskiest-card { border-color: rgba(168,85,247,0.3); }
.riskiest-name { font-size: 0.95rem; line-height: 1.3; color: #5ce0b0; }

/* ── Controls Bar ────────────────────────────────────────────── */
.controls-bar {
  max-width: 1600px;
  margin: 24px auto 0;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.controls-left  { display: flex; gap: 10px; flex-wrap: wrap; flex: 1; }
.controls-right { display: flex; gap: 8px; }

.ctrl-select, .ctrl-input {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 8px 14px;
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.85rem;
  outline: none;
  transition: border-color 0.2s;
}
.ctrl-select:focus, .ctrl-input:focus { border-color: rgba(0,212,146,0.5); }
.ctrl-select option { background: var(--bg-mid); }
.ctrl-input { min-width: 220px; }

.ctrl-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-dim);
  padding: 8px 16px;
  font-size: 0.82rem;
  cursor: pointer;
  font-family: 'Plus Jakarta Sans', sans-serif;
  transition: all 0.2s;
}
.ctrl-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.15);
}

/* ── Charts Row ──────────────────────────────────────────────── */
.charts-row {
  max-width: 1600px;
  margin: 24px auto 0;
  padding: 0 24px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 900px)  { .charts-row { grid-template-columns: 1fr; } }

.chart-card { 
  padding: 20px; 
  height: 380px; /* strict height prevents infinite Chart.js resize loop */
  display: flex;
  flex-direction: column;
}
.chart-card:last-child {
  grid-column: 1 / -1;
  height: 440px;
}
.chart-wrapper {
  position: relative;
  flex: 1;
  width: 100%;
  min-height: 0; /* allows flex item to shrink below content size if needed */
}
.chart-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 16px;
}

/* ── Table Section ───────────────────────────────────────────── */
.table-section {
  max-width: 1600px;
  margin: 28px auto 0;
  padding: 0 24px;
}
.table-header-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 12px;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.table-count {
  font-size: 0.75rem;
  color: var(--text-muted);
}
.table-wrap {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.84rem;
}
thead tr {
  background: rgba(255,255,255,0.03);
  border-bottom: 1px solid var(--border);
}
th {
  padding: 12px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  white-space: nowrap;
  user-select: none;
}
th.th-num { text-align: right; }
th.th-expand { width: 36px; }
th.th-link { width: 56px; text-align: center; }

.sortable { cursor: pointer; }
.sortable:hover { color: var(--text); }
.sortable.active { color: #00D492; }
.sort-arrow { opacity: 0.4; font-size: 0.7rem; }
.sortable.active .sort-arrow { opacity: 1; }

/* ── Table Rows ──────────────────────────────────────────────── */
tbody tr.event-row {
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s;
}
tbody tr.event-row:hover { background: var(--bg-glass-hover); }
tbody tr.event-row td { padding: 13px 14px; vertical-align: middle; }

.td-expand { text-align: center; color: var(--text-muted); font-size: 0.8rem; }
.td-market { max-width: 280px; }
.market-name {
  font-weight: 500;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.market-vol { font-size: 0.72rem; color: var(--text-muted); margin-top: 2px; }

.cat-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cat-elections   { background: rgba(129,140,248,0.15); color: var(--cat-elections); }
.cat-geopolitics { background: rgba(236,72,153,0.15);  color: var(--cat-geopolitics); }
.cat-sports      { background: rgba(52,211,153,0.15);  color: var(--cat-sports); }
.cat-crypto      { background: rgba(245,158,11,0.15);  color: var(--cat-crypto); }
.cat-econ        { background: rgba(45,212,191,0.15);  color: var(--cat-econ); }
.cat-other       { background: rgba(148,163,184,0.12); color: var(--cat-other); }

.td-num { text-align: right; font-family: 'Space Mono', ui-monospace, monospace; }

/* Jump count colours */
.j-none   { color: var(--text-muted); }
.j-low    { color: var(--green);  }
.j-mid    { color: var(--yellow); }
.j-high   { color: var(--orange); }
.j-crit   { color: var(--red); font-weight: 700; }

.td-link { text-align: center; }
.pm-link {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(0,212,146,0.1);
  border: 1px solid rgba(0,212,146,0.25);
  color: #00D492;
  text-decoration: none;
  font-size: 0.73rem;
  font-weight: 500;
  transition: all 0.2s;
  white-space: nowrap;
}
.pm-link:hover {
  background: rgba(0,212,146,0.2);
  border-color: rgba(0,212,146,0.5);
}

/* ── Sub-Rows (participants) ─────────────────────────────────── */
.participant-wrapper { display: none; background: rgba(0,0,0,0.3); }
.participant-wrapper.open { display: table-row-group; }

.participant-wrapper tr { border-bottom: 1px solid rgba(255,255,255,0.04); }
.participant-wrapper td { padding: 9px 14px 9px 40px; font-size: 0.8rem; }

.p-outcome {
  font-weight: 500;
  color: var(--text-dim);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.p-price {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 2px;
}
.quality-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 0.68rem;
  font-weight: 600;
}
.q-good { background: rgba(34,197,94,0.1);  color: var(--green); }
.q-bad  { background: rgba(239,68,68,0.1);  color: var(--red); }

/* ── Guide Section ───────────────────────────────────────────── */
.guide-section {
  max-width: 1600px;
  margin: 28px auto 40px;
  padding: 0 24px;
}
.guide-card { padding: 24px; }
.guide-title {
  font-size: 0.9rem;
  font-weight: 700;
  margin-bottom: 20px;
  color: var(--text);
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}
.guide-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.guide-badge {
  flex-shrink: 0;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}
.badge-green  { background: rgba(34,197,94,0.15);  color: var(--green); }
.badge-yellow { background: rgba(234,179,8,0.15);  color: var(--yellow); }
.badge-orange { background: rgba(249,115,22,0.15); color: var(--orange); }
.badge-red    { background: rgba(239,68,68,0.15);  color: var(--red); }

.guide-text { font-size: 0.8rem; color: var(--text-dim); line-height: 1.5; }
.guide-text strong { color: var(--text); }
.guide-card .guide-note {
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.6;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  margin-top: 14px;
}

/* ── Scrollbar ───────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.12); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.2); }

/* ── Tabs ────────────────────────────────────────────────────── */
.tabs-container {
  max-width: 1600px;
  margin: 28px auto 0;
  padding: 0 24px;
  display: flex;
  gap: 12px;
}
.tab-btn {
  background: var(--bg-glass);
  border: 1px solid var(--border);
  color: var(--text-muted);
  padding: 12px 24px;
  border-radius: var(--radius);
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  flex: 1;
  text-align: center;
}
.tab-btn:hover {
  background: var(--bg-glass-hover);
  color: var(--text);
  border-color: rgba(255,255,255,0.2);
}
.tab-btn.active {
  background: rgba(0,212,146,0.15);
  border-color: rgba(0,212,146,0.5);
  color: #00D492;
}

/* ═══════════ v3 panels (funnel / heatmap / timing / comparison) ═══════════ */
.section-nav {
  position: sticky;
  top: 70px;
  z-index: 90;
  background: rgba(11, 13, 15, 0.85);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.section-nav-inner {
  max-width: 1440px;
  margin: 0 auto;
  padding: 10px 24px;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.section-nav a {
  color: var(--text-dim);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 14px;
  border-radius: 20px;
  transition: all 0.2s;
  border: 1px solid transparent;
}
.section-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.15);
}
.panel {
  max-width: 1440px;
  margin: 0 auto;
  padding: 36px 24px;
  scroll-margin-top: 130px;
}
.panel-head { display: flex; align-items: baseline; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.hint { color: var(--text-muted); font-size: 12px; font-weight: 400; }
p.hint, p.guide-note {
  margin-top: 8px !important;
  margin-bottom: 20px !important;
  line-height: 1.6;
  color: var(--text-dim) !important;
  font-size: 13px !important;
}
.ver { font-size: 0.5em; opacity: 0.5; font-weight: 500; }

/* toggles */
.metric-toggle, .seg-toggle { display: inline-flex; gap: 4px; background: var(--bg-glass);
  border: 1px solid var(--border); border-radius: 8px; padding: 3px; }
.seg-btn { background: transparent; border: none; color: var(--text-dim); cursor: pointer;
  font-size: 12px; font-weight: 600; padding: 7px 13px; border-radius: 6px; font-family: inherit; }
.seg-btn:hover { color: var(--text); }
.seg-btn.active { background: var(--brand); color: #04140d; }

/* funnel */
.funnel-row { display: flex; align-items: stretch; gap: 12px; flex-wrap: wrap; }
.funnel-step {
  flex: 1;
  min-width: 280px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  transition: transform 0.2s, border-color 0.2s, background-color 0.2s;
  box-shadow: var(--shadow);
}
.funnel-step:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 212, 146, 0.3);
  background: rgba(255, 255, 255, 0.04);
}
.funnel-bar-track { height: 6px; background: rgba(255,255,255,0.06); border-radius: 4px; overflow: hidden; margin-bottom: 12px; }
.funnel-bar { height: 100%; background: linear-gradient(90deg, var(--green), #00ad89); border-radius: 4px; }
.funnel-val { font-size: 26px; font-weight: 800; font-family: 'Space Mono', ui-monospace, monospace; }
.funnel-label { font-size: 14px; font-weight: 700; margin-top: 2px; }
.funnel-pct { color: var(--teal); font-size: 12px; margin-left: 6px; }
.funnel-sub { font-size: 11.5px; color: var(--text-muted); margin-top: 4px; line-height: 1.4; }
.funnel-arrow { display: flex; align-items: center; justify-content: center; color: var(--text-muted); font-size: 24px; padding: 0 8px; }

/* heatmap tables */
.heatmap-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}
table.heatmap { width: 100%; border-collapse: collapse; font-size: 12.5px; }
table.heatmap th { background: rgba(255, 255, 255, 0.04); color: var(--text-dim); font-weight: 600;
  padding: 12px 14px; text-align: left; position: sticky; top: 0; border-bottom: 1px solid var(--border); }
table.heatmap th.num, table.heatmap td.num { text-align: right; font-family: 'Space Mono', ui-monospace, monospace; }
table.heatmap td { padding: 10px 14px; border-top: 1px solid rgba(255,255,255,0.04); }
table.heatmap td.rowlab { font-weight: 600; white-space: nowrap; }
table.heatmap td.tot, table.heatmap th.tot { font-weight: 700; border-left: 1px solid var(--border); }
.heatmap .cellpct { color: var(--text-muted); font-size: 10px; margin-left: 5px; }
.heatmap .totrow td { border-top: 1px solid var(--border); font-weight: 700; background: rgba(255, 255, 255, 0.02); }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 7px; vertical-align: middle; }

/* timing */
.timing-grid, .cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.timing-examples { max-height: 360px; overflow-y: auto; }
.tex-head { font-size: 12px; font-weight: 700; color: var(--text-dim); margin-bottom: 6px; }
.tex-row { display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 5px 0; border-bottom: 1px solid rgba(255,255,255,0.04); }
.tex-title { font-size: 12px; }
.tex-bars { display: flex; gap: 4px; flex-shrink: 0; }
.tex-chip { font-size: 10px; font-family: 'Space Mono', ui-monospace, monospace; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-glass); color: var(--text-dim); }
.tex-chip.good { background: rgba(0,212,146,0.18); color: #5ce0b0; }
.tex-chip.bad { background: rgba(239,68,68,0.18); color: #fca5a5; }
.chart-wrapper.tall { height: 320px; }

/* score + move badges + part rows */
.score { font-family: 'Space Mono', ui-monospace, monospace; font-weight: 700; padding: 2px 8px; border-radius: 5px; }
.sc-green { background: rgba(34,197,94,0.18); color: #4ade80; }
.sc-yellow { background: rgba(234,179,8,0.18); color: #facc15; }
.sc-orange { background: rgba(249,115,22,0.18); color: #fb923c; }
.sc-red { background: rgba(239,68,68,0.2); color: #f87171; }
.daysub { font-size: 10px; color: var(--text-muted); }
.part-row td { background: rgba(255,255,255,0.015); font-size: 12px; }
.p-outcome { margin-left: 12px; color: var(--text-dim); }
tr.event-row { cursor: pointer; }

@media (max-width: 900px) { .timing-grid, .cmp-grid { grid-template-columns: 1fr; } }

/* ── glossary + key-days + vol-timing ──────────────────────────── */
.glossary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 26px; margin-top: 10px; }
.glossary-grid > div { font-size: 12.5px; color: var(--text-dim); line-height: 1.5; }
.glossary-grid b { color: var(--text); }
@media (max-width: 820px) { .glossary-grid { grid-template-columns: 1fr; } }

.heatmap td .sub { font-size: 10.5px; color: var(--text-muted); margin-top: 2px; }
tr.kd-safe td { background: rgba(34,197,94,0.06); }
tr.kd-risk td { background: rgba(239,68,68,0.07); }
.heatmap a.pm-link { color: #5ce0b0; text-decoration: none; font-weight: 600; }
.heatmap a.pm-link:hover { text-decoration: underline; }
.heatmap .j-none { color: var(--text-muted); }
.heatmap .j-mid  { color: var(--yellow); font-weight: 600; }
.heatmap .j-high { color: var(--orange); font-weight: 700; }
.heatmap .j-crit { color: var(--red); font-weight: 700; }

/* ── sample comparison grid + key-day notes ────────────────────── */
.sc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .sc-grid { grid-template-columns: 1fr; } }
.kd-note { font-size: 12px; color: var(--text-dim); max-width: 220px; }

/* ── key-days table: fixed widths, wider market col, pagination ─── */
table.heatmap.kd { table-layout: fixed; }
table.heatmap.kd td, table.heatmap.kd th { overflow: hidden; text-overflow: ellipsis; }
.kd-market { white-space: normal !important; }
.kd-market .pm-link { display: inline-block; line-height: 1.25; }
.kd-note { white-space: normal; line-height: 1.25; }
table.heatmap.kd td.rowlab { white-space: nowrap; }

.pager { display: flex; align-items: center; justify-content: center; gap: 14px;
  padding: 12px 0 2px; }
.pg-btn { background: var(--bg-glass); border: 1px solid var(--border); color: var(--text);
  font-family: inherit; font-size: 12px; font-weight: 600; padding: 7px 14px; border-radius: 7px; cursor: pointer; }
.pg-btn:hover:not(:disabled) { background: var(--bg-glass-hover); }
.pg-btn:disabled { opacity: 0.35; cursor: default; }
.pg-info { font-size: 12px; color: var(--text-dim); font-family: 'Space Mono', ui-monospace, monospace; }

/* tighten the sample-compare chart so there's no dead space */
#samples .chart-wrapper { height: 290px; flex: none; }
#samples .card, #concentration .heatmap-wrap { align-self: start; }
.kd-sector, #kd-sector { min-width: 130px; }

/* ── key-days: clean text formatting (ref: img 3) ──────────────── */
table.heatmap.kd td, table.heatmap.kd th { padding: 12px 10px; vertical-align: middle; }
.kd-date { font-family: 'Space Mono', ui-monospace, monospace; font-size: 12.5px; color: var(--text-dim); }
.kd-title { display: block; font-size: 14px; font-weight: 600; color: var(--text);
  text-decoration: none; line-height: 1.3; }
.kd-title:hover { color: #5ce0b0; }
.kd-arrow { color: var(--text-muted); font-weight: 400; }
.kd-meta { margin-top: 5px; }
.cat-pill { display: inline-block; font-size: 10.5px; font-weight: 600; letter-spacing: .02em;
  text-transform: uppercase; padding: 2px 9px; border-radius: 999px;
  color: var(--c); background: color-mix(in srgb, var(--c) 16%, transparent); }
table.heatmap.kd td.num { font-size: 13px; }
table.heatmap.kd .kd-note { color: var(--text-dim); font-size: 12.5px; }
table.heatmap.kd tbody tr { border-bottom: 1px solid rgba(255,255,255,0.05); transition: background-color 0.15s; }
tr.kd-safe:hover td { background: rgba(34, 197, 94, 0.12) !important; }
tr.kd-risk:hover td { background: rgba(239, 68, 68, 0.14) !important; }

/* ── Research Library ────────────────────────────────────────── */
#research-index { border-top: 1px solid var(--border); margin-top: 24px; }
.index-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; margin-bottom: 22px; }
.index-title { font-size: 1.9rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 6px; color: var(--text); }
.index-sub { max-width: 380px; font-size: 0.9rem; line-height: 1.55; color: var(--text-muted); }
.research-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
.research-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px 22px 20px;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  min-height: 200px;
  transition: transform .2s, border-color .2s, background-color .2s;
}
.research-card.is-live { cursor: pointer; }
.research-card.is-live:hover {
  transform: translateY(-3px);
  border-color: rgba(0,212,146,0.45);
  background: rgba(0,212,146,0.05);
  box-shadow: var(--glow-blue);
}
.research-card.is-soon { opacity: 0.62; }
.rc-top { display: flex; align-items: center; justify-content: space-between; }
.rc-no {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 1.5rem; font-weight: 700; color: var(--brand);
  letter-spacing: -0.02em;
}
.rc-badge {
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.66rem; font-weight: 400; letter-spacing: 0.04em;
  color: var(--text-muted); padding: 3px 10px;
  border: 1px solid var(--border); border-radius: 999px;
}
.rc-live { color: #5ce0b0; background: rgba(0,212,146,0.1); border-color: rgba(0,212,146,0.3); }
.rc-title { font-size: 1.18rem; font-weight: 700; letter-spacing: -0.01em; color: var(--text); margin-top: 2px; }
.rc-desc { font-size: 0.86rem; line-height: 1.5; color: var(--text-muted); flex: 1; }
.rc-foot { font-size: 0.8rem; font-weight: 600; color: var(--brand); margin-top: 4px; }
.research-card.is-soon .rc-foot { color: var(--text-muted); }
/* locked / coming-soon card content — redaction bars + lock */
.rc-redacted { display: flex; flex-direction: column; gap: 11px; flex: 1; margin-top: 4px; }
.redact-bar {
  display: block; border-radius: 6px;
  background: linear-gradient(90deg, rgba(255,255,255,0.10), rgba(255,255,255,0.03));
  filter: blur(1.2px);
}
.redact-bar.bar-title { height: 18px; width: 72%; border-radius: 7px; }
.redact-bar.bar-line { height: 11px; width: 100%; }
.redact-bar.bar-line.short { width: 58%; }
.redact-bar.bar-title.short { width: 54%; }
.rc-lock { display: inline-flex; align-items: center; gap: 6px; color: var(--text-muted) !important; }
.rc-lock svg { opacity: 0.8; }

/* ── Footer ──────────────────────────────────────────────────── */
.site-footer {
  position: relative;
  border-top: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(11,13,15,0) 0%, rgba(0,212,146,0.04) 100%), rgba(11,13,15,0.7);
  margin-top: 8px;
}
.site-footer::before {
  content: ""; position: absolute; top: -1px; left: 0; right: 0; height: 1px;
  background: linear-gradient(90deg, transparent, rgba(0,212,146,0.5), transparent);
}
.footer-grid {
  max-width: 1440px; margin: 0 auto; padding: 44px 24px 28px;
  display: grid; grid-template-columns: 1.7fr 1fr 1fr; gap: 32px;
}
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; gap: 28px; } }
.footer-brandcol { display: flex; flex-direction: column; align-items: flex-start; gap: 16px; max-width: 400px; }
.footer-logo { height: 30px; width: auto; }
.footer-note { font-size: 0.86rem; line-height: 1.55; color: var(--text-muted); }
.footer-h {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.1em; color: var(--text-muted); margin-bottom: 6px;
}
.footer-col { display: flex; flex-direction: column; }
.footer-link {
  font-size: 0.85rem; color: var(--text-dim); text-decoration: none;
  padding: 6px 0; transition: color .2s;
}
a.footer-link:hover { color: var(--brand); }
.footer-link.is-muted { color: var(--text-muted); }
.back-to-top {
  display: inline-flex; align-items: center; gap: 7px;
  font-size: 0.82rem; font-weight: 600;
  color: var(--brand); text-decoration: none;
  padding: 9px 16px; border: 1px solid rgba(0,212,146,0.3);
  border-radius: 999px; white-space: nowrap; margin-top: 2px;
  transition: background-color .2s, border-color .2s, transform .2s;
}
.back-to-top:hover { background: rgba(0,212,146,0.1); border-color: rgba(0,212,146,0.55); transform: translateY(-1px); }
.footer-bar {
  max-width: 1440px; margin: 0 auto; padding: 16px 24px 30px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: 'Space Mono', ui-monospace, monospace;
  font-size: 0.72rem; color: var(--text-muted);
}
.footer-sep { color: rgba(255,255,255,0.25); }
