/* World Choir — Premium theme system (Dark default + Light) */

:root,
html[data-theme="dark"] {
  color-scheme: dark;

  /* Surfaces */
  --bg-void: #000000;
  --bg-primary: #000000;
  --bg-secondary: #0a0a0a;
  --bg-card: rgba(10, 10, 10, 0.85);
  --bg-card-hover: rgba(16, 16, 16, 0.92);
  --background-primary: var(--bg-primary);
  --background-secondary: var(--bg-secondary);
  --surface-primary: var(--bg-card);
  --surface-secondary: var(--bg-secondary);

  /* Borders */
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-glow: rgba(61, 124, 255, 0.22);
  --border-primary: var(--border-subtle);

  /* Text */
  --text-primary: #f4f4f6;
  --text-secondary: #a8abb8;
  --text-muted: #8a8e9a; /* ≥4.5:1 on black — WCAG AA for small text */

  /* Accents (identity colours) */
  --accent-blue: #3d7cff;
  --accent-violet: #6b5ce7;
  --accent-aurora: #4ec5e8;
  --accent-gold: #c9a962;
  --accent-primary: var(--accent-aurora);
  --accent-secondary: var(--accent-blue);
  --glow-blue: rgba(61, 124, 255, 0.35);
  --glow-violet: rgba(107, 92, 231, 0.25);

  /* Chrome */
  --icon-primary: var(--text-primary);
  --icon-secondary: var(--text-muted);
  --nav-background: rgba(0, 0, 0, 0.92);
  --overlay-background: rgba(0, 0, 0, 0.72);
  --input-background: rgba(255, 255, 255, 0.04);
  --shadow-card: 0 8px 32px rgba(0, 0, 0, 0.4);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  --logo-filter: none;
  --wc-boot-bg: #000000;

  /* Donate / Memory shared editorial tokens (dark) */
  --df-warm: #f2efe8;
  --df-warm-soft: rgba(242, 239, 232, 0.72);
  --df-muted: #8a8d97;
  --df-line: rgba(255, 255, 255, 0.08);
  --df-line-strong: rgba(78, 197, 232, 0.28);
  --df-accent: var(--accent-aurora);
  --mem-card-bg: #070708;
  --surface-lift: rgba(255, 255, 255, 0.04);
  --surface-lift-soft: rgba(255, 255, 255, 0.02);
  --surface-lift-mid: rgba(255, 255, 255, 0.03);
  --border-soft: rgba(255, 255, 255, 0.12);
  --border-mid: rgba(255, 255, 255, 0.1);
  --surface-gradient: linear-gradient(
    165deg,
    rgba(16, 16, 24, 0.92) 0%,
    rgba(10, 10, 14, 0.88) 100%
  );

  --radius-sm: 12px;
  --radius-md: 18px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', Arial, sans-serif;
  --nav-height: 84px;
  --transition: 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --theme-transition: 250ms ease;
}

html[data-theme="light"] {
  color-scheme: light;

  --bg-void: #ffffff;
  --bg-primary: #ffffff;
  --bg-secondary: #f3f3f5;
  --bg-card: rgba(255, 255, 255, 0.94);
  --bg-card-hover: #ececf0;
  --background-primary: var(--bg-primary);
  --background-secondary: var(--bg-secondary);
  --surface-primary: var(--bg-card);
  --surface-secondary: var(--bg-secondary);

  --border-subtle: rgba(0, 0, 0, 0.09);
  --border-glow: rgba(37, 99, 235, 0.28);
  --border-primary: var(--border-subtle);

  --text-primary: #0c0c0e;
  --text-secondary: #3a3d46;
  --text-muted: #5a5e69; /* ≥4.5:1 on white */

  --accent-blue: #2563eb;
  --accent-violet: #5546d6;
  --accent-aurora: #0a7f9c;
  --accent-gold: #8f7034;
  --accent-primary: var(--accent-aurora);
  --accent-secondary: var(--accent-blue);
  --glow-blue: rgba(37, 99, 235, 0.2);
  --glow-violet: rgba(85, 70, 214, 0.16);

  --icon-primary: var(--text-primary);
  --icon-secondary: var(--text-muted);
  --nav-background: rgba(255, 255, 255, 0.94);
  --overlay-background: rgba(255, 255, 255, 0.78);
  --input-background: rgba(0, 0, 0, 0.04);
  --shadow-card: 0 8px 28px rgba(0, 0, 0, 0.06);
  --inset-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.9);
  --logo-filter: brightness(0);
  --wc-boot-bg: #ffffff;

  --df-warm: #141416;
  --df-warm-soft: rgba(20, 20, 22, 0.72);
  --df-muted: #5a5e69;
  --df-line: rgba(0, 0, 0, 0.09);
  --df-line-strong: rgba(10, 127, 156, 0.32);
  --df-accent: var(--accent-aurora);
  --mem-card-bg: #f3f3f5;
  --surface-lift: rgba(0, 0, 0, 0.04);
  --surface-lift-soft: rgba(0, 0, 0, 0.025);
  --surface-lift-mid: rgba(0, 0, 0, 0.035);
  --border-soft: rgba(0, 0, 0, 0.12);
  --border-mid: rgba(0, 0, 0, 0.1);
  --surface-gradient: linear-gradient(
    165deg,
    #ffffff 0%,
    #f3f3f5 100%
  );
}

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

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  background: var(--bg-primary);
  /*
   * Never overflow-x clip/hidden on html OR body — on iOS Safari that turns
   * position:fixed into document-relative positioning, so the tab bar floats
   * mid-screen while scrolling. Horizontal lock lives on .page / tab panels.
   */
  max-width: 100%;
  overscroll-behavior-x: none;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-void);
  color: var(--text-primary);
  min-height: 100vh;
  overflow-x: visible;
  max-width: 100%;
  overscroll-behavior-x: none;
  line-height: 1.5;
}

/* Refined colour transition when the user toggles theme (not on every paint). */
html.wc-theme-animating,
html.wc-theme-animating *:not(img):not(video):not(canvas):not(iframe):not(svg image):not(.leaflet-tile):not(.maplibregl-canvas):not(.maplibre-canvas) {
  transition:
    background-color var(--theme-transition),
    color var(--theme-transition),
    border-color var(--theme-transition),
    fill var(--theme-transition),
    stroke var(--theme-transition),
    box-shadow var(--theme-transition),
    opacity var(--theme-transition) !important;
}

/* Ambient background */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg-primary);
}

/* Brand logos for surfaces that still use the dark-UI mark.
   Home/Profile/Donate light use dedicated light assets — never brightness/invert those. */
html[data-theme="light"] .df-topbar__logo img:not([src*="donations-light"]),
html[data-theme="light"] .wc-brand-logo,
html[data-theme="light"] img[src*="world-choir-logo"]:not(.home-logo):not(.profile-logo):not(.passport-card__logo):not([src*="world-choir-light"]):not([src*="donations-light"]) {
  filter: var(--logo-filter);
}

html[data-theme="light"] .home-logo,
html[data-theme="light"] .home-logo--light,
html[data-theme="light"] .profile-logo,
html[data-theme="light"] .profile-logo--light,
html[data-theme="light"] img[src*="world-choir-light"],
html[data-theme="light"] img[src*="donations-light"],
html[data-theme="light"] .passport-card__logo {
  filter: none !important;
}

/* Home: exactly one logo visible — light asset never shows in Dark Mode */
img.home-logo.home-logo--light {
  display: none !important;
}

html[data-theme="light"] img.home-logo.home-logo--dark {
  display: none !important;
}

html[data-theme="light"] img.home-logo.home-logo--light {
  display: block !important;
}

/* Profile: same swap, keep existing .profile-logo size/position */
img.profile-logo.profile-logo--light {
  display: none !important;
}

html[data-theme="light"] img.profile-logo.profile-logo--dark {
  display: none !important;
}

html[data-theme="light"] img.profile-logo.profile-logo--light {
  display: block !important;
}

/* Keep photographic / content imagery untouched even if nested under logo selectors */
html[data-theme="light"] .df-card img,
html[data-theme="light"] .mem-feed img,
html[data-theme="light"] .memory-photo img,
html[data-theme="light"] .wc-chain-hero__img,
html[data-theme="light"] .foundation-card img,
html[data-theme="light"] img[src*="flag"],
html[data-theme="light"] .wc-flag,
html[data-theme="light"] .leaflet-marker-icon {
  filter: none !important;
}

.ambient-bg.breathing {
  animation: earthBreathe 6s ease-in-out infinite;
}

.ambient-bg.intense {
  animation: earthBreathe 3.5s ease-in-out infinite;
}

@keyframes earthBreathe {
  0%, 100% { opacity: 1; filter: brightness(1); }
  50% { opacity: 0.92; filter: brightness(1.06); }
}

/* Particles */
.particles {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.particle {
  position: absolute;
  width: 2px;
  height: 2px;
  background: rgba(61, 124, 255, 0.4);
  border-radius: 50%;
  box-shadow: 0 0 6px rgba(61, 124, 255, 0.3);
  animation: particleFloat 18s infinite ease-in-out;
}

.particle:nth-child(3n) { background: rgba(107, 92, 231, 0.35); box-shadow: 0 0 6px rgba(107, 92, 231, 0.25); }
.particle:nth-child(3n+1) { background: rgba(201, 169, 98, 0.25); box-shadow: 0 0 6px rgba(201, 169, 98, 0.2); }

@keyframes particleFloat {
  0%, 100% { transform: translateY(100vh) translateX(0); opacity: 0; }
  8% { opacity: 0.8; }
  92% { opacity: 0.6; }
  100% { transform: translateY(-10vh) translateX(30px); opacity: 0; }
}

/* Layout */
.page {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  padding: 32px 24px calc(var(--nav-height) + 32px);
  max-width: 720px;
  margin: 0 auto;
  width: 100%;
  overflow-x: clip;
}

.page-wide {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

/* Typography */
.brand {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}

.hero-title {
  font-size: clamp(2rem, 6vw, 2.75rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  margin-bottom: 8px;
}

.hero-subtitle {
  font-size: 1rem;
  font-weight: 400;
  color: var(--text-secondary);
  margin-bottom: 40px;
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.state-title {
  font-size: clamp(1.5rem, 4vw, 2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.state-copy {
  font-size: 1rem;
  color: var(--text-secondary);
  max-width: 400px;
  margin: 0 auto 32px;
  line-height: 1.6;
}

.tagline {
  font-size: 0.8rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Countdown */
.countdown-block {
  margin: 32px 0 40px;
}

.countdown-label {
  font-size: 0.8rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.countdown-timer {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.countdown-unit {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 16px 14px;
  min-width: 72px;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: var(--shadow-card), var(--inset-highlight);
}

.countdown-unit.final-hour {
  border-color: var(--border-glow);
  box-shadow: 0 8px 40px var(--glow-blue), var(--inset-highlight);
}

.countdown-value {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
  line-height: 1;
}

.countdown-name {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-top: 8px;
}

.countdown-compact {
  font-size: clamp(2rem, 8vw, 3.5rem);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Glass cards */
.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 24px;
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: var(--shadow-card);
  margin-bottom: 16px;
  text-align: left;
}

.glass-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}

.glass-card-row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.glass-card-row:first-child {
  padding-top: 0;
}

.stat-label {
  font-size: 0.85rem;
  color: var(--text-muted);
}

.stat-value {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
}

.stat-value.highlight {
  color: var(--accent-aurora);
}

/* Stats grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 32px 0;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px 12px;
  text-align: center;
  backdrop-filter: blur(16px);
}

.stat-card .number {
  font-size: 1.35rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
  margin-bottom: 4px;
}

.stat-card .label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-sans);
  font-size: 1rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  padding: 16px 32px;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  width: 100%;
  max-width: 360px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--accent-blue) 0%, var(--accent-violet) 100%);
  color: #fff;
  box-shadow: 0 8px 32px var(--glow-blue);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--glow-blue);
}

.btn-primary:disabled,
.btn-primary.pledged {
  background: rgba(78, 197, 232, 0.15);
  color: var(--accent-aurora);
  border: 1px solid rgba(78, 197, 232, 0.3);
  box-shadow: none;
  cursor: default;
}

.btn-secondary {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-subtle);
}

.btn-secondary:hover {
  border-color: var(--border-glow);
  color: var(--text-primary);
}

.actions-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}

.actions-inline {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
  margin-top: 16px;
}

.actions-inline .btn {
  width: auto;
  padding: 12px 20px;
  font-size: 0.85rem;
  max-width: none;
}

/* Keep-alive soft tab host — primary tabs stay mounted; switches only reveal. */
html.wc-tab-shell,
body.wc-tab-shell {
  height: 100%;
}

body.wc-tab-shell {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  min-height: 100dvh;
}

#wc-tab-host.wc-tab-host {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  max-width: 100%;
  overflow-x: clip;
}

.wc-tab-panel {
  display: none;
  width: 100%;
  min-height: 100%;
}

/* Laid out under the active tab — Map/Leaflet can measure before we reveal. */
.wc-tab-panel.is-preparing {
  display: block;
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  z-index: 0;
}

.wc-tab-panel.is-active {
  display: block;
  position: relative;
  z-index: 1;
  opacity: 1;
  pointer-events: auto;
}

body.wc-tab-shell.map-page #wc-tab-host.wc-tab-host,
body.wc-tab-shell.map-page .wc-tab-panel.is-active,
body.wc-tab-shell.map-page .wc-tab-panel.is-preparing {
  height: 100%;
  min-height: 100%;
}

/*
 * Bottom tab bar — ALWAYS glued to the visible screen bottom.
 * CSS position:fixed + bottom:0 is the source of truth during page scroll.
 * WorldChoirNav.pinNavToVisualViewport() must NOT chase visualViewport while
 * scrolling (that slides the bar with the iOS URL chrome). It only lifts
 * bottom for a real keyboard when a text field is focused.
 * Never switch #nav-root to absolute/sticky/relative.
 */
#nav-root {
  position: fixed !important;
  left: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  top: auto !important;
  width: 100% !important;
  max-width: 100% !important;
  z-index: 100;
  pointer-events: none;
  margin: 0 !important;
  padding: 0;
  transform: none !important;
  /* Stay out of body.wc-tab-shell flex sizing; fixed already leaves flow. */
  flex-shrink: 0;
}

#nav-root[hidden] {
  display: none !important;
}

/* Bottom navigation */
.bottom-nav {
  --nav-indicator-duration: 200ms;
  --nav-indicator-ease: cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  width: 100%;
  height: var(--nav-height);
  background: var(--nav-background);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-top: 1px solid var(--border-subtle);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 100;
  padding-bottom: env(safe-area-inset-bottom, 0);
  pointer-events: auto;
  box-sizing: border-box;
}

/* Single shared tab indicator — X is driven via translate3d in JS */
.bottom-nav__indicator {
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 2px;
  background: var(--accent-aurora);
  border-radius: 2px;
  box-shadow: 0 0 12px var(--glow-blue);
  transform: translate3d(0, 0, 0);
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  will-change: transform;
}

.bottom-nav__indicator.is-visible {
  opacity: 1;
}

.bottom-nav__indicator.is-animated {
  transition: transform var(--nav-indicator-duration) var(--nav-indicator-ease);
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  text-decoration: none;
  color: var(--text-muted);
  font-size: 0.65rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 8px 16px;
  min-width: 44px;
  min-height: 44px;
  transition: color var(--nav-indicator-duration) var(--nav-indicator-ease);
  position: relative;
  z-index: 2;
}

.nav-item:focus-visible {
  outline: none;
  color: var(--text-secondary);
  box-shadow: 0 0 0 2px rgba(61, 124, 255, 0.55);
  border-radius: 10px;
}

.nav-item.active {
  color: var(--accent-aurora);
}

@media (prefers-reduced-motion: reduce) {
  .bottom-nav {
    --nav-indicator-duration: 0ms;
  }

  .bottom-nav__indicator.is-animated {
    transition: none;
  }

  .nav-item {
    transition: none;
  }
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.25rem;
  height: 1.25rem;
  font-size: 1.25rem;
  line-height: 1;
}

.nav-icon__svg {
  display: block;
  width: 1.25rem;
  height: 1.25rem;
}

/* Modals / overlays */
.overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 2, 4, 0.85);
  backdrop-filter: blur(12px);
  z-index: 200;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.overlay.active {
  display: flex;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  max-width: 440px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
  animation: modalIn 0.4s ease;
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(20px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.modal-title {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.01em;
}

.modal-copy {
  font-size: 0.95rem;
  color: var(--text-secondary);
  margin-bottom: 28px;
  line-height: 1.6;
}

.form-group {
  margin-bottom: 20px;
  text-align: left;
}

.form-label {
  display: block;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  background: var(--surface-lift);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-sans);
  font-size: 1rem;
  transition: var(--transition);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--border-glow);
  box-shadow: 0 0 0 3px rgba(61, 124, 255, 0.12);
}

.form-input:focus-visible,
.form-textarea:focus-visible,
.form-select:focus-visible,
.btn:focus-visible,
.btn-icon:focus-visible,
.btn-hero:focus-visible,
.btn-glass:focus-visible,
button:focus-visible,
a:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px rgba(61, 124, 255, 0.55);
}

/* Skip link removed — was appearing during fast scroll on touch devices */

.form-textarea {
  min-height: 120px;
  resize: vertical;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%236b6f7d' viewBox='0 0 16 16'%3E%3Cpath d='M4 6l4 4 4-4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 36px;
}

.reason-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.reason-chip {
  background: var(--input-background);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 12px;
  font-size: 0.85rem;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.reason-chip:hover,
.reason-chip.selected {
  border-color: var(--accent-blue);
  color: var(--text-primary);
  background: var(--glow-blue);
}

/* Live state */
.live-glow {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: var(--bg-primary);
  animation: livePulse 4s ease-in-out infinite;
}

@keyframes livePulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.live-icon {
  font-size: 3rem;
  margin-bottom: 16px;
  opacity: 0.9;
}

/* Memory wall */
.memory-grid {
  display: grid;
  gap: 16px;
}

.memory-item {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 20px;
  text-align: left;
}

.memory-promise {
  font-size: 1.05rem;
  font-style: italic;
  color: var(--text-primary);
  margin-bottom: 12px;
  line-height: 1.5;
}

.memory-meta {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.section-header {
  text-align: center;
  margin-bottom: 32px;
}

.section-header h2 {
  font-size: 1.5rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.95rem;
}

/* Profile */
.profile-header {
  text-align: center;
  margin-bottom: 32px;
}

.avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-violet));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
  font-weight: 600;
  margin: 0 auto 16px;
  box-shadow: 0 8px 32px var(--glow-violet);
}

.history-item {
  margin-bottom: 20px;
}

.history-year {
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-gold);
  margin-bottom: 8px;
}

/* Map page */
.map-page-header {
  padding: 24px 24px 0;
  text-align: center;
  position: relative;
  z-index: 2;
}

.map-container {
  position: relative;
  width: 100%;
  height: calc(100vh - var(--nav-height) - 100px);
  min-height: 400px;
  margin-top: 16px;
}

#world-map {
  width: 100%;
  height: 100%;
  z-index: 1;
}

.leaflet-container {
  background: var(--bg-void) !important;
}

/* ── Shared skeleton loaders (app-wide, brief first paint) ── */

/*
 * Black-boot test mode (default):
 * html.wc-booting covers the page in black until WorldChoirBoot.ready().
 * Restore skeletons: set window.WC_SHOW_SKELETONS = true in the page <head>
 * (adds html.wc-boot-skeletons and disables the black overlay).
 */
html.wc-booting:not(.wc-boot-skeletons)::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  background: var(--wc-boot-bg, #000);
  pointer-events: none;
}

/* During tab handoff, keep the bottom nav visible so the indicator can finish with the open. */
html.wc-booting.wc-nav-handoff:not(.wc-boot-skeletons)::before {
  bottom: calc(var(--nav-height) + env(safe-area-inset-bottom, 0px));
}

html.wc-booting:not(.wc-boot-skeletons),
html.wc-booting:not(.wc-boot-skeletons) body {
  background: var(--wc-boot-bg, #000) !important;
}

.wc-skel {
  display: block;
  border-radius: 8px;
  background: linear-gradient(
    90deg,
    var(--surface-lift) 0%,
    var(--surface-lift) 50%,
    var(--surface-lift) 100%
  );
  background-size: 200% 100%;
  animation: wcSkelShimmer 0.9s ease-in-out infinite;
}

html[data-theme="light"] .wc-skel {
  background: linear-gradient(
    90deg,
    rgba(0, 0, 0, 0.04) 0%,
    rgba(0, 0, 0, 0.09) 50%,
    rgba(0, 0, 0, 0.04) 100%
  );
  background-size: 200% 100%;
}

@keyframes wcSkelShimmer {
  0% { background-position: 100% 0; }
  100% { background-position: -100% 0; }
}

.wc-skel--voices {
  width: 7.5rem;
  height: 0.55rem;
  margin: 0 auto 14px;
  border-radius: 999px;
}

.wc-skel--line {
  height: 0.72rem;
  width: 100%;
  margin: 0 0 10px;
}

.wc-skel--line-short { width: 62%; }
.wc-skel--line-mid { width: 78%; }
.wc-skel--title {
  height: 1.25rem;
  width: min(16rem, 72%);
  margin: 0 auto 16px;
}

.wc-skel-card {
  padding: 18px 16px;
  margin-bottom: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  background: var(--surface-lift-soft);
}

.wc-skel-card--row {
  display: flex;
  gap: 14px;
  align-items: center;
}

.wc-skel--avatar {
  flex: 0 0 48px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
}

.wc-skel--media {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  margin-bottom: 14px;
}

.wc-skel-page {
  width: 100%;
  padding: 8px 0 24px;
}

.wc-skel-page[aria-busy="true"] {
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .wc-skel,
  .home-skel {
    animation: none !important;
  }
}

/* Utility */
.text-center { text-align: center; }
.hidden { display: none !important; }
.fade-in {
  animation: fadeIn 0.6s ease;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .ambient-bg.breathing,
  .ambient-bg.intense,
  .fade-in {
    animation: none !important;
  }
}

@media (max-width: 480px) {
  .countdown-unit {
    min-width: 64px;
    padding: 12px 10px;
  }
  .stats-grid {
    grid-template-columns: 1fr;
  }
}
