/* ─── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Produce palette */
  --cream:     #faf8f4;
  --cream-dk:  #f0ebe3;
  --ink:       #1c1b18;
  --ink-muted: #5c5a54;
  --leaf:      #2d6a4f;
  --leaf-lt:   #d8f3dc;
  --leaf-dim:  #40916c;
  --leaf-dark: #1b4332;

  /* Explorer (dark panel for contrast with map) */
  --bg:        #141412;
  --surface:   #1c1c1a;
  --border:    #2e2e2a;
  --border-lt: #3d3d38;
  --text:      #f5f3ee;
  --text-muted:#8a877e;
  --accent:    var(--leaf);
  --accent-dim:var(--leaf-dark);

  --snap:      #3b82f6;
  --foodbank:  #f97316;
  --meal:            #eab308;
  --meal-under18:    #ec4899;
  --wic:       #a855f7;

  --radius-sm: 6px;
  --radius-md: 10px;
  --sidebar-w: 320px;
  --transition: 0.18s ease;
}

html {
  scroll-behavior: auto;
}

@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }
}

html, body {
  min-height: 100%;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--ink);
  font-size: 14px;
  overflow-x: hidden;
}

body.page-home {
  -webkit-overflow-scrolling: touch;
}

.page-home .home-stats,
.page-home .home-how,
.page-home .home-preview,
.page-home .home-reach,
.page-home .home-closing,
.page-home .food-divider {
  contain: paint;
}

/* ─── Hero (landing) ────────────────────────────────────────── */
#hero {
  position: relative;
  background: var(--cream);
  overflow: hidden;
}

#hero-nav {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: clamp(18px, 3vw, 28px) clamp(20px, 5vw, 48px);
  isolation: isolate;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--leaf);
}

.nav-sprout {
  flex-shrink: 0;
  color: var(--leaf);
}

.nav-beanstalk-soil {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
  opacity: 0.32;
}

.nav-beanstalk-stem {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
}

.nav-beanstalk-vine {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.05;
  stroke-linecap: round;
  opacity: 0.62;
}

.nav-beanstalk-leaf {
  fill: rgba(216, 243, 220, 0.55);
  stroke: currentColor;
  stroke-width: 1.1;
  stroke-linejoin: round;
}

.nav-beanstalk-bean {
  fill: rgba(64, 145, 108, 0.38);
  stroke: currentColor;
  stroke-width: 0.85;
}

.nav-beanstalk-tendril {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.15;
  stroke-linecap: round;
}

.nav-logo-text {
  font-family: 'Syne', sans-serif;
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: clamp(12px, 2.5vw, 28px);
  flex-shrink: 0;
}

.nav-link {
  font-size: clamp(12px, 1.5vw, 13px);
  font-weight: 500;
  color: var(--ink-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.nav-link:hover { color: var(--ink); }

.nav-btn {
  font-size: clamp(11px, 1.4vw, 12px);
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--leaf);
  text-decoration: none;
  padding: clamp(6px, 1vw, 8px) clamp(14px, 2vw, 18px);
  border: 1px solid var(--leaf);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition);
  white-space: nowrap;
}

.nav-btn:hover {
  background: var(--leaf);
  color: var(--cream);
}

#hero-inner {
  --hero-pad-x: clamp(20px, 5vw, 48px);
  --hero-pad-top: clamp(112px, 16vw, 156px);
  --hero-scroll-reserve: clamp(52px, 9vw, 88px);
  --hero-stack-gap: clamp(20px, 3.5vw, 36px);
  --hero-map-gap-top: clamp(0.875rem, 2vw, 1.65rem);
  --hero-footer-pad-x: clamp(24px, 8vw, 112px);
  --hero-content-max: min(72rem, calc(100% - var(--hero-pad-x) * 2));
  --hero-title-max: min(35rem, 100%);
  --hero-map-max-width: min(70rem, 100%);
  --hero-subtitle-max: min(57.5rem, 100%);
  --hero-quote-max: min(25rem, 100%);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: var(--hero-pad-top);
  padding-bottom: 16px;
  padding-left: max(var(--hero-pad-x), env(safe-area-inset-left, 0px));
  padding-right: max(var(--hero-pad-x), env(safe-area-inset-right, 0px));
  --hero-side-pad: var(--hero-pad-x);
}

#hero-copy {
  position: relative;
  z-index: 10;
  width: 100%;
  max-width: var(--hero-content-max);
  margin-inline: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  isolation: isolate;
  overflow: visible;
}

.hero-heading {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0;
}

.hero-title-cluster {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  width: var(--hero-title-max);
  max-width: 100%;
  container-type: inline-size;
}

.hero-title .cursive-fallback,
.hero-title .hero-title-fallback {
  font-size: clamp(4.5rem, 34cqi, 9rem);
}

.hero-presenting {
  align-self: flex-start;
  margin: 0 0 0.25rem 0.5rem;
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--leaf);
}

.hero-title {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  margin: 0;
}

.hero-title.is-loading {
  min-height: clamp(5rem, 12vw, 9.5rem);
}

.hero-title .cursive-svg {
  width: 100%;
  max-width: var(--hero-title-max);
  margin-inline: auto;
}

.hero-title .cursive-fallback {
  left: 50%;
  transform: translateX(-50%);
}

.hero-title.cursive-text.is-fallback .cursive-fallback,
.hero-title.is-fallback .cursive-fallback {
  position: static;
  transform: none;
}

.cursive-svg,
.hero-title-svg {
  display: block;
  width: 100%;
  max-width: var(--hero-title-max, 35rem);
  height: auto;
  overflow: visible;
  opacity: 1;
  transition: opacity 0.25s ease;
}

.cursive-text.is-loading .cursive-svg,
.hero-title.is-loading:not(.is-cursive-ready) .cursive-svg,
.hero-title.is-loading:not(.is-cursive-ready) .hero-title-svg {
  opacity: 0;
}

.cursive-letter,
.hero-title-letter {
  fill: var(--leaf);
  stroke: none;
}

.cursive-fallback,
.hero-title-fallback {
  position: absolute;
  left: 0;
  top: 0;
  font-family: 'Allura', cursive;
  font-size: clamp(5rem, 13vw, 9rem);
  font-weight: 400;
  line-height: 1;
  color: var(--leaf);
  opacity: 0;
  pointer-events: none;
}

.cursive-text.is-fallback .cursive-fallback,
.hero-title.is-fallback .cursive-fallback,
.hero-title.is-fallback .hero-title-fallback {
  position: static;
  opacity: 1;
  pointer-events: auto;
}

.cursive-text.is-fallback .cursive-svg,
.hero-title.is-fallback .cursive-svg,
.hero-title.is-fallback .hero-title-svg {
  display: none;
}

.cursive-text--stat {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: 100%;
  min-height: clamp(4.75rem, 11vw, 6.75rem);
  margin: 0 auto 14px;
}

.cursive-text--stat .cursive-svg {
  display: block;
  width: auto;
  height: auto;
  max-width: min(100%, 340px);
  max-height: clamp(5rem, 12vw, 7.25rem);
  transform: scaleX(1.06);
  transform-origin: center center;
}

.cursive-text--stat .cursive-fallback {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: clamp(3.25rem, 8.5vw, 4.75rem);
  white-space: nowrap;
}

.cursive-text--stat.is-fallback .cursive-fallback {
  position: absolute;
  transform: translate(-50%, -50%);
}

.food-divider {
  background: var(--cream);
  line-height: 0;
  padding: 4px 24px 16px;
  overflow: hidden;
}

@media (prefers-reduced-motion: no-preference) {
  .food-divider[data-reveal] {
    opacity: 0;
    transition: opacity 0.55s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--reveal-delay, 0ms));
  }

  .food-divider[data-reveal].is-revealed {
    opacity: 1;
  }
}

.food-divider-img {
  display: block;
  width: 100%;
  max-width: 1100px;
  height: auto;
  min-height: 64px;
  max-height: 96px;
  margin: 0 auto;
  object-fit: contain;
  object-position: center;
}

[data-motion-group] {
  transform: translateZ(0);
  backface-visibility: hidden;
}

#hero [data-motion-group] {
  transform: none;
  backface-visibility: visible;
}

/* ─── Scroll reveal ─────────────────────────────────────────────── */
@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    transition: opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1);
    transition-delay: calc(var(--reveal-delay, 0ms));
    will-change: opacity;
  }

  [data-reveal].is-revealed {
    opacity: 1;
    will-change: auto;
  }

  [data-reveal-group]:not(.is-revealed) > * {
    opacity: 0;
  }

  [data-reveal-group].is-revealed > * {
    opacity: 1;
    transition: opacity 0.6s cubic-bezier(0.22, 1, 0.36, 1);
  }

  [data-reveal-group].is-revealed > *:nth-child(1) { transition-delay: 0ms; }
  [data-reveal-group].is-revealed > *:nth-child(2) { transition-delay: 80ms; }
  [data-reveal-group].is-revealed > *:nth-child(3) { transition-delay: 160ms; }
  [data-reveal-group].is-revealed > *:nth-child(4) { transition-delay: 240ms; }
  [data-reveal-group].is-revealed > *:nth-child(5) { transition-delay: 320ms; }
  [data-reveal-group].is-revealed > *:nth-child(6) { transition-delay: 400ms; }
  [data-reveal-group].is-revealed > *:nth-child(7) { transition-delay: 480ms; }
  [data-reveal-group].is-revealed > *:nth-child(8) { transition-delay: 560ms; }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] {
    opacity: 1;
  }

  [data-reveal-group]:not(.is-revealed) > * {
    opacity: 1;
    transform: none;
  }
}

[data-reveal][data-reveal-delay='1'] { --reveal-delay: 80ms; }
[data-reveal][data-reveal-delay='2'] { --reveal-delay: 160ms; }
[data-reveal][data-reveal-delay='3'] { --reveal-delay: 240ms; }
[data-reveal][data-reveal-delay='4'] { --reveal-delay: 320ms; }
[data-reveal][data-reveal-delay='5'] { --reveal-delay: 400ms; }

/* Pause decorative loops when off-screen or while scrolling */
.motion-paused,
.motion-paused *,
html.is-scrolling .home-reach-ticker-track,
html.is-scrolling .hero-dot,
html.is-scrolling .hero-map-shimmer,
html.is-scrolling .typewriter-cursor {
  animation-play-state: paused !important;
}

.cursive-text.is-fallback.is-loading .cursive-fallback,
.hero-title.is-fallback.is-loading .cursive-fallback,
.hero-title.is-fallback.is-loading .hero-title-fallback {
  opacity: 1;
}

.hero-subtitle {
  font-size: clamp(0.9375rem, 1rem + 0.15vw, 1.15rem);
  line-height: 1.65;
  color: var(--ink-muted);
  width: 100%;
  max-width: var(--hero-subtitle-max);
  margin: 0 auto var(--hero-stack-gap);
  font-weight: 400;
  text-align: center;
}

.hero-subtitle strong {
  color: var(--ink);
  font-weight: 600;
}

.hero-nearby-count {
  margin: -12px auto 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--leaf);
  letter-spacing: 0.02em;
  text-align: center;
}

.hero-footer {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: clamp(12px, 2.5vw, 28px);
  width: 100%;
  max-width: var(--hero-map-max-width);
  margin-inline: auto;
  padding-inline: var(--hero-footer-pad-x);
  box-sizing: border-box;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  font-size: clamp(12px, 1.5vw, 13px);
  font-weight: 600;
  color: var(--leaf);
  text-decoration: none;
  padding: clamp(10px, 1.5vw, 12px) clamp(16px, 2.5vw, 22px);
  border: 1px solid var(--leaf);
  border-radius: var(--radius-sm);
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}

.hero-cta:hover {
  background: var(--leaf);
  color: var(--cream);
  box-shadow: 0 8px 28px rgba(45, 106, 79, 0.28);
}

.hero-quote {
  position: relative;
  z-index: 12;
  flex: 0 1 25rem;
  min-width: 0;
  width: auto;
  max-width: var(--hero-quote-max);
  align-self: center;
  margin: 0;
  padding: 0 0 0 10px;
  border: none;
  border-left: 2px solid rgba(45, 106, 79, 0.35);
  box-sizing: border-box;
  text-align: left;
}

.hero-quote-text {
  margin: 0;
  font-size: clamp(0.8125rem, 0.85rem + 0.12vw, 0.975rem);
  line-height: 1.65;
  font-style: italic;
  color: var(--ink-muted);
  font-weight: 400;
  width: 100%;
  max-width: 100%;
}

#hero-map-wrap {
  position: relative;
  z-index: 5;
  width: var(--hero-map-max-width);
  aspect-ratio: 838 / 498;
  height: auto;
  margin: var(--hero-map-gap-top) auto var(--hero-stack-gap);
  display: flex;
  justify-content: center;
  align-items: center;
}

#hero-map {
  position: relative;
  width: 100%;
  height: 100%;
  cursor: default;
}

.hero-map-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
  object-position: center center;
  pointer-events: none;
  user-select: none;
  -webkit-user-drag: none;
}

#hero-map.is-map-loading {
  background: var(--leaf-lt);
}

.hero-map-placeholder {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.hero-map-placeholder-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.hero-map-placeholder-state {
  fill: var(--leaf-lt);
  stroke: rgba(45, 106, 79, 0.35);
  stroke-width: 0.6;
}

.hero-map-shimmer {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    105deg,
    transparent 0%,
    transparent 40%,
    rgba(255, 255, 255, 0.42) 50%,
    transparent 60%,
    transparent 100%
  );
  background-size: 220% 100%;
  animation: hero-map-shimmer 1.8s ease-in-out infinite;
}

@keyframes hero-map-shimmer {
  0% {
    background-position: 120% 0;
  }
  100% {
    background-position: -120% 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero-map-shimmer {
    animation: none;
    opacity: 0.2;
  }
}

#hero-map:not(.is-map-loading) .hero-map-placeholder {
  display: none;
}

#hero-map svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-state {
  fill: var(--leaf-lt);
  stroke: rgba(45, 106, 79, 0.35);
  stroke-width: 0.6;
  transition: fill 0.2s ease, stroke 0.2s ease, stroke-width 0.2s ease;
  cursor: pointer;
  outline: none;
}

.hero-state.is-hovered,
.hero-state:focus-visible {
  fill: #b7e4c7;
  stroke: var(--leaf);
  stroke-width: 1.4;
}

.hero-dot {
  fill: var(--leaf-dim);
  opacity: 0.55;
  animation: dot-twinkle 3s ease-in-out infinite;
}

@keyframes dot-twinkle {
  0%, 100% { opacity: 0.35; }
  50% { opacity: 0.95; }
}

.hero-map-tooltip {
  position: absolute;
  z-index: 30;
  pointer-events: none;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
  color: var(--cream);
  background: var(--leaf);
  border-radius: var(--radius-sm);
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(28, 27, 24, 0.15);
}

.hero-map-tooltip.hidden { display: none; }

.hero-map-fallback {
  padding: 40px;
  color: var(--ink-muted);
  font-size: 14px;
}

.hero-scroll {
  position: absolute;
  right: clamp(16px, 4vw, 40px);
  bottom: clamp(20px, 3vw, 36px);
  z-index: 15;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink-muted);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.2em;
  transition: color var(--transition);
}

.hero-scroll:hover { color: var(--leaf); }

.hero-scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--leaf), transparent);
}

.hero-scroll-label {
  writing-mode: vertical-rl;
  text-orientation: mixed;
}

/* ─── Home stats band ─────────────────────────────────────────── */
.home-stats {
  background: var(--cream);
  color: var(--ink);
  padding: 56px 48px 64px;
}

.home-stats-inner,
.home-reach-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.stat-card {
  --tilt-x: 0deg;
  --tilt-y: 0deg;
  --pointer-x: 50%;
  --pointer-y: 50%;
  --shadow-x: 0px;
  --shadow-y: 10px;
  --shade-angle: 135deg;
  position: relative;
  overflow: hidden;
  isolation: isolate;
  appearance: none;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 26px 20px 22px;
  border: 1.5px solid color-mix(in srgb, var(--leaf) 52%, transparent);
  border-radius: 16px;
  background: linear-gradient(160deg, #ffffff 0%, var(--cream-dk) 100%);
  box-shadow: var(--shadow-x) var(--shadow-y) 28px rgba(45, 106, 79, 0.14);
  cursor: pointer;
  text-align: center;
  font-family: inherit;
  color: inherit;
  transform: perspective(1100px) rotateX(var(--tilt-x)) rotateY(var(--tilt-y)) translateZ(0);
  backface-visibility: hidden;
  transition:
    box-shadow 0.35s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.25s ease;
}

.stat-card.is-hovering {
  will-change: transform, box-shadow;
  transition:
    transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
    box-shadow 0.2s ease,
    border-color 0.25s ease;
}

.stat-card::before,
.stat-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}

/* Bright green highlight under the cursor */
.stat-card::before {
  z-index: 0;
  background: radial-gradient(
    circle 120% at var(--pointer-x) var(--pointer-y),
    rgba(216, 243, 220, 0.75) 0%,
    rgba(64, 145, 108, 0.28) 32%,
    transparent 62%
  );
}

/* Darker leaf shade on the opposite side for depth */
.stat-card::after {
  z-index: 0;
  background: linear-gradient(
    var(--shade-angle),
    rgba(27, 67, 50, 0.22) 0%,
    rgba(45, 106, 79, 0.08) 38%,
    transparent 58%
  );
}

.stat-card.is-hovering {
  border-color: color-mix(in srgb, var(--leaf) 78%, transparent);
  box-shadow:
    var(--shadow-x) var(--shadow-y) 36px rgba(45, 106, 79, 0.26),
    inset 0 1px 0 rgba(255, 255, 255, 0.85);
}

.stat-card.is-hovering::before,
.stat-card.is-hovering::after {
  opacity: 1;
}

.stat-card:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 3px;
}

.stat-card-inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.home-stat-value,
.home-reach-value {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  min-height: clamp(5rem, 12vw, 7.25rem);
}

.stat-card-caption {
  display: block;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-muted);
  max-width: 280px;
}

.home-stats-source {
  max-width: 1100px;
  margin: 40px auto 0;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
  opacity: 0.75;
  text-align: center;
}

@media (max-width: 900px) {
  .home-stats {
    padding: 56px 24px 40px;
  }

  .home-stats-inner,
  .home-reach-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .stat-card-caption {
    max-width: none;
  }
}

/* ─── Home how-it-works ───────────────────────────────────────── */
.home-how {
  background: var(--cream);
  color: var(--ink);
  padding: 56px 48px 80px;
}

.home-how-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.home-how-header {
  margin-bottom: 56px;
  max-width: 640px;
}

.home-how-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--leaf);
  margin-bottom: 28px;
}

.home-how-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: var(--leaf);
  opacity: 0.55;
}

.home-how-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2.25rem, 5.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.home-how-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
}

.home-how-step {
  padding: 0 32px 8px;
  border-right: 1px solid rgba(45, 106, 79, 0.18);
}

.home-how-step:first-child {
  padding-left: 0;
}

.home-how-step:last-child {
  border-right: none;
  padding-right: 0;
}

.home-how-icon {
  color: var(--leaf);
  margin-bottom: 22px;
  line-height: 0;
}

.home-how-step-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  color: var(--leaf);
  margin-bottom: 14px;
}

.home-how-step-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 14px;
  letter-spacing: -0.02em;
}

.home-how-step-text {
  font-size: 14px;
  line-height: 1.65;
  color: var(--ink-muted);
  max-width: 300px;
}

.home-how-step-text.is-typewriter,
.hero-presenting.is-typewriter,
.hero-quote-text.is-typewriter {
  position: relative;
  width: 100%;
}

.hero-quote-text.is-typewriter .typewriter-spacer {
  width: 100%;
}

.typewriter-spacer {
  display: block;
  visibility: hidden;
  pointer-events: none;
  user-select: none;
}

.typewriter-live {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
}

.typewriter-output {
  white-space: pre-wrap;
}

.typewriter-cursor {
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 2px;
  vertical-align: text-bottom;
  background: var(--leaf);
  opacity: 0.85;
  animation: typewriter-blink 0.9s step-end infinite;
}

.typewriter-cursor.is-done {
  opacity: 0;
  animation: none;
}

@keyframes typewriter-blink {
  0%,
  100% {
    opacity: 0;
  }
  50% {
    opacity: 0.85;
  }
}

@media (prefers-reduced-motion: reduce) {
  .typewriter-cursor {
    display: none;
  }

  .home-how-step-text.is-typewriter .typewriter-live,
  .hero-presenting.is-typewriter .typewriter-live,
  .hero-quote-text.is-typewriter .typewriter-live {
    position: static;
  }
}

@media (max-width: 900px) {
  .home-how {
    padding: 56px 24px 64px;
  }

  .home-how-header {
    margin-bottom: 40px;
  }

  .home-how-grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .home-how-step {
    padding: 0 0 40px;
    border-right: none;
    border-bottom: 1px solid rgba(45, 106, 79, 0.18);
  }

  .home-how-step:last-child {
    border-bottom: none;
    padding-bottom: 0;
  }

  .home-how-step-text {
    max-width: none;
  }
}

/* ─── Home map preview (explorer sneak-peek) ──────────────────── */
.home-preview {
  background: var(--cream);
  padding: 56px 48px 80px;
}

.home-preview-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.home-preview-header {
  margin-bottom: 40px;
  max-width: 100%;
}

.home-preview-sub {
  font-size: clamp(11px, 1.05vw, 14px);
  color: var(--ink-muted);
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.home-preview-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--leaf);
  margin-bottom: 24px;
}

.home-preview-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: var(--leaf);
  opacity: 0.55;
}

.home-preview-title {
  font-family: 'Syne', sans-serif;
  font-size: clamp(2rem, 5vw, 3.25rem);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  color: var(--ink);
  margin-bottom: 14px;
}

.home-preview-mount {
  width: 100%;
}

.explorer-preview-shell {
  position: relative;
  width: 100%;
  border: 1px solid var(--border-lt);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(28, 27, 24, 0.12);
  background: var(--bg);
  contain: layout paint;
  transform: translateZ(0);
}

.explorer-preview-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1280 / 720;
}

/* ─── Home reach stats ────────────────────────────────────────── */
.home-reach {
  background: var(--cream);
  padding: 56px 48px 0;
}

.home-reach-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.home-reach-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--leaf);
  margin-bottom: 40px;
}

.home-reach-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 200px;
  height: 1px;
  background: var(--leaf);
  opacity: 0.55;
}

.home-reach-grid {
  padding-bottom: 32px;
}

.home-reach-source {
  margin: 0 0 8px;
  padding-bottom: 32px;
  border-bottom: 1px solid rgba(45, 106, 79, 0.18);
}

.home-reach-ticker {
  overflow: hidden;
  padding: 18px 0 22px;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  contain: paint;
  transform: translateZ(0);
}

.home-reach-ticker-track {
  display: flex;
  gap: 28px;
  width: max-content;
  animation: reach-ticker 36s linear infinite;
  transform: translateZ(0);
  backface-visibility: hidden;
}

.home-reach-ticker-track span {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-muted);
  white-space: nowrap;
  opacity: 0.7;
}

.home-reach-ticker-track span::after {
  content: '·';
  margin-left: 28px;
  opacity: 0.35;
}

@keyframes reach-ticker {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}

/* ─── Home closing ────────────────────────────────────────────── */
.home-closing {
  background: var(--cream);
  padding: 72px 48px 80px;
}

.home-closing-inner {
  max-width: 720px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-title--closing {
  margin-bottom: 20px;
  min-height: clamp(6rem, 16vw, 10rem);
  width: 100%;
  display: flex;
  justify-content: center;
}

.hero-title--closing .cursive-svg,
.hero-title--closing .hero-title-svg {
  width: min(100%, 680px);
  margin: 0 auto;
}

.hero-title--closing .cursive-fallback,
.hero-title--closing .hero-title-fallback {
  left: 50%;
  transform: translateX(-50%);
  font-size: clamp(5.5rem, 14vw, 10rem);
}

.hero-title--closing.is-fallback .cursive-fallback,
.hero-title--closing.is-fallback .hero-title-fallback {
  transform: translateX(-50%);
}

.home-closing-tagline {
  font-size: clamp(1rem, 2.2vw, 1.2rem);
  font-weight: 400;
  color: var(--ink-muted);
  margin-bottom: 32px;
  line-height: 1.5;
}

.home-closing-cta {
  display: inline-flex;
  font-size: 13px;
  font-weight: 600;
  color: var(--leaf);
  text-decoration: none;
  padding: 12px 24px;
  border: 1px solid var(--leaf);
  border-radius: var(--radius-sm);
  margin-bottom: 40px;
  transition: background var(--transition), color var(--transition), box-shadow var(--transition);
}

.home-closing-cta:hover {
  background: var(--leaf);
  color: var(--cream);
  box-shadow: 0 8px 28px rgba(45, 106, 79, 0.22);
}

.home-closing-footer {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-muted);
  opacity: 0.75;
}

@media (max-width: 900px) {
  .home-preview,
  .home-reach,
  .home-closing {
    padding-left: 24px;
    padding-right: 24px;
  }

  .home-preview {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  .home-reach {
    padding-top: 56px;
  }

  .home-closing {
    padding-top: 72px;
    padding-bottom: 56px;
  }

  .home-reach-grid {
    padding-bottom: 36px;
  }
}

/* ─── Explorer page ───────────────────────────────────────────── */
html.explorer-preview-embed,
html.explorer-preview-embed body.page-explorer {
  height: 720px;
  min-height: 720px;
  max-height: 720px;
  overflow: hidden;
}

html.explorer-preview-embed #app {
  height: 720px;
  min-height: 720px;
}

html.explorer-preview-embed body.page-explorer {
  pointer-events: none;
  user-select: none;
}

html.explorer-preview-embed .leaflet-control-zoom {
  display: none;
}

html.page-explorer,
body.page-explorer {
  height: 100%;
  overflow: hidden;
}

body.page-explorer {
  /* Explorer stays "light" by default; themes override variables at html[data-theme] */
  --bg: var(--cream);
  --surface: #ffffff;
  --border: color-mix(in srgb, var(--leaf) 20%, var(--cream-dk));
  --border-lt: color-mix(in srgb, var(--leaf) 32%, var(--cream-dk));
  --text: var(--ink);
  --text-muted: var(--ink-muted);
  --accent: var(--leaf);
  --accent-dim: var(--leaf-dark);
  --sidebar-w: 400px;
  --explorer-pad: 18px;
  background: var(--cream);
  color: var(--ink);
}

body.page-explorer #sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  box-shadow: 2px 0 24px rgba(45, 106, 79, 0.07);
  overflow: hidden;
  font-size: calc(14px * var(--text-scale));
}

body.page-explorer #sidebar-header {
  padding: 14px var(--explorer-pad) 12px;
  flex-shrink: 0;
}

body.page-explorer #search-section {
  padding: 14px var(--explorer-pad) 12px;
  flex-shrink: 0;
}

body.page-explorer #filter-section {
  padding: 12px var(--explorer-pad) 14px;
  flex-shrink: 0;
  border-bottom: 1px solid var(--border);
}

body.page-explorer .field-label {
  margin-bottom: 6px;
  font-size: 0.643em;
  letter-spacing: 1.1px;
}

body.page-explorer #zip-row {
  margin-bottom: 10px;
}

body.page-explorer #radius-row .field-label {
  margin-bottom: 5px;
}

body.page-explorer #filters {
  gap: 5px;
}

body.page-explorer .filter-item {
  font-size: 0.857em;
  line-height: 1.35;
  padding: 3px 0;
  gap: 7px;
}

body.page-explorer .scarcity-section {
  flex: 0 0 auto;
  padding: 12px var(--explorer-pad);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

body.page-explorer .scarcity-toggle {
  margin-top: 2px;
  padding: 8px 10px;
  gap: 8px;
}

body.page-explorer .scarcity-toggle-title {
  font-size: 0.857em;
}

body.page-explorer .scarcity-desc {
  margin-top: 6px;
  margin-left: 0;
  font-size: 0.714em;
  line-height: 1.4;
}

body.page-explorer .scarcity-legend {
  margin-top: 10px;
  padding: 10px 12px;
}

body.page-explorer .scarcity-legend-list {
  gap: 5px;
}

body.page-explorer .overlay-toggle-row {
  margin-top: 10px;
  padding-top: 10px;
}

body.page-explorer #results-section {
  flex: 1 1 auto;
  min-height: 0;
  padding: 12px var(--explorer-pad) 16px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.page-explorer #results-header {
  flex-shrink: 0;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  margin-bottom: 8px;
}

body.page-explorer .results-header-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

body.page-explorer .results-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

body.page-explorer .results-header-top .field-label {
  margin-bottom: 0;
}

body.page-explorer #results-count {
  font-size: 0.786em;
  font-weight: 600;
  text-align: right;
  flex-shrink: 0;
}

body.page-explorer .results-utility-btns {
  display: none;
  flex-wrap: wrap;
  gap: 6px;
}

body.page-explorer #results-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 2px;
  padding-bottom: 4px;
}

body.page-explorer #results-placeholder {
  padding: 16px 0;
  font-size: 0.857em;
}

body.page-explorer .result-card {
  padding: 10px 12px;
  margin-bottom: 6px;
}

body.page-explorer .result-name {
  font-size: 0.929em;
}

body.page-explorer .result-address {
  font-size: 0.786em;
  margin-top: 2px;
}

body.page-home {
  overflow-x: hidden;
}

.sidebar-home-link {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.sidebar-home-link:hover .logo-title {
  color: var(--leaf);
}

body.page-explorer .sidebar-home-link {
  color: var(--ink);
}

body.page-explorer .sidebar-sprout {
  flex-shrink: 0;
  color: var(--leaf);
}

.hero-map-fallback a {
  color: var(--leaf);
  font-weight: 600;
}

/* ─── Layout ────────────────────────────────────────────────── */
#app {
  display: flex;
  height: 100vh;
  height: 100dvh;
  width: 100%;
}

/* ─── Sidebar ───────────────────────────────────────────────── */
#sidebar {
  width: var(--sidebar-w);
  min-width: var(--sidebar-w);
  background: var(--surface);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  z-index: 10;
}

#sidebar-header {
  padding: 22px 20px 20px;
  border-bottom: 1px solid var(--border);
}

#logo-mark {
  width: 36px;
  height: 36px;
  background: var(--leaf);
  color: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 800;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}

body.page-explorer #logo-mark {
  display: none;
}

#logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-title {
  font-family: 'Syne', sans-serif;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.3px;
}

body.page-explorer .logo-title {
  color: var(--leaf);
  font-size: 1.214em;
}

body.page-explorer .logo-sub {
  font-size: 0.786em;
}

body.page-explorer .sidebar-nav-link {
  font-size: 0.857em;
}

body.page-explorer #address-input {
  font-size: 1.071em;
}

body.page-explorer #address-input::placeholder,
body.page-explorer #zip-input::placeholder {
  font-size: 0.929em;
}

body.page-explorer .input-error {
  font-size: 0.786em;
}

body.page-explorer .search-status {
  font-size: 0.857em;
}

body.page-explorer #search-btn {
  font-size: 0.857em;
}

body.page-explorer .radius-btn {
  font-size: 0.786em;
}

body.page-explorer .result-badge {
  font-size: 0.714em;
}

body.page-explorer .result-dist {
  font-size: 0.786em;
}

body.page-explorer .copy-link-btn {
  font-size: 0.786em;
}

body.page-explorer .pref-btn {
  font-size: 0.786em;
}

.logo-sub {
  font-size: 11px;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* ─── Search ────────────────────────────────────────────────── */
#search-section {
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.field-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  text-transform: uppercase;
  display: block;
  margin-bottom: 8px;
}

#zip-row {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

#zip-input,
#address-input {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-family: 'DM Sans', sans-serif;
  font-size: 15px;
  font-weight: 500;
  padding: 9px 12px;
  outline: none;
  transition: border-color var(--transition);
}

#zip-input {
  letter-spacing: 2px;
}

#zip-input:focus,
#address-input:focus {
  border-color: var(--accent);
}

#zip-input::placeholder {
  color: var(--text-muted);
  letter-spacing: 1px;
  font-size: 13px;
}

#address-input::placeholder {
  color: var(--text-muted);
  font-size: 13px;
}

.input-error {
  display: block;
  font-size: 11px;
  color: #dc2626;
  margin-top: 4px;
  line-height: 1.4;
}

.address-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 4px;
}

.address-label-row .field-label {
  margin-bottom: 0;
  line-height: 1.2;
}

.locate-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  font-family: 'DM Sans', sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--leaf) 6%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--leaf) 28%, var(--border));
  border-radius: var(--radius-sm);
  padding: 4px 8px;
  cursor: pointer;
  line-height: 1.2;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
  flex-shrink: 0;
}

body.page-explorer .address-label-row .field-label,
body.page-explorer .address-label-row .locate-btn {
  font-size: 0.643em;
  letter-spacing: 1.1px;
  line-height: 1.2;
}

body.page-explorer .address-label-row .locate-btn {
  padding: 0.35em 0.75em;
}

body.page-explorer .locate-btn-icon svg {
  width: 1.15em;
  height: 1.15em;
}

.locate-btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--leaf);
}

.locate-btn:hover {
  color: var(--text);
  background: color-mix(in srgb, var(--leaf) 12%, var(--bg));
  border-color: color-mix(in srgb, var(--leaf) 42%, var(--border));
}

.locate-btn:disabled {
  color: var(--text-muted);
  background: var(--bg);
  border-color: var(--border-lt);
  cursor: not-allowed;
}

.locate-btn:disabled .locate-btn-icon {
  color: #9ca3af;
}

#search-btn {
  background: var(--accent);
  color: var(--bg);
  border: none;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  padding: 9px 16px;
  cursor: pointer;
  letter-spacing: 0.3px;
  transition: background var(--transition), transform 0.1s;
}

body.page-explorer #search-btn {
  color: var(--cream);
}

#search-btn:hover { background: var(--accent-dim); }
#search-btn:active { transform: scale(0.97); }

body.page-explorer #search-btn:disabled {
  opacity: 0.65;
  cursor: not-allowed;
}

#radius-row { }

#radius-options {
  display: flex;
  gap: 6px;
}

.radius-btn {
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  padding: 6px 0;
  cursor: pointer;
  transition: all var(--transition);
}

.radius-btn:hover {
  border-color: var(--accent);
  color: var(--text);
}

.radius-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--bg);
  font-weight: 600;
}

body.page-explorer .radius-btn.active {
  color: var(--cream);
}

/* ─── Filters ───────────────────────────────────────────────── */
#filter-section {
  padding: 16px 20px;
}

#filters {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-item {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text);
  font-size: 13px;
  font-weight: 400;
  user-select: none;
  padding: 2px 0;
}

.filter-item input[type="checkbox"] {
  display: none;
}

.filter-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: opacity var(--transition);
}

.snap-dot     { background: var(--snap); }
.foodbank-dot { background: var(--foodbank); }
.meal-all-dot      { background: var(--meal); }
.meal-under18-dot  { background: var(--meal-under18); }
.wic-dot           { background: var(--wic); }

.filter-item input:not(:checked) ~ .filter-dot {
  opacity: 0.25;
}

.filter-item input:not(:checked) ~ span:last-child {
  color: var(--text-muted);
}

.sidebar-data-note {
  margin: 4px 0 0 18px;
  font-size: 10px;
  color: var(--ink-muted);
  line-height: 1.4;
}

body.page-explorer .sidebar-data-note {
  color: var(--ink-muted);
}

/* ─── Food scarcity tracker ─────────────────────────────────── */
.scarcity-section {
  flex: 0 0 auto;
  padding: 18px 20px 24px;
  border-top: 1px solid var(--border);
}

.scarcity-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 10px 12px;
  margin-top: 4px;
  border-radius: var(--radius-md);
  border: 1px solid color-mix(in srgb, var(--leaf) 22%, var(--border));
  background: color-mix(in srgb, var(--leaf) 6%, var(--bg));
  transition: border-color var(--transition), background var(--transition);
}

.scarcity-toggle:hover {
  border-color: color-mix(in srgb, var(--leaf) 40%, var(--border));
  background: color-mix(in srgb, var(--leaf) 10%, var(--bg));
}

.scarcity-toggle-input {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--leaf);
  cursor: pointer;
  flex-shrink: 0;
}

.scarcity-toggle-title {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.01em;
}

.scarcity-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  background: #dc2626;
  color: #fff;
  padding: 3px 6px;
  border-radius: 4px;
  flex-shrink: 0;
}

.scarcity-desc {
  margin: 10px 0 0;
  padding-left: 2px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--text-muted);
}

.scarcity-legend {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border-lt);
}

.scarcity-legend.hidden,
.scarcity-legend[hidden] {
  display: none;
}

.scarcity-legend-heading {
  margin: 0 0 10px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scarcity-legend-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 7px;
}

.scarcity-legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  color: var(--text);
  line-height: 1.3;
}

.scarcity-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}

.scarcity-source {
  margin: 12px 0 0;
  font-size: 10px;
  line-height: 1.45;
  color: var(--text-muted);
}

.scarcity-source a {
  color: var(--leaf);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.scarcity-source a:hover {
  color: var(--accent-dim);
}

.search-status {
  margin: 0 0 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--text-muted);
}

.search-status:not([hidden]) {
  display: block;
}

.search-status p {
  margin: 0;
}

/* ─── Results ───────────────────────────────────────────────── */
#results-section {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 16px 20px 0;
}

#results-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
  gap: 8px;
  flex-shrink: 0;
}

.results-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex: 1;
}

.results-utility-btns {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.copy-link-btn {
  background: transparent;
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 500;
  padding: 4px 8px;
  cursor: pointer;
  transition: color var(--transition), border-color var(--transition);
}

.copy-link-btn:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--leaf) 35%, var(--border-lt));
}

body.page-explorer .copy-link-btn:hover {
  color: var(--leaf);
}

#results-count {
  font-size: 12px;
  color: var(--accent);
  font-weight: 600;
}

body.page-explorer #results-count {
  color: var(--leaf);
}

#results-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding-right: 4px;
  padding-bottom: 12px;
}

#results-list::-webkit-scrollbar { width: 4px; }
#results-list::-webkit-scrollbar-track { background: transparent; }
#results-list::-webkit-scrollbar-thumb { background: var(--border-lt); border-radius: 2px; }

#results-placeholder {
  padding: 24px 0;
  color: var(--text-muted);
  font-size: 13px;
  line-height: 1.6;
}

.result-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: border-color var(--transition), transform 0.1s;
  position: relative;
  overflow: hidden;
}

.result-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
}

.result-card.snap::before     { background: var(--snap); }
.result-card.foodbank::before { background: var(--foodbank); }
.result-card.meal-all::before      { background: var(--meal); }
.result-card.meal-under18::before  { background: var(--meal-under18); }
.result-card.wic::before           { background: var(--wic); }

body.page-explorer .result-card {
  background: #ffffff;
  box-shadow: 0 2px 10px rgba(45, 106, 79, 0.06);
}

.result-card:hover {
  border-color: var(--border-lt);
  transform: translateX(2px);
}

body.page-explorer .result-card:hover {
  border-color: color-mix(in srgb, var(--leaf) 45%, var(--cream-dk));
}

.result-card.active {
  border-color: var(--accent);
}

.result-card:focus-visible {
  outline: 2px solid var(--leaf);
  outline-offset: 3px;
}

.result-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 3px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-address {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.result-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
}

.result-badge {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  padding: 2px 6px;
  border-radius: 3px;
  text-transform: uppercase;
}

.badge-snap     { background: rgba(59,130,246,0.15); color: var(--snap); }
.badge-foodbank { background: rgba(249,115,22,0.15); color: var(--foodbank); }
.badge-meal-all     { background: rgba(234,179,8,0.15); color: var(--meal); }
.badge-meal-under18 { background: rgba(236,72,153,0.15); color: var(--meal-under18); }
.badge-wic          { background: rgba(168,85,247,0.15); color: var(--wic); }

.result-dist {
  font-size: 11px;
  color: var(--text-muted);
  margin-left: auto;
}

/* ─── Footer ────────────────────────────────────────────────── */
#sidebar-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.7;
}

/* ─── Map ───────────────────────────────────────────────────── */
#map-container {
  flex: 1;
  position: relative;
  overflow: hidden;
}

body.page-explorer #map-container {
  padding: 18px 20px 20px;
  background: var(--cream);
}

#map {
  width: 100%;
  height: 100%;
  background: #1a1a18;
}

body.page-explorer #map {
  background: var(--cream-dk);
  border: 1.5px solid color-mix(in srgb, var(--leaf) 52%, transparent);
  border-radius: 16px;
  overflow: hidden;
  box-shadow:
    0 8px 28px rgba(45, 106, 79, 0.14),
    inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

.map-boot-error {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-height: 240px;
  padding: 24px;
  box-sizing: border-box;
  text-align: center;
  font-size: 14px;
  line-height: 1.6;
  color: var(--ink-muted);
  background: var(--cream-dk);
}

.map-boot-error code {
  font-size: 12px;
  color: var(--ink);
}

/* Dark map tiles via CSS filter (legacy; explorer uses natural tiles) */
.leaflet-tile-pane { filter: brightness(0.45) saturate(0.4) hue-rotate(180deg) invert(1); }

body.page-explorer .leaflet-tile-pane {
  filter: none;
}

/* ─── Stats Bar ─────────────────────────────────────────────── */
#stats-bar {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: 40px;
  display: flex;
  align-items: center;
  padding: 10px 24px;
  gap: 20px;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

body.page-explorer #stats-bar {
  bottom: 36px;
  border-color: color-mix(in srgb, var(--leaf) 35%, var(--cream-dk));
  box-shadow: 0 8px 28px rgba(45, 106, 79, 0.16);
}

body.page-explorer .stat-num {
  color: var(--leaf);
}

#stats-bar.hidden { display: none; }

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}

.stat-num {
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}

.stat-label {
  font-size: 10px;
  font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  white-space: nowrap;
}

.stat-divider {
  width: 1px;
  height: 28px;
  background: var(--border);
}

/* ─── Detail Panel ──────────────────────────────────────────── */
#detail-panel {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-md);
  padding: 20px;
  z-index: 500;
  box-shadow: 0 8px 32px rgba(0,0,0,0.5);
  animation: slideIn 0.18s ease;
}

body.page-explorer #detail-panel {
  top: 36px;
  right: 36px;
  border-color: color-mix(in srgb, var(--leaf) 35%, var(--cream-dk));
  box-shadow: 0 8px 28px rgba(45, 106, 79, 0.16);
}

@keyframes slideIn {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

#detail-panel.hidden { display: none; }

#detail-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 20px;
  cursor: pointer;
  line-height: 1;
  padding: 0;
}

#detail-close:hover { color: var(--text); }

#detail-type-badge {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 8px;
}

#detail-name {
  font-family: 'Syne', sans-serif;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.2;
  padding-right: 20px;
}

#detail-address {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 12px;
  line-height: 1.5;
}

#detail-meta {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.detail-meta-row {
  display: flex;
  gap: 8px;
  font-size: 12px;
}

.detail-meta-key {
  color: var(--text-muted);
  min-width: 70px;
}

.detail-meta-val {
  color: var(--text);
  font-weight: 500;
}

#detail-actions {
  display: flex;
  gap: 8px;
}

.detail-btn {
  flex: 1;
  padding: 8px 0;
  border-radius: var(--radius-sm);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
  display: block;
  transition: opacity var(--transition);
}

.detail-btn:hover { opacity: 0.8; }

.btn-primary {
  background: var(--accent);
  color: var(--bg);
  border: none;
}

body.page-explorer .btn-primary {
  color: var(--cream);
}

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

/* ─── Loading ───────────────────────────────────────────────── */
#loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(15,15,14,0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 600;
  backdrop-filter: blur(3px);
}

body.page-explorer #loading-overlay {
  background: rgba(250, 248, 244, 0.72);
}

#loading-overlay.hidden { display: none; }

#loading-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

#loading-spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--border-lt);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

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

#loading-text {
  font-size: 13px;
  color: var(--text-muted);
  letter-spacing: 0.3px;
}

/* ─── Leaflet overrides ─────────────────────────────────────── */
.leaflet-popup-content-wrapper {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border-lt);
  border-radius: var(--radius-md);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
}

body.page-explorer .leaflet-popup-content-wrapper {
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.14);
}

body.page-explorer .leaflet-control-zoom a {
  background: #ffffff !important;
  color: var(--ink) !important;
  border-color: color-mix(in srgb, var(--leaf) 28%, var(--cream-dk)) !important;
}

body.page-explorer .leaflet-control-zoom a:hover {
  background: var(--leaf-lt) !important;
}

body.page-explorer .leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.88) !important;
  color: var(--ink-muted) !important;
  max-width: min(220px, 42vw);
  line-height: 1.35;
  border-radius: 6px;
}

body.page-explorer .leaflet-bottom.leaflet-right {
  top: 10px;
  right: 10px;
  bottom: auto !important;
  left: auto !important;
}

.leaflet-popup-tip { background: var(--surface); }

.leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
  border-color: var(--border) !important;
}

.leaflet-control-zoom a:hover {
  background: var(--border) !important;
}

.leaflet-control-attribution {
  background: rgba(15,15,14,0.7) !important;
  color: var(--text-muted) !important;
  font-size: 9px !important;
}

.leaflet-control-attribution a { color: var(--text-muted) !important; }

.food-desert-tooltip {
  background: rgba(15, 15, 15, 0.92);
  border: 1px solid #333;
  border-radius: 6px;
  color: #fff;
  padding: 8px 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.food-desert-tooltip::before {
  display: none;
}

.food-desert-tooltip-inner {
  font-family: sans-serif;
  font-size: 12px;
  min-width: 180px;
  line-height: 1.6;
}

.food-desert-legend {
  font-size: 11px;
  line-height: 1.5;
  color: #374151;
  min-width: 180px;
}

.legend-title {
  font-weight: 600;
  font-size: 12px;
  margin-bottom: 6px;
  color: #111827;
}

.legend-subtitle {
  font-size: 10px;
  color: #9ca3af;
  margin-top: -4px;
  margin-bottom: 6px;
}

.legend-gradient-bar {
  height: 10px;
  border-radius: 4px;
  background: linear-gradient(to right, #4ade80, #facc15, #f97316, #dc2626);
  margin-bottom: 3px;
}

.legend-labels {
  display: flex;
  justify-content: space-between;
  font-size: 10px;
  color: #6b7280;
  margin-bottom: 8px;
}

.legend-labels--relative {
  align-items: center;
  gap: 6px;
}

.legend-labels-dots {
  flex: 1;
  text-align: center;
  letter-spacing: 0.12em;
  color: #d1d5db;
}

.legend-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 6px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
}

.legend-swatch {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-source {
  font-size: 10px;
  color: #9ca3af;
  margin-top: 4px;
}

/* ─── Custom markers ────────────────────────────────────────── */
.marker-icon {
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  border: 2px solid rgba(0,0,0,0.3);
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.marker-snap     { background: var(--snap); }
.marker-foodbank { background: var(--foodbank); }
.marker-meal-all     { background: var(--meal); }
.marker-meal-under18 { background: var(--meal-under18); }
.marker-wic          { background: var(--wic); }

.home-marker-wrap {
  background: transparent;
  border: none;
}

.home-marker {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #4ade80;
  border: 2.5px solid #ffffff;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  box-shadow: 0 3px 12px rgba(45, 106, 79, 0.35);
  color: #ffffff;
}

.home-marker svg {
  width: 16px;
  height: 16px;
  transform: rotate(45deg);
}

/* ─── Responsive ────────────────────────────────────────────── */
@media (max-width: 640px) {
  /* Mobile explorer layout — see Mobile explorer section at end of file */
  .drawer-toggle {
    display: none;
  }
}

/* ─── Info tooltips ──────────────────────────────────────────── */
.info-tooltip {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 5px;
  cursor: default;
  vertical-align: middle;
}

.info-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--leaf);
  color: #ffffff;
  font-size: 9px;
  font-weight: 700;
  font-style: normal;
  line-height: 1;
  flex-shrink: 0;
  transition: background 0.15s, transform 0.15s;
}

.info-tooltip:hover .info-icon,
.info-tooltip:focus .info-icon {
  background: var(--leaf-dark);
  transform: translateY(-0.5px);
}

.info-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #ffffff;
  color: var(--ink);
  font-size: 11px;
  font-weight: 400;
  font-style: normal;
  line-height: 1.5;
  padding: 7px 10px;
  border-radius: 6px;
  width: 220px;
  white-space: normal;
  z-index: 9999;
  pointer-events: none;
  border: 1px solid color-mix(in srgb, var(--leaf) 28%, #ffffff);
  box-shadow: 0 10px 24px rgba(45, 106, 79, 0.16);
}

/* Arrow pointing down from bubble */
.info-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 5px solid transparent;
  border-top-color: #ffffff;
}

.info-tooltip:hover .info-bubble,
.info-tooltip:focus .info-bubble {
  display: block;
}

/* If the tooltip is near the left edge, align bubble to the left */
.info-tooltip.align-left .info-bubble {
  left: 0;
  transform: none;
}
.info-tooltip.align-left .info-bubble::after {
  left: 14px;
  transform: none;
}

/* If the tooltip is near the right edge, align bubble to the right */
.info-tooltip.align-right .info-bubble {
  left: auto;
  right: 0;
  transform: none;
}
.info-tooltip.align-right .info-bubble::after {
  left: auto;
  right: 14px;
  transform: none;
}

/* ─── Transit overlay ───────────────────────────────────────── */
.overlay-toggle-row {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.popup-transit {
  margin-top: 8px;
  padding-top: 8px;
  border-top: 1px solid #e5e7eb;
  font-size: 12px;
  color: #6b7280;
  line-height: 1.5;
}

.popup-source-chip,
.source-chip {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.35);
  margin-top: 0;
}

.toggle-loading {
  font-size: 11px;
  color: #9ca3af;
  margin-left: 6px;
  font-style: italic;
}

.toggle-error {
  font-size: 11px;
  color: #dc2626;
  margin-left: 6px;
}

.toggle-warning {
  font-size: 11px;
  color: #b45309;
  margin-left: 6px;
  font-style: italic;
}

/* ─── Print export ────────────────────────────────────────────── */
@media print {
  #map-container,
  #loading-overlay,
  #detail-panel,
  #stats-bar,
  .leaflet-container {
    display: none !important;
  }

  #sidebar-header,
  #search-section,
  #filter-section,
  #scarcity-section,
  #results-header,
  .results-utility-btns,
  #copy-link-btn,
  #print-btn,
  #results-placeholder {
    display: none !important;
  }

  #app {
    display: block !important;
    height: auto !important;
  }

  #sidebar {
    width: 100% !important;
    min-width: 0 !important;
    max-width: none !important;
    border: none !important;
    box-shadow: none !important;
    overflow: visible !important;
    position: static !important;
    height: auto !important;
  }

  #results-section {
    display: block !important;
    flex: none !important;
    overflow: visible !important;
    padding: 0 !important;
  }

  #print-header {
    display: block !important;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #000;
  }

  #print-header h2 {
    font-size: 16px;
    margin: 0 0 4px;
    color: #000;
  }

  #print-header p {
    font-size: 12px;
    margin: 2px 0;
    color: #444;
  }

  #results-list {
    display: block !important;
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
  }

  .result-card {
    page-break-inside: avoid;
    border: none !important;
    border-bottom: 1px solid #ddd !important;
    border-radius: 0 !important;
    padding: 8px 0 !important;
    margin-bottom: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font-size: 12px;
  }

  .result-card::before {
    display: none !important;
  }

  .result-name {
    font-size: 13px;
    color: #000;
  }

  .result-address {
    color: #333;
  }

  .result-directions,
  .popup-transit {
    display: none !important;
  }

  @page {
    margin: 0.75in;
    size: letter portrait;
  }
}

.store-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 6px;
}

.store-type-grocery {
  background: #dcfce7;
  color: #166534;
}

.store-type-convenience {
  background: #fef9c3;
  color: #854d0e;
}

.store-type-warning {
  font-size: 11px;
  color: #92400e;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 4px;
  padding: 6px 8px;
  margin: 4px 0 6px;
  line-height: 1.4;
}

/* ─── Theme & font preferences ──────────────────────────────── */
html {
  --text-scale: 1;
}

html[data-font-scale="large"] {
  --text-scale: 1.143;
}

html[data-font-scale="xlarge"] {
  --text-scale: 1.286;
}

html[data-font-scale="large"] body {
  font-size: 16px;
}

html[data-font-scale="xlarge"] body {
  font-size: 18px;
}

html[data-theme="dark"].page-explorer,
html[data-theme="dark"] body.page-explorer {
  --bg: #141412;
  --surface: #1c1c1a;
  --border: #2e2e2a;
  --border-lt: #3d3d38;
  --text: #f5f3ee;
  --text-muted: #8a877e;
  --cream: #141412;
  --cream-dk: #1c1c1a;
  --ink: #f5f3ee;
  --ink-muted: #8a877e;
  background: #141412;
  color: #f5f3ee;
}

html[data-theme="dark"] body.page-explorer #sidebar {
  box-shadow: 2px 0 24px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] body.page-explorer .result-card {
  background: var(--surface);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}

html[data-theme="dark"] body.page-explorer #search-section,
html[data-theme="dark"] body.page-explorer #sidebar-header {
  background: var(--bg);
}

html[data-theme="dark"] body.page-explorer .leaflet-control-zoom a {
  background: var(--surface) !important;
  color: var(--text) !important;
}

html[data-theme="dark"] body.page-how-to {
  --cream: #141412;
  --cream-dk: #1c1c1a;
  --ink: #f5f3ee;
  --ink-muted: #8a877e;
  background: #141412;
  color: #f5f3ee;
}

.sidebar-nav-links {
  margin-top: 10px;
}

.sidebar-guide-row {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
  line-height: 1.2;
}

.sidebar-questions-label {
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  line-height: 1.2;
  white-space: nowrap;
}

body.page-explorer .sidebar-guide-row {
  font-size: 0.857em;
  line-height: 1.2;
}

body.page-explorer .sidebar-guide-row .sidebar-questions-label,
body.page-explorer .sidebar-guide-row .sidebar-nav-link {
  font-size: inherit;
  font-weight: 500;
  line-height: inherit;
}

.sidebar-questions-arrow {
  display: block;
  flex-shrink: 0;
  width: 0.9em;
  height: 0.9em;
  color: var(--leaf);
}

.sidebar-nav-link {
  font-size: 12px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color var(--transition);
}

.sidebar-nav-link:hover {
  color: var(--leaf);
}

body.page-explorer #sidebar-header {
  display: flex;
  flex-direction: column;
}

.pref-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.pref-btn {
  font-family: 'DM Sans', sans-serif;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  background: color-mix(in srgb, var(--leaf) 6%, var(--bg));
  border: 1px solid color-mix(in srgb, var(--leaf) 28%, var(--border));
  border-radius: var(--radius-sm);
  padding: 6px 10px;
  cursor: pointer;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
}

.pref-btn:hover,
.pref-btn.active {
  color: var(--leaf);
  border-color: color-mix(in srgb, var(--leaf) 45%, var(--border));
  background: color-mix(in srgb, var(--leaf) 12%, var(--bg));
}

.font-size-controls {
  display: inline-flex;
  gap: 4px;
}

.font-scale-btn {
  min-width: 34px;
  padding: 6px 8px;
}

body.page-explorer #sidebar-footer {
  flex-shrink: 0;
  position: relative;
  z-index: 5;
  padding: 12px var(--explorer-pad);
  border-top: 1px solid var(--border);
  background: var(--surface);
}

html[data-theme="dark"] body.page-explorer #sidebar-footer {
  background: var(--bg);
}

/* ─── Back to top ───────────────────────────────────────────── */
.back-to-top {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 1200;
  padding: 8px 12px;
  border: 1px solid color-mix(in srgb, var(--leaf) 35%, var(--border));
  border-radius: 999px;
  background: rgba(250, 248, 244, 0.72);
  color: var(--leaf);
  font-family: 'DM Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.12);
}

.back-to-top.is-visible {
  opacity: 0.72;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover,
.back-to-top:focus-visible {
  opacity: 1;
  background: rgba(250, 248, 244, 0.95);
  outline: none;
}

html[data-theme="dark"] .back-to-top {
  background: rgba(28, 28, 26, 0.82);
  color: var(--leaf-lt);
}

/* ─── Explorer help (map corner) ────────────────────────────── */
.explorer-help-anchor {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 1000;
}

.explorer-help-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid color-mix(in srgb, var(--leaf) 45%, var(--border));
  color: var(--leaf);
  font-family: 'Syne', sans-serif;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 18px rgba(45, 106, 79, 0.16);
  transition: background var(--transition), color var(--transition), border-color var(--transition), transform 0.15s ease;
}

.explorer-help-btn:hover,
.explorer-help-btn:focus-visible {
  background: var(--leaf-lt);
  color: var(--leaf-dark);
  outline: none;
  transform: translateY(-1px);
}

html[data-theme="dark"] .explorer-help-btn {
  background: rgba(28, 28, 26, 0.94);
  color: var(--leaf-lt);
}

html[data-theme="dark"] .explorer-help-btn:hover,
html[data-theme="dark"] .explorer-help-btn:focus-visible {
  background: rgba(28, 28, 26, 1);
  color: var(--leaf-lt);
}

/* ─── Map gesture hint ──────────────────────────────────────── */
.map-gesture-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  z-index: 650;
  max-width: calc(100% - 48px);
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(28, 27, 24, 0.82);
  color: #faf8f4;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  pointer-events: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
  animation: mapHintFade 0.2s ease;
}

.map-gesture-hint.hidden {
  display: none;
}

@keyframes mapHintFade {
  from { opacity: 0; transform: translate(-50%, -50%) scale(0.96); }
  to { opacity: 1; transform: translate(-50%, -50%) scale(1); }
}

/* ─── Results loading / empty states ────────────────────────── */
.results-state {
  padding: 28px 12px;
  text-align: center;
}

.results-state-spinner {
  width: 32px;
  height: 32px;
  margin: 0 auto 14px;
  border: 3px solid var(--border-lt);
  border-top-color: var(--leaf);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

.results-state-icon {
  width: 40px;
  height: 40px;
  margin: 0 auto 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--leaf) 10%, var(--bg));
  color: var(--leaf);
  font-size: 18px;
}

.results-state-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
}

.results-state-hint {
  font-size: 12px;
  line-height: 1.55;
  color: var(--text-muted);
  max-width: 280px;
  margin: 0 auto;
}

#results-placeholder.is-loading {
  min-height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ─── Mobile-only utilities ───────────────────────────────────── */
.mobile-only {
  display: none;
}

.desktop-only {
  display: none;
}

.results-expand-btn {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: none;
  border-radius: 8px;
  background: color-mix(in srgb, var(--leaf) 8%, var(--surface));
  color: var(--leaf);
  cursor: pointer;
  flex-shrink: 0;
}

.results-expand-collapse-icon {
  display: none;
}

body.page-explorer.results-expanded .results-expand-icon {
  display: none;
}

body.page-explorer.results-expanded .results-expand-collapse-icon {
  display: block;
}

.mobile-drawer-header {
  display: none;
}

.mobile-drawer-backdrop {
  display: none !important;
}

.mobile-drawer-backdrop.hidden {
  display: none;
}

.mobile-fab-bar {
  position: fixed;
  left: 50%;
  bottom: calc(12px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 1130;
  display: none;
  align-items: center;
  gap: 8px;
}

.mobile-filters-trigger {
  display: none;
  width: 100%;
  margin-top: 10px;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid color-mix(in srgb, var(--leaf) 35%, var(--border));
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--leaf) 8%, var(--surface));
  color: var(--leaf);
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transition), border-color var(--transition), color var(--transition);
}

.mobile-filters-trigger:hover,
.mobile-filters-trigger[aria-expanded="true"] {
  background: color-mix(in srgb, var(--leaf) 14%, var(--surface));
  border-color: color-mix(in srgb, var(--leaf) 50%, var(--border));
  color: var(--leaf-dark);
}

.mobile-fab-pill {
  font-family: 'DM Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  color: var(--leaf);
  background: rgba(250, 248, 244, 0.94);
  border: 1px solid color-mix(in srgb, var(--leaf) 40%, var(--border));
  border-radius: 999px;
  padding: 12px 18px;
  min-height: 44px;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(45, 106, 79, 0.16);
  transition: background var(--transition), transform 0.12s ease;
}

.mobile-fab-pill:hover {
  background: var(--leaf-lt);
}

.mobile-fab-pill.hidden {
  display: none;
}

.mobile-fab-pill:active {
  transform: scale(0.98);
}

/* ─── Mobile onboarding ─────────────────────────────────────── */
.mobile-onboarding {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(28, 27, 24, 0.45);
}

.mobile-onboarding-bubble {
  position: absolute;
  max-width: 260px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #ffffff;
  color: var(--ink);
  font-size: 13px;
  line-height: 1.5;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid color-mix(in srgb, var(--leaf) 25%, #ffffff);
}

.mobile-onboarding-dismiss {
  position: absolute;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  font-size: 12px;
  color: rgba(255, 255, 255, 0.88);
}

.onboarding-highlight {
  position: relative;
  z-index: 2001;
  box-shadow: 0 0 0 3px rgba(45, 106, 79, 0.55);
  border-radius: 8px;
}

/* ─── How-to page ───────────────────────────────────────────── */
body.page-how-to {
  background: var(--cream);
  color: var(--ink);
  min-height: 100dvh;
  font-size: calc(14px * var(--text-scale));
}

.page-how-to .howto-section,
.page-how-to .howto-hero {
  contain: paint;
}

.howto-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 48px;
  border-bottom: none;
}

.howto-nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--leaf);
}

.howto-nav-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}

.howto-hero {
  background: var(--cream);
  padding: 16px 48px 48px;
}

.howto-hero-inner {
  max-width: 1100px;
  margin: 0 auto;
}

.howto-hero-title {
  margin-bottom: 0;
}

.howto-eyebrow {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.22em;
  color: var(--leaf);
  margin-bottom: 24px;
  text-transform: uppercase;
}

.howto-eyebrow::after {
  content: '';
  flex: 1;
  max-width: 120px;
  height: 1px;
  background: var(--leaf);
  opacity: 0.55;
}

.howto-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 48px 96px;
}

.howto-section {
  margin-bottom: 20px;
  padding: 24px 26px 26px;
  border-radius: var(--radius-md);
  background: #ffffff;
  border: 1px solid color-mix(in srgb, var(--leaf) 14%, var(--cream-dk));
  box-shadow: 0 4px 20px rgba(45, 106, 79, 0.06);
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.howto-section:hover {
  border-color: color-mix(in srgb, var(--leaf) 28%, var(--cream-dk));
  box-shadow: 0 8px 28px rgba(45, 106, 79, 0.09);
}

.howto-section--last {
  margin-bottom: 32px;
}

.howto-step-num {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--leaf);
  background: var(--leaf-lt);
  padding: 4px 10px;
  border-radius: 999px;
  margin-bottom: 12px;
}

.howto-section-title {
  font-family: 'Syne', sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}

.howto-section-text {
  line-height: 1.68;
  color: var(--ink-muted);
  margin-bottom: 12px;
}

.page-how-to .howto-section-text {
  font-size: 1em;
}

.page-how-to .howto-section-title {
  font-size: 1.286em;
}

.page-how-to .howto-step-num {
  font-size: 0.714em;
}

.page-how-to .howto-eyebrow {
  font-size: 0.786em;
}

.page-how-to .pref-btn {
  font-size: 0.786em;
}

.howto-section-text:last-child {
  margin-bottom: 0;
}

.howto-section-text strong {
  color: var(--ink);
  font-weight: 600;
}

.howto-resource-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 16px;
}

.howto-resource-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--cream);
  border: 1px solid color-mix(in srgb, var(--leaf) 10%, var(--cream-dk));
  transition: background 0.2s ease, border-color 0.2s ease;
}

.howto-resource-item:hover {
  background: color-mix(in srgb, var(--leaf) 4%, #ffffff);
  border-color: color-mix(in srgb, var(--leaf) 22%, var(--cream-dk));
}

.howto-resource-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 5px;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.9);
}

.howto-resource-dot.snap-dot { background: var(--snap); }
.howto-resource-dot.foodbank-dot { background: var(--foodbank); }
.howto-resource-dot.meal-all-dot { background: var(--meal); }
.howto-resource-dot.meal-under18-dot { background: var(--meal-under18); }
.howto-resource-dot.wic-dot { background: var(--wic); }

.howto-resource-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 3px;
}

.howto-resource-desc {
  font-size: 12px;
  line-height: 1.55;
  color: var(--ink-muted);
}

.howto-pref-demo {
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid color-mix(in srgb, var(--leaf) 12%, var(--cream-dk));
}

.howto-cta-wrap {
  text-align: left;
}

.howto-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  background: var(--leaf);
  color: var(--cream);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  letter-spacing: 0.02em;
  transition: background var(--transition), transform 0.12s ease;
  box-shadow: 0 4px 16px rgba(45, 106, 79, 0.18);
}

.howto-cta:hover {
  background: var(--leaf-dark);
  transform: translateY(-1px);
}

html[data-theme="dark"] body.page-how-to {
  background: #141412;
}

html[data-theme="dark"] .howto-section {
  background: var(--surface);
  border-color: var(--border);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] .howto-resource-item {
  background: color-mix(in srgb, var(--leaf) 6%, var(--surface));
  border-color: var(--border);
}

html[data-theme="dark"] .howto-resource-item:hover {
  background: color-mix(in srgb, var(--leaf) 10%, var(--surface));
}

/* ─── Mobile explorer layout ────────────────────────────────── */
@media (max-width: 640px) {
  .mobile-only {
    display: block;
  }

  body.page-explorer .explorer-help-btn {
    width: 38px;
    height: 38px;
    font-size: 18px;
  }

  body.page-explorer .mobile-filters-trigger {
    display: inline-flex;
  }

  body.page-explorer #filters-drawer-panel #filter-section,
  body.page-explorer #filters-drawer-panel #scarcity-section {
    display: block;
    flex-shrink: 0;
  }

  .mobile-drawer-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 8px 16px 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 2;
  }

  .mobile-drawer-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
  }

  .mobile-results-grab {
    width: 40px;
    height: 4px;
    margin: 0 auto 8px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--leaf) 35%, var(--border));
    cursor: grab;
    flex-shrink: 0;
  }

  .mobile-drawer-title {
    font-family: 'Syne', sans-serif;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
  }

  .mobile-drawer-actions {
    display: inline-flex;
    align-items: center;
    gap: 4px;
  }

  .mobile-drawer-expand {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: none;
    border-radius: 10px;
    background: color-mix(in srgb, var(--leaf) 8%, var(--surface));
    color: var(--leaf);
    cursor: pointer;
    flex-shrink: 0;
  }

  .mobile-drawer-expand:active {
    transform: scale(0.96);
  }

  .mobile-drawer-close {
    font-family: 'DM Sans', sans-serif;
    font-size: 13px;
    font-weight: 600;
    color: var(--leaf);
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px 4px;
    min-height: 44px;
  }

  body.page-explorer {
    overflow: hidden;
    --mobile-results-collapsed-height: 52px;
    --mobile-results-peek-height: 132px;
    --mobile-fab-stack: calc(52px + env(safe-area-inset-bottom));
    --mobile-results-stack: calc(var(--mobile-fab-stack) + var(--mobile-results-peek-height));
  }

  body.page-explorer #app {
    flex-direction: column;
    height: 100dvh;
    overflow: hidden;
  }

  body.page-explorer #sidebar {
    position: relative;
    width: 100%;
    min-width: 0;
    height: auto;
    flex: 0 0 auto;
    overflow: visible;
    border: none;
    box-shadow: none;
    background: transparent;
    z-index: 1001;
  }

  body.page-explorer #sidebar-header {
    padding: 10px var(--explorer-pad) 8px;
    border-bottom: none;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }

  body.page-explorer .sidebar-nav-links {
    margin-top: 0;
  }

  body.page-explorer #search-section {
    position: sticky;
    top: 0;
    z-index: 1002;
    background: var(--cream);
    border-bottom: 1px solid var(--border);
    padding-top: 10px;
    padding-bottom: 12px;
  }

  html[data-theme="dark"] body.page-explorer #search-section {
    background: var(--bg);
  }

  body.page-explorer #map-container {
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    order: 1;
    padding: 8px 12px 72px;
  }

  body.page-explorer #map {
    border-radius: 12px;
  }

  body.page-explorer #filters-drawer-panel,
  body.page-explorer #results-drawer-panel {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 78vh;
    background: var(--surface);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -10px 36px rgba(0, 0, 0, 0.18);
    z-index: 1100;
    transform: translateY(100%);
    transition: transform 0.28s ease;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    padding-bottom: env(safe-area-inset-bottom);
  }

  body.page-explorer #filters-drawer-panel {
    z-index: 1200;
  }

  body.page-explorer.mobile-filters-open #filters-drawer-panel,
  body.page-explorer #filters-drawer-panel.is-open {
    transform: none;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    max-height: min(88vh, calc(100dvh - env(safe-area-inset-top) - 16px));
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: var(--mobile-fab-stack);
    height: var(--mobile-results-collapsed-height);
    max-height: var(--mobile-results-collapsed-height);
    transform: none;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 18px rgba(0, 0, 0, 0.12);
    cursor: pointer;
    overflow: hidden;
  }

  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel
    #results-section,
  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel
    #results-list,
  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel
    .mobile-drawer-actions {
    display: none;
  }

  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel
    .mobile-drawer-header {
    padding-bottom: 8px;
    border-bottom: none;
  }

  body.page-explorer.mobile-has-results:not(.mobile-results-collapsed):not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: var(--mobile-fab-stack);
    height: var(--mobile-results-peek-height);
    max-height: var(--mobile-results-peek-height);
    transform: none;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.16);
    cursor: default;
  }

  body.page-explorer.mobile-has-results:not(.mobile-results-collapsed):not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel
    .mobile-drawer-close {
    display: none;
  }

  body.page-explorer.mobile-has-results:not(.mobile-results-collapsed):not(.results-expanded):not(.mobile-filters-open)
    #results-drawer-panel
    #results-list {
    max-height: calc(var(--mobile-results-peek-height) - 56px);
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
  }

  body.page-explorer.results-expanded #results-drawer-panel,
  body.page-explorer #results-drawer-panel.is-expanded {
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    height: 100dvh;
    max-height: 100dvh;
    transform: none;
    border-radius: 0;
    z-index: 1125;
    cursor: default;
    overflow: hidden;
    padding-bottom: 0;
    box-shadow: none;
  }

  body.page-explorer.results-expanded #results-drawer-panel .mobile-drawer-header,
  body.page-explorer #results-drawer-panel.is-expanded .mobile-drawer-header {
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 2;
    padding-top: calc(10px + env(safe-area-inset-top));
  }

  body.page-explorer.results-expanded #results-drawer-panel .mobile-drawer-close,
  body.page-explorer #results-drawer-panel.is-expanded .mobile-drawer-close {
    display: inline-flex;
    align-items: center;
  }

  body.page-explorer.results-expanded #results-section,
  body.page-explorer #results-drawer-panel.is-expanded #results-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  body.page-explorer.results-expanded #results-list,
  body.page-explorer #results-drawer-panel.is-expanded #results-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    touch-action: pan-y;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded) #stats-bar:not(.hidden) {
    bottom: calc(var(--mobile-fab-stack) + var(--mobile-results-collapsed-height) + 8px);
    z-index: 1110;
  }

  body.page-explorer.mobile-has-results:not(.mobile-results-collapsed):not(.results-expanded) #stats-bar:not(.hidden) {
    bottom: calc(var(--mobile-fab-stack) + var(--mobile-results-peek-height) + 8px);
    z-index: 1110;
  }

  body.page-explorer.results-expanded #stats-bar:not(.hidden) {
    display: none;
  }

  body.page-explorer.mobile-filters-open #stats-bar:not(.hidden) {
    display: none;
  }

  body.page-explorer #filter-section,
  body.page-explorer #scarcity-section,
  body.page-explorer #results-section {
    border-bottom: none;
  }

  body.page-explorer #sidebar-footer {
    display: none;
  }

  body.page-explorer.mobile-filters-open #sidebar-footer {
    display: none;
  }

  body.page-explorer.mobile-filters-open #filters-drawer-panel {
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  body.page-explorer #results-list {
    min-height: 0;
  }

  body.page-explorer .result-card {
    padding: 14px 14px 14px 16px;
    margin-bottom: 10px;
    min-height: 72px;
  }

  body.page-explorer .result-name {
    font-size: 15px;
    font-weight: 700;
    white-space: normal;
    line-height: 1.3;
    margin-bottom: 4px;
  }

  body.page-explorer .result-address {
    font-size: 12px;
    white-space: normal;
    line-height: 1.45;
    margin-bottom: 8px;
  }

  body.page-explorer .result-badge {
    font-size: 10px;
    padding: 4px 8px;
  }

  body.page-explorer .result-meta {
    margin-top: 4px;
  }

  body.page-explorer .radius-btn {
    min-height: 44px;
    padding: 10px 0;
    font-size: 13px;
  }

  body.page-explorer #radius-options {
    gap: 8px;
  }

  body.page-explorer .filter-item {
    min-height: 44px;
    padding: 8px 0;
  }

  body.page-explorer .scarcity-toggle {
    min-height: 44px;
  }

  body.page-explorer #stats-bar {
    bottom: 72px;
    padding: 8px 14px;
    gap: 10px;
    max-width: calc(100% - 24px);
    overflow-x: auto;
    z-index: 1110;
  }

  body.page-explorer .stat-label {
    font-size: 9px;
  }

  body.page-explorer .stat-num {
    font-size: 16px;
  }

  #detail-panel,
  body.page-explorer #detail-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    top: auto;
    width: auto;
    max-height: 72vh;
    overflow: auto;
    border-radius: 16px;
    animation: detailSheetUp 0.24s ease;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28);
    z-index: 1150;
  }

  #detail-panel.detail-sheet-open {
    display: block;
  }

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

  .mobile-fab-bar {
    display: flex;
  }

  body.page-explorer.mobile-has-results:not(.results-expanded) .mobile-fab-bar {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    bottom: env(safe-area-inset-bottom);
  }

  body.page-explorer.mobile-has-results #mobile-show-results-btn {
    display: none !important;
  }

  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded) .explorer-help-anchor {
    bottom: calc(var(--mobile-fab-stack) + var(--mobile-results-collapsed-height) + 12px);
  }

  body.page-explorer.mobile-has-results:not(.mobile-results-collapsed):not(.results-expanded) .explorer-help-anchor {
    bottom: calc(var(--mobile-fab-stack) + var(--mobile-results-peek-height) + 12px);
  }

  body.page-explorer.mobile-has-results.mobile-results-collapsed:not(.results-expanded) .back-to-top {
    display: none;
  }

  body.page-explorer.mobile-has-results:not(.mobile-results-collapsed):not(.results-expanded) .back-to-top {
    bottom: calc(var(--mobile-fab-stack) + var(--mobile-results-peek-height) - 8px);
    right: 16px;
    z-index: 1120;
  }

  body.page-explorer.results-expanded .explorer-help-anchor {
    display: none;
  }

  body.page-explorer.results-expanded .back-to-top {
    display: inline-flex;
    bottom: calc(12px + env(safe-area-inset-bottom));
    right: 16px;
    z-index: 1130;
  }

  body.page-explorer:not(.mobile-has-results) .back-to-top {
    bottom: calc(68px + env(safe-area-inset-bottom));
    right: 60px;
  }

  .howto-nav {
    padding: 20px 24px;
  }

  .howto-hero {
    padding: 8px 24px 36px;
  }

  .howto-main {
    padding: 0 20px 72px;
  }

  .howto-section {
    padding: 20px 18px 22px;
  }

  .nav-actions {
    gap: 12px;
  }

  .nav-link {
    font-size: 12px;
  }
}

@media (min-width: 641px) {
  body.page-explorer #filters-drawer-panel,
  body.page-explorer #results-drawer-panel {
    display: contents;
  }

  body.page-explorer .results-expand-btn.desktop-only {
    width: 32px;
    height: 32px;
  }

  body.page-explorer.mobile-has-results .results-expand-btn.desktop-only {
    display: inline-flex;
  }

  body.page-explorer.results-expanded #search-section,
  body.page-explorer.results-expanded #filters-drawer-panel,
  body.page-explorer.results-expanded #sidebar-footer {
    display: none;
  }

  body.page-explorer.results-expanded #results-drawer-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
  }

  body.page-explorer.results-expanded #results-section {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    flex-direction: column;
    padding: 12px var(--explorer-pad) 16px;
  }

  body.page-explorer.results-expanded #results-list {
    flex: 1 1 auto;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
  }

  body.page-explorer.results-expanded .results-utility-btns {
    display: flex;
  }

  .howto-cta-wrap {
    text-align: center;
  }

  .page-how-to .howto-pref-demo .font-scale-btn {
    background: #ffffff;
    color: #8a8a85;
    border-color: #d8d8d3;
  }

  .page-how-to .howto-pref-demo .font-scale-btn:hover,
  .page-how-to .howto-pref-demo .font-scale-btn[aria-pressed="true"] {
    color: var(--leaf);
    border-color: var(--leaf);
    background: #ffffff;
  }

  html[data-theme="dark"] .page-how-to .howto-pref-demo .font-scale-btn {
    background: var(--surface);
    color: #9a9a94;
    border-color: var(--border);
  }

  html[data-theme="dark"] .page-how-to .howto-pref-demo .font-scale-btn:hover,
  html[data-theme="dark"] .page-how-to .howto-pref-demo .font-scale-btn[aria-pressed="true"] {
    color: var(--leaf-lt);
    border-color: var(--leaf-lt);
    background: var(--surface);
  }
}
