/* =====================================================================
   SPACE MAGICA — MARS CLOCK & MARS CALENDAR
   styles.css

   Palette (from the brief): obsidian ground, Mars red accent, warm sand
   typography, amber highlight. No neon, no gaming chrome.
     --void      #07070a  obsidian ground
     --rust      #c1440e  Mars red (structural accent)
     --ember     #e2643a  Mars red, lit
     --sand      #d9c2a3  warm sand (body text)
     --amber     #f0a437  highlight, live values only
     --ice       #bcd4e6  cold accent, used sparingly for Earth data
   Type: system sans for prose; monospace with tabular figures for every
   number, because this is an instrument.
   ===================================================================== */

:root {
  --void: #07070a;
  --panel: #0e0d11;
  --panel-2: #131217;
  --line: #221f27;
  --line-soft: #191720;
  --rust: #c1440e;
  --ember: #e2643a;
  --sand: #d9c2a3;
  --sand-dim: #9a8b78;
  --amber: #f0a437;
  --ice: #bcd4e6;
  --text: #f2ece4;
  --text-dim: #a29a90;
  --text-faint: #6d6660;
  --ok: #6fbf8f;
  --warn: #e0b04a;
  --bad: #d9614f;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, "Helvetica Neue", Arial, sans-serif;
  --font-mono: "IBM Plex Mono", "JetBrains Mono", ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --r: 4px;
  --maxw: 1180px;
  --nav-h: 58px;
  --ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- themes ---------- */
[data-theme="mars-light"] {
  --void: #f4efe8; --panel: #fffdfa; --panel-2: #f7f2ea;
  --line: #e0d6c8; --line-soft: #ebe3d7;
  --text: #1b1713; --text-dim: #5d554c; --text-faint: #918madd;
  --text-faint: #928a80; --sand: #6b5c48; --sand-dim: #8b7c68;
  --amber: #a86a12; --ember: #b8481f; --ice: #35617f;
}
[data-theme="mission-control"] {
  --void: #04060a; --panel: #080d14; --panel-2: #0b121b;
  --line: #16232f; --line-soft: #101a24;
  --amber: #ffb64d; --sand: #cfe3ef; --sand-dim: #7f95a4; --ice: #6fd3ff;
  --text: #e8f4fb; --text-dim: #91a7b6;
}
[data-theme="scientific"] {
  --void: #0b0b0c; --panel: #121213; --panel-2: #17171a;
  --line: #262629; --amber: #e8e2d6; --sand: #cfcac1; --ember: #c96a45;
  --text: #f2f2f0;
}
[data-theme="minimal"] {
  --void: #000; --panel: #000; --panel-2: #060606;
  --line: #1c1c1c; --line-soft: #131313;
  --amber: #fff; --sand: #b9b9b9; --sand-dim: #6f6f6f; --ember: #d24a1c;
  --text: #fff; --text-dim: #8a8a8a;
}

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--void);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before {
  /* faint dust haze; purely atmospheric, disabled for reduced motion */
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background:
    radial-gradient(900px 500px at 78% -8%, rgba(193, 68, 14, .13), transparent 65%),
    radial-gradient(700px 420px at 8% 108%, rgba(240, 164, 55, .07), transparent 60%);
}
a { color: var(--amber); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font-family: inherit; font-size: inherit; cursor: pointer; }
:focus-visible {
  outline: 2px solid var(--amber);
  outline-offset: 2px;
  border-radius: 2px;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: fixed; top: -60px; left: 12px; z-index: 200; background: var(--amber);
  color: #000; padding: 8px 14px; font-weight: 700; transition: top .2s;
}
.skip:focus { top: 10px; }

/* ---------- typography primitives ---------- */
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.eyebrow {
  font-family: var(--font-mono);
  font-size: 10.5px; letter-spacing: .22em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 10px;
}
.brand-word {
  font-weight: 800; letter-spacing: .34em; text-transform: uppercase;
}
h1, h2, h3, h4 { font-weight: 700; letter-spacing: -0.01em; margin: 0 0 .5em; }
h1 { font-size: clamp(28px, 5vw, 46px); }
h2 { font-size: clamp(20px, 3vw, 27px); }
h3 { font-size: 17px; }
p { margin: 0 0 1em; color: var(--text-dim); }
p strong { color: var(--text); }
hr { border: 0; border-top: 1px solid var(--line); margin: 30px 0; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50; height: var(--nav-h);
  display: flex; align-items: center; gap: 18px;
  padding: 0 clamp(14px, 3vw, 28px);
  background: color-mix(in srgb, var(--void) 88%, transparent);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}
.topbar .logo { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.topbar .logo .badge {
  width: 30px; height: 30px; border-radius: 50%;
  /* the badge carries its own black field; a faint rim seats it on the bar */
  box-shadow: 0 0 0 1px rgba(217, 194, 163, .18), 0 2px 10px rgba(0, 0, 0, .6);
  transition: box-shadow .25s ease, transform .25s ease;
}
.topbar .logo:hover .badge {
  box-shadow: 0 0 0 1px rgba(240, 164, 55, .45), 0 0 18px rgba(193, 68, 14, .38);
  transform: translateY(-1px);
}
[data-motion="off"] .topbar .logo:hover .badge { transform: none; }
.topbar .logo svg { width: 24px; height: 24px; }
.topbar .logo .name { font-size: 12.5px; }
.topbar .logo .sub {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em;
  color: var(--text-faint); text-transform: uppercase; display: block; margin-top: -2px;
}
.nav { display: flex; gap: 2px; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
  padding: 7px 11px; border: 1px solid transparent; white-space: nowrap;
}
.nav a:hover { color: var(--text); text-decoration: none; background: var(--panel-2); }
.nav a[aria-current="page"] {
  color: var(--amber); border-color: var(--line); background: var(--panel);
}
.tick {
  font-family: var(--font-mono); font-size: 11px; color: var(--text-faint);
  letter-spacing: .06em; flex-shrink: 0; display: none;
}
@media (min-width: 1080px) { .tick { display: block; } }

/* ---------- layout ---------- */
main { position: relative; z-index: 1; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 clamp(14px, 3vw, 28px); }
.view { padding: 34px 0 90px; animation: viewIn .34s var(--ease); }
@keyframes viewIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.grid { display: grid; gap: 14px; }
.g2 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.g4 { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.split { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .split { grid-template-columns: 1.05fr .95fr; align-items: start; } }
.stack-24 > * + * { margin-top: 24px; }

/* ---------- panels ---------- */
.panel {
  background: linear-gradient(180deg, var(--panel), var(--panel-2));
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}
.panel.tight { padding: 14px; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-bottom: 14px; padding-bottom: 10px;
  border-bottom: 1px solid var(--line-soft);
}
.panel-head h3, .panel-head h2 { margin: 0; }

/* readout cells */
.cell { border: 1px solid var(--line); background: var(--panel); padding: 12px 13px; border-radius: var(--r); }
.cell .k {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-faint); display: block;
}
.cell .v {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(17px, 2.4vw, 21px); color: var(--text); margin-top: 5px; display: block;
}
.cell .v.amber { color: var(--amber); }
.cell .v.ice { color: var(--ice); }
.cell .n { font-size: 11px; color: var(--text-faint); font-family: var(--font-mono); }

/* data rows */
.rows { display: grid; gap: 0; }
.row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 9px 0; border-bottom: 1px dashed var(--line-soft);
}
.row:last-child { border-bottom: 0; }
.row .rk { color: var(--text-dim); font-size: 13.5px; }
.row .rv {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--text); text-align: right; font-size: 13.5px;
}

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text);
  background: transparent; border: 1px solid var(--line); border-radius: var(--r);
  padding: 11px 18px; transition: border-color .2s, background .2s, color .2s;
}
.btn:hover { border-color: var(--ember); color: var(--amber); text-decoration: none; }
.btn.primary { background: var(--rust); border-color: var(--rust); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--ember); border-color: var(--ember); color: #fff; }
.btn.sm { padding: 7px 11px; font-size: 10.5px; letter-spacing: .1em; }
.btn[aria-pressed="true"] { border-color: var(--amber); color: var(--amber); background: var(--panel-2); }
.btn-row { display: flex; flex-wrap: wrap; gap: 8px; }

input, select, textarea {
  font-family: var(--font-mono); font-size: 13px;
  background: var(--void); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--r); padding: 9px 10px; width: 100%;
}
textarea { font-family: var(--font-sans); line-height: 1.55; resize: vertical; }
label.field { display: block; margin-bottom: 12px; }
label.field > span {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-faint); display: block; margin-bottom: 5px;
}

/* ---------- tags & badges ---------- */
.tag {
  display: inline-block; font-family: var(--font-mono); font-size: 9.5px;
  letter-spacing: .16em; text-transform: uppercase; color: var(--text-dim);
  border: 1px solid var(--line); padding: 3px 8px; border-radius: 2px;
}
.tag.live { color: var(--amber); border-color: color-mix(in srgb, var(--amber) 45%, transparent); }
.tag.model { color: var(--ice); border-color: color-mix(in srgb, var(--ice) 40%, transparent); }
.dot {
  width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
  display: inline-block; margin-right: 6px; vertical-align: middle;
  animation: pulse 2.4s infinite var(--ease);
}
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

.notice {
  border: 1px solid var(--line); border-left: 2px solid var(--ember);
  background: var(--panel); padding: 13px 15px; border-radius: var(--r);
  font-size: 13px; color: var(--text-dim);
}
.notice strong { color: var(--sand); }

/* =====================================================================
   HERO — the signature: sol counter over the live globe
   ===================================================================== */
.hero {
  position: relative; min-height: min(84vh, 760px);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 16px 54px; overflow: hidden;
}
.hero-globe {
  position: absolute; inset: 0; width: 100%; height: 100%;
  z-index: 0; opacity: .82;
  mask-image: radial-gradient(circle at 50% 46%, #000 42%, transparent 72%);
  -webkit-mask-image: radial-gradient(circle at 50% 46%, #000 42%, transparent 72%);
}
.hero-inner { position: relative; z-index: 1; width: 100%; max-width: 760px; }
.hero .kicker { font-size: clamp(11px, 2.6vw, 14px); color: var(--sand); margin-bottom: 6px; }
.hero .product {
  font-size: clamp(30px, 8vw, 62px); font-weight: 800; letter-spacing: .06em;
  text-transform: uppercase; line-height: 1; margin: 0;
  text-shadow: 0 2px 40px rgba(0, 0, 0, .8);
}
.hero .tagline {
  font-family: var(--font-mono); font-size: clamp(10px, 2.4vw, 12.5px);
  letter-spacing: .42em; text-transform: uppercase; color: var(--ember);
  margin: 12px 0 0;
}
.hero .tagline-2 { font-size: 12.5px; color: var(--text-faint); letter-spacing: .04em; margin-top: 10px; font-family: var(--font-sans); }

.sol-block { margin: 34px 0 6px; }
.sol-label {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .4em;
  color: var(--text-faint); text-transform: uppercase;
}
.sol-number {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(56px, 17vw, 132px); font-weight: 600; line-height: .92;
  color: var(--text); letter-spacing: -.02em;
  text-shadow: 0 0 60px rgba(0, 0, 0, .9);
}
.mars-time {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 9vw, 56px); color: var(--amber); letter-spacing: .04em;
  margin-top: 6px; text-shadow: 0 0 40px rgba(0, 0, 0, .85);
}
.mars-time .sec { opacity: .62; }
.time-caption {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .34em;
  text-transform: uppercase; color: var(--text-faint); margin-top: 4px;
}
/* sol progress rail — the sol as a physical quantity, not just a number */
.rail { max-width: 420px; margin: 20px auto 0; }
.rail-track { height: 2px; background: var(--line); position: relative; overflow: hidden; }
.rail-fill { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--rust), var(--amber)); }
.rail-legend {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em; color: var(--text-faint);
}
.hero-strip {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px 26px;
  margin-top: 26px;
}
.hero-strip .item { text-align: center; }
.hero-strip .k {
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .2em;
  color: var(--text-faint); text-transform: uppercase; display: block;
}
.hero-strip .v {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 15px; color: var(--sand);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-top: 30px; }

/* ---------- origin sol card ---------- */
.origin {
  border: 1px solid var(--line); border-radius: var(--r); overflow: hidden;
  background:
    radial-gradient(700px 220px at 12% 0%, rgba(193, 68, 14, .18), transparent 70%),
    linear-gradient(180deg, var(--panel), var(--panel-2));
}
.origin-body { padding: clamp(20px, 4vw, 34px); }
.origin .sol001 {
  font-family: var(--font-mono); font-size: clamp(34px, 8vw, 64px);
  color: var(--amber); letter-spacing: .04em; line-height: 1;
}
.origin .date {
  font-size: clamp(17px, 3.4vw, 25px); font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; margin-top: 8px;
}
.origin .place {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .3em;
  color: var(--text-faint); text-transform: uppercase; margin-top: 6px;
}

/* ---------- timeline ---------- */
.timeline { padding: 4px 0 0; }
.timeline-track { position: relative; height: 46px; margin: 18px 0 6px; }
.timeline-line { position: absolute; top: 22px; left: 0; right: 0; height: 1px; background: var(--line); }
.timeline-line::after {
  content: ""; position: absolute; inset: 0 auto 0 0; width: var(--past, 50%);
  background: linear-gradient(90deg, var(--rust), var(--amber));
}
.timeline-mark {
  position: absolute; top: 12px; width: 1px; height: 20px; background: var(--line);
}
.timeline-mark span {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .1em;
  color: var(--text-faint); white-space: nowrap;
}
.timeline-mark.key { background: var(--ember); height: 26px; top: 9px; }
input[type="range"] { -webkit-appearance: none; appearance: none; background: transparent; padding: 0; border: 0; height: 22px; }
input[type="range"]::-webkit-slider-runnable-track { height: 2px; background: var(--line); }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%;
  background: var(--amber); margin-top: -6px; border: 2px solid var(--void);
}
input[type="range"]::-moz-range-track { height: 2px; background: var(--line); }
input[type="range"]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--amber); border: 2px solid var(--void);
}

/* ---------- calendar ---------- */
.cal-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: 6px; }
.cal-cell {
  border: 1px solid var(--line); background: var(--panel); border-radius: 3px;
  padding: 9px 9px 8px; text-align: left; color: var(--text-dim);
  transition: border-color .18s, transform .18s var(--ease);
  display: block; width: 100%;
}
.cal-cell:hover { border-color: var(--ember); transform: translateY(-2px); text-decoration: none; }
.cal-cell .cs {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 15px; color: var(--text); display: block;
}
.cal-cell .cd { font-family: var(--font-mono); font-size: 9.5px; color: var(--text-faint); display: block; margin-top: 3px; }
.cal-cell .cl { font-family: var(--font-mono); font-size: 9px; color: var(--sand-dim); display: block; }
.cal-cell.today { border-color: var(--amber); background: color-mix(in srgb, var(--amber) 8%, var(--panel)); }
.cal-cell.today .cs { color: var(--amber); }
.cal-cell.origin-cell { border-color: var(--ember); }
.season-bar { display: flex; height: 6px; border-radius: 3px; overflow: hidden; margin: 10px 0 4px; }
.season-bar div { height: 100%; }

/* ---------- watch faces ---------- */
.face-shell {
  display: flex; align-items: center; justify-content: center;
  min-height: 380px; padding: 26px;
  border: 1px solid var(--line); border-radius: var(--r);
  background: radial-gradient(600px 300px at 50% 0%, rgba(193, 68, 14, .12), transparent 70%), var(--panel);
}
.face-mission { width: 100%; max-width: 560px; }
.face-mission .big {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(40px, 11vw, 76px); color: var(--amber); line-height: 1; letter-spacing: .02em;
}
.face-minimal { text-align: center; }
.face-minimal .m-sol {
  font-family: var(--font-mono); font-size: 12px; letter-spacing: .5em; color: var(--text-faint);
}
.face-minimal .m-time {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(48px, 16vw, 108px); font-weight: 300; color: var(--text); line-height: 1;
}
.face-rover .bars { display: grid; gap: 7px; }
.bar-line { display: grid; grid-template-columns: 92px 1fr 74px; gap: 10px; align-items: center; }
.bar-line .bl {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
}
.bar-line .bt { height: 8px; background: var(--void); border: 1px solid var(--line); position: relative; }
.bar-line .bf { position: absolute; inset: 0 auto 0 0; background: linear-gradient(90deg, var(--rust), var(--amber)); }
.bar-line .bv { font-family: var(--font-mono); font-size: 11.5px; text-align: right; color: var(--sand); }
.analog { display: block; margin: 0 auto; max-width: 340px; width: 100%; }
.face-picker { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 16px; }

/* ---------- globe page ---------- */
.globe-wrap { position: relative; border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: #050406; }
.globe-canvas { display: block; width: 100%; height: clamp(300px, 56vh, 560px); cursor: grab; touch-action: pan-y; }
.globe-canvas:active { cursor: grabbing; }
.globe-badge {
  position: absolute; left: 12px; bottom: 12px;
  font-family: var(--font-mono); font-size: 9px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-faint);
  background: rgba(0, 0, 0, .55); border: 1px solid var(--line); padding: 4px 8px;
}
.globe-controls { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- sky strip ---------- */
.sky {
  position: relative; height: 170px; border: 1px solid var(--line); border-radius: var(--r);
  overflow: hidden; background: linear-gradient(180deg, #0b0a10 0%, #16110f 62%, #241812 100%);
}
.sky .horizon { position: absolute; left: 0; right: 0; bottom: 34px; height: 1px; background: rgba(217, 194, 163, .3); }
.sky .ground { position: absolute; left: 0; right: 0; bottom: 0; height: 34px; background: linear-gradient(180deg, #3a2317, #1d120c); }
.sky .sun {
  position: absolute; width: 16px; height: 16px; border-radius: 50%;
  background: #ffd9a0; box-shadow: 0 0 26px 10px rgba(255, 186, 108, .35); transform: translate(-50%, 50%);
}
.sky .lbl {
  position: absolute; font-family: var(--font-mono); font-size: 9px;
  letter-spacing: .16em; color: var(--text-faint); bottom: 10px; transform: translateX(-50%);
}

/* ---------- formula viewer ---------- */
.formula { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel); margin-top: 10px; }
.formula > summary {
  cursor: pointer; padding: 10px 13px; list-style: none;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--amber);
}
.formula > summary::-webkit-details-marker { display: none; }
.formula > summary::before { content: "▸ "; }
.formula[open] > summary::before { content: "▾ "; }
.formula-body { padding: 0 13px 14px; }
.step { border-left: 1px solid var(--line); padding: 8px 0 8px 14px; margin-left: 4px; position: relative; }
.step::before {
  content: ""; position: absolute; left: -4px; top: 15px; width: 7px; height: 7px;
  background: var(--void); border: 1px solid var(--ember); border-radius: 50%;
}
.step .sl {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--text-faint);
}
.step .sf {
  font-family: var(--font-mono); font-size: 12px; color: var(--sand);
  white-space: pre-wrap; word-break: break-word; margin: 3px 0;
}
.step .sv { font-family: var(--font-mono); font-size: 13px; color: var(--text); }
.step.out .sv { color: var(--amber); font-size: 16px; }

/* ---------- validation table ---------- */
.vtable { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.vtable th, .vtable td {
  text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--line-soft);
  font-family: var(--font-mono);
}
.vtable th {
  font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-faint); border-bottom-color: var(--line);
}
.vtable td.name { font-family: var(--font-sans); color: var(--text-dim); }
.vtable .pass { color: var(--ok); }
.vtable .fail { color: var(--bad); }

/* ---------- mission / journal ---------- */
.mission-clock {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(30px, 8vw, 54px); color: var(--amber); line-height: 1;
}
.list-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: var(--r);
  background: var(--panel); margin-bottom: 8px;
}
.list-item .li-t { font-family: var(--font-mono); font-size: 13px; }
.list-item .li-s { font-size: 11.5px; color: var(--text-faint); font-family: var(--font-mono); }

/* ---------- footer ---------- */
footer {
  border-top: 1px solid var(--line); padding: 30px 0 100px; margin-top: 40px;
  text-align: center; position: relative; z-index: 1;
}
footer .fbadge {
  width: 56px; height: 56px; border-radius: 50%; display: block; margin: 0 auto 14px;
  box-shadow: 0 0 0 1px rgba(217, 194, 163, .16), 0 6px 22px rgba(0, 0, 0, .55);
}
footer .fbrand { font-size: 12px; letter-spacing: .3em; }
footer .ftag {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .3em;
  color: var(--text-faint); text-transform: uppercase; margin-top: 6px;
}
footer .flinks { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin-top: 14px; }
footer .flinks a { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em; text-transform: uppercase; color: var(--text-dim); }
footer .fnote { font-size: 11.5px; color: var(--text-faint); max-width: 620px; margin: 16px auto 0; }

/* ---------- bottom nav (mobile) ---------- */
.bottomnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 60;
  display: none; grid-template-columns: repeat(5, 1fr);
  background: color-mix(in srgb, var(--void) 94%, transparent);
  backdrop-filter: blur(14px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.bottomnav a {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 9px 2px 8px; color: var(--text-faint);
  font-family: var(--font-mono); font-size: 8.5px; letter-spacing: .12em; text-transform: uppercase;
}
.bottomnav a svg { width: 19px; height: 19px; }
.bottomnav a[aria-current="page"] { color: var(--amber); }
.bottomnav a:hover { text-decoration: none; }
@media (max-width: 780px) {
  .bottomnav { display: grid; }
  .nav { display: none; }
  footer { padding-bottom: 120px; }
  .topbar { height: 52px; }
  .view { padding-top: 22px; }
}

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%) translateY(20px);
  background: var(--panel-2); border: 1px solid var(--line); border-left: 2px solid var(--amber);
  color: var(--text); padding: 11px 16px; border-radius: var(--r); font-size: 13px;
  z-index: 100; opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s var(--ease);
  max-width: min(420px, 90vw);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- accessibility: motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; }
}
body[data-motion="off"] .dot { animation: none; }
body[data-motion="off"] .view { animation: none; }

/* ---------- print / PDF calendar ---------- */
@media print {
  :root { --void: #fff; --panel: #fff; --panel-2: #fff; --line: #bbb; --text: #000; --text-dim: #333; --text-faint: #666; --amber: #8a4b00; --sand: #5a4632; }
  body { background: #fff; color: #000; }
  body::before, .topbar, .bottomnav, .hero-globe, .globe-wrap, .btn, .toast, .no-print { display: none !important; }
  .panel, .cell, .cal-cell, .msol, .bc, .tzcard { border-color: #bbb !important; background: #fff !important; }
  .view { padding: 0; animation: none; }
  .cal-grid { grid-template-columns: repeat(7, 1fr); }
  a { color: #000; }
  .print-head { display: block !important; text-align: center; margin-bottom: 18px; }

  /* the Mars month grid is the thing people actually print */
  .base-head::before, .topo::before, .callegend, .monthstrip, .calnav,
  .notice, .formula, footer { display: none !important; }
  .mgrid { gap: 0; page-break-inside: avoid; }
  .mgrid .wh, .mgrid .wk { color: #000; border-bottom: 1px solid #bbb; }
  .msol {
    min-height: 92px; border-radius: 0; box-shadow: none !important;
    border: 1px solid #bbb !important; break-inside: avoid;
  }
  .msol.blank { border-style: solid !important; }
  .msol.today { background: #f2f2f2 !important; }
  .msol.today .md, .msol .md { color: #000; }
  .msol .ms, .msol .mev { color: #333; }
  .msol .lit-strip, .msol .bdot { display: none; }
  .msol .bnow { color: #000; border-color: #000; }
  .calbar .cal-month, .calbar .cal-year { color: #000; }
  @page { size: landscape; margin: 12mm; }
}
.print-head { display: none; }


/* =====================================================================
   MARS BASE CONSOLE — Ganges Chasma
   An operations screen: dense, monospaced, instrument-like. The panels
   below are deliberately quieter than the hero so the live numbers lead.
   ===================================================================== */
.base-head {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--r-lg);
  background:
    radial-gradient(120% 140% at 12% 0%, rgba(193, 68, 14, .20), transparent 58%),
    linear-gradient(180deg, rgba(255, 255, 255, .04), transparent 45%),
    var(--panel);
  padding: 26px clamp(18px, 4vw, 34px);
}
/* faint topographic contour field, drawn in CSS - no image request */
.base-head::before,
.topo::before {
  content: ""; position: absolute; inset: -40% -10%; pointer-events: none;
  background-image:
    repeating-radial-gradient(ellipse 62% 40% at 22% 34%,
      transparent 0 17px, rgba(217, 194, 163, .055) 17px 18px),
    repeating-radial-gradient(ellipse 48% 66% at 84% 72%,
      transparent 0 21px, rgba(193, 68, 14, .06) 21px 22px);
  opacity: .8; mask-image: linear-gradient(180deg, #000 10%, transparent 92%);
}
.topo { position: relative; overflow: hidden; }
.base-head > * { position: relative; }
.base-crest { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.base-crest img {
  width: 74px; height: 74px; border-radius: 50%; flex-shrink: 0;
  box-shadow: 0 0 0 1px rgba(217, 194, 163, .22), 0 0 30px rgba(193, 68, 14, .3);
}
.base-crest .station {
  font-family: var(--font-mono); font-size: clamp(15px, 2.6vw, 21px);
  letter-spacing: .16em; text-transform: uppercase; color: var(--text);
  line-height: 1.25;
}
.base-crest .where {
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .14em;
  color: var(--sand); text-transform: uppercase; margin-top: 5px;
}
.base-crest .fict {
  font-size: 11.5px; color: var(--text-dim); margin-top: 7px; max-width: 46ch;
}
.base-clock {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 14px; margin-top: 24px;
}
.bc {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(0, 0, 0, .32); padding: 13px 15px;
}
.bc .bk {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .18em;
  text-transform: uppercase; color: var(--text-dim);
}
.bc .bv {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: clamp(21px, 3.4vw, 29px); margin-top: 7px; color: var(--text);
}
.bc .bv.lead { color: var(--amber); }
.bc .bn { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }
.bc.wide { grid-column: span 2; }

/* status pill: day / night / twilight at the base right now */
.daystate {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em;
  text-transform: uppercase; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .3);
}
.daystate .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-dim); }
.daystate[data-state="day"] { color: var(--amber); border-color: rgba(240, 164, 55, .4); }
.daystate[data-state="day"] .dot { background: var(--amber); box-shadow: 0 0 10px var(--amber); }
.daystate[data-state="twilight"] { color: var(--ember); border-color: rgba(226, 100, 58, .4); }
.daystate[data-state="twilight"] .dot { background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.daystate[data-state="night"] { color: var(--ice); border-color: rgba(188, 212, 230, .3); }
.daystate[data-state="night"] .dot { background: var(--ice); box-shadow: 0 0 10px rgba(188, 212, 230, .7); }

/* one sol as a bar: night | day | night, with a live position needle */
.termbar { margin-top: 6px; }
.termbar .tb {
  position: relative; height: 30px; border-radius: 6px; overflow: hidden;
  border: 1px solid var(--line);
  background: linear-gradient(90deg, #0a0d14, #0d1119);
}
.termbar .lit {
  position: absolute; top: 0; bottom: 0;
  background: linear-gradient(180deg, rgba(240, 164, 55, .5), rgba(193, 68, 14, .42));
}
.termbar .twi { position: absolute; top: 0; bottom: 0; width: 2.5%; background: rgba(226, 100, 58, .55); }
.termbar .needle { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--text); box-shadow: 0 0 8px rgba(255, 255, 255, .8); }
.termbar .marks {
  display: flex; justify-content: space-between; margin-top: 6px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .1em;
  color: var(--text-dim); text-transform: uppercase;
}

/* sun position: azimuth compass + elevation arc */
.sundial { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.sundial svg { width: 100%; height: auto; display: block; }
@media (max-width: 560px) { .sundial { grid-template-columns: 1fr; } }

/* Mars Year progress rails */
.yearrail { margin-top: 18px; }
.yearrail + .yearrail { margin-top: 14px; }
.yearrail .yr-top {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim); margin-bottom: 7px;
}
.yearrail .yr-top b { color: var(--text); font-size: 12.5px; letter-spacing: .1em; }
.yearrail .yr-track {
  height: 8px; border-radius: 999px; background: rgba(255, 255, 255, .07);
  overflow: hidden; position: relative;
}
.yearrail .yr-fill { height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--rust), var(--amber)); }
.yearrail.alt .yr-fill { background: linear-gradient(90deg, #2f5d7a, var(--ice)); }
.yearrail .yr-seasons { position: absolute; inset: 0; }
.yearrail .yr-seasons i { position: absolute; top: 0; bottom: 0; width: 1px; background: rgba(255, 255, 255, .35); }
.yearrail .yr-note { font-size: 11px; color: var(--text-dim); margin-top: 6px; }

/* Mars Years table */
.ytable { width: 100%; border-collapse: collapse; font-family: var(--font-mono); font-size: 11.5px; }
.ytable th {
  text-align: left; font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--text-dim); font-weight: 500; padding: 9px 10px; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; background: var(--panel);
}
.ytable td { padding: 9px 10px; border-bottom: 1px solid rgba(255, 255, 255, .05); font-variant-numeric: tabular-nums; }
.ytable tr.now td { background: rgba(193, 68, 14, .14); color: var(--text); }
.ytable tr.now td:first-child { box-shadow: inset 3px 0 0 var(--amber); }
.ytable .num { text-align: right; }
.ytable-scroll { max-height: 460px; overflow: auto; border: 1px solid var(--line); border-radius: var(--r-md); }
@media (max-width: 640px) { .ytable .hide-s { display: none; } }

/* orbital position indicator */
.orbit-mini svg { width: 100%; height: auto; display: block; }

/* =====================================================================
   MARS CALENDAR — month grid
   ===================================================================== */
.calbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; flex-wrap: wrap; margin-bottom: 18px;
}
.calbar .cal-title { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.calbar .cal-month {
  font-family: var(--font-mono); font-size: clamp(22px, 4vw, 34px);
  letter-spacing: .08em; text-transform: uppercase; color: var(--text);
}
.calbar .cal-year {
  font-family: var(--font-mono); font-size: 13px; letter-spacing: .2em;
  color: var(--amber); text-transform: uppercase;
}
.calbar .cal-sub { font-size: 11.5px; color: var(--text-dim); width: 100%; }
.calnav { display: flex; gap: 8px; flex-wrap: wrap; }

.mgrid { display: grid; grid-template-columns: 34px repeat(7, 1fr); gap: 6px; }
.mgrid .wh, .mgrid .wk {
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .14em;
  text-transform: uppercase; color: var(--text-dim); text-align: center;
  padding: 6px 0;
}
.mgrid .wk { align-self: center; font-size: 9px; opacity: .75; }
.mgrid .wh.sun-col { color: var(--sand); }
.msol {
  position: relative; border: 1px solid var(--line); border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .028), transparent);
  padding: 8px 8px 9px; min-height: 82px; text-align: left;
  font-family: inherit; color: inherit; cursor: pointer; overflow: hidden;
  transition: border-color .18s ease, transform .18s ease, background .18s ease;
}
.msol:hover {
  border-color: rgba(240, 164, 55, .5); transform: translateY(-2px);
  background: rgba(240, 164, 55, .07);
}
[data-motion="off"] .msol:hover { transform: none; }
.msol:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; }
.msol .md {
  font-family: var(--font-mono); font-size: 16px; font-variant-numeric: tabular-nums;
  color: var(--text); line-height: 1;
}
.msol .ms {
  font-family: var(--font-mono); font-size: 9.5px; color: var(--text-dim);
  margin-top: 5px; letter-spacing: .04em;
}
.msol .mev {
  font-family: var(--font-mono); font-size: 9px; color: var(--sand);
  margin-top: 7px; display: flex; flex-direction: column; gap: 2px; opacity: .9;
}
.msol .mev span { display: flex; gap: 4px; align-items: center; }
.msol .mev .pending { color: var(--text-dim); opacity: .6; }
.msol.blank { border-style: dashed; border-color: rgba(255, 255, 255, .05); background: none; cursor: default; }
.msol.blank:hover { transform: none; background: none; border-color: rgba(255, 255, 255, .05); }
.msol.today {
  border-color: var(--rust);
  background:
    radial-gradient(120% 100% at 100% 0%, rgba(193, 68, 14, .34), transparent 60%),
    rgba(193, 68, 14, .12);
  box-shadow: 0 0 0 1px rgba(240, 164, 55, .35), 0 8px 26px rgba(193, 68, 14, .22);
}
.msol.today .md { color: var(--amber); }
.msol .badge-row { position: absolute; top: 7px; right: 8px; display: flex; gap: 4px; align-items: center; }
.msol .bdot { width: 6px; height: 6px; border-radius: 50%; }
.msol .bdot.base { background: var(--ice); box-shadow: 0 0 7px rgba(188, 212, 230, .8); }
.msol .bnow {
  font-family: var(--font-mono); font-size: 8px; letter-spacing: .1em;
  color: var(--amber); border: 1px solid rgba(240, 164, 55, .45);
  border-radius: 3px; padding: 1px 3px;
}
/* strip showing where in the sol the sun is up, per cell */
.msol .lit-strip {
  position: absolute; left: 0; right: 0; bottom: 0; height: 3px;
  background: rgba(255, 255, 255, .06);
}
.msol .lit-strip i { position: absolute; top: 0; bottom: 0; background: linear-gradient(90deg, var(--rust), var(--amber)); }
.msol .lit-strip u { position: absolute; top: -1px; bottom: -1px; width: 2px; background: #fff; }

@media (max-width: 720px) {
  .mgrid { grid-template-columns: 22px repeat(7, 1fr); gap: 4px; }
  .msol { min-height: 62px; padding: 6px 5px; border-radius: 8px; }
  .msol .md { font-size: 13px; }
  .msol .ms { font-size: 8px; margin-top: 3px; }
  .msol .mev { display: none; }
}

.callegend {
  display: flex; gap: 16px; flex-wrap: wrap; margin-top: 16px;
  font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--text-dim);
}
.callegend span { display: flex; align-items: center; gap: 6px; }
.callegend i { width: 9px; height: 9px; border-radius: 3px; display: inline-block; }

/* month strip: all 12 months of the year */
.monthstrip { display: grid; grid-template-columns: repeat(auto-fit, minmax(88px, 1fr)); gap: 8px; }
.monthstrip button {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .08em;
  text-transform: uppercase; padding: 9px 6px; border-radius: 8px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .25);
  color: var(--text-dim); cursor: pointer; transition: all .18s ease;
}
.monthstrip button:hover { color: var(--text); border-color: rgba(240, 164, 55, .4); }
.monthstrip button[aria-pressed="true"] { color: var(--amber); border-color: var(--rust); background: rgba(193, 68, 14, .16); }
.monthstrip button i { display: block; font-style: normal; font-size: 8.5px; opacity: .65; margin-top: 3px; }

/* =====================================================================
   EARTH TIME — timezone board
   ===================================================================== */
.tzsearch { position: relative; margin-bottom: 14px; }
.tzboard { display: grid; grid-template-columns: repeat(auto-fit, minmax(228px, 1fr)); gap: 12px; }
.tzcard {
  border: 1px solid var(--line); border-radius: var(--r-md);
  background: rgba(0, 0, 0, .28); padding: 14px 15px; position: relative;
}
.tzcard.primary { border-color: rgba(240, 164, 55, .42); background: rgba(193, 68, 14, .1); }
.tzcard .tzh { display: flex; align-items: center; gap: 8px; }
.tzcard .flag { font-size: 17px; line-height: 1; }
.tzcard .tzn {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: .12em;
  text-transform: uppercase; color: var(--text-dim);
}
.tzcard .tzt {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 27px; margin-top: 9px; color: var(--text);
}
.tzcard.primary .tzt { color: var(--amber); }
.tzcard .tzd { font-family: var(--font-mono); font-size: 10.5px; color: var(--text-dim); margin-top: 5px; }
.tzcard .rm {
  position: absolute; top: 9px; right: 9px; background: none; border: none;
  color: var(--text-dim); cursor: pointer; font-size: 15px; line-height: 1; padding: 2px 5px;
  border-radius: 4px;
}
.tzcard .rm:hover { color: var(--ember); background: rgba(255, 255, 255, .06); }
.tzcard .daynight { font-size: 10.5px; color: var(--text-dim); margin-top: 4px; }

/* nav divider between the primary sections and the rest */
.topbar .nav .nav-div {
  width: 1px; height: 15px; background: var(--line); margin: 0 4px; flex-shrink: 0;
}

/* Mars calendar date under the hero sol counter */
.hero .mars-date {
  font-size: clamp(12px, 2.2vw, 15px); letter-spacing: .22em;
  text-transform: uppercase; color: var(--sand); margin-top: 12px;
}
