/* ==========================================================================
   Aperture22 — Shared Design Tokens & Components
   Unified navbar, footer, and design system across all pages
   ========================================================================== */

/* ── Design Tokens ────────────────────────────────────────────────────────── */

/* ── Master Token System (light mode defaults) ────────────────────────────── */
:root {
  /* Accent — Golden Hour amber (light mode) */
  --accent-primary: #A25A0D;        /* text/link accent (distinct from --accent-fill) — 5.07:1 on card, 4.95:1 on primary, 4.58:1 on secondary — AA pass */
  --accent-fill:    #E0821A;        /* pill/badge fills (decorative) */
  --accent-fill-strong: #E0821A;    /* button fills w/ dark text (--accent-on) — 6.63:1 */
  --accent-light:   rgba(224, 130, 26, 0.14); /* backgrounds, badge fills, glass tints */
  --accent-hover:   #CC7413;        /* hover state */
  --accent-active:  #B5660F;        /* pressed state */
  --accent-on:      #111111;        /* text/icon on --accent-fill — #111 required: white on amber is 2.85:1 (fail), #111 is 6.63:1 (AA pass) */
  --accent-on-tint: #8A4D0B;        /* text on --accent-light tint (pills) — 5.65:1 on --bg-card, 5.82:1 on --bg-input. --accent-primary (#A25A0D) is reserved for links elsewhere and isn't re-verified against this tint. */
  --accent-glow:    rgba(224, 130, 26, 0.35);
  --accent-fill-rgb: 224, 130, 26;   /* rgb triplet for rgba() alpha use */
  --brand-22:        #A25A0D;        /* brand "22" text — 4.95:1 on nav, 5.07:1 on card */
  --brand-22-footer: #8A4D0B;        /* #A25A0D is 4.34:1 on the footer's --bg-subtle (fails normal text); this is 5.52:1 */

  /* Scrollbars — muted thumb on a near-invisible track */
  --scrollbar-track:       rgba(58, 48, 32, 0.06);
  --scrollbar-thumb:       #C8BFAA;
  --scrollbar-thumb-hover: #B8AE99;

  /* Surfaces */
  --bg-primary:   #FBF8F2;
  --bg-secondary: #F4EFE6;
  --bg-subtle:    #EFE9DD;
  --bg-card:      #FDFBF7;
  --bg-input:     #FFFFFF;
  --bg-elevated:  #FFFFFF;
  --bg-glass:     rgba(58, 48, 32, 0.05);
  --bg-glass-strong: rgba(255, 253, 249, 0.90);

  /* Text — contrast-corrected for WCAG AA on the warm surfaces above */
  --text-primary:   #3A342A;
  --text-secondary: #6B6355;   /* 5.74:1 on card (was #5A6B7C, ~5:1) */
  --text-muted:     #8A8171;   /* 3.72:1 on card — AA-large only (was #6B7280, ~4.8:1) */
  --text-heading:   #201B14;

  /* Lines & elevation */
  --border:        #E3DCCD;
  --border-hover:  #B8AE99;
  --border-input:  #C8BFAA;    /* visible field definition (was #CBD5E0) */
  --border-focus:  var(--accent-fill);
  --shadow:        rgba(40, 32, 18, 0.08);
  --shadow-sm:     0 1px 3px rgba(40, 32, 18, 0.08);
  --shadow-md:     0 8px 24px rgba(40, 32, 18, 0.10);
  --shadow-lg:     0 24px 80px rgba(40, 32, 18, 0.18);
  --shadow-elevated: rgba(40, 32, 18, 0.15);

  /* Semantic — light and dark now differ (see [data-theme="dark"] block) */
  --color-success: #2F7D4F;
  --color-warning: #A96A0B;
  --color-error:   #C13A25;
  --color-info:    #2E6FBF;

  /* ── Score tiers (App Workspace.dc.html) ─────────────────────────────
     The design defines FOUR tiers mapped to semantic tokens, not the legacy
     5-step --score-* ramp. Values are AA-checked on every surface a tier
     touches: bar fill vs its --border track, legend swatch vs card, and
     badge text vs card.
       good  uses --accent-primary in light: --accent-fill #E0821A measures
             2.09:1 on the track and 2.75:1 on the card, both below 3:1.
       fair  needs a text-safe sibling: --color-warning #A96A0B is 4.27:1 as
             text, just under AA, so --tier-fair-text darkens it. Same
             fill-vs-text split as --accent-fill / --accent-primary. */
  --tier-excellent:  var(--color-success);
  --tier-good:       var(--accent-primary);
  --tier-fair:       var(--color-warning);
  --tier-fair-text:  #8A560A;
  --tier-needs:      var(--color-error);

  /* Legacy 5-step ramp — retained for any consumer outside the Scores UI */
  --score-poor:        #ef4444;
  --score-below:       #f97316;
  --score-average:     #f59e0b;
  --score-good:        #3b82f6;
  --score-exceptional: #22c55e;
  /* Shorthand aliases for JS getComputedStyle reads */
  --score-bad: var(--score-poor);
  --score-low: var(--score-below);
  --score-mid: var(--score-average);
  --score-high: var(--score-exceptional);

  /* ─────────────────────────────────────────────
     Decorative chip / category colors — non-text UI indicators:
     coaching-focus pill borders (app.css), journey-leg strokes and
     map pin fills (planner.css / planner.js).
     Theme-independent EXCEPT teal + purple, which carry a
     [data-theme="dark"] override — light needs deeper tones to clear
     3:1 on warm off-white; the brighter originals only work on dark.
     ───────────────────────────────────────────── */
  --chip-neutral: #9ca3af;
  --chip-blue:    #6b7280;
  --chip-teal:    #1E8E7E;
  --chip-cyan:    #22d3ee;
  --chip-amber:   #fbbf24;
  --chip-orange:  #fb923c;
  --chip-red:     #f87171;
  --chip-purple:  #7C63C9;
  --chip-pink:    #f472b6;
  --chip-gold:    #fbbf24;
  /* Metro's journey leg — the 10th leg colour. Every other chip token is
     already a leg or collides with one: --chip-red IS dark-mode --color-error
     (the into-sun warning), --chip-amber IS --chip-gold, and --chip-blue reads
     as a muted grey beside --chip-neutral (the unset leg). */
  --chip-indigo:  #4F46E5;
  /* Train's journey leg — the 11th leg colour. Brown was the last unclaimed
     hue family (red = error, amber = gold); saddle brown for light, a warm
     tan in the dark block, same pattern as teal/purple/indigo. */
  --chip-brown:   #8B5A2B;

  /* Legacy System A aliases (used by shared.css components + other pages) */
  --color-bg-primary:            var(--bg-primary);
  --color-bg-secondary:          var(--bg-secondary);
  --color-bg-surface:            var(--bg-card);
  --color-bg-subtle:             var(--bg-subtle);
  --color-text-primary:          var(--text-primary);
  --color-text-secondary:        var(--text-secondary);
  --color-text-tertiary:         var(--text-secondary);  /* --text-muted is AA-large-only; this alias feeds small content text */
  --color-accent:                var(--accent-fill);
  --color-accent-hover:          var(--accent-hover);
  --color-border:                var(--border);
  --color-border-input:          var(--border-input);
  --color-border-focus:          var(--accent-fill);
  --color-nav-bg:                var(--bg-primary);
  --color-footer-bg:             var(--bg-subtle);
  --color-footer-text:           var(--text-primary);
  --color-footer-text-secondary: var(--text-secondary);  /* --text-muted was 3.18:1 on the footer's --bg-subtle; fails AA */
  --color-nav-active:            var(--text-heading);

  /* Legacy System C aliases (used by app.css components) */
  /* NB: this block used to carry `--border: var(--border)`. A custom property
     that references itself is guaranteed-invalid, so --border resolved to the
     empty string in light mode and every `border: 1px solid var(--border)`
     silently fell back to currentColor. Dark was unaffected only because its
     block re-declares --border. Removed — the #E3DCCD definition above stands. */
  --panel:  var(--bg-card);
  --text:   var(--text-heading);
  --muted:  var(--text-secondary);
  --bg:     var(--bg-primary);

  /* Legacy System B aliases (used by styles.css / admin / journal) */
  --color-bg:           var(--bg-secondary);
  --color-surface:      var(--bg-card);
  --color-text:         var(--text-primary);
  --color-text-muted:   var(--text-muted);   /* naming-trap fix: both *-muted now resolve to #6B7280 */

  /* Typography */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-heading: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, 'SF Mono', Menlo, Consolas, monospace;

  /* Type scale */
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-md:   1.125rem;
  --text-lg:   1.25rem;
  --text-xl:   1.75rem;
  --text-2xl:  2rem;
  --text-3xl:  2.5rem;
  --text-4xl:  3.5rem;
  --leading-tight:   1.1;
  --leading-snug:    1.25;
  --leading-normal:  1.6;
  --leading-relaxed: 1.8;
  --tracking-tight:  -0.02em;

  /* Spacing */
  --spacing-section: 80px;
  --spacing-content: 40px;
  --max-width: 1200px;
  --max-width-content: 720px;
  --max-width-admin: 900px;
  --nav-height: 64px;
  --border-radius: 8px;

  /* Spacing scale */
  --space-xs:  0.35rem;
  --space-sm:  0.75rem;
  --space-md:  1rem;
  --space-lg:  1.5rem;
  --space-xl:  2rem;
  --space-2xl: 3rem;

  /* Radius scale */
  --radius-sm:    3px;
  --radius-md:    4px;
  --radius-lg:    6px;
  --radius-xl:    8px;
  --radius-2xl:   12px;
  --radius-pill:  100px;
  --radius-round: 50%;

  /* Transitions */
  --transition-fast:  0.2s ease;
  --transition-theme: 0.25s ease;
  --transition-panel: 0.22s ease;

  /* Glass (frosted overlay legends) */
  --glass-bg:     rgba(0, 0, 0, 0.50);
  --glass-border: 0.75px solid rgba(255, 255, 255, 0.25);
  --glass-blur:   blur(12px);

  /* Topographic background (img/topo/). The SVGs are alpha masks, so one
     asset takes --topo-line in both themes. --topo-o is the page tile,
     --topo-art-o the Expedition22 starting-view art; its index line is 5×.
     --topo-footer-o is the site footer's own, unfaded tile; light stops at 6%
     because the footer links (4.91:1 bare) must stay AA where a line crosses. */
  --topo-line:   #6E6150;
  --topo-index:  var(--accent-fill);
  --topo-o:      0.05;
  --topo-art-o:  0.06;
  --topo-footer-o: 0.06;
}

/* ── Dark Mode Tokens ─────────────────────────────────────────────────────── */
[data-theme="dark"] {
  /* Accent — warm amber / golden hour (editorial, not neon orange) */
  --accent-primary: #D4862A;
  --accent-fill:    #D4862A;
  --accent-fill-strong: #D4862A;
  --accent-light:   rgba(212, 134, 42, 0.12);
  --accent-hover:   #E89A3A;
  --accent-active:  #C07824;
  --accent-on:      #111111;
  --accent-on-tint: #E0A054;        /* text on --accent-light tint (pills) — 5.61:1 on --bg-card, 5.19:1 on --bg-input. The obvious #D4862A (existing --accent-primary) only reaches 4.36:1 on this tint and fails AA — do not reuse it here. */
  --accent-glow:    rgba(212, 134, 42, 0.40);
  --accent-fill-rgb: 212, 134, 42;

  /* Scrollbars — dark charcoal thumb on a near-black track */
  --scrollbar-track:       rgba(0, 0, 0, 0.25);
  --scrollbar-thumb:       #3A3A3A;
  --scrollbar-thumb-hover: #4A4A4A;

  /* Surfaces — Spotify-inspired warm charcoal, each step barely perceptible */
  --bg-primary:      #191919;
  --bg-secondary:    #1F1F1F;
  --bg-subtle:       #141414;
  --bg-card:         #262626;
  --bg-input:        #2C2C2C;
  --bg-elevated:     #2A2A2A;
  --bg-glass:        rgba(255, 255, 255, 0.04);
  --bg-glass-strong: rgba(255, 255, 255, 0.07);

  /* Text */
  --text-primary:   #E0E0E0;
  --text-secondary: #A0A0A0;
  --text-muted:     #6A6A6A;
  --text-heading:   #F5F5F7;

  /* Lines & elevation */
  --border:        #333333;
  --border-hover:  #444444;
  --border-input:  #3A3A3A;
  --shadow:        rgba(0, 0, 0, 0.4);
  --shadow-sm:     0 1px 3px rgba(0, 0, 0, 0.5);
  --shadow-md:     0 8px 24px rgba(0, 0, 0, 0.55);
  --shadow-lg:     0 24px 80px rgba(0, 0, 0, 0.65);
  --shadow-elevated: rgba(0, 0, 0, 0.6);

  /* Semantic — dark-adjusted */
  --color-success: #3DD68C;
  --color-warning: #FBBF24;
  --color-error:   #F87171;
  --color-info:    #5B9BE8;

  /* Score tiers — dark. --accent-fill and --color-warning both clear AA on
     the dark surfaces, so no darkened siblings are needed here. */
  --tier-good:       var(--accent-fill);
  --tier-fair-text:  var(--color-warning);

  /* Legacy 5-step ramp */
  --score-poor:        #F87171;
  --score-below:       #FB923C;
  --score-average:     #FBBF24;
  --score-exceptional: #3DD68C;
  --score-bad:  var(--score-poor);
  --score-low:  var(--score-below);
  --score-mid:  var(--score-average);
  --score-high: var(--score-exceptional);

  /* Re-declared (same values as :root) so dark can't inherit a future light-mode edit */
  --chip-teal:    #2DD4BF;
  --chip-purple:  #A78BFA;
  --chip-indigo:  #818CF8;
  --chip-brown:   #C89B6C;

  /* Topographic background — dark is capped at 7% */
  --topo-line:   #CDBFA6;
  --topo-o:      0.06;
  --topo-art-o:  0.07;
  --topo-footer-o: 0.10;
}

/* ── Smooth Scrolling ─────────────────────────────────────────────────────── */

html {
  scroll-behavior: smooth;
}

/* ── Global Typography (single source of truth for every page) ─────────────── */

html,
body {
  font-family: var(--font-primary);
}

body {
  margin: 0;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
}

/* ── Shared Navbar ────────────────────────────────────────────────────────── */

.shared-navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-border);
  height: var(--nav-height);
  font-family: var(--font-primary);
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
  transition: transform 0.3s ease;
  box-sizing: border-box;
  line-height: 1.6;
}

/* Hide navbar in App Mode (when working with images) */
body.app-mode-active .shared-navbar {
  display: none;
}

/* Hide footer in App Mode */
body.app-mode-active .shared-footer {
  display: none;
}

/* Planner Focus Mode (planner.css / planner.js, 2026-09-04) — same chrome
   suppression as App Mode, driven by its own body class */
body.planner-focus .shared-navbar,
body.planner-focus .shared-footer {
  display: none;
}

.navbar-container {
  box-sizing: content-box;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
}

/* Logo */
.logo-link {
  text-decoration: none;
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  column-gap: 8px;
}

.logo-link .logo-icon {
  grid-row: 1 / 3;
}

.logo-tagline {
  font-size: 0.5625rem;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--color-text-secondary);
  white-space: nowrap;
}

.logo-icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  color: var(--color-text-primary);
}

.logo-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--color-text-primary);
  letter-spacing: -0.02em;
}

.logo-number {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text-primary);
}

.brand-22 {
  color: var(--brand-22);
}

footer .brand-22 {
  color: var(--brand-22-footer);
}

.mobile-menu .nav-sub {
  display: block;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--color-text-secondary);
}

/* Nav Links */
.nav-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 32px;
  align-items: center;
}

.nav-center a {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  transition: color 0.2s ease;
  position: relative;
}

.nav-center a:not(.active):hover {
  color: var(--accent-primary);
}

.nav-center a.active {
  color: var(--color-text-primary);
  font-weight: 600;
}

.nav-center a.active::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent-fill);
}

/* Auth Area */
.nav-auth {
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-auth a,
.nav-auth button {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 0.9375rem;
  font-weight: 400;
  background: none;
  border: none;
  cursor: pointer;
  transition: color 0.2s ease;
  font-family: var(--font-primary);
}

.nav-auth a:hover {
  color: var(--accent-primary);
}

.nav-auth button:hover {
  color: var(--color-text-primary);
}

.nav-auth .sign-in-btn {
  background: transparent;
  color: var(--text-heading);
  border: 1px solid var(--color-border-input);
  padding: 8px 16px;
  border-radius: 6px;
  font-weight: 500;
  transition: background 0.2s ease, border-color 0.2s ease;
}

.nav-auth .sign-in-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--text-secondary);
  cursor: pointer;
  padding: 8px;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.mobile-menu-toggle:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--text-primary);
}

.mobile-menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--color-text-primary);
  transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--nav-height);
  left: 0;
  right: 0;
  background: var(--color-nav-bg);
  border-bottom: 1px solid var(--color-border);
  padding: 24px;
  flex-direction: column;
  gap: 20px;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.mobile-menu.active {
  display: flex;
}

.mobile-menu a,
.mobile-menu button {
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 1rem;
  font-weight: 400;
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-primary);
  padding: 8px 0;
}

.mobile-menu a:not(.active):not(.sign-in-btn):hover {
  color: var(--accent-primary);
}

.mobile-menu a.active {
  color: var(--color-text-primary);
  font-weight: 600;
}

.mobile-menu .sign-in-btn {
  background: transparent;
  color: var(--color-text-primary);
  border: 1px solid var(--color-border-input);
  padding: 12px 20px;
  border-radius: 6px;
  font-weight: 500;
  text-align: center;
  margin-top: 8px;
}

/* ── Shared Footer ────────────────────────────────────────────────────────── */

.shared-footer {
  background: var(--color-footer-bg);
  color: var(--color-footer-text);
  border-top: 1px solid var(--color-border);
  padding: 60px 24px 24px 24px;
  line-height: 1.6;
}

.footer-container {
  box-sizing: content-box;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 24px;
}

.footer-columns {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  margin-bottom: 48px;
}

.footer-column h3 {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--color-footer-text);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-logo {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 6px;
}

.footer-logo-icon {
  width: 24px;
  height: 24px;
  flex-shrink: 0;
  color: var(--color-footer-text);
}

.footer-logo-wordmark {
  display: flex;
  align-items: baseline;
  gap: 0;
}

.footer-logo-text {
  font-size: 1.25rem;
  font-weight: 300;
  color: var(--color-footer-text);
}

.footer-logo-number {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-footer-text);
}

.footer-tagline {
  font-size: 0.875rem;
  color: var(--color-footer-text-secondary);
  line-height: 1.5;
  margin-bottom: 6px;
}

.footer-about-link {
  font-size: 0.8125rem;
  color: var(--color-footer-text-secondary);
  text-decoration: none;
  transition: color 0.2s;
  display: inline-block;
}

.footer-about-link:hover {
  color: var(--accent-primary);
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.footer-links a {
  color: var(--color-footer-text-secondary);
  text-decoration: none;
  font-size: 0.875rem;
  transition: color 0.2s ease;
}

.footer-links a:hover {
  color: var(--accent-primary);
}

.footer-bottom {
  padding-top: 24px;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.8125rem;
  color: var(--color-footer-text-secondary);
}

.footer-copyright {
  display: flex;
  flex-direction: column;
}

.footer-legal-badge {
  display: block;
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 11px;
  color: var(--text-secondary);   /* 11px legal text — --text-muted is 3.18:1, fails AA */
  text-align: left;
  letter-spacing: 0.02em;
  opacity: 0.7;
  line-height: 1.4;
}

.footer-legal-badge-icon {
  display: inline-flex;
  width: 12px;
  height: 12px;
  vertical-align: -2px;
}

.footer-bottom a {
  color: var(--color-footer-text);
  text-decoration: none;
  transition: color 0.2s ease;
}

.footer-bottom a:hover {
  color: var(--accent-primary);
}

/* Keyboard focus for header, mobile-menu, and footer navigation plus the
   theme control: the same ring the site's info pills use (one token, no
   colour-only indication). Replaces the browser default ring, never removes
   it. */
.nav-center a:focus-visible,
.nav-auth a:focus-visible,
.mobile-menu a:focus-visible,
.footer-about-link:focus-visible,
.footer-links a:focus-visible,
.footer-bottom a:focus-visible,
.theme-toggle:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* ── Responsive ───────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* Hide desktop nav, show mobile toggle */
  .nav-center,
  .nav-auth {
    display: none;
  }

  .mobile-menu-toggle {
    display: flex;
  }

  /* Footer — compact single-column on mobile */
  .shared-footer {
    padding: 28px 20px 20px;
  }

  .footer-columns {
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
  }

  /* Hide logo/tagline brand block on mobile to save vertical space */
  .footer-brand {
    display: none;
  }

  /* Collapse link lists horizontally on mobile */
  .footer-links {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px 16px;
  }

  .footer-column h3 {
    margin-bottom: 8px;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 10px;
    text-align: center;
    padding-top: 16px;
  }

  .footer-legal-badge {
    font-size: 10px;
    margin-top: 3px;
  }
}

@media (max-width: 1024px) {
  .footer-columns {
    grid-template-columns: repeat(2, 1fr);
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* ── Feedback Widget (modal panel, opened from the footer link) ─────────── */

.feedback-panel {
  position: fixed;
  bottom: 80px;
  right: 20px;
  max-width: 400px;
  width: calc(100vw - 40px);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 24px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  z-index: 1000;
  display: none;
}

.feedback-panel.active {
  display: block;
  animation: slideUp 0.2s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.feedback-panel-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.feedback-panel-title {
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text-heading);
  margin: 0;
}

.feedback-panel-subtitle {
  font-family: var(--font-primary);
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin: 0 0 20px 0;
  line-height: 1.5;
}

.feedback-form-group {
  margin-bottom: 16px;
}

.feedback-form-label {
  display: block;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.feedback-type-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.feedback-type-pill {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--bg-input);
  color: var(--text-secondary);
  font-family: var(--font-primary);
  font-size: 0.8125rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.feedback-type-pill:hover {
  border-color: var(--border-hover);
  background: var(--bg-secondary);
}

.feedback-type-pill.active {
  background: rgba(var(--accent-fill-rgb), 0.08);
  color: var(--accent-primary);
  border-color: var(--accent-fill-strong);
}

.feedback-textarea {
  width: 100%;
  min-height: 120px;
  padding: 12px;
  border: 1px solid var(--border-input);
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 0.9375rem;
  color: var(--text-primary);
  resize: vertical;
  transition: border-color 0.2s ease;
}

.feedback-textarea:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.feedback-textarea::placeholder {
  color: var(--text-muted);
}

.feedback-submit-btn {
  width: 100%;
  padding: 12px;
  background: var(--accent-fill);
  color: var(--accent-on);
  border: 1px solid transparent;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.feedback-form-actions {
  display: flex;
  gap: 8px;
}

.feedback-form-actions .feedback-submit-btn {
  flex: 1;
  width: auto;
}

.feedback-cancel-btn {
  padding: 12px 16px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border);
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: .875rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.feedback-cancel-btn:hover {
  background: var(--bg-secondary);
  color: var(--text-primary);
}

.feedback-cancel-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px var(--accent-glow);
}

.feedback-submit-btn:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
}

.feedback-submit-btn:active {
  background: var(--accent-active);
  border-color: var(--accent-active);
}

.feedback-submit-btn:disabled {
  background: var(--bg-subtle);
  border-color: var(--border);
  color: var(--text-secondary);
  cursor: not-allowed;
}

.feedback-success-message,
.feedback-error-message {
  margin-top: 12px;
  padding: 12px;
  border-radius: 8px;
  font-family: var(--font-primary);
  font-size: 0.875rem;
  text-align: center;
}

.feedback-success-message {
  background: rgba(34, 197, 94, 0.10);
  color: var(--color-success);
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.feedback-error-message {
  background: #FEF2F2;
  color: #991B1B;
  border: 1px solid #FECACA;
}

@media (max-width: 768px) {
  .feedback-panel {
    right: 10px;
    bottom: 70px;
    width: calc(100vw - 20px);
  }
}

/* ── Demo Mode CTA ───────────────────────────────────────────────────────── */

/* Nav bar passive hint — sits next to Sign In, hidden for authenticated users */
/* Scoped under .nav-auth to outrank the generic `.nav-auth a` rule above,
   which sets color/font-size/background and would otherwise win. */
.nav-auth .nav-demo-cta {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--accent-primary);
  /* 0.08 not --accent-light (0.14): the heavier tint darkens the surface
     enough to drop amber-on-amber to 4.34:1. At 0.08 it clears AA at 4.60:1. */
  background: rgba(var(--accent-fill-rgb), 0.08);
  border-radius: var(--radius-pill);
  padding: 5px 12px;
  text-decoration: none;
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-auth .nav-demo-cta:hover {
  background: var(--accent-glow);
  color: var(--accent-primary);
  text-decoration: none;
}

/* Contextual pill — positioned by demo-cta.js, appears next to clicked disabled button */
.demo-cta-contextual {
  position: fixed;
  top: -9999px;
  left: -9999px;
  opacity: 0;
  z-index: 10001;
  display: inline-block;   /* shrink-to-fit: background always wraps content */
  white-space: nowrap;     /* single line; JS overrides to normal on narrow viewports */
  overflow: visible;
  background: rgba(0, 0, 0, 0.50);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 0.75px solid rgba(255, 255, 255, 0.25);
  border-radius: 6px;
  box-shadow: 2px 3px 8px rgba(0, 0, 0, 0.15);
  padding: 8px 12px;
  font: 500 11px/1.4 system-ui, -apple-system, sans-serif;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
  pointer-events: auto;
}

.demo-cta-link {
  color: var(--accent-primary);
  text-decoration: none;
  font-weight: 600;
}

.demo-cta-link:hover {
  text-decoration: underline;
}

/* ── Theme transition ─────────────────────────────────────────────────────── */
/* Applied after first paint to avoid FOUC */
body.theme-ready,
body.theme-ready *,
body.theme-ready *::before,
body.theme-ready *::after {
  transition: background-color 0.25s ease, color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease !important;
}

/* ── Theme Toggle Button ──────────────────────────────────────────────────── */
.theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 0;
  padding: 0;
  cursor: pointer;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  font-family: var(--font-primary);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
  line-height: 1;
}

.theme-toggle:hover {
  color: var(--accent-primary);
}

.theme-toggle-icon {
  display: inline-flex;
  width: 14px;
  height: 14px;
  line-height: 1;
}

.theme-toggle-label {
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Topographic page background (opt-in: <body class="topo-bg">) ─────────── */
/* Never on planner/admin: the map, Builder, shot cards, the floating card and
   exports live there (app.css gates its own to BaseStation22's empty state). isolation keeps the z-index:-1 layer above body's
   own background, which dark mode paints (html, body !important below). The
   fade clears the centred text column and is strongest in the side margins. */
body.topo-bg {
  isolation: isolate;
  --topo-mask: url(/img/topo/ridge-tile.svg) 0 0 / 640px 640px repeat,
    linear-gradient(90deg, black calc(50% - 600px), rgb(0 0 0 / 0.1) calc(50% - 380px), rgb(0 0 0 / 0.1) calc(50% + 380px), black calc(50% + 600px));
}
body.topo-bg::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--topo-line);
  opacity: var(--topo-o);
  -webkit-mask: var(--topo-mask);
  -webkit-mask-composite: source-in;
  mask: var(--topo-mask);
  mask-composite: intersect;
}
/* The site footer paints over the page layer, so it carries its own: every
   page, no fade (it is chrome, not a text column). App Mode and Focus hide
   the footer and with it the layer. */
.shared-footer { position: relative; isolation: isolate; }
.shared-footer::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--topo-line);
  opacity: var(--topo-footer-o);
  -webkit-mask: url(/img/topo/ridge-tile.svg) 0 0 / 640px 640px repeat;
  mask: url(/img/topo/ridge-tile.svg) 0 0 / 640px 640px repeat;
}
@media print {
  body.topo-bg::before,
  .shared-footer::before { display: none; }
}

/* ── Dark Mode Overrides — Shared Components ──────────────────────────────── */

/* Base page background — prevents any gap/bleed showing through */
[data-theme="dark"] html,
[data-theme="dark"] body {
  background-color: var(--bg-primary, #191919) !important;
}

/* Navbar */
[data-theme="dark"] .shared-navbar {
  background: var(--bg-primary);
  border-bottom-color: var(--border);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .mobile-menu {
  background: var(--bg-primary);
  border-bottom-color: var(--border);
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .nav-auth .sign-in-btn:hover {
  background: var(--bg-secondary);
}

/* Footer — dark mode: entire tree must be dark */
[data-theme="dark"] .shared-footer {
  background: var(--bg-subtle) !important;
  color: var(--text-primary) !important;
  border-top-color: var(--border) !important;
}

[data-theme="dark"] .footer-container {
  background: transparent !important;
  color: var(--text-primary) !important;
}

[data-theme="dark"] .footer-columns,
[data-theme="dark"] .footer-column,
[data-theme="dark"] .footer-bottom {
  background: transparent !important;
}

[data-theme="dark"] .footer-column h3 {
  color: var(--color-footer-text) !important;
}

[data-theme="dark"] .footer-links a,
[data-theme="dark"] .footer-tagline,
[data-theme="dark"] .footer-about-link {
  color: var(--color-footer-text-secondary) !important;
}

[data-theme="dark"] .footer-links a:hover,
[data-theme="dark"] .footer-about-link:hover,
[data-theme="dark"] .footer-bottom a:hover {
  color: var(--accent-primary) !important;
}

[data-theme="dark"] .footer-logo-text {
  color: var(--color-footer-text) !important;
}

[data-theme="dark"] .footer-bottom a {
  color: var(--color-footer-text) !important;
}

/* Feedback widget */
[data-theme="dark"] .feedback-panel {
  background: var(--bg-card);
  border-color: var(--border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .feedback-panel-title {
  color: var(--text-heading);
}

[data-theme="dark"] .feedback-panel-subtitle {
  color: var(--text-secondary);
}

[data-theme="dark"] .feedback-form-label {
  color: var(--text-primary);
}

[data-theme="dark"] .feedback-type-pill {
  border-color: var(--border);
  background: var(--bg-secondary);
  color: var(--text-secondary);
}

[data-theme="dark"] .feedback-type-pill:hover {
  border-color: var(--border-input);
  background: var(--bg-card);
}

[data-theme="dark"] .feedback-type-pill.active {
  background: var(--accent-fill);
  color: var(--accent-on);
  border-color: var(--accent-fill);
}

[data-theme="dark"] .feedback-textarea {
  background: var(--bg-secondary);
  border-color: var(--border-input);
  color: var(--text-primary);
}

[data-theme="dark"] .feedback-textarea:focus {
  border-color: var(--accent-fill);
}

[data-theme="dark"] .feedback-textarea::placeholder {
  color: #777777;
}

[data-theme="dark"] .feedback-submit-btn {
  background: var(--accent-fill);
  color: var(--accent-on);
}

[data-theme="dark"] .feedback-submit-btn:hover {
  background: var(--accent-hover);
}

[data-theme="dark"] .feedback-submit-btn:disabled {
  background: var(--border);
  color: var(--text-muted);
}

/* ── IP ownership notice (homepage + about) ──────────────────────────────── */

.ip-notice {
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  padding: 20px 24px 0;
  margin: 0;
}

/* ─────────────────────────────────────────────
   Legal page styles (Terms, Privacy)
   ───────────────────────────────────────────── */

.legal-page {
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 60px 24px 80px;
}

.legal-header {
  margin-bottom: 48px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border);
}

.legal-header h1 {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
  color: var(--text-heading);
  margin: 0 0 12px 0;
  letter-spacing: -0.02em;
}

.legal-header .legal-date {
  font-size: 0.875rem;
  color: var(--text-secondary);
  font-family: var(--font-primary);
}

.legal-section {
  margin-bottom: 40px;
}

.legal-section h2 {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin: 0 0 12px 0;
}

.legal-section h3 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--accent-primary);
  margin: 20px 0 8px 0;
}

.legal-section a {
  color: var(--accent-primary);
}

.legal-section a:hover {
  color: var(--accent-hover);
}

.legal-section p,
.legal-section li {
  font-size: 0.9375rem;
  color: var(--text-primary);
  line-height: 1.8;
  margin: 0 0 12px 0;
}

.legal-section ul {
  padding-left: 20px;
  margin: 0 0 12px 0;
}

.legal-section li {
  margin-bottom: 6px;
}

.legal-contact-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 24px;
  margin-top: 48px;
}

.legal-contact-box p {
  font-size: 0.9375rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 0;
}

.legal-contact-box a {
  color: var(--accent-primary);
}

/* ─────────────────────────────────────────────
   Layout utilities
   Extracted from repeated inline styles (app.html).
   ───────────────────────────────────────────── */

/* Vertical stack with a small gap (form field label + control). */
.u-stack-4 {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.u-stack-6 {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Inline checkbox/radio label: small text, icon/input + text in a row. */
.u-check-label {
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Terms acceptance note on signup form */
.signup-terms-note {
  margin: 12px 0 8px;
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: center;
  line-height: 1.4;
}
.signup-terms-note a {
  color: var(--accent-primary);
  text-decoration: underline;
}

/* ── App-wide scrollbar theming ──────────────────────────────────────────
   Consumes the --scrollbar-* tokens (defined per theme above) so light mode
   shows a warm neutral thumb and dark mode shows a charcoal thumb that
   blends with the theme instead of the browser-default white bar.
   Token-driven so no theme-specific selectors are needed here. */
html {
  scrollbar-color: var(--scrollbar-thumb) var(--scrollbar-track);
  scrollbar-width: thin;
}
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}
::-webkit-scrollbar-track {
  background: var(--scrollbar-track);
}
::-webkit-scrollbar-thumb {
  background: var(--scrollbar-thumb);
  border-radius: var(--radius-pill);
  border: 2px solid transparent;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--scrollbar-thumb-hover);
}
::-webkit-scrollbar-corner {
  background: var(--scrollbar-track);
}

/* ── Onboarding modal (Quick Start / How It Works) ──────────────────────── */
.onboarding-modal { position: fixed; top: 0; left: 0; width: 100%; height: 100%; z-index: 10000; opacity: 0; pointer-events: none; transition: opacity 0.2s ease; }
.onboarding-modal.open { opacity: 1; pointer-events: auto; }
.onboarding-backdrop { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); }
.onboarding-panel { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 90%; max-width: 580px; max-height: 85vh; background: var(--bg-card, #FFFFFF); color: var(--text-primary); border-radius: 12px; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15); display: flex; flex-direction: column; overflow: hidden; }
.onboarding-header { padding: 16px 20px; border-bottom: 1px solid var(--border, #E5E7EB); display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; }
.onboarding-header h2 { margin: 0; font-size: 1.25rem; font-weight: 600; }
.onboarding-body { padding: 16px 20px; overflow-y: auto; flex: 1; }
.onboarding-block { margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid var(--bg-subtle, #F9FAFB); }
.onboarding-block:last-child { border-bottom: none; margin-bottom: 0; }
.onboarding-block h3 { margin: 0 0 6px; font-size: 1rem; font-weight: 600; }
.a22-inl { display: inline-flex; vertical-align: -2px; margin-right: 6px; }
.gear-group-icon { display: inline-flex; vertical-align: -2px; margin-right: 6px; }
.onboarding-block-icon { display: inline-flex; vertical-align: -3px; margin-right: 8px; color: var(--accent-primary); }
.onboarding-block p { margin: 0 0 8px; font-size: 0.9rem; line-height: 1.55; color: var(--text-secondary, #4B5563); }
.onboarding-link { display: inline-block; color: var(--accent-primary, #6F6299); text-decoration: none; font-size: 0.85rem; font-weight: 500; }
.onboarding-link:hover { text-decoration: underline; }
.onboarding-footer { padding: 12px 20px; border-top: 1px solid var(--border); text-align: right; flex-shrink: 0; }
.onboarding-done-btn { background: var(--accent-fill); color: var(--accent-on); border: 1px solid transparent; padding: 8px 20px; border-radius: 6px; cursor: pointer; font-size: .875rem; font-weight: 600; transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease; }
.onboarding-done-btn:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
[data-theme="dark"] .onboarding-panel { background: var(--bg-card); }
[data-theme="dark"] .onboarding-block { border-bottom-color: rgba(255, 255, 255, 0.06); }

/* ── Map expand control (Planner Redesign.dc.html line 593) ──────────────
   Opaque --bg-card with a 1px border: the mock is explicit that map chrome
   is NOT glass — only overlay legends use the frosted treatment. */
.map-expandable {
  position: relative;
}

.map-expand-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 401;               /* above Leaflet panes (400) */
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-size: 13px;
  line-height: 1;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.map-expand-btn:hover {
  background: var(--bg-secondary);
  border-color: var(--accent-fill);
  color: var(--accent-primary);
}

/* Shared chevron: points right closed, rotates down when open. */
.a22-chev { display: inline-flex; vertical-align: -2px; transition: transform 0.15s ease; }
.a22-chev[data-open="true"],
[aria-expanded="true"] > .a22-chev,
[data-expanded="true"] > .a22-chev { transform: rotate(90deg); }

/* Collapse "−" and close "×": one borderless control. Glyph only, a faint
   circle on hover, a focus ring, and a 44px hit area on touch. */
.a22-ctl {
  flex: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--text-secondary);
  font-family: inherit;
  font-size: 18px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
}
.a22-ctl:hover { background: var(--bg-secondary); color: var(--text-primary); }
.a22-ctl:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow); }
.a22-ctl[hidden] { display: none; }
@media (pointer: coarse) {
  .a22-ctl { width: 44px; height: 44px; }
}

/* ── Info pills (shared so profile/app pages style them; mirrors planner.css) ── */
.info-pill { display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-left: 6px; padding: 0; background: transparent; border: 1px solid transparent; color: var(--text-secondary); cursor: help; vertical-align: middle; border-radius: 50%; line-height: 1; }
.info-pill:hover, .info-pill:focus-visible { color: var(--accent-primary); border-color: var(--accent-fill); outline: 2px solid var(--accent-primary); outline-offset: 2px; }
.info-pill-icon { width: 14px; height: 14px; pointer-events: none; }
.info-pop { position: fixed; max-width: 240px; padding: 8px 10px; background: var(--bg-glass-strong); border: 1px solid var(--border); border-radius: 8px; color: var(--text-primary); font-size: 0.75rem; line-height: 1.4; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.10); z-index: 9999; }
.info-pop[hidden] { display: none; }
[data-theme="dark"] .info-pop { background: var(--bg-card); border-color: var(--border); box-shadow: 0 6px 20px rgba(0, 0, 0, 0.5); }

/* ── Google map underlay + Street View (map-google.js, both map surfaces) ── */
/* The sanctioned Maps JavaScript API map renders UNDER Leaflet's panes, and
   the Google logo/copyright at its base remain visible for attribution.
   pointer-events:auto is deliberate (2026-08-19): it is what lets Google's own
   POI icons open Google's own native place card. Leaflet keeps ownership of
   everything above it — its panes are z-index 400-700 against this 0, so pin
   clicks never reach Google, and clicks that do still bubble to the Leaflet
   container, which is where drag/zoom/click handlers live. Pin-placement flows
   flip .google-underlay-inert on (map-google.js setUnderlayInert) so an armed
   click is always the user's pin drop. */
.google-maps-underlay { position: absolute; inset: 0; z-index: 0; pointer-events: auto; }
.google-maps-underlay.google-underlay-inert { pointer-events: none; }
/* Cursor: now that the underlay is hit-testable, Google's own map surface div
   carries an inline `cursor: default` that beats Leaflet's inherited grab, so
   the map stopped LOOKING draggable even though it still is. Matching that one
   inline value (and nothing else) hands the cursor back to Leaflet, while
   Google's POI-hover cursor — the same div flipped to `cursor: pointer` — is
   left alone as a free affordance that the icon is clickable. */
.google-maps-underlay div[style*="cursor: default"] { cursor: inherit !important; }

.street-view-panel { position: absolute; inset: 0; z-index: 1100; display: flex; flex-direction: column; background: var(--bg-elevated, var(--bg-card, #fff)); border-radius: inherit; overflow: hidden; }
.street-view-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 10px; border-bottom: 1px solid var(--border, #ddd); }
.street-view-title { font-size: 0.85rem; font-weight: 600; color: var(--text-primary, #222); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.street-view-body { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.street-view-status { font-size: 0.85rem; color: var(--text-muted, #666); padding: 12px; text-align: center; }
.street-view-img { width: 100%; height: 100%; object-fit: cover; }
.street-view-look { border: 1px solid var(--border, #ddd); background: transparent; cursor: pointer; font-size: 0.75rem; font-weight: 500; line-height: 1.2; padding: 3px 10px; border-radius: 999px; color: var(--text-muted, #666); white-space: nowrap; font-family: inherit; }
.street-view-look:hover:not(:disabled) { color: var(--text-primary, #222); }
.street-view-look:disabled { opacity: 0.6; cursor: default; }
.street-view-pano { width: 100%; height: 100%; }

/* Standard | Google + Map | Satellite pills — the one look for every map's tile
   toggle (planner seam, gallery PhotoMap, Analyze location map). Each page keeps
   its own toggle logic; only the styling is shared. */
.map-provider-tools { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.map-provider-tools[hidden] { display: none; }
.map-provider-toggle, .map-maptype-toggle { display: flex; gap: 3px; }
.map-provider-toggle[hidden], .map-maptype-toggle[hidden] { display: none; }
.map-provider-btn, .map-maptype-btn, .map-street-view {
  padding: 4px 11px;
  font-size: 0.72rem;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--color-bg-surface);
  border: 1px solid var(--color-border-input);
  border-radius: 999px;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}
.map-provider-btn.active, .map-maptype-btn.active { background: var(--accent-fill-strong); border-color: var(--accent-fill-strong); color: var(--accent-on); }
.map-provider-btn:hover, .map-maptype-btn:hover { border-color: var(--accent-fill); transition: border-color 0.2s ease; }
/* The drop shadow stays underneath the focus ring. */
.map-provider-btn:focus-visible, .map-maptype-btn:focus-visible, .map-street-view:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--accent-glow), 0 1px 3px rgba(0, 0, 0, 0.15); border-color: var(--accent-fill); }
.map-maptype-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0; }
.map-maptype-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; pointer-events: none; }
.map-sv-btn { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 24px; padding: 0; }
.map-sv-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-sv-btn.active { background: var(--accent-fill-strong); border-color: var(--accent-fill-strong); color: var(--accent-on); }
.map-street-view:disabled { opacity: 0.55; cursor: not-allowed; }

/* Light map-control surface (2026-09-29). Popups, the legend panels and the
   shot card float over map tiles, which stay light in both page themes, so
   they re-pin the LIGHT token values on themselves instead of inheriting the
   dark ones — one block, every child rule keeps using var(--bg-card) etc. The
   shot card, its toggles, labels and the Sun Dial (.sun-compass: the face, its
   markings and the details panel) are in it too. The "Legend & tips" pill and
   the planner's legend notes are not: they follow the page theme, as do page
   chrome, the left panel and the subject sheet. */
[data-theme="dark"] :is(
  .leaflet-popup,
  .shot-map-legend,
  .plan-viewer-map-pill,
  .plan-viewer-legend-panel,
  .map-provider-tools,
  .plans-world-map-header,
  .plans-list-btn,
  .subplanner-map-header .subplanner-scout-search,
  .subplanner-map-header .subplanner-map-tools,
  .subplanner-playback,
  .vision-map-toolbar,
  .vision-pin-toolbar,
  .vision-map-legend,
  .map-expand-btn,
  .shot-map-expand,
  .journey-pin-body[style*="var(--bg-elevated)"],
  .journey-pin-num,
  .journey-pin-time,
  .plan-viewer-trip-origin,
  .plan-viewer-sibling-shot,
  .subplanner-leg-icon,
  .sun-compass,
  .plan-viewer-shot-float,
  .plan-viewer-pins-toggle,
  .plan-viewer-save-flash,
  .plan-viewer-moved-label,
  .plan-viewer-unchanged-chip,
  .plan-viewer-adjusted-pin-chip,
  .vision-pins-toggle,
  .vision-map-moved-label,
  .vision-map-unchanged-chip,
  .overview-trip-map-open,
  .plans-world-map-note
) {
  --color-bg-surface: #FDFBF7;
  --color-surface: #FDFBF7;
  --color-text-primary: #3A342A;
  --color-text-secondary: #6B6355;
  --color-border: #E3DCCD;
  --color-border-input: #C8BFAA;
  --bg-card: #FDFBF7;
  --bg-secondary: #F4EFE6;
  --bg-elevated: #FFFFFF;
  --bg-input: #FFFFFF;
  --bg-subtle: #EFE9DD;
  --bg-glass-strong: rgba(255, 253, 249, 0.90);
  --text-primary: #3A342A;
  --text-heading: #201B14;
  --text-secondary: #6B6355;
  --text-muted: #8A8171;
  --border: #E3DCCD;
  --border-input: #C8BFAA;
  --border-hover: #B8AE99;
  --color-success: #2F7D4F;
  --color-warning: #A96A0B;
  --color-error: #C13A25;
  --color-info: #2E6FBF;
  --accent-primary: #A25A0D;
  --accent-on-tint: #8A4D0B;
  --accent-light: rgba(224, 130, 26, 0.14);
  --accent-fill: #E0821A;
  --accent-fill-strong: #E0821A;
  --accent-fill-rgb: 224, 130, 26;
  --accent-glow: rgba(224, 130, 26, 0.35);
  --chip-indigo: #4F46E5;
  --scrollbar-track: rgba(58, 48, 32, 0.06);
  --scrollbar-thumb: #C8BFAA;
  --scrollbar-thumb-hover: #B8AE99;
}
/* The card is a light surface, so its native scroll bar follows it. */
.plan-viewer-shot-float { color-scheme: light; }
/* These inherit their text colour from the dark page, so it is set here too.
   :where keeps it from outranking any colour a child rule sets itself. */
[data-theme="dark"] :where(
  .sun-compass,
  .plan-viewer-shot-float,
  .plan-viewer-pins-toggle,
  .plan-viewer-save-flash,
  .vision-pins-toggle,
  .overview-trip-map-open,
  .plans-world-map-note,
  .vision-map-toolbar,
  .vision-pin-toolbar
) { color: var(--text-primary); }
[data-theme="dark"] .journey-pin-body[style*="var(--bg-elevated)"] { --bg-elevated: #FDFBF7; }
