.sim-layout {
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 18px;
}

.sim-controls,
.sim-results {
  padding: 20px;
}

.sim-controls h2 {
  font-size: 22px;
  margin-bottom: 6px;
  color: #1E3A8A;
}

.sim-controls > p { margin-bottom: 14px; }

/* ── Preset buttons ──────────────────────────────────────────────────── */

.preset-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 14px;
}

.preset-btn {
  border: 1.5px solid #cbd5e1;
  border-radius: 8px;
  background: #fff;
  color: #334155;
  font-size: 12px;
  font-weight: 500;
  padding: 8px;
  text-align: center;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease;
}

.preset-btn:hover {
  border-color: #1E3A8A;
  color: #1E3A8A;
  background: #dbeafe;
}

/* ── Slider controls ─────────────────────────────────────────────────── */

.control-group { margin-bottom: 16px; }

.control-head {
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.control-label { color: #334155; font-weight: 600; font-size: 14px; }

.control-value {
  color: #1E3A8A;
  font-size: 13px;
  font-weight: 700;
  background: #dbeafe;
  border-radius: 999px;
  padding: 2px 10px;
}

input[type='range'] {
  width: 100%;
  accent-color: #1E3A8A;
}

.toggle { display: inline-flex; align-items: center; gap: 8px; }
.toggle input { width: 42px; height: 22px; }

/* ── Policy box ──────────────────────────────────────────────────────── */

.policy-box {
  margin-top: 14px;
  border: 1.5px solid #dbeafe;
  border-radius: 10px;
  background: #f0f7ff;
  padding: 14px;
}

.policy-box h3 {
  font-size: 14px;
  margin-bottom: 10px;
  color: #1E3A8A;
  font-weight: 700;
}

.policy-list {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
}

/* ── Metric cards ────────────────────────────────────────────────────── */

.sim-metrics {
  margin-bottom: 16px;
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.sim-metrics .metric-value { font-size: 22px; }

/* ── Competition track ───────────────────────────────────────────────── */

.competition-track {
  margin-bottom: 16px;
  border: 1px solid var(--grey-200);
  border-radius: 999px;
  background: #e2e8f0;
  height: 14px;
  overflow: hidden;
}

.competition-fill {
  width: 0;
  height: 100%;
  transition: width 250ms ease, background-color 250ms ease;
  border-radius: 999px;
}

/* ── CAG Risk banners — strong color feedback ────────────────────────── */

.sim-banner {
  display: none;
  margin: 0 0 16px;
  border-radius: 10px;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  border: 1.5px solid transparent;
  line-height: 1.5;
}

.sim-banner.show { display: block; }

.sim-banner.red {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #7f1d1d;
}

.sim-banner.red::before {
  content: '⚠ CAG RISK: ';
  font-weight: 800;
}

.sim-banner.green {
  background: #f0fdf4;
  border-color: #86efac;
  color: #14532d;
}

.sim-banner.green::before {
  content: '✓ ';
  font-weight: 800;
}

.sim-banner.amber {
  background: #fffbeb;
  border-color: #fde68a;
  color: #78350f;
}

.sim-banner.amber::before {
  content: '◉ ';
  font-weight: 800;
}

/* ── Live explanation text ───────────────────────────────────────────── */

.live-explanation {
  margin-bottom: 14px;
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  border: 1px solid transparent;
  transition: background 250ms ease, border-color 250ms ease, color 250ms ease;
}

.live-explanation.healthy {
  background: #f0fdf4;
  border-color: #86efac;
  color: #166534;
}

.live-explanation.moderate {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.live-explanation.critical {
  background: #fef2f2;
  border-color: #fca5a5;
  color: #991b1b;
}

/* ── Filtered summary ────────────────────────────────────────────────── */

.filtered-summary {
  margin: 6px 0 14px;
  font-size: 13px;
  color: #475569;
  font-weight: 500;
}

/* ── Vendor table ────────────────────────────────────────────────────── */

.sim-table tbody tr {
  transition: background-color 200ms ease, opacity 200ms ease;
}

.sim-table tbody tr.ineligible {
  background: #f8fafc;
  opacity: 0.5;
}

.sim-table tbody tr.eligible { background: #f0fdf4; }

.sim-table tbody tr td.status-cell { font-weight: 700; }

.sim-table tbody tr td.reason-cell {
  color: #475569;
  font-size: 12px;
}

.status-strike { text-decoration: line-through; }

/* ── Insight cards ───────────────────────────────────────────────────── */

.insight-wrap { margin-top: 14px; display: grid; gap: 10px; }

.insight-card {
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  background: #fff;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.5;
}

.insight-card.warn {
  border-color: #fca5a5;
  background: #fef2f2;
  color: #7f1d1d;
}

.insight-card.good {
  border-color: #86efac;
  background: #f0fdf4;
  color: #14532d;
}

/* ── Chart ───────────────────────────────────────────────────────────── */

.chart-wrap {
  margin-top: 14px;
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  background: #fff;
  padding: 14px;
}

.chart-wrap h3 { margin-bottom: 10px; font-size: 15px; color: #1E3A8A; }

.competition-chart-svg { width: 100%; height: 200px; display: block; }

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin: 10px 0 0;
  font-size: 12px;
  color: #475569;
}

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

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.chart-legend .eligible   { background: #16a34a; }
.chart-legend .ineligible { background: #dc2626; }
.chart-legend .threshold  { background: #1E3A8A; }

.chart-note { margin-top: 8px; font-size: 12px; color: #64748b; }

/* ── Bottom row ──────────────────────────────────────────────────────── */

.sim-bottom-row {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: start;
}

.sim-history {
  border: 1px solid var(--grey-200);
  border-radius: 10px;
  background: #fff;
  padding: 12px;
}

.sim-history h3 { margin-bottom: 8px; font-size: 14px; color: #1E3A8A; }

.sim-history ol {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}

.history-empty { color: #94a3b8; font-size: 13px; }

/* ── Responsive ──────────────────────────────────────────────────────── */

@media (max-width: 1200px) {
  .sim-layout { grid-template-columns: 1fr; }
  .sim-metrics { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 600px) {
  .sim-metrics { grid-template-columns: 1fr 1fr; }
  .preset-row  { grid-template-columns: 1fr; }
}
