:root {
  --bg: #0e1116;
  --panel: #161a22;
  --panel-2: #1d2330;
  --fg: #e6e9ef;
  --muted: #8a93a6;
  --accent: #5fb87a;
  --accent-2: #f0a04b;
  --error: #e65f5f;
  --border: #232a38;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { height: 100%; }
body { margin: 0; padding: 0; min-height: 100%; background: var(--bg); color: var(--fg); display: flex; flex-direction: column; }
body.map-body { height: 100%; overflow: hidden; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Topbar ── */
.topbar {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0 1.25rem;
  height: 52px;
  flex-shrink: 0;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
}

.brand { display: flex; align-items: baseline; gap: 0.4rem; color: var(--fg); }
.brand:hover { text-decoration: none; }
.brand-mark { color: var(--accent); font-size: 1.2rem; line-height: 1; }
.brand-name { font-weight: 700; letter-spacing: 0.3px; }
.brand-sub { color: var(--muted); font-size: 0.78rem; display: none; }
@media (min-width: 900px) { .brand-sub { display: inline; } }

.nav-main { display: flex; gap: 0.25rem; }
.nav-utility { display: flex; gap: 0.5rem; align-items: center; margin-left: auto; }
.nav-main a, .nav-utility a {
  color: var(--muted); padding: 0.3rem 0.6rem; border-radius: 4px; font-size: 0.9rem;
  transition: color 0.15s, background 0.15s;
}
.nav-main a:hover, .nav-utility a:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.nav-main a.active { color: var(--fg); background: var(--panel-2); }
.nav-utility a.cta {
  background: var(--accent); color: #0e1116; font-weight: 600; padding: 0.3rem 0.8rem;
}
.nav-utility a.cta:hover { background: #6dc78a; }
.nav-utility a.cta.active { background: #6dc78a; }

.lang-switch { display: flex; gap: 0.25rem; align-items: center; font-size: 0.8rem; color: var(--muted); }
.lang-switch a { color: var(--muted); padding: 0.15rem 0.3rem; border-radius: 3px; }
.lang-switch a.active { color: var(--accent); }

/* ── Main / Footer ── */
body.page-body > main { flex: 1; }
body.map-body > main { flex: 1; overflow: hidden; min-height: 0; }

/* ── Console sub-nav (tabs across console pages) ── */
.console-tabs {
  display: flex;
  gap: 0.25rem;
  align-items: center;
  height: 36px;
  padding: 0 1.25rem;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  overflow-x: auto;
}
.console-tabs a {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 0.85rem;
  color: var(--muted);
  font-size: 0.85rem;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}
.console-tabs a:hover {
  color: var(--fg);
  text-decoration: none;
}
.console-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.sitefoot {
  padding: 1.25rem 2rem;
  background: var(--panel);
  border-top: 1px solid var(--border);
  font-size: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}
body.map-body .sitefoot { display: none; }

/* ── Container / Prose ── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1.5rem; }

.prose { padding: 2rem 0; }
.prose h1 { margin-top: 0; font-size: 2rem; }
.prose h2 { margin-top: 2.5rem; margin-bottom: 0.75rem; font-size: 1.1rem; }
.prose p { line-height: 1.7; }
.prose .lead { font-size: 1.1rem; color: var(--fg); line-height: 1.7; margin-bottom: 2rem; }
.prose ol, .prose ul { padding-left: 1.5rem; line-height: 1.8; }
.prose li { margin-bottom: 0.4rem; }
.prose code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.88em; background: var(--panel-2); padding: 0.1em 0.35em; border-radius: 3px; }
code.wrap { word-break: break-all; }

.breadcrumb { font-size: 0.85rem; color: var(--muted); margin-bottom: 1rem; display: flex; gap: 0.5rem; align-items: center; }
.breadcrumb a { color: var(--muted); }

.prose-nav { margin-top: 3rem; padding-top: 1.5rem; border-top: 1px solid var(--border); display: flex; gap: 1.5rem; flex-wrap: wrap; }

.principles-list li { margin-bottom: 1rem; }

/* Roadmap */
.roadmap { list-style: none; padding: 0; }
.roadmap li {
  padding: 0.9rem 1rem 0.9rem 1.25rem;
  border-left: 3px solid var(--border);
  margin-bottom: 0.75rem;
  line-height: 1.6;
}
.roadmap li.roadmap-done { border-left-color: var(--accent); }
.roadmap-phase { display: block; font-weight: 600; margin-bottom: 0.3rem; }
.roadmap-done .roadmap-phase { color: var(--accent); }

/* ── Console pages ── */
.page { padding: 1.5rem 2rem; max-width: 1200px; }
.page h1 { margin-top: 0; }
.page h2 { margin-top: 2rem; font-size: 1.05rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }

.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.error { color: var(--error); }

.filter-bar {
  display: flex; gap: 0.75rem; flex-wrap: wrap; align-items: end;
  background: var(--panel); padding: 0.75rem; border: 1px solid var(--border); border-radius: 6px;
  margin-bottom: 1rem;
}
.filter-bar label { display: flex; flex-direction: column; gap: 0.25rem; font-size: 0.85rem; color: var(--muted); }
.filter-bar label.grow { flex: 1 1 100%; }
.filter-bar input, .filter-bar select, .filter-bar textarea {
  background: var(--panel-2); color: var(--fg); border: 1px solid var(--border); border-radius: 4px;
  padding: 0.4rem 0.5rem; font-size: 0.9rem; font-family: inherit;
}
.filter-bar textarea { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; }
.filter-bar button {
  background: var(--accent); color: #0e1116; border: 0; border-radius: 4px;
  padding: 0.5rem 1rem; font-weight: 600; cursor: pointer;
}
.filter-bar button:hover { background: #6dc78a; }

.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.data th, .data td { padding: 0.6rem 0.75rem; text-align: left; border-bottom: 1px solid var(--border); font-size: 0.9rem; }
.data thead th { background: var(--panel-2); color: var(--muted); text-transform: uppercase; letter-spacing: 0.05em; font-size: 0.75rem; }

.map-shell { display: grid; grid-template-columns: 300px 1fr; height: 100%; }

.layer-panel {
  background: var(--panel); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; overflow-y: auto;
}
.layer-panel-section {
  padding: 0.75rem 0.875rem;
  border-bottom: 1px solid var(--border);
}
.layer-panel-section:last-child { border-bottom: none; flex: 1; }
.panel-section-title {
  margin: 0 0 0.5rem; font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.08em; color: var(--muted);
}

/* Basemap switcher */
.basemap-row { display: flex; gap: 0.4rem; }
.basemap-btn {
  flex: 1; padding: 0.3rem 0; background: var(--panel-2);
  color: var(--muted); border: 1px solid var(--border); border-radius: 4px;
  font-size: 0.8rem; cursor: pointer; transition: all 0.15s;
}
.basemap-btn.active, .basemap-btn:hover {
  background: var(--border); color: var(--fg);
}
.basemap-btn.active { border-color: var(--accent); color: var(--accent); }

/* Layer groups (collapsible, yvynation-inspired) */
.layer-group { border-bottom: 1px solid var(--border); }
.layer-group:last-child { border-bottom: none; }
.layer-group-hdr {
  width: 100%; background: none; border: none; color: var(--muted);
  text-align: left; padding: 0.45rem 0; font-size: 0.8rem; font-weight: 600;
  cursor: pointer; display: flex; align-items: center; gap: 0.4rem;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.layer-group-hdr:hover { color: var(--fg); }
.lg-arrow { font-size: 0.7rem; width: 0.9rem; text-align: center; }
.lg-count { margin-left: auto; background: var(--panel-2); color: var(--muted); padding: 0.05rem 0.4rem; border-radius: 999px; font-size: 0.65rem; }
.ee-hint { font-size: 0.75rem; color: var(--muted); padding: 0.5rem 0; line-height: 1.4; border-top: 1px dashed var(--border); margin-top: 0.5rem; }
.layer-group-body { padding-bottom: 0.25rem; }

.layer-row { padding: 0.2rem 0; }
.layer-toggle {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 0.85rem; cursor: pointer;
}
.layer-toggle input { flex-shrink: 0; }
.opacity-slider {
  width: 100%; margin: 0.15rem 0 0.35rem;
  accent-color: var(--accent);
}
.layer-sub-row { padding: 0.2rem 0 0.4rem; }
.sub-label { font-size: 0.8rem; color: var(--muted); display: flex; flex-direction: column; gap: 0.2rem; }
.layer-select {
  background: var(--panel-2); color: var(--fg);
  border: 1px solid var(--border); border-radius: 3px;
  padding: 0.2rem 0.4rem; font-size: 0.82rem;
}

/* Layer panel bottom links */
.layer-panel-links {
  display: flex; flex-direction: column; gap: 0.4rem; margin-top: auto;
}
.layer-panel-links a { font-size: 0.83rem; color: var(--muted); }
.layer-panel-links a:hover { color: var(--accent); }

.map { height: 100%; }

/* Inspect panel */
.inspect-panel {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 4px;
  padding: 0.5rem; font-size: 0.82rem; max-height: 40vh; overflow-y: auto;
  margin-top: 0.25rem;
}
.inspect-coord { color: var(--accent); font-size: 0.8rem; margin: 0 0 0.4rem; font-family: monospace; }
.inspect-section { margin-top: 0.6rem; }
.inspect-section h4 { margin: 0 0 0.3rem; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--muted); }

/* DETER popup */
.maplibregl-popup-content { background: var(--panel) !important; color: var(--fg) !important; border: 1px solid var(--border) !important; padding: 0.6rem !important; border-radius: 6px !important; }
.popup-content strong { display: block; margin-bottom: 0.35rem; color: var(--accent-2); font-size: 0.85rem; }
.popup-table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.popup-table td { padding: 0.15rem 0.25rem; }
.popup-table td:first-child { color: var(--muted); padding-right: 0.5rem; }

/* Imagery / console two-pane layout */
.imagery-shell {
  display: grid;
  grid-template-columns: minmax(420px, 520px) 1fr;
  height: 100%;
}
@media (max-width: 800px) {
  .imagery-shell { grid-template-columns: 1fr; grid-template-rows: 1fr 40vh; }
}
.imagery-panel {
  padding: 1.25rem 1.5rem;
  overflow-y: auto;
  border-right: 1px solid var(--border);
  background: var(--bg);
}
.imagery-panel h1 { margin-top: 0; font-size: 1.4rem; }

/* Map container — position:relative so overlays can anchor to it */
.imagery-map-wrap { position: relative; height: 100%; min-height: 400px; overflow: hidden; }
.imagery-map { width: 100%; height: 100%; }

/* Draw overlay */
.draw-overlay {
  position: absolute; inset: 0; z-index: 10;
  cursor: crosshair;
  background: rgba(14, 17, 22, 0.15);
}
.draw-rect {
  display: none;
  position: absolute;
  border: 2px solid #5fb87a;
  background: rgba(95, 184, 122, 0.15);
  pointer-events: none;
}
.draw-hint {
  position: absolute; bottom: 2.5rem; left: 50%; transform: translateX(-50%);
  background: rgba(14, 17, 22, 0.88); color: var(--fg);
  padding: 0.35rem 0.85rem; border-radius: 4px; font-size: 0.82rem;
  white-space: nowrap; pointer-events: none;
}

/* Crop download bar */
.crop-bar {
  position: absolute; bottom: 0.75rem; left: 50%; transform: translateX(-50%);
  z-index: 11;
  display: flex; align-items: center; gap: 0.6rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 6px;
  padding: 0.5rem 0.85rem; white-space: nowrap;
  box-shadow: 0 2px 12px rgba(0,0,0,0.5);
}

.btn-secondary-sm {
  background: var(--panel-2); color: var(--fg);
  border: 1px solid var(--border); border-radius: 4px;
  padding: 0.45rem 0.8rem; font-size: 0.85rem; cursor: pointer;
}
.btn-secondary-sm:hover { background: var(--border); }

/* Thumbnail action buttons */
.thumb-actions {
  display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.35rem;
}
.thumb-actions .btn-xs-primary,
.thumb-actions .btn-xs-muted { font-size: 0.75rem; padding: 0.2rem 0.55rem; }
.thumb-actions button:disabled { opacity: 0.5; cursor: not-allowed; }

.thumb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.75rem; }
.thumb { background: var(--panel); border: 1px solid var(--border); border-radius: 6px; overflow: hidden; }
.thumb img { width: 100%; height: 160px; object-fit: cover; display: block; background: #000; }
.thumb-placeholder { height: 160px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.thumb-meta { padding: 0.5rem; font-size: 0.8rem; display: flex; flex-direction: column; gap: 0.15rem; }
.thumb-meta strong { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.75rem; word-break: break-all; }

.maplibregl-popup-content { background: var(--panel); color: var(--fg); border: 1px solid var(--border); }

/* ── Landing page ── */
.landing-body { overflow-x: clip; }
.landing-body > main { flex: 1; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: 2.5rem;
  align-items: center;
  padding: 4rem 3rem 3.5rem;
  max-width: 1200px;
  margin: 0 auto;
}
@media (max-width: 800px) {
  .hero { grid-template-columns: 1fr; }
  .hero-map-preview { display: none; }
}
.hero-eyebrow { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--accent); margin: 0 0 1rem; }
.hero-title { font-size: clamp(1.8rem, 4vw, 2.8rem); line-height: 1.2; margin: 0 0 1.25rem; font-weight: 700; }
.hero-lede { color: var(--muted); font-size: 1.05rem; line-height: 1.7; margin: 0 0 2rem; }
.hero-actions { display: flex; gap: 0.75rem; flex-wrap: wrap; }

.btn-primary {
  display: inline-block; background: var(--accent); color: #0e1116;
  padding: 0.7rem 1.4rem; border-radius: 6px; font-weight: 700; font-size: 0.95rem;
  transition: background 0.15s;
}
.btn-primary:hover { background: #6dc78a; text-decoration: none; }
.btn-secondary {
  display: inline-block; background: var(--panel-2); color: var(--fg);
  padding: 0.7rem 1.4rem; border-radius: 6px; font-weight: 600; font-size: 0.95rem;
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: var(--border); text-decoration: none; }

/* Hero backdrop glow + screenshot frame */
.hero--glow {
  position: relative;
}
.hero--glow::before {
  content: ""; position: absolute; inset: -40% -20% auto;
  height: 130%; pointer-events: none; z-index: -1;
  background:
    radial-gradient(600px 380px at 72% 30%, rgba(95, 184, 122, 0.14), transparent 65%),
    radial-gradient(500px 320px at 18% 10%, rgba(240, 160, 75, 0.07), transparent 60%);
}
.hero-shot {
  display: block; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--border); background: var(--panel);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(95, 184, 122, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.hero-shot:hover {
  transform: translateY(-4px);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.55), 0 0 0 1px rgba(95, 184, 122, 0.25);
}
.hero-shot img { display: block; width: 100%; height: auto; }
.hero-shot-bar {
  display: flex; gap: 6px; padding: 9px 12px;
  background: var(--panel-2); border-bottom: 1px solid var(--border);
}
.hero-shot-bar i {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--border);
}
@media (max-width: 800px) {
  .hero-shot { display: none; }
}

/* Live ENSO chip */
.enso-chip {
  display: inline-flex; align-items: center; gap: 0.55rem;
  margin-top: 1.75rem; padding: 0.5rem 0.9rem;
  background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
  font-size: 0.85rem; color: var(--fg);
  transition: border-color 0.15s;
}
.enso-chip:hover { border-color: var(--accent); text-decoration: none; }
.enso-chip-label {
  text-transform: uppercase; letter-spacing: 0.08em; font-size: 0.68rem;
  color: var(--muted);
}
.enso-chip-value { color: var(--muted); }
.enso-chip-note { color: var(--muted); font-size: 0.75rem; }
.enso-chip-pulse {
  width: 9px; height: 9px; border-radius: 50%; background: var(--muted);
  animation: chip-pulse 2.4s ease-in-out infinite;
}
.enso-chip-pulse.is-warm { background: #e66767; }
.enso-chip-pulse.is-cool { background: #3987e5; }
@keyframes chip-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* Stats strip */
.stats-strip {
  border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
  background: var(--panel); padding: 1.5rem 0;
}
.stats-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem;
}
.stat-tile { display: flex; flex-direction: column; gap: 0.2rem; }
.stat-value { font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1.1; }
.stat-label { color: var(--muted); font-size: 0.85rem; line-height: 1.4; }

/* Screenshot showcase rows */
.showcase { display: flex; flex-direction: column; gap: 2.5rem; margin-bottom: 2.5rem; }
.showcase-row {
  display: grid; grid-template-columns: 3fr 2fr; gap: 2rem; align-items: center;
}
.showcase-row--flip .showcase-media { order: 2; }
.showcase-row--flip .showcase-copy { order: 1; }
@media (max-width: 800px) {
  .showcase-row, .showcase-row--flip { grid-template-columns: 1fr; }
  .showcase-row--flip .showcase-media { order: 0; }
}
.showcase-media {
  display: block; border-radius: 10px; overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s ease, border-color 0.25s ease;
}
.showcase-media:hover { transform: scale(1.015); border-color: var(--accent); }
.showcase-media img { display: block; width: 100%; height: auto; }
.showcase-copy h3 { margin: 0 0 0.6rem; font-size: 1.15rem; }
.showcase-copy p { color: var(--muted); font-size: 0.92rem; line-height: 1.65; margin: 0 0 1rem; }

.tools-grid--compact { margin-top: 0.5rem; }

/* Tools grid */
.tools-section { padding: 3rem 0; }
.section-title {
  font-size: 1.5rem; margin: 0 0 1.75rem; font-weight: 700;
}
.tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.tool-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem;
  transition: border-color 0.15s;
}
.tool-card:hover { border-color: var(--accent); }
.tool-icon { font-size: 1.6rem; line-height: 1; }
.tool-card h3 { margin: 0; font-size: 1rem; }
.tool-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0; flex: 1; }
.tool-links { display: flex; gap: 0.5rem; margin-top: 0.75rem; }
.btn-xs-primary {
  background: var(--accent); color: #0e1116; padding: 0.3rem 0.7rem;
  border-radius: 4px; font-size: 0.8rem; font-weight: 600;
}
.btn-xs-primary:hover { background: #6dc78a; text-decoration: none; }
.btn-xs-muted {
  background: var(--panel-2); color: var(--muted); padding: 0.3rem 0.7rem;
  border-radius: 4px; font-size: 0.8rem; border: 1px solid var(--border);
}
.btn-xs-muted:hover { color: var(--fg); text-decoration: none; }

/* Principles */
.principles-section {
  background: var(--panel);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 3.5rem 0;
}
.principles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.25rem;
  margin-bottom: 2rem;
}
.principle-card {
  background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.5rem;
}
.principle-card h3 { margin: 0 0 0.75rem; font-size: 1rem; color: var(--accent); }
.principle-card p { color: var(--muted); font-size: 0.9rem; line-height: 1.6; margin: 0; }
.principles-footer { display: flex; gap: 2rem; font-size: 0.9rem; }

/* Docs grid */
.docs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1.5rem 0 2.5rem;
}
.doc-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem;
  color: var(--fg); transition: border-color 0.15s;
}
.doc-card:hover { border-color: var(--accent); text-decoration: none; }
.doc-icon { font-size: 1.5rem; }
.doc-card h3 { margin: 0; font-size: 1rem; }
.doc-card p { color: var(--muted); font-size: 0.88rem; line-height: 1.5; margin: 0; flex: 1; }
.doc-cta { color: var(--accent); font-size: 0.85rem; margin-top: 0.5rem; }

.code-list { list-style: none; padding: 0; }
.code-list li { margin-bottom: 0.4rem; }

/* ── Sources card page ── */
.sources-page {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2.5rem;
  padding: 2rem 0;
  align-items: start;
}
@media (max-width: 860px) {
  .sources-page { grid-template-columns: 1fr; }
  .sources-toc { display: none; }
}

.sources-toc {
  position: sticky;
  top: 1rem;
  max-height: calc(100vh - 80px);
  overflow-y: auto;
}
.toc-title {
  font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.1em;
  color: var(--muted); margin: 0 0 0.75rem;
}
.sources-toc nav ul {
  list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.15rem;
}
.sources-toc nav li a {
  display: block; font-size: 0.85rem; color: var(--muted);
  padding: 0.2rem 0.5rem; border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.sources-toc nav li a:hover { color: var(--fg); background: var(--panel-2); text-decoration: none; }
.toc-divider { height: 1px; background: var(--border); margin: 0.4rem 0.5rem; }

.sources-main { min-width: 0; }
.sources-main .prose { padding-top: 0; }
.sources-main .prose h1 { margin-bottom: 0.5rem; }

.source-group { margin-top: 2.5rem; scroll-margin-top: 1rem; }
.source-group-title { font-size: 1.1rem; font-weight: 700; margin: 0 0 1rem; }
.source-group-intro { color: var(--muted); font-size: 0.92rem; margin: -0.5rem 0 1rem; }
.planned-section { border-top: 1px dashed var(--border); padding-top: 2rem; }

.source-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
}

.source-card {
  background: var(--panel); border: 1px solid var(--border); border-radius: 8px;
  padding: 1.1rem 1.25rem; display: flex; flex-direction: column; gap: 0.55rem;
  transition: border-color 0.15s;
}
.source-card:hover { border-color: rgba(95, 184, 122, 0.4); }
.source-card--planned { opacity: 0.75; }
.source-card--planned:hover { opacity: 1; }

.source-card-hdr {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 0.5rem;
}
.source-card-hdr h3 { margin: 0; font-size: 0.97rem; line-height: 1.3; flex: 1; }

.source-status {
  font-size: 0.68rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.07em;
  padding: 0.15rem 0.5rem; border-radius: 999px; white-space: nowrap; flex-shrink: 0;
}
.status-live    { background: rgba(95, 184, 122, 0.15); color: #5fb87a; border: 1px solid rgba(95, 184, 122, 0.35); }
.status-ee      { background: rgba(66, 133, 244, 0.15); color: #7ab4f5; border: 1px solid rgba(66, 133, 244, 0.35); }
.status-stub    { background: rgba(240, 160, 75, 0.12); color: #f0a04b; border: 1px solid rgba(240, 160, 75, 0.3); }
.status-planned { background: rgba(138, 147, 166, 0.12); color: var(--muted); border: 1px solid var(--border); }

.source-meta {
  display: flex; align-items: center; gap: 0.4rem;
  font-size: 0.8rem; color: var(--muted); flex-wrap: wrap;
}
.source-sep { opacity: 0.4; }
.source-kind { font-size: 0.78rem; background: var(--panel-2); padding: 0.05em 0.35em; border-radius: 3px; }
.source-kind-plain { font-size: 0.8rem; }

.source-endpoint {
  background: var(--panel-2); border-radius: 4px; padding: 0.3rem 0.5rem;
  font-size: 0.75rem; overflow: hidden;
}
.source-endpoint code { word-break: break-all; color: var(--muted); }

.source-desc {
  margin: 0; font-size: 0.87rem; line-height: 1.6; color: var(--fg); opacity: 0.85;
}

.source-detail {
  font-size: 0.82rem; line-height: 1.5; color: var(--muted); display: flex; gap: 0.4rem; flex-wrap: wrap;
}
.detail-label { color: var(--muted); opacity: 0.7; font-weight: 600; flex-shrink: 0; }

.source-links { display: flex; gap: 0.4rem; flex-wrap: wrap; margin-top: 0.25rem; }

/* Sources table (legacy, keep for any fallback) */
.sources-table td.small { font-size: 0.82rem; }

/* Utilities missing from earlier */
.climate-summary h3 { margin: 0 0 0.75rem; font-size: 0.95rem; color: var(--muted); }
.climate-block, .imagery-block { margin-top: 0.5rem; }
