/* ==========================================================================
   FXCarry Pro (Planet #22) — Zurich Private FX Desk Design System
   Dark Default: Deep Midnight Cobalt (#060B14)
   Light Toggle: Swiss Alabaster (#F6F8FB)
   Accents: FX Sky (#38BDF8), Carry Emerald (#10B981), Unwind Crimson (#F43F5E), Sovereign Gold (#E5B95C)
   ========================================================================== */

:root,
[data-theme="dark"] {
  --bg-canvas: #060B14;
  --bg-surface: #0B1322;
  --bg-surface-2: #0F1A2E;
  --bg-elevated: #14223B;
  --bg-hover: #192B4A;
  --bg-glass: rgba(11, 19, 34, 0.86);

  --border-subtle: rgba(148, 179, 219, 0.14);
  --border-med: rgba(148, 179, 219, 0.24);
  --border-sky: rgba(56, 189, 248, 0.42);
  --border-gold: rgba(229, 185, 92, 0.42);

  --text-primary: #F1F6FC;
  --text-secondary: #A3B8D4;
  --text-muted: #7088A8;

  --fx-sky: #38BDF8;
  --fx-sky-soft: rgba(56, 189, 248, 0.14);
  --carry-emerald: #10B981;
  --carry-emerald-soft: rgba(16, 185, 129, 0.15);
  --unwind-crimson: #F43F5E;
  --unwind-crimson-soft: rgba(244, 63, 94, 0.16);
  --sovereign-gold: #E5B95C;
  --sovereign-gold-soft: rgba(229, 185, 92, 0.15);

  --chart-grid: rgba(148, 179, 219, 0.12);
  --chart-axis: #8FA7C7;
  --chart-bg: rgba(6, 11, 20, 0.62);
  --hud-bg: rgba(9, 16, 30, 0.96);
  --shadow-card: 0 12px 32px rgba(0, 0, 0, 0.34);
  --shadow-hud: 0 10px 28px rgba(0, 0, 0, 0.55);
}

[data-theme="light"] {
  --bg-canvas: #F6F8FB;
  --bg-surface: #FFFFFF;
  --bg-surface-2: #F0F4FA;
  --bg-elevated: #E6EEF8;
  --bg-hover: #DCE7F5;
  --bg-glass: rgba(255, 255, 255, 0.90);

  --border-subtle: rgba(15, 29, 51, 0.11);
  --border-med: rgba(15, 29, 51, 0.20);
  --border-sky: rgba(2, 132, 199, 0.40);
  --border-gold: rgba(180, 123, 20, 0.40);

  --text-primary: #0B1526;
  --text-secondary: #374D6B;
  --text-muted: #5F7594;

  --fx-sky: #0284C7;
  --fx-sky-soft: rgba(2, 132, 199, 0.11);
  --carry-emerald: #059669;
  --carry-emerald-soft: rgba(5, 150, 105, 0.12);
  --unwind-crimson: #E11D48;
  --unwind-crimson-soft: rgba(225, 29, 72, 0.12);
  --sovereign-gold: #B47B14;
  --sovereign-gold-soft: rgba(180, 123, 20, 0.13);

  --chart-grid: rgba(15, 29, 51, 0.10);
  --chart-axis: #475E7D;
  --chart-bg: #F8FAFD;
  --hud-bg: rgba(255, 255, 255, 0.97);
  --shadow-card: 0 8px 24px rgba(15, 29, 51, 0.06);
  --shadow-hud: 0 10px 26px rgba(15, 29, 51, 0.16);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse 75% 42% at 50% -10%, rgba(56, 189, 248, 0.10), transparent 64%),
    radial-gradient(ellipse 45% 32% at 92% 8%, rgba(229, 185, 92, 0.07), transparent 60%);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'PingFang SC', 'Hiragino Sans GB', 'Inter', 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: clip;
}

[data-theme="light"] body {
  background-image:
    radial-gradient(ellipse 75% 38% at 50% -8%, rgba(2, 132, 199, 0.08), transparent 62%),
    radial-gradient(ellipse 45% 30% at 92% 6%, rgba(180, 123, 20, 0.06), transparent 58%);
}

button,
select,
input {
  font: inherit;
  color: inherit;
}

.num,
.meta-mono,
.mono-pill,
.stress-chip-val {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Topbar
   ========================================================================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  background: var(--bg-glass);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border-subtle);
}

.topbar-inner {
  max-width: 1380px;
  margin: 0 auto;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex-wrap: wrap;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--text-primary);
  min-height: 40px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-name {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-pro {
  color: var(--fx-sky);
}

.brand-sub {
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 500;
}

.orbit-slot {
  display: inline-flex;
  align-items: center;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.cta-link,
.cta-club,
.tool-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 13px;
  border-radius: 9px;
  font-size: 12.5px;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  border: 1px solid var(--border-med);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.cta-link:hover,
.cta-club:hover,
.tool-btn:hover {
  transform: translateY(-1px);
  border-color: var(--border-sky);
  background: var(--bg-hover);
}

.cta-link {
  border-color: var(--border-sky);
  background: var(--fx-sky-soft);
  color: var(--fx-sky);
}

.cta-club {
  border-color: var(--border-gold);
  background: var(--sovereign-gold-soft);
  color: var(--sovereign-gold);
}

.tool-btn--gold {
  background: linear-gradient(135deg, #E5B95C 0%, #C79229 100%);
  color: #060B14;
  border-color: transparent;
  font-weight: 750;
}

.tool-btn--gold:hover {
  background: linear-gradient(135deg, #F0CB79 0%, #D4A138 100%);
  color: #060B14;
  border-color: transparent;
}

.tool-btn--compact {
  min-width: 42px;
  padding: 0 11px;
  font-weight: 700;
}

.tool-btn.is-loading .refresh-icon {
  display: inline-block;
  animation: fx-spin 0.8s linear infinite;
}

@keyframes fx-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Main Page Shell & Executive Desk Ribbon
   ========================================================================== */
.page-shell {
  max-width: 1380px;
  margin: 0 auto;
  padding: 18px 20px 44px;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.desk-ribbon {
  background: linear-gradient(155deg, var(--bg-surface) 0%, var(--bg-surface-2) 100%);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.desk-ribbon-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.desk-headline-group {
  flex: 1 1 520px;
  min-width: 0;
}

.desk-eyebrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 11.5px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.live-beacon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  color: var(--carry-emerald);
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--carry-emerald);
  box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.22);
}

.meta-sep {
  opacity: 0.45;
}

.meta-mono {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: 11.5px;
  color: var(--text-muted);
}

.desk-title-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 6px;
}

.desk-title {
  margin: 0;
  font-size: clamp(21px, 2.3vw, 27px);
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
}

.regime-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 750;
  border: 1px solid var(--border-sky);
  background: var(--fx-sky-soft);
  color: var(--fx-sky);
  white-space: nowrap;
}

.regime-badge--crimson {
  border-color: rgba(244, 63, 94, 0.45);
  background: var(--unwind-crimson-soft);
  color: var(--unwind-crimson);
}

.regime-badge--gold {
  border-color: var(--border-gold);
  background: var(--sovereign-gold-soft);
  color: var(--sovereign-gold);
}

.regime-badge--emerald {
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--carry-emerald-soft);
  color: var(--carry-emerald);
}

.desk-summary {
  margin: 0;
  color: var(--text-secondary);
  font-size: 13.5px;
  max-width: 860px;
}

.desk-stress-chip {
  flex: 0 0 auto;
  min-width: 176px;
  padding: 12px 16px;
  border-radius: 13px;
  border: 1px solid var(--border-med);
  background: var(--bg-elevated);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 3px;
}

.stress-chip-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.stress-chip-row {
  display: flex;
  align-items: baseline;
  gap: 3px;
}

.stress-chip-val {
  font-size: 30px;
  font-weight: 850;
  line-height: 1;
  letter-spacing: -0.03em;
}

.stress-chip-denom {
  font-size: 13px;
  color: var(--text-muted);
  font-weight: 600;
}

.stress-chip-tier {
  font-size: 11.5px;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 6px;
  margin-top: 2px;
}

/* 6-Card Anchor Tape */
.anchor-tape {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.anchor-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 11px 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  transition: border-color 0.14s ease, transform 0.14s ease;
}

.anchor-card--clickable {
  cursor: pointer;
}

.anchor-card--clickable:hover {
  border-color: var(--border-sky);
  transform: translateY(-1px);
}

.anchor-label {
  font-size: 11px;
  font-weight: 650;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.anchor-val-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 6px;
}

.anchor-val {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.anchor-delta {
  font-size: 11.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.anchor-sub {
  font-size: 11px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.tone-pos { color: var(--carry-emerald); }
.tone-neg { color: var(--unwind-crimson); }
.tone-sky { color: var(--fx-sky); }
.tone-gold { color: var(--sovereign-gold); }
.tone-muted { color: var(--text-muted); }

/* ==========================================================================
   Panels & Controls
   ========================================================================== */
.panel {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 16px;
  padding: 18px 20px;
  box-shadow: var(--shadow-card);
  min-width: 0;
}

.panel--featured {
  border-color: rgba(56, 189, 248, 0.24);
}

.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.panel-header--compact {
  margin-bottom: 10px;
}

.panel-title-block {
  min-width: 0;
  flex: 1 1 300px;
}

.section-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 750;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--fx-sky);
  margin-bottom: 3px;
}

.panel-title {
  margin: 0;
  font-size: 17.5px;
  font-weight: 800;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.panel-subtitle {
  margin: 4px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.panel-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

.panel-controls--wrap {
  flex-wrap: wrap;
}

.seg-group {
  display: inline-flex;
  align-items: center;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 3px;
  gap: 2px;
}

.seg-group--full {
  display: flex;
  width: 100%;
}

.seg-group--full .seg-btn {
  flex: 1 1 0;
}

.seg-btn {
  min-height: 36px;
  padding: 0 12px;
  border: none;
  border-radius: 7px;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, color 0.14s ease;
}

.seg-btn:hover {
  color: var(--text-primary);
  background: var(--bg-hover);
}

.seg-btn.is-active {
  background: var(--fx-sky);
  color: #060B14;
}

[data-theme="light"] .seg-btn.is-active {
  color: #FFFFFF;
}

.pill-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 750;
  background: var(--fx-sky-soft);
  color: var(--fx-sky);
  border: 1px solid var(--border-sky);
  white-space: nowrap;
}

.pill-badge--emerald {
  background: var(--carry-emerald-soft);
  color: var(--carry-emerald);
  border-color: rgba(16, 185, 129, 0.40);
}

.pill-badge--crimson {
  background: var(--unwind-crimson-soft);
  color: var(--unwind-crimson);
  border-color: rgba(244, 63, 94, 0.42);
}

.pill-badge--gold {
  background: var(--sovereign-gold-soft);
  color: var(--sovereign-gold);
  border-color: var(--border-gold);
}

/* ==========================================================================
   Centerpiece #1 — Yen Carry Trade Stress Monitor
   ========================================================================== */
.yen-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.68fr) minmax(300px, 1fr);
  gap: 16px;
  align-items: stretch;
}

.yen-chart-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  min-width: 0;
}

.chart-legend-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  font-size: 12px;
  color: var(--text-secondary);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  width: 14px;
  height: 3px;
  border-radius: 2px;
  display: inline-block;
}

.swatch--sky { background: var(--fx-sky); }
.swatch--gold { background: var(--sovereign-gold); }
.swatch--crimson { background: var(--unwind-crimson); }
.swatch--dash {
  background: transparent;
  border-top: 2px dashed var(--text-muted);
  height: 0;
}

.chart-stage {
  position: relative;
  width: 100%;
  background: var(--chart-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  padding: 6px;
  overflow: hidden;
}

.chart-svg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.chart-hud {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 15;
  pointer-events: none;
  background: var(--hud-bg);
  border: 1px solid var(--border-sky);
  border-radius: 10px;
  padding: 9px 12px;
  min-width: 185px;
  max-width: 245px;
  box-shadow: var(--shadow-hud);
  font-size: 12px;
  line-height: 1.4;
}

.hud-title {
  font-weight: 800;
  font-size: 12.5px;
  color: var(--text-primary);
  margin-bottom: 5px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border-subtle);
  font-variant-numeric: tabular-nums;
}

.hud-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 2px;
}

.hud-k {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.hud-v {
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.yen-alert-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.alert-callout {
  border-radius: 10px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.alert-callout--warn {
  border-color: rgba(244, 63, 94, 0.36);
  background: var(--unwind-crimson-soft);
}

.alert-callout--gold {
  border-color: var(--border-gold);
  background: var(--sovereign-gold-soft);
}

.alert-callout-head {
  font-size: 11.5px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.alert-callout-body {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.42;
}

.yen-gauge-col {
  display: flex;
  min-width: 0;
}

.gauge-card {
  flex: 1;
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.gauge-svg-wrap {
  width: 100%;
  max-width: 268px;
  margin: 0 auto;
}

.gauge-svg {
  display: block;
  width: 100%;
  height: auto;
}

.gauge-headline {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.45;
  text-align: center;
}

.factor-list {
  display: flex;
  flex-direction: column;
  gap: 9px;
  margin-top: 2px;
}

.factor-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.factor-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 12px;
}

.factor-name {
  font-weight: 650;
  color: var(--text-primary);
}

.factor-pts {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.factor-track {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.factor-fill {
  height: 100%;
  border-radius: 999px;
  transform-origin: left center;
  transition: width 0.62s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.28s ease;
  animation: fx-bar-grow 0.68s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.factor-reading {
  font-size: 11px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   Centerpiece #2 — Quadrant + Dollar Smile & Sovereign Yield Ladder
   ========================================================================== */
.dual-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.52fr) minmax(330px, 1fr);
  gap: 18px;
  align-items: start;
}

.quadrant-panel {
  display: flex;
  flex-direction: column;
}

.quad-footer-note {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.note-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--fx-sky);
  flex-shrink: 0;
}

.right-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.smile-svg-wrap {
  background: var(--chart-bg);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 6px;
}

.smile-desc {
  margin: 10px 0;
  font-size: 12.5px;
  color: var(--text-secondary);
  line-height: 1.48;
}

.smile-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.smile-mini {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 9px;
  padding: 8px 10px;
}

.smile-mini-k {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 650;
}

.smile-mini-v {
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.mini-legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.mini-dot {
  width: 8px;
  height: 8px;
  border-radius: 2px;
  display: inline-block;
}

.mini-dot--sky { background: var(--fx-sky); }
.mini-dot--gold { background: var(--sovereign-gold); }

.ladder-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ladder-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr) 92px;
  align-items: center;
  gap: 10px;
  font-size: 12px;
}

.ladder-ccy {
  display: flex;
  align-items: center;
  gap: 6px;
  font-weight: 800;
}

.ladder-bank {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--text-muted);
}

.ladder-bars {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.ladder-bar-track {
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.ladder-bar-policy {
  height: 100%;
  border-radius: 999px;
  background: var(--fx-sky);
  transform-origin: left center;
  transition: width 0.62s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
  animation: fx-bar-grow 0.66s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ladder-bar-policy--neg {
  background: var(--unwind-crimson);
}

.ladder-bar-policy--realpos {
  background: var(--carry-emerald);
}

.mobile-scroll-hint {
  display: none;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-align: right;
}

@media (max-width: 960px) {
  .mobile-scroll-hint {
    display: block;
  }
}

.ladder-bar-10y {
  height: 100%;
  border-radius: 999px;
  background: var(--sovereign-gold);
  transform-origin: left center;
  transition: width 0.62s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.25s ease;
  animation: fx-bar-grow 0.72s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.ladder-bar-10y--cpi {
  background: rgba(148, 163, 184, 0.72);
}

.ladder-nums {
  text-align: right;
  font-variant-numeric: tabular-nums;
  font-size: 11.5px;
  font-weight: 700;
  white-space: nowrap;
}

.ladder-nums-10y {
  color: var(--sovereign-gold);
  font-size: 11px;
  margin-left: 4px;
}

/* ==========================================================================
   Matrix & 16-Currency Table
   ========================================================================== */
.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}

.chip-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
}

.chip-row--tight {
  gap: 6px;
  margin-top: 6px;
}

.filter-chip,
.cap-chip,
.preset-pill {
  min-height: 40px;
  padding: 0 13px;
  border-radius: 9px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.filter-chip:hover,
.cap-chip:hover,
.preset-pill:hover {
  border-color: var(--border-sky);
  color: var(--text-primary);
}

.filter-chip.is-active,
.cap-chip.is-active {
  background: var(--fx-sky-soft);
  border-color: var(--border-sky);
  color: var(--fx-sky);
}

.preset-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.sort-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.sort-label {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-secondary);
}

.select-input {
  min-height: 40px;
  padding: 0 12px;
  border-radius: 9px;
  border: 1px solid var(--border-med);
  background: var(--bg-surface-2);
  color: var(--text-primary);
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.select-input--full {
  width: 100%;
}

.table-scroll {
  width: 100%;
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border-subtle);
}

.fx-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 880px;
  font-size: 12.5px;
}

.fx-table th {
  text-align: left;
  padding: 11px 12px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  background: var(--bg-surface-2);
  border-bottom: 1px solid var(--border-subtle);
  white-space: nowrap;
}

.fx-table th.num,
.fx-table td.num {
  text-align: right;
}

.fx-table th.center,
.fx-table td.center {
  text-align: center;
}

.fx-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border-subtle);
  vertical-align: middle;
  white-space: nowrap;
}

.fx-table tbody tr {
  transition: background 0.12s ease;
}

.fx-table tbody tr.pair-row {
  cursor: pointer;
}

.fx-table tbody tr:hover {
  background: var(--bg-hover);
}

.fx-table tbody tr:last-child td {
  border-bottom: none;
}

.pair-cell {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pair-cell-top {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pair-symbol {
  font-weight: 800;
  font-size: 13.5px;
  color: var(--text-primary);
}

.carry-leg-tag {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--carry-emerald-soft);
  color: var(--carry-emerald);
}

.carry-leg-tag--rev {
  background: var(--sovereign-gold-soft);
  color: var(--sovereign-gold);
}

.pair-sub {
  font-size: 11px;
  color: var(--text-muted);
}

.sharpe-cell {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
}

.sharpe-meter {
  width: 48px;
  height: 6px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
  display: inline-block;
}

.sharpe-fill {
  height: 100%;
  border-radius: 999px;
  display: block;
}

.vol-spike-tag {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 800;
  background: var(--unwind-crimson-soft);
  color: var(--unwind-crimson);
}

.spark-svg {
  display: inline-block;
  vertical-align: middle;
}

/* ==========================================================================
   Interactive FX Carry & Hedge Simulator
   ========================================================================== */
.sim-grid {
  display: grid;
  grid-template-columns: minmax(310px, 1fr) minmax(0, 1.48fr);
  gap: 18px;
  align-items: start;
}

.sim-controls-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 13px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sim-pair-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.swap-btn {
  min-height: 40px;
  min-width: 42px;
  border-radius: 9px;
  border: 1px solid var(--border-sky);
  background: var(--fx-sky-soft);
  color: var(--fx-sky);
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
}

.swap-btn:hover {
  background: var(--fx-sky);
  color: #060B14;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.field-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-secondary);
}

.mono-pill {
  font-size: 11.5px;
  font-weight: 750;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--bg-elevated);
  color: var(--fx-sky);
  border: 1px solid var(--border-subtle);
}

.capital-input-row {
  display: flex;
  align-items: center;
  background: var(--bg-surface);
  border: 1px solid var(--border-med);
  border-radius: 9px;
  padding: 0 12px;
  min-height: 42px;
}

.currency-prefix {
  font-weight: 800;
  color: var(--sovereign-gold);
  margin-right: 6px;
}

.num-input {
  width: 100%;
  border: none;
  background: transparent;
  outline: none;
  font-size: 15px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  min-height: 40px;
}

.sim-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shock-readout {
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  font-size: 13px;
}

.range-slider {
  width: 100%;
  accent-color: var(--fx-sky);
  min-height: 40px;
  cursor: pointer;
}

.sim-output-col {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.sim-kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.sim-kpi {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 11px;
  padding: 11px 12px;
  min-width: 0;
}

.sim-kpi-k {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 650;
}

.sim-kpi-v {
  font-size: 18px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  margin-top: 3px;
  line-height: 1.15;
}

.sim-kpi-sub {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 3px;
  font-variant-numeric: tabular-nums;
}

.cip-hedge-box {
  border-radius: 11px;
  border: 1px solid var(--border-gold);
  background: var(--sovereign-gold-soft);
  padding: 11px 14px;
  font-size: 12.5px;
  color: var(--text-primary);
  line-height: 1.5;
}

/* ==========================================================================
   Provenance Strip & Footer
   ========================================================================== */
.provenance-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 13px 16px;
  border-radius: 13px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
}

.prov-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.prov-label {
  font-size: 10.5px;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fx-sky);
}

.prov-val {
  font-size: 11.5px;
  color: var(--text-secondary);
}

.site-footer {
  border-top: 1px solid var(--border-subtle);
  padding: 18px 20px 30px;
  margin-top: 10px;
}

.footer-inner {
  max-width: 1380px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 12px;
  color: var(--text-muted);
}

.footer-gold {
  color: var(--sovereign-gold);
}

/* ==========================================================================
   Click-to-Inspect Pair Deep-Dive Drawer (Smooth Kinetic Slide)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 120;
  background: rgba(4, 8, 16, 0.74);
  backdrop-filter: blur(8px);
  display: flex;
  justify-content: flex-end;
  opacity: 0;
  transition: opacity 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer-backdrop.is-open {
  opacity: 1;
}

.drawer-backdrop[hidden] {
  display: none;
}

.pair-drawer {
  width: min(740px, 100vw);
  height: 100%;
  background: var(--bg-surface);
  border-left: 1px solid var(--border-med);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 20px 22px 28px;
  gap: 16px;
  box-shadow: -18px 0 48px rgba(0, 0, 0, 0.50);
  transform: translateX(34px);
  transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
}

.drawer-backdrop.is-open .pair-drawer {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border-subtle);
  padding-bottom: 14px;
}

.drawer-eyebrow-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 6px;
}

.drawer-title-row {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
}

.drawer-title {
  margin: 0;
  font-size: 24px;
  font-weight: 850;
  letter-spacing: -0.02em;
}

.drawer-spot {
  font-size: 22px;
  font-weight: 800;
  color: var(--fx-sky);
  font-variant-numeric: tabular-nums;
}

.drawer-chg {
  font-size: 14px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.drawer-desc {
  margin: 5px 0 0;
  font-size: 12.5px;
  color: var(--text-secondary);
}

.drawer-close {
  min-width: 42px;
  min-height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border-med);
  background: var(--bg-surface-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.drawer-close:hover {
  border-color: var(--unwind-crimson);
  color: var(--unwind-crimson);
  transform: scale(1.04);
}

.drawer-body {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.drawer-chart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.drawer-chart-title {
  font-size: 13px;
  font-weight: 750;
}

.drawer-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  color: var(--text-secondary);
}

.drawer-stats-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.drawer-stat {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 11px;
}

.drawer-stat-k {
  font-size: 10.5px;
  color: var(--text-muted);
  font-weight: 650;
}

.drawer-stat-v {
  font-size: 16px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  margin-top: 2px;
}

.drawer-cb-notes {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.cb-note-card {
  background: var(--bg-surface-2);
  border: 1px solid var(--border-subtle);
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 12px;
}

.cb-note-head {
  font-weight: 800;
  margin-bottom: 3px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.cb-note-sub {
  color: var(--text-secondary);
  font-size: 11.5px;
}

.drawer-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
  padding-top: 6px;
}

/* Toast */
.fx-toast {
  position: fixed;
  bottom: 22px;
  right: 22px;
  z-index: 160;
  background: var(--bg-elevated);
  border: 1px solid var(--border-gold);
  color: var(--text-primary);
  padding: 11px 16px;
  border-radius: 10px;
  font-size: 12.5px;
  font-weight: 700;
  box-shadow: var(--shadow-hud);
}

/* ==========================================================================
   RSI-129 Kinetic Motion, Replay Dock, Radar Beacons & Cross-Planet X-Ray
   ========================================================================== */
@keyframes fx-bar-grow {
  from { transform: scaleX(0); opacity: 0.45; }
  to { transform: scaleX(1); opacity: 1; }
}

@keyframes fx-stroke-draw {
  from { stroke-dashoffset: var(--dash-len, 1600); }
  to { stroke-dashoffset: 0; }
}

@keyframes fx-radar-ping {
  0% {
    transform: scale(0.85);
    opacity: 0.78;
  }
  75% {
    transform: scale(2.15);
    opacity: 0;
  }
  100% {
    transform: scale(2.25);
    opacity: 0;
  }
}

@keyframes fx-live-pulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.24); }
  50% { box-shadow: 0 0 0 7px rgba(16, 185, 129, 0.04); }
}

.live-dot {
  animation: fx-live-pulse 2.2s ease-in-out infinite;
}

.fx-stroke-draw {
  stroke-dasharray: var(--dash-len, 1600);
  stroke-dashoffset: var(--dash-len, 1600);
  animation: fx-stroke-draw 0.88s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.fx-stroke-draw--slow {
  animation-duration: 1.08s;
}

.fx-radar-ring {
  transform-box: fill-box;
  transform-origin: center;
  animation: fx-radar-ping 2.35s cubic-bezier(0.22, 1, 0.36, 1) infinite;
  pointer-events: none;
}

.fx-radar-ring--delayed {
  animation-delay: 1.15s;
}

.sharpe-fill {
  transform-origin: left center;
  transition: width 0.58s cubic-bezier(0.22, 1, 0.36, 1);
  animation: fx-bar-grow 0.64s cubic-bezier(0.22, 1, 0.36, 1) both;
}

/* Spread Cell Mini Differential Bar */
.spread-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.spread-sub-real {
  font-size: 10.5px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

.spread-mini-track {
  width: 56px;
  height: 4px;
  border-radius: 999px;
  background: var(--bg-elevated);
  overflow: hidden;
}

.spread-mini-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  transform-origin: left center;
  transition: width 0.56s cubic-bezier(0.22, 1, 0.36, 1);
  animation: fx-bar-grow 0.62s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.pair-radar-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--unwind-crimson);
  display: inline-block;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(244, 63, 94, 0.24);
}

.etf-chip {
  font-size: 10px;
  font-weight: 750;
  font-family: ui-monospace, Menlo, monospace;
  padding: 1px 5px;
  border-radius: 4px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
}

/* Cross-Planet X-Ray Context Bar */
.xray-context-bar {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 7px 10px;
  border-radius: 10px;
  border: 1px solid var(--border-gold);
  background: var(--sovereign-gold-soft);
}

.xray-context-bar[hidden] {
  display: none;
}

.xray-badge {
  font-family: ui-monospace, Menlo, monospace;
  font-size: 11px;
  font-weight: 850;
  padding: 3px 8px;
  border-radius: 6px;
  background: var(--sovereign-gold);
  color: #060B14;
}

.xray-copy {
  font-size: 12px;
  font-weight: 650;
  color: var(--text-primary);
}

.xray-btn {
  min-height: 36px;
  padding: 0 11px;
  border-radius: 7px;
  border: 1px solid var(--border-sky);
  background: var(--bg-surface);
  color: var(--fx-sky);
  font-size: 11.5px;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease;
}

.xray-btn:hover {
  transform: translateY(-1px);
  background: var(--fx-sky-soft);
}

.xray-btn--gold {
  border-color: var(--border-gold);
  color: var(--sovereign-gold);
}

/* Carry Shock & Yen Unwind Replay Dock */
.seg-btn--shock {
  color: var(--unwind-crimson);
}

.seg-btn--shock.is-active {
  background: var(--unwind-crimson);
  color: #FFFFFF;
}

.replay-dock {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 9px 12px;
  margin-bottom: 12px;
  border-radius: 11px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
}

.replay-dock.is-replaying {
  border-color: var(--border-sky);
  box-shadow: 0 0 0 1px rgba(56, 189, 248, 0.16);
}

.replay-dock-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.replay-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  min-width: 44px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border-med);
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.14s ease, border-color 0.14s ease, background 0.14s ease;
}

.replay-btn:hover {
  border-color: var(--border-sky);
  background: var(--bg-hover);
}

.replay-btn--play {
  background: linear-gradient(135deg, rgba(56, 189, 248, 0.20), rgba(16, 185, 129, 0.16));
  border-color: var(--border-sky);
  color: var(--fx-sky);
}

.replay-btn--play.is-playing {
  background: var(--fx-sky);
  color: #060B14;
}

[data-theme="light"] .replay-btn--play.is-playing {
  color: #FFFFFF;
}

.replay-btn--compact {
  padding: 0 10px;
  font-family: ui-monospace, Menlo, monospace;
}

.replay-scrubber-wrap {
  flex: 1 1 210px;
  min-width: 140px;
  display: flex;
  align-items: center;
}

.replay-scrubber {
  width: 100%;
  accent-color: var(--fx-sky);
  min-height: 40px;
  cursor: pointer;
  margin: 0;
}

.replay-hud-pill {
  font-family: ui-monospace, 'SF Mono', Menlo, monospace;
  font-size: 11.5px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface);
  color: var(--text-primary);
  white-space: nowrap;
}

.replay-hud-pill.is-shock {
  border-color: rgba(244, 63, 94, 0.48);
  background: var(--unwind-crimson-soft);
  color: var(--unwind-crimson);
}

/* Dollar Smile Interactive Zone Tabs */
.smile-zone-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-top: 9px;
}

.smile-tab {
  min-height: 36px;
  padding: 0 8px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-surface-2);
  color: var(--text-secondary);
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.smile-tab:hover {
  border-color: var(--border-sky);
  color: var(--text-primary);
}

.smile-tab.is-active[data-zone="LEFT_WING"] {
  border-color: rgba(244, 63, 94, 0.45);
  background: var(--unwind-crimson-soft);
  color: var(--unwind-crimson);
}

.smile-tab.is-active[data-zone="TROUGH"] {
  border-color: rgba(16, 185, 129, 0.45);
  background: var(--carry-emerald-soft);
  color: var(--carry-emerald);
}

.smile-tab.is-active[data-zone="RIGHT_WING"] {
  border-color: var(--border-gold);
  background: var(--sovereign-gold-soft);
  color: var(--sovereign-gold);
}

/* Sovereign Ladder Mode Header */
.ladder-panel .panel-header--compact .panel-title-block {
  flex: 1 1 175px;
}

.ladder-panel .panel-title {
  font-size: 16px;
}

.seg-group--compact .seg-btn {
  padding: 0 9px;
  font-size: 11.5px;
}

.ladder-legend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

/* Keyboard Accessibility Focus Rings */
button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
[tabindex="0"]:focus-visible {
  outline: 2px solid var(--fx-sky);
  outline-offset: 2px;
}

/* SVG Interactive Cursors & Hover Focus Dimming */
.quad-pair-node {
  cursor: pointer;
  transition: opacity 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.quad-pair-node:hover .quad-pill-bg {
  stroke-width: 1.9;
}

#quadrant-svg.has-focus .quad-pair-node:not(.is-focused) {
  opacity: 0.28;
}

#quadrant-svg.has-focus .quad-conn-line:not(.is-focused) {
  opacity: 0.14;
}

/* ==========================================================================
   Responsive Breakpoints (1280 / 1024 / 768 / 390)
   ========================================================================== */
@media (max-width: 1180px) {
  .anchor-tape {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .yen-grid {
    grid-template-columns: 1fr;
  }
  .dual-workspace {
    grid-template-columns: 1fr;
  }
  .right-stack {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
  .sim-grid {
    grid-template-columns: 1fr;
  }
  .fx-table {
    min-width: 740px;
    font-size: 11.5px;
  }
  .fx-table th,
  .fx-table td {
    padding: 8px 6px;
  }
  .pair-symbol {
    font-size: 12.5px;
  }
  .carry-leg-tag {
    font-size: 10px;
    padding: 1px 4px;
  }
  .etf-chip {
    font-size: 9.5px;
    padding: 1px 4px;
  }
  .pair-sub {
    max-width: 145px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .spread-mini-track {
    width: 44px;
  }
  .sharpe-meter {
    width: 28px;
  }
  .spark-svg {
    width: 64px;
    height: 22px;
  }
}

@media (max-width: 960px) {
  .desk-stress-chip {
    width: 100%;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
  }
}

@media (max-width: 820px) {
  .topbar-inner {
    padding: 10px 14px;
  }
  .page-shell {
    padding: 14px 14px 36px;
    gap: 14px;
  }
  .panel,
  .desk-ribbon {
    padding: 14px 14px;
    border-radius: 14px;
  }
  .anchor-tape {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .right-stack {
    grid-template-columns: 1fr;
  }
  .yen-alert-strip {
    grid-template-columns: 1fr;
  }
  .sim-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .provenance-strip {
    grid-template-columns: 1fr;
  }
  .drawer-stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .drawer-cb-notes {
    grid-template-columns: 1fr;
  }
  .seg-btn,
  .replay-btn,
  .smile-tab,
  .xray-btn {
    min-width: 44px;
    min-height: 40px;
    padding: 0 11px;
  }
  .replay-hud-pill {
    width: 100%;
    text-align: center;
  }
}

@media (max-width: 520px) {
  .topbar-inner {
    padding: 9px 12px;
    gap: 8px;
  }
  .topbar-right {
    width: 100%;
    justify-content: flex-start;
  }
  .cta-link,
  .cta-club,
  .tool-btn {
    min-height: 40px;
    padding: 0 10px;
    font-size: 12px;
  }
  .anchor-val {
    font-size: 16px;
  }
  .sim-two-col {
    grid-template-columns: 1fr;
  }
  .sim-pair-row {
    grid-template-columns: 1fr;
  }
  .swap-btn {
    width: 100%;
  }
  .smile-metrics {
    grid-template-columns: 1fr;
  }
  .pair-drawer {
    padding: 16px 14px 24px;
  }
  .replay-dock-actions {
    width: 100%;
  }
  .replay-btn--play {
    flex: 1 1 auto;
  }
}

/* ==========================================================================
   Reduced Motion Accessibility (WCAG 2.1 AAA)
   ========================================================================== */
@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;
  }
  .fx-stroke-draw {
    stroke-dasharray: none !important;
    stroke-dashoffset: 0 !important;
  }
  .fx-radar-ring {
    animation: none !important;
    opacity: 0.25 !important;
  }
  .pair-drawer {
    transform: none !important;
  }
}
