/* ==========================================================================
   FinScope Mapping — Design Tokens
   Premium institutional fintech dark theme.
   ========================================================================== */
:root {
  /* --- Color: base --- */
  --bg: #050b14;
  --bg-grid: #071120;
  --surface: #0b1220;
  --surface-2: #101b2d;
  --surface-glass: rgba(16, 27, 45, 0.6);
  --border: rgba(148, 197, 178, 0.14);
  --border-strong: rgba(34, 227, 155, 0.38);

  /* --- Color: brand --- */
  --emerald: #14ab66;
  --emerald-bright: #22e39b;
  --emerald-dim: rgba(34, 227, 155, 0.12);
  --navy-deep: #060c18;
  --gold: #d9b45d;
  --gold-dim: rgba(217, 180, 93, 0.14);
  --red: #ff5a5f;
  --red-dim: rgba(255, 90, 95, 0.14);
  --blue-neutral: #5b8def;

  /* --- Color: text --- */
  --text-primary: #e7eef5;
  --text-muted: #8ea0b8;
  --text-dim: #52627a;

  /* --- Type --- */
  --font-display: "Space Grotesk", "Inter", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, monospace;

  /* --- Radius / shadow --- */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow-emerald: 0 0 24px rgba(34, 227, 155, 0.25);

  /* --- Layout --- */
  --header-h: 64px;
  --ticker-h: 40px;
  --rail-w: 300px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body.lang-fa {
  --font-display: "Vazirmatn", "Space Grotesk", sans-serif;
  --font-body: "Vazirmatn", -apple-system, BlinkMacSystemFont, sans-serif;
}
body.lang-fa .mono,
body.lang-fa .kpi-value,
body.lang-fa .ticker-item,
body.lang-fa table.data-table td,
body.lang-fa .a11y-table td,
body.lang-fa .drawer-stat .v,
body.lang-fa .drawer-price,
body.lang-fa .chain-metric b {
  font-family: var(--font-mono);
  direction: ltr;
  unicode-bidi: isolate;
}
html[dir="rtl"] .hero-cta,
html[dir="rtl"] .main-nav,
html[dir="rtl"] .internal-links,
html[dir="rtl"] .footer-sources { direction: rtl; }

.lang-toggle-btn {
  width: auto; padding: 0 10px; font-family: var(--font-mono); font-weight: 700; font-size: 12px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 { font-family: var(--font-display); margin: 0; font-weight: 600; letter-spacing: -0.01em; }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
button { font-family: var(--font-body); }
::selection { background: var(--emerald-dim); color: var(--emerald-bright); }

.mono { font-family: var(--font-mono); }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 500;
  background: var(--emerald); color: #04120b; padding: 10px 16px;
  border-radius: var(--radius-sm); font-weight: 600; transition: top .15s ease;
}
.skip-link:focus { top: 8px; }

:focus-visible {
  outline: 2px solid var(--emerald-bright);
  outline-offset: 2px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; }
}

/* ==========================================================================
   Animated background — network lines + drifting data points
   ========================================================================== */
.bg-layer {
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 900px 500px at 15% -10%, rgba(20, 171, 102, 0.14), transparent 60%),
    radial-gradient(ellipse 700px 500px at 100% 10%, rgba(91, 141, 239, 0.08), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-grid) 100%);
}
.bg-grid {
  position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.35;
  background-image:
    linear-gradient(rgba(148, 197, 178, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 197, 178, 0.05) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 20%, black, transparent 75%);
}
#bg-canvas { position: fixed; inset: 0; z-index: 0; pointer-events: none; opacity: 0.6; }

/* ==========================================================================
   Header
   ========================================================================== */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 24px;
  background: rgba(5, 11, 20, 0.82);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-size: 18px; font-weight: 700; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 8px;
  background: linear-gradient(135deg, var(--emerald) 0%, var(--emerald-bright) 100%);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-glow-emerald);
  color: #04120b; font-weight: 800; font-size: 15px;
}
.brand-name { color: var(--text-primary); }
.brand-product { color: var(--text-muted); font-weight: 500; font-size: 13px; margin-inline-start: 4px; }

.main-nav { display: flex; align-items: center; gap: 2px; }
.main-nav a {
  padding: 8px 12px; border-radius: var(--radius-sm); font-size: 13px; color: var(--text-muted);
  transition: color .15s ease, background .15s ease;
}
.main-nav a:hover { color: var(--text-primary); background: rgba(255,255,255,0.03); }
.main-nav a.active { color: var(--emerald-bright); box-shadow: inset 0 -2px 0 var(--emerald-bright); }
.nav-toggle { display: none; }

/* ==========================================================================
   Ticker strip
   ========================================================================== */
.ticker-wrap {
  height: var(--ticker-h);
  border-bottom: 1px solid var(--border);
  background: var(--surface);
  overflow: hidden;
  position: relative;
  z-index: 50;
}
.ticker-track {
  display: flex; align-items: center; gap: 36px; height: 100%;
  white-space: nowrap; animation: ticker-scroll 42s linear infinite;
  width: max-content;
}
.ticker-wrap:hover .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.ticker-item { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); display: flex; gap: 6px; align-items: center; }
.ticker-item b { color: var(--text-primary); font-weight: 600; }
.up { color: var(--emerald-bright); }
.down { color: var(--red); }

/* ==========================================================================
   Hero
   ========================================================================== */
.hero { position: relative; z-index: 1; padding: 56px 24px 32px; max-width: 1400px; margin: 0 auto; }
.hero-eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--emerald-bright); background: var(--emerald-dim); border: 1px solid var(--border-strong);
  padding: 5px 10px; border-radius: 999px; margin-bottom: 18px;
}
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--emerald-bright); box-shadow: 0 0 8px var(--emerald-bright); animation: pulse-dot 2s ease-in-out infinite; }
@keyframes pulse-dot { 0%,100% { opacity: 1; } 50% { opacity: 0.35; } }

.hero h1 { font-size: clamp(32px, 5vw, 52px); line-height: 1.05; max-width: 780px; }
.hero h1 .accent { background: linear-gradient(90deg, var(--emerald-bright), var(--gold)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { margin-top: 16px; max-width: 640px; color: var(--text-muted); font-size: 16px; }

.hero-cta { display: flex; gap: 12px; margin-top: 28px; flex-wrap: wrap; }
.btn {
  font-family: var(--font-body); font-size: 13.5px; font-weight: 600; cursor: pointer;
  padding: 11px 20px; border-radius: var(--radius-sm); border: 1px solid transparent;
  display: inline-flex; align-items: center; gap: 8px; transition: transform .12s ease, box-shadow .12s ease, background .12s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(135deg, var(--emerald), var(--emerald-bright)); color: #04140c; box-shadow: var(--shadow-glow-emerald); }
.btn-primary:hover { box-shadow: 0 0 32px rgba(34,227,155,0.4); }
.btn-ghost { background: rgba(255,255,255,0.03); border-color: var(--border); color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--border-strong); background: rgba(34,227,155,0.06); }
.btn-sm { padding: 7px 12px; font-size: 12.5px; }

/* KPI strip */
.kpi-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 1px;
  margin-top: 40px; border: 1px solid var(--border); border-radius: var(--radius-md);
  overflow: hidden; background: var(--border);
}
.kpi {
  background: var(--surface-glass); backdrop-filter: blur(10px);
  padding: 16px 18px; display: flex; flex-direction: column; gap: 6px;
}
.kpi-label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.05em; }
.kpi-value { font-family: var(--font-mono); font-size: 18px; font-weight: 600; color: var(--text-primary); }
.kpi-delta { font-size: 12px; font-family: var(--font-mono); }

.regime-card {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 12px;
  padding: 12px 18px; border-radius: var(--radius-md);
  background: var(--surface-glass); border: 1px solid var(--border);
}
.regime-badge { font-family: var(--font-mono); font-weight: 700; font-size: 13px; padding: 4px 10px; border-radius: 999px; }
.regime-badge.risk-on { background: var(--emerald-dim); color: var(--emerald-bright); border: 1px solid var(--border-strong); }
.regime-badge.risk-off { background: var(--red-dim); color: var(--red); border: 1px solid rgba(255,90,95,0.35); }
.regime-badge.neutral { background: rgba(91,141,239,0.12); color: var(--blue-neutral); border: 1px solid rgba(91,141,239,0.35); }
.regime-badge.insufficient { background: rgba(255,255,255,0.05); color: var(--text-muted); border: 1px solid var(--border); }
.regime-meta { font-size: 12px; color: var(--text-muted); max-width: 480px; }
.info-btn { background: none; border: 1px solid var(--border); color: var(--text-muted); border-radius: 50%; width: 18px; height: 18px; font-size: 11px; cursor: pointer; line-height: 1; }

/* ==========================================================================
   Workspace layout
   ========================================================================== */
.workspace { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 8px 24px 64px; }

.toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
  padding: 12px 14px; margin-bottom: 14px;
  background: var(--surface-glass); border: 1px solid var(--border); border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}
.tool-group { display: flex; align-items: center; gap: 6px; }
.tool-group label { font-size: 11px; color: var(--text-dim); text-transform: uppercase; letter-spacing: 0.04em; margin-inline-end: 2px; }
select, .search-input {
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-primary);
  border-radius: var(--radius-sm); padding: 7px 10px; font-size: 13px; font-family: var(--font-body);
}
select:hover, .search-input:hover { border-color: var(--border-strong); }
.mode-tabs { display: flex; gap: 4px; flex-wrap: wrap; }
.mode-tab {
  padding: 7px 13px; border-radius: 999px; font-size: 12.5px; font-weight: 600;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer;
  transition: all .15s ease;
}
.mode-tab:hover { color: var(--text-primary); }
.mode-tab.active { background: var(--emerald-dim); color: var(--emerald-bright); border-color: var(--border-strong); }

.search-wrap { position: relative; flex: 1; min-width: 180px; }
.search-input { width: 100%; padding-inline-start: 30px; }
.search-icon { position: absolute; inset-inline-start: 9px; top: 50%; transform: translateY(-50%); color: var(--text-dim); font-size: 13px; }

.spacer { flex: 1; }
.icon-btn {
  width: 32px; height: 32px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted);
  cursor: pointer; display: flex; align-items: center; justify-content: center; font-size: 14px;
  transition: all .15s ease;
}
.icon-btn:hover { color: var(--emerald-bright); border-color: var(--border-strong); }
.icon-btn.active { color: var(--emerald-bright); border-color: var(--border-strong); background: var(--emerald-dim); }

.refresh-status { font-size: 11px; color: var(--text-dim); font-family: var(--font-mono); display: flex; align-items: center; gap: 6px; }
.data-badge {
  font-family: var(--font-mono); font-size: 10px; font-weight: 700; letter-spacing: 0.05em;
  padding: 2px 7px; border-radius: 4px; text-transform: uppercase;
}
.data-badge.demo { background: var(--gold-dim); color: var(--gold); border: 1px solid rgba(217,180,93,0.35); }
.data-badge.live { background: var(--emerald-dim); color: var(--emerald-bright); border: 1px solid var(--border-strong); }

/* filter chips row */
.filter-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.chip {
  padding: 6px 12px; border-radius: 999px; font-size: 12px; cursor: pointer;
  background: rgba(255,255,255,0.03); border: 1px solid var(--border); color: var(--text-muted);
  transition: all .15s ease;
}
.chip:hover { color: var(--text-primary); }
.chip.active { background: var(--emerald-dim); color: var(--emerald-bright); border-color: var(--border-strong); }

/* main grid: map + right rail */
.main-grid { display: grid; grid-template-columns: 1fr var(--rail-w); gap: 14px; align-items: start; }

.map-panel {
  background: var(--surface-glass); border: 1px solid var(--border); border-radius: var(--radius-lg);
  backdrop-filter: blur(10px); overflow: hidden; position: relative;
  box-shadow: var(--shadow-glass);
}
.map-panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
}
.map-panel-head h2 { font-size: 15px; }
#map-svg-wrap { position: relative; width: 100%; height: 560px; touch-action: none; }
#bubble-svg { width: 100%; height: 100%; display: block; cursor: grab; }
#bubble-svg:active { cursor: grabbing; }

.map-panel.fullscreen {
  position: fixed; inset: 0; z-index: 300; border-radius: 0; height: 100vh;
}
.map-panel.fullscreen #map-svg-wrap { height: calc(100vh - 53px); }

.empty-state { position: absolute; inset: 0; display: none; align-items: center; justify-content: center; flex-direction: column; gap: 10px; color: var(--text-muted); text-align: center; padding: 20px; }
.empty-state.visible { display: flex; }

/* bubble tooltip */
.bubble-tooltip {
  position: absolute; pointer-events: none; z-index: 60;
  background: rgba(10, 16, 28, 0.96); border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm); padding: 10px 12px; min-width: 180px;
  font-size: 12px; box-shadow: var(--shadow-glass); opacity: 0; transform: translateY(4px);
  transition: opacity .1s ease, transform .1s ease;
}
.bubble-tooltip.visible { opacity: 1; transform: translateY(0); }
.bubble-tooltip .tt-title { font-family: var(--font-display); font-weight: 700; font-size: 13.5px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 10px; }
.bubble-tooltip .tt-row { display: flex; justify-content: space-between; gap: 14px; color: var(--text-muted); padding: 2px 0; }
.bubble-tooltip .tt-row b { color: var(--text-primary); font-family: var(--font-mono); }

/* right rail */
.rail { display: flex; flex-direction: column; gap: 14px; }
.rail-card {
  background: var(--surface-glass); border: 1px solid var(--border); border-radius: var(--radius-md);
  backdrop-filter: blur(10px); padding: 14px 16px;
}
.rail-card h3 { font-size: 12.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 10px; display: flex; align-items: center; justify-content: space-between; }
.heat-row { display: flex; justify-content: space-between; align-items: center; padding: 6px 0; font-size: 12.5px; border-bottom: 1px dashed var(--border); }
.heat-row:last-child { border-bottom: none; }
.heat-row .name { color: var(--text-primary); font-weight: 500; }
.heat-row .val { font-family: var(--font-mono); }

.insight-item { display: flex; gap: 8px; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: 12.5px; color: var(--text-muted); line-height: 1.4; }
.insight-item:last-child { border-bottom: none; }
.insight-item .ico { color: var(--emerald-bright); flex-shrink: 0; }

/* accessible list alt view */
.a11y-list-toggle { display: flex; align-items: center; gap: 8px; }
.a11y-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.a11y-table th { text-align: start; color: var(--text-dim); font-weight: 600; text-transform: uppercase; font-size: 10.5px; padding: 8px 10px; border-bottom: 1px solid var(--border); }
.a11y-table td { padding: 9px 10px; border-bottom: 1px solid rgba(255,255,255,0.03); font-family: var(--font-mono); }
.a11y-table tr:hover td { background: rgba(255,255,255,0.02); }
.a11y-table button.row-focus { background: none; border: none; color: var(--text-primary); font-family: var(--font-body); cursor: pointer; text-align: start; padding: 0; font-weight: 600; }
.a11y-table button.row-focus:hover { color: var(--emerald-bright); }

/* ==========================================================================
   Sections below the workspace (chains, insights, SEO content)
   ========================================================================== */
.section { position: relative; z-index: 1; max-width: 1400px; margin: 0 auto; padding: 40px 24px; }
.section-head { margin-bottom: 22px; }
.section-head .eyebrow { font-family: var(--font-mono); font-size: 11px; color: var(--emerald-bright); text-transform: uppercase; letter-spacing: 0.08em; }
.section-head h2 { font-size: 26px; margin-top: 6px; }
.section-head p { color: var(--text-muted); margin-top: 8px; max-width: 620px; }

.chain-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.chain-card {
  background: var(--surface-glass); border: 1px solid var(--border); border-radius: var(--radius-md);
  padding: 16px; backdrop-filter: blur(10px); transition: border-color .15s ease, transform .15s ease;
}
.chain-card:hover { border-color: var(--border-strong); transform: translateY(-2px); }
.chain-card .cname { font-family: var(--font-display); font-weight: 700; font-size: 15px; margin-bottom: 10px; display: flex; justify-content: space-between; align-items: center; }
.chain-metric { display: flex; justify-content: space-between; font-size: 12px; padding: 4px 0; color: var(--text-muted); }
.chain-metric b { font-family: var(--font-mono); color: var(--text-primary); }

.stable-table-wrap, .liq-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius-md); background: var(--surface-glass); backdrop-filter: blur(10px); }
table.data-table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
table.data-table th { text-align: start; padding: 12px 16px; color: var(--text-dim); font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; border-bottom: 1px solid var(--border); }
table.data-table td { padding: 12px 16px; border-bottom: 1px solid rgba(255,255,255,0.03); font-family: var(--font-mono); }
table.data-table tr:last-child td { border-bottom: none; }
table.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.faq-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.faq-item { background: var(--surface-glass); border: 1px solid var(--border); border-radius: var(--radius-md); padding: 16px 18px; backdrop-filter: blur(10px); }
.faq-item h4 { font-size: 14px; margin-bottom: 8px; color: var(--text-primary); }
.faq-item p { font-size: 13px; color: var(--text-muted); line-height: 1.6; }

.internal-links { display: flex; flex-wrap: wrap; gap: 10px; }
.internal-links a { padding: 8px 14px; border-radius: 999px; border: 1px solid var(--border); font-size: 12.5px; color: var(--text-muted); }
.internal-links a:hover { color: var(--emerald-bright); border-color: var(--border-strong); }

/* ==========================================================================
   Detail drawer
   ========================================================================== */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(2, 6, 12, 0.6); backdrop-filter: blur(2px);
  z-index: 200; opacity: 0; pointer-events: none; transition: opacity .18s ease;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }

.drawer {
  position: fixed; top: 0; bottom: 0; inset-inline-end: 0; width: min(420px, 100vw);
  background: var(--surface); border-inline-start: 1px solid var(--border);
  z-index: 201; transform: translateX(100%); transition: transform .22s cubic-bezier(.2,.8,.2,1);
  overflow-y: auto; box-shadow: -12px 0 40px rgba(0,0,0,0.5);
}
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; padding: 20px 20px 12px; border-bottom: 1px solid var(--border); }
.drawer-title { font-family: var(--font-display); font-size: 22px; font-weight: 700; }
.drawer-sub { color: var(--text-muted); font-size: 13px; margin-top: 4px; }
.drawer-price { font-family: var(--font-mono); font-size: 26px; margin-top: 10px; }
.drawer-body { padding: 16px 20px 40px; display: flex; flex-direction: column; gap: 18px; }
.drawer-close { background: none; border: 1px solid var(--border); color: var(--text-muted); width: 30px; height: 30px; border-radius: 50%; cursor: pointer; }

.drawer-stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.drawer-stat { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 10px 12px; }
.drawer-stat .l { font-size: 10.5px; color: var(--text-dim); text-transform: uppercase; }
.drawer-stat .v { font-family: var(--font-mono); font-size: 15px; margin-top: 3px; }

.range-tabs { display: flex; gap: 4px; }
.range-tab { padding: 5px 10px; font-size: 11.5px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); color: var(--text-muted); cursor: pointer; }
.range-tab.active { color: var(--emerald-bright); border-color: var(--border-strong); background: var(--emerald-dim); }
#drawer-chart { width: 100%; height: 160px; display: block; }

.related-chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.data-quality-line { font-size: 11px; color: var(--text-dim); display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px dashed var(--border); }

/* ==========================================================================
   Footer
   ========================================================================== */
.site-footer { position: relative; z-index: 1; border-top: 1px solid var(--border); padding: 32px 24px; }
.footer-inner { max-width: 1400px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.footer-sources { display: flex; flex-wrap: wrap; gap: 18px; font-size: 12px; color: var(--text-muted); }
.footer-sources span b { color: var(--text-primary); }
.footer-disclaimer { font-size: 11.5px; color: var(--text-dim); line-height: 1.6; max-width: 900px; }
.footer-meta { font-size: 11.5px; color: var(--text-dim); display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; }

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 1080px) {
  .main-grid { grid-template-columns: 1fr; }
  .rail { flex-direction: row; overflow-x: auto; }
  .rail-card { min-width: 260px; }
  .kpi-grid { grid-template-columns: repeat(3, 1fr); }
  .chain-grid { grid-template-columns: repeat(2, 1fr); }
  .faq-grid { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .main-nav { display: none; }
  .main-nav.mobile-open {
    display: flex; flex-direction: column; position: fixed; top: var(--header-h);
    inset-inline: 0; z-index: 150; background: rgba(5,11,20,0.98); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--border); padding: 8px;
  }
  .main-nav.mobile-open a { padding: 12px 14px; }
  .nav-toggle { display: flex; }
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
  #map-svg-wrap { height: 460px; }
  .rail { flex-direction: column; }
  .rail-card { min-width: 0; }
  .toolbar { position: sticky; bottom: 0; order: 3; margin-top: 10px; margin-bottom: 0; border-radius: var(--radius-md) var(--radius-md) 0 0; }
  .filter-row { display: none; }
  .filter-row.sheet-open {
    display: flex; position: fixed; inset-inline: 0; bottom: 0; z-index: 250;
    background: var(--surface); border-top: 1px solid var(--border);
    border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 18px; margin: 0;
    box-shadow: 0 -12px 40px rgba(0,0,0,0.5);
  }
  .drawer { width: 100vw; }
  .chain-grid { grid-template-columns: 1fr 1fr; }
}
