/* ================================================================
   styles.css — Market Emergence: Agent-Based Simulator
   ================================================================ */

:root {
  --sim-canvas-bg: #1e293b;
  --sim-grid-line: rgba(255, 255, 255, 0.05);
  --sim-border: #cbd5e1;
  --sim-panel-bg: #f8fafc;
  --sim-accent-pulse: #3b82f6;
  --sim-shock-bg: #fee2e2;
  --sim-shock-border: #ef4444;
  --sim-shock-text: #b91c1c;
}

/* ── Layout & Viewport ─────────────────────────────────────────── */
.sim-grid-container {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  margin-top: 1.25rem;
}

/* ── Scenario & Setup Bar ──────────────────────────────────────── */
.scenario-selector-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #ffffff;
  padding: 1.1rem 1.4rem;
  border-radius: 10px;
  border: 1px solid var(--app-border, #d6dfea);
  margin-bottom: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.scenario-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.scenario-group label {
  font-weight: 600;
  color: var(--app-text, #1f2a37);
  font-size: 0.95rem;
}

.scenario-select {
  padding: 0.5rem 1rem;
  font-size: 0.92rem;
  border-radius: 6px;
  border: 1px solid #cbd5e1;
  background-color: #f8fafc;
  color: #0f172a;
  font-weight: 500;
  cursor: pointer;
  min-width: 320px;
}

.scale-toggle {
  display: inline-flex;
  background: #e2e8f0;
  border-radius: 6px;
  padding: 2px;
}

.scale-btn {
  padding: 0.4rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 600;
  border: none;
  background: transparent;
  color: #475569;
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.15s ease;
}

.scale-btn.active {
  background: #ffffff;
  color: #1d5fbf; /* darker than --app-accent: small text needs 4.5:1 */
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

/* ── Former inline styles (data source chooser, scale bar, speed) ── */
.scenario-controls__input {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  align-items: center;
  margin-bottom: 0.75rem;
}
.scenario-select--case { flex: 1; min-width: 280px; }
.btn-inline { padding: 0.5rem 0.9rem; font-size: 0.88rem; cursor: pointer; }
.btn-inline--small { padding: 0.42rem 0.88rem; font-size: 0.85rem; }
.btn-browse { margin-top: 0.4rem; }
.dropzone--clickable { cursor: pointer; }
.upload-meta { margin-top: 0.6rem; }
.upload-status { font-size: 0.85rem; color: #475569; }
.scale-seed-bar { margin-top: 1.25rem; }
.speed-select { min-width: 90px; padding: 0.35rem 0.6rem; }

@media (max-width: 560px) {
  .scenario-select,
  .scenario-select--case { min-width: 0; width: 100%; }
}

/* ── Playback Controls Bar ─────────────────────────────────────── */
.playback-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: #f1f5f9;
  padding: 0.9rem 1.25rem;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  margin-bottom: 1.25rem;
}

.playback-buttons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.btn-ctrl {
  padding: 0.5rem 1.1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 6px;
  border: 1px solid transparent;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.btn-play {
  background: #2563eb;
  color: #ffffff;
}
.btn-play:hover { background: #1d4ed8; }
.btn-play.playing {
  background: #d97706;
}
.btn-play.playing:hover { background: #b45309; }

.btn-step {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #334155;
}
.btn-step:hover { background: #f8fafc; border-color: #94a3b8; }

.btn-reset {
  background: #ffffff;
  border-color: #cbd5e1;
  color: #64748b;
}
.btn-reset:hover { background: #fee2e2; border-color: #fca5a5; color: #b91c1c; }

.speed-control {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: #475569;
  font-weight: 600;
}

.playback-status {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cycle-badge {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  background: #ffffff;
  border: 1px solid #cbd5e1;
  border-radius: 20px;
  font-size: 0.86rem;
  font-weight: 700;
  color: #0f172a;
}

.status-indicator {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 0.3rem 0.65rem;
  border-radius: 12px;
  background: #e2e8f0;
  color: #475569;
}

.status-indicator.running {
  background: #dbeafe;
  color: #1e40af;
}

.status-indicator.equilibrium {
  background: #dcfce7;
  color: #15803d;
}

/* ── Event Shock Button ───────────────────────────────────────── */
.btn-shock {
  background: var(--sim-shock-bg);
  border: 1px solid var(--sim-shock-border);
  color: var(--sim-shock-text);
  font-weight: 700;
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  transition: all 0.15s ease;
}

.btn-shock:hover {
  background: #fecaca;
  box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
}

.btn-shock.injected {
  background: #fee2e2;
  border-color: #dc2626;
  color: #7f1d1d;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}

.btn-shock.injected::after {
  content: 'ACTIVE';
  display: inline-block;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  padding: 0.1rem 0.35rem;
  background: #dc2626;
  color: #ffffff;
  border-radius: 4px;
  margin-left: 0.35rem;
}

/* ── Parameter Controls Grid ──────────────────────────────────── */
.parameters-card {
  background: #ffffff;
  padding: 1.25rem 1.5rem;
  border-radius: 10px;
  border: 1px solid var(--app-border, #d6dfea);
  margin-bottom: 1.25rem;
}

.parameters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 1.25rem;
  margin-top: 1rem;
}

.param-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.param-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  font-weight: 600;
  color: #334155;
}

.param-val {
  font-weight: 700;
  color: #1d5fbf; /* 5.4:1 on #eff6ff */
  background: #eff6ff;
  padding: 0.15rem 0.45rem;
  border-radius: 4px;
  font-size: 0.82rem;
}

.param-slider {
  width: 100%;
  accent-color: var(--app-accent, #2a7de1);
  cursor: pointer;
}

.param-desc {
  font-size: 0.78rem;
  color: #64748b;
  margin: 0;
  line-height: 1.35;
}

/* ── Advanced Dynamics Panel ─────────────────────────────────── */
.advanced-dynamics-panel {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px dashed var(--app-border, #d6dfea);
}

.advanced-dynamics-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: #1e293b;
  margin-bottom: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.advanced-dynamics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.25rem;
}

.dyn-item {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  font-size: 0.85rem;
  color: #334155;
}

.dyn-item label {
  font-weight: 600;
}

.dyn-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.dyn-select {
  padding: 0.45rem 0.65rem;
  border-radius: 6px;
  border: 1px solid var(--app-border, #cbd5e1);
  background: #f8fafc;
  color: #1e293b;
  font-size: 0.82rem;
  font-weight: 500;
  outline: none;
  transition: border-color 0.15s ease;
}

.dyn-select:focus {
  border-color: var(--app-accent, #2a7de1);
  background: #ffffff;
}

.dyn-desc {
  font-size: 0.74rem;
  color: #64748b;
  margin: 0;
  line-height: 1.3;
}

.chk-label {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  cursor: pointer;
  font-weight: 600;
}

.chk-label input[type="checkbox"] {
  accent-color: var(--app-accent, #2a7de1);
  width: 1rem;
  height: 1rem;
  cursor: pointer;
}

/* ── Canvas Frame & Stage ─────────────────────────────────────── */
.canvas-wrapper {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--app-border, #d6dfea);
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.canvas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.canvas-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.canvas-tools {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.canvas-stage {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 680px;
  margin: 0 auto;
  background: #0f172a;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
  transition: box-shadow 0.3s ease, border-color 0.3s ease;
}

@keyframes shockPulseAnim {
  0% {
    box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.85), inset 0 0 24px rgba(239, 68, 68, 0.65);
    border-color: #ef4444;
  }
  50% {
    box-shadow: 0 0 35px 12px rgba(239, 68, 68, 0.5), inset 0 0 45px rgba(239, 68, 68, 0.85);
    border-color: #ef4444;
  }
  100% {
    box-shadow: inset 0 2px 6px rgba(0,0,0,0.4);
    border-color: transparent;
  }
}

.canvas-stage.shock-active {
  animation: shockPulseAnim 1.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 2px solid #ef4444;
}

#sim-canvas {
  width: 100%;
  height: 100%;
  display: block;
  image-rendering: pixelated;
  image-rendering: crisp-edges;
  cursor: crosshair;
}

.canvas-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: center;
  align-items: center;
  margin-top: 0.65rem;
  padding: 0.75rem 1rem;
  background: #f8fafc;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
  font-size: 0.84rem;
  font-weight: 600;
  color: #334155;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.legend-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: #ffffff;
  padding: 0.35rem 0.7rem;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: transform 0.1s ease;
}

.legend-chip:hover {
  transform: translateY(-1px);
}

.legend-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
}

.legend-icon svg {
  display: block;
}

/* ── Inspector Spotlight Popover ──────────────────────────────── */
.agent-inspector-card {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 240px;
  background: rgba(15, 23, 42, 0.94);
  color: #ffffff;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  padding: 0.9rem;
  font-size: 0.8rem;
  z-index: 10;
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
  display: none;
}

.agent-inspector-card.active {
  display: block;
  animation: fadeIn 0.15s ease-out;
}

.inspector-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(255,255,255,0.15);
  padding-bottom: 0.4rem;
  margin-bottom: 0.5rem;
}

.inspector-close {
  background: transparent;
  border: none;
  color: #94a3b8;
  font-size: 1rem;
  cursor: pointer;
  padding: 0 0.2rem;
}
.inspector-close:hover { color: #ffffff; }

.inspector-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.35rem;
}

.inspector-label { color: #94a3b8; }
.inspector-value { font-weight: 600; }

.agent-inspector-card .stat-explain {
  color: #93c5fd;
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.05);
  font-size: 0.72rem;
  padding: 0 0.35rem;
  min-height: 1.3em;
  margin-left: 0.25rem;
}

.agent-inspector-card .stat-explain:hover,
.agent-inspector-card .stat-explain:focus-visible,
.agent-inspector-card .stat-explain[aria-expanded='true'] {
  color: #ffffff;
  background: rgba(59, 130, 246, 0.3);
  border-color: #60a5fa;
}

/* ── Analytics & Time Series Cards ────────────────────────────── */
.analytics-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}

@media (max-width: 860px) {
  .analytics-wrapper {
    grid-template-columns: 1fr;
  }
}

.chart-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--app-border, #d6dfea);
  padding: 1.1rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.02);
}

.chart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.chart-title {
  font-size: 0.96rem;
  font-weight: 700;
  color: #1e293b;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.chart-plot-area {
  width: 100%;
  height: 230px;
}

/* ── StatCards Grid ───────────────────────────────────────────── */
.stats-summary-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)); /* 6 cards → balanced 3 × 2 */
  gap: 1rem;
  margin-top: 1.25rem;
}

@media (max-width: 900px) {
  .stats-summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .stats-summary-grid { grid-template-columns: 1fr; }
}

.stat-card {
  background: #ffffff;
  border: 1px solid var(--app-border, #d6dfea);
  border-radius: 8px;
  padding: 1rem 1.15rem;
  position: relative;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
}

.stat-card-title {
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.4rem;
}

.stat-card-value {
  font-size: 1.55rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.stat-card-sub {
  font-size: 0.78rem;
  color: #64748b;
  margin-top: 0.35rem;
}

/* ── Reporting: APA & Managerial Dual Panels ──────────────────── */
.reporting-section {
  margin-top: 1.25rem;
}

.reporting-section .dual-panels {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
}

.reporting-section .dual-panel {
  flex: 1 1 340px;
  min-width: 320px;
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--app-border, #d6dfea);
  padding: 1.35rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
  display: flex;
  flex-direction: column;
}

.narrative-card {
  background: #ffffff;
  border-radius: 10px;
  border: 1px solid var(--app-border, #d6dfea);
  padding: 1.4rem;
  margin-top: 1.25rem;
}

.narrative-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.75rem;
}

.narrative-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin: 0;
}

.narrative-body {
  font-size: 0.92rem;
  color: #334155;
  line-height: 1.65;
  flex: 1;
}

.narrative-body p {
  margin-top: 0;
  margin-bottom: 0.75rem;
}

.narrative-body p:last-child {
  margin-bottom: 0;
}

.apa-stat {
  font-style: italic;
}

.callout-box {
  background: #f8fafc;
  border-left: 4px solid var(--app-accent, #2a7de1);
  padding: 0.9rem 1.1rem;
  border-radius: 0 6px 6px 0;
  margin-top: 0.9rem;
  font-size: 0.88rem;
  color: #1e293b;
}

.managerial-shock-callout {
  background: #fef2f2;
  border-left: 4px solid #ef4444;
  border-radius: 0 8px 8px 0;
  padding: 0.95rem 1.15rem;
  margin-top: 1rem;
  font-size: 0.88rem;
  color: #7f1d1d;
  box-shadow: 0 1px 3px rgba(239, 68, 68, 0.08);
}

.managerial-shock-callout h5 {
  margin: 0 0 0.35rem 0;
  color: #991b1b;
  font-size: 0.92rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.managerial-shock-callout p {
  margin: 0;
  line-height: 1.5;
  color: #450a0a;
}

/* ── Export & Actions Bar ─────────────────────────────────────── */
.actions-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  background: #ffffff;
  border: 1px solid var(--app-border, #d6dfea);
  border-radius: 8px;
  padding: 1rem 1.4rem;
  margin-top: 1.25rem;
}

.action-btns-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.btn-secondary {
  background: #ffffff;
  border: 1px solid #cbd5e1;
  color: #334155;
  padding: 0.45rem 0.85rem;
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.15s ease;
}
.btn-secondary:hover {
  background: #f8fafc;
  border-color: #94a3b8;
}

/* ── Custom Upload Modal ──────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.modal-overlay.active {
  display: flex;
}

.modal-box {
  background: #ffffff;
  width: 90%;
  max-width: 580px;
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  border: 1px solid #cbd5e1;
}

.dropzone-area {
  border: 2px dashed #94a3b8;
  border-radius: 8px;
  padding: 2rem 1.5rem;
  text-align: center;
  cursor: pointer;
  background: #f8fafc;
  transition: all 0.15s ease;
  margin: 1rem 0;
}

.dropzone-area:hover, .dropzone-area.dragover {
  border-color: var(--app-accent, #2a7de1);
  background: #eff6ff;
}

/* ── Screen Reader Structured Table Fallback ─────────────────── */
.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;
}

/* ── Parameters card head & stale-settings banner ─────────────── */
.parameters-card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.parameters-card__title { margin: 0; font-size: 1.02rem; font-weight: 700; color: #0f172a; }
.parameters-card__note { margin: 0; font-size: 0.8rem; color: #64748b; }

.params-stale-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: 0.9rem;
  padding: 0.7rem 1rem;
  background: #fffbeb;
  border: 1px solid #fcd34d;
  border-left: 4px solid #d97706;
  border-radius: 6px;
  color: #78350f;
  font-size: 0.86rem;
}
.params-stale-banner[hidden] { display: none; }
.params-stale-actions { display: flex; gap: 0.5rem; }

/* ── Shock group ──────────────────────────────────────────────── */
.shock-group { display: flex; flex-direction: column; align-items: flex-start; gap: 0.25rem; }
.shock-hint { font-size: 0.76rem; color: #475569; max-width: 280px; line-height: 1.35; }
.btn-shock:disabled,
.btn-play:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
}
.btn-shock:disabled:hover { background: var(--sim-shock-bg); }
.btn-play:disabled:hover { background: #2563eb; }

/* ── Canvas extras ────────────────────────────────────────────── */
.glyph-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: #475569;
  cursor: pointer;
}
.canvas-note { margin: 0; font-size: 0.78rem; color: #64748b; text-align: center; }
.legend-name { white-space: nowrap; }

/* ── Inspector decision colors ────────────────────────────────── */
.decision-good { color: #4ade80; }
.decision-bad { color: #f87171; }
.decision-neutral { color: #94a3b8; }

/* ── Report states ────────────────────────────────────────────── */
.report-status { margin: 0 0 0.6rem; font-size: 0.84rem; color: #64748b; min-height: 1.2em; }
.report-pending .narrative-body { opacity: 0.45; transition: opacity 0.2s ease; }
.narrative-icon { font-size: 1.25rem; line-height: 1; }

/* ── Replications card ────────────────────────────────────────── */
.replications-card {
  background: #ffffff;
  border: 1px solid var(--app-border, #d6dfea);
  border-radius: 10px;
  padding: 1.35rem;
  margin-top: 1.25rem;
}
.replications-head { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem; }
.replications-head .narrative-title { display: flex; align-items: center; gap: 0.45rem; }
.replications-lede { font-size: 0.88rem; color: #475569; line-height: 1.55; margin: 0.5rem 0 0.9rem; }
.replications-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.9rem;
  margin-bottom: 1rem;
}
.replications-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: #334155;
}
.replications-controls select,
.replications-controls input {
  padding: 0.4rem 0.55rem;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 0.88rem;
  width: 7rem;
  background: #f8fafc;
}
.rep-status { font-size: 0.84rem; color: #475569; }
.rep-empty, .rep-stale { font-size: 0.86rem; color: #64748b; margin: 0; }
.rep-stale { color: #92400e; background: #fffbeb; padding: 0.5rem 0.75rem; border-radius: 6px; margin-bottom: 0.6rem; }
.rep-table { width: 100%; border-collapse: collapse; font-size: 0.86rem; margin-bottom: 0.75rem; }
.rep-table caption { text-align: left; font-weight: 700; color: #0f172a; padding-bottom: 0.4rem; }
.rep-table th, .rep-table td { padding: 0.45rem 0.6rem; border-bottom: 1px solid #e2e8f0; text-align: right; }
.rep-table th:first-child, .rep-table td:first-child { text-align: left; }
.rep-table thead th { background: #f8fafc; color: #475569; font-weight: 600; }
.rep-diff td { font-weight: 700; color: #0f172a; background: #eff6ff; }
.rep-test { font-size: 0.88rem; color: #334155; line-height: 1.55; margin: 0 0 0.75rem; }

/* ── Scenario disclaimer & import receipt ─────────────────────── */
.scenario-disclaimer {
  font-size: 0.8rem;
  color: #64748b;
  font-style: italic;
  margin: 0.5rem 0 0.75rem;
}
.import-receipt {
  margin-top: 0.75rem;
  padding: 0.6rem 0.85rem;
  border-radius: 6px;
  background: #f0fdf4;
  border: 1px solid #86efac;
  color: #14532d;
  font-size: 0.85rem;
}
.import-receipt--error { background: #fef2f2; border-color: #fca5a5; color: #7f1d1d; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Research Foundation Box ──────────────────────────────────── */
.research-foundation-box {
  background: #f0f7ff;
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--app-accent, #2a7de1);
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  margin: 1rem 0;
}

.research-foundation-box h5 {
  font-size: 0.95rem;
  font-weight: 700;
  color: #1e3a8a;
  margin: 0 0 0.5rem 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.research-foundation-box p {
  font-size: 0.84rem;
  line-height: 1.55;
  color: #1e293b;
  margin: 0 0 0.55rem 0;
}

.research-foundation-box p:last-child {
  margin-bottom: 0;
}
