/* Siberforge — Supply Chain Dashboard styles.
   Inherits the dark palette + Inter typography used across /core/. */

:root {
  --bg: #0b0d10;
  --panel: #13171c;
  --panel-2: #1a2028;
  --panel-3: #232b35;
  --line: #232b35;
  --text: #e5e9ee;
  --muted: #8a94a3;
  --muted-2: #5a6675;
  --accent: #f7a700;
  --green: #3ecf8e;
  --red: #ef4f5a;
  --blue: #5a9cff;

  --cat-dc:           #3b82f6;
  --cat-industrial-re:#8b5cf6;
  --cat-middle-mile:  #10b981;
  --cat-last-mile:    #f59e0b;
  --cat-international:#ef4444;
  --cat-composite:    #f7a700;

  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.42);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

a { color: var(--text); text-decoration: none; }
a:hover { color: var(--accent); }

/* ---------- top bar ---------- */
.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--line);
  background: rgba(19, 23, 28, 0.78);
  backdrop-filter: blur(14px) saturate(1.3);
  -webkit-backdrop-filter: blur(14px) saturate(1.3);
  position: sticky;
  top: 0;
  z-index: 100;
  transition: box-shadow .2s var(--ease-out), background .2s var(--ease-out);
}
.brand { display: flex; align-items: center; gap: 8px; }
.brand .mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue', Arial, sans-serif;
  font-weight: 900;
  letter-spacing: -0.02em;
  font-size: 18px;
  color: var(--text);
}
.brand .mark .brand-eyes {
  width: 36px;
  height: 16px;
  flex: 0 0 36px;
}
.brand .mark .siber { color: var(--text); }
.brand .mark .forge { color: #E63946; }
.brand .sub {
  color: var(--muted);
  margin-left: 14px;
  font-size: 13px;
}
.home-link {
  color: var(--muted);
  text-decoration: none;
  font-size: 18px;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  transition: color .15s, background-color .15s;
}
.home-link:hover { color: var(--accent); background: var(--panel-2); }
/* ---------- composite tile (top of overview) ---------- */
.composite-strip {
  margin: 24px;
  padding: 24px;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-left: 3px solid var(--cat-composite);
  border-radius: 6px;
  display: grid;
  grid-template-columns: 1fr 2fr 1fr;
  gap: 28px;
  align-items: center;
}
.composite-strip .label { color: var(--muted); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; }
.composite-strip .value { font-size: 42px; font-weight: 600; color: var(--accent); margin: 4px 0; }
.composite-strip .regime { font-size: 13px; color: var(--text); }
.composite-strip .regime.severe { color: var(--red); }
.composite-strip .regime.tight { color: #ffaa55; }
.composite-strip .regime.normal { color: var(--green); }
.composite-strip .regime.loose { color: var(--blue); }
.composite-strip svg.spark { width: 100%; height: 80px; }
.composite-strip .why {
  font-size: 12px; color: var(--muted); border-left: 2px solid var(--line); padding-left: 14px;
}

/* ---------- 2x2 quadrant grid (overview) ---------- */
.quadrants {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin: 0 24px 24px;
}
.quadrant {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px;
}
.quadrant h2 {
  margin: 0 0 12px;
  font-size: 15px; font-weight: 600;
  display: flex; align-items: center; gap: 8px;
}
.quadrant h2 .accent {
  width: 8px; height: 8px; border-radius: 50%;
}
.quadrant .open-link {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  color: var(--accent);
}
.quadrant .open-link:hover { text-decoration: underline; }

/* ---------- KPI tile grid (in quadrants and category pages) ---------- */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
}
.kpi-tile {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 12px;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, transform .15s;
}
.kpi-tile:hover { border-color: var(--accent); transform: translateY(-1px); }
.kpi-tile .kpi-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.5px; min-height: 26px; }
.kpi-tile .kpi-value { font-size: 22px; font-weight: 600; color: var(--text); margin: 2px 0; }
.kpi-tile .kpi-delta { font-size: 11px; color: var(--muted); }
.kpi-tile .kpi-delta.pos { color: var(--green); }
.kpi-tile .kpi-delta.neg { color: var(--red); }
.kpi-tile svg.spark { width: 100%; height: 28px; margin-top: 4px; }
.kpi-tile .stale-badge {
  position: absolute; top: 6px; right: 6px;
  background: rgba(239, 79, 90, 0.18);
  color: var(--red);
  font-size: 9px; padding: 2px 5px; border-radius: 3px;
  text-transform: uppercase; letter-spacing: 0.5px;
}
.kpi-tile.dim { opacity: 0.55; cursor: default; }

/* ---------- category pages: dense grid ---------- */
.dense-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
  margin: 0 24px 24px;
}

/* ---------- section headers ---------- */
.section-head {
  margin: 24px 24px 12px;
  display: flex; justify-content: space-between; align-items: baseline;
}
.section-head h2 { margin: 0; font-size: 16px; font-weight: 600; letter-spacing: 0.3px; }
.section-head .sub { color: var(--muted); font-size: 12px; }

/* ---------- hover tooltip ---------- */
.tooltip {
  position: absolute;
  z-index: 200;
  background: #0d1117;
  border: 1px solid var(--accent);
  border-radius: 6px;
  padding: 14px 16px;
  width: 360px;
  font-size: 12px;
  color: var(--text);
  box-shadow: var(--shadow-md);
  pointer-events: none;
  opacity: 0;
  transition: opacity .12s var(--ease-out);
}
.tooltip.show { opacity: 1; pointer-events: auto; }
.tooltip h3 { margin: 0 0 4px; font-size: 13px; font-weight: 600; }
.tooltip .latest { color: var(--muted); font-size: 11px; margin-bottom: 10px; }
.tooltip .deltas {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 4px 12px;
  border-top: 1px solid var(--line); padding-top: 8px;
  border-bottom: 1px solid var(--line); padding-bottom: 8px;
  margin-bottom: 8px;
}
.tooltip .deltas dt { color: var(--muted); font-size: 11px; }
.tooltip .deltas dd { margin: 0; color: var(--text); font-size: 11px; font-weight: 500; }
.tooltip .deltas dd.pos { color: var(--green); }
.tooltip .deltas dd.neg { color: var(--red); }
.tooltip h4 { margin: 6px 0 4px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }
.tooltip p { margin: 0 0 6px; line-height: 1.4; }
.tooltip .source-line { color: var(--muted-2); font-size: 10px; margin-top: 6px; }

/* ---------- drill-down chart page ---------- */
.drill-page { padding: 24px; max-width: 1100px; margin: 0 auto; }
.drill-header { margin-bottom: 18px; }
.drill-header h1 { margin: 0; font-size: 22px; font-weight: 600; }
.drill-header .meta { color: var(--muted); font-size: 13px; margin-top: 4px; }
.chart-frame { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; margin-bottom: 16px; }
.chart-frame svg { width: 100%; height: 360px; }
.methodology { background: var(--panel); border: 1px solid var(--line); border-radius: 6px; padding: 18px; }
.methodology h3 { margin: 0 0 8px; font-size: 13px; text-transform: uppercase; letter-spacing: 0.6px; color: var(--muted); }

/* ---------- download zone ---------- */
.download-zone { padding: 24px; max-width: 1200px; margin: 0 auto; }
.download-zone h1 { font-size: 22px; margin: 0 0 8px; }
.download-zone .hero {
  display: flex; justify-content: space-between; align-items: center;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  padding: 18px 22px; margin-bottom: 18px; border-radius: 6px;
}
.download-zone .bundle-btn {
  background: var(--accent); color: #0b0d10;
  padding: 10px 20px; border-radius: 4px; font-weight: 600;
  text-decoration: none;
}
.download-zone .bundle-btn:hover { background: #ffb721; color: #0b0d10; }
.download-zone table { width: 100%; border-collapse: collapse; font-size: 13px; }
.download-zone th, .download-zone td {
  text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line);
}
.download-zone th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 11px; letter-spacing: 0.6px; }
.download-zone tr:hover td { background: var(--panel); }
.download-zone .pill {
  display: inline-block; font-size: 10px; padding: 2px 7px; border-radius: 99px;
  background: var(--panel-2); border: 1px solid var(--line); color: var(--muted);
}
.download-zone .pill.stale { color: var(--red); border-color: var(--red); }
.download-zone .pill.fresh { color: var(--green); border-color: var(--green); }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .quadrants { grid-template-columns: 1fr; }
  .composite-strip { grid-template-columns: 1fr; gap: 14px; }
}

/* ============================================================================
   v2 — Calendar Strip, Watch Band, Environment Summary, Insights Page
   ============================================================================ */

/* ---- Calendar strip ---- */
.cal-strip {
  margin: 16px 24px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid #6b7280;
  border-radius: 6px;
  padding: 10px 14px;
}
.cal-strip-head { display: flex; justify-content: space-between; margin-bottom: 8px; }
.cal-strip-title { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--muted); text-transform: uppercase; }
.cal-strip-count { font-size: 11px; color: var(--muted-2); }
.cal-strip-cards { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.cal-card {
  flex: 0 0 130px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 8px;
  cursor: pointer;
  transition: border-color .15s;
}
.cal-card:hover { border-color: var(--accent); }
.cal-card .cal-date { font-size: 10px; color: var(--accent); font-weight: 600; text-transform: uppercase; letter-spacing: 0.4px; }
.cal-card .cal-label { font-size: 12px; font-weight: 500; margin: 2px 0; }
.cal-card .cal-cadence { font-size: 9px; color: var(--muted-2); }
.cal-card .cal-context { font-size: 10px; color: var(--muted); margin-top: 3px; line-height: 1.3; }

/* ---- Watch band ---- */
.watch-band {
  margin: 12px 24px 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--accent);
  border-radius: 6px;
  padding: 10px 14px;
}
.watch-band-head { display: flex; margin-bottom: 8px; }
.watch-band-title { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--accent); text-transform: uppercase; }
.watch-band-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 6px; }
.watch-card {
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 8px 10px;
  cursor: pointer;
  position: relative;
  transition: border-color .15s, transform .15s;
}
.watch-card:hover { transform: translateY(-1px); }
.watch-card.watch-risk { border-left: 2px solid var(--red); }
.watch-card.watch-opportunity { border-left: 2px solid var(--green); }
.watch-card.watch-watch { border-left: 2px solid var(--accent); }
.watch-card .watch-score { float: right; font-size: 11px; font-weight: 700; color: var(--text); background: var(--bg); border-radius: 3px; padding: 1px 5px; }
.watch-card .watch-icon { font-size: 13px; margin-right: 4px; }
.watch-card.watch-risk .watch-icon { color: var(--red); }
.watch-card.watch-opportunity .watch-icon { color: var(--green); }
.watch-card.watch-watch .watch-icon { color: var(--accent); }
.watch-card .watch-label { font-size: 12px; font-weight: 600; }
.watch-card .watch-z { font-size: 10px; color: var(--muted); margin-top: 2px; }
.watch-card .watch-headline { font-size: 11px; color: var(--muted); margin-top: 4px; line-height: 1.3; }

/* ---- Environment Summary ---- */
.env-summary {
  margin: 16px 24px 0;
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 18px 22px;
}
.env-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 12px; }
.env-title { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1.5px; font-weight: 600; }
.env-meta { display: flex; gap: 10px; }
.env-pill { font-size: 11px; padding: 3px 9px; border-radius: 12px; border: 1px solid var(--line); }
.env-pill.env-risk { color: var(--red); border-color: rgba(239, 79, 90, 0.4); }
.env-pill.env-oppty { color: var(--green); border-color: rgba(62, 207, 142, 0.4); }
.env-pill.env-watch { color: var(--accent); border-color: rgba(247, 167, 0, 0.4); }
.env-scp { display: flex; flex-direction: column; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.env-scp-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.env-scp-value { font-size: 36px; font-weight: 600; margin-top: 4px; color: var(--accent); }
.env-regime-loose .env-scp-value { color: var(--blue); }
.env-regime-normal .env-scp-value { color: var(--green); }
.env-regime-tight .env-scp-value { color: var(--accent); }
.env-regime-severe .env-scp-value { color: var(--red); }
.env-action {
  background: var(--bg);
  border-radius: 4px;
  padding: 10px 14px;
  margin-top: 8px;
  border-left: 2px solid var(--red);
}
.env-action-oppty { border-left-color: var(--green); }
.env-action-label { font-size: 10px; font-weight: 700; color: var(--red); text-transform: uppercase; letter-spacing: 1px; }
.env-action-oppty .env-action-label { color: var(--green); }
.env-action-headline { font-size: 14px; font-weight: 600; margin: 3px 0; }
.env-action-rightnow { font-size: 12px; color: var(--muted); line-height: 1.4; }
.env-action-drill { display: inline-block; margin-top: 6px; font-size: 11px; color: var(--accent); }
.env-action-drill:hover { text-decoration: underline; }

/* ---- Tooltip enhancements ---- */
.tooltip .rightnow { background: rgba(247, 167, 0, 0.06); border-left: 2px solid var(--accent); padding: 6px 10px; border-radius: 3px; font-size: 11.5px; }

/* ---- Insight dot on tile ---- */
.kpi-insight-dot { position: absolute; top: 6px; left: 6px; width: 6px; height: 6px; border-radius: 50%; }
.kpi-insight-risk { background: var(--red); }
.kpi-insight-opportunity { background: var(--green); }
.kpi-insight-watch { background: var(--accent); }

/* ---- Insights page ---- */
.insights-page { padding: 24px; max-width: 1200px; margin: 0 auto; }
.insights-page h2 { font-size: 16px; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 8px; }
.insight-card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px 14px;
}
.insight-card.insight-risk { border-left: 3px solid var(--red); }
.insight-card.insight-opportunity { border-left: 3px solid var(--green); }
.insight-card.insight-watch { border-left: 3px solid var(--accent); }
.ic-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ic-score { font-weight: 700; background: var(--panel-2); padding: 2px 8px; border-radius: 3px; font-size: 11px; }
.ic-icon { font-size: 14px; }
.insight-card.insight-risk .ic-icon { color: var(--red); }
.insight-card.insight-opportunity .ic-icon { color: var(--green); }
.insight-card.insight-watch .ic-icon { color: var(--accent); }
.ic-label { color: var(--text); font-size: 13px; }
.ic-label:hover { color: var(--accent); }
.ic-headline { font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.ic-rightnow { font-size: 11px; color: var(--muted); line-height: 1.4; }

.insights-table { width: 100%; border-collapse: collapse; font-size: 12px; margin-top: 14px; }
.insights-table th, .insights-table td { text-align: left; padding: 6px 10px; border-bottom: 1px solid var(--line); }
.insights-table th { color: var(--muted); font-weight: 500; text-transform: uppercase; font-size: 10px; letter-spacing: 0.6px; }
.insights-table .t-score { font-weight: 700; }
.insights-table .t-rightnow { color: var(--muted); font-size: 11px; max-width: 360px; }
.insight-row.insight-risk .t-score { color: var(--red); }
.insight-row.insight-opportunity .t-score { color: var(--green); }
.insight-row.insight-watch .t-score { color: var(--accent); }

/* ---- drill-page insight inset ---- */
.drill-insight {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 14px;
}
.drill-insight.insight-risk { border-left: 3px solid var(--red); }
.drill-insight.insight-opportunity { border-left: 3px solid var(--green); }
.drill-insight.insight-watch { border-left: 3px solid var(--accent); }

/* ---- Industrial-RE ticker grid ---- */
.ticker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 8px;
  margin: 0 24px 24px;
}
.section-head .label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }

@media (max-width: 900px) {
  .watch-band-cards { grid-template-columns: 1fr 1fr; }
}

/* ============================================================================
   v3 — Light mode, mobile, tinted panels, contrast, theme toggle
   ============================================================================ */

/* ---- contrast bumps ---- */
:root { --muted: #a0aab8; }    /* dark-mode muted color: bumped from #8a94a3 (3.2:1) to #a0aab8 (~4.6:1) for WCAG AA */
.kpi-tile .stale-badge { font-size: 10px; }    /* was 9px */

/* ---- tinted panels per category (subtle 3% opacity tint) ---- */
.kpi-tile[data-category="dc"]              { background: linear-gradient(135deg, rgba(59, 130, 246, 0.04), var(--panel-2) 60%); }
.kpi-tile[data-category="industrial-re"]   { background: linear-gradient(135deg, rgba(139, 92, 246, 0.04), var(--panel-2) 60%); }
.kpi-tile[data-category="middle-mile"]     { background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), var(--panel-2) 60%); }
.kpi-tile[data-category="last-mile"]       { background: linear-gradient(135deg, rgba(245, 158, 11, 0.04), var(--panel-2) 60%); }
.kpi-tile[data-category="international"]   { background: linear-gradient(135deg, rgba(239, 68, 68, 0.04), var(--panel-2) 60%); }

/* ---- theme toggle button in top bar ---- */
.theme-toggle {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
  padding: 4px 9px;
  border-radius: 4px;
  cursor: pointer;
  transition: border-color .12s, color .12s;
}
.theme-toggle:hover { border-color: var(--accent); color: var(--accent); }

/* ---- mobile responsive ---- */
@media (max-width: 600px) {
  .kpi-tile { padding: 14px; }
  .kpi-tile svg.spark { height: 36px; }
  .kpi-tile .kpi-value { font-size: 20px; }
  .composite-strip { padding: 16px; gap: 14px; }
  .composite-strip .value { font-size: 32px; }
  .quadrants { margin: 0 12px 12px; gap: 12px; }
  .dense-grid, .ticker-grid { margin: 0 12px 16px; }
  .cal-strip, .watch-band, .env-summary { margin-left: 12px; margin-right: 12px; }
.top { padding: 12px 14px; }
}

/* ============ LIGHT MODE ============ */
:root[data-theme="light"] {
  --bg: #f8f9fb;
  --panel: #ffffff;
  --panel-2: #f1f3f7;
  --panel-3: #e6e9ef;
  --line: #d8dde5;
  --text: #1a1f2a;
  --muted: #5a6675;     /* AA-compliant on white */
  --muted-2: #8a94a3;
  --accent: #b56700;    /* darker orange for AA contrast on white */
  --green: #1a8956;
  --red: #c2353f;
  --blue: #2563eb;
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.10);
}

:root[data-theme="light"] .top {
  background: rgba(255, 255, 255, 0.85);
}
:root[data-theme="light"] .top.scrolled {
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 1px 0 rgba(0,0,0,0.06), 0 4px 14px rgba(0,0,0,0.06);
}
:root[data-theme="light"] 
:root[data-theme="light"] .composite-strip {
  background: linear-gradient(135deg, var(--panel) 0%, var(--panel-2) 100%);
}
:root[data-theme="light"] .tooltip {
  background: #ffffff;
  border-color: var(--accent);
  box-shadow: 0 12px 32px rgba(0,0,0,0.18);
}
:root[data-theme="light"] .tooltip .rightnow {
  background: rgba(181, 103, 0, 0.06);
  border-left-color: var(--accent);
}
:root[data-theme="light"] .kpi-tile .stale-badge {
  background: rgba(194, 53, 63, 0.12);
}
:root[data-theme="light"] .env-pill.env-risk { border-color: rgba(194, 53, 63, 0.4); }
:root[data-theme="light"] .env-pill.env-oppty { border-color: rgba(26, 137, 86, 0.4); }
:root[data-theme="light"] .env-pill.env-watch { border-color: rgba(181, 103, 0, 0.4); }

/* tinted panels per category — lighter tints in light mode */
:root[data-theme="light"] .kpi-tile[data-category="dc"]              { background: linear-gradient(135deg, rgba(59, 130, 246, 0.06), var(--panel) 60%); }
:root[data-theme="light"] .kpi-tile[data-category="industrial-re"]   { background: linear-gradient(135deg, rgba(139, 92, 246, 0.06), var(--panel) 60%); }
:root[data-theme="light"] .kpi-tile[data-category="middle-mile"]     { background: linear-gradient(135deg, rgba(16, 185, 129, 0.06), var(--panel) 60%); }
:root[data-theme="light"] .kpi-tile[data-category="last-mile"]       { background: linear-gradient(135deg, rgba(245, 158, 11, 0.06), var(--panel) 60%); }
:root[data-theme="light"] .kpi-tile[data-category="international"]   { background: linear-gradient(135deg, rgba(239, 68, 68, 0.06), var(--panel) 60%); }


/* ========== Synced dashboard nav (mirrored from macro/styles.css) ========== */
/* ========================================================================= */
/* Deep-dive nav strip — sits below the sticky header on every macro page.   */
/* Solves the "users can't find related views unless they scroll" problem.   */
/* ========================================================================= */
.deep-dive-nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 24px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  position: sticky;
  top: 53px; /* sits just below the .top header (which is also sticky) */
  z-index: 95;
}
.dd-label {
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 600;
  margin-right: 14px;
  white-space: nowrap;
}
/* Section-grouping label inside .section-pages — used to mark distinct
   sub-sections of nav (e.g. Top-down vs Bottom-up). Visually heavier than
   .dd-label so the grouping reads as a real divider. */
.dd-section-label {
  color: var(--accent);
  letter-spacing: 1.0px;
  text-transform: uppercase;
  font-size: 10.5px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 4px;
  background: rgba(247, 167, 0, 0.08);
  border: 1px solid rgba(247, 167, 0, 0.22);
  margin: 0 6px 0 2px;
  white-space: nowrap;
}
.dd-link {
  color: var(--muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: 4px;
  border: 1px solid transparent;
  white-space: nowrap;
  transition: color .15s, background-color .15s, border-color .15s;
  font-size: 12px;
}
.dd-link:hover {
  color: var(--text);
  background: var(--panel-2);
}
.dd-link.active {
  color: var(--accent);
  background: rgba(247, 167, 0, 0.10);
  border-color: rgba(247, 167, 0, 0.30);
  font-weight: 600;
}
.dd-link-secondary {
  font-size: 11px;
  opacity: 0.80;
}
.dd-link-secondary:hover { opacity: 1; }

/* Hierarchy: master/sub grouping for Regime + its 6 deep-dive subcomponents,
   then visually separated standalone groups (Regional/Backtest/Pair Explorer,
   then Data/Indicator Library/Theme). */
.dd-group {
  display: flex;
  align-items: center;
  gap: 4px;
}
.dd-group-master {
  background: rgba(247, 167, 0, 0.05);
  border: 1px solid rgba(247, 167, 0, 0.18);
  border-radius: 6px;
  padding: 3px 6px;
}
.dd-master {
  font-weight: 700;
  letter-spacing: 0.4px;
  background: rgba(247, 167, 0, 0.14);
  border: 1px solid rgba(247, 167, 0, 0.40);
  color: var(--accent);
  font-size: 12.5px;
  padding: 6px 14px;
}
.dd-master:hover {
  background: rgba(247, 167, 0, 0.22);
  color: var(--accent);
}
.dd-master.active {
  background: var(--accent);
  color: #13171c;
  border-color: var(--accent);
}
.dd-tree {
  color: rgba(247, 167, 0, 0.55);
  font-size: 14px;
  font-weight: 700;
  margin: 0 2px;
  user-select: none;
}
.dd-sub {
  font-size: 11.5px;
  color: var(--muted);
}
.dd-sub.active {
  color: var(--accent);
  background: rgba(247, 167, 0, 0.12);
  border-color: rgba(247, 167, 0, 0.32);
  font-weight: 700;
}
.dd-divider {
  display: inline-block;
  width: 1px;
  height: 22px;
  background: var(--line);
  margin: 0 8px;
}
.dd-group-tail {
  margin-left: auto;
}

@media (max-width: 1100px) {
  .dd-group-master { padding: 2px 4px; }
  .dd-tree { display: none; }
}
@media (max-width: 800px) {
  .deep-dive-nav { padding: 8px 12px; gap: 2px; }
  .dd-label { display: none; }
  .dd-link { padding: 5px 8px; font-size: 11px; }
  .dd-master { padding: 5px 10px; font-size: 11.5px; }
  .dd-sub { font-size: 11px; }
  .dd-divider { margin: 0 4px; height: 16px; }
  .dd-group-tail { margin-left: 0; }
  .dd-link-secondary { display: none; }
}


/* ========================================================================= */
/* Two-tier deep-dive nav (Markets restructure 2026-04)                       */
/* Top tier = section tabs (FINANCIALS / MACRO / TOOLS / REFERENCE)           */
/* Bottom tier = pages within active section                                  */
/* ========================================================================= */
.deep-dive-nav.two-tier {
  flex-direction: column;
  align-items: stretch;
  padding: 0;
  gap: 0;
}
.deep-dive-nav.two-tier .section-tabs {
  display: flex;
  align-items: center;
  gap: 22px;
  padding: 8px 24px;
  background: var(--panel-2);
  border-bottom: 1px solid var(--line);
}
.deep-dive-nav.two-tier .section-tab {
  color: var(--muted);
  text-decoration: none;
  font-size: 11.5px;
  letter-spacing: 1.4px;
  font-weight: 600;
  text-transform: uppercase;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.deep-dive-nav.two-tier .section-tab:hover {
  color: var(--text);
}
.deep-dive-nav.two-tier .section-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.deep-dive-nav.two-tier .section-tabs .theme-toggle {
  margin-left: auto;
}
.deep-dive-nav.two-tier .section-pages {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 24px;
}
@media (max-width: 800px) {
  .deep-dive-nav.two-tier .section-tabs { gap: 12px; padding: 6px 12px; }
  .deep-dive-nav.two-tier .section-tab { font-size: 10.5px; letter-spacing: 1px; }
  .deep-dive-nav.two-tier .section-pages { padding: 8px 12px; }
}

