/* Orbis — an explorable atlas.
   Layout: the globe fills the screen; controls float over it as instrument panels.
   Light theme is a paper atlas; dark theme is a night observatory with brass fittings. */

:root {
  /* surfaces & ink */
  --bg: #e6ecf0;
  --bg-2: #d5dfe6;
  --panel: rgba(251, 251, 248, 0.94);
  --panel-solid: #fbfbf8;
  --panel-2: #f0eee6;
  --line: rgba(28, 36, 48, 0.12);
  --line-strong: rgba(28, 36, 48, 0.24);
  --ink: #172030;
  --ink-2: #46505f;
  --muted: #6b7482;
  --shadow: 0 12px 32px rgba(28, 40, 60, 0.16), 0 1px 2px rgba(28, 40, 60, 0.08);

  /* accents */
  --accent: #94650f;
  --accent-ink: #7a520c;
  --accent-soft: rgba(148, 101, 15, 0.12);
  --on-accent: #fffaf0;
  --event: #c2502c;
  --landmark: #23756e;
  --park: #3d8a3a;
  --wreck: #5b3f8c;
  --volcano: #8f1d3a;
  /* the Moon: its surface is a photograph, the same in both themes, so most of its colors are too.
     Landing sites: validated categorical slots against the Moon's mid-grey (all pairs). */
  --moon-glow: rgba(60, 62, 72, 0.12);
  --moon-rim: rgba(28, 30, 38, 0.5);
  --moon-fill: #8b8882;
  --moon-grat: rgba(255, 255, 255, 0.2);
  --moon-grat-strong: rgba(255, 255, 255, 0.45);
  --moon-grat-label: #f4f1e8;
  --moon-label: #f7f4ea;
  --moon-sea-label: #fff1cf;
  --moon-label-halo: rgba(12, 12, 16, 0.78);
  --moon-hover: rgba(255, 255, 255, 0.85);
  --moon-mount: #ddd6c6;
  --moon-site-crewed: #e9a400;
  --moon-site-robot: #2aa9cc;
  --moon-site-impact: #e24d8a;
  --moon-lit: #e9e4d4;
  --moon-dark: #3b3e4a;
  --mars-glow: rgba(150, 80, 48, 0.14);
  --mars-rim: rgba(60, 28, 16, 0.5);
  --mars-fill: #a9643f;
  --mars-site-rover: #e9a400;
  --mars-site-lander: #2aa9cc;
  --mars-site-crash: #e24d8a;
  --mercury-glow: rgba(120, 115, 110, 0.14);
  --mercury-rim: rgba(50, 45, 40, 0.45);
  --mercury-fill: #9a948c;
  --mercury-site-crash: #e24d8a;
  --venus-glow: rgba(220, 170, 90, 0.16);
  --venus-rim: rgba(90, 55, 20, 0.45);
  --venus-fill: #d9a860;
  --venus-site-lander: #2aa9cc;
  --venus-site-probe: #7c5cd6;
  --jupiter-glow: rgba(150, 120, 80, 0.14);
  --jupiter-rim: rgba(60, 45, 25, 0.45);
  --jupiter-fill: #c9b08a;
  --saturn-glow: rgba(150, 130, 90, 0.14);
  --saturn-rim: rgba(60, 50, 30, 0.45);
  --saturn-fill: #d8c79e;
  --saturn-ring-c: rgba(140, 126, 104, 0.4);
  --saturn-ring-b: rgba(226, 210, 176, 0.88);
  --saturn-ring-a: rgba(206, 190, 158, 0.74);
  --saturn-ring-f: rgba(222, 212, 190, 0.55);
  --saturn-ring-gap: rgba(120, 108, 90, 0.16);
  --uranus-glow: rgba(120, 180, 190, 0.16);
  --uranus-rim: rgba(40, 90, 100, 0.45);
  --uranus-fill: #b7dde2;
  --uranus-ring: rgba(70, 100, 110, 0.35);
  --uranus-ring-eps: rgba(70, 100, 110, 0.6);
  --neptune-glow: rgba(100, 150, 200, 0.16);
  --neptune-rim: rgba(30, 60, 100, 0.45);
  --neptune-fill: #7fb0d5;
  --neptune-ring: rgba(80, 110, 150, 0.4);
  --pluto-glow: rgba(150, 130, 120, 0.14);
  --pluto-rim: rgba(60, 45, 40, 0.45);
  --pluto-fill: #a89a90;
  --pluto-heart: #ebe4dc;
  --charon-glow: rgba(140, 135, 135, 0.14);
  --charon-rim: rgba(55, 50, 50, 0.45);
  --charon-fill: #9c9694;
  --charon-cap: #6b4a44;
  --satellite-glow: rgba(140, 140, 150, 0.14);
  --satellite-rim: rgba(50, 50, 60, 0.45);
  --satellite-fill: #9a9aa2;
  --sun-fill: #f6c85a;
  --sun-corona: rgba(255, 190, 90, 0.34);
  --sun-corona-2: rgba(255, 170, 70, 0.1);
  --sun-limb-0: #ffffff;
  --sun-limb-1: #eadfc8;
  --sun-limb-2: #c49a62;
  --sun-limb-3: #8f5a2a;
  --sun-rim: rgba(200, 90, 40, 0.55);
  --sun-hint: rgba(255, 196, 110, 0.28);
  --sun-mark: rgba(70, 40, 10, 0.75);
  --sun-earth-mark: #1f6fd0;
  --sun-band: rgba(140, 70, 20, 0.1);
  --sun-region: rgba(70, 35, 10, 0.8);
  --sun-region-ring: rgba(150, 70, 20, 0.55);
  --sun-label: #3a2208;
  --sun-label-halo: rgba(255, 240, 210, 0.75);
  /* plate boundaries: validated categorical slots 1-3 (all pairs) */
  --plate-div: #2a78d6;
  --plate-conv: #eb6834;
  --plate-trans: #1baf7a;
  /* climate zones (Köppen–Geiger groups A–E), validated all-pairs against each other */
  /* My travels (validated categorical slots 1-3, all pairs) */
  --trav-been: #2a78d6;
  --trav-lived: #1baf7a;
  --trav-want: #eb6834;
  /* five qualitative colors validated all-pairs (language and religion maps) */
  --qual-1: #008300;
  --qual-2: #eda100;
  --qual-3: #e87ba4;
  --qual-4: #6250d6;
  --qual-5: #6ab0f0;
  --clim-1: #008300;
  --clim-2: #eda100;
  --clim-3: #e87ba4;
  --clim-4: #6250d6;
  --clim-5: #6ab0f0;
  --iceage-land: #ddd3ad;
  --iceage-coast: #a99467;
  --iceage-label: #6f5f3c;
  --current-warm: #c8381e;
  --bigquake: #8b2fa0;
  --current-cold: #1d4fb8;
  --wind: #5d6372;
  /* time zones: washes over the map, so they read on any fill */
  --tz-sea: rgba(20, 45, 80, 0.1);
  --tz-odd: rgba(25, 25, 35, 0.13);
  --tz-frac: rgba(148, 101, 15, 0.24);
  --tz-line: rgba(25, 25, 35, 0.55);
  --good: #1d7a3b;
  --bad: #bf3a2b;
  --series-1: #2a78d6;
  --series-2: #eb6834;
  --cat-politics: #2a78d6;
  --cat-war: #e34948;
  --cat-science: #1baf7a;
  --cat-exploration: #eb6834;
  --cat-culture: #e87ba4;
  --cat-religion: #6250d6;
  --cat-disaster: #eda100;
  --cat-economy: #008300;

  /* globe */
  --globe-ocean: #a3c2d6;
  --globe-ocean-2: #d2e3ee;
  --globe-glow: rgba(255, 255, 255, 0.8);
  --globe-rim: rgba(40, 70, 100, 0.35);
  --globe-border: rgba(95, 85, 66, 0.55);
  --globe-coast: rgba(52, 86, 116, 0.6);
  --globe-grat: rgba(40, 70, 100, 0.15);
  --globe-tropic: rgba(140, 90, 20, 0.6);
  --globe-night: #0b1730;
  --globe-label: #262b33;
  --globe-halo: rgba(250, 248, 240, 0.92);
  --globe-sea-label: #3a6585;
  --globe-water-label: #2f6a9a;
  --globe-phys-label: #75552f;
  --globe-admin: rgba(80, 70, 52, 0.6);
  --globe-admin-casing: rgba(255, 252, 240, 0.35);
  --globe-admin-label: #5e513c;
  --globe-city: #1f2732;
  --globe-peak: #75552f;
  --globe-river: #4f86b0;
  --globe-lake: #b6d1e2;
  --globe-desert: #e5c68b;
  --globe-range: #b29674;
  --globe-range-line: rgba(110, 78, 40, 0.2);
  /* shaded relief: hillshade shadow and light (slopes lit from the northwest) */
  --relief-shadow: rgba(72, 52, 32, 0.5);
  --relief-light: rgba(255, 252, 240, 0.55);
  /* terrain overlay over political or data-map fills, by height: 0, 200, 500, 1000, 2000, 3500, 5000 m */
  --relief-0: rgba(178, 209, 159, 0);
  --relief-200: rgba(204, 214, 158, 0.06);
  --relief-500: rgba(222, 214, 150, 0.12);
  --relief-1000: rgba(214, 190, 120, 0.2);
  --relief-2000: rgba(190, 150, 90, 0.3);
  --relief-3500: rgba(160, 118, 72, 0.4);
  --relief-5000: rgba(236, 232, 224, 0.5);
  /* Physical map: land by height, same stops (green lowland, yellow-tan plateaus, brown, snow) */
  --hyps-0: #b2d19f;
  --hyps-200: #c9d9a1;
  --hyps-500: #dfdaa4;
  --hyps-1000: #dac891;
  --hyps-2000: #c9a872;
  --hyps-3500: #aa865a;
  --hyps-5000: #e9e4da;
  /* sea by depth, over --globe-ocean: 0, 200, 1000, 3000, 6000 m */
  --bathy-0: rgba(232, 245, 250, 0.1);
  --bathy-200: rgba(70, 130, 195, 0.06);
  --bathy-1000: rgba(70, 130, 195, 0.22);
  --bathy-3000: rgba(70, 130, 195, 0.38);
  --bathy-6000: rgba(70, 130, 195, 0.52);
  --globe-hover: rgba(255, 255, 255, 0.42);
  --globe-select: rgba(214, 160, 60, 0.38);
  --globe-dim: rgba(205, 210, 214, 0.72);
  --land-1: #eee4c9;
  --land-2: #e3e8cf;
  --land-3: #efdcc6;
  --land-4: #e2e2cb;
  --land-5: #eadfcd;
  --land-6: #dfe6d6;
  --land-7: #ede6d3;
  /* sequential (magnitude): one hue, light -> dark */
  --seq-0: #fde6d0;
  --seq-1: #fbcda4;
  --seq-2: #f6ad76;
  --seq-3: #ec8a4b;
  --seq-4: #d5682b;
  --seq-5: #aa4b18;
  --seq-6: #7a320d;
  --seq-none: #e4e2db;
  /* historical polities */
  --hist-1: #e6c79c;
  --hist-2: #bccf9f;
  --hist-3: #aec6db;
  --hist-4: #dbb3b9;
  --hist-5: #cbc0e0;
  --hist-6: #e2d598;
  --hist-7: #a9d0c4;
  --hist-8: #d8ba9c;
  --hist-wild: #ece6d6;
  /* live layers */
  --live-air: #3d4a5c;
  --live-mil: #1e7a34;
  --live-alert: #d42a1f;
  --live-ship: #0a5fa8;
  --live-custom: #7b3fe0;
  --live-quake: #c43d14;
  --live-hazard: #8a6d1d;
  --live-fire: #e0560b;
  --live-storm: #5f3dc4;
  --live-volcano: #b8174f;
  --live-ice: #0c8599;
  --live-flood: #1864ab;
  --live-conflict: #c41d1d;
  --live-flash: #d9650b;
  --live-crisis: #8a2ba3;
  --live-event: #1c6dc2;
  --live-note: #4b5563;
  --live-choke: #0b6e80;
  --live-sat: #b0158f;
  --live-launch: #a86a12;
  --live-aurora: #129a52;
  /* temperature classes, ≤ −20 °C to > 30 °C */
  --temp-1: #2c5fb8;
  --temp-2: #3f8ad1;
  --temp-3: #6fb3d9;
  --temp-4: #7fb98c;
  --temp-5: #d9a92e;
  --temp-6: #e2772e;
  --temp-7: #c4302b;
  /* main export type (categorical map) and trade flows */
  --exp-manuf: #2a78d6;
  --exp-fuels: #eb6834;
  --exp-raw: #1baf7a;
  --trade-flow: #1d2b45;
  --export-badge: rgba(255, 252, 244, 0.94);
  --export-badge-ring: rgba(80, 64, 40, 0.55);

  /* type */
  --font-display: "Cormorant Garamond", "Cormorant", Garamond, "Iowan Old Style", "Times New Roman", serif;
  --font-ui: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  --fs-xs: 0.75rem;
  --fs-sm: 0.8125rem;
  --fs-md: 0.9375rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.6rem;
  --fs-2xl: 2.2rem;

  /* layout */
  --gap: 16px;
  --top-h: 60px;
  --panel-w: 400px;
  --radius: 14px;
  --radius-sm: 9px;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #050911;
    --bg-2: #0b1325;
    --panel: rgba(11, 17, 31, 0.9);
    --panel-solid: #0d1527;
    --panel-2: rgba(255, 255, 255, 0.045);
    --line: rgba(255, 255, 255, 0.09);
    --line-strong: rgba(255, 255, 255, 0.2);
    --ink: #ece6d6;
    --ink-2: #b6bdcb;
    --muted: #8a94a6;
    --shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
    --accent: #e2b155;
    --accent-ink: #f0c877;
    --accent-soft: rgba(226, 177, 85, 0.14);
    --on-accent: #1b1406;
    --event: #ff8f6b;
    --landmark: #6fd0c4;
    --park: #7fd47a;
    --wreck: #c9a6ff;
    --volcano: #e8284a;
    --moon-glow: rgba(225, 225, 215, 0.14);
    --moon-rim: rgba(230, 228, 220, 0.35);
    --moon-dark: #20232d;
    --mars-glow: rgba(235, 140, 100, 0.16);
    --mars-rim: rgba(245, 200, 175, 0.35);
    --jupiter-glow: rgba(240, 210, 160, 0.16);
    --jupiter-rim: rgba(245, 225, 190, 0.32);
    --saturn-glow: rgba(240, 220, 170, 0.16);
    --saturn-rim: rgba(245, 230, 195, 0.32);
    --mercury-glow: rgba(200, 195, 190, 0.14);
    --mercury-rim: rgba(230, 225, 220, 0.3);
    --venus-glow: rgba(255, 205, 130, 0.18);
    --venus-rim: rgba(255, 225, 180, 0.32);
    --uranus-glow: rgba(160, 220, 230, 0.16);
    --uranus-rim: rgba(200, 240, 245, 0.3);
    --uranus-ring: rgba(190, 215, 220, 0.3);
    --uranus-ring-eps: rgba(210, 230, 235, 0.6);
    --neptune-glow: rgba(140, 190, 240, 0.16);
    --neptune-rim: rgba(190, 220, 250, 0.3);
    --neptune-ring: rgba(190, 215, 240, 0.4);
    --pluto-glow: rgba(220, 200, 190, 0.14);
    --pluto-rim: rgba(235, 225, 220, 0.3);
    --charon-glow: rgba(210, 205, 205, 0.14);
    --charon-rim: rgba(230, 225, 225, 0.3);
    --satellite-glow: rgba(205, 205, 215, 0.14);
    --satellite-rim: rgba(225, 225, 235, 0.3);
    --sun-corona: rgba(255, 180, 80, 0.4);
    --sun-corona-2: rgba(255, 150, 60, 0.12);
    --sun-hint: rgba(255, 180, 90, 0.2);
    --plate-div: #3987e5;
    --plate-conv: #d95926;
    --plate-trans: #199e70;
    --trav-been: #3987e5;
    --trav-lived: #199e70;
    --trav-want: #d95926;
    --qual-1: #2a7d1a;
    --qual-2: #d99a10;
    --qual-3: #d55181;
    --qual-4: #6f5fd8;
    --qual-5: #8cc8f5;
    --clim-1: #2a7d1a;
    --clim-2: #d99a10;
    --clim-3: #d55181;
    --clim-4: #6f5fd8;
    --clim-5: #8cc8f5;
    --iceage-land: #3e4a3b;
    --iceage-coast: #7f8f68;
    --iceage-label: #c9c3a3;
  --current-warm: #ff7d5e;
  --bigquake: #d68cff;
  --current-cold: #74ccff;
  --wind: #b8bfcc;
    --current-warm: #ff7d5e;
    --bigquake: #d68cff;
    --current-cold: #74ccff;
    --wind: #b8bfcc;
    --tz-sea: rgba(255, 255, 255, 0.045);
    --tz-odd: rgba(255, 255, 255, 0.13);
    --tz-frac: rgba(232, 182, 90, 0.26);
    --tz-line: rgba(240, 235, 220, 0.6);
    --good: #53c98a;
    --bad: #ff6b5e;
    --series-1: #3987e5;
    --series-2: #d95926;
    --cat-politics: #3987e5;
    --cat-war: #e66767;
    --cat-science: #199e70;
    --cat-exploration: #d95926;
    --cat-culture: #d55181;
    --cat-religion: #9085e9;
    --cat-disaster: #c98500;
    --cat-economy: #2e9b2e;
    --globe-ocean: #0a1f3d;
    --globe-ocean-2: #1d4a77;
    --globe-glow: rgba(90, 150, 255, 0.3);
    --globe-rim: rgba(140, 190, 255, 0.4);
    --globe-border: rgba(6, 10, 18, 0.62);
    --globe-coast: rgba(170, 205, 235, 0.4);
    --globe-grat: rgba(170, 200, 255, 0.13);
    --globe-tropic: rgba(226, 177, 85, 0.6);
    --globe-night: #000510;
    --globe-label: #f1ebdc;
    --globe-halo: rgba(5, 9, 18, 0.82);
    --globe-sea-label: #93badf;
    --globe-water-label: #8fc2ee;
    --globe-phys-label: #dcbd8d;
    --globe-admin: rgba(236, 226, 200, 0.45);
    --globe-admin-casing: rgba(6, 10, 18, 0.35);
    --globe-admin-label: #d6cbb3;
    --globe-city: #f6f0e1;
    --globe-peak: #dcbd8d;
    --globe-river: #6aa8de;
    --globe-lake: #12355e;
    --globe-desert: #8d6f3f;
    --globe-range: #6e5b47;
    --globe-range-line: rgba(222, 190, 140, 0.15);
    --relief-shadow: rgba(2, 6, 16, 0.62);
    --relief-light: rgba(255, 236, 196, 0.28);
    --relief-0: rgba(60, 90, 70, 0);
    --relief-200: rgba(84, 104, 62, 0.06);
    --relief-500: rgba(122, 120, 72, 0.12);
    --relief-1000: rgba(152, 134, 86, 0.2);
    --relief-2000: rgba(178, 152, 102, 0.28);
    --relief-3500: rgba(202, 178, 132, 0.36);
    --relief-5000: rgba(228, 228, 222, 0.42);
    --hyps-0: #2e4b39;
    --hyps-200: #3a5439;
    --hyps-500: #585f38;
    --hyps-1000: #6c603b;
    --hyps-2000: #806d48;
    --hyps-3500: #9e8a65;
    --hyps-5000: #d2cec1;
    --bathy-0: rgba(140, 190, 235, 0.06);
    --bathy-200: rgba(6, 14, 54, 0.06);
    --bathy-1000: rgba(6, 14, 54, 0.2);
    --bathy-3000: rgba(6, 14, 54, 0.36);
    --bathy-6000: rgba(6, 14, 54, 0.48);
    --globe-hover: rgba(255, 255, 255, 0.15);
    --globe-select: rgba(226, 177, 85, 0.34);
    --globe-dim: rgba(5, 9, 18, 0.62);
    --land-1: #4e5b47;
    --land-2: #58583f;
    --land-3: #4a5b52;
    --land-4: #5c5345;
    --land-5: #53593f;
    --land-6: #485347;
    --land-7: #5b5b4c;
    --seq-0: #3a2b21;
    --seq-1: #58321b;
    --seq-2: #7d3f17;
    --seq-3: #a65015;
    --seq-4: #cf691d;
    --seq-5: #ef8d43;
    --seq-6: #fdb87f;
    --seq-none: #2b3037;
    --hist-1: #6c5a3f;
    --hist-2: #4f6a45;
    --hist-3: #42607f;
    --hist-4: #7b4c56;
    --hist-5: #5e5583;
    --hist-6: #776d3d;
    --hist-7: #3e6f65;
    --hist-8: #76573e;
    --hist-wild: #363c38;
    --live-air: #d5deea;
    --live-mil: #79e08a;
    --live-alert: #ff5c50;
    --live-ship: #4fc3ff;
    --live-custom: #c39bff;
    --live-quake: #ff8a5c;
    --live-hazard: #e5c46b;
    --live-fire: #ff9a3c;
    --live-storm: #b39dff;
    --live-volcano: #ff7aa8;
    --live-ice: #6ee0f0;
    --live-flood: #74b4ff;
    --live-conflict: #ff5f5f;
    --live-flash: #ffae4f;
    --live-crisis: #e08bff;
    --live-event: #7ab8ff;
    --live-note: #c4cad3;
    --live-choke: #4dd8e6;
    --live-sat: #f47fd6;
    --live-launch: #ffc65a;
    --live-aurora: #4ee88f;
    --temp-1: #7aa6f7;
    --temp-2: #6cb4f2;
    --temp-3: #8fd3ee;
    --temp-4: #a6dcae;
    --temp-5: #f2c75a;
    --temp-6: #f4914a;
    --temp-7: #ff6a5c;
    --exp-manuf: #3987e5;
    --exp-fuels: #d95926;
    --exp-raw: #199e70;
    --trade-flow: #f3e3b8;
    --export-badge: rgba(16, 24, 40, 0.92);
    --export-badge-ring: rgba(226, 177, 85, 0.7);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #050911;
  --bg-2: #0b1325;
  --panel: rgba(11, 17, 31, 0.9);
  --panel-solid: #0d1527;
  --panel-2: rgba(255, 255, 255, 0.045);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.2);
  --ink: #ece6d6;
  --ink-2: #b6bdcb;
  --muted: #8a94a6;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 1px 2px rgba(0, 0, 0, 0.4);
  --accent: #e2b155;
  --accent-ink: #f0c877;
  --accent-soft: rgba(226, 177, 85, 0.14);
  --on-accent: #1b1406;
  --event: #ff8f6b;
  --landmark: #6fd0c4;
  --park: #7fd47a;
  --wreck: #c9a6ff;
  --volcano: #e8284a;
  --moon-glow: rgba(225, 225, 215, 0.14);
  --moon-rim: rgba(230, 228, 220, 0.35);
  --moon-dark: #20232d;
  --mars-glow: rgba(235, 140, 100, 0.16);
  --mars-rim: rgba(245, 200, 175, 0.35);
  --jupiter-glow: rgba(240, 210, 160, 0.16);
  --jupiter-rim: rgba(245, 225, 190, 0.32);
  --saturn-glow: rgba(240, 220, 170, 0.16);
  --saturn-rim: rgba(245, 230, 195, 0.32);
  --mercury-glow: rgba(200, 195, 190, 0.14);
  --mercury-rim: rgba(230, 225, 220, 0.3);
  --venus-glow: rgba(255, 205, 130, 0.18);
  --venus-rim: rgba(255, 225, 180, 0.32);
  --uranus-glow: rgba(160, 220, 230, 0.16);
  --uranus-rim: rgba(200, 240, 245, 0.3);
  --uranus-ring: rgba(190, 215, 220, 0.3);
  --uranus-ring-eps: rgba(210, 230, 235, 0.6);
  --neptune-glow: rgba(140, 190, 240, 0.16);
  --neptune-rim: rgba(190, 220, 250, 0.3);
  --neptune-ring: rgba(190, 215, 240, 0.4);
  --pluto-glow: rgba(220, 200, 190, 0.14);
  --pluto-rim: rgba(235, 225, 220, 0.3);
  --charon-glow: rgba(210, 205, 205, 0.14);
  --charon-rim: rgba(230, 225, 225, 0.3);
  --satellite-glow: rgba(205, 205, 215, 0.14);
  --satellite-rim: rgba(225, 225, 235, 0.3);
  --sun-corona: rgba(255, 180, 80, 0.4);
  --sun-corona-2: rgba(255, 150, 60, 0.12);
  --sun-hint: rgba(255, 180, 90, 0.2);
  --plate-div: #3987e5;
  --plate-conv: #d95926;
  --plate-trans: #199e70;
  --trav-been: #3987e5;
  --trav-lived: #199e70;
  --trav-want: #d95926;
  --qual-1: #2a7d1a;
  --qual-2: #d99a10;
  --qual-3: #d55181;
  --qual-4: #6f5fd8;
  --qual-5: #8cc8f5;
  --clim-1: #2a7d1a;
  --clim-2: #d99a10;
  --clim-3: #d55181;
  --clim-4: #6f5fd8;
  --clim-5: #8cc8f5;
  --iceage-land: #3e4a3b;
  --iceage-coast: #7f8f68;
  --iceage-label: #c9c3a3;
  --tz-sea: rgba(255, 255, 255, 0.045);
  --tz-odd: rgba(255, 255, 255, 0.13);
  --tz-frac: rgba(232, 182, 90, 0.26);
  --tz-line: rgba(240, 235, 220, 0.6);
  --good: #53c98a;
  --bad: #ff6b5e;
  --series-1: #3987e5;
  --series-2: #d95926;
  --cat-politics: #3987e5;
  --cat-war: #e66767;
  --cat-science: #199e70;
  --cat-exploration: #d95926;
  --cat-culture: #d55181;
  --cat-religion: #9085e9;
  --cat-disaster: #c98500;
  --cat-economy: #2e9b2e;
  --globe-ocean: #0a1f3d;
  --globe-ocean-2: #1d4a77;
  --globe-glow: rgba(90, 150, 255, 0.3);
  --globe-rim: rgba(140, 190, 255, 0.4);
  --globe-border: rgba(6, 10, 18, 0.62);
  --globe-coast: rgba(170, 205, 235, 0.4);
  --globe-grat: rgba(170, 200, 255, 0.13);
  --globe-tropic: rgba(226, 177, 85, 0.6);
  --globe-night: #000510;
  --globe-label: #f1ebdc;
  --globe-halo: rgba(5, 9, 18, 0.82);
  --globe-sea-label: #93badf;
  --globe-water-label: #8fc2ee;
  --globe-phys-label: #dcbd8d;
  --globe-admin: rgba(236, 226, 200, 0.45);
  --globe-admin-casing: rgba(6, 10, 18, 0.35);
  --globe-admin-label: #d6cbb3;
  --globe-city: #f6f0e1;
  --globe-peak: #dcbd8d;
  --globe-river: #6aa8de;
  --globe-lake: #12355e;
  --globe-desert: #8d6f3f;
  --globe-range: #6e5b47;
  --globe-range-line: rgba(222, 190, 140, 0.15);
  --relief-shadow: rgba(2, 6, 16, 0.62);
  --relief-light: rgba(255, 236, 196, 0.28);
  --relief-0: rgba(60, 90, 70, 0);
  --relief-200: rgba(84, 104, 62, 0.06);
  --relief-500: rgba(122, 120, 72, 0.12);
  --relief-1000: rgba(152, 134, 86, 0.2);
  --relief-2000: rgba(178, 152, 102, 0.28);
  --relief-3500: rgba(202, 178, 132, 0.36);
  --relief-5000: rgba(228, 228, 222, 0.42);
  --hyps-0: #2e4b39;
  --hyps-200: #3a5439;
  --hyps-500: #585f38;
  --hyps-1000: #6c603b;
  --hyps-2000: #806d48;
  --hyps-3500: #9e8a65;
  --hyps-5000: #d2cec1;
  --bathy-0: rgba(140, 190, 235, 0.06);
  --bathy-200: rgba(6, 14, 54, 0.06);
  --bathy-1000: rgba(6, 14, 54, 0.2);
  --bathy-3000: rgba(6, 14, 54, 0.36);
  --bathy-6000: rgba(6, 14, 54, 0.48);
  --globe-hover: rgba(255, 255, 255, 0.15);
  --globe-select: rgba(226, 177, 85, 0.34);
  --globe-dim: rgba(5, 9, 18, 0.62);
  --land-1: #4e5b47;
  --land-2: #58583f;
  --land-3: #4a5b52;
  --land-4: #5c5345;
  --land-5: #53593f;
  --land-6: #485347;
  --land-7: #5b5b4c;
  --seq-0: #3a2b21;
  --seq-1: #58321b;
  --seq-2: #7d3f17;
  --seq-3: #a65015;
  --seq-4: #cf691d;
  --seq-5: #ef8d43;
  --seq-6: #fdb87f;
  --seq-none: #2b3037;
  --hist-1: #6c5a3f;
  --hist-2: #4f6a45;
  --hist-3: #42607f;
  --hist-4: #7b4c56;
  --hist-5: #5e5583;
  --hist-6: #776d3d;
  --hist-7: #3e6f65;
  --hist-8: #76573e;
  --hist-wild: #363c38;
  --live-air: #d5deea;
  --live-mil: #79e08a;
  --live-alert: #ff5c50;
  --live-ship: #4fc3ff;
  --live-custom: #c39bff;
  --live-quake: #ff8a5c;
  --live-hazard: #e5c46b;
  --live-fire: #ff9a3c;
  --live-storm: #b39dff;
  --live-volcano: #ff7aa8;
  --live-ice: #6ee0f0;
  --live-flood: #74b4ff;
  --live-conflict: #ff5f5f;
  --live-flash: #ffae4f;
  --live-crisis: #e08bff;
  --live-event: #7ab8ff;
  --live-note: #c4cad3;
  --live-choke: #4dd8e6;
  --live-sat: #f47fd6;
  --live-launch: #ffc65a;
  --live-aurora: #4ee88f;
  --temp-1: #7aa6f7;
  --temp-2: #6cb4f2;
  --temp-3: #8fd3ee;
  --temp-4: #a6dcae;
  --temp-5: #f2c75a;
  --temp-6: #f4914a;
  --temp-7: #ff6a5c;
  --exp-manuf: #3987e5;
  --exp-fuels: #d95926;
  --exp-raw: #199e70;
  --trade-flow: #f3e3b8;
  --export-badge: rgba(16, 24, 40, 0.92);
  --export-badge-ring: rgba(226, 177, 85, 0.7);
  color-scheme: dark;
}

/* ------------------------------------------------------------------ base */

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 400 14px/1.45 var(--font-ui);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img { max-width: 100%; }

.app {
  position: fixed;
  inset: 0;
  background:
    radial-gradient(120% 90% at 50% 45%, var(--bg-2) 0%, var(--bg) 70%);
  overflow: hidden;
}
.stars, .globe-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.globe-input { touch-action: none; cursor: grab; outline: none; }
.globe-input:active { cursor: grabbing; }
.app[data-tool="ruler"] .globe-input, .app[data-picking] .globe-input { cursor: crosshair; }
.app[data-hover="1"] .globe-input { cursor: pointer; }

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
  backdrop-filter: blur(16px) saturate(1.2);
}

.eyebrow {
  font: 600 var(--fs-xs)/1.2 var(--font-ui);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 34px; padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: transparent;
  font-weight: 600; font-size: var(--fs-sm);
  text-decoration: none; color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--accent-soft); border-color: var(--accent); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn.primary:hover { filter: brightness(1.06); background: var(--accent); }
.btn.small { min-height: 28px; padding: 3px 10px; font-size: var(--fs-xs); }
.btn[disabled] { opacity: 0.45; pointer-events: none; }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  font-weight: 700; color: var(--ink);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent-ink); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}
button.chip:hover, a.chip:hover { border-color: var(--accent); color: var(--accent-ink); }
.chip .dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }

/* ------------------------------------------------------------------ top bar */

.topbar {
  position: absolute;
  top: calc(var(--safe-t) + 12px);
  left: var(--gap); right: var(--gap);
  display: flex; align-items: center; gap: 14px;
  pointer-events: none;
  z-index: 20;
}
.topbar > * { pointer-events: auto; }
.brand {
  display: flex; align-items: center; gap: 8px;
  color: var(--ink); text-decoration: none;
  padding: 3px 14px 3px 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.brand-mark { width: 30px; height: 30px; color: var(--accent); }
.brand-name {
  font: 700 1.65rem/1 var(--font-display);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.modes {
  display: flex; gap: 2px;
  margin: 0 auto;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.modes button {
  display: flex; align-items: center; gap: 7px;
  border: 0; background: transparent;
  padding: 7px 16px; border-radius: 999px;
  font-weight: 600; font-size: var(--fs-sm); color: var(--ink-2);
  transition: background 0.15s, color 0.15s;
}
.modes button:hover { color: var(--ink); }
.modes button[aria-pressed="true"] { background: var(--accent); color: var(--on-accent); }
.mode-ico { font-size: 0.95em; opacity: 0.85; }
.label-short { display: none; }
.top-actions { display: flex; align-items: center; gap: 10px; }

.search { position: relative; }
.search input {
  width: 280px; height: 38px;
  padding: 0 36px 0 36px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
  outline: none;
  transition: width 0.2s, border-color 0.2s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus { border-color: var(--accent); width: 340px; }
.search input::-webkit-search-cancel-button { display: none; }
.search-ico { position: absolute; left: 12px; top: 10px; width: 18px; height: 18px; color: var(--muted); pointer-events: none; }
.search-kbd {
  position: absolute; right: 10px; top: 9px;
  font: 500 11px/18px var(--font-mono);
  padding: 0 6px; border-radius: 5px;
  border: 1px solid var(--line-strong); color: var(--muted);
}
.search input:focus + .search-kbd { display: none; }
.search-results {
  position: absolute; top: 46px; right: 0;
  width: min(420px, calc(100vw - 32px));
  max-height: min(60vh, 520px);
  overflow-y: auto;
  padding: 6px;
}
.result {
  display: grid; grid-template-columns: 32px 1fr auto; align-items: center; gap: 10px;
  width: 100%; text-align: left;
  padding: 8px 10px; border-radius: var(--radius-sm);
  border: 0; background: transparent;
}
.result[aria-selected="true"], .result:hover { background: var(--accent-soft); }
.result-ico {
  width: 32px; height: 24px; border-radius: 4px;
  display: grid; place-items: center;
  background: var(--panel-2); color: var(--muted);
  font-size: 13px; overflow: hidden;
}
.result-ico img { width: 100%; height: 100%; object-fit: cover; }
.result-name { font-weight: 600; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-sub { display: block; font-size: var(--fs-xs); color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.result-kind { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.search-empty { padding: 14px; color: var(--muted); }

.level-chip {
  display: flex; align-items: center; gap: 9px;
  height: 38px; padding: 0 14px 0 5px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--panel);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
  box-shadow: var(--shadow);
}
.level-chip:hover { border-color: var(--accent); }
.level-num {
  width: 28px; height: 28px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--accent); color: var(--on-accent);
  font: 700 13px/1 var(--font-mono);
}
.level-text { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; font-size: var(--fs-xs); font-weight: 600; }
.level-bar { width: 76px; height: 4px; border-radius: 4px; background: var(--line-strong); overflow: hidden; }
.level-bar span { display: block; height: 100%; width: 0; background: var(--accent); border-radius: 4px; transition: width 0.6s; }

/* ------------------------------------------------------------------ layers */

.layers {
  position: absolute;
  top: calc(var(--safe-t) + var(--top-h) + 14px);
  left: var(--gap);
  width: 236px;
  max-height: calc(100% - var(--top-h) - 90px - var(--legend-h, 50px));
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 10;
}
.layers-head {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; border: 0; background: transparent;
  padding: 11px 14px;
  font: 600 var(--fs-xs)/1 var(--font-ui); letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted);
}
.layers-head .chev { transition: transform 0.2s; }
.layers-head[aria-expanded="false"] .chev { transform: rotate(-90deg); }
.layers-body { overflow-y: auto; padding: 0 10px 12px; display: grid; gap: 12px; }
.layers-group { display: grid; gap: 2px; }
.layers-group > .eyebrow { padding: 4px 4px 4px; }
.toggle {
  position: relative;
  display: flex; align-items: center; gap: 10px;
  padding: 6px 6px; border-radius: 8px;
  font-size: var(--fs-sm); color: var(--ink-2);
  cursor: pointer; user-select: none;
}
.toggle:hover { background: var(--panel-2); color: var(--ink); }
.toggle input { position: absolute; left: 6px; top: 6px; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.toggle .sw {
  width: 26px; height: 15px; border-radius: 15px; flex: none;
  background: var(--line-strong); position: relative; transition: background 0.15s;
}
.toggle .sw::after {
  content: ""; position: absolute; top: 2px; left: 2px;
  width: 11px; height: 11px; border-radius: 50%;
  background: var(--panel-solid); transition: transform 0.15s;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}
.toggle input:checked + .sw { background: var(--accent); }
.toggle input:checked + .sw::after { transform: translateX(11px); }
.toggle input:focus-visible + .sw { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle .key { margin-left: auto; display: inline-flex; }
.key-dot { width: 9px; height: 9px; border-radius: 50%; }
.key-diamond { width: 8px; height: 8px; transform: rotate(45deg); }
.key-volcano { width: 12px; height: 10px; background: var(--volcano); clip-path: polygon(0 100%, 34% 0, 44% 28%, 56% 28%, 66% 0, 100% 100%); }
.key-plates { display: inline-flex; gap: 2px; align-items: center; }
.key-plates i { width: 7px; height: 3px; border-radius: 2px; display: block; }
.key-plates i.dash { width: 7px; height: 0; border-top: 2px dashed currentColor; border-radius: 0; }
.key-wreck { width: 12px; height: 8px; background: var(--wreck); clip-path: polygon(0 20%, 100% 0, 82% 100%, 14% 100%); transform: rotate(-12deg); }
.key-sites { display: inline-flex; gap: 3px; align-items: center; }
.key-sites i { width: 9px; height: 9px; display: block; }
.key-sites .site-crewed { background: var(--moon-site-crewed); clip-path: polygon(20% 0, 100% 25%, 35% 50%, 35% 100%, 20% 100%); }
.key-sites .site-robot { background: var(--moon-site-robot); clip-path: polygon(22% 0, 78% 0, 78% 50%, 100% 100%, 80% 100%, 62% 55%, 38% 55%, 20% 100%, 0 100%, 22% 50%); }
.key-sites .site-impact { background: var(--moon-site-impact); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.key-sites .site-rover { background: var(--mars-site-rover); clip-path: polygon(0 20%, 100% 20%, 100% 62%, 85% 62%, 85% 100%, 65% 100%, 65% 62%, 35% 62%, 35% 100%, 15% 100%, 15% 62%, 0 62%); }
.key-sites .site-lander { background: var(--mars-site-lander); clip-path: polygon(22% 0, 78% 0, 78% 50%, 100% 100%, 80% 100%, 62% 55%, 38% 55%, 20% 100%, 0 100%, 22% 50%); }
.key-sites .site-probe { background: var(--venus-site-probe); border-radius: 50%; }
.key-sites .site-crash { background: var(--mars-site-crash); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%); }
.moon-now { display: flex; gap: 14px; align-items: center; margin: 0 0 14px; }
.moon-phase { flex: none; }
.moon-phase .dark { fill: var(--moon-dark); }
.moon-phase .lit { fill: var(--moon-lit); }
.moon-phase .rim { fill: none; stroke: var(--line); stroke-width: 1; }
.mars-disc { flex: none; }
.mars-disc .body { fill: var(--mars-fill); }
.mars-disc .rim { fill: none; stroke: var(--line); stroke-width: 1; }
.giant-disc.jupiter .body { fill: var(--jupiter-fill); }
.giant-disc.saturn .body { fill: var(--saturn-fill); }
.giant-disc.uranus .body { fill: var(--uranus-fill); }
.giant-disc.neptune .body { fill: var(--neptune-fill); }
.giant-disc.pluto .body { fill: var(--pluto-fill); }
.giant-disc.pluto .heart { fill: var(--pluto-heart); }
.giant-disc.charon .body { fill: var(--charon-fill); }
.giant-disc.charon .cap { fill: var(--charon-cap); }
.giant-disc.satellite .body { fill: var(--satellite-fill); }
.hear { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.hear-text { font-family: var(--font-display); font-size: 1.35rem; line-height: 1.2; }
.giant-disc.satellite .pit { fill: var(--satellite-rim); }
.giant-disc.sun .body { fill: var(--sun-fill); }
.giant-disc.sun .rim { stroke: var(--sun-rim); }
.list-item.static { cursor: default; }
.list-item.static:hover { background: none; }
.key-tree { width: 10px; height: 10px; background: var(--park); clip-path: polygon(50% 0, 95% 62%, 62% 62%, 62% 100%, 38% 100%, 38% 62%, 5% 62%); }
.select {
  width: 100%; height: 34px; padding: 0 10px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--panel-solid);
}

/* ------------------------------------------------------------------ side panel */

.side {
  position: absolute;
  top: calc(var(--safe-t) + var(--top-h) + 14px);
  right: var(--gap);
  bottom: calc(var(--safe-b) + var(--gap));
  width: var(--panel-w);
  display: flex; flex-direction: column;
  overflow: hidden;
  z-index: 15;
  animation: slide-in 0.25s ease-out;
}
@keyframes slide-in { from { opacity: 0; transform: translateX(16px); } }
.side-head { position: relative; padding: 18px 20px 12px; border-bottom: 1px solid var(--line); }
.side-close {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--line); background: var(--panel-solid);
  font-size: 15px; line-height: 1; color: var(--ink-2);
}
.side-close:hover { border-color: var(--accent); color: var(--ink); }
.side-back {
  border: 0; background: none; color: var(--accent-ink);
  font-size: var(--fs-xs); font-weight: 600; padding: 0; margin-bottom: 8px;
}
.side-body { flex: 1; min-height: 0; overflow-y: auto; padding: 16px 20px 22px; display: flex; flex-direction: column; gap: 18px; overscroll-behavior: contain; }
.side-body > * { flex-shrink: 0; }
.side-foot { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 8px; }

.title-row { display: flex; gap: 14px; align-items: center; padding-right: 30px; }
.flag {
  width: 64px; aspect-ratio: 4 / 3; flex: none;
  border-radius: 5px; overflow: hidden;
  box-shadow: 0 0 0 1px var(--line-strong), 0 2px 6px rgba(0, 0, 0, 0.18);
  background: var(--panel-2);
}
.flag img { width: 100%; height: 100%; object-fit: cover; display: block; }
.title { font: 600 var(--fs-2xl)/1.02 var(--font-display); margin: 0; text-wrap: balance; letter-spacing: 0.005em; }
.title.small { font-size: 1.75rem; }
.subtitle { color: var(--ink-2); font-size: var(--fs-sm); margin-top: 4px; }
.side-head .chip-row { margin-top: 10px; }

.tabs {
  display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none;
  margin: 12px -20px -12px; padding: 0 14px;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs.more-r { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent); }
.tabs.more-l { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent); }
.tabs.more-l.more-r { -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent); }
.tabs button {
  border: 0; background: transparent;
  padding: 10px 7px; flex: none;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  border-bottom: 2px solid transparent;
}
.tabs button:hover { color: var(--ink); }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--accent); }

.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--line); }
.fact { background: var(--panel-solid); padding: 9px 11px; min-width: 0; }
.fact.wide { grid-column: 1 / -1; }
.fact dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.fact dd { margin: 2px 0 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fact dd small { font-weight: 400; color: var(--muted); }

.prose { display: grid; gap: 10px; }
.prose p { margin: 0; color: var(--ink-2); line-height: 1.62; font-size: var(--fs-md); max-width: 65ch; }
.prose p.lead { color: var(--ink); font-size: 1.02rem; }
.section-title { font: 600 1.25rem/1.15 var(--font-display); margin: 0 0 8px; }
.kv { display: grid; gap: 10px; }
.kv-row { display: grid; gap: 2px; }
.kv-row dt { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.kv-row dd { margin: 0; color: var(--ink-2); line-height: 1.5; }

.callout {
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  padding: 12px 14px;
}
.callout .eyebrow { color: var(--accent-ink); margin-bottom: 4px; }
.callout p { margin: 0; line-height: 1.55; }

.list { display: grid; gap: 2px; }
.list-item {
  display: grid; grid-template-columns: auto 1fr; gap: 2px 10px; align-items: baseline;
  width: 100%; text-align: left;
  padding: 8px 10px; margin: 0 -10px;
  border: 0; background: transparent; border-radius: var(--radius-sm);
}
.list-item:hover { background: var(--panel-2); }
a.list-item { text-decoration: none; color: inherit; }
a.list-item .what { color: var(--accent-ink); }
.list-item .when { font: 500 12px/1.4 var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; min-width: 72px; }
.list-item .what { font-weight: 600; min-width: 0; }
.list-item .why { grid-column: 2; font-size: var(--fs-xs); color: var(--muted); }
.list-item .cat-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }

.reign { display: grid; gap: 0; position: relative; }
.reign-row { display: grid; grid-template-columns: 86px 1fr; gap: 10px; padding: 5px 0; align-items: baseline; }
.reign-row .when { font: 500 12px var(--font-mono); color: var(--muted); }
.reign-row .who { font-weight: 600; }
.reign-row .who small { display: block; font-weight: 400; color: var(--muted); }

.spark { width: 100%; height: 86px; display: block; overflow: visible; }
.spark-wrap { position: relative; }
.spark-tip {
  position: absolute; top: -6px; transform: translate(-50%, -100%);
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  border-radius: 6px; padding: 3px 7px; font-size: 11px; white-space: nowrap;
  pointer-events: none; box-shadow: var(--shadow);
}

.compare-table { display: grid; gap: 12px; }
.cmp-row { display: grid; gap: 4px; }
.cmp-label { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 600; }
.cmp-bars { display: grid; gap: 3px; }
.cmp-bar { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; font-size: var(--fs-sm); font-variant-numeric: tabular-nums; }
.cmp-track { height: 8px; border-radius: 4px; background: var(--panel-2); overflow: hidden; }
.cmp-fill { height: 100%; border-radius: 0 4px 4px 0; }
.cmp-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: var(--fs-sm); font-weight: 600; }
.cmp-legend span { display: inline-flex; align-items: center; gap: 6px; }
.swatch { width: 12px; height: 12px; border-radius: 3px; }

.stars-row { color: var(--accent); letter-spacing: 2px; font-size: 13px; }
.muted { color: var(--muted); }
.small { font-size: var(--fs-xs); }
.sources { font-size: 11px; color: var(--muted); line-height: 1.5; }
.empty { color: var(--muted); font-style: italic; }

/* ------------------------------------------------------------------ HUD */

.hud { position: absolute; z-index: 9; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.hud-left { left: var(--gap); bottom: calc(var(--safe-b) + var(--gap)); align-items: flex-start; }
.hud-right { right: var(--gap); bottom: calc(var(--safe-b) + var(--gap)); align-items: flex-end; }
.app[data-panel] .hud-right { right: calc(var(--panel-w) + var(--gap) * 2); }
.app[data-mode="time"] .hud-left, .app[data-mode="time"] .hud-right { bottom: calc(var(--safe-b) + var(--gap) + var(--tl-h, 150px) + 12px); }

.readout {
  font: 500 12px/1 var(--font-mono);
  color: var(--muted);
  padding: 6px 10px; border-radius: 999px;
  background: var(--panel); border: 1px solid var(--line);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
}
.tools { display: flex; flex-direction: column; padding: 4px; gap: 2px; border-radius: 12px; }
.tool {
  width: 36px; height: 36px; border-radius: 9px;
  border: 0; background: transparent; font-size: 17px; line-height: 1; color: var(--ink-2);
  display: grid; place-items: center;
}
.tool:hover { background: var(--panel-2); color: var(--ink); }
.tool[aria-pressed="true"] { color: var(--accent-ink); background: var(--accent-soft); }
.tool-sep { height: 1px; background: var(--line); margin: 3px 6px; }

.legend { padding: 10px 12px; width: 260px; display: grid; gap: 6px; }
/* live clocks card (Time zones layer) */
.clocks { padding: 10px 12px 8px; width: 260px; }
.space-card { position: absolute; left: 50%; bottom: calc(var(--safe-b) + var(--gap)); transform: translateX(-50%); z-index: 9; padding: 10px 12px; width: 300px; max-width: calc(100vw - 32px); display: grid; gap: 6px; }
@media (max-width: 700px) { .space-card { bottom: auto; top: 64px; left: 12px; transform: none; width: calc(100vw - 110px); } }
.space-head { display: grid; gap: 2px; }
.space-scale { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 10px; font-size: var(--fs-s, 13px); }
.space-scale input[type="range"] { width: 100%; accent-color: var(--accent); }
.scale-ends { display: flex; justify-content: space-between; font-size: var(--fs-xs, 11px); color: var(--muted); margin-top: -4px; }
#space-card p { margin: 0; }
#app:not([data-mode="explore"]) #space-card { display: none; }
.clocks-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 4px; }
.clocks-note { font-size: var(--fs-xs, 11px); color: var(--muted); }
.clocks-list { list-style: none; margin: 0; padding: 0; display: grid; }
.clock { display: grid; grid-template-columns: 1fr auto 18px; grid-template-areas: "name time x" "sub sub x"; column-gap: 8px; padding: 5px 0; border-top: 1px solid var(--line); }
.clock:first-child { border-top: 0; }
.clock-name { grid-area: name; font-weight: 600; font-size: var(--fs-sm); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clock-time { grid-area: time; font: 600 15px/1.2 var(--font-mono); font-variant-numeric: tabular-nums; color: var(--ink); }
.clock.you .clock-time { color: var(--accent-ink); }
.clock-sub { grid-area: sub; font: 500 10.5px var(--font-mono); color: var(--muted); }
.clock-sub b { font-weight: 600; color: var(--ink-2); }
.clock-x { grid-area: x; align-self: center; width: 18px; height: 18px; border: 0; border-radius: 50%; background: none; color: var(--muted); cursor: pointer; font-size: 14px; line-height: 1; padding: 0; }
.clock-x:hover { background: var(--panel-2); color: var(--ink); }
.clocks-tip { margin: 6px 0 0; font-size: 11px; color: var(--muted); }
.tt-time b { font-size: 13px; }
.legend-title { font-weight: 600; font-size: var(--fs-sm); }
.legend-scale { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.legend-scale span { height: 10px; }
.legend-scale span:first-child { border-radius: 3px 0 0 3px; }
.legend-scale span:last-child { border-radius: 0 3px 3px 0; }
.legend-ticks { display: flex; justify-content: space-between; font: 500 10.5px var(--font-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
/* relief key: gradient bars with ticks placed on a square-root scale */
.legend-bar { height: 10px; border-radius: 3px; box-shadow: inset 0 0 0 1px var(--line); }
.legend-ticks.scaled { display: block; position: relative; height: 15px; margin-bottom: 2px; }
.legend-ticks.scaled span { position: absolute; top: 3px; transform: translateX(-50%); white-space: nowrap; }
.legend-ticks.scaled span::before { content: ""; position: absolute; left: 50%; top: -6px; width: 1px; height: 4px; background: var(--line-strong); }
.legend-ticks.scaled span:first-child { transform: none; }
.legend-ticks.scaled span:first-child::before { left: 0; }
.legend-ticks.scaled span:last-child { transform: translateX(-100%); }
.legend-ticks.scaled span:last-child::before { left: 100%; }
.legend-cats { display: grid; gap: 4px; font-size: var(--fs-xs); }
.legend-cats span { display: flex; align-items: center; gap: 7px; }
.legend-note { font-size: 11px; color: var(--muted); }

.tooltip {
  position: absolute; z-index: 30; pointer-events: none;
  max-width: 280px;
  padding: 7px 10px; border-radius: 9px;
  background: var(--panel-solid); border: 1px solid var(--line-strong);
  box-shadow: var(--shadow);
  font-size: var(--fs-sm);
}
.tooltip b { font-weight: 600; }
.tooltip .tt-sub { display: block; color: var(--muted); font-size: var(--fs-xs); }
.tooltip .tt-flag { width: 22px; height: 16px; border-radius: 2px; vertical-align: -3px; margin-right: 6px; box-shadow: 0 0 0 1px var(--line); object-fit: cover; }

/* ------------------------------------------------------------------ toasts, banner, welcome */

.toasts {
  position: absolute; z-index: 40;
  bottom: calc(var(--safe-b) + var(--gap) + 8px); left: 50%; transform: translateX(-50%);
  display: grid; gap: 8px; justify-items: center; pointer-events: none;
}
.app[data-mode="time"] .toasts { bottom: calc(var(--safe-b) + var(--gap) + var(--tl-h, 150px) + 14px); }
.app[data-panel] .toasts { left: calc((100% - var(--panel-w) - var(--gap)) / 2); }
.toast {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 16px 9px 10px; border-radius: 999px;
  background: var(--panel-solid); border: 1px solid var(--line-strong); box-shadow: var(--shadow);
  font-size: var(--fs-sm); font-weight: 600;
  animation: toast-in 0.3s ease-out;
}
.toast.out { animation: toast-out 0.3s ease-in forwards; }
.toast .badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font-size: 13px; }
.toast small { display: block; font-weight: 400; color: var(--muted); }
@keyframes toast-in { from { opacity: 0; transform: translateY(-8px) scale(0.98); } }
@keyframes toast-out { to { opacity: 0; transform: translateY(-8px); } }

.banner {
  position: absolute; z-index: 25;
  top: calc(var(--safe-t) + var(--top-h) + 14px); left: 50%; transform: translateX(-50%);
  display: flex; align-items: center; gap: 12px;
  padding: 8px 8px 8px 16px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 600;
  max-width: calc(100vw - 32px);
}

.welcome {
  position: absolute; z-index: 12;
  right: var(--gap); top: calc(var(--safe-t) + var(--top-h) + 14px);
  width: min(360px, calc(100vw - 32px));
  padding: 18px 18px 16px;
  display: grid; gap: 12px;
}
.welcome h2 { font: 600 1.7rem/1.05 var(--font-display); margin: 0; text-wrap: balance; }
.welcome p { margin: 0; color: var(--ink-2); line-height: 1.5; }
.welcome .how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; font-size: var(--fs-xs); color: var(--muted); }
.welcome .how div { border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; }
.welcome .how b { display: block; color: var(--ink); font-size: var(--fs-sm); }
.quick { display: grid; gap: 6px; }
.quick button {
  display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 10px;
  text-align: left; padding: 8px 10px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.quick button:hover { border-color: var(--accent); }
.quick .q-ico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 15px; }
.quick b { display: block; font-size: var(--fs-sm); }
.quick small { color: var(--muted); }
.welcome .dismiss { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); font-size: 16px; }
.welcome .dismiss:hover { color: var(--ink); background: var(--panel-2); }

/* ------------------------------------------------------------------ timeline */

.timeline {
  position: absolute; z-index: 14;
  left: var(--gap);
  right: var(--gap);
  bottom: calc(var(--safe-b) + var(--gap));
  padding: 12px 18px 14px;
  display: grid; gap: 10px;
}
.app[data-panel] .timeline { right: calc(var(--panel-w) + var(--gap) * 2); }
.tl-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.tl-year {
  font: 600 2.1rem/1 var(--font-display);
  min-width: 150px;
  font-variant-numeric: tabular-nums lining-nums;
}
.tl-era { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.tl-era b { font: 600 1.1rem/1.15 var(--font-display); }
.tl-era span { font-size: var(--fs-xs); color: var(--muted); }
.tl-controls { display: flex; align-items: center; gap: 6px; }
.tl-btn {
  height: 34px; min-width: 34px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: transparent;
  font-weight: 600; font-size: var(--fs-sm); color: var(--ink);
}
.tl-btn:hover { border-color: var(--accent); color: var(--accent-ink); }
.tl-btn.play { background: var(--accent); border-color: var(--accent); color: var(--on-accent); min-width: 42px; }
.tl-track-wrap { position: relative; padding: 4px 0 20px; }
.tl-track {
  position: relative; height: 34px; border-radius: 8px;
  background: var(--panel-2); border: 1px solid var(--line);
  cursor: pointer; touch-action: none; overflow: hidden;
}
.tl-eras { position: absolute; inset: 0; display: flex; }
.tl-eras span {
  height: 100%; border-right: 1px solid var(--line);
  font-size: 10px; color: var(--muted); padding: 3px 5px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis;
  letter-spacing: 0.02em;
}
.tl-eras span.on { background: var(--accent-soft); color: var(--accent-ink); }
.tl-ticks { position: absolute; left: 0; right: 0; bottom: 3px; height: 12px; pointer-events: none; }
.tl-ticks i { position: absolute; bottom: 0; width: 2px; height: 8px; border-radius: 1px; background: var(--event); opacity: 0.75; }
.tl-thumb {
  position: absolute; top: -3px; bottom: -3px; width: 3px; margin-left: -1.5px;
  background: var(--accent); border-radius: 2px; pointer-events: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent);
}
.tl-thumb::before {
  content: ""; position: absolute; top: -6px; left: -5px; width: 13px; height: 13px; border-radius: 50%;
  background: var(--accent); box-shadow: 0 0 0 3px var(--panel-solid);
}
.tl-scale { position: absolute; left: 0; right: 0; bottom: 0; height: 16px; font: 500 10px var(--font-mono); color: var(--muted); }
.tl-scale span { position: absolute; transform: translateX(-50%); white-space: nowrap; }
.tl-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.tl-filters .chip { cursor: pointer; }
.tl-filters .chip[aria-pressed="false"] { opacity: 0.45; }
.tl-note { font-size: 11px; color: var(--muted); margin-left: auto; }

/* ------------------------------------------------------------------ quests */

.quest-card {
  position: absolute; z-index: 16;
  top: calc(var(--safe-t) + var(--top-h) + 14px);
  left: 50%; transform: translateX(-50%);
  width: min(560px, calc(100vw - 32px));
  padding: 14px 16px;
  display: grid; gap: 10px;
}
.qc-top { display: flex; align-items: center; gap: 12px; }
.qc-progress { display: flex; gap: 3px; flex: 1; }
.qc-progress i { flex: 1; height: 4px; border-radius: 2px; background: var(--line-strong); }
.qc-progress i.ok { background: var(--good); }
.qc-progress i.no { background: var(--bad); }
.qc-progress i.now { background: var(--accent); }
.qc-score { font: 600 13px var(--font-mono); font-variant-numeric: tabular-nums; }
.qc-quit { border: 0; background: none; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.qc-quit:hover { color: var(--ink); }
.qc-prompt { display: flex; gap: 14px; align-items: center; }
.qc-prompt .flag { width: 96px; }
.qc-ask { font: 600 1.7rem/1.1 var(--font-display); margin: 0; text-wrap: balance; }
.qc-ask small { display: block; font: 500 var(--fs-sm)/1.4 var(--font-ui); color: var(--muted); margin-top: 3px; }
.qc-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qc-option {
  padding: 10px 12px; border-radius: 10px; text-align: left;
  border: 1px solid var(--line-strong); background: var(--panel-solid);
  font-weight: 600;
}
.qc-option:hover { border-color: var(--accent); }
.qc-option.right { border-color: var(--good); background: color-mix(in srgb, var(--good) 14%, var(--panel-solid)); }
.qc-option.wrong { border-color: var(--bad); background: color-mix(in srgb, var(--bad) 14%, var(--panel-solid)); }
.qc-option .k { font: 500 11px var(--font-mono); color: var(--muted); margin-right: 6px; }
.qc-feedback { display: grid; gap: 8px; padding: 10px 12px; border-radius: 10px; background: var(--panel-2); }
.qc-verdict { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.qc-verdict .mark { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; color: #fff; }
.qc-verdict.ok .mark { background: var(--good); }
.qc-verdict.no .mark { background: var(--bad); }
.qc-verdict .pts { margin-left: auto; font: 600 13px var(--font-mono); color: var(--accent-ink); }
.qc-feedback p { margin: 0; color: var(--ink-2); font-size: var(--fs-sm); line-height: 1.5; }
.qc-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; align-items: center; }
.qc-actions .hint-note { margin-right: auto; font-size: var(--fs-xs); color: var(--muted); }
.qc-clues { display: grid; gap: 6px; margin: 0; padding: 0; list-style: none; counter-reset: clue; }
.qc-clues li { counter-increment: clue; display: grid; grid-template-columns: 22px 1fr; gap: 8px; font-size: var(--fs-sm); line-height: 1.45; }
.qc-clues li::before { content: counter(clue); width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font: 600 11px var(--font-mono); }
.qc-year { display: grid; gap: 8px; }
.qc-year-val { font: 600 1.6rem/1 var(--font-display); text-align: center; font-variant-numeric: tabular-nums lining-nums; }
.qc-year input[type="range"] { width: 100%; accent-color: var(--accent); }
.qc-year .fine { display: flex; justify-content: center; gap: 6px; }
.qc-order { display: grid; gap: 6px; }
.qc-order button { text-align: left; padding: 9px 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-solid); display: flex; gap: 10px; align-items: center; }
.qc-order button .n { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; background: var(--panel-2); font: 600 12px var(--font-mono); flex: none; }
.qc-order button.picked .n { background: var(--accent); color: var(--on-accent); }
.qc-order button.picked { border-color: var(--accent); }
.qc-order button .yr { margin-left: auto; font: 500 12px var(--font-mono); color: var(--muted); }
.qc-order button.right { border-color: var(--good); }
.qc-order button.wrong { border-color: var(--bad); }
.qc-type { position: relative; }
.qc-type input { width: 100%; height: 38px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--line-strong); background: var(--panel-solid); }
.qc-type .search-results { top: 42px; left: 0; right: auto; width: 100%; }

.quest-grid { display: grid; gap: 8px; }
.quest-tile {
  display: grid; grid-template-columns: 40px 1fr auto; gap: 12px; align-items: center;
  text-align: left; padding: 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--panel-2);
}
.quest-tile:hover { border-color: var(--accent); }
.quest-tile .qt-ico { width: 40px; height: 40px; border-radius: 10px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); font-size: 19px; }
.quest-tile b { display: block; font-size: var(--fs-md); }
.quest-tile small { color: var(--muted); line-height: 1.35; display: block; }
.quest-tile .qt-meta { font: 500 11px var(--font-mono); color: var(--muted); text-align: right; }
.quest-tile.featured { border-color: color-mix(in srgb, var(--accent) 50%, transparent); background: var(--accent-soft); }
.opt-row { display: flex; flex-wrap: wrap; gap: 6px; }
.seg { display: inline-flex; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel-2); flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 5px 11px; border-radius: 999px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); }
.seg button[aria-pressed="true"] { background: var(--panel-solid); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18); }

.result-hero { text-align: center; display: grid; gap: 4px; padding: 6px 0; }
.result-hero .big { font: 600 3.2rem/1 var(--font-display); font-variant-numeric: tabular-nums lining-nums; }
.result-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.result-stats div { border: 1px solid var(--line); border-radius: 10px; padding: 8px; text-align: center; }
.result-stats b { display: block; font: 600 1.3rem var(--font-mono); font-variant-numeric: tabular-nums; }
.result-stats span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }

/* ------------------------------------------------------------------ passport */

.passport-head { display: grid; gap: 10px; }
.xp-big { display: flex; align-items: center; gap: 14px; }
.xp-big .lv { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent); font: 700 1.4rem var(--font-mono); flex: none; }
.xp-big .lv-title { font: 600 1.7rem/1 var(--font-display); }
.xp-track { height: 6px; border-radius: 6px; background: var(--line-strong); overflow: hidden; margin-top: 6px; }
.xp-track span { display: block; height: 100%; background: var(--accent); }
.list-item.static { cursor: default; }
.list-item.static:hover { background: none; }
.list-item.static:hover { background: none; }
.boundary-key { display: flex; gap: 8px; align-items: baseline; margin: 6px 0 0; }
.boundary-key .swatch { flex: none; transform: translateY(1px); }
.travel-key { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: var(--fs-xs); color: var(--muted); }
.travel-key span, .travel-item .why { display: inline-flex; align-items: center; gap: 6px; }
.travel-item img { width: 22px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-strong); display: block; }
.travel-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 10px; }
.travel-row .eyebrow { margin-right: 2px; }
.travel-row .chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.travel-row .chip .swatch { width: 9px; height: 9px; }
.stat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.stat { border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; }
.stat b { display: block; font: 600 1.25rem var(--font-mono); font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
.region-block { display: grid; gap: 8px; }
.region-head { display: flex; justify-content: space-between; align-items: baseline; }
.region-head b { font: 600 1.15rem var(--font-display); }
.region-head span { font: 500 12px var(--font-mono); color: var(--muted); }
.stamps { display: grid; grid-template-columns: repeat(auto-fill, minmax(38px, 1fr)); gap: 5px; }
.stamp {
  aspect-ratio: 4 / 3; border-radius: 4px; overflow: hidden; padding: 0;
  border: 0; background: var(--panel-2);
  box-shadow: 0 0 0 1px var(--line);
}
.stamp img { width: 100%; height: 100%; object-fit: cover; display: block; filter: grayscale(1) opacity(0.28); transition: filter 0.2s; }
.stamp.got img { filter: none; }
.stamp:hover { box-shadow: 0 0 0 2px var(--accent); }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.badge-card { border: 1px solid var(--line); border-radius: 10px; padding: 9px 10px; display: grid; gap: 2px; opacity: 0.55; }
.badge-card.got { opacity: 1; border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.badge-card b { font-size: var(--fs-sm); }
.badge-card small { color: var(--muted); font-size: 11px; line-height: 1.35; }
.badge-card .medal { font-size: 15px; color: var(--accent-ink); }
.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }

/* ------------------------------------------------------------------ live */

.modes button[data-mode="live"]:not([aria-pressed="true"]) .live-ico { color: var(--live-alert); opacity: 1; }
.live-eyebrow { display: flex; align-items: center; gap: 7px; color: var(--live-alert); }
.live-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--live-alert); animation: live-blink 1.6s ease-in-out infinite; }
@keyframes live-blink { 50% { opacity: 0.25; } }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.section-head .section-title { margin: 0; }
.live-toggle { align-items: flex-start; }
.live-toggle .sw { margin-top: 3px; }
.live-toggle .key { margin-top: 5px; }
.lt-text { display: flex; flex-direction: column; min-width: 0; }
.lt-text b { font-weight: 600; color: var(--ink); }
.lt-text small { font-size: 11.5px; line-height: 1.35; color: var(--muted); }
.bad { color: var(--bad); }
.lt-text small.bad, .eyebrow.bad, .when.bad { color: var(--bad); }
.wdot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; flex: none; }
.watch-item.resolved { opacity: 0.55; }
.callout.warn { background: color-mix(in srgb, var(--bad) 10%, transparent); border-color: color-mix(in srgb, var(--bad) 35%, transparent); }
.callout.warn .eyebrow { color: var(--bad); }
.callout code, .side code { font: 500 12px var(--font-mono); background: var(--panel-2); border: 1px solid var(--line); padding: 0 5px; border-radius: 4px; overflow-wrap: anywhere; }
.linkish { border: 0; background: none; padding: 0; color: var(--accent-ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; }
.chip b.mono { font-weight: 600; color: var(--ink); }
.chip.level-1 { color: var(--muted); }
.chip.level-2 { color: var(--accent-ink); }
.chip.level-3 { color: var(--live-flash); }
.chip.level-4 { color: var(--live-conflict); border-color: color-mix(in srgb, var(--live-conflict) 45%, transparent); }
.title.mono-title { font: 600 1.7rem/1.05 var(--font-mono); letter-spacing: 0.01em; }
.link-text { overflow-wrap: anywhere; }
details.more { margin-top: 6px; }
details.more > summary { cursor: pointer; font-size: var(--fs-xs); font-weight: 600; color: var(--accent-ink); list-style: none; }
details.more > summary::before { content: "▸ "; }
details.more[open] > summary::before { content: "▾ "; }
details.more > .prose { margin-top: 8px; }

/* landmark photo, above the name */
.lm-photo { margin: 0 0 12px; display: grid; gap: 5px; }
.lm-photo img { display: block; width: 100%; height: 200px; object-fit: cover; object-position: 50% 12%; border-radius: var(--radius-sm); background: var(--panel-2); box-shadow: 0 0 0 1px var(--line); }
.lm-photo.loading { height: 200px; border-radius: var(--radius-sm); background: linear-gradient(100deg, var(--panel-2) 30%, var(--line) 50%, var(--panel-2) 70%) 0 0 / 300% 100%; animation: photo-wait 1.4s linear infinite; }
.lm-photo.loading img, .lm-photo.loading figcaption { visibility: hidden; }
@keyframes photo-wait { to { background-position: -150% 0; } }
.lm-photo figcaption { font-size: 10.5px; line-height: 1.3; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lm-photo figcaption a { color: inherit; text-decoration: none; }
.lm-photo figcaption a:hover { color: var(--ink-2); text-decoration: underline; }

/* relief key, under "Mountains & terrain" */
.relief-key { padding: 2px 6px 8px 46px; display: grid; gap: 3px; }
.relief-key.in-legend { padding: 0; }
.relief-key .legend-bar { height: 8px; }
.relief-note { font-size: 10.5px; line-height: 1.35; color: var(--muted); margin-top: 2px; }
.toggle input:disabled + .sw { opacity: 0.55; }

/* trade tab */
.trade-show { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.trade-show .seg button:disabled { opacity: 0.45; cursor: default; }
.trade-goods { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; counter-reset: good; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; background: var(--line); }
.trade-goods li { counter-increment: good; display: grid; grid-template-columns: 20px 12px 1fr auto; gap: 8px; align-items: center; padding: 8px 11px; background: var(--panel-solid); font-size: var(--fs-sm); }
.trade-goods li::before { content: counter(good); grid-column: 1; grid-row: 1; font: 500 12px var(--font-mono); color: var(--muted); }
.trade-goods .what { font-weight: 600; color: var(--ink); min-width: 0; }
.trade-goods .kind { color: var(--muted); font-size: var(--fs-xs); text-align: right; }
.trade-partners { display: grid; gap: 6px; }
.trade-row { display: grid; grid-template-columns: minmax(0, 11rem) 1fr 40px; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.trade-row .bar-val { font: 500 12px var(--font-mono); font-variant-numeric: tabular-nums; text-align: right; color: var(--ink); }
.trade-name { display: inline-flex; align-items: center; gap: 7px; min-width: 0; border: 0; background: none; padding: 2px 0; font: inherit; font-weight: 600; color: var(--ink); text-align: left; }
.trade-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
button.trade-name { cursor: pointer; }
button.trade-name:hover span { text-decoration: underline; }
.key-emoji { font-size: 12px; line-height: 1; }
.trade-goods .where { grid-column: 3 / -1; font-size: var(--fs-xs); color: var(--muted); margin-top: -4px; }
.flag.tiny-flag { width: 20px; border-radius: 2px; box-shadow: 0 0 0 1px var(--line-strong); }

.bars { display: grid; gap: 4px; }
.bar-row { display: grid; grid-template-columns: 42px 1fr 48px; gap: 8px; align-items: center; font: 500 12px var(--font-mono); font-variant-numeric: tabular-nums; }
.bar-label { color: var(--muted); }
.bar-track { height: 8px; border-radius: 4px; background: var(--panel-2); border: 1px solid var(--line); overflow: hidden; }
.bar-fill { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.bar-val { text-align: right; }

.input {
  width: 100%; min-height: 34px; padding: 6px 10px;
  border-radius: 8px; border: 1px solid var(--line-strong);
  background: var(--panel-solid); color: var(--ink);
  font: 400 var(--fs-sm)/1.4 var(--font-ui);
}
.input:focus { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
textarea.input { resize: vertical; }
.form-grid, .watch-form { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 12px; }
.form-grid label, .watch-form label { display: grid; gap: 4px; font-size: var(--fs-xs); font-weight: 600; color: var(--ink-2); min-width: 0; }
.form-grid label small, .watch-form label small { font-weight: 400; color: var(--muted); }
.form-grid .wide, .watch-form .wide { grid-column: 1 / -1; }
.form-grid + .btn-row { margin-top: 10px; }
.watch-form .check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.watch-form .check input { accent-color: var(--accent); width: 16px; height: 16px; }
.where { display: grid; gap: 6px; padding: 10px 12px; border: 1px dashed var(--line-strong); border-radius: 10px; }
.where-val { font: 500 13px var(--font-mono); }
.form-msg { margin: 0; }
.custom-row { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--line); }
.cf-url { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
label.btn { cursor: pointer; }

.units-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 6px 6px 2px; }
.wx-now { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 12px; margin-bottom: 10px; }
.wx-sym { font-size: 1.6rem; line-height: 1; color: var(--accent-ink); }
.wx-temp { font: 600 2.2rem/1 var(--font-display); font-variant-numeric: tabular-nums lining-nums; }
.wx-desc { display: flex; flex-direction: column; min-width: 0; }
.wx-desc small { color: var(--muted); font-size: var(--fs-xs); }
.wx-days { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin-top: 10px; }
.wx-days > div { display: grid; justify-items: center; gap: 2px; padding: 8px 2px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); font-size: var(--fs-xs); }
.wx-days b { font-weight: 600; }
.wx-days .wx-sym { font-size: 1.05rem; }
.wx-days small { color: var(--muted); }
.list-item.pass { cursor: default; }
.list-item.pass:hover { background: transparent; }

/* ------------------------------------------------------------------ modal & loading */

.modal {
  position: absolute; inset: 0; z-index: 50;
  display: grid; place-items: center; padding: 16px;
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.modal-card { width: min(560px, 100%); max-height: calc(100% - 32px); overflow-y: auto; padding: 22px 24px; position: relative; display: grid; gap: 14px; }
.modal-card h2 { font: 600 1.9rem/1.05 var(--font-display); margin: 0; }
.keys { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: var(--fs-sm); }
.keys kbd { font: 500 12px var(--font-mono); padding: 2px 7px; border-radius: 5px; border: 1px solid var(--line-strong); background: var(--panel-2); white-space: nowrap; justify-self: start; }

.loading {
  position: absolute; inset: 0; z-index: 100;
  display: grid; place-content: center; justify-items: center; gap: 12px;
  background: var(--bg);
  transition: opacity 0.5s;
}
.loading.done { opacity: 0; pointer-events: none; }
.loading-globe {
  width: 84px; height: 84px; border-radius: 50%;
  border: 1.5px solid var(--accent);
  background:
    repeating-linear-gradient(90deg, transparent 0 13px, color-mix(in srgb, var(--accent) 40%, transparent) 13px 14px);
  animation: spin-bg 2.4s linear infinite;
  box-shadow: inset -14px -10px 24px rgba(0, 0, 0, 0.25);
}
@keyframes spin-bg { to { background-position: 28px 0; } }
.loading-name { font: 700 2rem/1 var(--font-display); letter-spacing: 0.16em; text-transform: uppercase; }
.loading-msg { color: var(--muted); font-size: var(--fs-sm); }

/* ------------------------------------------------------------------ mobile */

@media (max-width: 760px) {
  :root { --gap: 12px; --top-h: 50px; }
  .topbar { gap: 8px; }
  .brand-name { font-size: 1.3rem; }
  .brand-mark { width: 24px; height: 24px; }
  .modes {
    position: fixed; left: 8px; right: 8px; bottom: calc(var(--safe-b) + 8px);
    margin: 0; justify-content: space-around;
    border-radius: 16px;
  }
  .modes button { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; flex: 1; border-radius: 12px; }
  .modes button { min-width: 0; }
  .modes button span:not(.mode-ico) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .label-long { display: none; }
  .label-short { display: inline; }
  .form-grid, .watch-form { grid-template-columns: 1fr; }
  .mode-ico { font-size: 16px; }
  .top-actions { margin-left: auto; gap: 6px; }
  .search input { width: 40px; padding: 0 0 0 36px; cursor: pointer; }
  .search input:focus { width: calc(100vw - 32px); position: fixed; left: 16px; top: calc(var(--safe-t) + 12px); z-index: 40; padding-right: 12px; cursor: text; }
  .search-kbd { display: none; }
  .search-ico { color: var(--ink); }
  .search-results { position: fixed; top: calc(var(--safe-t) + 58px); left: 16px; right: 16px; width: auto; }
  .level-text { display: none; }
  .level-chip { padding: 0 4px; }
  #help-btn { display: none; }

  .layers { top: auto; bottom: calc(var(--safe-b) + 84px + var(--legend-h, 0px)); left: var(--gap); width: auto; max-width: calc(100vw - 90px); max-height: 50vh; } /* above the legend when one shows */
  .layers-head[aria-expanded="false"] { padding: 9px 12px; }

  .side {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; height: min(62vh, 560px);
    border-radius: 18px 18px 0 0;
    padding-bottom: calc(var(--safe-b) + 66px);
    animation: sheet-in 0.25s ease-out;
  }
  @keyframes sheet-in { from { transform: translateY(24px); opacity: 0; } }
  .side.expanded { height: calc(100% - var(--safe-t) - 60px); }
  .side-grip { display: block; width: 40px; height: 4px; border-radius: 4px; background: var(--line-strong); margin: 8px auto -6px; border: 0; padding: 0; }
  .title { font-size: 1.8rem; }
  .flag { width: 52px; }
  .lm-photo img, .lm-photo.loading { height: 140px; }

  .hud-left { bottom: calc(var(--safe-b) + 84px); }
  .hud-right { bottom: calc(var(--safe-b) + 84px); }
  .app[data-panel] .hud-right { right: var(--gap); }
  .app[data-panel] .hud, .app[data-panel] .layers { display: none; }
  .readout { display: none; }
  .tools { flex-direction: column; }
  .tool { width: 34px; height: 34px; }

  .timeline { left: 8px; right: 8px; bottom: calc(var(--safe-b) + 76px); padding: 10px 12px; }
  .app[data-panel] .timeline { display: none; }
  .tl-year { font-size: 1.6rem; min-width: 110px; }
  .tl-era span { display: none; }
  .tl-filters { display: none; }
  .tl-scale span:nth-child(2) { display: none; }
  .app[data-mode="quest"] .hud-right { display: none; }
  .app[data-mode="time"] .hud-left, .app[data-mode="time"] .hud-right { bottom: calc(var(--safe-b) + 76px + var(--tl-h, 120px) + 8px); }

  .quest-card { top: calc(var(--safe-t) + 58px); padding: 12px; }
  .qc-ask { font-size: 1.35rem; }
  .qc-prompt .flag { width: 72px; }
  .welcome { top: auto; right: auto; left: var(--gap); bottom: calc(var(--safe-b) + 84px); padding: 16px; gap: 10px; }
  .welcome .how { display: none; }
  .welcome h2 { font-size: 1.45rem; }
  .toasts { bottom: calc(var(--safe-b) + 84px); width: calc(100vw - 32px); }
  .app[data-panel] .toasts { left: 50%; bottom: auto; top: calc(var(--safe-t) + 60px); }
  .app[data-mode="time"] .toasts { bottom: calc(var(--safe-b) + 84px + var(--tl-h, 120px)); }
}
@media (min-width: 761px) { .side-grip { display: none; } }
@media (max-width: 1100px) and (min-width: 761px) {
  .modes button span:not(.mode-ico) { display: none; }
  .modes button { padding: 8px 12px; }
  .search input { width: 200px; }
  .search input:focus { width: 260px; }
  :root { --panel-w: 360px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}
@media (forced-colors: active) {
  .panel { border: 1px solid CanvasText; }
}

/* "People living around it": one line per ring (25, 50, 100 km) */
.near { display: grid; gap: 2px; }
.near-row b { display: inline-block; min-width: 4.2em; color: var(--muted); font-weight: 500; }

/* Phones: a compact tool column (⋯ opens the rest), timeline filters on demand, a one-line era
   name, a single scrolling row of card buttons, and the search icon above its blurred input. */
.search-ico { z-index: 1; }
.tool.more, .tl-filter-toggle { display: none; }
@media (max-width: 760px) {
  .tool.more { display: grid; }
  .tools .extra { display: none; }
  .tools.open { display: grid; grid-template-columns: repeat(4, 34px); gap: 4px; }
  .tools.open .tool.extra { display: grid; }
  .tools.open .tool-sep { display: none; }
  .tools.open .tool.more { grid-column: 4; }
  .tl-filter-toggle { display: inline-grid; }
  .tl-top { gap: 8px; }
  .tl-year { min-width: 0; }
  .tl-era { min-width: 0; flex: 1; }
  .tl-era b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1.05rem; }
  .tl-controls { gap: 4px; }
  .tl-btn { width: 36px; height: 36px; }
  .timeline.show-filters .tl-filters { display: flex; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .timeline.show-filters .tl-filters > * { flex: none; }
  .tl-note { display: none; }
  .side-foot { flex-wrap: nowrap; overflow-x: auto; padding: 10px 14px; scrollbar-width: none; }
  .side-foot > * { flex: none; }
  .side-foot .btn { padding: 8px 14px; font-size: 0.9rem; }
}

/* "Say it in …": hello, thank you and the country's own name, each with a play button */
.phrases { display: grid; gap: 6px; }
.hear-btn {
  width: 28px; height: 28px; flex: none; align-self: center;
  display: inline-grid; place-items: center; padding: 0 0 0 2px;
  border-radius: 999px; border: 1px solid var(--line-strong); background: var(--panel);
  color: var(--accent); font-size: 11px; cursor: pointer;
}
.hear-btn:hover, .hear-btn:focus-visible { border-color: var(--accent); }
.phrases .hear-text { font-size: 1.2rem; }

/* "Earth at night" base map: the map's lines and names keep the dark theme's colours in either theme,
   so they read over the night imagery (js/night.js swaps them in while the base map is drawn). */
:root {
  --night-globe-label: #f1ebdc;
  --night-globe-halo: rgba(5, 9, 18, 0.82);
  --night-globe-sea-label: #93badf;
  --night-globe-water-label: #8fc2ee;
  --night-globe-phys-label: #dcbd8d;
  --night-globe-border: rgba(236, 226, 200, 0.3);
  --night-globe-coast: rgba(170, 205, 235, 0.4);
  --night-globe-city: #f6f0e1;
  --night-globe-grat: rgba(170, 200, 255, 0.13);
  --night-globe-tropic: rgba(226, 177, 85, 0.6);
  --night-globe-admin: rgba(236, 226, 200, 0.3);
  --night-globe-admin-casing: rgba(6, 10, 18, 0.35);
  --night-globe-admin-label: #d6cbb3;
  --night-globe-peak: #dcbd8d;
  --night-globe-river: #6aa8de;
  --night-globe-lake: #12355e;
}

/* The light-speed tour: the pulse of light (same warm white in both themes: it is drawn over space). */
:root { --light-beam: #fff3d6; }
.tour-card { position: absolute; left: 50%; bottom: calc(var(--safe-b) + var(--gap)); transform: translateX(-50%); z-index: 9; padding: 12px 14px; width: 340px; max-width: calc(100vw - 32px); display: grid; gap: 6px; }
.tour-card .tour-clock { font: 600 1.9rem/1.1 var(--font-mono); font-variant-numeric: tabular-nums; }
.tour-card .tour-where { font-family: var(--font-display); font-size: 1.3rem; line-height: 1.2; }
.tour-card p { margin: 0; }
.tour-card .tour-actions { display: flex; gap: 8px; justify-content: flex-end; }
.tour-progress { height: 4px; border-radius: 4px; background: var(--line); overflow: hidden; }
.tour-progress i { display: block; height: 100%; background: var(--accent); transition: width 0.3s; }
@media (max-width: 700px) { .tour-card { bottom: auto; top: 64px; left: 12px; transform: none; width: calc(100vw - 110px); } }

/* Writing systems: the note under the script's name */
.script-note { display: block; }

/* The ruler's card: total, flying time and the ground along the line */
.ruler-card { position: absolute; left: 50%; bottom: calc(var(--safe-b) + var(--gap)); transform: translateX(-50%); z-index: 24; padding: 10px 12px; width: 340px; max-width: calc(100vw - 32px); display: grid; gap: 6px; }
.ruler-head { display: flex; align-items: baseline; gap: 8px; }
.ruler-total { font-size: 1.25rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.ruler-row { display: flex; align-items: baseline; gap: 8px; font-size: var(--fs-sm); }
.ruler-profile { margin: 2px 0 0; }
.ruler-profile svg { display: block; width: 100%; height: 96px; border-radius: 6px; background: var(--panel-2); touch-action: none; cursor: crosshair; }
.ruler-profile .rp-sea { fill: var(--bathy-1000); }
.ruler-profile .rp-ground { fill: var(--hyps-500); }
.ruler-profile .rp-body { fill: var(--line); }
.ruler-profile .rp-line { fill: none; stroke: var(--ink-2); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ruler-profile .rp-zero { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ruler-profile .rp-cursor { stroke: var(--accent); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.ruler-profile figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.ruler-profile .rp-readout { margin-left: auto; }
.app[data-mode="time"] .ruler-card { bottom: auto; top: calc(var(--safe-t) + var(--top-h) + 64px); }

/* Ocean currents: the layer key (warm over cold) and the card's chips */
.key-current { display: inline-grid; gap: 3px; width: 16px; }
.key-current i { display: block; height: 2.5px; border-radius: 2px; }
.chip.warm { color: var(--current-warm); }
.chip.cold { color: var(--current-cold); }
