/* Siberforge — Economic Indicators dashboard styles.
   Builds on the shared dark palette used by the macro dashboard. */

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

  --cat-growth:    #3b82f6;
  --cat-inflation: #ef4444;
  --cat-consumer:  #10b981;
  --cat-housing:   #a855f7;

  /* ornamental tokens (styling pass) */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 6px 18px rgba(0, 0, 0, 0.42);
  --shadow-lg: 0 14px 36px rgba(0, 0, 0, 0.55);
  --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;
}

/* --------------------------------- header --------------------------------- */
.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), border-color .2s var(--ease-out);
}
.top.scrolled {
  background: rgba(19, 23, 28, 0.92);
  box-shadow: 0 1px 0 rgba(0,0,0,0.4), 0 4px 14px rgba(0,0,0,0.4);
}

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

.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); }

.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;
}

.status { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 12px; }

.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--muted);
  transition: background-color .2s;
}
.dot.live   { background: var(--green); box-shadow: 0 0 8px rgba(62, 207, 142, .7); }
.dot.stale  { background: var(--accent); }
.dot.error  { background: var(--red); }

/* --------------------------------- layout --------------------------------- */
main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 28px 24px 48px;
}

.page-title {
  margin: 0 0 6px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.3px;
}

.page-sub {
  margin: 0 0 28px;
  color: var(--muted);
  font-size: 13px;
  max-width: 780px;
  line-height: 1.5;
}

/* --------------------------- release strip --------------------------- */
.release-strip {
  margin: 0 0 28px;
  padding: 12px 14px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.rs-header {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-weight: 500;
  margin-bottom: 10px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}
.rs-asof {
  color: var(--muted);
  opacity: 0.6;
  font-weight: 400;
  letter-spacing: 0.5px;
  text-transform: none;
  font-size: 10px;
}

.rs-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rs-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
  font-feature-settings: 'tnum' 1;
}
.rs-chip:hover {
  border-color: var(--accent);
  background: var(--panel);
}

.rs-chip-label   { font-weight: 600; }
.rs-chip-sep     { color: var(--muted); opacity: 0.5; }
.rs-chip-date    { color: var(--muted); }
.rs-chip-countdown {
  color: var(--muted);
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 3px;
  background: rgba(138, 148, 163, 0.12);
  letter-spacing: 0.3px;
}

.rs-chip.rs-soon .rs-chip-countdown {
  color: var(--accent);
  background: rgba(247, 167, 0, 0.12);
}
.rs-chip.rs-today .rs-chip-countdown {
  color: var(--green);
  background: rgba(62, 207, 142, 0.15);
}
.rs-chip.rs-today { border-color: rgba(62, 207, 142, 0.35); }

.rs-empty, .rs-loading {
  color: var(--muted);
  font-size: 12px;
  padding: 4px 0;
}

/* card pulse when targeted by a release chip */
@keyframes card-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(247, 167, 0, 0); }
  30%      { box-shadow: 0 0 0 4px rgba(247, 167, 0, 0.35); }
}
.card.pulse { animation: card-pulse 1.5s ease; }

/* ------------------------------ category rows ----------------------------- */
.category {
  margin-bottom: 36px;
}

.category-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 0 2px 10px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 18px;
}

.category-header .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}

.category-header h2 {
  margin: 0;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--text);
}

.category-header .count {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 1px;
  margin-left: auto;
}

/* --------------------------------- grid ---------------------------------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 16px 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 156px;
  transition: border-color .15s, transform .15s;
  cursor: pointer;
  position: relative;
}
.card:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}

.card.placeholder {
  opacity: 0.45;
  cursor: default;
  border-style: dashed;
}
.card.placeholder:hover { border-color: var(--line); transform: none; }

.card.error {
  border-color: rgba(239, 79, 90, 0.35);
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}

.card-label {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  letter-spacing: 0.3px;
  line-height: 1.3;
  flex: 1;
}

.card-badge {
  font-size: 9px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--muted);
  padding: 2px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  flex-shrink: 0;
  font-weight: 500;
}

.card-value {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 2px;
}

.card-value .primary {
  font-size: 24px;
  font-weight: 600;
  font-feature-settings: 'tnum' 1;  /* tabular figures for alignment */
  color: var(--text);
  line-height: 1;
}

.card-value .unit {
  font-size: 14px;
  color: var(--muted);
  font-weight: 400;
}

.card-change {
  font-size: 11px;
  color: var(--muted);
  font-feature-settings: 'tnum' 1;
  letter-spacing: 0.2px;
}
.card-change .delta.up   { color: var(--green); }
.card-change .delta.down { color: var(--red); }
.card-change .delta.neutral { color: var(--muted); }
.card-change .as-of {
  margin-left: 6px;
  color: var(--muted);
  opacity: 0.75;
}

.card-spark {
  height: 36px;
  margin-top: 2px;
}

.card-context {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}
.card-context .strip { flex: 1; height: 10px; }
.card-context .pctl {
  font-size: 10px;
  color: var(--muted);
  font-feature-settings: 'tnum' 1;
  flex-shrink: 0;
  min-width: 52px;
  text-align: right;
}

.card-note {
  font-size: 10px;
  color: var(--muted);
  line-height: 1.35;
  margin-top: auto;
  opacity: 0.8;
}

.card.loading .card-value .primary::after {
  content: '—';
}
.card.loading { opacity: 0.55; }

/* ------------------------ compact utility markup ------------------------- */
footer {
  max-width: 1400px;
  margin: 0 auto;
  padding: 18px 24px 24px;
  color: var(--muted);
  font-size: 11px;
  border-top: 1px solid var(--line);
  line-height: 1.6;
}
footer a { color: var(--muted); }
footer a:hover { color: var(--accent); }

/* ---------------------- category accent left-border --------------------- */
.card[data-cat="growth"]    { border-left: 2px solid var(--cat-growth); }
.card[data-cat="inflation"] { border-left: 2px solid var(--cat-inflation); }
.card[data-cat="consumer"]  { border-left: 2px solid var(--cat-consumer); }
.card[data-cat="housing"]   { border-left: 2px solid var(--cat-housing); }

@media (max-width: 720px) {
  .grid { grid-template-columns: 1fr; }
  main { padding: 20px 16px 32px; }
  .page-title { font-size: 19px; }
}

/* ========================================================================= */
/* DRILL-DOWN PAGE (indicator.html)                                          */
/* ========================================================================= */

/* Card click affordance — only applied when card is wired as a link. */
.card.clickable {
  cursor: pointer;
  transition: transform .12s ease, border-color .15s ease, box-shadow .15s ease;
}
.card.clickable:hover {
  transform: translateY(-1px);
  border-color: rgba(247, 167, 0, 0.25);
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
}
.card.clickable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.drill-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

/* -------------------------- breadcrumb --------------------------- */
.breadcrumb {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.breadcrumb a {
  color: var(--muted);
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color .15s, border-color .15s;
}
.breadcrumb a:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.breadcrumb .sep { color: var(--line); }
.breadcrumb #crumb-indicator { color: var(--text); }

/* -------------------------- drill header --------------------------- */
.drill-header {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 32px;
  padding: 20px 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 20px;
}

.drill-header-left { min-width: 0; }

.drill-category {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 10px;
}
.drill-category .swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 2px;
}

.drill-title {
  margin: 0 0 8px 0;
  font-size: 24px;
  font-weight: 600;
  line-height: 1.2;
  color: var(--text);
}

.drill-context {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 640px;
  line-height: 1.5;
}

.drill-header-right {
  text-align: right;
  min-width: 160px;
}
.drill-value {
  font-size: 34px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--text);
}
.drill-value-unit {
  display: inline-block;
  font-size: 14px;
  color: var(--muted);
  margin-left: 4px;
}
.drill-delta {
  margin-top: 6px;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
}
.drill-delta.up     { color: var(--green); }
.drill-delta.down   { color: var(--red); }
.drill-delta.neutral{ color: var(--muted); }
.drill-as-of {
  margin-top: 4px;
  font-size: 11px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* -------------------------- chart section --------------------------- */
.chart-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 20px;
}

.chart-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  flex-wrap: wrap;
  gap: 8px;
}

.range-toggle {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.range-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background-color .15s, color .15s;
}
.range-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.range-btn.active {
  background: var(--accent);
  color: #0b0d10;
  font-weight: 600;
}
.range-btn + .range-btn { border-left: 1px solid var(--line); }

.chart-extras {
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 12px;
  color: var(--muted);
}

.chart-wrap {
  width: 100%;
  min-height: 360px;
  position: relative;
}
.chart-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: var(--muted);
  font-size: 13px;
}
.chart-error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 360px;
  color: var(--red);
  font-size: 13px;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding-top: 10px;
  font-size: 11px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  margin-top: 8px;
}
.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 2px;
  border-radius: 1px;
}
.legend-swatch.dashed {
  background-image: linear-gradient(90deg, currentColor 50%, transparent 50%);
  background-size: 4px 2px;
}

/* uPlot theme overrides — match panel palette. */
.chart-wrap .u-wrap { background: transparent; }
.chart-wrap .u-legend { display: none; }
.chart-wrap .u-cursor-pt { box-shadow: 0 0 0 2px rgba(247, 167, 0, 0.2); }
.chart-wrap .u-select {
  background: rgba(247, 167, 0, 0.08);
  border: 1px solid rgba(247, 167, 0, 0.25);
}

/* -------------------------- info panels --------------------------- */
.drill-info {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.info-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
}
.info-panel h2 {
  margin: 0 0 12px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}
.methodology-panel p {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
}

.metadata-grid {
  margin: 0;
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 6px 14px;
  font-size: 12px;
}
.metadata-grid dt {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  font-size: 11px;
  padding-top: 2px;
}
.metadata-grid dd {
  margin: 0;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.metadata-grid dd a {
  color: var(--blue);
  text-decoration: none;
}
.metadata-grid dd a:hover { text-decoration: underline; }

/* -------------------------- vintage table --------------------------- */
.vintage-section {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 16px 18px;
  margin-bottom: 20px;
}
.vintage-section h2 {
  margin: 0 0 6px 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}
.vintage-note {
  margin: 0 0 12px 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}
.vintage-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 4px;
}
.vintage-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.vintage-table th,
.vintage-table td {
  padding: 8px 12px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.vintage-table th:first-child,
.vintage-table td:first-child {
  text-align: left;
  color: var(--muted);
}
.vintage-table thead th {
  color: var(--muted);
  font-weight: 500;
  background: var(--panel-2);
  text-transform: uppercase;
  font-size: 10px;
  letter-spacing: 0.5px;
}
.vintage-table tbody tr:last-child td { border-bottom: none; }
.vintage-table tbody tr:hover { background: rgba(255,255,255,0.015); }

/* -------------------------- drill responsive --------------------------- */
@media (max-width: 820px) {
  .drill-header {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .drill-header-right {
    text-align: left;
    min-width: 0;
  }
  .drill-info {
    grid-template-columns: 1fr;
  }
  .drill-title { font-size: 20px; }
  .drill-value { font-size: 28px; }
}

@media (max-width: 520px) {
  .drill-main { padding: 16px 12px 32px; }
  .chart-wrap { min-height: 280px; }
  .chart-placeholder, .chart-error { height: 280px; }
}

/* ========================================================================= */
/* COMPARE PAGE (compare.html)                                                */
/* ========================================================================= */

.compare-main {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px 24px 48px;
}

.compare-header { margin-bottom: 18px; }
.compare-title {
  margin: 0 0 6px 0;
  font-size: 22px;
  font-weight: 600;
  color: var(--text);
}
.compare-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}
.compare-sub code {
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11.5px;
  border: 1px solid var(--line);
}

/* -------------------------- picker row --------------------------- */
.compare-picker {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 14px 18px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.picker-row {
  display: flex;
  align-items: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.picker {
  display: flex;
  flex-direction: column;
  flex: 1 1 280px;
  min-width: 220px;
}
.picker-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  margin-bottom: 4px;
  font-weight: 600;
}
.picker-label.picker-a { color: #5a9cff; }
.picker-label.picker-b { color: var(--accent); }

.picker select {
  appearance: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  padding: 8px 12px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  min-height: 36px;
}
.picker select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.picker-vs {
  color: var(--muted);
  font-size: 13px;
  padding: 0 4px 8px;
  font-style: italic;
}

.picker-swap {
  appearance: none;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--text);
  width: 36px;
  height: 36px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  transition: border-color .15s, color .15s;
}
.picker-swap:hover { border-color: var(--accent); color: var(--accent); }

.picker-controls {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

.mode-toggle {
  display: inline-flex;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.mode-btn {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 6px 14px;
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  letter-spacing: 0.5px;
  transition: background-color .15s, color .15s;
}
.mode-btn:hover { color: var(--text); background: rgba(255,255,255,0.03); }
.mode-btn.active {
  background: var(--accent);
  color: #0b0d10;
  font-weight: 600;
}
.mode-btn + .mode-btn { border-left: 1px solid var(--line); }

.share-link {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  border-bottom: 1px dotted transparent;
  transition: color .15s, border-color .15s;
}
.share-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* -------------------------- compare chart --------------------------- */
.compare-chart-section {
  margin-bottom: 14px;
}
.compare-chart-section .chart-wrap,
.corr-section .chart-wrap {
  min-height: auto;
}

.chart-legend .legend-note {
  color: var(--muted);
  font-style: italic;
  margin-left: auto;
  font-size: 11px;
}
.chart-legend {
  justify-content: flex-start;
}

/* -------------------------- correlation strip --------------------------- */
.corr-section {
  margin-bottom: 20px;
}
.corr-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
}
.corr-header h2 {
  margin: 0;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
  font-weight: 600;
}
.corr-meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.corr-wrap {
  width: 100%;
}
.corr-wrap .chart-placeholder,
.corr-wrap .chart-error {
  height: 180px;
}
.corr-note {
  margin: 8px 0 0 0;
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.5;
}

/* -------------------------- compare metadata grid --------------------------- */
.compare-meta {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 8px;
}
.compare-meta .info-panel h2 {
  color: var(--text);
  font-size: 13px;
  text-transform: none;
  letter-spacing: 0;
  margin-bottom: 10px;
}
.compare-meta .meta-a h2 { border-left: 3px solid #5a9cff; padding-left: 8px; }
.compare-meta .meta-b h2 { border-left: 3px solid var(--accent); padding-left: 8px; }
.meta-context {
  margin: 10px 0 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  font-style: italic;
}

@media (max-width: 820px) {
  .compare-meta { grid-template-columns: 1fr; }
  .picker-vs { display: none; }
  .picker-controls { justify-content: space-between; }
  .share-link { margin-left: 0; }
}

@media (max-width: 520px) {
  .compare-main { padding: 16px 12px 32px; }
}

/* ========================================================================= */
/* DASHBOARD: compare entry link                                              */
/* ========================================================================= */
.compare-link {
  display: inline-block;
  margin-left: auto;
  padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.compare-link:hover {
  color: var(--accent);
  border-color: var(--accent);
}

.recession-link {
  display: inline-block;
  padding: 4px 10px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  color: var(--muted);
  font-size: 12px;
  text-decoration: none;
  transition: color .15s, border-color .15s;
}
.recession-link:hover {
  color: var(--red);
  border-color: var(--red);
}

/* ========================================================================= */
/* RECESSION DASHBOARD (/core/econ/recession.html)                            */
/* ========================================================================= */

.recession-main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 20px 24px 48px;
}

body.recession .breadcrumb { margin-bottom: 12px; }

.recession-header {
  margin: 8px 0 24px;
}
.recession-title {
  margin: 0 0 8px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: 0.2px;
}
.recession-sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  max-width: 820px;
  line-height: 1.55;
}

/* ---- Big composite gauge ------------------------------------------------ */
.gauge-section {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  padding: 22px 28px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 6px;
  margin-bottom: 24px;
}

.gauge-score { display: flex; flex-direction: column; align-items: flex-start; min-width: 130px; }
.gauge-count {
  font-size: 64px;
  font-weight: 700;
  line-height: 1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  letter-spacing: -1px;
}
.gauge-denom {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.gauge-tier {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 18px;
  border-left: 4px solid var(--line);
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.015);
}
.gauge-tier .tier-label {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 1.5px;
  color: var(--muted);
}
.gauge-tier .tier-sub {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
  max-width: 540px;
}

.gauge-tier.tier-benign   { border-left-color: var(--green);  background: rgba(62, 207, 142, 0.06); }
.gauge-tier.tier-benign   .tier-label { color: var(--green); }
.gauge-tier.tier-low      { border-left-color: var(--blue);   background: rgba(90, 156, 255, 0.06); }
.gauge-tier.tier-low      .tier-label { color: var(--blue); }
.gauge-tier.tier-elevated { border-left-color: var(--accent); background: rgba(247, 167, 0, 0.08); }
.gauge-tier.tier-elevated .tier-label { color: var(--accent); }
.gauge-tier.tier-high     { border-left-color: var(--red);    background: rgba(239, 79, 90, 0.10); }
.gauge-tier.tier-high     .tier-label { color: var(--red); }

.gauge-dots {
  display: flex;
  gap: 10px;
  align-items: center;
}
.gauge-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 2px rgba(62, 207, 142, 0.15);
  cursor: help;
}
.gauge-dot.triggered {
  background: var(--red);
  box-shadow: 0 0 0 2px rgba(239, 79, 90, 0.20);
}

/* ---- Signal tiles ------------------------------------------------------- */
.signal-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 14px;
  margin-bottom: 28px;
}

.signal-tile {
  background: var(--panel);
  border: 1px solid var(--line);
  border-left: 3px solid var(--green);
  border-radius: 6px;
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
.signal-tile.triggered {
  border-left-color: var(--red);
  background: linear-gradient(180deg, rgba(239, 79, 90, 0.045), var(--panel) 60%);
}

.tile-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 6px;
  gap: 10px;
}
.tile-label {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.6px;
}
.tile-status {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 2px 6px;
  border-radius: 2px;
  background: rgba(62, 207, 142, 0.15);
  color: var(--green);
}
.tile-status.triggered {
  background: rgba(239, 79, 90, 0.18);
  color: var(--red);
}

.tile-value {
  font-size: 26px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  margin: 2px 0 4px;
  line-height: 1.1;
}
.tile-unit {
  margin-left: 4px;
  font-size: 13px;
  color: var(--muted);
  font-weight: 400;
}

.tile-meta {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--muted);
  margin-bottom: 8px;
}

.tile-spark {
  height: 52px;
  width: 100%;
  margin: 4px 0 8px;
}
.tile-spark .spark-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}

.tile-desc {
  margin-top: auto;
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  border-top: 1px solid var(--line);
  padding-top: 8px;
}

/* ---- Timeline ----------------------------------------------------------- */
.timeline-section { margin-bottom: 28px; }

.timeline-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 10px;
}
.timeline-header h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.timeline-meta {
  font-size: 11px;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.timeline-wrap { min-height: 240px; }

.timeline-note {
  margin: 10px 2px 0;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 880px;
}

/* ---- Methodology -------------------------------------------------------- */
.methodology-section { margin-top: 8px; }

.methodology-panel { padding: 18px 22px; }
.methodology-panel h2 {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.4px;
}
.methodology-panel > div > p {
  margin: 0 0 14px;
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.6;
  max-width: 880px;
}

.method-list {
  margin: 12px 0 14px;
  padding: 0;
}
.method-list dt {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-top: 12px;
}
.method-list dt:first-child { margin-top: 0; }
.method-list dt .method-cite {
  margin-left: 8px;
  font-weight: 400;
  font-size: 11px;
  color: var(--muted);
  font-style: italic;
}
.method-list dd {
  margin: 4px 0 0;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 880px;
}
.method-list dd code {
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 11px;
  color: var(--text);
}

.method-caveat {
  margin-top: 14px;
  padding: 10px 14px;
  background: var(--panel-2);
  border-left: 3px solid var(--accent);
  border-radius: 2px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.55;
  max-width: 880px;
}
.method-caveat strong { color: var(--text); }

/* ---- Responsive --------------------------------------------------------- */
@media (max-width: 880px) {
  .gauge-section {
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }
  .gauge-score { flex-direction: row; align-items: baseline; gap: 12px; min-width: 0; }
  .gauge-count { font-size: 52px; }
  .gauge-tier { border-left-width: 3px; padding: 12px 14px; }
  .gauge-dots { justify-content: flex-start; }
}

@media (max-width: 520px) {
  .recession-main { padding: 16px 12px 32px; }
  .signal-grid { grid-template-columns: 1fr; }
  .gauge-count { font-size: 44px; }
}

/* ========================================================================= */
/* STYLING PASS — shared utilities (eyebrow, live-pill, reveal, CTA)         */
/* ========================================================================= */

.eyebrow {
  display: inline-block;
  color: var(--accent);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 2.5px;
  text-transform: uppercase;
  margin: 0 0 10px;
  padding: 3px 10px;
  background: rgba(247, 167, 0, 0.12);
  border: 1px solid rgba(247, 167, 0, 0.22);
  border-radius: 999px;
}

/* Page title bump when .page-title appears with eyebrow on this theme */
.page-title {
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.15;
}

/* live-data pulse pill (drop into .brand) */
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 3px 9px 3px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--panel-2);
}
.pulse-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.6);
  animation: sfg-pulse 2.2s infinite;
}
@keyframes sfg-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0.55); }
  70%  { box-shadow: 0 0 0 7px rgba(62, 207, 142, 0); }
  100% { box-shadow: 0 0 0 0 rgba(62, 207, 142, 0); }
}

/* CTA buttons — amber primary to contrast on dark bg */
.cta-primary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  background: var(--accent);
  color: #0b0d10;
  border: 1px solid var(--accent);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
  transition: transform .15s var(--ease-out), box-shadow .15s var(--ease-out), filter .15s;
}
.cta-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(247, 167, 0, 0.25);
  filter: brightness(1.06);
}
.cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12.5px;
  font-weight: 500;
  text-decoration: none;
  transition: border-color .15s, color .15s;
}
.cta-secondary:hover { border-color: var(--accent); color: var(--accent); }

/* scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

/* reduced-motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .pulse-dot { animation: none; }
}

/* ========================================================================= */
/* Regime banner pill — links to /core/macro/ for full regime context        */
/* ========================================================================= */
.regime-banner-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 6px 0 16px 12px;
  padding: 5px 14px 5px 11px;
  background: rgba(247, 167, 0, 0.06);
  border: 1px solid rgba(247, 167, 0, 0.22);
  border-radius: 999px;
  font-size: 11.5px;
  text-decoration: none;
  color: var(--text);
  transition: background-color .15s, border-color .15s, transform .15s;
}
.regime-banner-pill:hover {
  background: rgba(247, 167, 0, 0.10);
  border-color: rgba(247, 167, 0, 0.45);
  transform: translateY(-1px);
}
.regime-banner-pill.loading { opacity: 0.6; }
.regime-banner-pill .rbp-dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.04);
}
.regime-banner-pill .rbp-label {
  color: var(--muted);
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 10px;
}
.regime-banner-pill .rbp-name {
  font-weight: 700;
  letter-spacing: 0.4px;
}
.regime-banner-pill .rbp-arrow {
  color: var(--muted);
  margin-left: 6px;
  font-size: 11px;
}


/* ========== 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; }
}

