/* ==========================================================================
   Future Weather Generator — GEED
   All-white scientific dashboard · harmonized typography · no side panels
   ========================================================================== */

:root {
  /* Brand accent — from header blueprint */
  --brand-accent: #ED7C30;
  --header-height: 89px;

  /* Surfaces — all white */
  --bg:           #ffffff;
  --surface:      #ffffff;
  --surface-alt:  #ffffff;

  /* Ink scale */
  --ink:          #0f172a;
  --ink-strong:   #020617;
  --muted:        #64748b;
  --muted-soft:   #94a3b8;

  /* Borders — outlines instead of fills */
  --border:        #e5e7eb;
  --border-strong: #cbd5e1;
  --border-active: #2563eb;

  /* Brand + status */
  --accent:        #1d4ed8;
  --accent-strong: #1e3a8a;
  --pass:          #059669;
  --warn:          #b45309;
  --fail:          #b91c1c;
  --pass-soft:     #ecfdf5;
  --warn-soft:     #fffbeb;
  --fail-soft:     #fef2f2;
  --accent-soft:   #eff6ff;

  /* Type scale */
  --fs-10: 10px;
  --fs-11: 11px;
  --fs-12: 12px;
  --fs-13: 13px;
  --fs-14: 14px;
  --fs-15: 15px;
  --fs-16: 16px;
  --fs-18: 18px;
  --fs-22: 22px;
  --fs-28: 28px;

  /* Shadows — minimal */
  --shadow-card:  0 1px 0 var(--border);
  --shadow-pop:   0 8px 24px rgba(15, 23, 42, 0.08);

  /* Radii */
  --r-sm: 6px;
  --r-md: 8px;
  --r-lg: 12px;
}

* { box-sizing: border-box; }

html, body {
  background: var(--bg);
}

body {
  margin: 0; padding: 0;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
               Roboto, Helvetica, Arial, sans-serif;
  font-size: var(--fs-14);
  line-height: 1.55;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ==========================================================================
   Typography
   ========================================================================== */

h1, h2, h3, h4 { margin: 0; color: var(--ink-strong); font-weight: 600; }
h1 { font-size: var(--fs-22); letter-spacing: -0.01em; }
h2 { font-size: var(--fs-18); letter-spacing: -0.005em; font-weight: 600; }
h3 { font-size: var(--fs-13); }
h4 { font-size: var(--fs-13); }

p { margin: 0; }

code { font-family: "JetBrains Mono", "SF Mono", Consolas, monospace; font-size: 12.5px; }

/* Universal block label — used for every section sub-title */
.block-label {
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 24px 0 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ==========================================================================
   Top header (premium SaaS style)
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--surface);
  border-bottom: 3px solid var(--brand-accent);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px;
  height: var(--header-height);
  padding: 0 2rem;
}

.brand-logo-block {
  display: flex; align-items: center;
}
.brand-logo {
  width: 180px;
  height: 70px;
  object-fit: contain;
  display: block;
}

.brand-title-block {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 0;
  gap: 2px;
}
.brand-title-block h1 {
  font-family: 'Poppins', -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 1.35rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-main, var(--ink-strong));
  white-space: nowrap;
  margin: 0;
}
.brand-tagline {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--ink-muted, #6a7280);
  letter-spacing: 0.01em;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  max-width: 100%;
}
@media (max-width: 900px) {
  .brand-tagline { display: none; }
}

.mode-switch {
  display: flex; gap: 2px; padding: 3px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.mode-switch button {
  background: transparent; border: 0;
  padding: 5px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.mode-switch button.active {
  background: var(--ink-strong); color: white;
}

/* ==========================================================================
   Layout & cards
   ========================================================================== */

main {
  max-width: 1280px;
  margin: 24px auto 64px;
  padding: 0 32px;
  display: flex; flex-direction: column;
  gap: 20px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 28px 32px;
}

.card-header { margin-bottom: 16px; }
.card-header h2 { margin: 4px 0 0; }
.card-sub {
  margin-top: 6px;
  color: var(--muted);
  font-size: var(--fs-13);
}
.card-sub-strong {
  margin-top: 8px;
  font-size: var(--fs-13);
  color: var(--ink-strong);
  font-weight: 500;
}
.step-marker {
  display: inline-block;
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--accent);
}

.hidden { display: none !important; }
body.mode-basic .advanced-only { display: none !important; }
body.mode-basic .help { display: none !important; }

/* ==========================================================================
   Info callout — no side stripe
   ========================================================================== */

.info-callout {
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  border-radius: var(--r-md);
  padding: 12px 16px;
  font-size: var(--fs-13);
  color: var(--ink);
  margin-bottom: 20px;
}
.info-callout strong { color: var(--ink-strong); }

/* ==========================================================================
   Upload — Two-column responsive workflow
   ========================================================================== */

.upload-workflow {
  display: grid;
  grid-template-columns: 1fr 1fr 1.1fr;
  gap: 20px;
  align-items: stretch;
}

/* Upload Panel (Left) */
.upload-panel {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 400px;
}

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

.panel-title {
  margin: 0;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
}

.panel-caption {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--muted);
  line-height: 1.5;
}

.dropzone {
  background: var(--surface);
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r-md);
  padding: 24px;
  text-align: center;
  transition: 0.12s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.upload-icon {
  width: 32px;
  height: 32px;
  color: var(--muted);
}

.dropzone-text {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--muted);
}

.dropzone code {
  background: var(--accent-soft);
  padding: 2px 6px;
  border-radius: 4px;
  color: var(--ink-strong);
  font-weight: 500;
}

.dropzone input[type=file] {
  font-size: var(--fs-13);
  cursor: pointer;
}

.dropzone.dragging {
  border-color: var(--accent);
  background: var(--accent-soft);
}

/* Baseline picker — dropdown that replaces the upload dropzone. */
.baseline-select-wrap {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.baseline-select-label {
  font-size: var(--fs-13);
  color: var(--muted);
  font-weight: 500;
}
.baseline-select {
  background: var(--surface);
  border: 1.5px solid var(--border-strong);
  border-radius: var(--r-md);
  padding: 10px 12px;
  font: inherit;
  font-size: var(--fs-14);
  color: var(--ink-strong);
  cursor: pointer;
  width: 100%;
  transition: 0.12s;
}
.baseline-select:hover,
.baseline-select:focus {
  border-color: var(--accent);
  outline: none;
}
.baseline-contact-note {
  margin: 0;
  font-size: var(--fs-12);
  color: var(--muted);
  background: var(--accent-soft);
  border-left: 3px solid var(--accent);
  padding: 8px 12px;
  border-radius: 4px;
  line-height: 1.45;
}
.baseline-contact-note a {
  color: var(--accent);
  font-weight: 500;
  text-decoration: none;
}
.baseline-contact-note a:hover {
  text-decoration: underline;
}

/* Locked period pills — visible but un-clickable; show a contact CTA. */
.period-pill.locked {
  cursor: not-allowed;
  position: relative;
  background: #f4f4f5 !important;
  border-style: dashed !important;
  border-color: #d4d4d8 !important;
  color: #a1a1aa !important;
}
.period-pill.locked .period-label,
.period-pill.locked .year {
  color: #a1a1aa !important;
}
.period-pill.locked:hover {
  background: #f4f4f5 !important;
  border-color: #d4d4d8 !important;
}
.period-pill.locked input[type=checkbox] {
  pointer-events: none;
}

.file-format-note {
  font-size: var(--fs-12);
  color: var(--muted);
  text-align: center;
}

.file-format-note strong {
  color: var(--ink-strong);
  font-weight: 600;
}

.filename-display {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--pass-soft);
  border: 1px solid #a7f3d0;
  border-radius: var(--r-md);
  font-size: var(--fs-13);
  color: var(--pass);
  font-weight: 500;
}

.check-icon {
  width: 16px;
  height: 16px;
  color: var(--pass);
  flex-shrink: 0;
}

#filename-text {
  word-break: break-all;
}

/* Location Panel (Center) */
.location-panel {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-height: 400px;
}

.location {
  display: flex;
  flex-direction: column;
  gap: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 20px;
  flex: 1;
}

.location-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.location-header .panel-title {
  margin: 0;
}

.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  background: var(--pass-soft);
  border: 1px solid #a7f3d0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--pass);
  white-space: nowrap;
}

.badge-icon {
  width: 12px;
  height: 12px;
  color: var(--pass);
}

.location-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.location-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.location-card dt {
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.location-card dd {
  margin: 0;
  font-size: var(--fs-14);
  font-variant-numeric: tabular-nums;
  color: var(--ink-strong);
  font-weight: 500;
  word-break: break-word;
}

.location-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  text-align: center;
  color: var(--muted);
  flex: 1;
  min-height: 300px;
}

.placeholder-icon {
  width: 40px;
  height: 40px;
  color: var(--border-strong);
  flex-shrink: 0;
}

.location-placeholder p {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--muted);
}

/* ==========================================================================
   Map Panel — Interactive geographic preview
   ========================================================================== */

.map-panel {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-height: 400px;
}

.map-container {
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px;
  flex: 1;
  height: 100%;
  position: relative;
  z-index: 1;
}

.map-container .map-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px;
}

.map-container .map-header .panel-title {
  margin: 0;
}

.map-view {
  flex: 1;
  width: 100%;
  height: 100%;
  min-height: 300px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  background: #f8f9fa;
  position: relative;
  z-index: 1;
}

/* Leaflet map customization — light theme, minimal controls */
.map-view .leaflet-container {
  font-family: inherit;
  background: #f8f9fa;
}

.map-view .leaflet-control {
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

.map-view .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.95) !important;
  color: var(--muted);
  font-size: 10px;
  padding: 4px 8px !important;
  border-radius: var(--r-md);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.map-view .leaflet-control-zoom {
  border-radius: var(--r-md);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.map-view .leaflet-control-zoom a {
  color: var(--ink-strong);
  font-weight: 600;
  border-bottom: 1px solid var(--border);
}

.map-view .leaflet-control-zoom a:last-child {
  border-bottom: none;
}

.map-view .leaflet-control-zoom a:hover {
  background: var(--accent-soft);
}

.map-view .leaflet-popup-content-wrapper {
  background: var(--ink-strong);
  color: white;
  border-radius: 6px;
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.25);
}

.map-view .leaflet-popup-content {
  margin: 8px;
  font-size: var(--fs-12);
  line-height: 1.5;
}

.map-view .leaflet-popup-content strong {
  font-weight: 600;
}

.map-view .leaflet-popup-tip {
  background: var(--ink-strong);
}

.map-view .custom-map-marker {
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.15));
}

.coordinates-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  border-radius: var(--r-md);
  font-size: var(--fs-12);
  color: var(--accent);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.map-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 20px;
  background: var(--surface);
  border: 1px dashed var(--border);
  border-radius: var(--r-md);
  text-align: center;
  color: var(--muted);
  flex: 1;
  min-height: 300px;
}

.map-placeholder p {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--muted);
}

/* ==========================================================================
   Scenario Primer — Collapsed by default, minimal visual footprint
   ========================================================================== */

.scenario-primer-section {
  margin-bottom: 14px;
}

.primer-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 8px 12px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-12);
  color: var(--muted);
  user-select: none;
  transition: 0.15s;
}

.primer-toggle:hover {
  background: var(--surface);
  color: var(--ink-strong);
}

.toggle-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
  font-size: 11px;
  color: var(--muted-soft);
}

.scenario-primer-section[open] .toggle-icon {
  transform: rotate(180deg);
}

.primer-content {
  padding: 10px 12px;
  background: transparent;
  border: none;
  color: var(--muted);
  font-size: var(--fs-12);
  line-height: 1.5;
  margin-top: 6px;
}

.primer-content p {
  margin: 0;
}

/* ==========================================================================
   Scenario Presets — Lightweight workflow shortcuts
   ========================================================================== */

.scenario-presets {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.preset-label {
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted-soft);
  margin-right: 4px;
}

.preset-btn {
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: var(--fs-11);
  font-weight: 500;
  color: var(--muted);
  cursor: pointer;
  transition: 0.12s;
  white-space: nowrap;
}

.preset-btn:hover {
  border-color: var(--border-strong);
  background: var(--surface);
  color: var(--ink-strong);
}

.preset-btn.active {
  background: var(--muted);
  color: white;
  border-color: var(--muted);
}

/* ==========================================================================
   Scenarios Container & List — Lean, scannable layout
   ========================================================================== */

.scenarios-container {
  margin-top: 0;
}

.scenario-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
  margin-bottom: 0;
  place-items: stretch;
  auto-rows: 1fr;
}

@supports (grid-auto-flow: dense) {
  .scenario-list {
    max-width: 100%;
  }
}

.scenario-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px;
  display: flex;
  flex-direction: column;
  transition: 0.15s ease;
  position: relative;
  overflow: hidden;
}

/* Visual differentiation by SSP severity - top border accent */
.scenario-card.tag-best {
  border-top: 3px solid #0891b2;
}

.scenario-card.tag-conservative {
  border-top: 3px solid var(--pass);
}

.scenario-card.tag-moderate {
  border-top: 3px solid var(--accent);
}

.scenario-card.tag-pessimistic {
  border-top: 3px solid var(--warn);
}

.scenario-card.tag-worst {
  border-top: 3px solid var(--fail);
}

.scenario-card:hover {
  border-color: var(--border-strong);
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
}

.scenario-card input[type="checkbox"]:checked {
  accent-color: var(--ink-strong);
}

.scenario-card:has(input[type="checkbox"]:checked) {
  border-color: var(--border-strong);
  box-shadow: 0 3px 12px rgba(15, 23, 42, 0.1);
  background: var(--accent-soft);
}

.scenario-card .sc-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 8px;
}

.scenario-card .sc-title {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: var(--fs-16);
  font-weight: 700;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
  line-height: 1.2;
}

.scenario-card .sc-code {
  font-variant-numeric: tabular-nums;
}

.scenario-card .sc-pathway {
  margin: 0;
  font-size: var(--fs-12);
  color: var(--muted);
  line-height: 1.4;
  margin-bottom: 8px;
}

.scenario-card .sc-warming {
  margin: 8px 0;
  padding: 8px 0;
  border-top: none;
  border-bottom: none;
}

.scenario-card .warming-label {
  font-size: var(--fs-10);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted-soft);
  margin-bottom: 3px;
  display: none;
}

.scenario-card .warming-value {
  font-size: var(--fs-18);
  font-weight: 700;
  color: var(--ink-strong);
  font-variant-numeric: tabular-nums;
  margin-bottom: 6px;
  line-height: 1.1;
}

.scenario-card .warming-bar {
  width: 100%;
  height: 5px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.scenario-card.tag-best .warming-bar-fill { background: #0891b2; width: 15%; }
.scenario-card.tag-conservative .warming-bar-fill { background: var(--pass); width: 30%; }
.scenario-card.tag-moderate .warming-bar-fill { background: var(--accent); width: 50%; }
.scenario-card.tag-pessimistic .warming-bar-fill { background: var(--warn); width: 70%; }
.scenario-card.tag-worst .warming-bar-fill { background: var(--fail); width: 95%; }

.scenario-card .warming-bar-fill {
  height: 100%;
  transition: width 0.4s ease;
}

.scenario-card .sc-meta {
  display: none;
}

.scenario-card .sc-meta dt {
  color: var(--muted);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 10px;
}

.scenario-card .sc-meta dd {
  margin: 0;
}

.scenario-card .sc-meta .advanced-only { display: contents; }
body.mode-basic .scenario-card .sc-meta .advanced-only > * { display: none; }

.scenario-card .sc-periods {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: auto;
  padding-top: 6px;
  border-top: none;
}

.scenario-card .period-pill {
  display: flex;
  align-items: center;
  flex-direction: column;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: var(--fs-11);
  font-weight: 600;
  color: var(--ink-strong);
  user-select: none;
  transition: 0.12s ease;
  text-align: center;
  flex: 1;
  min-width: 0;
}

.scenario-card .period-pill:hover {
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

.scenario-card .period-pill.selected {
  border-color: var(--ink-strong);
  background: var(--ink-strong);
  color: white;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.12);
}

.scenario-card .period-pill input {
  display: none;
}

.scenario-card .period-pill .year {
  font-size: 9px;
  color: var(--muted);
  margin-top: 1px;
  font-weight: 400;
}

.scenario-card .period-pill.selected .year {
  color: rgba(255, 255, 255, 0.7);
  font-size: 8px;
}

.scenario-card .period-label {
  font-size: var(--fs-11);
  font-weight: 600;
  color: inherit;
}

/* ==========================================================================
   Advanced section
   ========================================================================== */

.advanced-section {
  margin-top: 8px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.advanced-section > summary {
  display: flex; align-items: center; justify-content: space-between;
  cursor: pointer;
  padding: 6px 0;
  list-style: none;
}
.advanced-section > summary::-webkit-details-marker { display: none; }
.advanced-section > summary::after {
  content: "▾";
  font-size: 10px;
  color: var(--muted);
  margin-left: 8px;
}
.advanced-section[open] > summary::after { content: "▴"; }
.summary-hint {
  font-size: var(--fs-12);
  color: var(--muted);
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
}

.option-group { margin-top: 8px; }
.option-group .block-label { margin: 16px 0 8px; }

.radio-row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  cursor: pointer;
}
.radio-row:hover { border-color: var(--border-active); }
.radio-row input { margin-top: 3px; accent-color: var(--accent); }
.radio-content { display: flex; flex-direction: column; gap: 3px; flex: 1; min-width: 0; }
.label-line {
  display: flex; align-items: center; gap: 8px;
  font-size: var(--fs-14);
  font-weight: 600;
  color: var(--ink-strong);
}
.radio-content .desc {
  font-size: var(--fs-12);
  color: var(--muted);
}
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.badge.rec {
  background: var(--pass-soft);
  color: var(--pass);
  border: 1px solid #a7f3d0;
}

/* Help "?" icon + tooltip ------------------------------------------------ */
.help {
  display: inline-flex; align-items: center; justify-content: center;
  width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--muted);
  font-size: 10px; font-weight: 700;
  cursor: help; margin-left: 4px;
}
.help:hover {
  background: var(--ink-strong); color: white;
  border-color: var(--ink-strong);
}
.tooltip {
  position: fixed; z-index: 200; max-width: 320px;
  padding: 10px 12px;
  background: var(--ink-strong); color: white;
  font-size: var(--fs-12); line-height: 1.5;
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-pop);
  pointer-events: none;
}

/* ==========================================================================
   Buttons
   ========================================================================== */

button, .primary-btn {
  background: var(--ink-strong);
  color: white;
  border: 0;
  border-radius: var(--r-md);
  padding: 10px 20px;
  font-size: var(--fs-13);
  font-weight: 600;
  letter-spacing: 0.005em;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 8px;
  transition: 0.12s;
}
button:hover, .primary-btn:hover { background: #000; }
button:disabled, .primary-btn[aria-disabled="true"] {
  background: var(--surface);
  color: var(--muted-soft);
  border: 1px solid var(--border);
  cursor: not-allowed;
}
.action-row {
  display: flex; align-items: center; gap: 16px;
  margin-bottom: 16px;
}

/* ==========================================================================
   Queue / tables
   ========================================================================== */

table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-13);
  background: var(--surface);
}
th, td {
  text-align: left;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  font-variant-numeric: tabular-nums;
  vertical-align: top;
}
th {
  font-size: var(--fs-12);
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: var(--surface);
  border-bottom: 1px solid var(--border-strong);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr.clickable { cursor: pointer; }
tbody tr.clickable:hover { background: var(--accent-soft); }
tbody tr.active { background: var(--accent-soft); }

.progress-cell {
  display: flex; flex-direction: column; gap: 5px;
  min-width: 160px;
}
.progress-cell .bar {
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.progress-cell .bar > span {
  display: block; height: 100%;
  background: var(--ink-strong);
  transition: width 0.25s ease;
}
.progress-cell .label {
  font-size: 11px;
  color: var(--muted);
}

/* ==========================================================================
   Status pills (no fills; minimal stroke)
   ========================================================================== */

.status-pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  border: 1px solid transparent;
}
.status-pill::before {
  content: ""; width: 7px; height: 7px; border-radius: 999px;
}
.status-pill.pass { color: var(--pass); border-color: #a7f3d0; background: var(--pass-soft); }
.status-pill.pass::before { background: var(--pass); }
.status-pill.warn { color: var(--warn); border-color: #fde68a; background: var(--warn-soft); }
.status-pill.warn::before { background: var(--warn); }
.status-pill.fail { color: var(--fail); border-color: #fecaca; background: var(--fail-soft); }
.status-pill.fail::before { background: var(--fail); }
.status-pill.queued { color: var(--muted); border-color: var(--border); }
.status-pill.queued::before { background: var(--muted-soft); }
.status-pill.running { color: var(--accent); border-color: #bfdbfe; background: var(--accent-soft); }
.status-pill.running::before { background: var(--accent); }

/* ==========================================================================
   Impact cards — no side stripes, status communicated by dot + label
   ========================================================================== */

.impact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}
.impact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 14px 16px;
  display: flex; flex-direction: column; gap: 4px;
}
.impact-card .label {
  font-size: var(--fs-12);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 600;
}
.impact-card .severity-row {
  display: flex; align-items: center; gap: 8px;
  margin-top: 2px;
}
.impact-card .dot {
  width: 8px; height: 8px; border-radius: 999px;
  background: var(--muted-soft);
}
.impact-card.pass .dot { background: var(--pass); }
.impact-card.warn .dot { background: var(--warn); }
.impact-card.fail .dot { background: var(--fail); }
.impact-card .severity {
  font-size: var(--fs-18);
  font-weight: 600;
  color: var(--ink-strong);
  letter-spacing: -0.005em;
}
.impact-card .value {
  font-size: var(--fs-12);
  color: var(--muted);
}

/* ==========================================================================
   Recommendations — no side stripes, leading dot
   ========================================================================== */

#recommendations {
  list-style: none; padding: 0; margin: 0;
  display: flex; flex-direction: column; gap: 6px;
}
#recommendations li {
  position: relative;
  padding: 10px 14px 10px 30px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  font-size: var(--fs-13);
  color: var(--ink);
}
#recommendations li::before {
  content: "";
  position: absolute; left: 14px; top: 16px;
  width: 8px; height: 8px;
  border-radius: 999px;
  background: var(--warn);
}
#recommendations li.ok::before { background: var(--pass); }

/* ==========================================================================
   Validation Summary Panel — High-level interpretation
   ========================================================================== */

.validation-summary {
  background: var(--accent-soft);
  border: 1px solid #dbeafe;
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 20px;
}

.summary-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #dbeafe;
}

.summary-title {
  flex: 1;
}

.summary-title span {
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-strong);
}

.summary-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
}

.summary-section {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.summary-label {
  margin: 0;
  font-size: var(--fs-11);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.summary-value {
  margin: 0;
  font-size: var(--fs-13);
  color: var(--ink-strong);
  line-height: 1.5;
}

/* ==========================================================================
   Validation Details — Collapsible scientific checks
   ========================================================================== */

.validation-details-section {
  margin-top: 16px;
}

.validation-summary-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  padding: 10px 0;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-strong);
  user-select: none;
  list-style: none;
}

.validation-summary-toggle::-webkit-details-marker {
  display: none;
}

.validation-summary-toggle::before {
  content: '';
}

.toggle-icon {
  display: inline-flex;
  font-size: 12px;
  transition: transform 0.3s ease;
  color: var(--muted);
}

.validation-details-section[open] .toggle-icon {
  transform: rotate(180deg);
}

.validation-groups {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.validation-group {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}

.group-title {
  margin: 0;
  padding: 10px 14px;
  font-size: var(--fs-12);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}

#validation-passed .group-title {
  color: var(--pass);
  background: rgba(5, 150, 105, 0.03);
}

#validation-warnings .group-title {
  color: var(--warn);
  background: rgba(180, 83, 9, 0.03);
}

#validation-issues .group-title {
  color: var(--fail);
  background: rgba(185, 28, 28, 0.03);
}

.validation-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: var(--fs-13);
}

.validation-table.compact {
  font-size: var(--fs-12);
}

.validation-table tr {
  border-bottom: 1px solid var(--border);
}

.validation-table tr:last-child {
  border-bottom: none;
}

.validation-table td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
}

.validation-table td:first-child {
  font-weight: 600;
  color: var(--ink-strong);
  width: 160px;
  white-space: nowrap;
}

.validation-table td:nth-child(2) {
  width: 80px;
}

.validation-table td:nth-child(3) {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.validation-table td:nth-child(4) {
  color: var(--ink);
  line-height: 1.5;
  font-size: var(--fs-12);
}

.validation-recommendations-section {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ==========================================================================
   Summary table (for climate impact section)
   ========================================================================== */

#summary-table th, #summary-table td { text-align: right; }
#summary-table th:first-child, #summary-table td:first-child {
  text-align: left;
  font-weight: 500;
  color: var(--ink-strong);
}
#summary-table td .pos { color: var(--fail); font-weight: 600; }
#summary-table td .neg { color: var(--accent); font-weight: 600; }

/* ==========================================================================
   Plot cards — clean white, no side stripes
   ========================================================================== */

.plots-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.plot-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 16px 18px;
  display: flex; flex-direction: column; gap: 10px;
}
.plot-card .plot-title {
  display: flex; align-items: center; gap: 10px;
  font-size: var(--fs-13);
  font-weight: 600;
  color: var(--ink-strong);
}
.plot-card .narrative {
  font-size: var(--fs-12);
  line-height: 1.55;
  color: var(--ink);
  padding: 10px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
}
.plot-card .plot-area { min-height: 280px; }

/* ==========================================================================
   Footer
   ========================================================================== */

footer {
  text-align: center;
  padding: 24px 32px 40px;
  color: var(--muted);
  font-size: var(--fs-12);
  display: flex; align-items: center; justify-content: center; gap: 8px;
  flex-wrap: wrap;
  background: var(--surface);
  border-top: 1px solid var(--border);
}
footer .dot { color: var(--muted-soft); }

/* ==========================================================================
   Responsive
   ========================================================================== */

/* Laptop (1200px+): Full 3-column layout with equal heights */
@media (max-width: 1400px) {
  .upload-workflow {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
  }

  .upload-panel,
  .location-panel,
  .map-panel {
    min-height: 400px;
  }
}

/* Tablet (768px - 1024px): Upload + Metadata in 2 cols, Map spans below */
@media (max-width: 1024px) {
  .upload-workflow {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 16px;
  }

  .upload-panel,
  .location-panel {
    min-height: 350px;
  }

  .map-panel {
    grid-column: 1 / -1;
    max-width: 100%;
    min-height: 280px;
  }

  .map-view {
    min-height: 280px;
  }

  .plots-grid { grid-template-columns: 1fr; }
  .scenario-list { grid-template-columns: 1fr; }
}

/* Mobile (<768px): Stack vertically */
@media (max-width: 768px) {
  .topbar-inner {
    flex-wrap: wrap;
    height: auto;
    padding: 0.75rem 1rem;
    gap: 12px;
  }
  .brand-logo { width: 140px; height: 54px; }
  .brand-title-block { flex: 1; justify-content: flex-start; }
  .brand-title-block h1 { font-size: 1.05rem; white-space: normal; }

  /* Upload workflow stacks vertically */
  .upload-workflow {
    grid-template-columns: 1fr;
    gap: 14px;
  }

  .upload-panel,
  .location-panel,
  .map-panel {
    min-height: 300px;
  }

  .location-grid {
    grid-template-columns: 1fr;
  }

  .map-view {
    min-height: 250px;
  }

  .scenario-presets {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
  }

  .preset-label {
    margin-bottom: 6px;
    margin-right: 0;
  }

  .scenario-list {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  .scenario-card {
    padding: 12px;
  }

  .scenario-card .sc-title {
    font-size: var(--fs-14);
  }

  .scenario-card .sc-pathway {
    font-size: var(--fs-11);
  }

  .scenario-card .warming-value {
    font-size: var(--fs-16);
  }

  .plots-grid { grid-template-columns: 1fr; }
}

/* ============================================================== */
/*  Phase 1 — ensemble toggle, synthetic-data banner, fan chart   */
/* ============================================================== */

.ensemble-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
  padding: 6px 12px;
  border: 1px solid #d0d6df;
  border-radius: 6px;
  background: #f7f9fc;
  cursor: pointer;
  user-select: none;
  font-size: var(--fs-13, 13px);
}
.ensemble-toggle input { margin: 0; }
.ensemble-toggle small { color: #6a7280; }
.ensemble-toggle:has(input:checked) {
  background: #eaf2ff;
  border-color: #6c93cc;
}

.banner {
  margin: 12px 0;
  padding: 12px 16px;
  border-radius: 6px;
  border: 1px solid;
  line-height: 1.45;
}
.banner-warn {
  background: #fff7e6;
  border-color: #f5b04a;
  color: #6b4500;
}
.banner-warn strong { color: #663b00; }

#ensemble-fan-block {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px solid #e6e9ee;
}

/* ============================================================== */
/*  Phase 3 — building energy simulation card                     */
/* ============================================================== */

.sim-controls {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
  margin: 12px 0;
}
.sim-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: var(--fs-13, 13px);
}
.sim-field > span { font-weight: 600; }
.sim-field small { color: #6a7280; font-size: 11px; }
.sim-field input[type="number"],
.sim-field input[type="file"] {
  padding: 6px 8px;
  border: 1px solid #cdd3dc;
  border-radius: 4px;
  font: inherit;
}
.sim-toggle {
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

#sim-table, #sim-adaptive-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 8px;
  font-size: var(--fs-13, 13px);
}
#sim-table th, #sim-table td,
#sim-adaptive-table th, #sim-adaptive-table td {
  padding: 8px 10px;
  border-bottom: 1px solid #eef0f4;
  text-align: right;
}
#sim-table th:first-child, #sim-table td:first-child,
#sim-adaptive-table th:first-child, #sim-adaptive-table td:first-child {
  text-align: left;
}
#sim-table thead th, #sim-adaptive-table thead th {
  background: #f5f7fa;
  font-weight: 600;
}

