:root {
  /* Winter-night village palette: deep night blue ground, warm gold as the
     primary accent (candlelight/lantern), holly and cranberry for status.
     bg-dark/bg-card/text-main/text-muted/color-primary/color-success/
     color-warning/color-danger are all admin-editable via the branding
     panel (/api/styles) - these are just the defaults. */
  --bg-dark: #0b1521;
  --bg-card: rgba(20, 28, 41, 0.72);
  --border-color: rgba(232, 169, 76, 0.16);
  --text-main: #f3f1ea;
  --text-muted: #8a96ab;
  --color-primary: #e8a94c;
  --color-primary-glow: rgba(232, 169, 76, 0.35);
  /* Gradient-partner shades derive from their base colour via color-mix(), not a
     second static hex, so admin re-theming (which only sets the base tokens -
     see shared-ui.js applyStyles / admin/main.js applyClientStyles) stays coherent:
     the gradient's second stop follows whatever primary/success/warning/danger
     the admin picks instead of freezing on the original default's partner shade. */
  --color-primary-2: color-mix(in srgb, var(--color-primary) 80%, black);
  --color-success: #2f6e4f;
  --color-success-glow: rgba(47, 110, 79, 0.35);
  --color-success-2: color-mix(in srgb, var(--color-success) 60%, black);
  --color-warning: #d98c3d;
  --color-warning-glow: rgba(217, 140, 61, 0.3);
  --color-warning-2: color-mix(in srgb, var(--color-warning) 80%, black);
  --color-danger: #b8433d;
  --color-danger-glow: rgba(184, 67, 61, 0.35);
  --color-danger-2: color-mix(in srgb, var(--color-danger) 80%, black);
  /* Single dark ink for text on gold/amber accent surfaces (buttons, badges, markers). */
  --ink-on-accent: #1c1406;

  /* Radius scale: inputs/buttons -> sm, cards/modals -> lg,
     toolbars/secondary cards -> md, mini/chips -> xs, status pills -> pill. */
  --radius-xs: 4px;
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 999px;

  /* Type scale, ~1.2 ratio. Snap every font-size to the nearest step. */
  --text-2xs: 0.72rem;
  --text-xs: 0.8rem;
  --text-sm: 0.9rem;
  --text-md: 1rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.9rem;
  --text-3xl: 2.4rem;
  /* Extends the scale for hero display numbers (countdown, big ETA figures). */
  --text-4xl: 3rem;
  --text-5xl: 4rem;

  /* Elevation: resting card / raised or hover / modal. Neutral depth only -
     coloured glows are a separate concern (see --color-*-glow above). */
  --elev-1: 0 8px 32px rgba(0, 0, 0, 0.3);
  --elev-2: 0 12px 40px rgba(0, 0, 0, 0.4);
  --elev-3: 0 20px 50px rgba(0, 0, 0, 0.6);

  /* 8px spacing grid. Extended with -10/-12 for larger section padding. */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;
  --space-12: 48px;

  /* Stroke icon sprite sizing (public/icons.svg). */
  --icon-sm: 16px;
  --icon-md: 20px;
  --icon-lg: 24px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: 'Karla', sans-serif;
  background-color: var(--bg-dark);
  /* Ambient accent kept tight to the top-left corner so it reads as a
     vignette, not a full-page colour wash (see docs/TODO-DESIGN.md glow pass). */
  background-image:
    radial-gradient(at 8% 0%, var(--color-primary-glow) 0px, transparent 22%),
    radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.03) 0%, rgba(0, 0, 0, 0.15) 100%);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
}

/* Flat design mode (Theme & Branding > Disable gradients): strips the
   ambient radial-gradient glows down to the plain --bg-dark colour. Higher
   specificity than the page-specific `body { background-image: ... }`
   overrides in index.css/login.css, so it wins regardless of link order. */
html.no-gradients body,
html.no-gradients body.login-body {
  background-image: none;
}

#snow-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  pointer-events: none;
}

.app-wrapper {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  overflow-x: hidden;
}

header {
  padding: var(--space-4) var(--space-8);
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  z-index: 100;
  flex-wrap: wrap;
  gap: var(--space-3);
  max-width: 100vw;
  box-sizing: border-box;
}

.logo-container {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
  max-width: 100%;
}

.header-brand-logo,
.brand-logo,
.branding-logo {
  height: 64px;
  width: auto;
  max-width: 100px;
  border-radius: var(--radius-xs);
  object-fit: contain;
  display: none;
}

.header-brand-logo.visible,
.brand-logo.visible,
.branding-logo.visible {
  display: inline-block !important;
}

.logo-container h1 {
  font-family: 'Fraunces', serif;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-primary, #e8a94c);
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}

.wordmark {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.tagline {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-2xs);
  font-weight: 500;
  letter-spacing: 1.4px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 2px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  flex-wrap: wrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-wrap: wrap;
}

.nav-btn {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-sm);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-main);
  text-decoration: none;
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-2xs);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  transition: all 0.3s;
}

.nav-btn:hover {
  background: rgba(232, 169, 76, 0.1);
  border-color: var(--color-primary);
}

.nav-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.nav-btn-logout {
  background: color-mix(in srgb, var(--color-danger) 20%, transparent);
  border-color: color-mix(in srgb, var(--color-danger) 40%, transparent);
  color: var(--color-danger);
}

.nav-btn-logout:hover {
  background: color-mix(in srgb, var(--color-danger) 35%, transparent);
  border-color: color-mix(in srgb, var(--color-danger) 60%, transparent);
}

@media (max-width: 768px) {
  header {
    padding: var(--space-3) var(--space-4);
    gap: var(--space-3);
  }
  .logo-container {
    gap: var(--space-2);
  }
  .logo-container h1 {
    font-size: var(--text-lg);
    word-break: break-word;
  }
  .tagline {
    display: none;
  }
  .header-actions {
    gap: var(--space-2);
  }
  .nav-links {
    gap: var(--space-2);
  }
  .nav-btn {
    padding: var(--space-2) var(--space-3);
    font-size: var(--text-2xs);
  }
  .route-header-badge {
    font-size: var(--text-2xs);
    padding: 2px var(--space-2);
    max-width: 160px;
  }
}


.status-badge {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
}

@keyframes pulse {
  0% { transform: scale(0.9); opacity: 0.6; }
  100% { transform: scale(1.2); opacity: 1; }
}

/* Shared "live" indicator: a lantern that swings and glows while live, and
   hangs still and dim otherwise. Used wherever a page needs to show signal
   freshness (public landing, cockpit, admin live monitor). */
.lantern-badge {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-xs);
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}

.lantern-icon {
  width: 18px;
  height: 26px;
  color: var(--text-muted);
  transform-origin: top center;
  transition: color 0.4s ease;
}

.lantern-badge.live {
  color: var(--text-main);
}

.lantern-badge.live .lantern-icon {
  color: var(--color-primary);
  filter: drop-shadow(0 0 6px var(--color-primary-glow));
  animation: lantern-swing 2.6s ease-in-out infinite;
}

.lantern-badge.alarm {
  color: var(--color-danger);
}

.lantern-badge.alarm .lantern-icon {
  color: var(--color-danger);
  animation: lantern-flicker 1.4s steps(1) infinite;
}

@keyframes lantern-swing {
  0%, 100% { transform: rotate(-6deg); }
  50% { transform: rotate(6deg); }
}

@keyframes lantern-flicker {
  0%, 100% { opacity: 1; }
  45% { opacity: 0.4; }
  50% { opacity: 0.9; }
  55% { opacity: 0.55; }
}

@media (prefers-reduced-motion: reduce) {
  .lantern-icon {
    animation: none !important;
  }
}

@media (max-width: 768px) {
  .lantern-badge {
    font-size: var(--text-2xs);
  }
}

/* Shared stroke icon sprite (public/icons.svg). currentColor means the icon
   always matches whatever text colour it sits in - buttons/badges/nav links
   all get a coherent icon colour for free, including through admin re-theming. */
.icon {
  display: inline-block;
  width: var(--icon-md);
  height: var(--icon-md);
  stroke: currentColor;
  fill: none;
  vertical-align: -0.35em;
  flex-shrink: 0;
}

.icon-sm {
  width: var(--icon-sm);
  height: var(--icon-sm);
}

.icon-lg {
  width: var(--icon-lg);
  height: var(--icon-lg);
}

.icon-spin {
  animation: spin 0.9s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .icon-spin {
    animation: none;
  }
}

/* Shared Form Controls */
.form-control {
  width: 100%;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: var(--space-2) var(--space-3);
  color: var(--text-main);
  font-family: 'Karla', sans-serif;
  /* 16px keeps mobile Safari from auto-zooming when a field is focused. */
  font-size: var(--text-md);
  transition: all 0.2s;
}

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 8px var(--color-primary-glow);
  background: rgba(0, 0, 0, 0.3);
}

/* Block field label used inside plain (non `.form-group`) field wrappers,
   e.g. modal forms and crew donation inputs - shared across admin/crew. */
.form-label {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-muted);
  display: block;
  margin-bottom: 5px;
}

/* Common Buttons */
.btn {
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-sm);
  border: none;
  font-weight: 700;
  font-family: 'Karla', sans-serif;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  transition: all 0.3s;
  text-decoration: none;
  font-size: var(--text-sm);
}

.btn-primary {
  background: var(--color-primary);
  color: var(--ink-on-accent);
  box-shadow: var(--elev-1);
}

.btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

/* Visually hides text while keeping it available to screen readers, for
   form controls whose purpose is clear visually but has no on-screen label. */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Section titles across pages are styled as flex rows (title + badge/actions).
   Where the title text is promoted to a real heading for a11y, reset the
   heading's browser defaults so it inherits the row's own typography. */
.card-title h2,
.card-title h3,
.panel-title h2,
.panel-title h3,
.route-title {
  margin: 0;
  font: inherit;
  color: inherit;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(232, 169, 76, 0.5);
}

.btn-success {
  background: var(--color-success);
  color: var(--text-main);
  box-shadow: var(--elev-1);
}

.btn-success:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-success) 50%, transparent);
}

.btn-danger {
  background: var(--color-danger);
  color: var(--text-main);
  box-shadow: var(--elev-1);
}

.btn-danger:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px color-mix(in srgb, var(--color-danger) 50%, transparent);
}

.btn-warning {
  background: var(--color-warning);
  color: var(--ink-on-accent);
  box-shadow: var(--elev-1);
}

.btn-warning:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(217, 140, 61, 0.5);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-main);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.15);
}

.btn-mini {
  padding: var(--space-1) var(--space-2);
  font-size: var(--text-2xs);
  border-radius: var(--radius-xs);
}

/* Shared Cards & Badges. Flat ink surface, not glass: no backdrop-filter blur,
   a resting elevation shadow only (glow is reserved for live/hover states
   elsewhere). Also the admin dashboard's .panel (see admin.css) - same shell,
   plus its own `gap`. */
.card, .glass-card, .panel {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--elev-1);
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

.badge {
  font-size: var(--text-2xs);
  padding: 3px var(--space-2);
  border-radius: var(--radius-xs);
  font-weight: 700;
}

.badge-primary {
  background: var(--color-primary);
  color: var(--ink-on-accent);
}

.badge-secondary {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-muted);
}

/* Shared status pill - a single component for the three previously
   hand-rolled "coloured tag" implementations (admin's role/approval badges,
   tracker's safety-lock pill, crew's crew-status pill). Tone modifiers use
   color-mix() against the semantic tokens so admin re-theming stays coherent. */
.status-pill {
  display: inline-flex;
  align-items: center;
  font-size: var(--text-2xs);
  font-weight: 700;
  padding: 2px var(--space-2);
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.3px;
  border: 1px solid transparent;
}

.status-pill--success {
  background: color-mix(in srgb, var(--color-success) 15%, transparent);
  color: var(--color-success);
  border-color: color-mix(in srgb, var(--color-success) 35%, transparent);
}

.status-pill--warning {
  background: color-mix(in srgb, var(--color-warning) 15%, transparent);
  color: var(--color-warning);
  border-color: color-mix(in srgb, var(--color-warning) 35%, transparent);
}

.status-pill--danger {
  background: color-mix(in srgb, var(--color-danger) 15%, transparent);
  color: var(--color-danger);
  border-color: color-mix(in srgb, var(--color-danger) 35%, transparent);
}

.status-pill--primary {
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  color: var(--color-primary);
  border-color: color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* Deliberately keyed off --text-main (not --text-muted): themes tune
   --text-muted for ordinary body-text legibility against their own card
   colour, which can end up brighter than a semantic tone like --color-success
   (see the "Santa's Workshop" green preset) and make "neutral" look more
   prominent than "success". Deriving from --text-main keeps this pill
   reliably de-emphasised regardless of what a theme does to --text-muted. */
.status-pill--neutral {
  background: color-mix(in srgb, var(--text-main) 12%, transparent);
  color: color-mix(in srgb, var(--text-main) 65%, transparent);
  border-color: color-mix(in srgb, var(--text-main) 20%, transparent);
}

/* Size variant for a heavier, more prominent pill (tracker's safety-lock
   status). The glow uses currentColor so it automatically follows whichever
   tone modifier is combined with it - a deliberate, state-driven glow (the
   safety lock is real system state, same category as .lantern-badge.live),
   not the ambient always-on glow the redesign otherwise removes. */
.status-pill--lg {
  font-size: var(--text-sm);
  padding: var(--space-1) var(--space-3);
  box-shadow: 0 0 10px color-mix(in srgb, currentColor 35%, transparent);
}

/* Monospace variant (crew's crew-status pill). */
.status-pill--mono {
  font-family: 'IBM Plex Mono', monospace;
}

/* Strips all chrome down to plain coloured text (tracker's route-name status,
   previously .status-text). */
.status-pill--plain {
  display: inline;
  background: none;
  border: none;
  padding: 0;
  border-radius: 0;
  text-transform: none;
  letter-spacing: normal;
  font-weight: 500;
}

/* Shared telemetry/stat-tile readout shell, used by index.css (public map)
   and tracker.css (cockpit) - each page keeps its own grid-template-columns/
   gap/value sizing (their layouts genuinely differ), just not this
   duplicated box/label treatment. Value defaults to plain --text-main
   (matching tracker's existing discipline) rather than an unconditional
   gold; pages opt individual values into the accent via .telemetry-value.highlight. */
.telemetry-item {
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.telemetry-label {
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-2xs);
  color: var(--text-muted);
  text-transform: uppercase;
  font-weight: 600;
  letter-spacing: 0.5px;
}

.telemetry-value {
  font-family: 'Fraunces', serif;
  color: var(--text-main);
}

.telemetry-value.highlight {
  color: var(--color-primary);
}

/* Shared hero card - the single, page-filling card used by login and
   volunteer (previously two identical hand-rolled cards, .login-card and
   .volunteer-card). One level up from the standard .card's --elev-1 since
   it's the sole page content. */
.hero-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  box-shadow: var(--elev-2);
  box-sizing: border-box;
}

/* Toast Notifications */
.toast {
  position: fixed;
  bottom: var(--space-6);
  right: var(--space-6);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--color-primary) 95%, transparent);
  color: var(--ink-on-accent);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: var(--text-sm);
  box-shadow: var(--elev-2);
  z-index: 4000;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show {
  opacity: 1;
}

/* Success tone: confirms a completed submission (e.g. volunteer application). */
.toast.success {
  background: color-mix(in srgb, var(--color-success) 95%, transparent);
  color: var(--text-main);
  box-shadow: 0 8px 30px var(--color-success-glow);
}

/* Warning tone: non-fatal heads-up (stale data, lost signal). */
.toast.warning {
  background: color-mix(in srgb, var(--color-warning) 95%, transparent);
  color: var(--text-main);
  box-shadow: 0 8px 30px var(--color-warning-glow);
}

/* Error tone: a request/action failed outright. */
.toast.error {
  background: color-mix(in srgb, var(--color-danger) 95%, transparent);
  color: var(--text-main);
  box-shadow: 0 8px 30px var(--color-danger-glow);
}

/* Strict Leaflet & Map Overflow Prevention */
.leaflet-container {
  width: 100% !important;
  max-width: 100% !important;
  overflow: hidden !important;
  box-sizing: border-box !important;
}

.leaflet-control-container,
.leaflet-top,
.leaflet-bottom,
.leaflet-left,
.leaflet-right {
  max-width: 100% !important;
  box-sizing: border-box !important;
}

.leaflet-control-attribution {
  max-width: 100% !important;
  white-space: normal !important;
  word-break: break-word !important;
  overflow-wrap: break-word !important;
  font-size: var(--text-2xs) !important;
  line-height: 1.1 !important;
  padding: 2px var(--space-1) !important;
}

.leaflet-pane,
.leaflet-tile,
.leaflet-marker-pane,
.leaflet-shadow-pane,
.leaflet-tile-pane,
.leaflet-overlay-pane,
.leaflet-popup-pane,
.leaflet-map-pane {
  max-width: 100% !important;
}

/* Map Controls Overlay */
.map-controls-overlay {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  z-index: 1000;
  display: flex;
  gap: var(--space-3);
}

.map-ctrl-btn {
  background: rgba(11, 21, 33, 0.9);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-pill);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-2xs);
  text-transform: uppercase;
  letter-spacing: 0.4px;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transition: all 0.25s ease;
  box-shadow: var(--elev-2);
  display: flex;
  align-items: center;
  gap: var(--space-2);
  line-height: 1;
}

.map-ctrl-btn:hover:not(:disabled) {
  background: var(--color-primary-glow);
  border-color: var(--color-primary);
  color: var(--text-main);
  box-shadow: 0 4px 16px var(--color-primary-glow);
}

.map-ctrl-btn.active {
  background: var(--color-primary);
  color: var(--ink-on-accent);
  border-color: var(--color-primary);
  box-shadow: 0 0 15px var(--color-primary-glow);
  font-weight: 700;
}

.map-ctrl-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.map-ctrl-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Shared Map Markers & Filters */
.start-marker-glow, .end-marker-glow, .start-end-marker-glow, .sleigh-marker-glow {
  font-size: var(--text-xl);
  display: flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  line-height: 1;
  width: 100%;
  height: 100%;
}

.start-marker-glow {
  filter: drop-shadow(0 0 8px var(--color-success)) drop-shadow(0 0 14px color-mix(in srgb, var(--color-success) 70%, transparent));
}

.end-marker-glow {
  filter: drop-shadow(0 0 8px var(--color-danger)) drop-shadow(0 0 14px color-mix(in srgb, var(--color-danger) 70%, transparent));
}

.start-end-marker-glow {
  font-size: var(--text-lg);
  letter-spacing: -2px;
  filter: drop-shadow(0 0 8px var(--color-primary)) drop-shadow(0 0 14px color-mix(in srgb, var(--color-primary) 70%, transparent));
}

.sleigh-marker-glow {
  filter: drop-shadow(0 0 8px var(--color-primary, #e8a94c)) drop-shadow(0 0 14px var(--color-primary-glow, rgba(232, 169, 76, 0.35)));
}

.start-marker-glow.no-glow,
.end-marker-glow.no-glow,
.start-end-marker-glow.no-glow,
.sleigh-marker-glow.no-glow {
  filter: none !important;
  box-shadow: none !important;
  background: transparent !important;
  border: none !important;
  animation: none !important;
}

@keyframes pulse-marker {
  0% { transform: scale(0.9); box-shadow: 0 0 8px var(--color-primary); }
  100% { transform: scale(1.1); box-shadow: 0 0 20px var(--color-primary); }
}

/* Custom Festive Map Tile CSS Filters */
.map-tile-winter {
  filter: hue-rotate(190deg) saturate(0.8) brightness(0.88) contrast(1.25) !important;
}
.map-tile-christmas {
  filter: sepia(0.4) hue-rotate(345deg) saturate(1.1) brightness(0.9) contrast(1.2) !important;
}
.map-tile-holiday {
  filter: hue-rotate(120deg) saturate(0.7) brightness(0.9) contrast(1.15) !important;
}

/* Route Preview: Marching-ants animated look-ahead line */
@keyframes march-ants {
  to { stroke-dashoffset: -30; }
}

/* Route Header Badge */
.route-header-badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border: 1px solid color-mix(in srgb, var(--color-primary) 18%, transparent);
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-pill);
  font-family: 'IBM Plex Mono', monospace;
  font-size: var(--text-2xs);
  letter-spacing: 0.3px;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--text-main, #f3f1ea);
  box-shadow: var(--elev-1);
  white-space: nowrap;
  max-width: 250px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.route-header-badge .route-icon {
  font-size: var(--text-sm);
}

/* Shared modal chrome - the CMS-style modals across admin (edit donations,
   edit volunteer, calendar share, A3 route preview) and the public calendar
   (map preview, shareable image) all hand-rolled their own overlay/card shell.
   Consolidated to one canonical treatment; each modal's own inline
   `style="display: none"` / JS toggle still opens/closes it, this class
   supplies everything else. The overlay keeps its dim + blur scrim (a
   conventional, expected pattern for dimming whatever's behind), but the
   card itself is flat (--bg-dark, opaque, no blur) rather than glass. */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(8px);
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--space-6);
}

.modal-card {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 90%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: var(--space-6);
  box-shadow: var(--elev-3);
  box-sizing: border-box;
}

.modal-card--wide {
  width: 100%;
  max-width: 850px;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.modal-card--xwide {
  width: 100%;
  max-width: 1100px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 0;
}

.modal-card--narrow {
  max-width: 800px;
}

.modal-header {
  padding: var(--space-4) var(--space-6);
  border-bottom: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.03);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.modal-header h3,
.modal-title {
  font-family: 'Fraunces', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-main);
  margin: 0;
}

.modal-subtitle {
  color: var(--text-muted);
  font-size: var(--text-sm);
  margin-top: 5px;
}

.modal-close-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: var(--text-xl);
  cursor: pointer;
  transition: color 0.2s;
}

.modal-close-btn:hover {
  color: var(--text-main);
}

.modal-body-center {
  padding: var(--space-6);
  overflow-y: auto;
  text-align: center;
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.modal-footer {
  padding: var(--space-4) var(--space-6);
  border-top: 1px solid var(--border-color);
  background: rgba(255, 255, 255, 0.02);
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
  flex-wrap: wrap;
}

/* Shared Confirm Dialog (SantaUI.confirmDialog - replaces window.confirm).
   z-index sits above .modal-overlay so a confirm triggered from inside an
   open CMS modal renders on top of it, not behind. */
.santa-confirm-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(5, 8, 20, 0.85);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  padding: var(--space-6);
}

.santa-confirm-overlay.show {
  display: flex;
}

.santa-confirm-box {
  background: var(--bg-dark);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  max-width: 450px;
  width: 100%;
  box-shadow: var(--elev-3);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-sizing: border-box;
}

.santa-confirm-title {
  font-family: 'Fraunces', serif;
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--text-main);
}

.santa-confirm-message {
  color: var(--text-main);
  font-size: var(--text-md);
  line-height: 1.5;
}

.santa-confirm-actions {
  display: flex;
  gap: var(--space-3);
  justify-content: flex-end;
}
