:root {
  --bg-primary:   #0f1117;
  --bg-secondary: #171c28;
  --bg-panel:     #0b1020;
  --bg-card:      #1c2236;
  --accent:       #3d8ef0;
  --accent-hover: #5aa0f5;
  --ok:           #4caf82;
  --err:          #e94560;
  --warn:         #f0c040;
  --text:         #dde2f0;
  --text-muted:   #6b7592;
  --border:       #252d44;
  --border-light: #1a2236;
  --martin-color: #f06a3d;
  --titiler-color: #9b6af0;
  --bg-toolbar:   rgba(11, 16, 32, 0.88);
  --bg-glass:     rgba(23, 28, 40, 0.82);
  --shadow-float: 0 4px 20px rgba(0,0,0,0.55), 0 1px 4px rgba(0,0,0,0.3);
  --shadow-heavy: 0 8px 32px rgba(0,0,0,0.7), 0 2px 8px rgba(0,0,0,0.4);
  --t-fast:       0.12s ease;
  --t-normal:     0.22s ease;
  --accent-glow:  rgba(61,142,240,0.18);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg-primary);
  color: var(--text);
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────── */
#header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 44px;
  flex-shrink: 0;
  z-index: 200;
}

#brand {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.8px;
  color: var(--accent);
  white-space: nowrap;
  flex-shrink: 0;
}

#aoi-badge {
  font-size: 11px;
  color: var(--text-muted);
  padding: 2px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 20px;
  transition: color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}

#aoi-badge.set {
  color: var(--ok);
  border-color: var(--ok);
}

#mode-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  color: var(--accent);
  padding: 2px 8px;
  border: 1px solid var(--accent);
  border-radius: 10px;
}

/* ── Status strip ───────────────────────────────────────── */
#status-strip {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
  justify-content: center;
}

.status-step {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 3px 8px;
  border-radius: 12px;
  transition: all var(--t-fast);
  user-select: none;
}

.status-step:hover { color: var(--text); background: var(--bg-card); }
.status-step.active { color: var(--text); background: var(--bg-card); }
.status-step.done .sstep-dot { background: var(--ok); }
.status-step.active .sstep-dot { background: var(--accent); }

.sstep-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  transition: background var(--t-fast);
}

.sstep-arrow {
  color: var(--border);
  font-size: 14px;
  line-height: 1;
  flex-shrink: 0;
}

/* ── Layout ─────────────────────────────────────────────── */
#main-content {
  display: flex;
  flex: 1;
  overflow: hidden;
  position: relative;
}

/* ── Map ────────────────────────────────────────────────── */
#map-container {
  flex: 0 0 75%;
  position: relative;
  display: flex;
  overflow: hidden;
}

#normal-map-wrap {
  position: relative;
  width: 100%;
  height: 100%;
}

#map { width: 100%; height: 100%; }

/* ── Compare split-map ──────────────────────────────────── */
#compare-maps-wrap {
  display: flex;
  width: 100%;
  height: 100%;
}

.compare-pane {
  flex: 1;
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#martin-map, #titiler-map {
  flex: 1;
  width: 100%;
}

.compare-label {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  background: rgba(11, 16, 32, 0.80);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  padding: 4px 14px;
  border-radius: 14px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  white-space: nowrap;
  pointer-events: none;
}

#martin-pane .compare-label { color: var(--martin-color); border-color: var(--martin-color); }
#titiler-pane .compare-label { color: var(--titiler-color); border-color: var(--titiler-color); }

.port-tag {
  font-family: 'Consolas', monospace;
  font-size: 10px;
  opacity: 0.7;
}

.compare-divider {
  width: 2px;
  background: var(--border);
  flex-shrink: 0;
  z-index: 5;
}

/* ── Map toolbar (icon stack) ───────────────────────────── */
#map-toolbar {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: var(--bg-toolbar);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 6px;
  box-shadow: var(--shadow-float);
}

.map-tool {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 7px;
  cursor: pointer;
  color: var(--text-muted);
  transition: background var(--t-fast), color var(--t-fast);
}

.map-tool svg {
  width: 16px;
  height: 16px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tool:hover { background: var(--bg-card); color: var(--text); }
.map-tool.active { background: var(--accent-glow); color: var(--accent); }

.map-tool-divider {
  height: 1px;
  background: var(--border);
  margin: 2px 4px;
}

/* ── Side panel ─────────────────────────────────────────── */
#side-panel {
  flex: 0 0 25%;
  min-width: 300px;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ── Compare layout: docked (default) vs floating ───────── */
#main-content.compare-active #map-container {
  flex: 1 1 auto;
  min-width: 0;
}

#main-content.compare-active.compare-panel-floating #map-container {
  flex: 1 1 100%;
}

#main-content.compare-active #side-panel.compare-docked {
  flex: 0 0 280px;
  width: 280px;
  min-width: 260px;
  max-width: 300px;
  position: relative;
  height: auto;
  border-left: 1px solid var(--border);
  background: var(--bg-secondary);
  border-radius: 0;
  box-shadow: none;
}

#side-panel.compare-floating {
  position: fixed;
  z-index: 200;
  width: 300px;
  max-height: min(72vh, calc(100vh - 56px));
  height: auto;
  left: 12px;
  bottom: 12px;
  top: auto;
  right: auto;
  flex: none;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: var(--shadow-heavy);
  background: rgba(15, 17, 23, 0.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

#main-content.compare-active .tab-btn:not([data-tab="compare"]) {
  display: none;
}

#main-content.compare-active #tab-bar .tab-btn[data-tab="compare"] {
  flex: 1;
  cursor: default;
}

/* ── Tab bar ────────────────────────────────────────────── */
#tab-bar {
  display: flex;
  height: 36px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.tab-btn {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--text-muted);
  font-size: 9px;
  cursor: pointer;
  transition: all var(--t-fast);
  padding: 0 4px;
}

.tab-btn:hover { color: var(--text); background: var(--bg-card); }
.tab-btn.active { color: var(--accent); border-bottom-color: var(--accent); background: var(--accent-glow); }

.tab-badge {
  display: inline-block;
  padding: 0 4px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 8px;
  font-weight: 700;
  color: var(--text-muted);
  margin-left: 2px;
  letter-spacing: 0;
  vertical-align: middle;
}

/* ── Compare HUD ────────────────────────────────────────── */
#compare-hud {
  padding: 8px 10px 6px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  background: transparent;
  flex-shrink: 0;
}

.hud-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.7px;
  text-transform: uppercase;
  color: var(--text-muted);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.panel-drag-handle {
  flex: 1;
  min-width: 0;
  cursor: grab;
  user-select: none;
  touch-action: none;
}

#side-panel.compare-docked .panel-drag-handle {
  cursor: default;
}

.panel-drag-handle:active {
  cursor: grabbing;
}

#btn-panel-dock-float[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
}

.btn-exit-compare {
  font-size: 10px;
  padding: 2px 8px;
  line-height: 1.4;
}
.btn-exit-compare:hover { border-color: var(--err); color: var(--err); }

.hud-row {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 0;
}

.hud-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}

.hud-name {
  font-size: 10px;
  font-weight: 600;
  color: var(--text);
  min-width: 44px;
}

.hud-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}

.hud-unit {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-right: 2px;
}

.hud-sep {
  color: var(--border);
  font-size: 11px;
  margin: 0 1px;
}

/* ── Tab panels ─────────────────────────────────────────── */
#tab-panels {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.tab-panel {
  display: none;
  height: 100%;
  overflow-y: auto;
  padding: 12px 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

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

.panel-hint {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 12px;
}

/* ── Panel footer ───────────────────────────────────────── */
#panel-footer {
  height: 32px;
  border-top: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 12px;
  flex-shrink: 0;
  gap: 8px;
}

#footer-dl-bar {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
}

.footer-track {
  flex: 1;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.footer-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s;
  width: 0%;
}

.footer-fill.done { background: var(--ok); }

#footer-dl-label {
  font-size: 10px;
  color: var(--text-muted);
  white-space: nowrap;
}

#footer-hint {
  font-size: 10px;
  color: var(--text-muted);
}

/* ── Form controls ──────────────────────────────────────── */
.form-row {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}

.form-group {
  flex: 1;
  margin-bottom: 12px;
}

.form-group:last-child { margin-bottom: 0; }

label {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 5px;
  letter-spacing: 0.2px;
}

input[type="date"],
input[type="number"] {
  width: 100%;
  padding: 7px 9px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 12px;
  border-radius: 5px;
  outline: none;
  transition: border-color 0.15s;
}

input[type="date"]:focus,
input[type="number"]:focus { border-color: var(--accent); }

input[type="range"] {
  width: 100%;
  accent-color: var(--accent);
  cursor: pointer;
  margin-top: 4px;
}

.sat-toggle { display: flex; gap: 7px; }

.sat-btn {
  flex: 1;
  padding: 7px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 5px;
  text-align: center;
  transition: all 0.15s;
}

.sat-btn.active {
  background: rgba(61,142,240,0.15);
  border-color: var(--accent);
  color: var(--accent);
}

/* ── Buttons ────────────────────────────────────────────── */
.btn-primary {
  width: 100%;
  padding: 10px;
  background: var(--accent);
  border: none;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border-radius: 6px;
  margin-top: 14px;
  transition: background 0.15s, opacity 0.15s;
}

.btn-primary:hover { background: var(--accent-hover); }
.btn-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-sm {
  padding: 4px 10px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 11px;
  cursor: pointer;
  border-radius: 4px;
  transition: border-color 0.15s, color 0.15s;
}

.btn-sm:hover { border-color: var(--accent); color: var(--text); }
.btn-sm.danger:hover { border-color: var(--err); color: var(--err); }

/* ── Dropzone ───────────────────────────────────────────── */
.dropzone {
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 20px;
  text-align: center;
  cursor: pointer;
  transition: border-color var(--t-fast), background var(--t-fast);
  margin-bottom: 12px;
}

.dropzone:hover,
.dropzone.drag-over { border-color: var(--accent); background: var(--accent-glow); }

.dropzone-icon { font-size: 24px; color: var(--text-muted); margin-bottom: 6px; }
.dropzone-label { font-size: 12px; color: var(--text-muted); }

.link-btn {
  background: none;
  border: none;
  color: var(--accent);
  cursor: pointer;
  font-size: inherit;
  text-decoration: underline;
  padding: 0;
}

/* ── AOI stats ──────────────────────────────────────────── */
.aoi-stats {
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-top: 4px;
}

.stat-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  padding: 3px 0;
  color: var(--text-muted);
}

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

/* ── Results ────────────────────────────────────────────── */
.result-controls {
  display: flex;
  gap: 7px;
  margin-bottom: 10px;
}

.result-list {
  max-height: 280px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  margin-bottom: 12px;
}

.result-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 8px 8px 10px;
  border-bottom: 1px solid var(--border-light);
  border-left: 2px solid transparent;
  transition: border-color 0.2s, background 0.2s;
  border-radius: 0 4px 4px 0;
}

.result-item:last-child { border-bottom: none; }

.result-item.is-queued    { border-left-color: var(--border); opacity: 0.6; }
.result-item.is-downloading { border-left-color: var(--accent); background: rgba(61,142,240,0.04); }
.result-item.is-complete  { border-left-color: var(--ok); }
.result-item.is-error     { border-left-color: var(--err); }

.result-item input[type="checkbox"] {
  accent-color: var(--accent);
  cursor: pointer;
  flex-shrink: 0;
  margin-top: 1px;
}

.result-item label {
  flex: 1;
  font-size: 11px;
  cursor: pointer;
  margin: 0;
  color: var(--text);
  letter-spacing: 0;
  font-weight: normal;
  line-height: 1.4;
  word-break: break-all;
  min-width: 0;
}

.result-meta {
  font-size: 10px;
  color: var(--text-muted);
  margin-top: 2px;
}

.item-status {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  font-size: 10px;
  color: var(--text-muted);
  min-width: 70px;
  justify-content: flex-end;
  white-space: nowrap;
}

.result-item.is-downloading .item-status { color: var(--accent); }
.result-item.is-complete    .item-status { color: var(--ok); }
.result-item.is-error       .item-status { color: var(--err); }

@keyframes spin { to { transform: rotate(360deg); } }

.spinner {
  display: inline-block;
  width: 11px;
  height: 11px;
  border: 1.5px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}

.tag {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 700;
  margin-right: 4px;
  letter-spacing: 0.3px;
}

.tag-s1 { background: rgba(76,175,130,0.15); color: var(--ok); }
.tag-s2 { background: rgba(61,142,240,0.15); color: var(--accent); }

/* ── Download summary bar ───────────────────────────────── */
.dl-summary {
  display: none;
  padding: 10px 12px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  margin-bottom: 10px;
}

.dl-summary.active { display: block; }

.dl-summary-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  margin-bottom: 8px;
}

#dl-label { color: var(--text-muted); }

.dl-count {
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
}

.dl-track {
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.dl-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.4s ease, background 0.4s;
  width: 0%;
}

.dl-fill.done { background: var(--ok); }

/* ── Storage / Files ────────────────────────────────────── */
.files-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.muted-label { font-size: 10px; color: var(--text-muted); }

.file-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--border-light);
}

.file-item:last-child { border-bottom: none; }

.file-name {
  flex: 1;
  font-size: 11px;
  font-family: 'Consolas', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--text);
}

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

.file-actions { display: flex; gap: 4px; flex-shrink: 0; }

/* ── Process pipeline (in files panel) ─────────────────── */
.process-pipeline {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  margin-top: 14px;
}

/* ── Empty state ────────────────────────────────────────── */
.empty-state {
  color: var(--text-muted);
  font-size: 12px;
  text-align: center;
  padding: 18px 0;
}

/* ── Compare panel controls ─────────────────────────────── */
.picker-row {
  display: flex;
  gap: 6px;
}

.panel-select {
  flex: 1;
  min-width: 0;
  padding: 6px 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  color: var(--text);
  font-size: 11px;
  border-radius: 5px;
  outline: none;
  cursor: pointer;
  transition: border-color 0.15s;
}

.panel-select:focus { border-color: var(--accent); }

.process-log {
  margin-top: 8px;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 8px 10px;
  font-size: 10px;
  font-family: 'Consolas', monospace;
  color: var(--text-muted);
  line-height: 1.6;
  max-height: 240px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}

.process-line { display: flex; align-items: center; gap: 6px; padding: 1px 0; }
.process-line.active { color: var(--accent); }
.process-line.done   { color: var(--ok); }
.process-line.err    { color: var(--err); }

.stage-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
  background: currentColor;
}

/* ── Metrics cards ──────────────────────────────────────── */
.metrics-card {
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  margin-bottom: 8px;
  background: var(--bg-panel);
}

.martin-card  { border-left: 3px solid var(--martin-color); }
.titiler-card { border-left: 3px solid var(--titiler-color); }

.metrics-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.server-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

.metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
}

.metric-cell {
  text-align: center;
  background: var(--bg-card);
  border-radius: 4px;
  padding: 6px 4px;
}

.metric-val {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  line-height: 1;
  margin-bottom: 2px;
}

.metric-lbl {
  font-size: 9px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.4px;
}

.subsection-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-top: 4px;
}

/* ── Load test ──────────────────────────────────────────── */
.load-test-block {
  border-top: 1px solid var(--border-light);
  padding-top: 12px;
  margin-top: 4px;
}

.lt-results { margin-top: 12px; }

.lt-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

.lt-table th {
  text-align: left;
  padding: 4px 6px;
  color: var(--text-muted);
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--border);
}

.lt-table td {
  padding: 5px 6px;
  color: var(--text);
  border-bottom: 1px solid var(--border-light);
  font-variant-numeric: tabular-nums;
}

.lt-table tr:last-child td { border-bottom: none; }
.lt-martin-row  td:first-child { color: var(--martin-color);  font-weight: 600; }
.lt-titiler-row td:first-child { color: var(--titiler-color); font-weight: 600; }

.sys-metrics-row {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border-light);
  position: relative;
}

.sys-metric-item {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 4px 6px;
  text-align: center;
}

.sys-metric-val {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.sys-metric-lbl {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-top: 3px;
}

.sys-metric-samples {
  position: absolute;
  top: 12px;
  right: 0;
  font-size: 9px;
  color: var(--text-muted);
}

/* ── Toast system ───────────────────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}

.toast {
  padding: 10px 18px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  box-shadow: var(--shadow-heavy);
  pointer-events: auto;
  max-width: 380px;
  border: 1px solid transparent;
  animation: toast-in 0.25s ease, toast-out 0.3s ease 2.7s forwards;
}

.toast-warn { background: var(--bg-card); border-color: var(--warn); color: var(--warn); }
.toast-err  { background: var(--bg-card); border-color: var(--err);  color: var(--err); }
.toast-ok   { background: var(--bg-card); border-color: var(--ok);   color: var(--ok); }
.toast-info { background: var(--bg-card); border-color: var(--border); color: var(--text); }

@keyframes toast-in  { from { opacity:0; transform: translateY(12px); } to { opacity:1; transform: translateY(0); } }
@keyframes toast-out { from { opacity:1; } to { opacity:0; } }
