/* =============================================
   YARRAN DHERAN — NATURE RESERVE APP
   Mobile-first iOS prototype
   Palette: Forest green, warm olive, earthy amber
============================================= */

/* ---- Design Tokens ---- */
:root, [data-theme="light"] {
  /* Type scale */
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.95rem + 0.25vw, 1.125rem);
  --text-lg:   clamp(1.125rem, 1rem    + 0.75vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1.2rem  + 1.25vw, 2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);

  /* Spacing */
  --space-1: 0.25rem; --space-2: 0.5rem; --space-3: 0.75rem;
  --space-4: 1rem; --space-5: 1.25rem; --space-6: 1.5rem;
  --space-8: 2rem; --space-10: 2.5rem; --space-12: 3rem;
  --space-16: 4rem;

  /* Nature-derived palette */
  /* Surfaces: warm cream matched to yarrandheran.org site palette */
  --color-bg:              #F6EDE4;
  --color-surface:         #FAF7F2;
  --color-surface-2:       #FFFFFF;
  --color-surface-offset:  #EDE3D7;
  --color-divider:         #D9CFC3;
  --color-border:          #CCC1B4;

  /* Text: dark olive matched to yarrandheran.org site palette */
  --color-text:            #3D4435;
  --color-text-muted:      #6B6D62;
  --color-text-faint:      #AAA99F;
  --color-text-inverse:    #F6EDE4;

  /* Primary: deep forest green */
  --color-primary:         #2D6A4F;
  --color-primary-hover:   #1E4E39;
  --color-primary-active:  #123326;
  --color-primary-deep:    #1B4332;
  --color-primary-light:   #D8EDDF;

  /* Accent greens for semantic use */
  --color-green:           #2D6A4F;
  --color-green-bg:        #D8EDDF;
  --color-teal:            #197B8D;
  --color-teal-bg:         #C7E8EF;
  --color-amber:           #B5621A;
  --color-amber-bg:        #F5DFC4;
  --color-olive:           #6B7A2E;
  --color-olive-bg:        #E4ECC4;

  /* Radius */
  --radius-sm: 0.375rem;
  --radius-md: 0.625rem;
  --radius-lg: 1rem;
  --radius-xl: 1.25rem;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(20, 28, 15, 0.07);
  --shadow-md: 0 4px 14px rgba(20, 28, 15, 0.09);
  --shadow-lg: 0 12px 32px rgba(20, 28, 15, 0.12);

  /* Fonts */
  --font-display: 'Poppins', 'Georgia', sans-serif;
  --font-body:    'Manrope', 'system-ui', sans-serif;

  /* Transitions */
  --trans: 200ms cubic-bezier(0.16, 1, 0.3, 1);

  /* Safe-area bottom padding (tab bar height + inset + breathing room) */
  --bottom-safe: calc(56px + env(safe-area-inset-bottom) + 16px);
}

[data-theme="dark"] {
  --color-bg:              #151813;
  --color-surface:         #1A1E16;
  --color-surface-2:       #1F2319;
  --color-surface-offset:  #232719;
  --color-divider:         #2D3124;
  --color-border:          #3A3F2C;
  --color-text:            #D4D8CA;
  --color-text-muted:      #7D8273;
  --color-text-faint:      #545A47;
  --color-text-inverse:    #1A1E16;
  --color-primary:         #52B788;
  --color-primary-hover:   #40A376;
  --color-primary-active:  #2E8A5F;
  --color-primary-deep:    #0D2318;
  --color-primary-light:   #1E3D2A;
  --color-green:           #52B788;
  --color-green-bg:        #1C3024;
  --color-teal:            #4AAFC0;
  --color-teal-bg:         #19303A;
  --color-amber:           #D4874A;
  --color-amber-bg:        #3A2415;
  --color-olive:           #A0B053;
  --color-olive-bg:        #2A3016;
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.25);
  --shadow-md: 0 4px 14px rgba(0,0,0,0.32);
  --shadow-lg: 0 12px 32px rgba(0,0,0,0.45);
}

/* ---- Base ---- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-text-size-adjust: none;
  text-size-adjust: none;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
  height: 100%;
  height: 100dvh;
}
body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-bg);
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  position: relative;
}
button { cursor: pointer; background: none; border: none; font: inherit; color: inherit; }
a { color: var(--color-primary); }
img { display: block; max-width: 100%; }

/* ---- Focus management ---- */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}
button:focus-visible, a:focus-visible { border-radius: var(--radius-sm); }

/* ==============================
   SPLASH
================================ */
.splash {
  position: fixed; inset: 0;
  background: var(--color-primary);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  z-index: 10000;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}
.splash.fade-out { opacity: 0; visibility: hidden; pointer-events: none; }
.splash.gone { display: none; }

.splash-inner {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-3);
}
.splash-logo {
  margin-bottom: var(--space-4);
  animation: splashPulse 2s ease infinite;
}
@keyframes splashPulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.05); opacity: 0.9; }
}
.splash-logo svg path, .splash-logo svg circle, .splash-logo svg line {
  stroke: rgba(255,255,255,0.9);
}
.splash-logo svg path[fill] { fill: rgba(255,255,255,0.15); }
.splash-logo svg path[stroke="var(--color-primary)"] { stroke: rgba(255,255,255,0.85); }

.splash-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.02em;
}
.splash-subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.75);
  font-weight: 400;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.splash-tagline {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.55);
  margin-top: var(--space-2);
}
.splash-loader {
  width: 140px; height: 2px;
  background: rgba(255,255,255,0.2);
  border-radius: var(--radius-full);
  margin-top: var(--space-8);
  overflow: hidden;
}
.loader-bar {
  height: 100%;
  background: rgba(255,255,255,0.8);
  border-radius: var(--radius-full);
  width: 0%;
  animation: loadBar 2s ease forwards;
}
@keyframes loadBar {
  0% { width: 0%; }
  60% { width: 75%; }
  100% { width: 100%; }
}
.splash-footer {
  position: absolute; bottom: var(--space-8);
  color: rgba(255,255,255,0.45);
  font-size: var(--text-xs);
  letter-spacing: 0.03em;
}

/* ==============================
   APP SHELL
================================ */
.app {
  position: fixed; inset: 0;
  display: flex; flex-direction: column;
  background: var(--color-bg);
  overflow: hidden;
}
.app.hidden { display: none; }

/* ---- Download toast ---- */
.download-toast {
  position: fixed;
  bottom: calc(var(--nav-height, 64px) + 16px);
  left: 50%;
  transform: translateX(-50%) translateY(12px);
  padding: 10px 18px;
  border-radius: 22px;
  font-size: 14px;
  font-family: var(--font-body);
  font-weight: 500;
  white-space: nowrap;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 9999;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
}
.download-toast.toast-show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.download-toast.toast-success {
  background: var(--color-primary);
  color: #fff;
}
.download-toast.toast-info {
  background: #444;
  color: #fff;
}

/* ---- Offline / Save-for-offline button ---- */
@keyframes spin {
  to { transform: rotate(360deg); }
}
.spin {
  animation: spin 0.9s linear infinite;
  display: inline-block;
  flex-shrink: 0;
}
.offline-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}
.offline-btn:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
}
.offline-btn.offline-btn-saving {
  opacity: 0.7;
  cursor: default;
  pointer-events: none;
}
.offline-btn.offline-btn-cached {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
}
.offline-btn-icon {
  flex-shrink: 0;
}

/* Offline badge on walk list cards */
.badge-offline {
  background: color-mix(in srgb, var(--color-primary) 15%, transparent);
  color: var(--color-primary);
  border: 1px solid var(--color-primary);
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: var(--radius-full);
}

/* ---- Screens ---- */
.screen {
  display: none;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  min-height: 0;
  max-height: 100%;
  animation: screenIn 0.28s cubic-bezier(0.16, 1, 0.3, 1) both;
}
.screen.active { display: flex; }
.app > .screen.active { flex: 1; min-height: 0; max-height: none; }

@keyframes screenIn {
  from { opacity: 0; transform: translateX(18px); }
  to   { opacity: 1; transform: translateX(0); }
}

.screen-scroll {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--bottom-safe);
  overscroll-behavior: contain;
}
.screen-scroll::-webkit-scrollbar { display: none; }

/* ---- Screen headers ---- */
.screen-header {
  flex-shrink: 0;
  z-index: 5;
}
.compact-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-divider);
  display: flex; align-items: center;
  padding: var(--space-3) var(--space-4);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
  gap: var(--space-3);
  min-height: 52px;
}
.compact-title {
  flex: 1;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  text-align: center;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-primary);
  transition: background var(--trans);
  flex-shrink: 0;
}
.back-btn:hover { background: var(--color-primary-light); }
.back-btn:active { background: var(--color-primary-light); transform: scale(0.93); }

.icon-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  color: var(--color-text-muted);
  transition: background var(--trans), color var(--trans);
  flex-shrink: 0;
}
.icon-btn:hover { background: var(--color-surface-offset); color: var(--color-text); }

/* ---- HOME screen ---- */
.home-header {
  position: relative;
  flex-shrink: 0;
}
.home-header-bg {
  position: absolute; inset: 0;
  background: linear-gradient(160deg, var(--color-primary) 0%, #1A4A33 100%);
}
.home-header-content {
  position: relative; z-index: 2;
  display: flex; align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5) var(--space-5);
}
.app-logo-small { flex-shrink: 0; }
.home-header-text { flex: 1; }
.home-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
}
.home-subtitle {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.65);
  margin-top: 2px;
}

/* ---- Sections ---- */
.section {
  padding: var(--space-5) var(--space-5) 0;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
}
.section-intro {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-3);
  margin-top: 0;
}
.section-label {
  font-size: var(--text-xs);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-3);
}

/* ---- Today banner ---- */
.today-banner {
  padding: var(--space-3) var(--space-5);
  background: var(--color-primary-light);
}
.today-banner-inner {
  display: flex; align-items: center; gap: var(--space-3);
  color: var(--color-primary);
}
.today-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  display: block;
}
.today-value {
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
}
.today-weather-wrap {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.today-weather {
  font-size: var(--text-sm);
  font-weight: 500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 1px;
}
.today-weather-desc {
  font-size: var(--text-xs);
  font-weight: 400;
  opacity: 0.7;
}
.today-weather-location {
  font-size: 10px;
  font-weight: 500;
  opacity: 0.5;
  letter-spacing: 0.02em;
}

/* ---- Quick grid ---- */
.quick-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}
.quick-card {
  display: flex; flex-direction: column; align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  transition: all var(--trans);
  box-shadow: var(--shadow-sm);
}
.quick-card:hover, .quick-card:active { 
  transform: translateY(-1px); 
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.quick-icon {
  width: 48px; height: 48px;
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
}
.quick-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-align: center;
}

/* ---- Walk featured cards ---- */
.walks-featured {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.walk-featured-card {
  display: flex;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans);
  width: 100%;
  text-align: left;
}
.walk-featured-card:hover, .walk-featured-card:active {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.walk-featured-img {
  width: 88px;
  min-height: 110px;
  flex-shrink: 0;
  position: relative;
  display: flex; align-items: flex-start;
  padding: var(--space-3);
}
.walk-img-wetlands {
  background: url('img/walk-wetlands.jpg') center center / cover no-repeat;
  position: relative;
}
.walk-img-spring {
  background: url('img/walk-spring.jpg') center center / cover no-repeat;
}
.walk-img-creek {
  background: url('img/walk-creek.jpg') center center / cover no-repeat;
}
.walk-img-schwerkolt {
  background: url('img/walk-schwerkolt.jpg') center center / cover no-repeat;
}
.walk-img-cascade {
  background: url('img/walk-cascade.jpg') center center / cover no-repeat;
}

.walk-color-dot {
  width: 14px; height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.6);
  box-shadow: 0 0 0 1px rgba(0,0,0,0.1);
}
.walk-featured-body {
  flex: 1;
  padding: var(--space-3) var(--space-4) var(--space-3) var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-1);
}
.walk-featured-meta {
  display: flex; align-items: center; gap: var(--space-2);
}
.walk-featured-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.walk-featured-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.walk-parts {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}

/* ---- Badges ---- */
.walk-difficulty, .badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
}
.moderate, .badge-moderate {
  background: #FFF0E0;
  color: #B5621A;
}
.easy, .badge-easy {
  background: #D8EDDF;
  color: #2D6A4F;
}
.badge-time {
  background: var(--color-surface-offset, #EDE3D7);
  color: var(--color-text-muted);
}
.badge-soon {
  background: var(--color-surface-offset, #EDE3D7);
  color: var(--color-text-faint);
}
.badge-live {
  background: var(--color-teal);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.walk-featured-live-badge {
  position: absolute;
  bottom: var(--space-2);
  left: var(--space-2);
  background: var(--color-teal);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
[data-theme="dark"] .moderate, [data-theme="dark"] .badge-moderate {
  background: #3A2415; color: #D4874A;
}
[data-theme="dark"] .easy, [data-theme="dark"] .badge-easy {
  background: #1C3024; color: #52B788;
}
[data-theme="dark"] .badge-time { background: var(--color-surface-offset); }
.walk-duration {
  font-size: 11px;
  color: var(--color-text-muted);
  font-weight: 500;
}

/* ---- Wildlife banner ---- */
.wildlife-banner {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--color-teal-bg);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  border: 1px solid color-mix(in srgb, var(--color-teal) 20%, transparent);
}
.wildlife-banner-icon { font-size: 2rem; flex-shrink: 0; }
.wildlife-banner-text { flex: 1; }
.wildlife-banner-text strong {
  font-size: var(--text-sm);
  color: var(--color-teal);
  display: block; margin-bottom: 2px;
}
.wildlife-banner-text p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.wildlife-banner-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-teal);
  background: color-mix(in srgb, var(--color-teal) 12%, transparent);
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  flex-shrink: 0;
  transition: background var(--trans);
}
.wildlife-banner-btn:hover { background: color-mix(in srgb, var(--color-teal) 22%, transparent); }

/* ---- Reserve stats ---- */
.info-pills {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: var(--space-2);
}
@media (max-width: 360px) {
  .info-pills { grid-template-columns: repeat(2, 1fr); }
}
.info-pill {
  padding: var(--space-3) var(--space-2);
  text-align: center;
  border-top: 2px solid var(--color-primary-light);
}
.info-pill-num {
  display: block;
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}
.info-pill-label {
  display: block;
  font-size: 10px;
  color: var(--color-text-muted);
  font-weight: 500;
  margin-top: 2px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Acknowledgement ---- */
.acknowledgement {
  background: var(--color-olive-bg);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  border-left: 3px solid var(--color-olive);
}
.acknowledgement p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.6;
}
.acknowledgement strong { color: var(--color-olive); }

/* ==============================
   MAP SCREEN
================================ */
.map-container {
  flex: 1;
  min-height: 0;
  background: var(--color-surface-offset);
  z-index: 1;
}
#screen-map {
  position: relative;
}
.map-legend {
  position: absolute;
  bottom: 80px;
  left: var(--space-4);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  padding: var(--space-3) var(--space-4);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  z-index: 10;
  min-width: 210px;
}
.legend-title {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.legend-items { display: flex; flex-direction: column; gap: var(--space-1); }
.legend-item {
  display: flex; align-items: center; gap: var(--space-2);
  padding: var(--space-1) 0;
  width: 100%;
  text-align: left;
  transition: opacity var(--trans);
}
.legend-item:not(.active) { opacity: 0.4; }
.legend-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-name {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--color-text);
  font-weight: 500;
}
.legend-time {
  font-size: 11px;
  color: var(--color-text-faint);
}
.map-cta {
  position: absolute;
  bottom: var(--space-4);
  right: var(--space-4);
  z-index: 10;
}

/* On the map screen, shift the FAB to the left so it
   doesn't collide with the "Start a Guided Walk" button on the right */

.map-cta-btn {
  display: flex; align-items: center; gap: var(--space-2);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-5);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  transition: all var(--trans);
}
.map-cta-btn:hover { background: var(--color-primary-hover); transform: translateY(-1px); }
.map-cta-btn:active { background: var(--color-primary-active); transform: scale(0.97); }

/* ==============================
   MERGED WALKS SCREEN
================================ */
#screen-map {
  flex-direction: column;
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.map-container-full {
  width: 100%;
  flex: 1;
  min-height: 0;
  background: var(--color-surface-offset);
  z-index: 1;
  overflow: hidden;
  position: relative;
}

.walks-list-panel {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-bg);
  border-top: 1px solid var(--color-border);
  padding: 0 var(--space-4);
  padding-bottom: var(--bottom-safe);
}

.walks-list-header {
  padding: var(--space-4) 0 var(--space-2);
}
.walks-list-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 2px;
}
.walks-list-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin: 0;
}
.walks-colour-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.walks-legend-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.walks-legend-dot--wetlands   { background: #a0a0a0; }
.walks-legend-dot--cascade    { background: #27AE60; }
.walks-legend-dot--creek      { background: #2980B9; }
.walks-legend-dot--spring     { background: #9B59B6; }
.walks-legend-dot--schwerkolt { background: #E74C3C; }


/* Pulsing location dot */
.loc-dot {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.loc-dot-inner {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-teal);
  border: 2.5px solid white;
  box-shadow: 0 0 0 0 rgba(41,128,185,0.5);
  animation: loc-pulse 2s ease-out infinite;
}
@keyframes loc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(41,128,185,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(41,128,185,0); }
  100% { box-shadow: 0 0 0 0 rgba(41,128,185,0); }
}

/* ==============================
   WALKS LIST SCREEN
================================ */
.walks-hero {
  background: linear-gradient(160deg, var(--color-primary) 0%, #1A4A33 100%);
  padding: var(--space-8) var(--space-6);
  text-align: center;
}
.walks-hero-icon { font-size: 2.5rem; margin-bottom: var(--space-3); }
.walks-hero-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: var(--space-3);
}
.walks-hero-desc {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  line-height: 1.6;
  max-width: 320px;
  margin: 0 auto;
}

.walks-info-strip {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3) var(--space-3) var(--space-4);
  background: var(--color-primary-light);
  border: 1px solid var(--color-primary);
  border-radius: 12px;
  margin-bottom: var(--space-4);
  color: var(--color-primary);
}
.walks-info-strip > svg { flex-shrink: 0; margin-top: 2px; }
.walks-info-strip-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.walks-info-strip-heading {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
}
.walks-info-strip-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.4;
}
.walks-info-strip-dismiss {
  flex-shrink: 0;
  background: none;
  border: none;
  padding: 2px;
  cursor: pointer;
  color: var(--color-text-muted);
  line-height: 0;
  margin-top: 1px;
}

.walk-list { display: flex; flex-direction: column; gap: var(--space-3); }

.walk-card {
  display: flex; align-items: stretch;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all var(--trans);
  width: 100%;
  text-align: left;
}
.walk-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
  transform: translateY(-1px);
}
.walk-card:active {
  box-shadow: var(--shadow-sm);
  border-color: var(--color-primary);
  transform: scale(0.98);
}
.walk-card-coming-soon { opacity: 0.55; cursor: not-allowed; }
.walk-card-coming-soon:hover { transform: none; box-shadow: var(--shadow-sm); border-color: var(--color-border); }

.walk-card-color {
  width: 6px;
  flex-shrink: 0;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}
.walk-card-color--wetlands    { background: linear-gradient(135deg, #d0cec9, #a0a0a0); }
.walk-card-color--cascade     { background: linear-gradient(135deg, #27AE60, #1A7A40); }
.walk-card-color--creek       { background: linear-gradient(135deg, #2980B9, #1A5276); }
.walk-card-color--spring      { background: linear-gradient(135deg, #9B59B6, #6C3483); }
.walk-card-color--schwerkolt  { background: linear-gradient(135deg, #E74C3C, #922B21); }
.walk-card-body {
  flex: 1;
  padding: var(--space-3);
  display: flex; flex-direction: column; gap: var(--space-2);
  min-width: 0;
}
.walk-card-header {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.walk-card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.01em;
  line-height: 1.25;
}
.walk-card-badges { display: flex; gap: var(--space-1); flex-wrap: wrap; }
.walk-card-desc {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}
.walk-card-footer {
  display: flex; align-items: center; gap: var(--space-3);
  margin-top: var(--space-1);
}
.walk-parts-tag {
  font-size: 11px;
  background: var(--color-surface-offset, #EDE3D7);
  color: var(--color-text-muted);
  padding: 2px 8px;
  border-radius: var(--radius-full);
  font-weight: 500;
}
.walk-trail-tag {
  font-size: 11px;
  font-weight: 600;
}
.walk-card-arrow {
  display: flex; align-items: center;
  padding: 0 var(--space-4) 0 0;
  color: var(--color-text-faint);
}

/* ==============================
   WALK PLAYER SCREEN
================================ */
.player-map-container {
  height: 320px;
  flex-shrink: 0;
  background: var(--color-surface-offset);
  position: relative;
  z-index: 1;
}

.player-panel {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding-bottom: var(--bottom-safe);
}

.player-stop-indicator {
  display: flex; align-items: baseline; gap: var(--space-2);
  padding: var(--space-4) var(--space-5) 0;
}
.player-stop-label {
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-muted);
}
.player-stop-num {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
}
.player-stop-total {
  font-size: var(--text-sm);
  color: var(--color-text-faint);
}

.player-audio-section {
  padding: 0 var(--space-5) var(--space-4);
}
.player-audio-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin-bottom: var(--space-1);
  margin-top: var(--space-3);
}
.player-audio-subtitle {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

/* Waveform */

/* Scrubber */
.player-scrubber {
  min-height: 44px;
  cursor: pointer;
  display: flex; align-items: center; gap: var(--space-3);
  margin-bottom: var(--space-4);
}
.scrubber-time {
  font-size: 11px;
  color: var(--color-text-faint);
  font-weight: 500;
  min-width: 32px;
  font-variant-numeric: tabular-nums;
}
.scrubber-time:last-child { text-align: right; }
.scrubber-track {
  flex: 1; height: 3px;
  background: var(--color-border);
  border-radius: var(--radius-full);
  position: relative; cursor: pointer;
}
.scrubber-fill {
  position: absolute; left: 0; top: 0; bottom: 0;
  background: var(--color-primary);
  border-radius: var(--radius-full);
  transition: width 0.3s linear;
  width: 0%;
}
.scrubber-thumb {
  position: absolute; top: 50%;
  width: 14px; height: 14px;
  background: var(--color-primary);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 0 3px rgba(45,106,79,0.15);
  left: 0%;
  transition: left 0.3s linear;
}
[data-theme="dark"] .scrubber-thumb { box-shadow: 0 0 0 3px rgba(82,183,136,0.2); }

/* Controls */
.player-controls {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-5);
  margin-bottom: var(--space-4);
}
.ctrl-btn {
  display: flex; align-items: center; justify-content: center;
  color: var(--color-text-muted);
  border-radius: 50%;
  transition: all var(--trans);
  padding: var(--space-2);
}
.ctrl-btn:hover { color: var(--color-text); background: var(--color-surface-offset); }
.ctrl-btn:active { transform: scale(0.9); opacity: 0.8; }
.ctrl-play {
  width: 64px; height: 64px;
  background: var(--color-primary);
  color: #fff !important;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(45,106,79,0.35);
}

.ctrl-play:hover { background: var(--color-primary-hover); transform: scale(1.05); }
.ctrl-play:active { background: var(--color-primary-active); transform: scale(0.95); }
.ctrl-play:disabled,
.ctrl-play.loading {
  opacity: 0.7;
  pointer-events: none;
  cursor: default;
}
/* Spinning ring shown while audio is buffering */
.ctrl-play.loading #play-icon {
  display: none;
}
.ctrl-play.loading::after {
  content: '';
  width: 22px; height: 22px;
  border: 3px solid rgba(255,255,255,0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  display: block;
}
.ctrl-skip {
  font-size: var(--text-xs);
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
}

/* Stops list */
.player-stops-list {
  padding: 0 var(--space-5) var(--space-4);
  display: flex; flex-direction: column; gap: var(--space-2);
}
.stop-item {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-lg);
  background: var(--color-bg);
  border: 1px solid var(--color-divider);
  cursor: pointer;
  transition: all var(--trans);
}
.stop-item:hover { border-color: var(--color-primary); background: var(--color-primary-light); }
.stop-item.current {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
.stop-num {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-border);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.stop-item.current .stop-num {
  background: var(--color-primary);
  color: #fff;
}
.stop-item.played {
  opacity: 0.6;
}
.stop-item.played .stop-num {
  background: var(--color-primary);
  color: #fff;
}
.stop-item.played .stop-title {
  text-decoration: line-through;
  text-decoration-color: var(--color-text-muted);
}
.stop-body { flex: 1; }
.stop-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.3;
}
.stop-duration {
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: 1px;
}
.stop-play-icon {
  color: var(--color-text-faint);
  flex-shrink: 0;
}
.stop-item.current .stop-play-icon { color: var(--color-primary); }

/* ==============================
   DISCOVER SCREEN
================================ */
.discover-filter-row {
  display: flex; align-items: center;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-5) 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.discover-filter-row::-webkit-scrollbar { display: none; }
.filter-chip {
  flex-shrink: 0;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: 600;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-text-muted);
  transition: all var(--trans);
}
.filter-chip.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.filter-chip:hover:not(.active) {
  border-color: var(--color-primary);
  color: var(--color-primary);
}

.wildlife-search-wrap {
  position: relative;
  margin: var(--space-3) var(--space-4) 0;
}
.wildlife-search-icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--color-text-faint);
  pointer-events: none;
}
.wildlife-search {
  width: 100%;
  padding: 10px 12px 10px 36px;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  background: var(--color-surface);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  outline: none;
  -webkit-appearance: none;
  box-sizing: border-box;
  transition: border-color var(--trans);
}
.wildlife-search:focus {
  border-color: var(--color-primary);
}
.wildlife-search::placeholder { color: var(--color-text-faint); }
.wildlife-search::-webkit-search-cancel-button { -webkit-appearance: none; }
.wildlife-no-results {
  padding: var(--space-6) var(--space-4);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
}
.wildlife-search-hint {
  padding: var(--space-8) var(--space-4) var(--space-6);
  text-align: center;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  line-height: 1.5;
}

.wildlife-grid {
  display: flex; flex-direction: column; gap: var(--space-2);
}
.wildlife-card {
  display: flex; align-items: center; gap: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  transition: transform 0.15s ease;
}
.wildlife-card.hidden { display: none; }
.wildlife-featured {
  background: color-mix(in srgb, var(--color-primary-light) 60%, var(--color-surface));
  border-color: color-mix(in srgb, var(--color-primary) 20%, transparent);
}
.wildlife-card-thumb {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  overflow: hidden;
}
.wildlife-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: var(--radius-md);
}
.wildlife-card-body { flex: 1; min-width: 0; }

.wildlife-card-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.wildlife-alpha-header {
  grid-column: 1 / -1;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--color-primary);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: var(--space-3) 0 var(--space-1);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-1);
}
.wildlife-card-last-seen {
  font-size: 10px;
  color: var(--color-primary);
  opacity: 0.8;
  margin-top: 2px;
}
.wildlife-card-detail {
  font-size: 11px;
  color: var(--color-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==============================
   INFO SCREEN
================================ */
.info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.info-row {
  display: flex; gap: var(--space-4);
  padding: var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.info-row:last-child { border-bottom: none; }
.info-row svg { flex-shrink: 0; margin-top: 2px; }
.info-row strong {
  display: block; font-size: var(--text-sm);
  font-weight: 600; color: var(--color-text);
  margin-bottom: var(--space-1);
}
.info-row p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.5;
}

.trail-table {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.trail-row {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-bottom: 1px solid var(--color-divider);
}
.trail-row:last-child { border-bottom: none; }
.trail-dot {
  width: 10px; height: 10px; border-radius: 50%; flex-shrink: 0;
}
/* Trail-specific colours — used on dot chips and legend items */
.trail-dot--wetlands, .trail-chip-dot--wetlands {
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
}
.trail-dot--cascade, .trail-chip-dot--cascade   { background: #27AE60; }
.trail-dot--creek, .trail-chip-dot--creek       { background: #2980B9; }
.trail-dot--spring, .trail-chip-dot--spring     { background: #9B59B6; }
.trail-dot--schwerkolt, .trail-chip-dot--schwerkolt { background: #E74C3C; }
.trail-name-col { flex: 1; font-size: var(--text-sm); color: var(--color-text); font-weight: 500; }
.trail-diff { font-size: 11px; font-weight: 600; }
.easy-text { color: var(--color-green); }
.mod-text { color: var(--color-amber); }
.trail-dist { font-size: var(--text-xs); color: var(--color-text-muted); min-width: 44px; text-align: right; }

.tips-list { display: flex; flex-direction: column; gap: var(--space-3); }
.tip-item {
  display: flex; align-items: flex-start; gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.tip-icon { font-size: 1.25rem; flex-shrink: 0; }
.tip-item p {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  line-height: 1.55;
  padding-top: 2px;
}

.info-links { display: flex; flex-direction: column; gap: var(--space-3); }
.info-link-btn {
  display: flex; align-items: center; gap: var(--space-3);
  justify-content: center;
  background: var(--color-primary);
  color: #fff;
  text-decoration: none;
  padding: var(--space-4);
  border-radius: var(--radius-xl);
  font-size: var(--text-sm);
  font-weight: 600;
  transition: background var(--trans);
}
.info-link-btn:hover { background: var(--color-primary-hover); }
.info-link-btn:active { background: var(--color-primary-active); transform: scale(0.98); }

/* ==============================
   TAB BAR
================================ */
.tab-bar {
  display: flex;
  background: var(--color-surface);
  border-top: 1px solid var(--color-divider);
  padding: var(--space-2) 0;
  padding-bottom: max(var(--space-2), env(safe-area-inset-bottom));
  flex-shrink: 0;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 200;
  height: calc(56px + env(safe-area-inset-bottom));
}
.tab-item {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  gap: 3px;
  padding: var(--space-1) 0;
  color: var(--color-text-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.03em;
  transition: color var(--trans);
}
.tab-item.active { color: var(--color-primary); }
.tab-item:hover { color: var(--color-text-muted); }
.tab-item:active { transform: scale(0.9); }
.tab-item svg { transition: transform var(--trans); }
.tab-item.active svg { transform: scale(1.05); }

/* Active dot indicator above icon */
.tab-item {
  position: relative;
}
.tab-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 3px;
  border-radius: 0 0 3px 3px;
  background: var(--color-primary);
}

/* ==============================
   FOOTER
================================ */
.footer-section {
  padding-top: var(--space-6) !important;
  padding-bottom: var(--space-6);
  display: flex; flex-direction: column;
  align-items: center; gap: var(--space-2);
}
.footer-credit {
  font-size: 11px;
  color: var(--color-text-faint);
  text-decoration: none;
  transition: color var(--trans);
}
.footer-credit:hover { color: var(--color-primary); }
.footer-link {
  font-size: 11px;
  color: var(--color-text-faint);
  text-decoration: none;
}
.footer-link:hover { color: var(--color-primary); }

/* ==============================
   Leaflet overrides
================================ */
.leaflet-container {
  font-family: var(--font-body) !important;
  background: var(--color-surface-offset) !important;
}
.leaflet-control-zoom a {
  background: var(--color-surface) !important;
  color: var(--color-text) !important;
  border-color: var(--color-border) !important;
}

/* ==============================
   Utility
================================ */
.hidden { display: none !important; }

/* ============================================================
   SIGHTINGS FEATURE
   ============================================================ */

/* ---- FAB ---- */

.sighting-fab:active { transform: scale(0.95); }

[data-theme="dark"] 

/* ---- Overlay ---- */

/* ---- Bottom Sheet ---- */

.sheet-close:active { background: var(--color-border); }

/* ---- Photo area ---- */

.sheet-photo-area:active { border-color: var(--color-primary); }

.photo-hint {
  font-size: 11px;
  color: var(--color-text-faint);
  font-weight: 400;
}

/* ---- Form fields ---- */

.field-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-input:focus { border-color: var(--color-primary); box-shadow: 0 0 0 3px rgba(45,106,79,0.12); }
.field-input

[data-theme="dark"] 

@keyframes shake {
  0%,100% { transform: translateX(0); }
  20%,60% { transform: translateX(-6px); }
  40%,80% { transform: translateX(6px); }
}

/* ---- Category pills ---- */

.cat-pill {
  padding: 6px 14px;
  border-radius: var(--radius-full);
  border: 1.5px solid var(--color-border);
  background: transparent;
  font-size: 13px;
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.cat-pill.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}

/* ---- Location row ---- */
.location-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}

#sighting-location-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-body);
}

.location-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* ---- Sheet footer ---- */
.sheet-footer {
  padding: var(--space-4) var(--space-5) var(--space-5);
}

.sheet-submit-btn:active { transform: scale(0.98); }
.sheet-submit-btn.submit-success { background: #27AE60; }

/* ---- Discover sub-tabs ---- */
.discover-tabs {
  display: flex;
  border-bottom: 1.5px solid var(--color-border);
  background: var(--color-surface);
  padding: 0 var(--space-5);
  gap: 0;
}
.discover-tab {
  flex: 1;
  padding: 12px 0;
  background: none;
  border: none;
  font-size: var(--text-sm);
  font-weight: 500;
  font-family: var(--font-body);
  color: var(--color-text-muted);
  cursor: pointer;
  border-bottom: 2.5px solid transparent;
  margin-bottom: -1.5px;
  transition: color 0.2s, border-color 0.2s;
}
.discover-tab.active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
  font-weight: 600;
}

/* ---- My Sightings panel ---- */
.sightings-log-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-4) var(--space-5) var(--space-2);
}

.sightings-empty-sub {
  font-size: 12px;
  color: var(--color-text-faint);
  line-height: 1.5;
}

/* ---- Sighting card ---- */

.sighting-card-photo {
  width: 100%;
  height: 160px;
  object-fit: cover;
  display: block;
}
.sighting-card-body {
  padding: var(--space-3) var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.sighting-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sighting-card-cat {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: capitalize;
}
.sighting-card-delete {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--color-text-faint);
  padding: 4px;
  display: flex;
  align-items: center;
}
.sighting-card-delete:active { color: #E74C3C; }
.sighting-card-species {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text);
}
.sighting-card-notes {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.45;
}
.sighting-card-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
}
.sighting-map-link {
  display: flex;
  align-items: center;
  gap: 4px;
  color: var(--color-primary);
  text-decoration: none;
  font-weight: 500;
}

/* ============================================================
   OFFICIAL LOGO
   ============================================================ */

/* Splash screen logo */
.splash-logo-img {
  width: 180px;
  height: 180px;
  object-fit: contain;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0,0,0,0.12);
  background: #fff;
}

/* Home header logo */
.header-logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

/* Splash credit line */
.splash-credit {
  font-size: 12px;
  color: rgba(255,255,255,0.65);
  text-align: center;
  line-height: 1.5;
  margin-top: var(--space-1);
  letter-spacing: 0.01em;
}

/* ============================================================
   VOLUNTEER CTA CARD
   ============================================================ */
.volunteer-card {
  background: linear-gradient(135deg, var(--color-primary-active) 0%, var(--color-primary) 100%);
  border-radius: var(--radius-xl, 20px);
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  box-shadow: 0 4px 20px rgba(45,106,79,0.25);
}
.volunteer-card-top {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}
.volunteer-icon {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-lg);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  flex-shrink: 0;
}
.volunteer-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 600;
  color: #fff;
  letter-spacing: -0.01em;
}
.volunteer-subtitle {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.7);
  margin-top: 2px;
}
.volunteer-body {
  font-size: var(--text-sm);
  color: rgba(255,255,255,0.85);
  line-height: 1.55;
}
.volunteer-roles {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 14px;
}
.vol-role {
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  font-weight: 400;
}
.volunteer-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  background: #fff;
  color: var(--color-primary-active);
  font-size: var(--text-sm);
  font-weight: 700;
  font-family: var(--font-body);
  padding: 13px 20px;
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: opacity 0.15s, transform 0.1s;
}
.volunteer-btn:active {
  opacity: 0.85;
  transform: scale(0.98);
}

/* ============================================================
   SUPPORTER CARD
   ============================================================ */

.supporter-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-4);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.supporter-logo {
  width: 52px;
  height: auto;
  flex-shrink: 0;
  opacity: 0.85;
}
[data-theme="dark"] .supporter-logo {
  filter: invert(1);
  opacity: 0.7;
}
.supporter-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}
.supporter-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.supporter-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.5;
}

/* ============================================================
   WORKING BEE ROW
   ============================================================ */

.working-bee-row {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.working-bee-icon {
  width: 36px;
  height: 36px;
  background: var(--color-primary-tint, rgba(45,106,79,0.1));
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  flex-shrink: 0;
}
.working-bee-body {
  flex: 1;
  min-width: 0;
}
.working-bee-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.working-bee-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}
.working-bee-link {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
  text-decoration: none;
}

/* ============================================================
   SIGHTINGS FILTER BAR + COMMUNITY CARDS
   ============================================================ */

.sightings-select:focus { border-color: var(--color-primary); }
[data-theme="dark"] 

.sightings-filter-meta #sightings-log-count {
  font-size: 12px;
  color: var(--color-text-muted);
}

/* Community (official) sighting card — subtle accent */
.sighting-card-community {
  border-color: rgba(45,106,79,0.2);
}
.sighting-card-community .sighting-card-cat::after {
  content: ' · Community';
  font-size: 10px;
  color: var(--color-primary);
  opacity: 0.7;
}
.sighting-location {
  display: flex;
  align-items: flex-start;
  gap: 5px;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-top: 2px;
}
.sighting-location svg {
  flex-shrink: 0;
  margin-top: 1px;
}
.sighting-reported-by {
  display: block;
  font-size: 11px;
  color: var(--color-text-faint);
  margin-top: var(--space-1);
  font-style: italic;
}

/* ============================================================
   EVENTS SCREEN
   ============================================================ */

/* Loading skeleton */
.events-loading { padding: var(--space-4); }
.events-skeleton { display: flex; flex-direction: column; gap: var(--space-3); }
.skel-line {
  height: 14px; border-radius: 7px;
  background: linear-gradient(90deg, var(--color-surface-offset) 25%, var(--color-border) 50%, var(--color-surface-offset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
.skel-short { width: 40%; }
.skel-card {
  height: 90px; border-radius: var(--radius-lg);
  background: linear-gradient(90deg, var(--color-surface-offset) 25%, var(--color-border) 50%, var(--color-surface-offset) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
}
@keyframes shimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Empty / error state */
.events-empty {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: var(--space-12) var(--space-6);
  gap: var(--space-3);
  text-align: center;
  color: var(--color-text-faint);
  font-size: var(--text-sm);
  line-height: 1.5;
}

/* Events filter bar */
.events-filter-bar {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  border-bottom: 1px solid var(--color-divider);
}
.events-filter-bar::-webkit-scrollbar { display: none; }
.events-filter-bar .filter-chip { flex-shrink: 0; }

/* Month group heading */
.events-month-heading {
  padding: var(--space-5) var(--space-4) var(--space-2);
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  color: var(--color-text-muted);
  letter-spacing: 0.01em;
  border-bottom: 1px solid var(--color-border);
  margin-bottom: var(--space-1);
}

/* Event card */
.event-card {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-4);
  margin: 0 var(--space-4) var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  color: var(--color-text);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.event-card:active { transform: scale(0.98); }
[data-theme="dark"] .event-card { background: var(--color-surface-offset); }

/* Date column */
.event-card-date {
  display: flex; flex-direction: column; align-items: center;
  min-width: 40px;
  padding: var(--space-1) var(--space-2);
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border-radius: var(--radius-md);
  flex-shrink: 0;
}
.event-day-num {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
  color: var(--color-primary);
}
.event-day-name,
.event-month {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-text-muted);
  line-height: 1.2;
}

/* Body */
.event-card-body { flex: 1; min-width: 0; }
.event-card-top {
  display: flex; align-items: center; gap: var(--space-2);
  margin-bottom: var(--space-1);
}
.event-cat-badge {
  font-size: 10px;
  font-weight: 600;
  padding: 2px 7px;
  border-radius: var(--radius-full);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  white-space: nowrap;
  border: 1px solid var(--color-border);
}
.event-today-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-full);
  background: var(--color-primary); color: #fff;
}
.inat-quality-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-full);
  background: rgba(39,174,96,0.12); color: #1a7a40;
  border: 1px solid rgba(39,174,96,0.3);
}
[data-theme="dark"] .inat-quality-badge { color: #52d68a; background: rgba(39,174,96,0.2); }
.sighting-detail-sciname {
  font-style: italic;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin: -var(--space-2) 0 var(--space-4);
}

/* Sighting detail — photo strip */
.sighting-photo-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px 16px;
  scrollbar-width: none;
  background: var(--color-surface-offset);
}
.sighting-photo-strip::-webkit-scrollbar { display: none; }
.sighting-photo-thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--radius-md);
  object-fit: cover;
  cursor: pointer;
  border: 2.5px solid transparent;
  opacity: 0.7;
  transition: opacity 0.15s, border-color 0.15s;
}
.sighting-photo-thumb.active {
  border-color: var(--color-primary);
  opacity: 1;
}
.sighting-photo-thumb:active { opacity: 0.5; }

/* Observer's note — blockquote style */
.sighting-observer-notes {
  background: var(--color-surface-offset);
  border-left: 3px solid var(--color-primary);
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
  margin: 0;
  font-style: italic;
}

/* Conservation status warning row */
.sighting-conservation-row {
  color: #92400E;
}
.sighting-conservation-row svg { stroke: #D97706; }
[data-theme="dark"] .sighting-conservation-row { color: #FCD34D; }
[data-theme="dark"] .sighting-conservation-row svg { stroke: #FCD34D; }

/* ==============================
   POI GROUP MARKERS + POPUP
================================ */
.poi-group-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.poi-group-icon {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: #2D6A4F;
  border: 2.5px solid #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.32);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
.poi-group-count-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 17px;
  height: 17px;
  border-radius: 99px;
  background: #fff;
  color: #222;
  font-size: 10px;
  font-weight: 700;
  font-family: sans-serif;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.22);
  pointer-events: none;
}
.poi-group-label {
  background: rgba(255,255,255,0.95);
  font-size: 9px;
  font-weight: 700;
  color: #2D6A4F;
  padding: 2px 7px;
  border-radius: 10px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Leaflet popup shell overrides */
.poi-group-leaflet-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.16);
  padding: 0;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.06);
}
.poi-group-leaflet-popup .leaflet-popup-content {
  margin: 0;
  width: auto !important;
}
.poi-group-leaflet-popup .leaflet-popup-tip-container {
  margin-top: -1px;
}

/* Popup inner content */
.poi-group-popup {
  padding: 14px 16px 12px;
  min-width: 185px;
}
.poi-group-popup-title {
  font-size: 13px;
  font-weight: 700;
  color: #2D6A4F;
  margin-bottom: 2px;
  line-height: 1.3;
}
.poi-group-popup-desc {
  font-size: 11px;
  color: #999;
  margin-bottom: 10px;
}
.poi-group-popup-items {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.poi-group-popup-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: #333;
  font-weight: 500;
  line-height: 1.2;
}
.poi-group-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.event-soon-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-full);
  background: var(--color-amber, #E67E22); color: #fff;
}
.event-register-badge {
  font-size: 10px; font-weight: 700;
  padding: 2px 7px; border-radius: var(--radius-full);
  background: rgba(240,85,55,0.12); color: #c4381a;
  border: 1px solid rgba(240,85,55,0.3);
}
[data-theme="dark"] .event-register-badge { color: #ff7a63; background: rgba(240,85,55,0.2); border-color: rgba(240,85,55,0.4); }
.event-card-title {
  font-family: var(--font-display);
  font-size: var(--text-base);
  font-weight: 600;
  line-height: 1.3;
  margin-bottom: var(--space-1);
  color: var(--color-text);
}
.event-card-meta {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-1);
}
.event-time, .event-location {
  display: flex; align-items: center; gap: 4px;
  font-size: 11px;
  color: var(--color-text-muted);
}
.event-card-desc {
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.45;
  margin-top: var(--space-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.event-card-arrow {
  display: flex; align-items: center;
  color: var(--color-text-faint);
  flex-shrink: 0;
  align-self: center;
}
.event-card-thumb {
  flex-shrink: 0;
  width: 60px;
  height: 60px;
  border-radius: var(--radius-md);
  overflow: hidden;
  align-self: center;
}
.event-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* View all link */
.events-view-all {
  display: flex; align-items: center; justify-content: center;
  gap: var(--space-2);
  margin: var(--space-4);
  padding: var(--space-3) var(--space-4);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: all 0.2s ease;
}
.events-view-all:hover { color: var(--color-primary); border-color: var(--color-primary); }

/* Last updated timestamp */
.events-updated {
  text-align: center;
  font-size: 11px;
  color: var(--color-text-faint);
  padding: 0 var(--space-4) var(--space-6);
}

/* =============================================
   CMS ALERT BANNER
============================================= */
/* Reserve space before API responds to prevent layout shift */
.cms-alert-wrap {
  min-height: 56px;
  overflow: hidden;
  transition: min-height 0.2s ease;
}
.cms-alert-wrap.no-alert {
  min-height: 0;
}

.cms-alert {
  margin: var(--space-3) var(--space-4) 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}
.cms-alert.visible {
  opacity: 1;
  transform: translateY(0);
}
.cms-alert-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
}
.cms-alert-icon {
  flex-shrink: 0;
  margin-top: 1px;
}
.cms-alert-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cms-notice-text {
  font-size: var(--text-sm);
  font-weight: 600;
  margin: 0;
  line-height: 1.4;
}
.cms-notice-link {
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
/* Alert severity levels */
.cms-alert[data-level="info"] {
  background: var(--color-primary-light);
  border: 1.5px solid var(--color-primary);
}
.cms-alert[data-level="info"] .cms-alert-icon,
.cms-alert[data-level="info"] .cms-notice-text { color: var(--color-primary-dark, #1A3D2B); }
.cms-alert[data-level="info"] .cms-notice-link { color: var(--color-primary); }

.cms-alert[data-level="warning"] {
  background: #FFF8E7;
  border: 1.5px solid #E8A000;
}
.cms-alert[data-level="warning"] .cms-alert-icon,
.cms-alert[data-level="warning"] .cms-notice-text { color: #7A5200; }
.cms-alert[data-level="warning"] .cms-notice-link { color: #A06800; }

.cms-alert[data-level="closure"] {
  background: #FFF0F0;
  border: 1.5px solid #CC3333;
}
.cms-alert[data-level="closure"] .cms-alert-icon,
.cms-alert[data-level="closure"] .cms-notice-text { color: #8B0000; }
.cms-alert[data-level="closure"] .cms-notice-link { color: #CC3333; }

/* Dark mode alert adjustments */
[data-theme="dark"] .cms-alert[data-level="info"] {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
}
[data-theme="dark"] .cms-alert[data-level="info"] .cms-alert-icon,
[data-theme="dark"] .cms-alert[data-level="info"] .cms-notice-text { color: var(--color-primary); }
[data-theme="dark"] .cms-alert[data-level="info"] .cms-notice-link { color: var(--color-primary-hover); }
[data-theme="dark"] .cms-alert[data-level="warning"] { background: #3A2E00; border-color: #C88A00; }
[data-theme="dark"] .cms-alert[data-level="warning"] .cms-alert-icon,
[data-theme="dark"] .cms-alert[data-level="warning"] .cms-notice-text { color: #F0C040; }
[data-theme="dark"] .cms-alert[data-level="warning"] .cms-notice-link { color: #E8B840; }
[data-theme="dark"] .cms-alert[data-level="closure"] { background: #3A0000; border-color: #CC3333; }
[data-theme="dark"] .cms-alert[data-level="closure"] .cms-alert-icon,
[data-theme="dark"] .cms-alert[data-level="closure"] .cms-notice-text { color: #FF8080; }
[data-theme="dark"] .cms-alert[data-level="closure"] .cms-notice-link { color: #FF9999; }

/* =============================================
   FIRE DANGER RATING
============================================= */
.fire-danger-bar {
  margin-top: var(--space-2);
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: var(--space-2);
}
.fire-danger-inner {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}
.fire-danger-icon {
  flex-shrink: 0;
}
.fire-danger-label {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--color-text-muted);
}
.fire-danger-rating {
  margin-left: auto;
  font-size: var(--text-sm);
  font-weight: 700;
  padding: 2px 10px;
  border-radius: 20px;
  color: #fff;
  background: #888;
  letter-spacing: 0.02em;
}
/* Severity colours */
.fire-danger-rating[data-level="none"]         { background: #888888; }
.fire-danger-rating[data-level="moderate"]     { background: #E8A000; color: #fff; }
.fire-danger-rating[data-level="high"]         { background: #FF6600; color: #fff; }
.fire-danger-rating[data-level="extreme"]      { background: #CC0000; color: #fff; }
.fire-danger-rating[data-level="catastrophic"] { background: #4A0000; color: #fff; }
.fire-danger-rating[data-level="unknown"]      { display: none; }

/* ==============================
   HOME SCREEN — STATIC MAP PREVIEW
================================ */
.section-map-preview { padding-bottom: 0; }

.map-preview-btn {
  display: block;
  width: 100%;
  position: relative;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--color-border);
  cursor: pointer;
  padding: 0;
  background: none;
}

.map-preview-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 240px;
  object-fit: cover;
  object-position: center;
  transition: transform 0.3s ease;
}

.map-preview-btn:active .map-preview-img {
  transform: scale(1.02);
}

.map-preview-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.45) 0%, transparent 100%);
  padding: var(--space-4) var(--space-4) var(--space-3);
  display: flex;
  justify-content: flex-end;
}

.map-preview-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: #fff;
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-sm);
}

/* ==============================
   MAP LIGHTBOX
================================ */
.map-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(0,0,0,0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  animation: fadeIn 0.2s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.map-lightbox-inner {
  width: 100%;
  max-height: 90vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-xl);
}

.map-lightbox-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-xl);
}

.map-lightbox-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.2);
}

/* ==============================
   TRAIL FILTER BAR (below map)
================================ */
.trail-filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.trail-filter-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  flex: 1;
  padding: 2px 0;
}
.trail-filter-scroll::-webkit-scrollbar { display: none; }

.trail-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 10px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: all var(--trans);
}
.trail-filter-chip.active {
  background: var(--color-surface-offset);
  color: var(--color-text);
  border-color: var(--color-text-muted);
}
.trail-filter-chip:not(.active) {
  opacity: 0.45;
}
.trail-chip-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* My Location inline button */
.map-loc-btn-inline {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--color-surface-offset);
  border: 1px solid var(--color-border);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--color-text);
  transition: all var(--trans);
}
.map-loc-btn-inline:active { transform: scale(0.9); }
.map-loc-btn-inline.locating {
  color: var(--color-primary);
  animation: spin 1s linear infinite;
}

/* Pulsing location dot */
.loc-dot {
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
}
.loc-dot-inner {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--color-teal);
  border: 2.5px solid white;
  box-shadow: 0 0 0 0 rgba(41,128,185,0.5);
  animation: loc-pulse 2s ease-out infinite;
}
@keyframes loc-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(41,128,185,0.5); }
  70%  { box-shadow: 0 0 0 14px rgba(41,128,185,0); }
  100% { box-shadow: 0 0 0 0 rgba(41,128,185,0); }
}

/* ==============================
   MINI NOW-PLAYING BAR
================================ */
.mini-player {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  border-top: 1px solid rgba(255,255,255,0.15);
  min-height: 52px;
  transition: opacity var(--trans);
  position: fixed;
  bottom: calc(56px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  z-index: 199;
}
.mini-player:active { opacity: 0.85; }

.mini-player-track {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex: 1;
  min-width: 0;
}

/* Animated bars */
.mini-player-bars {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 18px;
  flex-shrink: 0;
}
.mini-player-bars span {
  display: block;
  width: 3px;
  border-radius: 2px;
  background: rgba(255,255,255,0.9);
  animation: mini-bar 0.8s ease-in-out infinite alternate;
}
.mini-player-bars span:nth-child(1) { height: 8px; animation-delay: 0s; }
.mini-player-bars span:nth-child(2) { height: 14px; animation-delay: 0.2s; }
.mini-player-bars span:nth-child(3) { height: 10px; animation-delay: 0.4s; }
@keyframes mini-bar {
  from { transform: scaleY(0.4); }
  to   { transform: scaleY(1); }
}
.mini-player.paused .mini-player-bars span {
  animation-play-state: paused;
}

.mini-player-info {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.mini-player-title {
  font-size: var(--text-sm);
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mini-player-sub {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-player-controls {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  flex-shrink: 0;
}
.mini-player-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  transition: background var(--trans);
}
.mini-player-btn:active { background: rgba(255,255,255,0.25); }

/* ==============================
   HOME VOLUNTEER BUTTON
================================ */
/* ── Home Trail List ────────────────────────────────────────── */
.home-trail-list {
  display: flex;
  flex-direction: column;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: var(--color-surface);
}
.home-trail-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-4);
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  cursor: pointer;
  transition: background var(--trans);
  color: var(--color-text);
  width: 100%;
}
.home-trail-item:last-child { border-bottom: none; }
.home-trail-item:active { background: var(--color-surface-offset); }
.home-trail-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-trail-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.home-trail-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.home-trail-desc {
  font-size: var(--text-xs);
  color: var(--color-text-faint);
  line-height: 1.4;
  margin-top: 2px;
  white-space: normal;
}
.home-trail-item svg { color: var(--color-text-faint); flex-shrink: 0; }

/* ── Home CTA Group (Quest + Audio Walk) ───────────────────── */
.home-cta-group {
  padding: var(--space-5) var(--space-5) 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

/* ── Home Audio Walk CTA ────────────────────────────────────── */
.home-audio-cta {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  width: 100%;
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.home-audio-cta:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--color-primary);
}
.home-audio-cta:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-sm);
}
.home-audio-cta-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  display: grid;
  place-items: center;
  color: var(--color-primary);
}
.home-audio-cta-text {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-audio-cta-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.2;
}
.home-audio-cta-sub {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.home-audio-cta-chevron {
  flex-shrink: 0;
  color: var(--color-text-faint);
}

/* Ecology CTA uses teal tint to visually distinguish from the audio (green) card */
.home-ecology-icon {
  background: color-mix(in srgb, var(--color-teal) 12%, transparent) !important;
  color: var(--color-teal) !important;
}

/* ── Home Events Widget ─────────────────────────────────────── */
.home-event-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  margin-bottom: var(--space-2);
  cursor: pointer;
  transition: background var(--trans);
  color: var(--color-text);
}
.home-event-item:last-of-type { margin-bottom: var(--space-3); }
.home-event-item:active { background: var(--color-surface-offset); }
.home-event-date {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 44px;
  flex-shrink: 0;
  background: color-mix(in srgb, var(--color-primary) 10%, transparent);
  border-radius: var(--radius-md);
  padding: var(--space-2) 0;
}
.home-event-day-name {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  line-height: 1;
}
.home-event-day-num {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1.1;
}
.home-event-month {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  line-height: 1;
}
.home-event-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.home-event-title {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.home-event-time {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}
.home-event-item > svg { color: var(--color-text-faint); flex-shrink: 0; }
.home-events-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-1);
  width: 100%;
  padding: var(--space-3);
  background: none;
  border: none;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-primary);
  cursor: pointer;
  transition: opacity var(--trans);
}
.home-events-more:active { opacity: 0.7; }

/* ── About prose ────────────────────────────────────────────── */
.about-prose p {
  font-size: var(--text-sm);
  color: var(--color-text-secondary);
  line-height: 1.7;
  margin-bottom: var(--space-3);
}
.about-prose p:last-child { margin-bottom: 0; }

/* Tab intro text */
.tab-intro {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.5;
  padding: var(--space-1) 0 var(--space-2);
}
#info-panel-wildlife > .tab-intro {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}
.tab-intro-link {
  color: var(--color-primary);
  text-decoration: none;
}
.tab-intro-link:hover { text-decoration: underline; }

.home-volunteer-btn {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-4);
  background: var(--color-primary);
  border-radius: var(--radius-xl);
  color: #fff;
  text-decoration: none;
  transition: opacity var(--trans);
  width: 100%;
  box-sizing: border-box;
}
.home-volunteer-btn:active { opacity: 0.85; }
.home-volunteer-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.home-volunteer-text {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 2px;
}
.home-volunteer-text strong {
  font-size: var(--text-sm);
  font-weight: 700;
  color: #fff;
}
.home-volunteer-text span {
  font-size: 12px;
  color: rgba(255,255,255,0.75);
}

/* ==============================
   AMENITIES (now uses .info-card / .info-row)
================================ */
.amenity-emoji {
  font-size: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

/* ==============================
   FULL-SCREEN MAP (screen-map)
================================ */
#screen-map {
  position: relative;
}

.map-filter-overlay {
  position: absolute;
  bottom: calc(64px + env(safe-area-inset-bottom) + 8px);
  left: 0;
  right: 0;
  z-index: 15;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.trail-filter-bar-overlay {
  pointer-events: all;
  margin: 0 var(--space-3);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}

/* POI category filter bar */
.poi-filter-bar {
  display: flex;
  flex-direction: row;
  gap: 6px;
  overflow-x: auto;
  padding: 7px 8px;
  scrollbar-width: none;
  pointer-events: all;
  -webkit-overflow-scrolling: touch;
  margin: 0 var(--space-3) 6px;
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
}
.poi-filter-bar::-webkit-scrollbar { display: none; }

.poi-filter-btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 12px 9px 8px;
  border-radius: var(--radius-full);
  font-size: 12px;
  font-weight: 600;
  font-family: var(--font-body);
  background: var(--color-surface-offset);
  color: var(--color-text-muted);
  border: 1.5px solid transparent;
  -webkit-tap-highlight-color: transparent;
  transition: all 0.15s ease;
  white-space: nowrap;
  opacity: 0.5;
}
.poi-filter-btn::before {
  content: '';
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.poi-filter-btn[data-category="amenities"]::before { background: #4A90D9; }
.poi-filter-btn[data-category="rest"]::before       { background: #8D6748; }
.poi-filter-btn[data-category="features"]::before   { background: #1565C0; }
.poi-filter-btn[data-category="landmarks"]::before  { background: #2D6A4F; }
.poi-filter-btn.active {
  background: var(--color-surface);
  color: var(--color-text);
  border-color: var(--color-border);
  opacity: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}
.poi-filter-btn:active { transform: scale(0.93); }

.map-listen-cta {
  position: absolute;
  bottom: calc(64px + env(safe-area-inset-bottom) + 140px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
}
.map-listen-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: var(--color-primary);
  color: #fff;
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
}

/* ==============================
   LISTEN SCREEN
================================ */
#screen-listen {
  flex-direction: column;
}
#screen-listen .screen-scroll {
  padding-left: var(--space-4);
  padding-right: var(--space-4);
}

/* Push map overlays up when mini-player is showing */
#screen-map.mini-player-visible .map-filter-overlay {
  bottom: calc(64px + env(safe-area-inset-bottom) + 52px + 8px);
}
#screen-map.mini-player-visible .map-listen-cta {
  bottom: calc(64px + env(safe-area-inset-bottom) + 52px + 100px);
}

/* iNaturalist CTA — distinct from volunteer green */
.home-inaturalist-btn {
  background: #4a7c59;
  text-align: left;
  border: none;
  cursor: pointer;
}

/* ==============================
   INFO SUB-TABS
================================ */
.info-sub-tabs {
  display: flex;
  gap: 0;
  background: var(--color-surface-offset);
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
  padding: 0;
  min-height: 48px;
  width: 100%;
}
.info-sub-tab {
  flex: 1;
  padding: 0 var(--space-1);
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  border-bottom: 3px solid transparent;
  transition: all var(--trans);
  text-align: center;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
}
.info-sub-tab.active {
  color: var(--color-primary);
  border-bottom: 3px solid var(--color-primary);
  background: var(--color-primary-light);
}
.info-panel {
  display: none;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: var(--bottom-safe);
}
.info-panel.active {
  display: block;
}

#screen-info { flex-direction: column; overflow: hidden; }

/* Info screen — disable animation that clips sub-tabs, ensure proper flex */
#screen-info {
  animation: none !important;
}
#screen-info .info-sub-tabs {
  z-index: 2;
  position: relative;
}

/* ==============================
   HOME WELCOME MESSAGE
================================ */
.home-welcome {
  padding: var(--space-6) var(--space-5) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}
.home-welcome-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-3);
  letter-spacing: -0.02em;
  line-height: 1.2;
}
.home-welcome-body {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0 0 var(--space-2);
}
.home-welcome-body:last-child { margin-bottom: 0; }
.home-welcome-body strong { color: var(--color-text); font-weight: 600; }

.address-link {
  color: var(--color-primary);
  text-decoration: underline;
  text-decoration-color: rgba(45,106,79,0.3);
  text-underline-offset: 2px;
  display: inline-block;
  padding: 8px 0;
  min-height: 44px;
}

/* ==============================
   SPLASH WORDMARK
================================ */
.splash-wordmark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  margin-bottom: var(--space-3);
  animation: splashFadeUp 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
@keyframes splashFadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}
.splash-wordmark-yarran {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 400;
  color: rgba(255,255,255,0.92);
  letter-spacing: 0.04em;
  line-height: 1;
}
.splash-wordmark-dheran {
  font-family: var(--font-display);
  font-size: 52px;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.04em;
  line-height: 1.1;
}

/* ==============================
   TODAY'S EVENTS WIDGET (home screen)
================================ */
#today-events-widget {
  border-bottom: 1px solid var(--color-border);
  background: var(--color-surface);
}
.today-events-inner {
  padding: var(--space-3) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: 0;
}
.today-events-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding-bottom: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--color-primary);
}
.today-event-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--color-border);
  text-decoration: none;
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
  border-radius: var(--radius-sm);
}
.today-event-item:active {
  background: var(--color-surface-offset);
}
.today-event-time {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--color-primary);
  white-space: nowrap;
  min-width: 60px;
}
.today-event-title {
  flex: 1;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  line-height: 1.35;
}
.today-event-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ==============================
   FAQ ACCORDION (Info > FAQ sub-tab)
================================ */
.faq-card {
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  background: var(--color-surface);
  overflow: hidden;
}
.faq-section {
  padding: var(--space-4) var(--space-5) 0;
}
.faq-section + .faq-section {
  padding-top: var(--space-3);
  border-top: 1px solid var(--color-border);
  margin-top: var(--space-2);
}
.faq-card .faq-section:last-child {
  padding-bottom: var(--space-4);
}
.faq-section-title {
  font-family: var(--font-display);
  font-size: var(--text-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 2px solid var(--color-primary-light);
}
.faq-item {
  border-bottom: 1px solid var(--color-border);
}
.faq-q {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  width: 100%;
  padding: var(--space-4) 0;
  background: transparent;
  text-align: left;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
  cursor: pointer;
  transition: color var(--trans);
}
.faq-q:active,
.faq-item.open .faq-q {
  color: var(--color-primary);
}
.faq-chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform 0.25s ease, color 0.2s ease;
}
.faq-item.open .faq-chevron {
  transform: rotate(180deg);
  color: var(--color-primary);
}
.faq-a {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.3s ease, padding 0.25s ease;
  padding-bottom: 0;
}
.faq-item.open .faq-a {
  max-height: 400px;
  padding-bottom: var(--space-4);
}
.faq-a p {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.65;
  margin: 0;
}
.faq-a p + p {
  margin-top: var(--space-2);
}
.faq-a a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ==============================
   MAP TRAIL SELECTION
   Tap a trail to highlight; others fade
================================ */

/* Floating selected-walk label (Leaflet topright control) */
.map-trail-label {
  margin: calc(10px + env(safe-area-inset-top, 50px)) 10px 0 0;
}
.map-trail-label-inner {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,0.96);
  border-radius: 8px;
  padding: 7px 10px 7px 12px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #1a1a1a;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  white-space: nowrap;
  max-width: 220px;
}
@media (prefers-color-scheme: dark) {
  .map-trail-label-inner {
    background: rgba(30,30,30,0.95);
    color: #f0f0f0;
  }
}
.map-trail-label-close {
  background: none;
  border: none;
  padding: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #888;
  cursor: pointer;
  border-radius: 4px;
  flex-shrink: 0;
  -webkit-tap-highlight-color: transparent;
}
.map-trail-label-close:active {
  background: rgba(0,0,0,0.08);
}

/* Tap-hint overlay shown when no trail is selected */
.map-tap-hint {
  display: block;
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.9);
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
  letter-spacing: 0.02em;
  padding-bottom: var(--space-2);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.4s ease;
}
.map-tap-hint.hidden {
  opacity: 0;
  pointer-events: none;
}

/* ==============================
   MAP TRAIL LEGEND BAR + TRAIL PICKER
================================ */
.trail-legend-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-2);
  background: var(--color-surface);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  pointer-events: all;
  margin: 0 var(--space-3);
}

.trail-picker {
  position: relative;
  flex: 1;
  min-width: 0;
}

.trail-picker-trigger {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border-radius: var(--radius-full);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.trail-picker-trigger:active { background: var(--color-divider); }

.trail-picker-trigger .trail-chip-dot {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  background: var(--color-border);
}
#trail-picker-label {
  flex: 1;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trail-picker-chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  transition: transform var(--trans);
}
.trail-picker.open .trail-picker-chevron {
  transform: rotate(180deg);
}

/* Expanded panel — fixed position so it escapes isolation/overflow stacking contexts */
.trail-picker-panel {
  position: fixed;
  z-index: 10000;
  background: var(--color-surface);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--color-border);
  overflow: hidden;
  opacity: 0;
  transform: translateY(6px);
  transition: opacity 0.2s ease, transform 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
}
.trail-picker.open .trail-picker-panel {
  opacity: 1;
  transform: translateY(0);
  pointer-events: all;
}

.trail-picker-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  cursor: pointer;
  border-bottom: 1px solid var(--color-divider);
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.trail-picker-item:last-child { border-bottom: none; }
.trail-picker-item:active { background: var(--color-surface-offset); }

.trail-picker-item .trail-chip-dot {
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.trail-picker-item-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.trail-picker-item-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.trail-picker-item-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
}

/* ==============================
   SPLASH — BOTANICAL REDESIGN
================================ */
.splash-bg-svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.splash-emblem {
  margin-bottom: var(--space-4);
  animation: splashFadeUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.splash-emblem-img {
  width: 100px;
  height: 100px;
  border-radius: 22px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
/* Stagger the wordmark after the emblem */
.splash-wordmark {
  animation-delay: 0.15s;
}
.splash-tagline {
  animation: splashFadeUp 0.8s 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}
.splash-loader {
  animation: splashFadeUp 0.8s 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  opacity: 0;
}

/* ==============================
   HOME HERO
================================ */
.home-hero {
  position: relative;
  height: 285px;
  overflow: hidden;
}
.home-hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 60% center;
}
.home-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(10, 30, 20, 0.45) 0%,
    rgba(10, 30, 20, 0.15) 35%,
    rgba(10, 30, 20, 0.75) 100%
  );
}
.home-hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: calc(var(--space-4) + env(safe-area-inset-top)) var(--space-5) var(--space-5);
}
.home-hero-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.home-hero-logo-img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.home-hero-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.25);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.home-hero-theme-btn:active {
  background: rgba(255,255,255,0.28);
}
.home-hero-title-block {
  /* sits in the middle / bottom area */
}
.home-hero-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.03em;
  line-height: 1.05;
  text-shadow: 0 1px 6px rgba(0,0,0,0.3);
  margin: 0 0 4px;
}
.home-hero-subtitle {
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.75);
  letter-spacing: 0.03em;
  text-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.home-hero-actions {
  display: flex;
  gap: var(--space-2);
}
.home-hero-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-radius: 20px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: #fff;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans), transform 0.1s ease;
  white-space: nowrap;
}
.home-hero-btn:active {
  background: rgba(255,255,255,0.3);
  transform: scale(0.97);
}

/* ==============================
   TRAIL DIFFICULTY BADGES (map legend)
================================ */
.trail-diff {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 2px 6px;
  border-radius: 4px;
  margin-left: 2px;
  flex-shrink: 0;
}
.trail-diff-easy {
  background: rgba(39, 174, 96, 0.15);
  color: #1e7e4a;
}
.trail-diff-moderate {
  background: rgba(230, 126, 34, 0.15);
  color: #c0621a;
}
.trail-diff-hard {
  background: rgba(192, 57, 43, 0.15);
  color: #a32e1e;
}
@media (prefers-color-scheme: dark) {
  .trail-diff-easy    { background: rgba(39,174,96,0.2);  color: #4ecb78; }
  .trail-diff-moderate{ background: rgba(230,126,34,0.2); color: #f0933a; }
  .trail-diff-hard    { background: rgba(192,57,43,0.2);  color: #e05c4a; }
}

/* ==============================
   EVENT DETAIL SCREEN
================================ */
#screen-event-detail {
  flex-direction: column;
}
.event-detail-hero {
  position: relative;
  height: 220px;
  flex-shrink: 0;
  overflow: hidden;
}
.event-detail-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}
.event-detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, transparent 50%, rgba(0,0,0,0.3) 100%);
}
.event-detail-body {
  padding: var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.event-detail-meta-top {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
}
.event-detail-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin: 0;
}
.event-detail-info-card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-4);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.event-detail-info-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  font-size: var(--text-sm);
  color: var(--color-text);
  font-weight: 500;
  line-height: 1.4;
}
.event-detail-info-row svg {
  flex-shrink: 0;
  margin-top: 1px;
}
.event-detail-desc {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.7;
}
.event-detail-register-notice {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-amber-bg);
  border: 1px solid rgba(181, 98, 26, 0.3);
  border-radius: var(--radius-md);
  font-size: var(--text-xs);
  color: var(--color-amber);
  line-height: 1.5;
}
.event-detail-register-notice svg {
  flex-shrink: 0;
  margin-top: 1px;
}
.event-detail-register-notice p {
  margin: 0;
}
[data-theme="dark"] .event-detail-register-notice {
  background: rgba(181, 98, 26, 0.12);
  border-color: rgba(181, 98, 26, 0.35);
  color: #D4845A;
}
.event-detail-register-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: opacity var(--trans);
}
.event-detail-register-btn:active {
  opacity: 0.85;
}
.event-detail-register-btn--secondary {
  background: var(--color-surface);
  color: var(--color-text);
  border: 1px solid var(--color-border);
}
.event-detail-register-btn--secondary:active {
  opacity: 0.75;
}
.event-detail-actions {
  display: flex;
  gap: var(--space-3);
}
.event-action-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans), opacity var(--trans);
}
.event-action-btn:active {
  opacity: 0.75;
}
/* Make event cards tappable */
.event-card {
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.event-card:active {
  background: var(--color-surface-offset);
}

/* ==============================
   INFO SCREEN HERO
================================ */
.info-compact-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: max(52px, calc(16px + env(safe-area-inset-top))) var(--space-4) var(--space-3);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  flex-shrink: 0;
}
.info-compact-title {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  letter-spacing: -0.02em;
  margin: 0;
}
.info-theme-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ==============================
   RESUME BANNER
================================ */
.resume-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin: var(--space-3) var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary-light);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-lg);
  animation: slideDown 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes slideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.resume-banner-text {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  flex: 1;
}
.resume-banner-actions {
  display: flex;
  gap: var(--space-2);
  flex-shrink: 0;
}
.resume-banner-btn {
  font-size: var(--text-xs);
  font-weight: 600;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  transition: opacity var(--trans), transform var(--trans);
}
.resume-banner-btn:active { transform: scale(0.95); opacity: 0.8; }
.resume-banner-resume {
  background: var(--color-primary);
  color: #fff;
}
.resume-banner-dismiss {
  background: transparent;
  color: var(--color-text-muted);
  border: 1px solid var(--color-border);
}

/* ==============================
   OFFLINE TIP BUBBLE
================================ */
#offline-tip-bubble {
  transition: opacity 0.4s ease;
}
.offline-tip-inner {
  display: flex;
  align-items: flex-start;
  gap: var(--space-3);
  margin: var(--space-3) var(--space-4) 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-primary-light);
  border: 1.5px solid var(--color-primary);
  border-radius: var(--radius-lg);
  color: var(--color-primary-dark, #1A3D2B);
}
.offline-tip-inner svg {
  flex-shrink: 0;
  margin-top: 2px;
  color: var(--color-primary);
}
.offline-tip-inner p {
  flex: 1;
  font-size: var(--text-sm);
  line-height: 1.45;
  margin: 0;
  color: var(--color-text);
}
.offline-tip-inner p strong {
  color: var(--color-primary);
}
.offline-tip-inner button {
  flex-shrink: 0;
  font-size: 14px;
  color: var(--color-text-muted);
  padding: 0 2px;
  line-height: 1;
  align-self: flex-start;
}

/* ==============================
   RECENT SIGHTINGS
================================ */
.sightings-header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.sightings-source {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.recent-sightings-list {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}
.sightings-loading {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  padding: var(--space-3) 0;
}
.sighting-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
}
.sighting-card:active { opacity: 0.75; }
.sighting-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-offset);
}
.sighting-thumb-placeholder {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  flex-shrink: 0;
}
.sighting-body { flex: 1; min-width: 0; }
.sighting-name {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sighting-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.sighting-arrow {
  color: var(--color-text-muted);
  flex-shrink: 0;
}

/* ==============================
   iNATURALIST SIGHTING CARDS
================================ */
.inat-card {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s ease;
}
.inat-card:active { transform: scale(0.98); opacity: 0.9; }
[data-theme="dark"] .inat-card { background: var(--color-surface-offset); }
.inat-card-photo {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  object-fit: cover;
  flex-shrink: 0;
  background: var(--color-surface-offset);
}
.inat-card-photo--empty {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}
.inat-card-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.inat-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.inat-card-category {
  font-size: 11px;
  font-weight: 600;
  color: var(--color-primary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.inat-card-quality {
  font-size: 10px;
  font-weight: 600;
  color: #27AE60;
  background: rgba(39,174,96,0.1);
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.inat-card-needs-id {
  font-size: 10px;
  font-weight: 500;
  color: var(--color-text-muted);
  background: var(--color-surface-raised, rgba(0,0,0,0.05));
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.inat-card-threatened {
  font-size: 10px;
  font-weight: 600;
  color: #C0392B;
  background: rgba(192,57,43,0.1);
  padding: 2px 6px;
  border-radius: 20px;
  white-space: nowrap;
}
.inat-card-desc {
  font-size: 11px;
  color: var(--color-text-secondary);
  line-height: 1.45;
  margin-top: 3px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inat-card-place {
  color: var(--color-text-muted);
}
.inat-card-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inat-card-sciname {
  font-size: 11px;
  color: var(--color-text-muted);
  font-style: italic;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.inat-card-meta {
  font-size: 11px;
  color: var(--color-text-muted);
}


/* ==============================
   WILDLIFE VIEW TOGGLE
================================ */
.wildlife-toggle-row {
  display: flex;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4) 0;
}
.wildlife-toggle {
  flex: 1;
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1.5px solid var(--color-border);
  background: var(--color-surface);
  color: var(--color-text-muted);
  transition: all 0.18s ease;
}
.wildlife-toggle.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
}
.sightings-source-row {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}
.sightings-inat-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: #74AC00;
  border-radius: 20px;
  padding: 3px 8px;
  text-decoration: none;
  letter-spacing: 0.02em;
  flex-shrink: 0;
}
.sightings-inat-badge:active { opacity: 0.8; }
.sightings-view-more {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  margin-top: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1.5px solid #74AC00;
  color: #74AC00;
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
  background: transparent;
  -webkit-tap-highlight-color: transparent;
}
.sightings-view-more:active { background: rgba(116,172,0,0.08); }
[data-theme="dark"] .sightings-view-more { border-color: #8fca1a; color: #8fca1a; }

/* ==============================
   SPECIES DETAIL SHEET
================================ */
.species-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0);
  z-index: 300;
  transition: background 0.3s ease, backdrop-filter 0.3s ease;
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
}
.species-overlay.visible {
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.species-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 301;
  background: var(--color-surface);
  border-radius: 20px 20px 0 0;
  flex-direction: column;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  transform: translateY(100%);
  transition: transform 0.32s cubic-bezier(0.32,0.72,0,1);
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}
.species-sheet.visible { transform: translateY(0); }

.species-sheet-handle {
  width: 36px;
  height: 4px;
  background: var(--color-border);
  border-radius: 2px;
  margin: 10px auto 0;
  flex-shrink: 0;
}
.species-sheet-close {
  position: absolute;
  top: 12px;
  right: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(255,255,255,0.85);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text);
  z-index: 10;
  box-shadow: 0 1px 4px rgba(0,0,0,0.15);
}
.species-photo-wrap {
  width: 100%;
  height: 220px;
  flex-shrink: 0;
  margin-top: var(--space-3);
  overflow: hidden;
  position: relative;
}
.species-photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.species-photo-placeholder {
  width: 100%;
  height: 100%;
  background: var(--color-surface-offset);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 72px;
}
.species-sheet-body {
  padding: var(--space-4) var(--space-5);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.species-sheet-header { display: flex; flex-direction: column; gap: 4px; }
.species-common-name {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0;
}
.species-sci-name {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  font-style: italic;
  margin: 0;
}
.species-conservation {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 20px;
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.cons-ok    { background: var(--color-primary-light); color: var(--color-primary); }
.cons-urgent { background: #FFF0F0; color: #CC3333; }
.species-conservation-def {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: var(--space-1);
  line-height: 1.4;
}
.species-last-seen-detail {
  font-size: 12px;
  color: var(--color-primary);
  opacity: 0.85;
  margin-top: var(--space-2);
}

.species-enrichment-loading {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) 0;
  font-size: var(--text-sm);
  color: var(--color-text-muted);
}
.species-enrichment-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-border);
  border-top-color: var(--color-primary);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  flex-shrink: 0;
}
.species-section { display: flex; flex-direction: column; gap: var(--space-2); }
.species-section-title {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--color-text);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin: 0;
}
.species-description {
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.6;
  margin: 0;
}
.species-wiki {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  line-height: 1.6;
  margin: 0;
}
.species-links { display: flex; gap: var(--space-3); }
.species-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 600;
  text-decoration: none;
}
.species-link-primary {
  background: var(--color-primary);
  color: #fff;
  flex: 1;
  justify-content: center;
}

/* Wildlife card chevron */
.wildlife-card-chevron {
  flex-shrink: 0;
  color: var(--color-text-muted);
  margin-left: auto;
  align-self: center;
}
.wildlife-card { cursor: pointer; }
.wildlife-card:active { transform: scale(0.98); opacity: 0.9; }

/* =============================================
   ONBOARDING
============================================= */
.onboard {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: #2D6A4F;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity 400ms cubic-bezier(0.16, 1, 0.3, 1);
}
[data-theme="dark"] .onboard {
  background: #1A3028;
}
.onboard.visible {
  opacity: 1;
  pointer-events: auto;
}
.onboard.leaving {
  opacity: 0;
  pointer-events: none;
}

.onboard-skip {
  position: absolute;
  top: calc(var(--space-5) + env(safe-area-inset-top, 0px));
  right: var(--space-5);
  z-index: 2;
  background: none;
  color: rgba(255,255,255,0.8);
  border: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  padding: var(--space-2) var(--space-1);
  cursor: pointer;
  letter-spacing: 0.01em;
}

.onboard-slider {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.onboard-track {
  display: flex;
  height: 100%;
  will-change: transform;
  transition: transform 380ms cubic-bezier(0.16, 1, 0.3, 1);
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.onboard-card {
  flex: 0 0 100%;
  display: flex;
  flex-direction: column;
  height: 100%;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

/* Illustration panel — forest green, SVG centred */
.onboard-illus-wrap {
  flex: 0 0 52%;
  background: #2D6A4F;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--space-10) + env(safe-area-inset-top, 0px));
  padding-bottom: var(--space-10);
  color: rgba(255,255,255,0.88);
  position: relative;
}
[data-theme="dark"] .onboard-illus-wrap {
  background: #1A3028;
}

.onboard-illus {
  width: 170px;
  height: 170px;
}

/* Content card lifts over the green panel */
.onboard-content {
  flex: 1;
  background: var(--color-surface);
  border-radius: 24px 24px 0 0;
  margin-top: -24px;
  padding: var(--space-8) var(--space-6) var(--space-2);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  position: relative;
  z-index: 1;
}
.onboard-eyebrow {
  font-family: var(--font-body);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-primary);
  margin: 0 0 var(--space-2);
}
.onboard-heading {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 var(--space-3);
  line-height: 1.2;
}
.onboard-desc {
  font-family: var(--font-body);
  font-size: var(--text-base);
  color: var(--color-text-muted);
  margin: 0;
  line-height: 1.6;
}

.onboard-footer {
  padding: var(--space-4) var(--space-6);
  padding-bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-4);
  background: var(--color-surface);
}

.onboard-dots {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}
.onboard-dot {
  height: 8px;
  width: 8px;
  border-radius: var(--radius-full);
  background: var(--color-divider);
  transition: background 250ms ease, width 250ms cubic-bezier(0.16, 1, 0.3, 1);
}
.onboard-dot.active {
  background: var(--color-primary);
  width: 24px;
}

.onboard-btn {
  width: 100%;
  padding: var(--space-4);
  border-radius: var(--radius-full);
  background: var(--color-primary);
  color: #fff;
  font-family: var(--font-body);
  font-size: var(--text-base);
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: background var(--trans), transform var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.onboard-btn:active {
  background: var(--color-primary-hover);
  transform: scale(0.98);
}

/* ==============================
   REDUCED MOTION
================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ==============================
   WANDERER MODE (?view=map)
   Strips app chrome for iframe embedding — shows only the map.
================================ */
.wanderer-mode .tab-bar,
.wanderer-mode #screen-map .screen-header {
  display: none !important;
}

/* Map fills the full viewport without nav bar offset */
.wanderer-mode #screen-map {
  padding-bottom: 0;
}

/* Filter overlay sits at the bottom of the screen (no nav bar) */
.wanderer-mode .map-filter-overlay {
  bottom: calc(env(safe-area-inset-bottom) + 8px);
}

/* Force light theme */
.wanderer-mode,
.wanderer-mode * {
  --color-bg:             #F5F3EE;
  --color-surface:        #FFFFFF;
  --color-surface-2:      #EAE8E3;
  --color-primary:        #2D6A4F;
  --color-primary-light:  rgba(45,106,79,0.08);
  --color-text:           #1A1A1A;
  --color-text-muted:     #6B7280;
  --color-border:         #E0DDD7;
  --color-divider:        #E8E5DF;
}

/* ══════════════════════════════════════════
   NATURE QUEST
══════════════════════════════════════════ */

/* ── Home entry card ──────────────────── */
.quest-entry-card {
  background: var(--color-surface);
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  position: relative;
}

.quest-entry-card--complete {
  border-color: var(--color-primary);
}
.quest-entry-card { cursor: pointer; -webkit-tap-highlight-color: transparent; }
.quest-entry-card:active { opacity: 0.85; }
.quest-entry-chevron { flex-shrink: 0; color: var(--color-text-faint); }

.quest-entry-top {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.quest-entry-icon {
  flex: none;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--color-primary) 12%, transparent);
  display: grid;
  place-items: center;
  color: var(--color-primary);
}
.quest-entry-text { flex: 1; min-width: 0; }
.quest-entry-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.2;
}
.quest-entry-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.quest-entry-btn {
  flex: none;
  align-self: center;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-primary);
  color: #fff;
  cursor: pointer;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}
.quest-entry-btn:active { opacity: 0.85; }

.quest-entry-stats {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-3);
}
.quest-stat {
  font-size: 11.5px;
  color: var(--color-text-muted);
  font-family: var(--font-display);
}
.quest-stat strong { color: var(--color-text); font-weight: 700; }
.quest-stat-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--color-border);
  flex: none;
}

/* Progress bar on entry card (in-progress state) */
.quest-progress-track {
  margin-top: var(--space-3);
  height: 4px;
  border-radius: 2px;
  background: var(--color-border);
  overflow: hidden;
}
.quest-progress-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 2px;
  transition: width 0.4s ease;
}

/* ── Screen: Quest ────────────────────── */
/* .screen and .screen.active already handle display:flex, flex-direction:column, and height.
   Only override what's specific to the quest screen layout. */
#quest-screen-content {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

/* Reset button in compact-header */
.quest-reset-btn {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
  background: none;
  border: none;
  padding: var(--space-2) var(--space-2);
  cursor: pointer;
  border-radius: var(--radius-sm);
  min-width: 36px;
  text-align: right;
  transition: color var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.quest-reset-btn.quest-reset-confirm { color: var(--color-amber); }

/* Top progress bar */
.quest-progress-bar-wrap {
  height: 3px;
  background: var(--color-divider);
  flex: none;
}
.quest-progress-bar {
  height: 100%;
  background: var(--color-primary);
  transition: width 0.4s ease;
  border-radius: 0 2px 2px 0;
}

.quest-screen-scroll {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-4) var(--space-4) var(--bottom-safe);
  scrollbar-width: none;
}
.quest-screen-scroll::-webkit-scrollbar { display: none; }

.quest-wildlife-tip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  background: color-mix(in srgb, var(--color-primary) 8%, transparent);
  border: none;
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  margin-bottom: var(--space-4);
  cursor: pointer;
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}
.quest-wildlife-tip:active { opacity: 0.75; }
.quest-wildlife-tip > svg:first-child { flex-shrink: 0; color: var(--color-primary); }
.quest-wildlife-tip > svg:last-child  { flex-shrink: 0; color: var(--color-text-faint); margin-left: auto; }
.quest-wildlife-tip span {
  flex: 1;
  font-size: 12px;
  color: var(--color-text-muted);
  line-height: 1.4;
}
.quest-wildlife-tip strong { color: var(--color-primary); font-weight: 600; }

.quest-prompts-header {
  display: flex;
  align-items: center;
  margin-bottom: var(--space-3);
}
.quest-prompts-count {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-text-muted);
}

/* ── Task rows ────────────────────────── */
.quest-task {
  display: flex;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  margin-bottom: var(--space-2);
  cursor: pointer;
  user-select: none;
  position: relative;
  overflow: hidden;
  transition: border-color var(--trans), background var(--trans);
  -webkit-tap-highlight-color: transparent;
}
.quest-task:active { opacity: 0.82; }

.quest-task-tick {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: 1.5px solid var(--color-border);
  background: var(--color-surface-2);
  display: grid;
  place-items: center;
  transition: background var(--trans), border-color var(--trans);
}
.quest-task-tick svg {
  stroke: #fff;
  transition: opacity var(--trans), transform var(--trans);
  opacity: 0;
  transform: scale(0.5);
}

.quest-task-body { flex: 1; min-width: 0; }
.quest-task-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.25;
  transition: color var(--trans);
}
.quest-task-hint {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
  line-height: 1.4;
}

/* Done state */
.quest-task.done {
  background: var(--color-primary-light);
  border-color: transparent;
}
.quest-task.done .quest-task-tick {
  background: var(--color-primary);
  border-color: var(--color-primary);
}
.quest-task.done .quest-task-tick svg { opacity: 1; transform: scale(1); }
.quest-task.done .quest-task-title {
  color: var(--color-text-muted);
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

/* Tick pulse */
.quest-task-pulse {
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  pointer-events: none;
  background: radial-gradient(circle at 20px 50%, var(--color-primary-light), transparent 60%);
  opacity: 0;
}
.quest-task.just-ticked .quest-task-pulse {
  animation: quest-pulse 0.75s ease forwards;
}
@keyframes quest-pulse {
  0%   { opacity: 0.9; }
  100% { opacity: 0; }
}

/* ── Bird counter ─────────────────────── */
.quest-counter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-surface-2));
  margin-bottom: var(--space-2);
  transition: border-color var(--trans);
}
.quest-counter.done {
  border-color: var(--color-primary);
}

.quest-ring {
  flex: none;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary) calc(var(--p, 0) * 1%), var(--color-divider) 0);
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.3s ease;
}
.quest-ring::after {
  content: "";
  position: absolute;
  inset: 5px;
  background: var(--color-surface-2);
  border-radius: 50%;
}
.quest-ring-count {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: var(--color-primary);
}

.quest-counter-body { flex: 1; min-width: 0; }
.quest-counter-btns { display: flex; gap: var(--space-1); flex: none; }
.quest-step-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  color: var(--color-text);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.quest-step-btn:active { background: var(--color-primary-light); }
.quest-step-btn--add {
  background: var(--color-primary);
  color: #fff;
  border-color: transparent;
}
.quest-step-btn--add:active { background: var(--color-primary-hover); }

/* ── Bonus section ────────────────────── */
.quest-bonus-section { margin-top: var(--space-5); }
.quest-bonus-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 11px;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: var(--space-2);
}
.quest-bonus {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: var(--color-amber-bg);
  border: 1px dashed var(--color-amber);
  margin-bottom: var(--space-2);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans), border-color var(--trans);
}
.quest-bonus:active { opacity: 0.82; }
.quest-bonus-star {
  flex: none;
  color: var(--color-amber);
  display: flex;
  align-items: center;
  transition: color var(--trans);
}
.quest-bonus-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  color: var(--color-amber);
  flex: 1;
  transition: color var(--trans);
}
.quest-bonus-inat-btn {
  flex: none;
  background: none;
  border: none;
  padding: 4px;
  margin: -4px;
  cursor: pointer;
  color: var(--color-amber);
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity var(--trans), color var(--trans);
}
.quest-bonus-inat-btn:active { opacity: 1; }
.quest-bonus.done {
  background: var(--color-primary-light);
  border-color: var(--color-primary);
  border-style: solid;
}
.quest-bonus.done .quest-bonus-title { color: var(--color-primary); text-decoration: line-through; }
.quest-bonus.done .quest-bonus-star { color: var(--color-primary); }
.quest-bonus.done .quest-bonus-inat-btn { color: var(--color-primary); }

/* ── Super Spotter banner ──────────────── */
.quest-super-spotter {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #FFF8E1, #FFF3CD);
  border: 1.5px solid #F59E0B;
  margin-top: var(--space-3);
}
[data-theme="dark"] .quest-super-spotter {
  background: linear-gradient(135deg, #3B2C0A, #2E2200);
  border-color: #B45309;
}
.quest-super-spotter-star { font-size: 22px; flex: none; }
.quest-super-spotter-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  color: #B45309;
  display: block;
}
[data-theme="dark"] .quest-super-spotter-text { color: #F59E0B; }
.quest-super-spotter-sub {
  font-size: 11px;
  color: #92400E;
  display: block;
  margin-top: 1px;
}
[data-theme="dark"] .quest-super-spotter-sub { color: #D97706; }
.quest-super-spotter--reveal {
  animation: quest-cta-reveal 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

/* ── Completion Super Spotter block ──── */
.quest-completion-super {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, #FFF8E1, #FFF3CD);
  border: 1.5px solid #F59E0B;
  margin: var(--space-3) 0;
}
[data-theme="dark"] .quest-completion-super {
  background: linear-gradient(135deg, #3B2C0A, #2E2200);
  border-color: #B45309;
}
.quest-completion-super-star { font-size: 28px; }
.quest-completion-super-text {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 16px;
  color: #B45309;
}
[data-theme="dark"] .quest-completion-super-text { color: #F59E0B; }
.quest-completion-super-body {
  font-size: 12px;
  color: #92400E;
  margin: 0;
  text-align: center;
}
[data-theme="dark"] .quest-completion-super-body { color: #D97706; }

/* ── Super Spotter badge variant ─────── */
.quest-badge-bonus--super {
  color: #B45309;
  font-weight: 700;
}
[data-theme="dark"] .quest-badge-bonus--super { color: #F59E0B; }

/* ── Intro sheet ──────────────────────── */
.quest-intro-sheet {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: none;
}
.quest-intro-sheet::-webkit-scrollbar { display: none; }
.quest-intro-handle {
  width: 36px;
  height: 4px;
  border-radius: 2px;
  background: var(--color-divider);
  margin: 0 auto;
  flex: none;
}
.quest-intro-illo {
  height: 100px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, var(--color-primary-light), var(--color-bg));
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.quest-intro-illo-emoji {
  font-size: 52px;
  line-height: 1;
}
.quest-intro-heading {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  color: var(--color-primary);
  margin: 0;
}
.quest-intro-body {
  font-size: var(--text-sm);
  color: var(--color-text);
  margin: 0;
  line-height: 1.55;
}
.quest-intro-safety {
  list-style: none;
  padding: 0;
  margin: 0;
}
.quest-intro-safety li {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  font-size: var(--text-sm);
  color: var(--color-text);
  padding: var(--space-1) 0;
  line-height: 1.45;
}
.quest-intro-safety li::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  margin-top: 6px;
  border-radius: 50%;
  background: var(--color-primary);
}
.quest-intro-actions {
  display: flex;
  gap: var(--space-3);
  margin-top: auto;
  padding-top: var(--space-3);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.quest-btn-ghost {
  flex: 1;
  padding: 13px;
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
  background: transparent;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: var(--color-text-muted);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quest-btn-primary {
  flex: 2;
  padding: 13px;
  border-radius: var(--radius-md);
  border: none;
  background: var(--color-primary);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  color: #fff;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.quest-btn-primary:active { opacity: 0.88; }

/* ── Completion card ──────────────────── */
.quest-completion {
  text-align: center;
  padding: var(--space-8) var(--space-4) var(--space-6);
  border-radius: var(--radius-xl);
  background: linear-gradient(160deg, var(--color-primary) 0%, var(--color-primary-deep) 100%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.quest-completion::before {
  content: "";
  position: absolute;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  right: -60px;
  top: -60px;
  pointer-events: none;
}
.quest-completion-badge {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  border: 2px solid rgba(255, 255, 255, 0.3);
  display: grid;
  place-items: center;
  margin: 0 auto var(--space-4);
  color: #fff;
}
.quest-completion-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-lg);
  margin: 0 0 var(--space-2);
  color: #fff;
  line-height: 1.3;
}
.quest-completion-body {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.8);
  margin: 0 0 var(--space-6);
  line-height: 1.5;
}
.quest-completion-inat-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 13px var(--space-4);
  border-radius: var(--radius-md);
  border: none;
  background: #fff;
  color: var(--color-primary-deep);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  margin-bottom: var(--space-3);
  -webkit-tap-highlight-color: transparent;
}
.quest-completion-inat-btn:active { opacity: 0.88; }
.quest-completion-reset-btn {
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.35);
  color: rgba(255, 255, 255, 0.9);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  padding: 11px var(--space-4);
  border-radius: var(--radius-md);
  width: 100%;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ── Complete Quest CTA ───────────────── */
.quest-complete-cta {
  margin: var(--space-5) 0 var(--space-4);
  padding: var(--space-4) var(--space-4) var(--space-4);
  border-radius: var(--radius-xl);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-deep) 100%);
  text-align: center;
}
.quest-complete-cta--reveal {
  animation: quest-cta-reveal 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
@keyframes quest-cta-reveal {
  from { opacity: 0; transform: translateY(12px) scale(0.96); }
  to   { opacity: 1; transform: none; }
}
.quest-complete-cta-hint {
  font-size: var(--text-sm);
  color: rgba(255, 255, 255, 0.85);
  margin: 0 0 var(--space-3);
  line-height: 1.5;
}
.quest-complete-cta-btn {
  display: block;
  width: 100%;
  padding: 14px var(--space-4);
  border-radius: var(--radius-md);
  border: 2px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
  letter-spacing: 0.01em;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans), transform 0.1s;
}
.quest-complete-cta-btn:active {
  background: rgba(255, 255, 255, 0.25);
  transform: scale(0.98);
}

/* ── Quest picker seasonal note ────────── */
.quest-picker-seasonal-note {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  text-align: center;
  padding: var(--space-3) var(--space-2) var(--space-1);
  line-height: 1.5;
  margin: 0;
}

/* ── Quest badges strip (home card) ────── */
.quest-badges-strip {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  width: 100%;
  padding: var(--space-2) var(--space-3);
  background: var(--color-surface-offset);
  border: none;
  border-top: 1px solid var(--color-border);
  border-radius: 0 0 var(--radius-xl) var(--radius-xl);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  text-align: left;
}
.quest-badges-strip:active { opacity: 0.8; }
.quest-badges-strip-thumbs { display: flex; gap: 4px; flex: none; }
.quest-badge-thumb {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 14px;
  flex: none;
}
.quest-badge-thumb--more {
  background: var(--color-surface-3) !important;
  color: var(--color-text-muted) !important;
  font-size: 10px;
  font-weight: 700;
  font-family: var(--font-display);
}
.quest-badges-strip-label {
  flex: 1;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-family: var(--font-display);
  font-weight: 500;
}
.quest-badges-strip svg { flex: none; color: var(--color-text-muted); }

/* ── Picker badges button (header) ─────── */
.quest-picker-badges-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--color-surface-3);
  color: var(--color-text-muted);
  display: grid;
  place-items: center;
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.quest-picker-badges-btn:active { opacity: 0.7; }

/* ── Completion badges button ───────────── */
.quest-completion-badges-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  padding: 11px var(--space-4);
  border-radius: var(--radius-md);
  border: 1px solid rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.9);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 13px;
  cursor: pointer;
  margin-bottom: var(--space-3);
  -webkit-tap-highlight-color: transparent;
}
.quest-completion-badges-btn:active { opacity: 0.8; }

/* ── Achievements screen ────────────────── */
.quest-achievement-stats {
  display: flex;
  align-items: center;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4) var(--space-3);
  gap: 0;
}
.quest-achievement-stat {
  flex: 1;
  text-align: center;
}
.quest-achievement-stat-num {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-xl);
  color: var(--color-primary);
  line-height: 1.1;
}
.quest-achievement-stat-label {
  font-size: 11px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.quest-achievement-stat-div {
  width: 1px;
  height: 36px;
  background: var(--color-border);
  flex: none;
}

/* ── Badge grid ──────────────────────────── */
.quest-badge-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-3);
}
.quest-badge-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}
.quest-badge-circle {
  --badge-color: #aaa;
  position: relative;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--color-surface-3);
  border: 3px solid var(--color-border);
  display: grid;
  place-items: center;
  transition: border-color 0.2s, background 0.2s;
}
.quest-badge-item--earned .quest-badge-circle {
  background: color-mix(in srgb, var(--badge-color) 12%, transparent);
  border-color: var(--badge-color);
}
.quest-badge-emoji {
  font-size: 26px;
  line-height: 1;
  transition: opacity 0.2s;
}
.quest-badge-item:not(.quest-badge-item--earned) .quest-badge-emoji {
  opacity: 0.3;
  filter: grayscale(1);
}
.quest-badge-check {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--badge-color);
  color: #fff;
  display: grid;
  place-items: center;
  border: 2px solid var(--color-bg);
}
.quest-badge-name {
  font-size: 11px;
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.2;
  margin-top: 2px;
}
.quest-badge-item:not(.quest-badge-item--earned) .quest-badge-name {
  color: var(--color-text-muted);
}
.quest-badge-meta {
  font-size: 10px;
  color: var(--color-text-muted);
  line-height: 1.2;
}
.quest-badge-bonus {
  font-size: 10px;
  color: var(--color-amber);
  font-weight: 600;
}

/* ── Monthly history ─────────────────────── */
.quest-history-group { margin-bottom: var(--space-4); }
.quest-history-month-label {
  font-size: var(--text-xs);
  font-family: var(--font-display);
  font-weight: 700;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: var(--space-2);
}
.quest-history-item {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-3);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  margin-bottom: var(--space-2);
}
.quest-history-emoji {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  font-size: 20px;
  flex: none;
}
.quest-history-body { flex: 1; min-width: 0; }
.quest-history-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
}
.quest-history-meta {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: 1px;
}
.quest-history-item svg { flex: none; color: var(--color-primary); }

/* ── Device backup card ──────────────────── */
.quest-backup-card {
  display: flex;
  gap: var(--space-3);
  background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-deep) 100%);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
  color: #fff;
  margin-bottom: var(--space-3);
}
.quest-backup-icon {
  flex: none;
  width: 36px;
  height: 36px;
  background: rgba(255,255,255,0.15);
  border-radius: var(--radius-md);
  display: grid;
  place-items: center;
  color: #fff;
}
.quest-backup-body { flex: 1; min-width: 0; }
.quest-backup-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: 4px;
}
.quest-backup-subtitle {
  font-size: var(--text-xs);
  color: rgba(255,255,255,0.8);
  line-height: 1.5;
  margin-bottom: var(--space-3);
}
.quest-backup-code-row {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-3);
}
.quest-backup-code {
  flex: 1;
  font-family: 'Courier New', monospace;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #fff;
  user-select: all;
}
.quest-backup-copy-btn {
  background: rgba(255,255,255,0.2);
  border: 1px solid rgba(255,255,255,0.35);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 12px;
  padding: 5px 12px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.quest-backup-copy-btn:active { opacity: 0.75; }

/* ── Restore card ────────────────────────── */
.quest-restore-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-xl);
  padding: var(--space-4);
}
.quest-restore-label {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-2);
}
.quest-restore-row {
  display: flex;
  gap: var(--space-2);
}
.quest-restore-input {
  flex: 1;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 10px var(--space-3);
  font-family: 'Courier New', monospace;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.06em;
  color: var(--color-text);
  text-transform: uppercase;
  -webkit-appearance: none;
  appearance: none;
}
.quest-restore-input:focus {
  outline: none;
  border-color: var(--color-primary);
}
.quest-restore-btn {
  background: var(--color-primary);
  border: none;
  border-radius: var(--radius-md);
  color: #fff;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 14px;
  padding: 10px var(--space-4);
  cursor: pointer;
  flex: none;
  -webkit-tap-highlight-color: transparent;
}
.quest-restore-btn:active { opacity: 0.85; }

.quest-achievements-footer-link {
  text-align: center;
  padding: var(--space-4) var(--space-4) var(--space-8);
}
.quest-achievements-footer-link button {
  background: none;
  border: none;
  padding: 0;
  color: var(--color-text-muted);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  -webkit-tap-highlight-color: transparent;
}

.faq-reveal-btn {
  background: none;
  border: none;
  padding: 0;
  margin-top: var(--space-3);
  color: var(--color-primary);
  font-size: var(--text-sm);
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  display: inline-block;
  -webkit-tap-highlight-color: transparent;
}

/* ── Quest picker screen ──────────────── */
.quest-picker-list {
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  background: var(--color-surface-2);
  overflow: hidden;
}
.quest-picker-item {
  width: 100%;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  background: none;
  border: none;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background var(--trans);
}
.quest-picker-item:last-child { border-bottom: none; }
.quest-picker-item:active { background: var(--color-primary-light); }
.quest-picker-emoji {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: grid;
  place-items: center;
  font-size: 20px;
}
.quest-picker-body { flex: 1; min-width: 0; }
.quest-picker-name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  line-height: 1.25;
}
.quest-picker-meta {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-top: 2px;
}
.quest-picker-pill {
  flex: none;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 10.5px;
  padding: 3px 8px;
  border-radius: var(--radius-full);
  background: var(--color-primary-light);
  color: var(--color-primary);
  letter-spacing: 0.02em;
  white-space: nowrap;
}
.quest-picker-pill--active {
  background: var(--color-amber-bg);
  color: var(--color-amber);
}
.quest-picker-pill--done {
  background: var(--color-primary-light);
  color: var(--color-primary);
}
.quest-picker-item svg { flex: none; color: var(--color-text-muted); }

/* ── Quest progress card ──────────────── */
.quest-progress-card {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.quest-progress-card-left { flex: 1; min-width: 0; }
.quest-progress-card-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--color-text);
  margin-bottom: var(--space-1);
}
.quest-progress-card-sub {
  font-size: 12px;
  color: var(--color-text-muted);
  margin-bottom: var(--space-2);
}
.quest-progress-card-bar {
  height: 5px;
  border-radius: 999px;
  background: var(--color-divider);
  overflow: hidden;
}
.quest-progress-card-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--color-primary), var(--color-primary-hover));
  border-radius: 999px;
  transition: width 0.4s ease;
}
.quest-progress-ring {
  flex: none;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: conic-gradient(var(--color-primary) calc(var(--p, 0) * 1%), var(--color-divider) 0);
  display: grid;
  place-items: center;
  position: relative;
  transition: background 0.4s ease;
}
.quest-progress-ring::after {
  content: "";
  position: absolute;
  inset: 6px;
  background: var(--color-surface-2);
  border-radius: 50%;
}
.quest-progress-ring-pct {
  position: relative;
  z-index: 1;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 12px;
  color: var(--color-primary);
}

/* ── Task emoji icon ──────────────────── */
.quest-task-icon {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  background: var(--color-primary-light);
  display: grid;
  place-items: center;
  font-size: 16px;
  transition: background var(--trans);
}
.quest-task.done .quest-task-icon { background: transparent; }
