/* ─────────────────────────────────────────────────────────────────
 * /css/solar-return.css — Free Solar Return page (Solar Return build, Task 9)
 *
 * SR-SPECIFIC additions only. The form, results, reading, upsell-card,
 * hero-cosmic, and loader styling are all inherited from birth-chart-v2.css
 * (linked BEFORE this file). Everything here is scoped under body.sr-page
 * so it never leaks onto other pages.
 *
 * Palette (from birth-chart-v2.css :root):
 *   parchment/vellum, ink #2D1F38, burgundy #6B1F2C, aubergine #3A1F38,
 *   gold #B89150 / bright #D4AC68 / deep #8E6E3A / shimmer #F0D89A.
 * ───────────────────────────────────────────────────────────────── */

/* ─── YEAR TOGGLE — "flip a page in the almanac" (gold-on-aubergine pills) ── */
body.sr-page .sr-year-row {
  margin-bottom: 2rem;
}
body.sr-page .sr-year-label {
  display: block;
  text-align: center;
  margin-bottom: 0.9rem;
}
/* ONE stacked control, one radiogroup — NOT two equal halves:
   • TOP row = PRIMARY (Next Birthday): full-width, taller, larger label.
   • BOTTOM row = SECONDARY (This Year): quieter, shorter/half-height.
   The selected row takes the warm gold fill. A hairline seam divides them.
   Desktop: comfortable fixed width, centered. Mobile: full-width. */
body.sr-page .sr-year-toggle {
  display: grid;
  grid-template-columns: 1fr;          /* single column: primary stacked over secondary */
  gap: 0;
  width: max-content;
  min-width: 360px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0;
  border: 1.5px solid var(--gold-deep);
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--aubergine), var(--aubergine-deep));
  box-shadow:
    inset 0 2px 6px rgba(0, 0, 0, 0.3),
    0 3px 10px rgba(74, 22, 32, 0.18);
}
body.sr-page .sr-year-pill {
  position: relative;
  display: block;
  cursor: pointer;
  margin: 0;
}
body.sr-page .sr-year-pill input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
body.sr-page .sr-year-pill-face {
  display: flex;
  flex-direction: column;              /* main label + optional year hint below */
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  min-height: 48px;                    /* comfortable tap target */
  padding: 0.45rem 1.8rem;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 0.82rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  white-space: nowrap;                 /* labels never wrap, at any width */
  color: var(--gold-pale);
  transition: color 0.25s, background 0.25s, box-shadow 0.25s;
}
/* ── HIERARCHY: primary row is the prominent one, secondary is quiet ── */
body.sr-page .sr-year-pill--primary .sr-year-pill-face {
  min-height: 62px;                    /* full-height primary row */
  padding: 0.7rem 1.8rem;
  font-size: 0.94rem;
  letter-spacing: 0.14em;
}
body.sr-page .sr-year-pill--secondary .sr-year-pill-face {
  min-height: 40px;                    /* ~half-height secondary row */
  padding: 0.3rem 1.8rem;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--gold-deep);             /* quieter until chosen */
}
/* Year hint — "your 2025 return" pinned under the option label once the
   birth date is known (JS fills it; empty = hidden, single-line pill).
   rem-sized (not em) so it doesn't shrink with the pill's small Cinzel size. */
body.sr-page .sr-year-hint {
  display: block;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.03em;
  text-transform: none;
  color: var(--gold-shimmer);          /* brightest gold on the aubergine half */
  line-height: 1.25;
}
body.sr-page .sr-year-hint:empty { display: none; }
/* On the selected (gold) half, gold-on-gold would vanish — full-strength ink */
body.sr-page .sr-year-pill input:checked + .sr-year-pill-face .sr-year-hint {
  color: inherit;
  opacity: 1;
}
/* Hairline seam between the stacked rows (horizontal now) */
body.sr-page .sr-year-pill--secondary .sr-year-pill-face {
  border-top: 1px solid rgba(184, 145, 80, 0.4);
}
body.sr-page .sr-year-pill:hover .sr-year-pill-face {
  color: var(--gold-shimmer);
}
/* Selected half — warm gold fill, ink text, engraved look */
body.sr-page .sr-year-pill input:checked + .sr-year-pill-face {
  background: linear-gradient(180deg, var(--gold-pale), var(--gold-bright) 55%, var(--gold-deep));
  color: var(--burgundy-deep);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
}
/* Keyboard focus ring for accessibility */
body.sr-page .sr-year-pill input:focus-visible + .sr-year-pill-face {
  outline: 2px solid var(--gold-shimmer);
  outline-offset: -3px;
}
/* Clarifying microcopy under the toggle — one quiet Garamond line.
   burgundy-deep, not gold: gold-deep read too faint on parchment. */
body.sr-page .sr-year-note {
  margin-top: 0.7rem;
  text-align: center;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-weight: 500;
  font-size: 1.02rem;
  color: var(--burgundy-deep);
  line-height: 1.45;
}
@media (max-width: 480px) {
  body.sr-page .sr-year-toggle {
    width: 100%;
    min-width: 0;
    grid-template-columns: 1fr;   /* stacked rows, full-width */
  }
  body.sr-page .sr-year-pill-face {
    padding: 0.4rem 0.3rem;
    letter-spacing: 0.08em;
  }
  body.sr-page .sr-year-pill--primary .sr-year-pill-face {
    min-height: 58px;
    padding: 0.6rem 0.5rem;
    font-size: 0.88rem;
    letter-spacing: 0.1em;
  }
  body.sr-page .sr-year-pill--secondary .sr-year-pill-face {
    min-height: 38px;
    padding: 0.28rem 0.5rem;
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }
  body.sr-page .sr-year-hint { font-size: 0.88rem; }
  body.sr-page .sr-year-note { font-size: 0.94rem; }
}

/* ─── LOCATION-TENSE DIVIDER — "— Where Did You Spend Your Birthday? —"
      (past tense, shown when This Year is selected) is much longer than the
      default "— Where Will You Be? —", so the .is-past state sizes down to
      keep one elegant line on desktop
      (js/solar-return.js updateLocationTense toggles the class + text). ── */
body.sr-page .form-divider.is-past {
  font-size: 1.12rem;
  letter-spacing: 0.2em;
  padding-left: 0.2em;   /* tracking-drift compensation, scaled to match */
}

/* ─── MOBILE FORM POLISH — centered section heading + one-line submit label ── */
/* Keep "Solar Return" together at every width */
body.sr-page .sr-nowrap { white-space: nowrap; }
@media (max-width: 480px) {
  /* The em-dashes in the divider text already frame it, so drop the flex
     gradient lines and true-center the text (wraps centered if long). */
  body.sr-page .form-divider {
    display: block;
    text-align: center;
    font-size: 0.95rem;
    letter-spacing: 0.12em;
    padding-left: 0.12em;   /* same tracking-drift compensation, scaled */
  }
  /* Longer past-tense string: tighten so it wraps to at most two centered lines */
  body.sr-page .form-divider.is-past {
    font-size: 0.9rem;
    letter-spacing: 0.05em;
    padding-left: 0.05em;
  }
  body.sr-page .form-divider::before,
  body.sr-page .form-divider::after { content: none; }

  /* Submit button — fit "CAST MY SOLAR RETURN →" on one line if possible;
     if it must wrap, the .sr-nowrap span means it breaks after "CAST MY". */
  body.sr-page .form-submit {
    width: 100%;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
    padding: 1.15rem 0.8rem;
  }
}

/* Results-area copy of the toggle — centered under the meta line */
body.sr-page .sr-year-toggle-results {
  margin: 1.4rem auto 0.4rem;
}

/* ─── HERO MEDALLIONS — SR-specific animated icons (SVG lives in solar-return.php) ──
   Medallion 1 "The Return": a gold sun makes one slow lap of the year's orbit
   and blooms as it arrives home at its natal mark.
   Medallion 2 "A New Year Is Cast": the zodiac wheel turns slowly around a
   fixed, breathing sun. transform-origin 50px 50px = the 100×100 viewBox
   center (same proven technique as .med-orbiter in birth-chart-v2.css). */
body.sr-page .srm-orbiter {
  transform-origin: 50px 50px;
  animation: srmOrbit 20s linear infinite;
}
@keyframes srmOrbit { to { transform: rotate(360deg); } }

body.sr-page .srm-bloom {
  opacity: 0;
  animation: srmBloom 20s ease-in-out infinite;
}
@keyframes srmBloom {
  0%   { opacity: 0.95; }
  4%   { opacity: 0.95; }
  12%  { opacity: 0; }
  92%  { opacity: 0; }
  100% { opacity: 0.95; }
}

body.sr-page .srm-zodiac {
  transform-origin: 50px 50px;
  animation: srmTurn 90s linear infinite;
}
@keyframes srmTurn { to { transform: rotate(360deg); } }

body.sr-page .srm-breath {
  transform-origin: 50px 50px;
  animation: srmBreath 6s ease-in-out infinite;
}
@keyframes srmBreath {
  0%, 100% { transform: scale(0.96); opacity: 0.88; }
  50%      { transform: scale(1.06); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  body.sr-page .srm-orbiter,
  body.sr-page .srm-bloom,
  body.sr-page .srm-zodiac,
  body.sr-page .srm-breath { animation: none !important; }
  /* Static fallback: show the return-moment glow softly */
  body.sr-page .srm-bloom { opacity: 0.5; }
}

/* ─── ORNAMENTAL BRIDGE — carries the reading's momentum down into the offer ── */
body.sr-page .sr-bridge {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 2.4rem auto 0;
  max-width: 620px;
}
body.sr-page .sr-bridge-line {
  display: block;
  width: 42%;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold) 50%, transparent);
}
body.sr-page .sr-bridge-mark {
  color: var(--gold-deep);
  font-size: 1.3rem;
  line-height: 1;
  margin-top: -0.75rem;
  background: var(--parchment);
  padding: 0 0.6rem;
}
body.sr-page .sr-bridge-caret {
  color: var(--gold);
  font-size: 1.1rem;
  line-height: 0.6;
  opacity: 0.85;
  animation: srBridgeNudge 2.2s ease-in-out infinite;
}
@keyframes srBridgeNudge {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50%      { transform: translateY(4px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  body.sr-page .sr-bridge-caret { animation: none; }
}

/* ─── THE ALTAR PANEL — full-width illuminated showpiece (the tripwire moment) ── */
body.sr-page .sr-altar {
  display: block;
  max-width: 860px;
  margin: 1rem auto 1.4rem;
  padding: 5px;                      /* gold-leaf frame gap */
  background: linear-gradient(135deg, var(--gold-bright), var(--gold-deep) 45%, var(--gold-bright) 100%);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(74, 22, 32, 0.35);
}
body.sr-page .sr-altar-inner {
  position: relative;
  padding: 2.8rem 2.6rem 2.6rem;
  border-radius: 5px;
  text-align: center;
  overflow: hidden;
  /* Aubergine → burgundy field so it POPS off the parchment page */
  background:
    radial-gradient(ellipse at 50% -10%, rgba(212, 172, 104, 0.18), transparent 60%),
    linear-gradient(165deg, var(--aubergine) 0%, var(--aubergine-deep) 55%, var(--burgundy-deep) 100%);
  box-shadow: inset 0 0 0 1px rgba(212, 172, 104, 0.45);
}
/* faint engraved corner flourishes */
body.sr-page .sr-altar-inner::before,
body.sr-page .sr-altar-inner::after {
  content: '✦';
  position: absolute;
  color: rgba(212, 172, 104, 0.4);
  font-size: 1.1rem;
}
body.sr-page .sr-altar-inner::before { top: 0.9rem; left: 1.1rem; }
body.sr-page .sr-altar-inner::after  { bottom: 0.9rem; right: 1.1rem; }

body.sr-page .sr-altar-eyebrow {
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  font-weight: 700;
  letter-spacing: 0.28em;
  font-size: 0.9rem;
  color: var(--gold-bright);
  margin-bottom: 0.7rem;
}
body.sr-page .sr-altar-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 900;
  font-size: clamp(2rem, 5.5vw, 3.2rem);
  line-height: 1.05;
  color: var(--gold-shimmer);
  text-shadow: 0 2px 18px rgba(212, 172, 104, 0.4);
  margin: 0 0 0.9rem;
}
body.sr-page .sr-altar-price {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  margin-bottom: 1.3rem;
}
body.sr-page .sr-altar-price-num {
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: clamp(2.4rem, 6vw, 3.4rem);
  color: var(--gold-bright);
  line-height: 1;
  -webkit-text-stroke: 0.4px var(--gold-deep);
}
body.sr-page .sr-altar-price-sub {
  font-family: 'EB Garamond', serif;
  font-variant: small-caps;
  letter-spacing: 0.2em;
  font-size: 0.82rem;
  color: rgba(237, 228, 200, 0.75);
}
body.sr-page .sr-altar-deck {
  font-family: 'EB Garamond', serif;
  font-size: 1.2rem;
  font-style: italic;
  line-height: 1.55;
  color: rgba(237, 228, 200, 0.92);
  max-width: 560px;
  margin: 0 auto 1.6rem;
}
body.sr-page .sr-altar-list {
  list-style: none;
  margin: 0 auto 1.5rem;
  padding: 0;
  max-width: 620px;
  text-align: left;
}
body.sr-page .sr-altar-list li {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid rgba(212, 172, 104, 0.22);
  font-family: 'EB Garamond', serif;
  font-size: 1.14rem;
  line-height: 1.5;
  color: rgba(237, 228, 200, 0.94);
}
body.sr-page .sr-altar-list li:last-child { border-bottom: 1px solid rgba(212, 172, 104, 0.22); }
body.sr-page .sr-altar-list strong { color: var(--gold-shimmer); font-weight: 700; }
body.sr-page .sr-altar-bullet {
  flex: 0 0 auto;
  color: var(--gold-bright);
  font-size: 1rem;
  line-height: 1.6;
  text-shadow: 0 0 10px rgba(212, 172, 104, 0.5);
}
body.sr-page .sr-altar-anchor {
  font-family: 'EB Garamond', serif;
  font-size: 1.25rem;
  color: rgba(237, 228, 200, 0.92);
  margin: 0 auto 1.8rem;
  max-width: 560px;
  line-height: 1.55;
}
body.sr-page .sr-altar-anchor em {
  display: block;
  margin-top: 0.35rem;
  font-family: 'Italianno', cursive;
  font-style: normal;
  font-size: 1.9rem;
  color: var(--gold-bright);
  line-height: 1;
}
body.sr-page .sr-altar-cta {
  display: inline-block;
  width: auto;
  max-width: 100%;
  padding: 1.25rem 3rem;
  font-family: 'Cinzel', serif;
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--burgundy-deep);
  background: linear-gradient(180deg, var(--gold-pale), var(--gold-bright) 50%, var(--gold-deep));
  border: 1.5px solid var(--gold-deep);
  border-radius: 999px;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.45);
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.3);
  transition: transform 0.25s, box-shadow 0.25s;
}
body.sr-page .sr-altar-cta:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(0, 0, 0, 0.45); }
body.sr-page .sr-altar-cta:disabled { opacity: 0.6; cursor: wait; transform: none; }

@media (max-width: 560px) {
  body.sr-page .sr-altar { margin-left: 0.2rem; margin-right: 0.2rem; }
  body.sr-page .sr-altar-inner { padding: 2rem 1.3rem 2.1rem; }
  body.sr-page .sr-altar-deck { font-size: 1.08rem; }
  body.sr-page .sr-altar-list li { font-size: 1.04rem; }
  /* Full-width CTA on mobile */
  body.sr-page .sr-altar-cta { display: block; width: 100%; padding: 1.2rem 1rem; letter-spacing: 0.12em; }
}

/* ─── READING-FAILED RETRY AFFORDANCE (never a blank result) ── */
body.sr-page .sr-reading-retry {
  max-width: 620px;
  margin: 1.4rem auto 0;
  padding: 1.6rem 1.8rem;
  text-align: center;
  background: var(--vellum-warm);
  border: 1px solid rgba(184, 145, 80, 0.55);
  border-radius: 6px;
  box-shadow: inset 0 0 0 4px var(--vellum), 0 6px 18px rgba(74, 22, 32, 0.12);
}
body.sr-page .sr-reading-retry p {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--ink);
  margin: 0 0 1.1rem;
  line-height: 1.5;
}
body.sr-page .sr-retry-btn {
  background: var(--burgundy);
  color: var(--gold-pale);
  border: 1.5px solid var(--burgundy-deep);
  box-shadow: 0 6px 18px rgba(74, 22, 32, 0.28);
  cursor: pointer;
}

/* ─── EXISTING-ACCOUNT BANNER — mirror .bc-existing-account visibility ── */
body.sr-page .bc-existing-account.is-visible { display: block; }

/* ─── THE RETURN INSTANT — the exact day/time the Sun comes home ──
   One elegant centered line under the wheel, matched to the .sr-year-note
   treatment (EB Garamond italic / gold-deep), with a quiet "why?" link. */
body.sr-page .sr-instant {
  margin: 1.4rem auto 0.2rem;
  max-width: 620px;
  text-align: center;
}
body.sr-page .sr-instant-line {
  margin: 0;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.2rem;
  line-height: 1.5;
  color: var(--gold-deep);
}
body.sr-page .sr-instant-why {
  display: inline-block;
  margin-top: 0.35rem;
  padding: 0;
  background: none;
  border: none;
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 0.98rem;
  color: var(--burgundy);
  text-decoration: underline;
  text-decoration-color: rgba(107, 31, 44, 0.4);
  text-underline-offset: 3px;
  cursor: pointer;
  transition: color 0.2s, text-decoration-color 0.2s;
}
body.sr-page .sr-instant-why:hover {
  color: var(--burgundy-deep);
  text-decoration-color: var(--burgundy);
}
body.sr-page .sr-instant-why:focus-visible {
  outline: 2px solid var(--gold-deep);
  outline-offset: 3px;
  border-radius: 3px;
}
@media (max-width: 480px) {
  body.sr-page .sr-instant-line { font-size: 1.08rem; }
  body.sr-page .sr-instant-why  { font-size: 0.94rem; }
}

/* ─── "WHY NOT MY BIRTHDAY?" MODAL — parchment card on a dimmed field ── */
body.sr-modal-open { overflow: hidden; }
.sr-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.2rem;
  background: rgba(45, 31, 56, 0.62);
  backdrop-filter: blur(3px);
  animation: srModalFade 0.2s ease-out;
}
.sr-modal-overlay[hidden] { display: none; }
@keyframes srModalFade { from { opacity: 0; } to { opacity: 1; } }

.sr-modal {
  position: relative;
  max-width: 540px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  padding: 2.4rem 2.4rem 2.2rem;
  background: var(--parchment, #FBF3DC);
  border: 1px solid var(--gold-deep, #8E6E3A);
  border-radius: 8px;
  box-shadow: inset 0 0 0 5px var(--vellum, #F3E8CC), 0 24px 60px rgba(45, 31, 56, 0.45);
  animation: srModalRise 0.24s ease-out;
}
@keyframes srModalRise { from { transform: translateY(12px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.sr-modal:focus { outline: none; }

.sr-modal-close {
  position: absolute;
  top: 0.7rem;
  right: 0.9rem;
  width: 2rem;
  height: 2rem;
  padding: 0;
  background: none;
  border: none;
  font-family: 'EB Garamond', serif;
  font-size: 1.9rem;
  line-height: 1;
  color: var(--gold-deep, #8E6E3A);
  cursor: pointer;
  transition: color 0.2s, transform 0.2s;
}
.sr-modal-close:hover { color: var(--burgundy, #6B1F2C); transform: scale(1.08); }
.sr-modal-close:focus-visible {
  outline: 2px solid var(--gold-deep, #8E6E3A);
  outline-offset: 2px;
  border-radius: 4px;
}
.sr-modal-title {
  margin: 0 1.6rem 1.1rem 0;
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.4rem;
  line-height: 1.25;
  color: var(--aubergine, #3A1F38);
}
.sr-modal-body p {
  margin: 0 0 1rem;
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  line-height: 1.62;
  color: var(--ink, #2D1F38);
}
.sr-modal-body p:last-child { margin-bottom: 0; }
.sr-modal-body em { font-style: italic; color: var(--burgundy, #6B1F2C); }

@media (max-width: 480px) {
  .sr-modal { padding: 2rem 1.4rem 1.8rem; }
  .sr-modal-title { font-size: 1.22rem; }
  .sr-modal-body p { font-size: 1.04rem; }
}

/* ══════════════════════════════════════════════════════════════════════════
 * THE MAP (Solar Return build, Task 15) — birthday map on the delivery view.
 * Scoped entirely under #sr-map so it never leaks onto the free page.
 *
 * Shared mechanics styled once; THREE style directions are data-theme variants:
 *   [data-theme="candlelit"]  (A) Candlelit Cartography — aubergine night field,
 *                                 dots as gold candle-flames, ledger ranked list
 *   [data-theme="atlas"]      (B) Celestial Atlas — burgundy-night field, dots as
 *                                 8-point stars, constellation hints, compass rose
 *   [data-theme="ledger"]     (C) Gilded Ledger — parchment day-map, burgundy dots
 *                                 with gold rims, wax-seal medallion for #1
 * Brand v2 palette (literals so the partial is self-contained on the view page).
 * ═══════════════════════════════════════════════════════════════════════ */
#sr-map {
  --sr-parchment: #FBF3DC;
  --sr-vellum:    #FAF1E1;
  --sr-ink:       #2D1F38;
  --sr-burgundy:  #6B1F2C;
  --sr-burgundy-deep: #4A1620;
  --sr-aubergine: #3A1F38;
  --sr-aubergine-deep: #2A1428;
  --sr-gold:      #B89150;
  --sr-gold-bright: #D4AC68;
  --sr-gold-deep: #8E6E3A;
  --sr-gold-shimmer: #F0D89A;

  margin: 3.2rem 0 1rem;
  padding: 0;
  position: relative;
  display: block;
  width: 100%;
  box-sizing: border-box;
}
#sr-map * { box-sizing: border-box; }

/* ── Header ── */
#sr-map .sr-map-head { text-align: center; margin-bottom: 1.8rem; }
#sr-map .sr-map-eyebrow {
  font-family: 'Cinzel', serif;
  font-weight: 600;
  font-size: 1.0rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--sr-gold-bright, #D4AC68);
  margin-bottom: 0.55rem;
}
#sr-map .sr-map-title {
  font-family: 'Cinzel Decorative', 'Cinzel', serif;
  font-weight: 700;
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.1;
  /* Sits on the dashboard's dark field — gold, not aubergine-on-dark. */
  color: var(--sr-gold-shimmer, #E9C87F);
  margin: 0 0 0.6rem;
}
/* Item 4 — unmissable line naming WHICH birthday the map scores. Gold-bright. */
#sr-map .sr-map-nextline {
  font-family: 'EB Garamond', serif;
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--sr-gold-bright, #D4AC68);
  max-width: 50ch;
  margin: 0 auto 0.7rem;
}
#sr-map .sr-map-nextline .sr-map-nextdate {
  font-family: 'Cinzel', serif;
  font-weight: 700;
  font-size: 1.18rem;
  letter-spacing: 0.01em;
  color: var(--sr-gold-shimmer, #F0D89A);
  white-space: nowrap;
}
#sr-map .sr-map-nextline .sr-map-nextnote { opacity: 0.9; }

#sr-map .sr-map-sub {
  font-family: 'EB Garamond', serif;
  font-size: 1.1rem;
  line-height: 1.55;
  /* The map section sits on the dashboard's dark field — light text, not ink. */
  color: var(--sr-parchment, #FBF3DC);
  opacity: 0.88;
  max-width: 44ch;
  margin: 0 auto;
}
/* How-it-works line: tells buyers the dots sell readings. Sits BETWEEN the
   controls and the map canvas (no longer a header whisper) — larger and
   brighter per Michael 2026-07-05. */
#sr-map .sr-map-hint {
  font-family: 'EB Garamond', serif;
  font-style: italic;
  font-size: 1.22rem;
  line-height: 1.5;
  text-align: center;
  color: var(--sr-gold-shimmer, #F0D89A);
  max-width: 58ch;
  margin: 0.9rem auto 0.2rem;
}

/* The HTML `hidden` attribute must win over our flex/block display rules. */
#sr-map [hidden] { display: none !important; }

/* ── Loading / error ── */
#sr-map .sr-map-loading {
  display: flex; align-items: center; justify-content: center; gap: 0.8rem;
  padding: 3rem 1rem;
  font-family: 'EB Garamond', serif; font-style: italic;
  color: var(--sr-gold-deep); font-size: 1.1rem;
}
#sr-map .sr-map-loading-orb {
  width: 14px; height: 14px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, var(--sr-gold-shimmer), var(--sr-gold) 60%, var(--sr-gold-deep));
  box-shadow: 0 0 14px 4px rgba(212,172,104,0.5);
  animation: srPulse 1.4s ease-in-out infinite;
}
#sr-map .sr-map-error {
  text-align: center; padding: 2.4rem 1rem;
  font-family: 'EB Garamond', serif; color: var(--sr-burgundy); font-size: 1.05rem;
}
@keyframes srPulse {
  0%,100% { transform: scale(0.85); opacity: 0.7; }
  50%     { transform: scale(1.15); opacity: 1; }
}

/* ── Controls ── */
#sr-map .sr-map-controls {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 0.9rem; margin-bottom: 1.2rem;
}
#sr-map .sr-scope-tabs {
  display: inline-flex; padding: 4px;
  border: 1px solid var(--sr-gold); border-radius: 999px;
  background: rgba(184,145,80,0.08);
}
/* Inactive tab ("The World") must clearly read as clickable on the dark band —
   bright gold + a hover lift (Michael 2026-07-06: it was invisible). */
#sr-map .sr-tab {
  border: none; background: none; cursor: pointer;
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 0.88rem;
  letter-spacing: 0.06em; padding: 0.5rem 1.3rem; border-radius: 999px;
  color: var(--sr-gold-bright); transition: all 0.22s ease;
}
#sr-map .sr-tab:not(.is-active):hover {
  color: var(--sr-gold-shimmer);
  background: rgba(212, 172, 104, 0.14);
}
#sr-map .sr-tab.is-active {
  background: var(--sr-burgundy); color: var(--sr-parchment);
  box-shadow: 0 2px 10px rgba(74,22,32,0.32);
}
#sr-map .sr-country-select {
  font-family: 'EB Garamond', serif; font-size: 0.98rem;
  padding: 0.5rem 1rem; border-radius: 8px;
  border: 1px solid var(--sr-gold); background: var(--sr-vellum);
  color: var(--sr-ink); cursor: pointer;
}

/* ── Goal pills ── */
#sr-map .sr-goal-pills {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.8rem;
  margin-bottom: 1.6rem;
}
/* Unselected pills live on the DARK night band — bright gold text, not the
   deep gold that vanished into the aubergine (Michael 2026-07-05). */
#sr-map .sr-pill {
  border: 1px solid rgba(212, 172, 104, 0.65); background: rgba(212, 172, 104, 0.08);
  cursor: pointer;
  font-family: 'EB Garamond', serif; font-size: 1.0rem; font-weight: 600;
  padding: 0.5rem 1.1rem; border-radius: 999px;
  color: var(--sr-gold-bright); transition: all 0.2s ease; white-space: nowrap;
}
#sr-map .sr-pill:hover { border-color: var(--sr-gold-shimmer); color: var(--sr-gold-shimmer); }
#sr-map .sr-pill.is-active {
  background: linear-gradient(180deg, var(--sr-gold-bright), var(--sr-gold));
  border-color: var(--sr-gold-bright); color: var(--sr-aubergine-deep); font-weight: 600;
  box-shadow: 0 2px 8px rgba(184,145,80,0.35);
}

/* ── Body layout: FULL-WIDTH map, Top-5 panel BELOW it (Michael feedback) ── */
#sr-map .sr-map-body {
  display: block;
}
#sr-map .sr-map-canvas {
  position: relative; border-radius: 14px; overflow: hidden;
  border: 1px solid var(--sr-gold-deep);
  min-width: 0; width: 100%;
}
#sr-map .sr-map-svg-wrap { position: relative; width: 100%; }
#sr-map .sr-map-art, #sr-map .sr-map-dotsvg {
  display: block; width: 100%; height: auto;
}
#sr-map .sr-map-dotsvg { position: absolute; inset: 0; }

/* Land base (shared shape; themes recolor) */
#sr-map .sr-land :is(path, circle) {
  fill: rgba(184,145,80,0.14);
  stroke: var(--sr-gold);
  stroke-width: 1.1;
  stroke-linejoin: round;
}
/* Interior lakes (Lake Michigan): read as water against every theme's land fill. */
#sr-map .sr-lake path {
  fill: rgba(45,31,56,0.30);
  stroke: var(--sr-gold);
  stroke-width: 0.8;
  opacity: 0.85;
}
/* State borders: gold survey lines — clearly readable (Michael 2026-07-05:
   at 0.45 the Midwest read as missing lines), still quieter than the dots. */
#sr-map .sr-borders path {
  fill: none;
  stroke: var(--sr-gold);
  stroke-width: 0.85;
  opacity: 0.62;
  stroke-linejoin: round;
  stroke-linecap: round;
}
/* Coastal detail (bays, Long Island, Puget Sound): same voice as the coastline. */
#sr-map .sr-coast path {
  fill: none;
  stroke: var(--sr-gold);
  stroke-width: 0.8;
  opacity: 0.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
#sr-map .sr-inset-box { fill: none; stroke: var(--sr-gold-deep); stroke-width: 1; stroke-dasharray: 4 3; opacity: 0.65; }
#sr-map .sr-inset-label {
  font-family: 'Cinzel', serif; font-size: 16px; fill: var(--sr-gold-bright, #D4AC68);
  letter-spacing: 0.1em; opacity: 0.95;
}

/* ── Dots (shared geometry) ── */
/* No text selection anywhere on the canvas — dragging while zoomed was
   selecting the % badge text and killing the pan (Michael 2026-07-05). */
#sr-map .sr-map-canvas, #sr-map .sr-map-canvas * {
  user-select: none; -webkit-user-select: none;
}
#sr-map .sr-dot { cursor: pointer; }
#sr-map .sr-dot:focus { outline: none; }
#sr-map .sr-dot-halo { fill: var(--sr-gold-bright); opacity: 0.28; filter: blur(1px); transition: opacity 0.25s; }
#sr-map .sr-dot-core { fill: var(--sr-gold-shimmer); stroke: var(--sr-gold-deep); stroke-width: 0.8; }
#sr-map .sr-dot-badge rect { fill: var(--sr-aubergine-deep); opacity: 0.92; }
#sr-map .sr-dot-badge text {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 16px; fill: var(--sr-gold-shimmer);
}
/* Quiet-sky dots (score < 10): dim gracefully, hide the badge, no glow */
/* Quiet halos are invisible AND must never catch a click meant for a bright
   neighbor underneath (dense regions — Michael 2026-07-06). */
#sr-map .sr-dot.is-quiet .sr-dot-halo { opacity: 0; pointer-events: none; }
/* Quiet dots: ember tint — palette burgundy with a faint gold rim — so they read
   as "dimmed city", not border linework (Michael 2026-07-04). */
#sr-map .sr-dot.is-quiet .sr-dot-core { fill: rgba(107,31,44,0.85); stroke: rgba(212,172,104,0.55); stroke-width: 0.6; }
#sr-map .sr-dot.is-quiet .sr-dot-badge { display: none; }
#sr-map .sr-dot.is-quiet { opacity: 0.6; }
/* Hover/tap reveal: the quiet dot wakes and shows its % badge, so exploring
   answers "what is that dot?" without opening the card. */
#sr-map .sr-dot.is-quiet:hover,
#sr-map .sr-dot.is-quiet:focus-visible { opacity: 1; }
#sr-map .sr-dot.is-quiet:hover .sr-dot-core,
#sr-map .sr-dot.is-quiet:focus-visible .sr-dot-core { fill: var(--sr-gold-bright); stroke: var(--sr-gold-deep); stroke-width: 0.8; }
#sr-map .sr-dot.is-quiet:hover .sr-dot-badge,
#sr-map .sr-dot.is-quiet:focus-visible .sr-dot-badge { display: inline; }
#sr-map .sr-dot.is-live:hover .sr-dot-halo { opacity: 0.5; }
#sr-map .sr-dot.is-live:hover .sr-dot-core, #sr-map .sr-dot:focus-visible .sr-dot-core { stroke: var(--sr-gold-shimmer); stroke-width: 1.6; }
#sr-map .sr-dot.is-selected .sr-dot-core { stroke: var(--sr-burgundy); stroke-width: 2; }
#sr-map .sr-dot.is-top .sr-dot-halo { animation: srDotPulse 2s ease-in-out infinite; }
@keyframes srDotPulse {
  0%,100% { opacity: 0.32; transform: scale(1); }
  50%     { opacity: 0.62; transform: scale(1.25); }
}

/* ── Below-map panel: Top-5 ranked cards + detail card ── */
#sr-map .sr-map-panel { display: flex; flex-direction: column; gap: 1rem; margin-top: 1.4rem; }
#sr-map .sr-rank-head {
  border-bottom: 1.5px solid var(--sr-gold); padding-bottom: 0.5rem;
}
#sr-map .sr-rank-title {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.86rem;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--sr-burgundy);
}
/* Desktop: a horizontal row of five elegant cards. */
#sr-map .sr-rank-list {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0.8rem;
  align-items: stretch;  /* uniform card heights — every card shows the same anatomy */
}
/* Jewel cards, not skinny rows (Michael 2026-07-05): the SCORE is the hero,
   the city sits under it, a small gold rank medal crowns each card, and
   rank #1 wears the burgundy medal + a warm glow. */
#sr-map .sr-rank-item {
  display: block; padding: 0; position: relative;
  border: 1px solid rgba(184, 145, 80, 0.55);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(184, 145, 80, 0.13), rgba(184, 145, 80, 0.04));
  box-shadow: 0 2px 10px rgba(45, 31, 56, 0.08);
  transition: background 0.18s, border-color 0.18s, transform 0.15s, box-shadow 0.2s;
}
/* The whole card is ONE <button> — a centered column showing everything:
   medal / big score / city / driver line / quiet CTA. No expand state, so
   heights stay uniform and nothing "sticks" open. */
#sr-map .sr-rank-open {
  display: grid; width: 100%; height: 100%;
  grid-template-columns: 1fr;
  grid-template-rows: auto auto auto 1fr auto;
  justify-items: center; align-items: start; row-gap: 0.35rem;
  padding: 1rem 0.8rem 0.85rem; cursor: pointer; text-align: center;
  border: none; background: transparent; color: inherit; font: inherit;
}
#sr-map .sr-rank-item:hover,
#sr-map .sr-rank-item:focus-within {
  background: linear-gradient(180deg, rgba(184, 145, 80, 0.20), rgba(184, 145, 80, 0.08));
  border-color: var(--sr-gold-bright);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(45, 31, 56, 0.16);
}
#sr-map .sr-rank-open:focus-visible { outline: 2px solid var(--sr-gold-deep); outline-offset: 2px; border-radius: 12px; }
#sr-map .sr-rank-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.9rem; height: 1.9rem; border-radius: 50%;
  border: 1px solid var(--sr-gold);
  background: rgba(251, 243, 220, 0.6);
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 0.95rem;
  color: var(--sr-gold-deep);
}
#sr-map .sr-rank-score {
  font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 2.1rem; line-height: 1;
  color: var(--sr-burgundy);
}
#sr-map .sr-rank-place {
  font-family: 'EB Garamond', serif; font-weight: 500;
  font-size: 1.18rem; line-height: 1.25;
  color: var(--sr-ink); text-align: center;
}
/* Driver line — the "why", always visible on every card. */
#sr-map .sr-rank-line {
  font-family: 'EB Garamond', serif; font-style: italic;
  font-size: 1.0rem; line-height: 1.4;
  color: var(--sr-ink); opacity: 0.9;
  padding-top: 0.15rem;
}
/* Quiet CTA pinned to the card's bottom edge. */
#sr-map .sr-rank-cta {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 0.72rem;
  letter-spacing: 0.05em; text-transform: uppercase;
  color: var(--sr-gold-deep);
  border-top: 1px dashed rgba(184, 145, 80, 0.45);
  padding-top: 0.55rem; margin-top: 0.3rem;
  width: 100%; text-align: center;
  transition: color 0.18s;
}
#sr-map .sr-rank-item:hover .sr-rank-cta,
#sr-map .sr-rank-open:focus-visible .sr-rank-cta { color: var(--sr-burgundy); }
/* Rank #1 — crowned: burgundy medal, bigger score, warm gold glow. */
#sr-map .sr-rank-item:first-child {
  border-color: var(--sr-gold-bright);
  box-shadow: 0 0 0 1px rgba(212, 172, 104, 0.5), 0 6px 18px rgba(184, 145, 80, 0.28);
}
#sr-map .sr-rank-item:first-child .sr-rank-num {
  color: var(--sr-parchment);
  background: linear-gradient(180deg, var(--sr-burgundy), var(--sr-burgundy-deep));
  border-color: var(--sr-gold-bright);
}
#sr-map .sr-rank-item:first-child .sr-rank-score { font-size: 2.5rem; }

/* ── Detail card (opens below the Top-5 row — never covers the map) ── */
#sr-map .sr-side-card {
  display: none; position: relative;
  /* FIRST in the panel — directly under the map, above the Top-5 — so a dot
     click answers right where the eye already is (Michael 2026-07-05: the
     card was opening below the taller Top-5 row, off-screen). */
  order: -1;
  border: 1px solid var(--sr-gold); border-radius: 12px;
  background: var(--sr-vellum); padding: 1.2rem 1.4rem 1.3rem;
  box-shadow: 0 8px 24px rgba(45,31,56,0.14);
}
/* Desktop: lay the card out horizontally — text block | mini-wheel | CTA. */
#sr-map .sr-side-card.is-open {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) auto minmax(0, 1fr);
  grid-template-areas:
    "score wheel cta"
    "city  wheel cta"
    "label wheel cta";
  column-gap: 1.8rem;
  align-items: center;
  animation: srCardIn 0.28s ease;
}
#sr-map .sr-side-card .sr-card-score { grid-area: score; align-self: end; }
#sr-map .sr-side-card .sr-card-city  { grid-area: city; }
#sr-map .sr-side-card .sr-card-label { grid-area: label; align-self: start; margin-bottom: 0; }
#sr-map .sr-side-card .sr-card-wheel { grid-area: wheel; margin: 0; }
#sr-map .sr-side-card .sr-card-cta-block { grid-area: cta; justify-self: stretch; align-self: center; }
@keyframes srCardIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
#sr-map .sr-card-close {
  position: absolute; top: 0.5rem; right: 0.7rem; border: none; background: none;
  font-family: 'EB Garamond', serif; font-size: 1.6rem; line-height: 1; cursor: pointer;
  color: var(--sr-gold-deep); transition: color 0.2s;
}
#sr-map .sr-card-close:hover { color: var(--sr-burgundy); }
#sr-map .sr-card-score {
  font-family: 'Cinzel Decorative', 'Cinzel', serif; font-weight: 700;
  font-size: 2.6rem; line-height: 1; color: var(--sr-burgundy);
}
#sr-map .sr-card-score span { font-size: 1.1rem; opacity: 0.7; }
#sr-map .sr-card-score[data-quiet="1"] { color: var(--sr-gold-deep); opacity: 0.75; }
#sr-map .sr-card-city {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 1.2rem;
  color: var(--sr-aubergine); margin: 0.2rem 0 0.4rem;
}
#sr-map .sr-card-label {
  font-family: 'EB Garamond', serif; font-style: italic; font-size: 1.02rem;
  color: var(--sr-ink); opacity: 0.85; margin: 0 0 0.9rem; line-height: 1.45;
}
#sr-map .sr-card-wheel {
  display: flex; flex-direction: column; align-items: center;
  margin: 0.4rem 0 1rem;
}
/* 176px compensates the viewBox label-gutter (js miniWheel PAD) so the wheel
   itself renders at the original size while ASC/MC labels get clip room. */
#sr-map .sr-wheel-svg { width: 176px; height: 176px; }
#sr-map .sr-wheel-ring { fill: none; stroke: var(--sr-gold); stroke-width: 1; }
#sr-map .sr-wheel-ring-inner { fill: none; stroke: var(--sr-gold-deep); stroke-width: 0.7; opacity: 0.6; }
/* Item 2 — hairline inner circle to finish the composition as a jewel. */
#sr-map .sr-wheel-ring-hair { fill: none; stroke: var(--sr-gold); stroke-width: 0.4; opacity: 0.35; }
#sr-map .sr-wheel-spoke { stroke: var(--sr-gold-deep); stroke-width: 0.5; opacity: 0.45; }
/* Item 1 — monochrome brand-colored glyphs (fill also set inline as belt+braces). */
#sr-map .sr-wheel-sign { font-size: 11px; fill: var(--sr-gold-deep); }
#sr-map .sr-wheel-planet { font-size: 12px; fill: var(--sr-ink); }
/* Item 2 — thin gold axis lines that stop at the ring; tiny Cinzel labels. */
#sr-map .sr-wheel-asc { stroke: var(--sr-gold); stroke-width: 1; }
#sr-map .sr-wheel-mc { stroke: var(--sr-gold); stroke-width: 0.8; stroke-dasharray: 2.5 2; opacity: 0.85; }
#sr-map .sr-wheel-angle-label { font-family: 'Cinzel', serif; font-size: 7.5px; font-weight: 600; letter-spacing: 0.04em; fill: var(--sr-gold-deep); }
/* Item 5b — caption clarifying the wheel is one sky read many ways. */
#sr-map .sr-card-wheel-cap {
  font-family: 'EB Garamond', serif; font-style: italic; font-size: 0.82rem;
  line-height: 1.35; text-align: center; color: var(--sr-gold-deep);
  opacity: 0.9; max-width: 20ch; margin: 0.35rem auto 0;
}
/* Item 3 — the CTA as a marketing moment: italic lead-in + price-dominant button. */
#sr-map .sr-card-cta-lead {
  font-family: 'EB Garamond', serif; font-style: italic; font-size: 1.0rem;
  line-height: 1.4; color: var(--sr-ink); opacity: 0.88;
  text-align: center; margin: 0 0 0.6rem;
}
#sr-map .sr-card-cta {
  display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
  width: 100%; cursor: pointer; text-align: center;
  padding: 0.85rem 1rem 0.95rem; border-radius: 12px; border: none;
  background: linear-gradient(180deg, var(--sr-burgundy), var(--sr-burgundy-deep));
  color: var(--sr-parchment); transition: transform 0.15s, box-shadow 0.2s;
  box-shadow: 0 3px 14px rgba(74,22,32,0.32);
}
#sr-map .sr-card-cta-price {
  font-family: 'Cinzel Decorative', 'Cinzel', serif; font-weight: 700;
  font-size: 2.1rem; line-height: 1; letter-spacing: 0.01em;
  color: var(--sr-gold-shimmer, #F0D89A);
  text-shadow: 0 1px 6px rgba(0,0,0,0.28);
}
#sr-map .sr-card-cta-sub {
  font-family: 'Cinzel', serif; font-weight: 600; font-size: 0.78rem;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--sr-parchment); opacity: 0.9;
}
#sr-map .sr-card-cta:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(74,22,32,0.42); }
#sr-map .sr-card-cta:disabled { opacity: 0.75; cursor: default; transform: none; }

/* ════════════════════════════════════════════════════════════════════════
 * DIRECTION A — CANDLELIT CARTOGRAPHY (deep aubergine night, candle-flame dots)
 * ════════════════════════════════════════════════════════════════════════ */
#sr-map[data-theme="candlelit"] .sr-map-canvas {
  background:
    radial-gradient(120% 100% at 50% 0%, #43244a 0%, var(--sr-aubergine-deep) 55%, #1c0e1c 100%);
  border-color: var(--sr-gold-deep);
  box-shadow: inset 0 0 60px rgba(0,0,0,0.5), 0 10px 30px rgba(20,10,20,0.35);
}
#sr-map[data-theme="candlelit"] .sr-land :is(path, circle) {
  fill: rgba(184,145,80,0.10);
  stroke: rgba(212,172,104,0.55);
  stroke-width: 1;
}
#sr-map[data-theme="candlelit"] .sr-dot-halo {
  fill: #ffd67a;
  opacity: 0.35;
  filter: blur(2.5px);
}
#sr-map[data-theme="candlelit"] .sr-dot-core {
  fill: #fff1c4;
  stroke: #ffcf6a; stroke-width: 0.6;
  filter: drop-shadow(0 0 3px rgba(255,208,120,0.9));
}
#sr-map[data-theme="candlelit"] .sr-dot.is-live .sr-dot-core {
  animation: srFlicker 3.2s ease-in-out infinite;
}
@keyframes srFlicker {
  0%,100% { opacity: 1; }
  45% { opacity: 0.82; }
  70% { opacity: 0.95; }
}
#sr-map[data-theme="candlelit"] .sr-dot.is-quiet .sr-dot-core { fill: rgba(107,31,44,0.85); stroke: rgba(212,172,104,0.55); stroke-width: 0.6; filter: none; }
/* Re-assert the wake state over the theme rule (same specificity, later wins). */
#sr-map[data-theme="candlelit"] .sr-dot.is-quiet:hover .sr-dot-core,
#sr-map[data-theme="candlelit"] .sr-dot.is-quiet:focus-visible .sr-dot-core { fill: var(--sr-gold-bright); stroke: var(--sr-gold-deep); stroke-width: 0.8; }
#sr-map[data-theme="candlelit"] .sr-map-panel {
  background: var(--sr-parchment);
  border: 1px solid var(--sr-gold-deep); border-radius: 12px; padding: 1.1rem;
  box-shadow: inset 0 0 0 1px rgba(184,145,80,0.2);
}
#sr-map[data-theme="candlelit"] .sr-rank-item:first-child {
  background: linear-gradient(180deg, rgba(212,172,104,0.22), rgba(212,172,104,0.10));
  border-radius: 12px;
}

/* ════════════════════════════════════════════════════════════════════════
 * DIRECTION B — CELESTIAL ATLAS (burgundy night, 8-point star dots, compass)
 * ════════════════════════════════════════════════════════════════════════ */
#sr-map[data-theme="atlas"] .sr-map-canvas {
  background:
    radial-gradient(140% 120% at 50% -10%, #3a1420 0%, var(--sr-burgundy-deep) 45%, #250a12 100%);
  border-color: var(--sr-gold);
  box-shadow: inset 0 0 70px rgba(0,0,0,0.55), 0 10px 30px rgba(30,10,16,0.4);
}
#sr-map[data-theme="atlas"] .sr-land :is(path, circle) {
  fill: rgba(250,241,225,0.05);
  stroke: rgba(184,145,80,0.5);
  stroke-width: 0.9;
  stroke-dasharray: 2 2.5;
}
/* Star-form dots: overlay an 8-point spark via a pseudo core using CSS scale of the badge geometry.
   We restyle the core into a sharp star using a conic clip is not portable in SVG, so we tint + add rays via box-shadow-like glow. */
#sr-map[data-theme="atlas"] .sr-dot-core {
  fill: #fff;
  stroke: var(--sr-gold-bright); stroke-width: 0.5;
  filter: drop-shadow(0 0 2px #fff) drop-shadow(0 0 5px rgba(212,172,104,0.8));
}
#sr-map[data-theme="atlas"] .sr-dot-halo { fill: var(--sr-gold-shimmer); opacity: 0.22; filter: blur(2px); }
#sr-map[data-theme="atlas"] .sr-dot.is-quiet .sr-dot-core { fill: rgba(255,255,255,0.35); filter: none; stroke: none; }
/* Re-assert the wake state over the theme rule (same specificity, later wins). */
#sr-map[data-theme="atlas"] .sr-dot.is-quiet:hover .sr-dot-core,
#sr-map[data-theme="atlas"] .sr-dot.is-quiet:focus-visible .sr-dot-core { fill: var(--sr-gold-bright); stroke: var(--sr-gold-deep); stroke-width: 0.8; }
#sr-map[data-theme="atlas"] .sr-dot-badge rect { fill: rgba(37,10,18,0.9); }
#sr-map[data-theme="atlas"] .sr-dot-badge text { fill: var(--sr-gold-shimmer); }
#sr-map[data-theme="atlas"] .sr-map-panel {
  background: var(--sr-parchment);
  border: 1px solid var(--sr-gold); border-radius: 4px; padding: 1.1rem;
}
#sr-map[data-theme="atlas"] .sr-rank-title { letter-spacing: 0.2em; }

/* ════════════════════════════════════════════════════════════════════════
 * DIRECTION C — GILDED LEDGER (parchment DAY map, burgundy dots gold rims)
 * ════════════════════════════════════════════════════════════════════════ */
#sr-map[data-theme="ledger"] .sr-map-canvas {
  background:
    radial-gradient(120% 100% at 50% 0%, #fdf6e4 0%, var(--sr-parchment) 60%, #f0e4c4 100%);
  border-color: var(--sr-burgundy);
  box-shadow: inset 0 0 0 1px rgba(184,145,80,0.4), 0 8px 24px rgba(120,90,50,0.18);
}
#sr-map[data-theme="ledger"] .sr-land :is(path, circle) {
  fill: rgba(184,145,80,0.16);
  stroke: var(--sr-gold-deep);
  stroke-width: 1.2;
}
#sr-map[data-theme="ledger"] .sr-inset-box { stroke: var(--sr-gold-deep); }
#sr-map[data-theme="ledger"] .sr-inset-label { fill: var(--sr-gold-deep); }
#sr-map[data-theme="ledger"] .sr-dot-halo { fill: var(--sr-burgundy); opacity: 0.16; filter: blur(2px); }
#sr-map[data-theme="ledger"] .sr-dot-core {
  fill: var(--sr-burgundy);
  stroke: var(--sr-gold); stroke-width: 1.4;
}
#sr-map[data-theme="ledger"] .sr-dot.is-quiet .sr-dot-core { fill: rgba(107,31,44,0.28); stroke: rgba(184,145,80,0.4); stroke-width: 0.8; }
/* Re-assert the wake state over the theme rule (same specificity, later wins). */
#sr-map[data-theme="ledger"] .sr-dot.is-quiet:hover .sr-dot-core,
#sr-map[data-theme="ledger"] .sr-dot.is-quiet:focus-visible .sr-dot-core { fill: var(--sr-gold-bright); stroke: var(--sr-gold-deep); stroke-width: 0.8; }
#sr-map[data-theme="ledger"] .sr-dot-badge rect { fill: var(--sr-burgundy); opacity: 0.95; }
#sr-map[data-theme="ledger"] .sr-dot-badge text { fill: var(--sr-gold-shimmer); }
/* Wax-seal medallion for the #1 (top) dot */
#sr-map[data-theme="ledger"] .sr-dot.is-top .sr-dot-core {
  fill: var(--sr-burgundy-deep); stroke: var(--sr-gold-bright); stroke-width: 2;
  filter: drop-shadow(0 1px 2px rgba(74,22,32,0.5));
}
#sr-map[data-theme="ledger"] .sr-dot.is-top .sr-dot-halo { fill: var(--sr-gold); opacity: 0.3; }
#sr-map[data-theme="ledger"] .sr-map-panel {
  background: #fffaf0;
  border: 1px solid var(--sr-gold); border-radius: 8px; padding: 1.1rem;
  box-shadow: 0 4px 14px rgba(120,90,50,0.14);
}
#sr-map[data-theme="ledger"] .sr-rank-item:first-child .sr-rank-num {
  background: var(--sr-burgundy); color: var(--sr-gold-shimmer);
  border-radius: 50%; width: 1.4rem; height: 1.4rem; line-height: 1.4rem; display: inline-block;
}

/* ════════════════════════════════════════════════════════════════════════
 * ZOOM + PAN (Task 15 follow-up) — wheel/pinch zoom, drag-to-pan, +/− controls
 * ════════════════════════════════════════════════════════════════════════ */

/* Geography keeps hairline weight at every zoom level; the dots counter-scale
   in JS (.sr-dot-inner), so strokes must not fatten either. */
#sr-map .sr-land :is(path, circle),
#sr-map .sr-lake path,
#sr-map .sr-borders path,
#sr-map .sr-coast path,
#sr-map .sr-inset-box {
  vector-effect: non-scaling-stroke;
}

/* Single-finger vertical page-scroll still works over the map at 1x;
   once zoomed, the map owns the gesture (drag = pan). */
#sr-map .sr-map-svg-wrap { touch-action: pan-y; }
#sr-map .sr-map-canvas.is-zoomed .sr-map-svg-wrap { touch-action: none; }
#sr-map .sr-map-canvas.is-zoomed { cursor: grab; }
#sr-map .sr-map-canvas.is-panning { cursor: grabbing; }
#sr-map .sr-map-canvas.is-panning .sr-dot { cursor: grabbing; }

/* Controls: small round gold-bordered buttons, top-right of the canvas. */
#sr-map .sr-zoom-controls {
  position: absolute; top: 0.7rem; right: 0.7rem;
  display: flex; flex-direction: column; gap: 0.4rem;
  z-index: 3;
}
#sr-map .sr-zoom-btn {
  width: 2.1rem; height: 2.1rem; border-radius: 50%;
  border: 1px solid var(--sr-gold);
  background: rgba(42, 20, 40, 0.55);
  color: var(--sr-gold-shimmer);
  font-family: 'EB Garamond', serif; font-size: 1.25rem; font-weight: 500;
  line-height: 1; cursor: pointer; padding: 0;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(20, 10, 20, 0.35);
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
  backdrop-filter: blur(2px);
}
#sr-map .sr-zoom-btn:hover {
  background: var(--sr-gold);
  color: var(--sr-aubergine-deep);
  border-color: var(--sr-gold-bright);
}
#sr-map .sr-zoom-btn:active { transform: scale(0.92); }
#sr-map .sr-zoom-btn:focus-visible {
  outline: 2px solid var(--sr-gold-bright);
  outline-offset: 2px;
}
#sr-map .sr-zoom-reset { font-size: 1.05rem; }
/* Day-map theme: dark-on-parchment buttons instead of night glass. */
#sr-map[data-theme="ledger"] .sr-zoom-btn {
  background: rgba(251, 243, 220, 0.85);
  color: var(--sr-burgundy);
  border-color: var(--sr-gold-deep);
}
#sr-map[data-theme="ledger"] .sr-zoom-btn:hover {
  background: var(--sr-burgundy);
  color: var(--sr-gold-shimmer);
}

/* ── Responsive ── */
@media (max-width: 860px) {
  /* Top-5 cards stack vertically; the same centered anatomy, just full-width
     and a touch tighter. */
  #sr-map .sr-rank-list { grid-template-columns: 1fr; gap: 0.65rem; }
  #sr-map .sr-rank-open { padding: 0.85rem 0.9rem 0.75rem; row-gap: 0.25rem; }
  #sr-map .sr-rank-score { font-size: 1.7rem; }
  #sr-map .sr-rank-item:first-child .sr-rank-score { font-size: 2rem; }
  /* Detail card returns to its vertical composition. */
  #sr-map .sr-side-card.is-open { display: block; }
  #sr-map .sr-side-card .sr-card-label { margin-bottom: 0.9rem; }
  #sr-map .sr-side-card .sr-card-wheel { margin: 0.4rem 0 1rem; }
  #sr-map .sr-side-card .sr-card-cta-block { width: 100%; margin-top: 0.4rem; }
}
@media (max-width: 520px) {
  #sr-map { margin-top: 2.4rem; }
  #sr-map .sr-goal-pills { gap: 0.4rem; }
  #sr-map .sr-pill { font-size: 0.86rem; padding: 0.35rem 0.75rem; }
  #sr-map .sr-map-title { font-size: 1.7rem; }
  #sr-map .sr-map-nextline { font-size: 1.0rem; }
  #sr-map .sr-map-nextline .sr-map-nextdate { font-size: 1.05rem; }
  #sr-map .sr-dot-badge text { font-size: 13px; }
  #sr-map .sr-zoom-btn { width: 2.4rem; height: 2.4rem; }  /* comfortable tap targets */
  #sr-map .sr-rank-more { font-size: 0.95rem; }
}

/* ─── ALTAR INTENTION PICKER (Michael 2026-07-05) — the buyer chooses what
      the paid reading + Birthday Map are scored for, right before the CTA.
      Gold pills on the dark altar field; active = warm gold fill. ─── */
body.sr-page .sr-altar-goals { margin: 1.9rem 0 2rem; }
body.sr-page .sr-altar-goals-label {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 1.55rem;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--gold-shimmer, #F0D89A);
  margin-bottom: 1.2rem;
}
body.sr-page .sr-altar-goals-row {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.85rem;
  max-width: 680px; margin: 0 auto;
}
body.sr-page .sr-goal-pick {
  cursor: pointer;
  font-family: 'EB Garamond', serif; font-weight: 600; font-size: 1.08rem;
  padding: 0.6rem 1.25rem;
  color: var(--gold-bright, #D4AC68);
  background: rgba(212, 172, 104, 0.08);
  border: 1px solid rgba(212, 172, 104, 0.55);
  border-radius: 999px;
  transition: background 0.18s, color 0.18s, border-color 0.18s, transform 0.12s;
}
body.sr-page .sr-goal-pick:hover { border-color: var(--gold-shimmer, #F0D89A); transform: translateY(-1px); }
body.sr-page .sr-goal-pick.is-active {
  color: var(--burgundy-deep, #4A1620);
  background: linear-gradient(180deg, var(--gold-pale, #E5C68A), var(--gold-bright, #D4AC68));
  border-color: var(--gold-shimmer, #F0D89A);
  box-shadow: 0 2px 10px rgba(212, 172, 104, 0.35);
}
body.sr-page .sr-goal-pick:focus-visible { outline: 2px solid var(--gold-shimmer, #F0D89A); outline-offset: 2px; }
body.sr-page .sr-altar-goals-note {
  font-family: 'EB Garamond', serif; font-style: italic; font-size: 1.28rem;
  line-height: 1.55; color: var(--gold-shimmer, #F0D89A);
  max-width: 48ch; margin: 1.2rem auto 0;
}
@media (max-width: 520px) {
  body.sr-page .sr-goal-pick { font-size: 0.92rem; padding: 0.38rem 0.75rem; }
}
