/*
 * Atlas — design system for the device browser + per-device pages.
 *
 * Aesthetic: editorial reference book meets developer docs.
 *   - Fraunces (variable serif) for display
 *   - Geist (sans) for UI body
 *   - JetBrains Mono for versions / codenames / SHAs
 *   - Deep slate canvas with hairline borders, no card shadows
 *   - Mint accent for inert state, coral for active selection
 *   - Pale gold for monospace numerals
 *
 * Loaded only on devices.html and device.html alongside style.css.
 * style.css already provides --bg / --text / --accent etc; we override the
 * subset that drives the atlas surface.
 */


:root {
  --atlas-canvas: #0f1216;
  --atlas-paper: #161b22;
  --atlas-paper-2: #1c2230;
  --atlas-rule: rgba(255, 255, 255, 0.07);
  --atlas-rule-strong: rgba(255, 255, 255, 0.16);
  --atlas-ink: #e7eaf2;
  --atlas-ink-2: #c0c6d3;
  --atlas-ink-mute: #7a8392;
  --atlas-mint: #5eead4;
  --atlas-coral: #fb7185;
  --atlas-gold: #fde68a;
  --atlas-violet: #a78bfa;

  --atlas-display: "Fraunces", "Times New Roman", serif;
  --atlas-sans: "Geist", system-ui, -apple-system, "Segoe UI", sans-serif;
  --atlas-mono: "JetBrains Mono", "SF Mono", "Cascadia Code", Consolas, monospace;

  --atlas-rail-w: 320px;
  --atlas-content-max: 980px;
  --atlas-line-h: 1.55;

  /* Alignment system — consistent rhythm across every page. */
  --atlas-pad-x: 24px;             /* horizontal gutter inside .atlas-wrap */
  --atlas-card-pad: 22px;           /* card / panel inner padding */
  --atlas-card-pad-lg: 28px;        /* hero / detail card */
  --atlas-section-gap: 32px;        /* vertical gap between top-level sections */
  --atlas-row-gap: 12px;             /* default row gap (button rows, meta rows) */
  --atlas-radius: 0;                  /* hairline edges; per-theme can override */
  --atlas-control-h: 40px;            /* unified input/button minimum height */
  --atlas-shell-max: 1380px;          /* outer page max width */
}

:root.light-theme {
  /* Bumped contrast — previous canvas/paper/paper-2 (cream→white→light-grey)
     were within 1.5% of each other, making cards near-invisible on the page.
     Now: warm-stone canvas → near-white paper → off-white paper-2 with
     enough delta to read at a glance. */
  --atlas-canvas: #e8e5dc;
  --atlas-paper: #faf8f3;
  --atlas-paper-2: #efece2;
  --atlas-rule: rgba(15, 18, 22, 0.14);
  --atlas-rule-strong: rgba(15, 18, 22, 0.28);
  --atlas-ink: #0f1216;
  --atlas-ink-2: #2a3140;
  --atlas-ink-mute: #5a6478;
  --atlas-mint: #0d9488;
  --atlas-coral: #be123c;
  --atlas-gold: #92400e;
  --atlas-violet: #6d28d9;
}

/* Dark mode: nav.js's 🌙 toggle adds .dark-theme, but no CSS ever implemented
   it — so with an editorial theme active (e.g. magazine) the page kept that
   theme's light palette in "dark". Re-assert the dark tokens here. The
   [data-theme] form has specificity (0,3,0), which outranks the theme files'
   :root[data-theme="…"] (0,2,0), so an explicit dark choice wins on every theme. */
:root.dark-theme,
:root.dark-theme[data-theme] {
  --atlas-canvas: #0f1216;
  --atlas-paper: #161b22;
  --atlas-paper-2: #1c2230;
  --atlas-rule: rgba(255, 255, 255, 0.07);
  --atlas-rule-strong: rgba(255, 255, 255, 0.16);
  --atlas-ink: #e7eaf2;
  --atlas-ink-2: #c0c6d3;
  --atlas-ink-mute: #7a8392;
  --atlas-mint: #5eead4;
  --atlas-coral: #fb7185;
  --atlas-gold: #fde68a;
  --atlas-violet: #a78bfa;
}

/* ── Page-level chrome ──────────────────────────────────────────── */

body.atlas {
  background:
    radial-gradient(1200px 600px at 12% -10%, rgba(94, 234, 212, 0.06), transparent 60%),
    radial-gradient(800px 500px at 95% 5%, rgba(251, 113, 133, 0.05), transparent 55%),
    var(--atlas-canvas);
  color: var(--atlas-ink);
  font-family: var(--atlas-sans);
  font-feature-settings: "ss01", "cv11";
}

body.atlas .topbar {
  background: rgba(15, 18, 22, 0.72);
  border-bottom: 1px solid var(--atlas-rule);
}

:root.light-theme body.atlas .topbar { background: rgba(232, 229, 220, 0.86); }

/* The topbar — and the mobile menu that drops out of it — must always paint
   above the page. Theme layers set `body.atlas > * { z-index: 2 }` on every
   direct child of body, which otherwise caps the topbar at the same level as
   <main>; since <main> comes later in the DOM it paints OVER the open mobile
   dropdown, leaving the menu transparent/unreadable with the hero showing
   through. !important so it wins regardless of which theme layer loads last. */
body.atlas .topbar { z-index: 1000 !important; }

/* Light-theme: force Atlas tokens onto the legacy .card / .tile / inputs /
   pills / links / nav so the donate / devices / device / programs / etc.
   pages all read correctly. The legacy classes don't have light-theme
   variants for every property the Atlas surfaces use, so we re-apply here. */
:root.light-theme body.atlas .card,
:root.light-theme body.atlas .tile {
  background: var(--atlas-paper);
  border: 1px solid var(--atlas-rule);
  color: var(--atlas-ink);
}
:root.light-theme body.atlas input,
:root.light-theme body.atlas select,
:root.light-theme body.atlas textarea {
  background: var(--atlas-paper);
  color: var(--atlas-ink);
  border: 1px solid var(--atlas-rule-strong);
}
:root.light-theme body.atlas .muted { color: var(--atlas-ink-mute); }
:root.light-theme body.atlas .pill {
  background: var(--atlas-paper-2);
  color: var(--atlas-ink-2);
  border: 1px solid var(--atlas-rule);
}
:root.light-theme body.atlas a:not(.btn):not(.home-cta):not(.atlas-btn):not(.relocate-cta) { color: var(--atlas-mint); }
:root.light-theme body.atlas .nav a,
:root.light-theme body.atlas .logo,
:root.light-theme body.atlas .logo a { color: var(--atlas-ink); }
:root.light-theme body.atlas h1,
:root.light-theme body.atlas h2,
:root.light-theme body.atlas h3,
:root.light-theme body.atlas .h1,
:root.light-theme body.atlas .h2,
:root.light-theme body.atlas .h3 { color: var(--atlas-ink); }

/* ── Atlas wrap ─────────────────────────────────────────────────── */

.atlas-wrap {
  max-width: 1380px;
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.atlas-h1 {
  font-family: var(--atlas-display);
  font-weight: 350;
  font-size: clamp(36px, 6vw, 72px);
  letter-spacing: -0.02em;
  line-height: 1.02;
  margin: 0 0 8px;
  color: var(--atlas-ink);
}
.atlas-h1 em {
  font-style: italic;
  font-weight: 300;
  color: var(--atlas-mint);
  font-feature-settings: "ss02";
}
.atlas-kicker {
  font-family: var(--atlas-mono);
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
  margin: 0 0 18px;
}
.atlas-lede {
  font-family: var(--atlas-display);
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.5;
  color: var(--atlas-ink-2);
  max-width: 64ch;
  margin: 0 0 28px;
  font-weight: 350;
}

/* ── Brand atlas (devices.html) ─────────────────────────────────── */

.atlas-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 18px 0;
  border-top: 1px solid var(--atlas-rule);
  border-bottom: 1px solid var(--atlas-rule);
  margin: 22px 0 36px;
}
.atlas-stat {
  flex: 1 1 140px;
  min-width: 0;
  padding: 4px 18px;
  border-right: 1px solid var(--atlas-rule);
}
.atlas-stat:last-child { border-right: 0; }
@media (max-width: 600px) {
  .atlas-stat {
    flex-basis: calc(50% - 1px);
    padding: 10px 14px;
  }
  /* In 2-per-row mode, hide the right border on every 2nd cell (end of row)
     and the bottom border on the last row (handled by :last-child rule) */
  .atlas-stat:nth-child(2n) { border-right: 0; }
}
.atlas-stat-num {
  font-family: var(--atlas-mono);
  font-size: 28px;
  letter-spacing: -0.01em;
  color: var(--atlas-gold);
  display: block;
  line-height: 1;
}
.atlas-stat-label {
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
  display: block;
  margin-top: 8px;
}

.atlas-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 18px;
  flex-wrap: wrap;
}
.atlas-search {
  flex: 1;
  min-width: 240px;
  position: relative;
}
.atlas-search input {
  width: 100%;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--atlas-rule-strong);
  padding: 12px 0 12px 28px;
  font-family: var(--atlas-sans);
  font-size: 16px;
  color: var(--atlas-ink);
  outline: none;
  transition: border-color 0.15s ease;
}
.atlas-search input:focus { border-bottom-color: var(--atlas-mint); }
.atlas-search::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  border: 1.5px solid var(--atlas-ink-mute);
  border-radius: 50%;
}
.atlas-search::after {
  content: "";
  position: absolute;
  left: 16px;
  top: calc(50% + 6px);
  width: 7px;
  height: 1.5px;
  background: var(--atlas-ink-mute);
  transform: rotate(45deg);
}
/* The generic control-height rule `body.atlas input[type=search]{padding:0 12px}`
   outranks `.atlas-search input`, collapsing its left padding to 12px so the
   placeholder text ran under the magnifier glyph (desktop and mobile). Restore
   room for the icon with a higher-specificity selector. */
body.atlas .atlas-search input[type="search"] { padding: 12px 0 12px 30px; }
.atlas-pill {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 8px 12px;
  border: 1px solid var(--atlas-rule-strong);
  border-radius: 999px;
  color: var(--atlas-ink-2);
  background: transparent;
  cursor: pointer;
  transition: all 0.15s ease;
}
.atlas-pill:hover { color: var(--atlas-mint); border-color: var(--atlas-mint); }
.atlas-pill.active { color: var(--atlas-canvas); background: var(--atlas-mint); border-color: var(--atlas-mint); }

/* Brand grid */

.atlas-brands {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0;
  border-top: 1px solid var(--atlas-rule);
  border-left: 1px solid var(--atlas-rule);
}
.atlas-brand {
  position: relative;
  padding: 22px 22px 20px;
  border-right: 1px solid var(--atlas-rule);
  border-bottom: 1px solid var(--atlas-rule);
  background: var(--atlas-paper);
  cursor: pointer;
  transition: background 0.15s ease;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  text-decoration: none;
  color: inherit;
  min-height: 138px;
}
.atlas-brand:hover { background: var(--atlas-paper-2); }
.atlas-brand[aria-expanded="true"] { background: var(--atlas-paper-2); }
.atlas-brand-num {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  color: var(--atlas-ink-mute);
}
.atlas-brand-name {
  font-family: var(--atlas-display);
  font-size: 28px;
  font-weight: 400;
  letter-spacing: -0.015em;
  margin-top: 18px;
  line-height: 1.05;
}
.atlas-brand-meta {
  font-family: var(--atlas-mono);
  font-size: 12px;
  color: var(--atlas-ink-mute);
  margin-top: auto;
  padding-top: 18px;
  display: flex;
  gap: 14px;
}
.atlas-brand-meta b { color: var(--atlas-gold); font-weight: 500; }

/* Model list (revealed under selected brand) */

.atlas-models {
  border: 1px solid var(--atlas-rule);
  border-top: 0;
  background: var(--atlas-paper);
  padding: 0;
  display: none;
}
.atlas-models.open { display: block; }
.atlas-models-head {
  padding: 16px 22px;
  border-bottom: 1px solid var(--atlas-rule);
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}
.atlas-models-head h2 {
  font-family: var(--atlas-display);
  font-weight: 350;
  font-size: 22px;
  margin: 0;
}
.atlas-models-head .muted {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
}
.atlas-model-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 0;
}
.atlas-model {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 18px;
  border-right: 1px solid var(--atlas-rule);
  border-bottom: 1px solid var(--atlas-rule);
  text-decoration: none;
  color: inherit;
  transition: background 0.12s ease, color 0.12s ease;
}
.atlas-model:hover {
  background: var(--atlas-paper-2);
  color: var(--atlas-mint);
}
.atlas-model-thumb {
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--atlas-rule);
  border-radius: 10px;
  background: var(--atlas-paper);
  overflow: hidden;
  transition: border-color 0.15s ease;
}
.atlas-model:hover .atlas-model-thumb {
  border-color: var(--atlas-mint);
}
.atlas-model-thumb img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
  transition: transform 0.25s ease;
}
.atlas-model:hover .atlas-model-thumb img {
  transform: scale(1.04);
}
.atlas-model-thumb-fallback {
  font-family: var(--atlas-display);
  font-size: 18px;
  letter-spacing: 0.02em;
  color: var(--atlas-ink-mute);
  font-weight: 400;
}
.atlas-model-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2px;
  min-width: 0;
  flex: 1;
}
.atlas-model-name {
  font-size: 15px;
  font-weight: 500;
  letter-spacing: -0.005em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.atlas-model-code {
  font-family: var(--atlas-mono);
  font-size: 11px;
  color: var(--atlas-ink-mute);
  letter-spacing: 0.04em;
}
.atlas-model:hover .atlas-model-code { color: var(--atlas-mint); }

/* Empty state */

.atlas-empty {
  padding: 80px 24px;
  text-align: center;
  border: 1px dashed var(--atlas-rule-strong);
  color: var(--atlas-ink-mute);
  font-family: var(--atlas-display);
  font-size: 18px;
}

/* ── Per-device page ────────────────────────────────────────────── */

.atlas-device {
  display: grid;
  grid-template-columns: var(--atlas-rail-w) 1fr;
  gap: 0;
  border-top: 1px solid var(--atlas-rule);
  min-height: calc(100vh - 200px);
}

@media (max-width: 920px) {
  .atlas-device { grid-template-columns: 1fr; }
}

/* Left rail */

.atlas-rail {
  border-right: 1px solid var(--atlas-rule);
  padding: 24px 0 40px;
  position: sticky;
  top: 64px;
  align-self: start;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--atlas-rule-strong) transparent;
}
@media (max-width: 920px) {
  .atlas-rail { position: static; max-height: none; border-right: 0; border-bottom: 1px solid var(--atlas-rule); }
}
.atlas-rail::-webkit-scrollbar { width: 6px; }
.atlas-rail::-webkit-scrollbar-thumb { background: var(--atlas-rule-strong); border-radius: 3px; }

.atlas-rail-head {
  padding: 0 22px 20px;
  border-bottom: 1px solid var(--atlas-rule);
  margin-bottom: 12px;
}
.atlas-rail-photo {
  width: 100%;
  aspect-ratio: 4 / 3;
  border: 1px solid var(--atlas-rule);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.02), rgba(0,0,0,0.06)),
    var(--atlas-paper);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 14px;
  transition: border-color 0.18s ease;
}
.atlas-rail-photo:hover { border-color: var(--atlas-mint); }
.atlas-rail-photo img {
  max-width: 92%;
  max-height: 92%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(0,0,0,0.25));
}
.atlas-rail-photo-fallback {
  font-family: var(--atlas-display);
  font-size: 48px;
  font-weight: 350;
  color: var(--atlas-ink-mute);
  letter-spacing: 0.02em;
}
.atlas-rail-codename {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
}
.atlas-rail-name {
  font-family: var(--atlas-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin: 8px 0 0;
}
.atlas-rail-brand {
  font-size: 12px;
  color: var(--atlas-ink-mute);
  margin-top: 6px;
}

.atlas-tree { padding: 0 12px; }

.atlas-tree-section {
  margin: 0;
  padding: 0;
}
.atlas-tree-section-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 10px 10px 14px;
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
  cursor: pointer;
  user-select: none;
  border-radius: 6px;
  transition: color 0.12s ease, background 0.12s ease;
}
.atlas-tree-section-head:hover { color: var(--atlas-ink); }
.atlas-tree-section-head .chev {
  width: 9px;
  height: 9px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.18s ease;
}
.atlas-tree-section[data-open="true"] > .atlas-tree-section-head .chev { transform: rotate(45deg); }

.atlas-tree-children { display: none; padding: 2px 0 6px; }
.atlas-tree-section[data-open="true"] > .atlas-tree-children { display: block; }

.atlas-tree-item {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 8px 14px 8px 32px;
  font-size: 14px;
  color: var(--atlas-ink-2);
  cursor: pointer;
  border-radius: 6px;
  text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
}
.atlas-tree-item:hover { background: var(--atlas-paper-2); color: var(--atlas-ink); }
.atlas-tree-item.active {
  color: var(--atlas-coral);
  background: rgba(251, 113, 133, 0.06);
}
.atlas-tree-item.active::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 4px;
  height: 16px;
  background: var(--atlas-coral);
  border-radius: 2px;
}
.atlas-tree-item .ver {
  margin-left: auto;
  font-family: var(--atlas-mono);
  font-size: 11px;
  color: var(--atlas-ink-mute);
}
.atlas-tree-item.active .ver { color: var(--atlas-coral); }

.atlas-tree-sub {
  /* second-level child group inside Custom Recovery */
  border-left: 1px solid var(--atlas-rule);
  margin: 4px 0 6px 26px;
  padding-left: 0;
}
.atlas-tree-sub-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 8px 14px;
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
}
.atlas-tree-sub-head:hover { background: var(--atlas-paper-2); }
.atlas-tree-sub-logo {
  width: 18px; height: 18px; flex: 0 0 18px;
  object-fit: contain;
  filter: grayscale(0.4);
}
.atlas-tree-sub-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--atlas-ink);
}
.atlas-tree-sub-count {
  margin-left: auto;
  font-family: var(--atlas-mono);
  font-size: 10px;
  color: var(--atlas-ink-mute);
}
.atlas-tree-sub[data-open="true"] > .atlas-tree-sub-head .chev { transform: rotate(45deg); }
.atlas-tree-sub-versions { display: none; padding: 2px 0 4px; }
.atlas-tree-sub[data-open="true"] > .atlas-tree-sub-versions { display: block; }
.atlas-tree-version {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 6px 14px 6px 44px;
  font-size: 13px;
  color: var(--atlas-ink-2);
  cursor: pointer;
  border-radius: 6px;
  transition: background 0.12s ease, color 0.12s ease;
  position: relative;
  font-family: var(--atlas-mono);
}
.atlas-tree-version:hover { background: var(--atlas-paper-2); color: var(--atlas-ink); }
.atlas-tree-version.active { color: var(--atlas-coral); background: rgba(251, 113, 133, 0.06); }
.atlas-tree-version .date {
  margin-left: auto;
  font-size: 10px;
  color: var(--atlas-ink-mute);
}
.atlas-tree-version.latest::after {
  content: "NEW";
  margin-left: 6px;
  padding: 1px 6px;
  background: var(--atlas-mint);
  color: var(--atlas-canvas);
  border-radius: 3px;
  font-size: 9px;
  letter-spacing: 0.1em;
  font-weight: 600;
}

/* Right content panel */

.atlas-content {
  padding: 32px clamp(20px, 4vw, 56px) 64px;
  max-width: var(--atlas-content-max);
}

.atlas-content-head {
  display: flex;
  align-items: center;
  gap: 18px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--atlas-rule);
  margin-bottom: 28px;
}
.atlas-content-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  background: var(--atlas-paper);
  border: 1px solid var(--atlas-rule);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 56px;
  overflow: hidden;
}
.atlas-content-logo img { width: 70%; height: 70%; object-fit: contain; }
.atlas-content-eye {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
}
.atlas-content-title {
  font-family: var(--atlas-display);
  font-weight: 400;
  font-size: clamp(28px, 4vw, 44px);
  letter-spacing: -0.018em;
  line-height: 1.05;
  margin: 4px 0 0;
}

.atlas-meta {
  display: flex;
  gap: 0;
  border-top: 1px solid var(--atlas-rule);
  border-bottom: 1px solid var(--atlas-rule);
  margin: 0 0 32px;
  flex-wrap: wrap;
}
.atlas-meta-cell {
  flex: 1 1 auto;
  min-width: 140px;
  padding: 14px 22px 14px 0;
  border-right: 1px solid var(--atlas-rule);
}
.atlas-meta-cell:last-child { border-right: 0; padding-right: 0; }
.atlas-meta-key {
  font-family: var(--atlas-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
}
.atlas-meta-val {
  margin-top: 6px;
  font-family: var(--atlas-mono);
  font-size: 14px;
  color: var(--atlas-ink);
}
.atlas-meta-val.gold { color: var(--atlas-gold); }
.atlas-meta-val.coral { color: var(--atlas-coral); }
.atlas-meta-val.mint { color: var(--atlas-mint); }

/* Rich content from admin editor */

.atlas-rich {
  font-family: var(--atlas-sans);
  font-size: 16px;
  line-height: var(--atlas-line-h);
  color: var(--atlas-ink-2);
  margin: 0 0 36px;
  /* Cap reading width — long lines on a wide content panel are hard to
     read. 70 chars is the editorial sweet spot. */
  max-width: 70ch;
  /* Prevent any embedded media or pre block from blowing the column out. */
  word-wrap: break-word;
  overflow-wrap: anywhere;
}
.atlas-rich > * { margin-left: 0; margin-right: 0; }
.atlas-rich > *:first-child { margin-top: 0; }
.atlas-rich > *:last-child { margin-bottom: 0; }
.atlas-rich h1, .atlas-rich h2, .atlas-rich h3, .atlas-rich h4 {
  font-family: var(--atlas-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  color: var(--atlas-ink);
  line-height: 1.18;
  margin: 28px 0 10px;
}
.atlas-rich h1 { font-size: 30px; }
.atlas-rich h2 { font-size: 24px; }
.atlas-rich h3 { font-size: 19px; }
.atlas-rich h4 { font-size: 16px; font-weight: 500; }
/* First heading flush with the section head above */
.atlas-rich > h1:first-child,
.atlas-rich > h2:first-child,
.atlas-rich > h3:first-child { margin-top: 0; }
.atlas-rich p { margin: 0 0 14px; }
.atlas-rich strong { color: var(--atlas-ink); font-weight: 600; }
.atlas-rich em { font-style: italic; }
.atlas-rich a {
  color: var(--atlas-mint);
  text-decoration: underline;
  text-decoration-color: rgba(94, 234, 212, 0.45);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: text-decoration-color .15s ease;
}
.atlas-rich a:hover { text-decoration-color: var(--atlas-mint); }
.atlas-rich code {
  font-family: var(--atlas-mono);
  font-size: 0.88em;
  background: var(--atlas-paper);
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid var(--atlas-rule);
  color: var(--atlas-gold);
  vertical-align: baseline;
  word-break: break-all;
}
.atlas-rich pre {
  font-family: var(--atlas-mono);
  font-size: 13px;
  background: var(--atlas-paper);
  padding: 14px 16px;
  border-radius: 8px;
  border: 1px solid var(--atlas-rule);
  overflow-x: auto;
  line-height: 1.55;
  margin: 16px 0;
  max-width: 100%;
}
.atlas-rich pre code {
  background: transparent;
  border: 0;
  padding: 0;
  color: var(--atlas-ink);
  font-size: 13px;
}
.atlas-rich blockquote {
  border-left: 3px solid var(--atlas-coral);
  padding: 4px 0 4px 20px;
  margin: 22px 0;
  color: var(--atlas-ink);
  font-family: var(--atlas-display);
  font-style: italic;
  font-size: 19px;
  line-height: 1.4;
}
.atlas-rich blockquote p:last-child { margin-bottom: 0; }
.atlas-rich ul, .atlas-rich ol {
  padding-left: 22px;
  margin: 0 0 14px;
  list-style-position: outside;
}
.atlas-rich ul { list-style: none; }
.atlas-rich ul > li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 8px;
  line-height: 1.5;
}
.atlas-rich ul > li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.65em;
  width: 6px; height: 6px;
  border: 1px solid var(--atlas-mint);
  border-radius: 50%;
  background: transparent;
}
.atlas-rich ol { counter-reset: rn; padding-left: 0; }
.atlas-rich ol > li {
  position: relative;
  padding-left: 32px;
  margin-bottom: 8px;
  line-height: 1.5;
  counter-increment: rn;
  list-style: none;
}
.atlas-rich ol > li::before {
  content: counter(rn) ".";
  position: absolute;
  left: 0;
  top: 0;
  width: 24px;
  text-align: right;
  font-family: var(--atlas-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--atlas-coral);
  font-weight: 500;
  line-height: 1.6;
}
.atlas-rich hr {
  border: 0;
  border-top: 1px solid var(--atlas-rule);
  margin: 28px 0;
}
.atlas-rich img, .atlas-rich video, .atlas-rich iframe {
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--atlas-rule);
  margin: 20px 0;
  display: block;
}
.atlas-rich iframe {
  width: 100%;
  aspect-ratio: 16 / 9;
}
.atlas-rich .figure { margin: 24px 0; }
.atlas-rich .figure-caption {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
  margin-top: 8px;
}
/* Tables in release notes (changelog grids etc.) */
.atlas-rich table {
  width: 100%;
  border-collapse: collapse;
  margin: 18px 0;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}
.atlas-rich th, .atlas-rich td {
  text-align: left;
  padding: 10px 14px;
  border-bottom: 1px solid var(--atlas-rule);
}
.atlas-rich th {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
  font-weight: 500;
  border-bottom: 1px solid var(--atlas-rule-strong);
}

/* Action row (download / donate) */

.atlas-actions {
  display: flex;
  gap: 14px;
  align-items: center;
  flex-wrap: wrap;
  padding: 24px 0;
  border-top: 1px solid var(--atlas-rule);
  border-bottom: 1px solid var(--atlas-rule);
  margin: 32px 0;
}
.atlas-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 22px;
  border-radius: 999px;
  border: 1px solid var(--atlas-rule-strong);
  font-family: var(--atlas-sans);
  font-size: 14px;
  font-weight: 500;
  color: var(--atlas-ink);
  background: transparent;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.18s ease;
  letter-spacing: -0.005em;
}
.atlas-btn:hover {
  border-color: var(--atlas-mint);
  color: var(--atlas-mint);
  transform: translateY(-1px);
}
.atlas-btn.primary {
  background: var(--atlas-mint);
  color: var(--atlas-canvas);
  border-color: var(--atlas-mint);
}
.atlas-btn.primary:hover {
  background: var(--atlas-coral);
  border-color: var(--atlas-coral);
  color: #fff;
}

/* Legacy/JS-rendered primary buttons use `.btn.primary` (style.css paints it a
   purple gradient). Under the Atlas theme, map it to the Atlas primary look so
   it stops reading as off-brand — this catches buttons injected by JS too,
   without editing each call site. Only .primary is remapped; plain .btn (tabs,
   secondary actions) keeps its existing treatment. */
body.atlas .btn.primary {
  background: var(--atlas-mint);
  border: 1px solid var(--atlas-mint);
  color: var(--atlas-canvas);
}
body.atlas .btn.primary:hover {
  background: var(--atlas-coral);
  border-color: var(--atlas-coral);
  color: #fff;
}

/* Visible keyboard focus ring (a11y). :focus-visible only triggers for keyboard
   navigation, so mouse users don't see a ring on click. Covers nav links,
   buttons, the hamburger, and form controls across every Atlas page. */
body.atlas a:focus-visible,
body.atlas button:focus-visible,
body.atlas .btn:focus-visible,
body.atlas .atlas-btn:focus-visible,
body.atlas .navToggle:focus-visible,
body.atlas input:focus-visible,
body.atlas select:focus-visible,
body.atlas textarea:focus-visible {
  outline: 2px solid var(--atlas-mint);
  outline-offset: 2px;
  border-radius: 4px;
}
.atlas-btn.coral {
  background: var(--atlas-coral);
  color: #fff;
  border-color: var(--atlas-coral);
}
.atlas-btn.coral:hover { transform: translateY(-1px); filter: brightness(1.1); }
.atlas-btn .meta {
  font-family: var(--atlas-mono);
  font-size: 11px;
  /* Inherit the button's own text colour at reduced weight so the size
     badge (e.g. "2.0 GB") stays legible on ANY button background + theme.
     The old hardcoded dark rgba() vanished on coloured buttons — e.g. the
     oxblood primary Download button in the Magazine theme (dark-on-red). */
  color: currentColor;
  opacity: 0.72;
  margin-left: 4px;
}
/* Ghost buttons (transparent bg): a touch muted, still clearly readable. */
.atlas-btn:not(.primary):not(.coral) .meta { color: var(--atlas-ink-mute); opacity: 1; }

.atlas-action-aside {
  margin-left: auto;
  font-family: var(--atlas-mono);
  font-size: 11px;
  color: var(--atlas-ink-mute);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
@media (max-width: 720px) {
  .atlas-action-aside { margin-left: 0; }
}

/* Notes section header — release notes / instructions block on device.html */
.atlas-section-head {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: baseline;
  gap: 16px;
  margin: 40px 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--atlas-rule);
}
.atlas-section-num {
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--atlas-coral);
  font-weight: 500;
  white-space: nowrap;
}
.atlas-section-head h3 {
  font-family: var(--atlas-display);
  font-weight: 400;
  font-size: 24px;
  letter-spacing: -0.012em;
  line-height: 1.2;
  margin: 0;
  color: var(--atlas-ink);
}
@media (max-width: 600px) {
  .atlas-section-head { grid-template-columns: 1fr; gap: 4px; }
  .atlas-section-head h3 { font-size: 20px; }
}

/* Initial empty / loading state */

.atlas-loading {
  font-family: var(--atlas-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
  padding: 48px 0;
  text-align: center;
}

.atlas-error {
  border: 1px solid var(--atlas-coral);
  background: rgba(251, 113, 133, 0.06);
  color: var(--atlas-coral);
  padding: 18px;
  border-radius: 8px;
  font-family: var(--atlas-mono);
  font-size: 13px;
  margin: 24px 0;
}

/* ── Global alignment polish ──────────────────────────────────────────
 *
 * Cross-page consistency layer. Standardizes:
 *   - Topbar height + padding + max-width
 *   - .atlas-wrap inner padding + max-width
 *   - Card padding rhythm
 *   - Button + input heights (40px control row)
 *   - Footer alignment
 *   - Section gaps
 *
 * Lives at the bottom of atlas.css so it overrides earlier rules where
 * needed. Per-theme files in assets/css/themes/* still win via
 * [data-theme=…] specificity.
 */

body.atlas {
  /* Tabular numerals everywhere a number is shown — versions, sizes,
     prices, counts. Keeps columns aligned without explicit widths. */
  font-variant-numeric: tabular-nums;
}

/* Topbar */
body.atlas .topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: 56px;
  display: flex;
  align-items: center;
  backdrop-filter: blur(12px);
}
body.atlas .topbar-inner {
  max-width: var(--atlas-shell-max);
  width: 100%;
  margin: 0 auto;
  padding: 10px var(--atlas-pad-x);
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: nowrap;
}
body.atlas .logo {
  font-family: var(--atlas-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.005em;
  flex: 0 0 auto;
}
body.atlas .logo a { color: inherit; text-decoration: none; }
body.atlas .nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 auto;
  flex-wrap: wrap;
  font-family: var(--atlas-sans);
  font-size: 14px;
  font-weight: 500;
}
body.atlas .nav a {
  text-decoration: none;
  color: var(--atlas-ink-2);
  padding: 6px 0;
  border-bottom: 1px solid transparent;
  transition: color .15s ease, border-color .15s ease;
}
body.atlas .nav a:hover { color: var(--atlas-mint); }
body.atlas .nav a[aria-current="page"] {
  color: var(--atlas-coral);
  border-bottom-color: var(--atlas-coral);
}
body.atlas .langSelect {
  flex: 0 0 auto;
  min-width: 96px;
  max-width: 140px;
  height: 36px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--atlas-rule-strong);
  color: var(--atlas-ink);
  font-family: var(--atlas-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
}

/* Wrap — outer page padding + max-width */
body.atlas .atlas-wrap {
  max-width: var(--atlas-shell-max);
  margin: 0 auto;
  padding: 28px var(--atlas-pad-x) 64px;
}
@media (max-width: 720px) {
  body.atlas .atlas-wrap { padding: 18px 16px 48px; }
}

/* Sections vertical rhythm */
body.atlas .home-section,
body.atlas .donate-hero,
body.atlas .donate-detail-wrap {
  margin-top: 0;
}
body.atlas .home-section + .home-section { margin-top: 0; }

/* Cards — consistent padding + radius (radius defaults 0; themes may override) */
body.atlas .atlas-content,
body.atlas .home-featured-tile,
body.atlas .atlas-brand,
body.atlas .home-principle,
body.atlas .home-flow-aside {
  padding: var(--atlas-card-pad);
}
body.atlas .donate-hero-card,
body.atlas .home-step {
  padding: var(--atlas-card-pad-lg);
}

/* Unified control sizing — buttons, inputs, selects all 40px tall */
body.atlas .atlas-btn,
body.atlas .home-cta,
body.atlas button.btn,
body.atlas a.btn {
  min-height: var(--atlas-control-h);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
body.atlas input[type="text"],
body.atlas input[type="email"],
body.atlas input[type="search"],
body.atlas input[type="number"],
body.atlas input[type="password"],
body.atlas input[type="date"],
body.atlas select,
body.atlas .input {
  min-height: var(--atlas-control-h);
  padding: 0 12px;
}
body.atlas textarea {
  padding: 10px 12px;
  min-height: 80px;
}

/* Hero alignment fix — both halves baseline-align */
body.atlas .home-hero,
body.atlas .donate-hero {
  align-items: stretch;
}
body.atlas .home-hero-aside,
body.atlas .donate-hero-aside,
body.atlas .donate-hero-card {
  align-self: stretch;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

/* Section heads — consistent eyebrow / h2 spacing */
body.atlas .home-section-head,
body.atlas .donate-section-head {
  margin: 0 0 22px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--atlas-rule);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
body.atlas .home-section-head h2 { margin: 0; }
body.atlas .home-section-eye,
body.atlas .home-flow-eye,
body.atlas .atlas-kicker,
body.atlas .donate-hero-eye {
  display: inline-block;
  margin-bottom: 8px;
}

/* Footer */
body.atlas .home-footer,
body.atlas .donatePage .footer,
body.atlas footer {
  max-width: var(--atlas-shell-max);
  margin: 0 auto;
  padding: 24px var(--atlas-pad-x) 36px;
  border-top: 1px solid var(--atlas-rule);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--atlas-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--atlas-ink-mute);
}
body.atlas footer a { color: inherit; text-decoration: underline; text-underline-offset: 4px; }

/* Row utility — consistent default gap, vertical centering */
body.atlas .row {
  display: flex;
  align-items: center;
  gap: var(--atlas-row-gap);
  flex-wrap: wrap;
}
body.atlas .row.row--gap-8  { gap: 8px; }
body.atlas .row.row--gap-14 { gap: 14px; }
body.atlas .row.row--end    { justify-content: flex-end; }
body.atlas .row.row--align-end { align-items: flex-end; }

/* Donation campaign cards — equal heights, consistent body padding */
body.atlas #campaignCards.grid > * {
  display: flex;
  flex-direction: column;
  min-height: 220px;
}
body.atlas #campaignCards .campCardActions {
  margin-top: auto;
  padding-top: 14px;
}

/* Campaign detail — donate header alignment (scrolls with content, not sticky) */
body.atlas .campDetailSticky {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 0;
  position: static;
  background: var(--atlas-canvas);
  border-bottom: 1px solid var(--atlas-rule);
}

/* Mobile breakpoints — keep max-content readable, no overflow */
@media (max-width: 880px) {
  body.atlas .topbar-inner { gap: 10px; }
  body.atlas .nav { display: none; }
  body.atlas .nav.open {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    position: absolute;
    top: 56px; left: 0; right: 0;
    background: var(--atlas-paper);
    border-bottom: 1px solid var(--atlas-rule);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.22);
    padding: 18px 24px;
    gap: 14px;
    z-index: 60;
  }
  body.atlas .navToggle { display: inline-flex; }
}
@media (min-width: 881px) {
  body.atlas .navToggle { display: none; }
}

/* Universal hairline tweak — make sure NOT all elements get rounded
   pseudo-soft borders inheriting from style.css. */
body.atlas .card,
body.atlas .tile {
  border-radius: var(--atlas-radius);
}

/* ── Long-notes / changelog "Show more" collapse ─────────────────────
   Applied by atlas-device.js when an .atlas-rich block runs past the
   fold (e.g. a long changelog). Theme-agnostic: the fade is a CSS mask,
   not a solid-colour gradient, so it dissolves the text to transparent
   on every theme + light/dark without knowing the panel background. */
.atlas-rich.is-collapsible { position: relative; }
.atlas-rich.is-collapsible.is-collapsed {
  max-height: var(--atlas-rich-fold, 460px);
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), transparent);
          mask-image: linear-gradient(to bottom, #000 calc(100% - 96px), transparent);
}
.atlas-rich-toggle {
  display: flex;
  justify-content: center;
  max-width: 70ch;                 /* line up under the reading column */
  margin: 4px 0 36px;
}
.atlas-rich.is-collapsible.is-collapsed + .atlas-rich-toggle {
  margin-top: -22px;               /* tuck the button into the faded gap */
}
.atlas-rich-toggle button {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1px solid var(--atlas-rule-strong);
  background: var(--atlas-paper);
  color: var(--atlas-ink);
  font-family: var(--atlas-sans);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: -0.005em;
  cursor: pointer;
  transition: color .18s ease, border-color .18s ease, background .18s ease;
}
.atlas-rich-toggle button:hover {
  border-color: var(--atlas-mint);
  color: var(--atlas-mint);
}
.atlas-rich-toggle button:focus-visible {
  outline: 2px solid var(--atlas-mint);
  outline-offset: 2px;
}
.atlas-more-caret {
  display: inline-block;
  width: 7px; height: 7px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
  transition: transform .18s ease;
}
.atlas-rich-toggle button[aria-expanded="true"] .atlas-more-caret {
  transform: translateY(1px) rotate(-135deg);
}
@media (prefers-reduced-motion: reduce) {
  .atlas-more-caret,
  .atlas-rich-toggle button { transition: none; }
}

/* ── Changelog timeline ──────────────────────────────────────────────
   Built client-side by atlas-device.js (enhanceChangelog) from a dated
   changelog: Year → Month → Day. Days are <details> rows that open on click;
   a category filter and expand/collapse-all sit in the toolbar. Colours are
   the atlas tokens, so every theme + light/dark is covered. */
.atlas-rich.has-cl { max-width: 88ch; }
.atlas-cl { margin-top: 18px; }
.atlas-cl [hidden] { display: none !important; }
.atlas-cl-intro { max-width: 70ch; }
.atlas-cl-toolbar {
  display: flex; flex-wrap: wrap; gap: 10px 14px;
  align-items: center; justify-content: space-between;
  padding: 12px 0; margin: 0 0 20px;
  border-top: 1px solid var(--atlas-rule);
  border-bottom: 1px solid var(--atlas-rule);
}
.atlas-cl-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.atlas-cl-tools { display: flex; gap: 6px; }
.atlas-cl-filter,
.atlas-cl-tools button {
  font-family: var(--atlas-mono); font-size: 11px; letter-spacing: 0.06em;
  text-transform: uppercase; color: var(--atlas-ink-2);
  background: transparent; border: 1px solid var(--atlas-rule-strong);
  border-radius: 999px; padding: 4px 10px; line-height: 1.4; cursor: pointer;
}
.atlas-cl-filter b { font-weight: 500; color: var(--atlas-ink-mute); margin-left: 4px; }
.atlas-cl-filter:hover,
.atlas-cl-tools button:hover { border-color: var(--atlas-mint); color: var(--atlas-ink); }
.atlas-cl-filter.is-active { background: var(--atlas-mint); border-color: var(--atlas-mint); color: var(--atlas-canvas); }
.atlas-cl-filter.is-active b { color: inherit; }
.atlas-cl-filter:focus-visible,
.atlas-cl-tools button:focus-visible,
.atlas-cl-month > summary:focus-visible,
.atlas-cl-day > summary:focus-visible { outline: 2px solid var(--atlas-mint); outline-offset: 2px; }
.atlas-cl-year { margin: 0 0 26px; }
.atlas-cl-year-head { display: flex; align-items: baseline; gap: 12px; margin: 0 0 10px; }
.atlas-cl-year-num { font-family: var(--atlas-display); font-size: 30px; line-height: 1; color: var(--atlas-ink); }
.atlas-cl-count { font-family: var(--atlas-mono); font-size: 11px; color: var(--atlas-ink-mute); }
.atlas-cl-month { border-left: 2px solid var(--atlas-rule-strong); margin: 0 0 10px; padding-left: 14px; }
.atlas-cl-month > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: flex; align-items: center; gap: 10px; padding: 6px 0;
  font-family: var(--atlas-mono); font-size: 12px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--atlas-ink);
}
.atlas-cl-month > summary::-webkit-details-marker { display: none; }
.atlas-cl-month > summary::before {
  content: ""; width: 7px; height: 7px; margin-right: 2px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform .15s ease;
}
.atlas-cl-month[open] > summary::before { transform: rotate(45deg); }
.atlas-cl-day { border-top: 1px solid var(--atlas-rule); }
.atlas-cl-day:last-child { border-bottom: 1px solid var(--atlas-rule); }
.atlas-cl-day > summary {
  list-style: none; cursor: pointer; user-select: none;
  display: grid; grid-template-columns: 48px minmax(0, 1fr) auto;
  column-gap: 12px; align-items: center; padding: 10px 0;
}
.atlas-cl-day > summary::-webkit-details-marker { display: none; }
.atlas-cl-day > summary:hover .atlas-cl-day-title,
.atlas-cl-day[open] > summary .atlas-cl-day-title { color: var(--atlas-mint); }
.atlas-cl-day-date time { display: block; text-decoration: none; }
.atlas-cl-day-num { display: block; font-family: var(--atlas-mono); font-size: 20px; line-height: 1; color: var(--atlas-gold); }
.atlas-cl-day-wd { display: block; margin-top: 3px; font-family: var(--atlas-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--atlas-ink-mute); }
.atlas-cl-day-title { font-family: var(--atlas-display); font-size: 17px; line-height: 1.25; color: var(--atlas-ink); }
.atlas-cl-day-title code { font-size: 0.85em; }
.atlas-cl-chips { display: flex; flex-wrap: wrap; gap: 4px; justify-content: flex-end; max-width: 260px; }
.atlas-cl-chip {
  font-family: var(--atlas-mono); font-size: 9.5px; letter-spacing: 0.08em;
  text-transform: uppercase; white-space: nowrap; color: var(--atlas-ink-2);
  border: 1px solid var(--atlas-rule-strong); border-radius: 999px; padding: 2px 7px;
}
.atlas-cl-chip:hover { border-color: var(--atlas-mint); color: var(--atlas-mint); }
.atlas-cl-body { padding: 2px 0 16px 60px; max-width: 70ch; }
.atlas-cl-body > *:first-child { margin-top: 0; }
.atlas-cl-body > *:last-child { margin-bottom: 0; }
@media (max-width: 640px) {
  .atlas-cl-day > summary { grid-template-columns: 44px minmax(0, 1fr); row-gap: 6px; }
  .atlas-cl-chips { grid-column: 2; justify-content: flex-start; max-width: none; }
  .atlas-cl-body { padding-left: 0; }
  .atlas-cl-toolbar { flex-direction: column; align-items: flex-start; }
}
@media (prefers-reduced-motion: reduce) {
  .atlas-cl-month > summary::before { transition: none; }
}

/* ============================================================================
   MAGAZINE — NIGHT EDITION ("Noir")  (2026-09-14)
   Purpose-built warm-dark palette for the (previously light-only) magazine
   theme's dark mode: ink-black warm paper, bone text, glowing vermilion / gold
   / teal accents — the editorial soul at night. Scoped to magazine + .dark-theme
   with HIGHER specificity than the base dark tokens so this palette wins; the
   theme is token-driven, so it flips cohesively. Light mode + other themes
   are untouched. (Supersedes the earlier topbar-only dark patch.)
   ========================================================================== */
:root[data-theme="magazine"].dark-theme {
  --atlas-canvas: #12100c;          /* warm ink-black paper */
  --atlas-paper: #1b1712;           /* dark sheet */
  --atlas-paper-2: #262019;         /* raised sheet */
  --atlas-rule: rgba(240, 228, 205, 0.12);
  --atlas-rule-strong: rgba(240, 228, 205, 0.26);
  --atlas-ink: #f4ecdd;             /* warm bone */
  --atlas-ink-2: #d4c8b5;           /* aged cream */
  --atlas-ink-mute: #9a8b76;
  --atlas-mint: #4bbd9e;            /* teal */
  --atlas-coral: #ec6a5c;           /* warm vermilion (oxblood, glowing on dark) */
  --atlas-gold: #d9a441;            /* burnt gold */
  --atlas-violet: #a98bd8;
}

/* Warm-dark masthead (matches the canvas, not a cold generic dark). */
:root[data-theme="magazine"].dark-theme body.atlas .topbar {
  background: rgba(18, 16, 12, 0.9);
  border-bottom-color: var(--atlas-rule-strong);
}
:root[data-theme="magazine"].dark-theme body.atlas .topbar .langSelect {
  background: rgba(255, 255, 255, 0.05);
  color: var(--atlas-ink);
  border-color: var(--atlas-rule-strong);
}

/* Warm ambient glows, a touch stronger so they read on the dark canvas. */
:root[data-theme="magazine"].dark-theme body.atlas {
  background:
    radial-gradient(900px 520px at 12% -10%, rgba(217, 164, 65, 0.10), transparent 60%),
    radial-gradient(760px 520px at 95% 4%, rgba(236, 106, 92, 0.08), transparent 55%),
    var(--atlas-canvas);
}

/* Coral primary buttons: keep punchy dark text on the glowing vermilion. */
:root[data-theme="magazine"].dark-theme .home-cta.primary,
:root[data-theme="magazine"].dark-theme .atlas-btn.primary,
:root[data-theme="magazine"].dark-theme body.donatePage .btn.primary {
  color: #17130d;
}


/* Collapse long build/version lists: show latest 10, reveal the rest on click */
.atlas-tree-more { display: none; }
.atlas-tree-more[data-open="true"] { display: block; }
.atlas-tree-more-toggle {
  display: block;
  padding: 5px 12px 5px 22px;
  margin: 1px 0 3px;
  font-size: 12px;
  line-height: 1.2;
  color: var(--atlas-coral);
  cursor: pointer;
  user-select: none;
}
.atlas-tree-more-toggle:hover { text-decoration: underline; }
