/* ============================================================================
   QxLab — design system applied to /research (web/index.html)
   Loaded AFTER the existing inline <style> block so these rules override.
   Strategy: re-map the :root CSS variables that the entire dashboard already
   uses, plus targeted modernization of typography, cards, scrollbars, etc.
   ============================================================================ */

:root {
  /* Color palette — replaces the Bloomberg amber/cream system */
  --bg-primary:   #070809;    /* near-black charcoal */
  --bg-secondary: #0f1115;    /* sidebar */
  --bg-card:      #14171c;    /* cards */
  --bg-input:     #1a1e25;    /* inputs */
  --bg-elevated:  #252b35;    /* hover/elevated */
  --border:       #1f2937;
  --border-soft:  #14171c;

  /* Text */
  --text-primary:   #e7e9ee;
  --text-secondary: #cdd2dc;
  --text-muted:     #9aa3b2;

  /* Accent: emerald (replaces amber #ff9100) */
  --accent:        #10b981;
  --accent-dim:    #0a8a63;
  --accent-bright: #34d399;

  /* Status colors */
  --green: #34d399;
  --red:   #ef4444;

  /* Effects */
  --shadow-ambient: 0 0 0 1px rgba(255,255,255,0.04), 0 6px 18px rgba(0,0,0,0.45);
  --shadow-deep:    0 18px 50px rgba(0,0,0,0.7), 0 0 0 1px rgba(16,185,129,0.12) inset;
  --glow-emerald:   0 0 0 1px rgba(16,185,129,0.4), 0 0 14px rgba(16,185,129,0.18);

  /* Legacy aliases — any rule still using these old names gets the new palette */
  --accent-mint: #10b981;
  --yellow:      #fbbf24;
  --orange:      #f59e0b;
  --purple:      #a78bfa;
  --glow-amber:  var(--glow-emerald);

  /* ── QX system v2 tokens (additive — do not remove the names above) ── */
  --font-ui:   'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace;

  /* Type scale */
  --fs-display: clamp(44px, 7vw, 96px);
  --fs-h1: 28px;
  --fs-h2: 20px;
  --fs-h3: 15px;
  --fs-body: 13px;
  --fs-caption: 11px;
  --fs-micro: 10px;
  --ls-display: -0.03em;
  --ls-heading: -0.02em;
  --ls-micro: 0.18em;     /* uppercase micro-labels */
  --ls-eyebrow: 0.32em;   /* hero / section eyebrows */

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
  --radius-pill: 999px;

  /* Layered depth — hairline top highlight + ambient + key shadow */
  --hairline-top: inset 0 1px 0 rgba(255,255,255,0.05);
  --shadow-tile:
    inset 0 1px 0 rgba(255,255,255,0.05),
    0 1px 2px rgba(0,0,0,0.4),
    0 10px 28px -16px rgba(0,0,0,0.6);
  --shadow-tile-hover:
    inset 0 1px 0 rgba(255,255,255,0.07),
    0 2px 4px rgba(0,0,0,0.45),
    0 18px 40px -18px rgba(0,0,0,0.7),
    0 0 24px -8px rgba(16,185,129,0.25);
  --shadow-panel:
    inset 0 1px 0 rgba(255,255,255,0.04),
    0 1px 2px rgba(0,0,0,0.35),
    0 16px 40px -24px rgba(0,0,0,0.65);
  --ring-focus: 0 0 0 2px rgba(7,8,9,1), 0 0 0 4px rgba(16,185,129,0.55);

  /* Motion */
  --ease-out: cubic-bezier(.2,.7,.2,1);
  --dur-fast: 150ms;
  --dur-med: 250ms;
  --dur-slow: 450ms;
}

/* ============================================================================
   AURORA BACKGROUND — matches lab.html
   ============================================================================ */
body {
  background: #070809 !important;
}
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    radial-gradient(45rem 35rem at 25% 25%, rgba(16,185,129,0.14), transparent 60%),
    radial-gradient(55rem 35rem at 80% 70%, rgba(20,184,166,0.09), transparent 60%),
    radial-gradient(40rem 30rem at 50% 95%, rgba(8,145,178,0.06), transparent 65%),
    linear-gradient(rgba(255,255,255,0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.018) 1px, transparent 1px);
  background-size: cover, cover, cover, 60px 60px, 60px 60px;
  pointer-events: none;
  z-index: 0;
  mask-image: radial-gradient(ellipse at center, black 30%, transparent 90%);
}
.app { position: relative; z-index: 1; }

/* ============================================================================
   TYPOGRAPHY — Inter for UI, JetBrains Mono for all numbers
   (replaces Spectral serif primary)
   ============================================================================ */
body, h1, h2, h3, h4, h5, h6, p, div, span, button, label, select, option,
.tab, .btn, .ui-text, a, li, td, th, header, footer, section, aside, nav, main,
.sidebar h1, .sidebar p, .sidebar-header h1, .sidebar-header p {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif !important;
}
h1, h2, h3, h4, h5, h6 {
  letter-spacing: -0.02em !important;
  font-weight: 600 !important;
}
code, pre, .mono, .mono *, .font-mono, .font-mono *,
[class*="num-"], input[type="number"], .price, .pnl,
.data-cell, td.num, th.num, .num-tabular {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, monospace !important;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum", "ss01";
}

/* ============================================================================
   SCROLLBARS — modern, thin, emerald-tinged
   ============================================================================ */
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background: rgba(91,100,115,0.30);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover { background: rgba(16,185,129,0.45); }
::-webkit-scrollbar-corner { background: transparent; }
* { scrollbar-width: thin; scrollbar-color: rgba(91,100,115,0.30) transparent; }

/* ============================================================================
   SIDEBAR — modernize the masthead
   ============================================================================ */
.sidebar {
  background: var(--bg-secondary) !important;
  border-right: 1px solid var(--border) !important;
}
.sidebar-header {
  padding: 22px 20px 18px !important;
  border-bottom: 1px solid var(--border) !important;
  background: linear-gradient(180deg, rgba(16,185,129,0.04), transparent 100%) !important;
}
.sidebar-header h1 {
  font-size: 20px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  background: linear-gradient(110deg, #e7e9ee 0%, #34d399 50%, #e7e9ee 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: qxlab-shimmer 10s linear infinite;
}
.sidebar-header h1::before {
  background: var(--accent) !important;
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
}
@keyframes qxlab-shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ============================================================================
   LIVE INDICATOR — emerald with breathing pulse
   ============================================================================ */
.live-indicator {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
}
.live-indicator::before {
  background: var(--accent) !important;
  animation: qxlab-pulse 2s ease-in-out infinite;
}
@keyframes qxlab-pulse {
  0%, 100% { opacity: 1; box-shadow: 0 0 0 0 rgba(52,211,153,0.55); }
  50%      { opacity: 0.85; box-shadow: 0 0 0 6px rgba(52,211,153,0); }
}

/* ============================================================================
   CARDS — rounded edges, hover lift, subtle border glow on hover
   ============================================================================ */
#verifiedList > div,
.card,
[class*="-card"],
section.panel {
  border-radius: 8px !important;
  transition: transform .25s ease, border-color .25s ease, background .25s ease, box-shadow .25s ease !important;
}
#verifiedList > div:hover {
  transform: translateY(-1px);
  border-color: rgba(16,185,129,0.35) !important;
  box-shadow: 0 8px 24px -10px rgba(16,185,129,0.25);
}

/* ============================================================================
   TABS — emerald active state, subtle hover transition
   ============================================================================ */
.tab {
  transition: color .2s ease, border-color .2s ease, background .2s ease !important;
}
.tab:hover { color: var(--text-primary) !important; }
.tab.active,
.tab[data-active="true"] {
  color: var(--accent) !important;
  border-bottom-color: var(--accent) !important;
  background: linear-gradient(180deg, transparent 60%, rgba(16,185,129,0.08) 100%) !important;
}

/* ============================================================================
   BUTTONS — emerald primary, smooth transitions
   ============================================================================ */
button, .btn {
  transition: background .2s ease, border-color .2s ease, color .2s ease, transform .12s ease, box-shadow .2s ease !important;
  border-radius: 6px !important;
}
button:hover, .btn:hover {
  border-color: var(--accent) !important;
}
button:active, .btn:active { transform: scale(0.98); }

/* Primary action buttons (filled with accent) */
button.primary,
.btn-primary,
button[type="submit"]:not([disabled]) {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent)) !important;
  color: #0a0a0a !important;
  border-color: transparent !important;
  font-weight: 600 !important;
}
button.primary:hover,
.btn-primary:hover {
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25), 0 6px 16px -8px rgba(16,185,129,0.6);
}

/* ============================================================================
   INPUTS / SELECT — modern subtle
   ============================================================================ */
input[type="text"], input[type="number"], input[type="email"],
input[type="password"], textarea, select {
  background: var(--bg-input) !important;
  border: 1px solid var(--border) !important;
  border-radius: 6px !important;
  color: var(--text-primary) !important;
  transition: border-color .2s ease, background .2s ease !important;
}
input:focus, textarea:focus, select:focus {
  outline: none !important;
  border-color: var(--accent) !important;
  background: var(--bg-elevated) !important;
}

/* ============================================================================
   TABLES — modern row hover, no harsh borders
   ============================================================================ */
table { border-collapse: collapse !important; }
th {
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  color: var(--text-muted) !important;
  font-weight: 600 !important;
  border-bottom: 1px solid var(--border) !important;
  padding: 10px 12px !important;
  text-align: left !important;
}
td {
  padding: 9px 12px !important;
  border-bottom: 1px solid var(--border-soft) !important;
}
tr { transition: background .15s ease !important; }
tbody tr:hover { background: rgba(16,185,129,0.035) !important; }
/* Numeric columns: right-aligned tabular mono, signed coloring */
td.num, th.num { text-align: right !important; }
td.num.pos, .table-pos { color: var(--green) !important; }
td.num.neg, .table-neg { color: var(--red) !important; }

/* ============================================================================
   STATUS PILLS — when text has these classes, modern pill style
   ============================================================================ */
.pill, .badge, .chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px !important;
  border-radius: 999px !important;
  font-family: 'Inter', sans-serif !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  letter-spacing: 0.04em !important;
  text-transform: uppercase !important;
}

/* ============================================================================
   PROFIT / LOSS COLORS — consistent across the whole dashboard
   ============================================================================ */
.profit, .pnl-positive, [data-sign="positive"] { color: var(--green) !important; }
.loss, .pnl-negative, [data-sign="negative"]   { color: var(--red) !important; }

/* ============================================================================
   Disable the old graph-paper grid (we have one in the aurora bg now)
   ============================================================================ */
.app::before, .app::after { display: none !important; }

/* ============================================================================
   Small visual sweeteners — animated glow on key elements
   ============================================================================ */
.glow-on-hover {
  transition: filter .25s ease, box-shadow .25s ease !important;
}
.glow-on-hover:hover {
  filter: brightness(1.1);
  box-shadow: var(--glow-emerald);
}

/* ============================================================================
   STRATEGY PIPELINE WIZARD — 7-stage graduation journey
   ============================================================================ */
.pipeline-shell {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 16px;
}
.pipeline-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.pipeline-header h2 {
  font-size: 24px !important;
  font-weight: 700 !important;
  background: linear-gradient(110deg, #e7e9ee, #34d399, #e7e9ee);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: qxlab-shimmer 10s linear infinite;
}
.pipeline-subject {
  display: flex;
  align-items: center;
  gap: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text-muted);
}
.pipeline-subject select {
  font-family: 'Inter', sans-serif !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  padding: 6px 12px !important;
  background: var(--bg-card) !important;
  color: var(--text-primary) !important;
}

/* Stepper row */
.pipeline-stepper {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0;
  padding: 24px 12px 36px;
  margin-bottom: 24px;
  position: relative;
}
.pipeline-stepper::before {
  content: '';
  position: absolute;
  top: 38px;
  left: 5%;
  right: 5%;
  height: 1px;
  background: var(--border);
  z-index: 0;
}
.pipeline-stepper .step {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  flex: 1;
  cursor: pointer;
  transition: transform .2s ease;
}
.pipeline-stepper .step:hover { transform: translateY(-1px); }
.pipeline-stepper .step .node {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-muted);
  transition: all .25s ease;
}
.pipeline-stepper .step .label {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color .25s ease;
  text-align: center;
}
.pipeline-stepper .step.done .node {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  border-color: var(--accent);
  color: #0a0a0a;
  box-shadow: 0 0 0 1px rgba(16,185,129,0.4), 0 2px 8px rgba(16,185,129,0.3);
}
.pipeline-stepper .step.done .label { color: var(--text-primary); }
.pipeline-stepper .step.active .node {
  background: var(--bg-card);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(16,185,129,0.18), 0 0 14px rgba(16,185,129,0.35);
  animation: step-pulse 2s ease-in-out infinite;
}
.pipeline-stepper .step.active .label { color: var(--accent); }
@keyframes step-pulse {
  0%,100% { box-shadow: 0 0 0 2px rgba(16,185,129,0.18), 0 0 14px rgba(16,185,129,0.35); }
  50%     { box-shadow: 0 0 0 4px rgba(16,185,129,0.10), 0 0 24px rgba(16,185,129,0.45); }
}
.pipeline-stepper .step.locked .node { color: var(--text-muted); }
.pipeline-stepper .step.locked { opacity: 0.55; cursor: default; }
.pipeline-stepper .step.locked:hover { transform: none; }

/* Connector progress fill (overlaid on the gray ::before line) */
.pipeline-stepper .progress-fill {
  position: absolute;
  top: 38px;
  left: 5%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent), var(--accent-bright));
  z-index: 0;
  transition: width .8s cubic-bezier(.2,.7,.2,1);
  box-shadow: 0 0 8px rgba(16,185,129,0.5);
}

/* Stage panel */
.pipeline-panel {
  background: linear-gradient(180deg, var(--bg-card) 0%, rgba(20,23,28,0.6) 100%);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 32px;
  min-height: 420px;
  position: relative;
  overflow: hidden;
  animation: panel-rise 450ms cubic-bezier(.2,.7,.2,1);
}
@keyframes panel-rise {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.pipeline-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(50rem 30rem at 80% -10%, rgba(16,185,129,0.06), transparent 60%);
  pointer-events: none;
}
.panel-eyebrow {
  font-family: 'Inter', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.32em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 10px;
  position: relative;
}
.panel-title {
  font-size: 32px !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em !important;
  margin-bottom: 12px;
  color: var(--text-primary);
  position: relative;
}
.panel-blurb {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 720px;
  margin-bottom: 24px;
  position: relative;
}

/* Metric tiles inside the panel */
.panel-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 12px;
  margin: 24px 0;
  position: relative;
}
.panel-metric {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px 16px;
}
.panel-metric .mk {
  font-family: 'Inter', sans-serif;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.panel-metric .mv {
  font-family: 'JetBrains Mono', monospace;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  font-variant-numeric: tabular-nums;
}
.panel-metric.good .mv { color: var(--green); }
.panel-metric.bad  .mv { color: var(--red); }
.panel-metric .ms {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Pass/fail verdict badge */
.panel-verdict {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-family: 'Inter', sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  margin: 16px 0;
  position: relative;
}
.panel-verdict.pass {
  background: rgba(52,211,153,0.10);
  color: var(--green);
  border: 1px solid rgba(52,211,153,0.35);
}
.panel-verdict.fail {
  background: rgba(239,68,68,0.10);
  color: var(--red);
  border: 1px solid rgba(239,68,68,0.35);
}
.panel-verdict.inprogress {
  background: rgba(251,191,36,0.10);
  color: #fbbf24;
  border: 1px solid rgba(251,191,36,0.35);
}
.panel-verdict .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: currentColor;
}
.panel-verdict.inprogress .dot { animation: step-pulse 1.5s ease-in-out infinite; }

/* Pipeline nav buttons */
.pipeline-nav {
  display: flex;
  justify-content: space-between;
  margin-top: 24px;
  position: relative;
}
.pipeline-nav button {
  padding: 10px 20px !important;
  font-family: 'Inter', sans-serif !important;
  font-weight: 600 !important;
  font-size: 12px !important;
  letter-spacing: 0.12em !important;
  text-transform: uppercase !important;
  background: var(--bg-input) !important;
  color: var(--text-primary) !important;
  border: 1px solid var(--border) !important;
  border-radius: 8px !important;
  cursor: pointer;
}
.pipeline-nav button:hover:not(:disabled) {
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}
.pipeline-nav button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}
.pipeline-nav button.primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent)) !important;
  color: #0a0a0a !important;
  border-color: transparent !important;
}
.pipeline-nav button.primary:hover {
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25), 0 8px 18px -8px rgba(16,185,129,0.6) !important;
}

/* Detail blocks inside a stage */
.panel-detail-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 24px;
  margin-top: 16px;
  position: relative;
}
.panel-bullet-list {
  list-style: none;
  padding: 0;
  margin: 0;
}
.panel-bullet-list li {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.5;
  border-bottom: 1px solid var(--border-soft);
}
.panel-bullet-list li::before {
  content: '◆';
  color: var(--accent);
  font-size: 10px;
  margin-top: 4px;
  flex-shrink: 0;
}
.panel-bullet-list li:last-child { border-bottom: none; }

/* ============================================================================
   ============================================================================
   QX SYSTEM v2 — refined design-system layer (additive, opt-in classes).
   Pages adopt these by adding classes; nothing below overrides legacy markup.
   ============================================================================
   ============================================================================ */

/* ── Selection + focus: the small details that read as "premium" ── */
::selection {
  background: rgba(16,185,129,0.30);
  color: #eafff6;
}
:focus-visible {
  outline: none;
  box-shadow: var(--ring-focus);
  border-radius: var(--radius-sm);
}
a:focus-visible, button:focus-visible {
  box-shadow: var(--ring-focus) !important;
}

/* ── Type scale ─────────────────────────────────────────────────────────── */
.type-display {
  font-family: var(--font-ui);
  font-size: var(--fs-display);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: var(--ls-display);
}
.type-h1 {
  font-family: var(--font-ui);
  font-size: var(--fs-h1);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: var(--ls-heading);
  color: var(--text-primary);
}
.type-h2 {
  font-family: var(--font-ui);
  font-size: var(--fs-h2);
  font-weight: 650;
  line-height: 1.25;
  letter-spacing: var(--ls-heading);
  color: var(--text-primary);
}
.type-eyebrow {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--accent-bright);
}
.type-label {
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: 600;
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  color: var(--text-muted);
  line-height: 1.4;
}
.type-body {
  font-family: var(--font-ui);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
}
.type-caption {
  font-family: var(--font-ui);
  font-size: var(--fs-caption);
  line-height: 1.5;
  color: var(--text-muted);
}
/* Mono numbers — tabular figures at three display weights */
.num    { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; font-feature-settings: "tnum"; }
.num-md { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; font-size: 18px; font-weight: 600; line-height: 1.1; }
.num-lg { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; font-size: 28px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; }
.num-xl { font-family: var(--font-mono) !important; font-variant-numeric: tabular-nums; font-size: 40px; font-weight: 700; line-height: 1.0;  letter-spacing: -0.02em; }
.num.pos, .num-md.pos, .num-lg.pos, .num-xl.pos { color: var(--green); }
.num.neg, .num-md.neg, .num-lg.neg, .num-xl.neg { color: var(--red); }

/* ── Card system ────────────────────────────────────────────────────────── */
/* PANEL — chart / table container. Quiet chrome, layered depth, hairline
   top highlight so the surface reads as lit from above. */
.qx-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(20,23,28,0.72) 0%, rgba(15,17,21,0.55) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-panel);
  overflow: hidden;
}
.qx-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 18px;
  border-bottom: 1px solid rgba(31,41,55,0.85);
  background: linear-gradient(180deg, rgba(255,255,255,0.018), transparent);
}
.qx-panel-title {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-ui);
  font-size: var(--fs-micro);
  font-weight: 700;
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  color: var(--accent-bright);
}
/* Accent bar — the refined version of the old "▌" glyph prefix */
.qx-bar {
  display: inline-block;
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-bright), var(--accent-dim));
  box-shadow: 0 0 8px rgba(16,185,129,0.45);
  flex-shrink: 0;
}

/* STAT TILE — a single big number with label + sub-line. */
.qx-tile {
  position: relative;
  background: linear-gradient(180deg, rgba(20,23,28,0.66), rgba(13,15,19,0.55));
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 16px 18px;
  box-shadow: var(--shadow-tile);
  transition:
    transform var(--dur-med) var(--ease-out),
    border-color var(--dur-med) var(--ease-out),
    box-shadow var(--dur-med) var(--ease-out),
    background var(--dur-med) var(--ease-out);
}
.qx-tile:hover {
  transform: translateY(-2px);
  border-color: rgba(16,185,129,0.35);
  box-shadow: var(--shadow-tile-hover);
}
.qx-tile-label {
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: var(--ls-micro);
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.qx-tile-value {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  font-size: 30px;
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
.qx-tile-sub {
  font-family: var(--font-mono) !important;
  font-variant-numeric: tabular-nums;
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 6px;
}
.qx-tile-value.pos { color: var(--green); }
.qx-tile-value.neg { color: var(--red); }
/* HERO tile — the headline metric. Larger number, emerald wash, soft glow. */
.qx-tile--hero {
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(16,185,129,0.12), transparent 55%),
    linear-gradient(180deg, rgba(20,23,28,0.72), rgba(13,15,19,0.60));
  border-color: rgba(16,185,129,0.28);
}
.qx-tile--hero:hover { border-color: rgba(16,185,129,0.50); }
.qx-tile--hero .qx-tile-value { font-size: 44px; letter-spacing: -0.02em; }
.qx-tile--hero .qx-tile-label { color: var(--accent-bright); }

/* ── Pills / badges ─────────────────────────────────────────────────────── */
.qx-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-family: var(--font-ui);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  border: 1px solid var(--border);
  color: var(--text-secondary);
  background: rgba(255,255,255,0.02);
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.qx-pill .qx-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.qx-pill--live {
  color: var(--accent-bright);
  border-color: rgba(16,185,129,0.35);
  background: rgba(16,185,129,0.07);
}
.qx-pill--live .qx-dot { animation: qxlab-pulse 2s ease-in-out infinite; }
.qx-pill--pass { color: var(--green); border-color: rgba(52,211,153,0.35); background: rgba(52,211,153,0.07); }
.qx-pill--fail { color: var(--red);   border-color: rgba(239,68,68,0.35);  background: rgba(239,68,68,0.07); }
.qx-pill--warn { color: var(--yellow); border-color: rgba(251,191,36,0.35); background: rgba(251,191,36,0.07); }
.qx-pill--tier { color: var(--text-primary); border-color: rgba(167,139,250,0.35); background: rgba(167,139,250,0.08); }

/* ── Buttons / nav links / toggles ──────────────────────────────────────── */
.qx-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  background: var(--bg-input);
  border: 1px solid var(--border);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) ease,
    color var(--dur-fast) ease,
    background var(--dur-fast) ease,
    box-shadow var(--dur-med) ease,
    transform 120ms ease;
}
.qx-btn:hover { border-color: rgba(16,185,129,0.5); color: var(--accent-bright); }
.qx-btn:active { transform: scale(0.98); }
.qx-btn--primary {
  background: linear-gradient(180deg, var(--accent-bright), var(--accent));
  color: #06231a;
  border-color: transparent;
}
.qx-btn--primary:hover {
  color: #06231a;
  box-shadow: 0 0 0 2px rgba(16,185,129,0.25), 0 8px 20px -8px rgba(16,185,129,0.55);
}
.qx-navlink {
  font-family: var(--font-ui);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  transition: color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.qx-navlink:hover { color: var(--text-primary); background: rgba(255,255,255,0.045); }
.qx-navlink.active {
  color: var(--accent-bright);
  background: rgba(16,185,129,0.08);
  box-shadow: inset 0 -1px 0 rgba(16,185,129,0.5);
}

/* ── Micro-motion: entrance rise for cards (CSS-only, reduced-motion safe) ── */
.qx-rise { animation: qx-rise var(--dur-slow) var(--ease-out) both; }
.qx-stagger > * { animation: qx-rise var(--dur-slow) var(--ease-out) both; }
.qx-stagger > *:nth-child(1) { animation-delay: 50ms; }
.qx-stagger > *:nth-child(2) { animation-delay: 110ms; }
.qx-stagger > *:nth-child(3) { animation-delay: 170ms; }
.qx-stagger > *:nth-child(4) { animation-delay: 230ms; }
.qx-stagger > *:nth-child(5) { animation-delay: 290ms; }
.qx-stagger > *:nth-child(6) { animation-delay: 350ms; }
.qx-stagger > *:nth-child(n+7) { animation-delay: 400ms; }
@keyframes qx-rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Reduced motion: collapse every animation/transition to near-zero ───── */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

