/* Earth Evidence Atlas – styles (AI-generated with Claude; team review pending) */
:root {
  --bg: #f6f7f9; --panel: #ffffff; --ink: #17202a; --muted: #5d6b7a; --line: #dde3ea;
  --accent: #0b5cad; --accent-soft: #e6f0fa; --good: #1a7f37; --warn: #9a6700; --bad: #b42318;
  --on-accent: #ffffff;
  --spark: #d99a00; --spark-glow: rgba(217,154,0,.7);
  --tip-bg: rgba(12,18,26,.94); --tip-ink: #e6edf3; --tip-muted: #b4c0cc; --tip-line: rgba(255,255,255,.14);
  --shadow: 0 1px 2px rgba(16,24,40,.06), 0 1px 3px rgba(16,24,40,.08);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1419; --panel: #171e26; --ink: #e6edf3; --muted: #9aa7b4; --line: #2a3542;
    --accent: #5ea8ff; --accent-soft: #15283d; --good: #4ac26b; --warn: #d4a72c; --bad: #ff7b72;
    --on-accent: #08131f;
    --spark: #ffe7a3; --spark-glow: rgba(255,214,120,.9);
  }
}
@font-face { font-family: "Nasalization"; src: url("/static/fonts/nasalization.ttf") format("truetype"); font-display: swap; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
h1 { font-size: 22px; margin: 0; letter-spacing: -.01em; }
h3 { font-size: 15px; margin: 0 0 6px; }
h4 { font-size: 13px; margin: 14px 0 4px; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.top { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 0 20px; border-bottom: 1px solid var(--line); background: var(--panel); }
.brand h1 { position: relative; display: inline-block; font: 400 20px/1 "Nasalization", system-ui, sans-serif; letter-spacing: .04em;
  padding: 13px 0 11px; margin: 0; }
.logo-text { position: relative; }
/* one sparkle at a time travels along the edge of the logo (positions computed from the glyph outline in app.js) */
.spark { position: absolute; left: 0; top: 0; width: 14px; height: 14px; margin: -7px 0 0 -7px; pointer-events: none; opacity: 0;
  filter: drop-shadow(0 0 3px var(--spark-glow)); }
.spark::before { content: ""; position: absolute; inset: 0; background: var(--spark);
  clip-path: polygon(50% 0, 60% 40%, 100% 50%, 60% 60%, 50% 100%, 40% 60%, 0 50%, 40% 40%); }
.spark.go { animation: twinkle 1.1s ease-in-out forwards; }
@keyframes twinkle { 0% { opacity: 0; transform: scale(.1) rotate(0); } 45% { opacity: 1; transform: scale(1) rotate(45deg); }
  100% { opacity: 0; transform: scale(.1) rotate(90deg); } }
@media (prefers-reduced-motion: reduce) { .spark { display: none; } }
.tabs { display: flex; gap: 4px; }
.tab { display: inline-flex; align-items: center; gap: 7px; border: 0; background: none; padding: 13px 14px 12px; color: var(--muted); font: inherit; cursor: pointer;
  border-bottom: 3px solid transparent; }
.tab.active { color: var(--ink); border-color: var(--accent); font-weight: 600; }
.panel { display: none; padding: 16px 20px; max-width: 1500px; margin: 0 auto; }
.panel.active { display: block; }
.controls { display: grid; grid-template-columns: 1.6fr 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.step { display: flex; gap: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px;
  padding: 12px; box-shadow: var(--shadow); min-width: 0; }
.num { flex: none; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--on-accent);
  display: grid; place-items: center; font-weight: 700; font-size: 13px; }
.field { flex: 1; min-width: 0; }
.field > label { display: block; font-weight: 600; margin-bottom: 6px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 6px; }
.vcard { text-align: left; border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 8px;
  padding: 7px 9px; cursor: pointer; font: inherit; font-size: 13px; }
.vcard b { display: block; font-size: 12px; color: var(--muted); font-weight: 500; }
.vcard.on { border-color: var(--accent); background: var(--accent-soft); }
.vcard:disabled { opacity: .45; cursor: not-allowed; }
input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); min-width: 0; margin: 0; }
select, input:not([type=range]):not([type=checkbox]) { font: inherit; color: var(--ink); background: var(--panel); border: 1px solid var(--line);
  border-radius: 6px; padding: 5px 8px; max-width: 100%; }
#region { width: 100%; }
.row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.row.wrap { flex-wrap: wrap; }
.period-range { --thumb: 20px; position: relative; display: grid; align-items: center; margin-top: 8px; height: 32px; cursor: pointer; }
.period-track { position: absolute; inset: 13px calc(var(--thumb) / 2); border-radius: 999px;
  background: linear-gradient(to right, var(--line) var(--start), var(--accent) var(--start) var(--end), var(--line) var(--end)); }
.period-range input { grid-area: 1 / 1; width: 100%; height: 100%; appearance: none; pointer-events: none; }
.period-range input::-webkit-slider-thumb { appearance: none; width: var(--thumb); height: var(--thumb); border: 2px solid var(--accent);
  border-radius: 50%; background: var(--panel); pointer-events: auto; cursor: ew-resize; }
.period-range input::-moz-range-thumb { box-sizing: border-box; width: var(--thumb); height: var(--thumb); border: 2px solid var(--accent);
  border-radius: 50%; background: var(--panel); pointer-events: auto; cursor: ew-resize; }
.period-range input:focus-visible { outline: none; z-index: 1; }
.period-range input:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.period-range input:focus-visible::-moz-range-thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.period-limits { display: flex; justify-content: space-between; color: var(--muted); font-size: 12px; }
.seasons { flex-wrap: wrap; gap: 4px; }
.chip { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 3px 10px;
  cursor: pointer; font: inherit; font-size: 13px; }
.chip.on { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn, .ghost { display: inline-block; border: 1px solid var(--accent); background: var(--accent); color: var(--on-accent);
  border-radius: 6px; padding: 6px 12px; text-decoration: none; cursor: pointer; font: inherit; font-size: 14px; }
.ghost { background: transparent; color: var(--accent); }
.ghost.on { background: var(--accent-soft); }
.hint { color: var(--muted); font-size: 13px; margin: 6px 0 0; }
.grid { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; }
.grid2 { display: grid; grid-template-columns: 3fr 2fr; gap: 14px; margin-top: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; box-shadow: var(--shadow);
  min-width: 0; }
.cardhead { display: flex; justify-content: space-between; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.side { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.mapbox { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; box-shadow: var(--shadow);
  position: relative; min-width: 0; }
#map { height: 520px; border-radius: 8px; background: #dfe6ec; }
#map.drawing { cursor: crosshair; }
.maptools { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 13px; margin-top: 8px; }
.maptools .legend { margin: 0 0 0 8px; }
.legend { display: flex; align-items: center; gap: 8px; font-size: 12px; margin-top: 6px; flex-wrap: wrap; }
.legend .bar { height: 12px; width: 220px; border-radius: 3px; border: 1px solid var(--line); }
.legend .nd { width: 14px; height: 12px; border: 1px solid var(--line);
  background: repeating-linear-gradient(45deg, #bbb 0 2px, transparent 2px 5px); }
.chart { height: 300px; }
.chart.small { height: 180px; }
.result .verdict { border-left: 5px solid var(--muted); padding: 4px 0 4px 12px; margin-bottom: 10px; }
.result .verdict.trend_detected { border-color: var(--good); }
.result .verdict.depends_on_period { border-color: var(--warn); }
.result .verdict.ci_includes_zero { border-color: var(--muted); }
.result .verdict.insufficient_data { border-color: var(--bad); }
.verdict h2 { font-size: 18px; margin: 0 0 4px; }
.verdict p { margin: 0; color: var(--muted); font-size: 14px; }
.big { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.big small { font-size: 14px; font-weight: 500; color: var(--muted); }
.stats { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px 14px; margin-top: 10px; font-size: 13px; }
.stats div span { display: block; color: var(--muted); font-size: 12px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  margin-right: 4px; }
.source { font-size: 13px; }
.source ul { padding-left: 18px; margin: 4px 0; }
.banner { background: #fff4e5; color: #7a4b00; border: 1px solid #f0c27b; padding: 8px 14px; border-radius: 8px;
  font-weight: 700; letter-spacing: .03em; text-align: center; }
.sim-info { display: inline-block; margin-left: 4px; border-radius: 4px; cursor: help; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .banner { background: #2d2310; color: #f0c27b; } }
.sim { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; font-size: 14px; }
.sim div { background: var(--bg); padding: 8px; border-radius: 6px; }
.sim b { display: block; font-size: 18px; }
.prose { max-width: 900px; margin: 0 auto; }
.prose h2 { font-size: 18px; margin-top: 18px; }
.prose table { border-collapse: collapse; width: 100%; font-size: 13px; }
.prose td, .prose th { border-bottom: 1px solid var(--line); padding: 6px; text-align: left; vertical-align: top; }
/* ---------------- globe explorer */
.panel.globe-panel { max-width: none; padding: 0; position: relative; }
.panel.globe-panel { background: #010208; }
#globeMap { height: calc(100vh - var(--hdr, 48px)); min-height: 520px; background: transparent; position: relative; z-index: 1; }
#gStars { position: absolute; inset: 0; width: 100%; height: calc(100vh - var(--hdr, 48px)); min-height: 520px; z-index: 0; display: block; }
.gpanel { position: absolute; z-index: 5; background: rgba(12,18,26,.86); color: #e6edf3; border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px; padding: 14px; backdrop-filter: blur(6px); box-shadow: 0 8px 30px rgba(0,0,0,.35); }
.gpanel h3 { color: #fff; }
.gpanel input[type=range] { accent-color: #5ea8ff; }
.gpanel select, .gpanel input:not([type=range]):not([type=checkbox]) { background: #0f1720; color: #e6edf3; border-color: #2a3542; }
.gpanel .chip { background: #16202b; color: #dfe7ef; border-color: #2a3542; }
.gpanel .chip.on { background: #236bbd; border-color: #236bbd; color: #fff; }
.gpanel .hint, .ginfo { color: #b4c0cc; font-size: 12px; margin: 4px 0; }
.gpanel .tag { background: #15283d; color: #7cc4ff; }
.gleft { top: 14px; left: 14px; width: 330px; max-height: calc(100% - 28px); overflow: auto; }
.gright { top: 14px; right: 60px; width: 380px; max-height: calc(100% - 28px); overflow: auto; }
.glegend { bottom: 30px; left: 50%; transform: translateX(-50%); padding: 8px 14px; font-size: 12px; display: flex; flex-wrap: wrap;
  gap: 8px; align-items: center; justify-content: center; max-width: 560px; }
.glegend:empty { display: none; }
.gchips { flex-wrap: wrap; gap: 4px; }
.glegend .lrow { display: flex; gap: 8px; align-items: center; width: 100%; justify-content: center; }
.glegend .bar { height: 10px; width: 200px; border-radius: 3px; }
.glabel { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: #8fa3b8; margin: 12px 0 4px; }
.gpanel select { width: 100%; }
.ginline { font-size: 13px; }
.ginline input[type=range], #gYear { flex: 1; }
.btn.small { padding: 3px 10px; }
.gdraw { width: 100%; margin-top: 14px; color: #ffd166; border-color: #ffd166; justify-content: center; }
.gdraw.on { background: rgba(255,209,102,.15); }
#gGo { flex: none; }
.gclose { position: absolute; top: 8px; right: 8px; }
.gprog { margin-top: 10px; }
.gbar { height: 8px; background: #1d2935; border-radius: 4px; overflow: hidden; }
#gProgBar { height: 100%; width: 0; background: linear-gradient(90deg, #236bbd, #7cc4ff); transition: width .4s; }
.gpanel .verdict p, .gpanel .big small { color: #a9b6c3; }
.gpanel .verdict { margin-top: 12px; }
.gpanel a { color: #7cc4ff; }
@media (max-width: 900px) {
  .gleft, .gright { position: static; width: auto; max-height: none; border-radius: 0; }
  #globeMap, #gStars { height: 70vh; min-height: 360px; }
  .glegend { position: static; transform: none; max-width: none; border-radius: 0; }
}
a { color: var(--accent); }
.foot { color: var(--muted); font-size: 11px; line-height: 1.5; text-align: center; padding: 12px 16px 14px; }
body.on-globe .foot { display: none; }
.err { color: var(--bad); }
.leaflet-container { font: inherit; }
@media (max-width: 1000px) {
  .controls, .grid, .grid2 { grid-template-columns: 1fr; }
  #map { height: 380px; }
  .panel { padding: 12px 16px; }
  .sim { grid-template-columns: 1fr; }
}
/* narrow screens: tabs scroll sideways, wide tables scroll inside their box */
.tabs { overflow-x: auto; max-width: 100%; scrollbar-width: none; }
.tab { white-space: nowrap; }
.prose table { display: block; overflow-x: auto; }
@media (max-width: 600px) { .top { padding: 0 10px; gap: 0; } .brand h1 { font-size: 16px; padding: 6px 0 2px; } .tab { padding: 8px 10px; } }
input[type=range]:focus { outline: none; }
input[type=range]:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

/* ---------------- icons, icon buttons, segmented control */
.ic { width: 18px; height: 18px; flex: none; display: inline-block; vertical-align: -4px; }
.tab .ic { width: 17px; height: 17px; }
.ic.muted { color: var(--muted); }
.gpanel .ic.muted { color: #b4c0cc; }
.btn, .ghost { display: inline-flex; align-items: center; gap: 6px; }
.btn .ic { width: 16px; height: 16px; }
.ibtn { display: inline-grid; place-items: center; width: 34px; height: 34px; flex: none; border-radius: 8px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--ink); padding: 0; font: inherit; }
.ibtn:hover { border-color: var(--accent); color: var(--accent); }
.ibtn.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.gpanel .ibtn { background: #16202b; border-color: #2a3542; color: #dfe7ef; }
.gpanel .ibtn:hover { border-color: #5ea8ff; color: #fff; }
.gpanel .ibtn.on { background: #236bbd; border-color: #236bbd; color: #fff; }
.ghosticon, .gpanel .ghosticon { background: transparent; border-color: transparent; cursor: help; }
.seg { display: inline-flex; border-radius: 9px; overflow: hidden; border: 1px solid var(--line); }
.gpanel .seg { border-color: #2a3542; }
.seg .ibtn { border: 0; border-radius: 0; }
.seg .ibtn + .ibtn { border-left: 1px solid var(--line); }
.gpanel .seg .ibtn + .ibtn { border-left-color: #2a3542; }
.gtools { gap: 8px; margin-top: 10px; }
.grow { flex: 1; min-width: 0; }
.dim { opacity: .55; }
.num-out { min-width: 3.2em; text-align: right; font-variant-numeric: tabular-nums; }
.gleft { width: 300px; }
.gpanel .row select { flex: 1; min-width: 0; }
.gchips .chip { display: inline-flex; align-items: center; gap: 4px; }
.gchips .chip .ic { width: 14px; height: 14px; }
/* ---------------- one tooltip for globe, map, charts and buttons */
.tip { position: fixed; z-index: 1000; pointer-events: none; max-width: 280px; padding: 8px 10px; border-radius: 10px;
  background: var(--tip-bg); color: var(--tip-ink); border: 1px solid var(--tip-line); box-shadow: 0 8px 24px rgba(0,0,0,.28);
  backdrop-filter: blur(6px); font-size: 12.5px; line-height: 1.45; }
.tip .muted { color: var(--tip-muted); }
.tip .thead { font-weight: 600; margin-bottom: 3px; color: #fff; }
.tip .trow { display: flex; align-items: center; gap: 7px; }
.tip .trow i { width: 9px; height: 9px; border-radius: 50%; flex: none; }
.tip .trow b { margin-left: auto; padding-left: 12px; font-variant-numeric: tabular-nums; }
[data-tip] { cursor: default; }
button[data-tip] { cursor: pointer; }
.stats div[data-tip] { cursor: help; }
.gpanel .btn:not(.ghost) { background: #236bbd; border-color: #236bbd; color: #fff; }

/* on/off switch (show data on the globe) */
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: none; cursor: pointer; }
.switch input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: #2a3542; border: 1px solid #3a4756; transition: background .2s; }
.switch span::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #dfe7ef; transition: transform .2s; }
.switch input:checked + span { background: #236bbd; border-color: #236bbd; }
.switch input:checked + span::after { transform: translateX(16px); background: #fff; }
.switch input:focus-visible + span { outline: 2px solid #5ea8ff; outline-offset: 2px; }
.ibtn:disabled, input[type=range]:disabled { opacity: .4; cursor: not-allowed; }
.glabel { display: flex; align-items: center; gap: 6px; }
.glabel .ic { width: 13px; height: 13px; }
/* panels never scroll sideways: rows wrap and shrink */
.gpanel { overflow-x: hidden; }
.gleft { width: min(300px, calc(100% - 28px)); }
.gright { width: min(380px, calc(100% - 88px)); }
.gpanel .row { flex-wrap: wrap; min-width: 0; }
.gpanel .row > select { min-width: 0; flex: 1 1 120px; }
.gtools .grow { flex: 1 1 90px; }
@media (max-width: 900px) { .gleft, .gright { width: auto; } }
.gopacity { gap: 8px; margin-top: 6px; flex-wrap: nowrap !important; }
.gopacity input { flex: 1; }

/* ---------------- detective map tools */
.maptool { display: flex; flex-direction: column; gap: 6px; }
.maptool .ibtn, .maptool .btn { box-shadow: 0 1px 4px rgba(0,0,0,.25); align-self: flex-end; }
.maptool .btn { background: var(--panel); font-weight: 600; }
.maptool .btn.on { background: var(--accent); color: var(--on-accent); }
.drawbanner { position: absolute; z-index: 1000; top: 92px; left: 50%; transform: translateX(-50%); display: flex; align-items: center; gap: 10px;
  padding: 7px 8px 7px 12px; border-radius: 10px; background: var(--tip-bg); color: var(--tip-ink); border: 1px solid #ffd166;
  box-shadow: 0 6px 20px rgba(0,0,0,.3); font-size: 13px; width: max-content; max-width: calc(100% - 20px); }
.drawbanner .ic { color: #ffd166; }
.drawbanner .btn.ghost { color: #ffd166; border-color: #ffd166; padding: 2px 10px; font-size: 12px; }
#map.drawing { cursor: crosshair; outline: 2px solid #ffd166; outline-offset: -2px; }
#map.oncell { cursor: pointer; }
#map.drawing.oncell { cursor: crosshair; }
.gridimg { image-rendering: pixelated; image-rendering: crisp-edges; }
.ginline.small { font-size: 12px; color: var(--muted); gap: 8px; margin-top: 8px; }
.gpanel .ginline.small { color: #b4c0cc; }
.switch.light span { background: var(--line); border-color: var(--line); }
.switch.light input:checked + span { background: var(--accent); border-color: var(--accent); }
.chipx { display: inline-grid; place-items: center; width: 16px; height: 16px; margin: 0 -4px 0 2px; border-radius: 50%; opacity: .7; }
.chipx:hover { opacity: 1; background: rgba(255,255,255,.15); }
.chipx .ic { width: 10px; height: 10px; }

/* ---------------- answer to the selected question */
.answer { margin: 0 0 14px; border-left: 5px solid var(--muted); transition: opacity .2s; }
.answer[data-code="trend_detected"] { border-left-color: var(--good); }
.answer[data-code="depends_on_period"] { border-left-color: var(--warn); }
.answer[data-code="insufficient_data"] { border-left-color: var(--bad); }
.answer.loading #answerBody { opacity: .45; }
.answer-q { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.answer-q h2 { font-size: 15px; margin: 0; color: var(--muted); font-weight: 600; }
.answer-tag { font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent); }
.answer-head { font-size: 24px; font-weight: 700; letter-spacing: -.01em; margin: 4px 0 6px; }
.answer-lines { margin: 0; padding-left: 18px; line-height: 1.55; }
.answer-lines li + li { margin-top: 3px; }
.answer-lines li::marker { color: var(--muted); }
.answer-caveat { display: flex; gap: 8px; align-items: flex-start; margin: 10px 0 0; color: var(--muted); font-size: 13px; }
.answer-caveat .ic { width: 16px; height: 16px; margin-top: 1px; }
.answer-how { margin-top: 10px; font-size: 13px; }
.answer-how summary { cursor: pointer; color: var(--accent); font-weight: 600; width: max-content; }
.answer-how ul { margin: 6px 0 0; padding-left: 18px; color: var(--muted); }
.field > label.ginline { display: flex; align-items: center; font-weight: 400; margin: 8px 0 0; }
/* ---------------- alignment pass */
.vcard { display: flex; flex-direction: column; justify-content: flex-start; gap: 2px; }
.vcard b { margin-top: 1px; }
.switch.light span { background: #c3ccd6; border-color: #b3bdc8; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .switch.light span { background: #2a3542; border-color: #3a4756; } }
.switch.light input:checked + span { background: var(--accent); border-color: var(--accent); }
/* equal-height cards side by side; the map and the period matrix grow to fill their card */
#lab .row.wrap { gap: 10px 22px; }
#lab .ginline { gap: 8px; }
#lab .num-out { min-width: 2.2em; text-align: left; }
.step .field > label:first-child { line-height: 24px; margin-bottom: 8px; }
@media (max-width: 600px) {
  .brand h1 { font-size: 17px; padding: 12px 0 6px; }
  .tab { padding: 9px 8px 10px; gap: 5px; font-size: 13.5px; }
  .tab .ic { width: 15px; height: 15px; }
}
@media (max-width: 420px) { .tab .ic { display: none; } .tab { padding: 9px 9px 10px; } }
/* always keep the vertical scrollbar, so the header does not shift between tabs */
html { overflow-y: scroll; }
/* same weight on every tab: the active one is shown by colour and underline, so its width never changes */
.tab, .tab.active { font-weight: 600; }
.grid, .grid2 { align-items: stretch; }
.mapbox { display: flex; flex-direction: column; }
#map { flex: 1 1 auto; min-height: 520px; height: auto; }
.grid2 > .card:first-child { display: flex; flex-direction: column; }
.grid2 > .card:first-child #matrix { flex: 1 1 auto; min-height: 300px; height: auto; }
@media (max-width: 1000px) { #map { min-height: 380px; } }
/* switch colours: the "on" state must win over the dark-theme track colour */
.switch input:checked + span, .switch.light input:checked + span,
:root:not([data-theme="light"]) .switch.light input:checked + span { background: var(--accent); border-color: var(--accent); }
.gpanel .switch input:checked + span { background: #236bbd; border-color: #236bbd; }
.switch input:checked + span::after { background: #fff; }

/* Language settings remain available below every view, including the globe. */
:root { --language-height: 56px; }
body { padding-bottom: var(--language-height); }
.language-panel { position: fixed; z-index: 1100; inset: auto 0 0; min-height: var(--language-height);
  display: flex; align-items: center; justify-content: center; gap: 12px; padding: 8px 16px;
  background: var(--panel); color: var(--ink); border-top: 1px solid var(--line); }
.language-panel label { font-size: 13px; font-weight: 600; }
.language-panel select { width: auto; min-width: 140px; max-width: 50vw; }
.language-panel select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
#languageStatus { color: var(--bad); font-size: 12px; max-width: 300px; }
#languageStatus:empty { display: none; }
#globeMap, #gStars { height: calc(100vh - var(--hdr, 48px) - var(--language-height)); }
@media (max-width: 600px) {
  .language-panel { gap: 8px; padding: 8px 12px; }
  #languageStatus { max-width: 140px; font-size: 11px; }
}
