/* ─── Reset & base ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --nav-width: 220px;
  --nav-bg: #0f172a;
  --nav-border: #1e293b;
  --nav-text: #94a3b8;
  --nav-text-active: #f8fafc;
  --nav-active-bg: #1e293b;
  --nav-hover-bg: #162032;
  --nav-accent: #22c55e;

  --panel-width: 380px;
  --panel-bg: #0f172a;
  --panel-border: #1e293b;
  --card-bg: #1e293b;

  --text-primary: #f1f5f9;
  --text-secondary: #94a3b8;
  --text-muted: #475569;

  --radius: 8px;
  --transition: 200ms ease;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 14px;
  background: #0f172a;
  color: var(--text-primary);
  overflow: hidden;
}

/* ─── Layout shell ──────────────────────────────────────────────────────── */
body { display: flex; height: 100vh; }

.main-content {
  flex: 1;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* ─── Left navigation sidebar ───────────────────────────────────────────── */
.nav-sidebar {
  width: var(--nav-width);
  flex-shrink: 0;
  background: var(--nav-bg);
  border-right: 1px solid var(--nav-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 100;
}

/* Brand / logo */
.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 16px 18px;
  border-bottom: 1px solid var(--nav-border);
  flex-shrink: 0;
}

.nav-logo { width: 32px; height: 32px; flex-shrink: 0; }

.nav-brand-text {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

/* Scrollable area below brand */
.nav-scroll {
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
}

/* Menu list */
.nav-menu {
  list-style: none;
  padding: 12px 8px;
}

.nav-menu li { margin-bottom: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 6px;
  color: var(--nav-text);
  text-decoration: none;
  font-size: 13.5px;
  font-weight: 500;
  transition: background var(--transition), color var(--transition);
  position: relative;
  white-space: nowrap;
}

.nav-item:hover:not(.disabled) { background: var(--nav-hover-bg); color: var(--nav-text-active); }

.nav-item.active { background: var(--nav-active-bg); color: var(--nav-text-active); }

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0; top: 6px; bottom: 6px;
  width: 3px;
  background: var(--nav-accent);
  border-radius: 0 3px 3px 0;
}

.nav-item.disabled { opacity: 0.4; cursor: not-allowed; }

.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }
.nav-label { flex: 1; }

.nav-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 20px;
  background: #1e293b;
  color: #64748b;
  letter-spacing: 0.02em;
}

/* Footer */
.nav-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--nav-border);
  flex-shrink: 0;
}

.nav-attribution {
  font-size: 11px;
  color: var(--text-muted);
  text-decoration: none;
  display: block;
}
.nav-attribution:hover {
  color: var(--text-secondary);
}

/* ─── Inline feature-select radio labels inside attr-grid ──────────────── */
.feat-label {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
  color: inherit;
  font-size: inherit;
  user-select: none;
}

.feat-label input[type="radio"] {
  accent-color: var(--nav-accent);
  flex-shrink: 0;
  cursor: pointer;
  width: 12px;
  height: 12px;
}

.feat-label:has(input:checked) { color: var(--text-primary); }

.feat-label:has(input:disabled) {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

.no-data-note {
  color: var(--text-muted);
  font-style: italic;
  font-size: 12px;
}

/* ─── Map container ─────────────────────────────────────────────────────── */
#map { flex: 1; width: 100%; }


/* ─── Resolution badge ──────────────────────────────────────────────────── */
.map-resolution-badge {
  position: absolute;
  bottom: 44px;
  left: 8px;
  z-index: 10;
  background: rgba(15, 23, 42, 0.75);
  color: #94a3b8;
  font-size: 10px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  pointer-events: none;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

/* ─── Hover tooltip ─────────────────────────────────────────────────────── */
.map-tooltip {
  position: absolute;
  z-index: 20;
  pointer-events: none;
  background: rgba(15, 23, 42, 0.92);
  border: 1px solid #334155;
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 12px;
  color: var(--text-primary);
  min-width: 160px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(0,0,0,0.4);
}

.tooltip-id {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 10px;
  color: var(--nav-accent);
  margin-bottom: 5px;
  letter-spacing: 0.02em;
}

.tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.tooltip-row span:last-child { color: var(--text-primary); font-weight: 500; }

/* ─── Cell detail panel (right sidebar) ─────────────────────────────────── */
.cell-panel {
  position: absolute;
  top: 0; right: 0; bottom: 0;
  width: var(--panel-width);
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  overflow: hidden;
  z-index: 30;
  display: flex;
  flex-direction: column;
  animation: slideIn var(--transition) ease;
}

.cell-panel[hidden] { display: none; }

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

/* ─── Resize handle ─────────────────────────────────────────────────────── */
.panel-resize-handle {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 5px;
  cursor: col-resize;
  z-index: 2;
  background: transparent;
  transition: background 150ms;
}

.panel-resize-handle:hover,
.panel-resize-handle.resizing {
  background: rgba(34, 197, 94, 0.25);
}

/* ─── Panel sticky top (header + tabs) ─────────────────────────────────── */
.panel-sticky-top { flex-shrink: 0; }

/* Panel header */
.panel-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: 18px 16px 14px;
  border-bottom: 1px solid var(--panel-border);
}

.panel-title-group { display: flex; flex-direction: column; gap: 4px; }

.panel-title { font-size: 15px; font-weight: 600; color: var(--text-primary); }

.panel-h3id {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 10px;
  color: var(--nav-accent);
  letter-spacing: 0.02em;
}

.panel-close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
}

.panel-close:hover { color: var(--text-primary); background: var(--card-bg); }
.panel-close svg { width: 18px; height: 18px; }

/* ─── Tabs ──────────────────────────────────────────────────────────────── */
.panel-tabs {
  display: flex;
  border-bottom: 1px solid var(--panel-border);
}

.panel-tab {
  flex: 1;
  padding: 9px 4px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  border: none;
  background: none;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color var(--transition), border-color var(--transition);
}

.panel-tab.active {
  color: var(--nav-accent);
  border-bottom-color: var(--nav-accent);
}

.panel-tab:hover:not(.active) { color: var(--text-primary); }

/* ─── Panel scrollable body ─────────────────────────────────────────────── */
.panel-body { flex: 1; overflow-y: auto; }

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

/* ─── Panel cards ───────────────────────────────────────────────────────── */
.panel-card {
  margin: 12px;
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 14px;
}

.panel-card[hidden] { display: none; }

.panel-card-title {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 10px;
}

/* ─── Attribute grid (definition list) ─────────────────────────────────── */
.attr-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
}

.attr-grid dt { color: var(--text-secondary); font-size: 12px; }

.attr-grid dd {
  color: var(--text-primary);
  font-size: 12px;
  font-weight: 500;
  text-align: right;
}

/* ─── Soil attrs scroll ─────────────────────────────────────────────────── */
.soil-attrs-scroll {
  max-height: 190px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
}

/* ─── Charts ────────────────────────────────────────────────────────────── */
.chart-wrap {
  position: relative;
  height: 180px;
}

/* ─── MapLibre attribution tweak ────────────────────────────────────────── */
.maplibregl-ctrl-attrib { font-size: 10px; }

/* ─── Demo mode notice banner ───────────────────────────────────────────── */
.demo-notice {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px 14px;
  border-radius: 8px;
  background: rgba(56,189,248,0.08);
  border: 1px solid rgba(56,189,248,0.25);
  color: #7dd3fc;
  font-size: 13px;
  line-height: 1.55;
  margin-bottom: 8px;
}

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

.demo-notice-hide {
  animation: fadeOut 400ms ease forwards;
}

/* ─── Nav section separator label ──────────────────────────────────────── */
.nav-section-label {
  padding: 14px 18px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  user-select: none;
}

/* ─── Docs / Data-sources page layout ──────────────────────────────────── */
.docs-page {
  flex: 1;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #334155 transparent;
  padding: 40px 48px;
}

.docs-inner {
  max-width: 800px;
  margin: 0 auto;
}

.docs-header { margin-bottom: 36px; }

.docs-title {
  font-size: 26px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  margin-bottom: 6px;
}

.docs-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.docs-section { margin-bottom: 48px; }

.docs-section-title {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--nav-accent);
  margin-bottom: 18px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--panel-border);
}

.docs-h3 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin: 24px 0 10px;
}

.docs-p {
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--text-secondary);
  margin-bottom: 14px;
}

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

.docs-list {
  margin: 8px 0 14px 0;
  padding-left: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.docs-list li {
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text-secondary);
}

.docs-list li strong { color: var(--text-primary); }

.docs-link {
  color: var(--nav-accent);
  text-decoration: none;
}
.docs-link:hover { text-decoration: underline; }

.docs-code {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 12px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 4px;
  padding: 1px 5px;
  color: #93c5fd;
}

.docs-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 12px;
}

/* Stats row */
.docs-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin: 24px 0;
}

.docs-stat {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.docs-stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--nav-accent);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.docs-stat-label {
  font-size: 11.5px;
  color: var(--text-secondary);
  line-height: 1.4;
}

.docs-stat-sub {
  color: var(--text-muted);
  font-size: 10.5px;
}

/* Feature cards */
.docs-feature-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 20px 18px;
  margin-bottom: 14px;
}

.docs-feature-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.docs-feature-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  color: var(--nav-accent);
}

.docs-feature-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
}

.docs-feature-route {
  font-family: ui-monospace, "SF Mono", monospace;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
  padding: 2px 7px;
}

/* Shared table */
.docs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 14px;
}

.docs-table th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  padding: 7px 10px;
  border-bottom: 1px solid var(--panel-border);
}

.docs-table td {
  padding: 8px 10px;
  color: var(--text-secondary);
  border-bottom: 1px solid rgba(255,255,255,0.04);
  vertical-align: top;
  line-height: 1.5;
}

.docs-table tr:last-child td { border-bottom: none; }
.docs-table td:first-child { color: var(--text-primary); }

/* Data source cards */
.ds-card {
  background: var(--card-bg);
  border-radius: var(--radius);
  padding: 20px 20px 16px;
  margin-bottom: 16px;
}

.ds-card-header {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.ds-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  flex: 1;
  min-width: 0;
}

.ds-provider {
  font-size: 11.5px;
  color: var(--text-muted);
  width: 100%;
  margin-top: 2px;
}

.ds-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 3px 8px;
  border-radius: 20px;
  flex-shrink: 0;
}

.ds-badge-weather    { background: rgba(56,189,248,0.15); color: #38bdf8; }
.ds-badge-vegetation { background: rgba(34,197,94,0.15);  color: #4ade80; }
.ds-badge-water      { background: rgba(99,102,241,0.15); color: #818cf8; }
.ds-badge-soil       { background: rgba(234,179,8,0.15);  color: #fbbf24; }
.ds-badge-terrain    { background: rgba(148,163,184,0.15);color: #94a3b8; }
.ds-badge-economics  { background: rgba(249,115,22,0.15); color: #fb923c; }
.ds-badge-agro       { background: rgba(167,139,250,0.15);color: #a78bfa; }

.ds-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px 16px;
  margin: 12px 0;
}

.ds-meta-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.ds-meta-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  font-weight: 600;
}

.ds-meta-val {
  font-size: 12.5px;
  color: var(--text-primary);
  font-weight: 500;
}

.ds-table { margin-top: 10px; }

/* ─── Yield & Profit page layout ────────────────────────────────────────── */
#yp-container {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
}

#yp-map {
  flex: 1;
  min-width: 0;
}

/* ─── Suitability page layout ───────────────────────────────────────────── */
#suitability-container {
  flex: 1;
  display: flex;
  flex-direction: row;
  overflow: hidden;
  position: relative;
}

#suitability-map {
  flex: 1;
  min-width: 0;
}

/* ─── Suitability panel (right sidebar) ─────────────────────────────────── */
.suit-panel {
  position: relative;
  width: var(--panel-width);
  flex-shrink: 0;
  background: var(--panel-bg);
  border-left: 1px solid var(--panel-border);
  overflow: hidden;
  z-index: 30;
  display: flex;
  flex-direction: column;
  animation: slideIn var(--transition) ease;
}

.suit-panel.hidden { display: none; }

/* ─── Crop score rows (Tab 1) ───────────────────────────────────────────── */
.suit-crop-row {
  margin-bottom: 8px;
}

.suit-crop-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: 13px;
  color: var(--text-secondary);
}

.suit-crop-label:has(input:checked) { color: var(--text-primary); }

.suit-crop-label input[type="radio"] {
  accent-color: var(--nav-accent);
  flex-shrink: 0;
  cursor: pointer;
  width: 13px;
  height: 13px;
}

.suit-crop-name {
  width: 80px;
  flex-shrink: 0;
  font-size: 13px;
}

.suit-score-track {
  flex: 1;
  height: 6px;
  background: #1e293b;
  border-radius: 3px;
  overflow: hidden;
}

.suit-score-bar {
  height: 100%;
  background: var(--nav-accent);
  border-radius: 3px;
  transition: width 300ms ease;
}

.suit-score-value {
  width: 32px;
  text-align: right;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  font-family: ui-monospace, "SF Mono", monospace;
  flex-shrink: 0;
}

/* ─── Yield-profit info icon ─────────────────────────────────────────────── */
.yp-info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: rgba(148,163,184,0.15);
  color: #94a3b8;
  font-size: 10px;
  font-style: normal;
  cursor: help;
  flex-shrink: 0;
}
.yp-info-icon:hover { background: rgba(148,163,184,0.3); color: #cbd5e1; }

/* ─── Feature breakdown rows ─────────────────────────────────────────────── */
.feat-row {
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.feat-row:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }

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

.feat-info {
  display: flex;
  align-items: baseline;
  gap: 4px;
  flex: 0 0 130px;
  min-width: 0;
}

.feat-name {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feat-unit {
  font-size: 10px;
  color: var(--text-muted);
  flex-shrink: 0;
}

.feat-score-track {
  flex: 1;
  height: 5px;
  background: rgba(255,255,255,0.07);
  border-radius: 3px;
  overflow: hidden;
}

.feat-score-bar {
  height: 100%;
  border-radius: 3px;
  transition: width 300ms ease;
}

.feat-score-val {
  flex-shrink: 0;
  width: 30px;
  text-align: right;
  font-size: 11px;
  font-weight: 600;
  font-family: ui-monospace, "SF Mono", monospace;
}

/* ─── Weather feature expand button ─────────────────────────────────────── */
.feat-expand-btn {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 3px;
  border-radius: 4px;
  display: flex;
  align-items: center;
  transition: color var(--transition), background var(--transition);
}

.feat-expand-btn:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }

.feat-chevron {
  width: 14px;
  height: 14px;
  transition: transform var(--transition);
}

.feat-weather.expanded .feat-chevron { transform: rotate(180deg); }

/* ─── Chart drawer ───────────────────────────────────────────────────────── */
.feat-drawer { margin-top: 10px; }

.feat-chart-wrap {
  position: relative;
  height: 155px;
}

.feat-chart-legend {
  position: absolute;
  top: 4px;
  right: 4px;
  font-size: 10px;
  color: rgba(34,197,94,0.7);
  pointer-events: none;
  z-index: 1;
}

/* ─── Scenario list page ─────────────────────────────────────────────────── */
.page-container {
  padding: 1.5rem 2rem;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.page-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}

.btn { display: inline-flex; align-items: center; gap: 0.375rem; padding: 0.5rem 1rem;
       border-radius: 6px; font-size: 0.875rem; font-weight: 500; cursor: pointer;
       text-decoration: none; border: none; }
.btn-primary { background: #22c55e; color: #fff; }
.btn-primary:hover { background: #16a34a; }

.table-card {
  background: #1e293b;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid #334155;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.data-table th {
  padding: 0.625rem 1rem;
  text-align: left;
  font-weight: 500;
  color: #94a3b8;
  background: #0f172a;
  border-bottom: 1px solid #334155;
}

.data-table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid #1e293b;
  color: var(--text-primary);
  vertical-align: middle;
}

.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: rgba(255,255,255,0.02); }

.table-empty { text-align: center; color: #64748b; padding: 2rem; }

.link-primary { color: #22c55e; text-decoration: none; }
.link-primary:hover { text-decoration: underline; }

.text-muted { color: #64748b; }

.badge { display: inline-block; padding: 0.2em 0.6em; border-radius: 4px;
         font-size: 0.75rem; font-weight: 500; }
.badge-success  { background: rgba(34,197,94,0.15);  color: #22c55e; }
.badge-warning  { background: rgba(234,179,8,0.15);  color: #eab308; }
.badge-danger   { background: rgba(239,68,68,0.15);  color: #ef4444; }
.badge-neutral  { background: rgba(100,116,139,0.15); color: #94a3b8; }

.progress-track { background: #334155; border-radius: 4px; height: 6px; width: 120px; overflow: hidden; }
.progress-fill  { height: 100%; border-radius: 4px; transition: width 0.4s ease; }
.progress-fill-success { background: #22c55e; }
.progress-fill-running { background: #eab308; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.5} }

.actions-cell { display: flex; gap: 0.5rem; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; border-radius: 5px; border: none; cursor: pointer;
  background: transparent; color: #64748b; text-decoration: none;
}
.icon-btn:hover { background: #334155; color: #e2e8f0; }
.icon-btn-danger:hover { background: rgba(239,68,68,0.15); color: #ef4444; }

/* ─── Scenario result page ───────────────────────────────────────────────── */
#scenario-container {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
}

#scenario-map {
  flex: 1;
  height: 100%;
}

/* ─── Before/After score pair ────────────────────────────────────────────── */
.scen-score-pair {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.75rem;
  min-width: 90px;
}

.scen-before { color: #64748b; }
.scen-arrow  { color: #475569; }
.scen-after  { font-weight: 600; }


/* ─── Scenario result: override chips ───────────────────────────────────── */
.scen-overrides-bar {
  flex-wrap: wrap;
  gap: 0.375rem;
  padding: 0.5rem 1rem;
  background: rgba(15,23,42,0.6);
  border-bottom: 1px solid #334155;
}

.scen-override-chip {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.625rem;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  background: rgba(56,189,248,0.12);
  color: #38bdf8;
  border: 1px solid rgba(56,189,248,0.25);
  white-space: nowrap;
}

/* ─── Scenario result: parameter requirement rows ───────────────────────── */
/* Mirror .suit-crop-label but for non-interactive requirement items */
.scen-req-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.scen-req-diff {
  font-size: 0.75rem;
  font-weight: 600;
}

.scen-req-expand {
  background: transparent;
  border: 1px solid #334155;
  border-radius: 4px;
  color: #64748b;
  cursor: pointer;
  font-size: 0.625rem;
  padding: 0.15rem 0.5rem;
  flex-shrink: 0;
  transition: border-color 0.15s, color 0.15s;
}
.scen-req-expand:hover { border-color: #94a3b8; color: #e2e8f0; }

.scen-req-chart-wrap {
  padding: 0.5rem 0 0.25rem;
  height: 220px;
}
