:root {
  --bg: #0f172a;
  --card: #1e293b;
  --text: #f1f5f9;
  --muted: #94a3b8;
  --goldilocks: #22c55e;
  --reflation: #3b82f6;
  --stagflation: #f97316;
  --deflation: #8b5cf6;
  --positive: #22c55e;
  --negative: #ef4444;
  --border: #334155;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

.hidden { display: none !important; }

.error-banner {
  background: #7f1d1d;
  color: #fecaca;
  padding: 0.75rem 1rem;
  text-align: center;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.5rem;
  border-bottom: 1px solid var(--border);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.logo {
  font-family: ui-monospace, monospace;
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.header-meta {
  display: flex;
  gap: 1.5rem;
  color: var(--muted);
  font-size: 0.85rem;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.5rem;
  display: grid;
  gap: 1.25rem;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.25rem;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.card:hover { border-color: #475569; }

.hero {
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 1.5rem;
  align-items: start;
}

.hero-label {
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.75rem;
  margin: 0 0 0.5rem;
}

#regime-name {
  margin: 0;
  font-size: clamp(2.5rem, 6vw, 4rem);
  line-height: 1;
  letter-spacing: 0.04em;
}

.hero-confidence {
  font-size: 1.25rem;
  margin: 0.75rem 0;
  color: var(--text);
}

.hero-description {
  color: var(--muted);
  max-width: 48rem;
}

.forecast-box {
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1rem;
}

.forecast-box h2 {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.forecast-line {
  padding: 0.5rem 0;
  font-weight: 600;
}

.grid-two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.probability-list { display: grid; gap: 0.85rem; }

.prob-row {
  display: grid;
  grid-template-columns: 120px 1fr 56px;
  gap: 0.75rem;
  align-items: center;
}

.prob-row.active {
  padding: 0.5rem;
  border-radius: 8px;
  box-shadow: 0 0 0 1px currentColor, 0 0 18px rgba(255,255,255,0.06);
}

.prob-bar-wrap {
  background: #0f172a;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.prob-bar { height: 100%; border-radius: 999px; }

.score-block { margin-bottom: 1.25rem; }

.score-header {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
  font-weight: 500;
}

.score-bar {
  position: relative;
  height: 12px;
  background: linear-gradient(to right, #334155 0%, #334155 49.5%, #475569 50%, #14532d 50%, #14532d 100%);
  border-radius: 999px;
}

.score-block.inflation .score-bar {
  background: linear-gradient(to right, #334155 0%, #334155 49.5%, #475569 50%, #7c2d12 50%, #7c2d12 100%);
}

.score-marker {
  position: absolute;
  top: -4px;
  width: 4px;
  height: 20px;
  background: white;
  border-radius: 2px;
  transform: translateX(-50%);
}

.score-trend { color: var(--muted); font-size: 0.85rem; margin-top: 0.35rem; }

.panel-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.panel-header h2 { margin: 0; font-size: 1.1rem; }

.btn-secondary, .tab, .range-btn {
  background: #0f172a;
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.btn-secondary:hover, .tab:hover, .range-btn:hover { border-color: #64748b; }

.tabs { display: flex; gap: 0.5rem; margin-bottom: 1rem; }

.tab.active, .range-btn.active {
  background: #334155;
  border-color: #64748b;
}

.tab-panel { display: none; }
.tab-panel.active { display: block; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

th, td {
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.positive { color: var(--positive); }
.negative { color: var(--negative); }

.weight-bar {
  display: inline-block;
  height: 6px;
  background: #3b82f6;
  border-radius: 999px;
  min-width: 4px;
  vertical-align: middle;
  margin-right: 0.35rem;
}

.composite-line { font-weight: 600; margin-top: 0.75rem; }

.footnote {
  color: var(--muted);
  font-size: 0.82rem;
  margin-top: 0.75rem;
}

.range-buttons { display: flex; gap: 0.35rem; flex-wrap: wrap; }

.btn-primary {
  background: #2563eb;
  color: #fff;
  border: 1px solid #3b82f6;
  border-radius: 8px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  font: inherit;
  font-weight: 600;
}

.btn-primary:hover { background: #1d4ed8; }
.btn-primary:disabled { opacity: 0.6; cursor: not-allowed; }

.ai-panel { margin-bottom: 2rem; }

.ai-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1rem;
}

.ai-loading { color: var(--muted); font-size: 0.9rem; }

.ai-ask {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.ai-ask input {
  flex: 1;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.65rem 0.85rem;
  font: inherit;
}

.ai-result {
  margin-top: 1rem;
  padding: 1rem;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  line-height: 1.6;
}

.ai-result h1, .ai-result h2, .ai-result h3 {
  margin-top: 0.5rem;
  margin-bottom: 0.5rem;
}

.ai-result ul { padding-left: 1.25rem; }

.ai-meta {
  color: var(--muted);
  font-size: 0.85rem;
  margin-bottom: 0.75rem;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 1rem;
}

.modal-content {
  width: min(480px, 100%);
}

.modal-content label {
  display: block;
  margin: 0.75rem 0 0.35rem;
  color: var(--muted);
  font-size: 0.9rem;
}

.modal-content select {
  width: 100%;
  background: #0f172a;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 0.65rem;
  font: inherit;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 1rem;
}

.admin-status { color: var(--positive); font-size: 0.9rem; }

@media (max-width: 900px) {
  .hero, .grid-two { grid-template-columns: 1fr; }
  .header-meta { flex-direction: column; gap: 0.25rem; align-items: flex-end; }
}
