/* =========================================================
   LEEKS TERMINAL — Refined Quant Terminal Design System
   win9you.com · Day-trade signal dashboard
   v2.0 (2026-08-24 redesign)
   ========================================================= */

:root {
  /* Color tokens — dark, refined, slightly blue undertone */
  --bg: #0a0e1a;
  --bg-2: #0d1220;
  --panel: #131826;
  --panel-2: #18203a;
  --border: #1f2735;
  --border-2: #2a3447;
  --fg: #e8eaf0;
  --fg-2: #c5cad6;
  --dim: #8892a4; /* v2.1: lifted from #6b7280 for WCAG AA on panels (5.6:1) */
  --dim-2: #4b5563;
  --theme-color: #0a0e1a;

  /* Signal colors (dark palette) */
  --bull: #10b981;
  --bull-dim: rgba(16, 185, 129, 0.12);
  --bear: #f43f5e;
  --bear-dim: rgba(244, 63, 94, 0.12);
  --amber: #f59e0b;
  --amber-dim: rgba(245, 158, 11, 0.12);
  --blue: #818cf8;
  --blue-dim: rgba(129, 140, 248, 0.12);
  --violet: #a78bfa;

  /* Type */
  --font-display: 'Fraunces', 'Newsreader', 'Times New Roman', serif;
  --font-body: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', 'Menlo', monospace;

  /* Sizes */
  --text-xs: 11px;
  --text-sm: 12px;
  --text-base: 14px;
  --text-md: 15px;
  --text-lg: 17px;
  --text-xl: 20px;
  --text-2xl: 26px;
  --text-3xl: 34px;
  --text-4xl: 46px;
  --text-5xl: 64px;

  /* Spacing */
  --sp-1: 4px;
  --sp-2: 8px;
  --sp-3: 12px;
  --sp-4: 16px;
  --sp-5: 24px;
  --sp-6: 32px;
  --sp-7: 48px;
  --sp-8: 64px;
  --sp-9: 96px;

  --radius: 4px;
  --radius-lg: 8px;
  --container: 1280px;
}

/* Light theme */
:root[data-theme="light"] {
  --bg: #fafbfc;
  --bg-2: #f3f4f6;
  --panel: #ffffff;
  --panel-2: #f9fafb;
  --border: #e5e7eb;
  --border-2: #d1d5db;
  --fg: #1a1d23;
  --fg-2: #374151;
  --dim: #6b7280;
  --dim-2: #9ca3af;
  --bull: #059669;
  --bull-dim: rgba(5, 150, 105, 0.10);
  --bear: #dc2626;
  --bear-dim: rgba(220, 38, 38, 0.10);
  --amber: #d97706;
  --amber-dim: rgba(217, 119, 6, 0.10);
  --blue: #4f46e5;
  --blue-dim: rgba(79, 70, 229, 0.10);
  --violet: #7c3aed;
  --theme-color: #fafbfc;
}

/* v2.2 (2026-08-25 P0 fix): merged all tokens into a single :root block.
   Previous v2.0 had two :root blocks with the second one outside the first,
   leaving the signal palette and type scale orphaned in the cascade. */

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.55;
  background-image:
    radial-gradient(ellipse 800px 400px at 20% 0%, rgba(129, 140, 248, 0.06), transparent 60%),
    radial-gradient(ellipse 600px 300px at 80% 100%, rgba(167, 139, 250, 0.04), transparent 60%);
  background-attachment: fixed;
}

a { color: var(--blue); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--fg); }

img { max-width: 100%; height: auto; display: block; }

/* =========================================================
   Layout
   ========================================================= */
.container { max-width: var(--container); margin: 0 auto; padding: 0 var(--sp-5); }

.site-header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}

.nav {
  display: flex; align-items: center; gap: var(--sp-6);
  padding: var(--sp-4) var(--sp-5);
  max-width: var(--container);
  margin: 0 auto;
}

.nav-brand {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 500;
  letter-spacing: -0.01em;
  font-variation-settings: "opsz" 144, "SOFT" 30;
  color: var(--fg);
}

.nav-brand .leek { color: var(--bull); }

.nav-links { display: flex; gap: var(--sp-5); margin-left: auto; flex-wrap: wrap; }
.nav-links a {
  font-size: var(--text-sm);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-2);
  position: relative;
  padding: var(--sp-1) 0;
}
.nav-links a:hover, .nav-links a.active { color: var(--fg); }
.nav-links a.active::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: -2px;
  height: 1px; background: var(--bull);
}

.nav-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--dim);
  letter-spacing: 0.02em;
}

.live-dot {
  display: inline-block;
  width: 6px; height: 6px;
  background: var(--bull);
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px var(--bull);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* =========================================================
   Typography
   ========================================================= */
.display {
  font-family: var(--font-display);
  font-variation-settings: "opsz" 144, "SOFT" 30;
  letter-spacing: -0.02em;
  line-height: 1.05;
}

h1, .h1 { font-family: var(--font-display); font-size: var(--text-5xl); font-weight: 400; line-height: 1.0; letter-spacing: -0.025em; font-variation-settings: "opsz" 144, "SOFT" 50; }
h2, .h2 { font-family: var(--font-display); font-size: var(--text-3xl); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; font-variation-settings: "opsz" 80; }
h3, .h3 { font-family: var(--font-display); font-size: var(--text-xl); font-weight: 500; line-height: 1.2; font-variation-settings: "opsz" 40; }
h4, .h4 { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); }

/* Card label: h3 semantics (heading hierarchy fix) with the old h4 look.
   SEO audit 2026-08-25: homepage cards used h2→h4 skips. */
.card-label { font-family: var(--font-mono); font-size: var(--text-xs); font-weight: 600; text-transform: uppercase; letter-spacing: 0.12em; color: var(--dim); margin: 0 0 var(--sp-2); }

.italic { font-style: italic; font-variation-settings: "opsz" 144, "SOFT" 100; }

.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.tnum { font-variant-numeric: tabular-nums; }

.lede { font-size: var(--text-lg); color: var(--fg-2); line-height: 1.6; max-width: 60ch; }

.text-dim { color: var(--dim); }
.text-dim-2 { color: var(--dim-2); }
.text-bull { color: var(--bull); }
.text-bear { color: var(--bear); }
.text-amber { color: var(--amber); }
.text-accent { color: var(--blue); }

/* Theme toggle */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 4px;
  font-size: var(--text-xs);
  font-family: var(--font-mono);
  cursor: pointer;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--fg-2);
  letter-spacing: 0.06em;
  transition: all 0.12s ease;
}
.theme-toggle:hover { color: var(--fg); border-color: var(--border-2); }
.theme-toggle .icon { font-size: 14px; line-height: 1; }

/* =========================================================
   Hero
   ========================================================= */
.hero {
  padding: var(--sp-9) 0 var(--sp-8);
  position: relative;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: var(--sp-7);
  align-items: end;
}

.hero-title { font-size: var(--text-5xl); margin-bottom: var(--sp-4); }
.hero-title em { font-style: italic; color: var(--bull); font-variation-settings: "opsz" 144, "SOFT" 100; }

.hero-meta {
  display: flex; gap: var(--sp-5); margin-top: var(--sp-5);
  font-family: var(--font-mono); font-size: var(--text-sm);
  color: var(--dim);
  flex-wrap: wrap;
}
.hero-meta b { color: var(--fg); font-weight: 600; }

.hero-stat {
  padding: var(--sp-4) var(--sp-5);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.hero-stat .label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }
.hero-stat .value { font-family: var(--font-mono); font-size: var(--text-2xl); font-weight: 600; margin-top: 4px; }
.hero-stat .delta { font-family: var(--font-mono); font-size: var(--text-sm); margin-top: 2px; }

/* =========================================================
   Cards
   ========================================================= */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  transition: border-color 0.2s ease, transform 0.2s ease;
}
.card:hover { border-color: var(--border-2); }

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: var(--sp-4);
  margin: var(--sp-5) 0;
}

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

.signal-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-left: 3px solid var(--blue);
  border-radius: var(--radius);
  padding: var(--sp-4) var(--sp-5);
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--sp-4);
  transition: all 0.15s ease;
}
.signal-card:hover { transform: translateX(2px); border-color: var(--border-2); }
.signal-card.bull { border-left-color: var(--bull); }
.signal-card.bear { border-left-color: var(--bear); }
.signal-card.wait { border-left-color: var(--dim-2); }

.signal-ticker {
  font-family: var(--font-mono);
  font-size: var(--text-md);
  font-weight: 700;
  letter-spacing: -0.01em;
}
.signal-name { font-size: var(--text-sm); color: var(--fg-2); }
.signal-action {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.1em;
  padding: 3px 8px;
  border-radius: 3px;
}
.signal-action.bull { background: var(--bull-dim); color: var(--bull); }
.signal-action.bear { background: var(--bear-dim); color: var(--bear); }
.signal-action.wait { background: rgba(107, 114, 128, 0.12); color: var(--dim); }

.signal-detail {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-align: right;
  color: var(--fg-2);
}
.signal-detail b { color: var(--fg); font-weight: 600; }

/* =========================================================
   Buttons
   ========================================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2);
  padding: var(--sp-3) var(--sp-5);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  border-radius: var(--radius);
  border: 1px solid var(--border-2);
  background: var(--panel);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.15s ease;
}
.btn:hover { border-color: var(--blue); background: var(--panel-2); }
.btn-primary { background: var(--blue); color: var(--bg); border-color: var(--blue); }
.btn-primary:hover { background: var(--violet); border-color: var(--violet); color: var(--bg); }
.btn-ghost { background: transparent; border-color: var(--border); }
.btn-ghost:hover { background: var(--panel); }

.btn-row { display: flex; gap: var(--sp-3); flex-wrap: wrap; }

/* =========================================================
   Tables
   ========================================================= */
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--text-sm);
  font-variant-numeric: tabular-nums;
}

.data-table th {
  text-align: left;
  padding: var(--sp-3) var(--sp-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--dim);
  border-bottom: 1px solid var(--border-2);
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  position: sticky; top: 0;
  background: var(--bg-2);
  z-index: 5;
}
.data-table th:hover { color: var(--fg); }
.data-table th::after { content: ' \2195'; opacity: 0.3; font-size: 0.8em; margin-left: 4px; }
.data-table th.sorted-asc::after { content: ' \2191'; opacity: 0.8; }
.data-table th.sorted-desc::after { content: ' \2193'; opacity: 0.8; }

.data-table td {
  padding: var(--sp-3) var(--sp-4);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.data-table tr:hover td { background: rgba(129, 140, 248, 0.04); }
.data-table tr.row-bull td:first-child { box-shadow: inset 3px 0 0 var(--bull); }
.data-table tr.row-bear td:first-child { box-shadow: inset 3px 0 0 var(--bear); }
.data-table tr.row-wait td:first-child { box-shadow: inset 3px 0 0 var(--dim-2); }

.cell-right { text-align: right; }
.cell-action { font-weight: 600; letter-spacing: 0.04em; }
.cell-action.bull { color: var(--bull); }
.cell-action.bear { color: var(--bear); }
.cell-action.wait { color: var(--dim); }

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
}
.tag-bull { background: var(--bull-dim); color: var(--bull); }
.tag-bear { background: var(--bear-dim); color: var(--bear); }
.tag-amber { background: var(--amber-dim); color: var(--amber); }
.tag-blue { background: var(--blue-dim); color: var(--blue); }
.tag-dim { background: rgba(107, 114, 128, 0.12); color: var(--dim); }

/* =========================================================
   Filters
   ========================================================= */
.filter-bar {
  display: flex;
  gap: var(--sp-3);
  flex-wrap: wrap;
  align-items: center;
  padding: var(--sp-4);
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-4);
}
.filter-bar input, .filter-bar select {
  background: var(--bg-2);
  color: var(--fg);
  border: 1px solid var(--border-2);
  padding: var(--sp-2) var(--sp-3);
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-size: var(--text-sm);
}
.filter-bar input:focus, .filter-bar select:focus { outline: none; border-color: var(--blue); }
.filter-bar label { font-size: var(--text-xs); text-transform: uppercase; letter-spacing: 0.1em; color: var(--dim); }

.filter-chip {
  display: inline-block;
  appearance: none; -webkit-appearance: none; /* v2.1: render as <button> */
  padding: 4px 10px;
  border-radius: 3px;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  font-family: var(--font-mono);
  background: var(--panel-2);
  border: 1px solid var(--border-2);
  color: var(--fg);
  cursor: pointer;
  transition: all 0.12s ease;
}
.filter-chip:hover { border-color: var(--border-2); color: var(--fg); }
.filter-chip.active { background: var(--blue-dim); border-color: var(--blue); color: var(--blue); }

/* =========================================================
   Tabs
   ========================================================= */
.tabs {
  display: flex;
  gap: var(--sp-1);
  border-bottom: 1px solid var(--border-2);
  margin: var(--sp-5) 0 var(--sp-4);
}
.tab {
  padding: var(--sp-3) var(--sp-4);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: all 0.15s ease;
}
.tab:hover { color: var(--fg); }
.tab.active { color: var(--blue); border-bottom-color: var(--blue); }

/* =========================================================
   Sections
   ========================================================= */
section { padding: var(--sp-7) 0; }
section h2 { margin-bottom: var(--sp-4); }
section h2 .em { font-style: italic; color: var(--blue); font-variation-settings: "opsz" 80, "SOFT" 100; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: end;
  margin-bottom: var(--sp-5);
  flex-wrap: wrap;
  gap: var(--sp-3);
}

.section-meta {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--dim);
}

/* =========================================================
   Footer
   ========================================================= */
.site-footer {
  margin-top: var(--sp-9);
  padding: var(--sp-6) 0;
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  color: var(--dim);
}
.site-footer .row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: var(--sp-4); }
.site-footer a { color: var(--fg-2); }
.site-footer a:hover { color: var(--blue); }

.disclaimer {
  background: var(--amber-dim);
  border: 1px solid var(--amber);
  border-left-width: 3px;
  border-radius: var(--radius);
  padding: var(--sp-3) var(--sp-4);
  margin: var(--sp-4) 0;
  font-size: var(--text-sm);
  color: var(--fg-2);
}
.disclaimer b { color: var(--amber); }

/* =========================================================
   Page Header
   ========================================================= */
.page-head {
  padding: var(--sp-7) 0 var(--sp-5);
  border-bottom: 1px solid var(--border);
  margin-bottom: var(--sp-5);
}
.page-head h1 { margin-bottom: var(--sp-3); }
.page-head .lede { color: var(--fg-2); }

.kicker {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--blue);
  margin-bottom: var(--sp-3);
}

/* =========================================================
   Ticker detail page
   ========================================================= */
.detail-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr;
  gap: var(--sp-5);
  margin: var(--sp-5) 0;
}
@media (max-width: 1000px) { .detail-grid { grid-template-columns: 1fr; } }

.chart-frame {
  background: var(--bg-2);
  border: 1px solid var(--border-2);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* The candlestick chart is dark-themed (matplotlib hardcoded palette).
   In light mode, give it a soft shadow + clearer border so it reads as a
   distinct inset rather than a "lost" rectangle on white. */
:where(:root[data-theme="light"]) .chart-frame {
  box-shadow: inset 0 0 0 1px var(--border-2), 0 2px 8px rgba(13, 18, 32, 0.08);
}
.chart-frame img {
  display: block;
  max-width: 100%;
  height: auto;
}
.chart-frame img.loading {
  opacity: 0;
}
.chart-frame .skeleton {
  width: 100%;
  height: 600px;
  display: block;
}

.info-card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--sp-5);
  margin-bottom: var(--sp-4);
}
.info-card h3 { font-size: var(--text-md); margin-bottom: var(--sp-3); }
.info-card dl { display: grid; grid-template-columns: 1fr auto; gap: var(--sp-2) var(--sp-3); font-size: var(--text-sm); }
.info-card dt { color: var(--dim); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xs); }
.info-card dd { font-family: var(--font-mono); text-align: right; }

.phase-block {
  padding: var(--sp-3) var(--sp-4);
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--sp-3);
  font-size: var(--text-sm);
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.phase-block .name { color: var(--fg-2); font-family: var(--font-mono); text-transform: uppercase; letter-spacing: 0.08em; font-size: var(--text-xs); }
.phase-block .value { font-family: var(--font-mono); font-weight: 600; color: var(--fg); }

.scenario-list { list-style: none; padding: 0; }
.scenario-list li {
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.scenario-list li:last-child { border-bottom: none; }
.scenario-list b { color: var(--blue); }

.misjudge {
  display: flex;
  gap: var(--sp-3);
  padding: var(--sp-3) 0;
  border-bottom: 1px solid var(--border);
  font-size: var(--text-sm);
}
.misjudge:last-child { border-bottom: none; }
.misjudge .claim { color: var(--bear); flex: 0 0 38%; }
.misjudge .refute { color: var(--fg-2); flex: 1; }

/* =========================================================
   Animations
   ========================================================= */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in { animation: fadeIn 0.5s ease-out both; }
.fade-in-1 { animation-delay: 0.05s; }
.fade-in-2 { animation-delay: 0.15s; }
.fade-in-3 { animation-delay: 0.25s; }
.fade-in-4 { animation-delay: 0.35s; }
.fade-in-5 { animation-delay: 0.45s; }

@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
.skeleton {
  background: linear-gradient(90deg, var(--panel) 0%, var(--panel-2) 50%, var(--panel) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius);
  height: 60px;
}

/* =========================================================
   Utility
   ========================================================= */
.flex { display: flex; }
.flex-col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: var(--sp-1); }
.gap-2 { gap: var(--sp-2); }
.gap-3 { gap: var(--sp-3); }
.gap-4 { gap: var(--sp-4); }
.gap-5 { gap: var(--sp-5); }
.gap-6 { gap: var(--sp-6); }
.mt-2 { margin-top: var(--sp-2); }
.mt-3 { margin-top: var(--sp-3); }
.mt-4 { margin-top: var(--sp-4); }
.mt-5 { margin-top: var(--sp-5); }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-3 { margin-bottom: var(--sp-3); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-5 { margin-bottom: var(--sp-5); }

@media (max-width: 800px) {
  :root { --text-5xl: 42px; --text-4xl: 32px; --text-3xl: 26px; }
  .nav { flex-wrap: wrap; gap: var(--sp-3); }
  .nav-links { order: 3; width: 100%; gap: var(--sp-4); }
  .hero { padding: var(--sp-7) 0 var(--sp-6); }
  .hero-grid { grid-template-columns: 1fr; gap: var(--sp-5); }
  .signal-card { grid-template-columns: 1fr; gap: var(--sp-2); }
  .signal-detail { text-align: left; }
}

/* =========================================================
   v2.1 fixes (2026-08-25 design audit)
   ========================================================= */

/* Mobile reading order: verdict column (Action Plan / Key levels)
   stacks ABOVE chart + framework on narrow screens */
@media (max-width: 1000px) {
  .detail-grid > div:last-child { order: -1; }
}

/* Chart frame: shorter reserve height on mobile */
@media (max-width: 800px) {
  .chart-frame { min-height: 420px; }
  .chart-frame .skeleton { height: 420px; }
}

/* Keyboard focus visibility */
.filter-chip:focus-visible,
.theme-toggle:focus-visible,
.data-table th:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 2px;
}
.data-table th:focus-visible { color: var(--fg); }

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