:root {
  --cream: #f4f0df;
  --cream-deep: #e9e4cf;
  --paper: rgba(249, 247, 238, .975);
  --ink: #17352f;
  --ink-soft: #48645d;
  --pine: #244f43;
  --fern: #4f7755;
  --river: #3d7180;
  --sky: #94b9c5;
  --berry: #a84f63;
  --sun: #e1b64b;
  --dusk: #69475b;
  --shadow: 0 24px 70px rgba(17, 44, 38, .20);
  --radius: 26px;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Baskerville, Georgia, serif;
  --sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: #dfe7dc;
  font-family: var(--sans);
  min-height: 100%;
  overflow-x: hidden;
}
body.menu-open,
body.overlay-open,
body.explore-open { overflow: hidden; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; }
a { color: inherit; }

.skip-link {
  position: fixed;
  left: 1rem;
  top: -4rem;
  z-index: 9999;
  background: #fff;
  color: #111;
  padding: .8rem 1rem;
  border-radius: 10px;
}
.skip-link:focus { top: 1rem; }

#map {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: #dfe8df;
}
#map-tint {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    radial-gradient(circle at 82% 16%, rgba(255,255,255,.18), transparent 30%),
    linear-gradient(90deg, rgba(31, 63, 53, .07), transparent 50%);
  transition: background 800ms ease, opacity 800ms ease;
}
body[data-theme="dusk"] #map-tint {
  background:
    linear-gradient(180deg, rgba(45, 41, 67, .08), rgba(107, 67, 79, .30)),
    radial-gradient(circle at 78% 18%, rgba(234, 184, 100, .22), transparent 34%);
}
#grain {
  position: fixed;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  opacity: .10;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.82' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.23'/%3E%3C/svg%3E");
  mix-blend-mode: soft-light;
}

.topbar {
  position: fixed;
  inset: max(16px, env(safe-area-inset-top)) 20px auto 20px;
  z-index: 220;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  pointer-events: none;
}
.topbar > * { pointer-events: auto !important; position: relative; z-index: 1; }
#menu-button, #explore-button { pointer-events: auto !important; }
.topbar-actions { display: flex; align-items: center; gap: 10px; pointer-events: auto; }
.topbar-actions > * { pointer-events: auto; }
.theme-toggle { font-size: 1.25rem; line-height: 1; transition: background 180ms ease, color 180ms ease, transform 180ms ease; }
.theme-toggle span { display: block; transform: translateY(-1px); }
.round-button:hover, .text-button:hover { background: rgba(255,255,255,.98); transform: translateY(-1px); }
.round-button:focus-visible, .text-button:focus-visible, .story-hide-button:focus-visible, .story-restore:focus-visible { outline: 3px solid rgba(168,79,99,.45); outline-offset: 3px; }
.round-button,
.text-button {
  border: 1px solid rgba(23, 53, 47, .16);
  background: rgba(248, 246, 237, .90);
  color: var(--ink);
  box-shadow: 0 10px 35px rgba(18, 49, 42, .15);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(18px);
}
.round-button {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
#menu-button { gap: 4px; align-content: center; }
#menu-button span { display: block; width: 18px; height: 2px; border-radius: 2px; background: currentColor; }
.text-button {
  padding: .78rem 1rem;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}
.progress-pill {
  flex: 0 0 clamp(390px, 48vw, 650px);
  width: clamp(390px, 48vw, 650px);
  min-width: 390px;
  max-width: 650px;
  height: 48px;
  min-height: 48px;
  max-height: 48px;
  box-sizing: border-box;
  display: grid;
  grid-template-columns: 58px 94px minmax(0, 1fr);
  align-items: center;
  gap: .65rem;
  padding: .55rem .9rem;
  border-radius: 999px;
  color: var(--ink);
  background: rgba(248, 246, 237, .88);
  border: 1px solid rgba(23, 53, 47, .14);
  box-shadow: 0 10px 35px rgba(18, 49, 42, .13);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(18px);
  overflow: hidden;
  contain: layout paint;
}
.progress-pill span,
.progress-pill strong {
  display: block;
  min-width: 0;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.progress-pill span { font-size: .74rem; color: var(--ink-soft); }
.progress-pill strong { font-size: .82rem; }

#story { position: relative; z-index: 5; }
.cover,
.manifesto,
.chapter,
.finish {
  position: relative;
  min-height: 100svh;
}
.cover {
  display: flex;
  align-items: center;
  padding: 12vh 6vw 10vh;
}
.cover-card {
  width: min(620px, 92vw);
  padding: clamp(1.45rem, 3vw, 2.5rem);
  border-radius: 34px;
  background: linear-gradient(145deg, rgba(248, 246, 235, .992), rgba(242, 240, 230, .975));
  border: 1px solid rgba(31, 81, 65, .16);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}
.eyebrow {
  display: block;
  margin-bottom: .7rem;
  text-transform: uppercase;
  letter-spacing: .15em;
  font-weight: 800;
  font-size: .7rem;
  color: var(--fern);
}
.cover h1,
.chapter-title h2,
.story-card h3,
.wide-card h2,
.finish-card h2,
.menu-panel h2,
.overlay-shell h2 {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: .96;
  margin: 0;
}
.cover h1 { font-size: clamp(3rem, 7.2vw, 6.8rem); }
.tagline {
  margin: 1.1rem 0 1.4rem;
  font-family: var(--serif);
  font-style: italic;
  font-size: clamp(1.2rem, 2.6vw, 1.8rem);
  color: var(--berry);
}
.cover-copy { max-width: 48ch; font-size: 1rem; line-height: 1.65; color: var(--ink-soft); }
.cover-stats {
  display: flex;
  flex-wrap: wrap;
  gap: .55rem;
  margin: 1.1rem 0;
}
.cover-stats span {
  padding: .55rem .7rem;
  background: rgba(255,255,255,.62);
  border: 1px solid rgba(23,53,47,.10);
  border-radius: 999px;
  font-size: .78rem;
}
.cover-stats b { color: var(--pine); }
.scroll-cue { margin-top: 1.5rem; display: flex; align-items: center; gap: .8rem; color: var(--ink-soft); font-size: .78rem; font-weight: 700; }
.scroll-cue i { width: 48px; height: 1px; background: currentColor; position: relative; }
.scroll-cue i::after { content: ""; position: absolute; right: 0; top: -3px; width: 7px; height: 7px; border-right: 1px solid; border-bottom: 1px solid; transform: rotate(45deg); }

.manifesto { display: grid; align-items: center; padding: 18vh 6vw; }
.wide-card {
  width: min(780px, 92vw);
  margin-left: auto;
  padding: clamp(1.5rem, 3vw, 2.7rem);
  border-radius: 32px;
  background: rgba(247, 245, 235, .985);
  box-shadow: var(--shadow);
  border: 1px solid rgba(23,53,47,.16);
  backdrop-filter: blur(18px);
}
.wide-card h2 { font-size: clamp(2.3rem, 5vw, 4.8rem); }
.wide-card > p { max-width: 63ch; line-height: 1.72; color: #29463f; font-size: 1.02rem; }
.mini-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .8rem; margin-top: 1.5rem; }
.mini-grid > div { padding: 1.05rem; border-radius: 18px; background: rgba(227, 234, 211, .82); border: 1px solid rgba(23,53,47,.08); }
.mini-grid strong, .mini-grid span { display: block; }
.mini-grid strong { font-family: var(--serif); font-size: 1.15rem; }
.mini-grid span { color: var(--ink-soft); font-size: .78rem; line-height: 1.45; margin-top: .25rem; }

.chapter { padding: 18vh 6vw 10vh; --chapter-accent: var(--fern); }
.chapter[data-day="2"] { --chapter-accent: #6d7f45; }
.chapter[data-day="3"] { --chapter-accent: var(--river); }
.chapter[data-day="4"] { --chapter-accent: var(--berry); }
.chapter-title {
  min-height: 72svh;
  display: flex;
  align-items: flex-end;
  padding-bottom: 8vh;
}
.chapter-title-card {
  width: min(720px, 92vw);
  padding: clamp(1.4rem, 3vw, 2.4rem);
  border-radius: 30px;
  color: #f7f4e8;
  background: linear-gradient(135deg, rgba(28, 75, 61, .96), rgba(55, 102, 91, .86));
  box-shadow: var(--shadow);
  border: 1px solid rgba(255,255,255,.12);
}
.chapter[data-day="2"] .chapter-title-card { background: linear-gradient(135deg, rgba(29, 58, 50, .97), rgba(61, 93, 63, .90)); }
.chapter[data-day="3"] .chapter-title-card { background: linear-gradient(135deg, rgba(50, 91, 80, .96), rgba(97, 119, 77, .88)); }
.chapter[data-day="4"] .chapter-title-card { background: linear-gradient(135deg, rgba(40, 78, 86, .97), rgba(90, 87, 111, .89)); }
.chapter-title h2 { font-size: clamp(2.7rem, 6vw, 6rem); }
.chapter-meta { display: flex; flex-wrap: wrap; gap: .55rem; margin-top: 1.2rem; }
.chapter-meta span { border: 1px solid rgba(255,255,255,.18); background: rgba(255,255,255,.08); padding: .58rem .72rem; border-radius: 999px; font-size: .78rem; }
.chapter-character { max-width: 56ch; margin: 1rem 0 0; line-height: 1.6; color: rgba(255,255,255,.76); }

.steps { display: grid; gap: 25vh; }
.story-step { min-height: 72svh; display: flex; align-items: center; }
.story-step.align-right { justify-content: flex-end; }
.story-card {
  width: min(520px, 90vw);
  padding: clamp(1.25rem, 2.6vw, 2rem);
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid rgba(24, 65, 55, .14);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transform: translateY(16px) scale(.98);
  opacity: .93;
  transition: transform 520ms cubic-bezier(.2,.8,.2,1), opacity 420ms ease, background 420ms ease, box-shadow 420ms ease, border-color 420ms ease;
  overflow: hidden;
  position: relative;
}
.story-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 5px;
  background: var(--chapter-accent, var(--fern));
  opacity: .65;
}
.story-step.active .story-card {
  transform: translateY(0) scale(1);
  opacity: 1;
  background: rgba(250,248,240,.995);
  border-color: color-mix(in srgb, var(--chapter-accent, var(--fern)) 35%, transparent);
  box-shadow: 0 28px 80px rgba(17,44,38,.24);
}
.story-meta { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.story-meta .eyebrow { margin-bottom: .75rem; }
.route-range {
  flex: 0 0 auto;
  padding: .32rem .5rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--chapter-accent, var(--fern)) 11%, white);
  color: var(--ink-soft);
  font-size: .66rem;
  font-weight: 800;
  letter-spacing: .045em;
  text-transform: uppercase;
}
.story-card h3 { font-size: clamp(2rem, 4vw, 3.6rem); text-wrap: balance; }
.story-card p { line-height: 1.72; color: #29463f; font-size: .98rem; }
.step-gallery {
  margin: 1.35rem -0.45rem -.35rem;
  display: grid;
  gap: .65rem;
}
.step-gallery.single { grid-template-columns: 1fr; }
.step-gallery.multi { grid-template-columns: 1.25fr .85fr; }
.story-card .step-image {
  width: 100%;
  height: 100%;
  min-height: 178px;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 19px;
  box-shadow: 0 16px 38px rgba(20, 49, 42, .16);
  background: rgba(255,255,255,.45);
  transform: scale(1.018);
  transition: transform 900ms cubic-bezier(.2,.8,.2,1), filter 450ms ease;
}
.step-gallery.multi .step-image:nth-child(2) { aspect-ratio: 3 / 4; }
.story-step.active .step-image { transform: scale(1); }
.story-card:hover .step-image { filter: saturate(1.05) contrast(1.02); }

.media-break {
  min-height: 105svh;
  margin: 8vh -6vw 12vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
}
.media-break img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.media-break::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(18, 37, 33, .82)); }
.media-caption { position: relative; z-index: 1; color: #fff; max-width: 640px; padding: 8vw 6vw; }
.media-caption h3 { font: 700 clamp(2.6rem, 6vw, 6rem)/.98 var(--serif); letter-spacing: -.035em; margin: 0; }
.media-caption p { max-width: 54ch; line-height: 1.6; color: rgba(255,255,255,.78); }
.vintage-break img { object-fit: cover; filter: saturate(.82) contrast(.96); }
.vintage-break::after { background: linear-gradient(90deg, rgba(33,52,46,.84), transparent 75%), linear-gradient(180deg, transparent 45%, rgba(33,52,46,.70)); }

.finish { display: grid; place-items: center; padding: 16vh 6vw; }
.finish-card {
  width: min(720px, 92vw);
  padding: clamp(1.6rem, 4vw, 3.4rem);
  text-align: center;
  border-radius: 36px;
  color: #fff8ea;
  background: linear-gradient(145deg, rgba(74, 59, 87, .95), rgba(131, 74, 81, .91));
  box-shadow: var(--shadow);
}
.finish-card h2 { font-size: clamp(3rem, 8vw, 7rem); }
.finish-card p { max-width: 52ch; margin: 1rem auto 1.5rem; line-height: 1.65; color: rgba(255,255,255,.78); }
.finish-card button { border: 0; border-radius: 999px; padding: .9rem 1.15rem; background: #f2dd9d; color: #3e3b43; font-weight: 800; cursor: pointer; }

/* Story-card map access */
.cover-card, .wide-card, .chapter-title-card, .story-card, .media-caption, .finish-card { position: relative; }
.story-hide-button {
  position: absolute;
  top: .75rem;
  right: .75rem;
  z-index: 6;
  border: 1px solid rgba(23,53,47,.15);
  border-radius: 999px;
  padding: .42rem .64rem;
  background: rgba(255,255,255,.9);
  color: var(--ink);
  font-size: .68rem;
  font-weight: 850;
  letter-spacing: .03em;
  cursor: pointer;
  box-shadow: 0 7px 20px rgba(17,44,38,.14);
}
.story-card > .story-meta { padding-right: 3.8rem; }
.cover-card > .eyebrow, .wide-card > .eyebrow, .chapter-title-card > .eyebrow, .media-caption > .eyebrow, .finish-card > .eyebrow { padding-right: 3.8rem; }
.chapter-title-card .story-hide-button, .media-caption .story-hide-button, .finish-card .story-hide-button {
  color: #fff;
  border-color: rgba(255,255,255,.28);
  background: rgba(18,42,36,.52);
}

.media-break > .media-break-hide-button {
  top: max(1rem, env(safe-area-inset-top));
  right: max(1rem, 3vw);
  left: auto;
  z-index: 8;
  color: #fff;
  border-color: rgba(255,255,255,.34);
  background: rgba(18,42,36,.62);
}
.media-break > .media-break-hide-button:hover { background: rgba(18,42,36,.9); }
.story-hide-button:hover { background: #fff; }
.chapter-title-card .story-hide-button:hover, .media-caption .story-hide-button:hover, .finish-card .story-hide-button:hover { background: rgba(18,42,36,.82); }
.story-card-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: scale(.97) !important;
}
.story-restore {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 260;
  transform: translateX(-50%);
  border: 1px solid rgba(23,53,47,.16);
  border-radius: 999px;
  padding: .78rem 1rem;
  color: var(--ink);
  background: rgba(248,246,237,.97);
  box-shadow: 0 16px 48px rgba(17,44,38,.24);
  font-weight: 850;
  cursor: pointer;
}
.story-restore[hidden] { display: none; }
.map-free #story { pointer-events: none; }
.map-free .progress-pill, .map-free .elevation-panel { opacity: 0; pointer-events: none; }
.map-free #map-tint { opacity: .16; }

.elevation-panel {
  position: fixed;
  left: 20px;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 25;
  width: min(380px, calc(100vw - 40px));
  min-width: min(380px, calc(100vw - 40px));
  max-width: min(380px, calc(100vw - 40px));
  height: 116px;
  min-height: 116px;
  max-height: 116px;
  box-sizing: border-box;
  padding: .78rem 1rem .58rem;
  overflow: hidden;
  contain: layout paint;
  color: var(--river);
  background: rgba(248,246,237,.88);
  border: 1px solid rgba(23,53,47,.13);
  box-shadow: 0 14px 44px rgba(18,49,42,.14);
  border-radius: 20px;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 300ms ease, transform 300ms ease;
}
.elevation-panel.visible { opacity: 1; transform: translateY(0); }
.elevation-head {
  height: 22px;
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
  color: var(--ink);
  font-size: .72rem;
  line-height: 1;
  overflow: hidden;
}
.elevation-head span,
.elevation-head b {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.elevation-head span { color: var(--ink-soft); font-weight: 750; }
.elevation-head b { color: var(--berry); font-variant-numeric: tabular-nums; text-align: right; }
#elevation-svg { width: 100%; height: 68px; overflow: visible; }
#elevation-line { stroke: currentColor; stroke-width: 2; }
#elevation-dot { fill: var(--berry); stroke: #fff; stroke-width: 2; }

.menu-panel {
  position: fixed;
  display: flex;
  flex-direction: column;
  inset: 0 auto 0 0;
  width: min(430px, 92vw);
  z-index: 320;
  padding: max(24px, env(safe-area-inset-top)) 24px max(24px, env(safe-area-inset-bottom));
  background: rgba(246, 243, 231, .97);
  border-right: 1px solid rgba(23,53,47,.12);
  box-shadow: 24px 0 60px rgba(19,45,39,.20);
  transform: translateX(-104%);
  transition: transform 350ms cubic-bezier(.2,.8,.2,1);
  overflow-y: auto;
}
.menu-open .menu-panel { transform: translateX(0); }
.menu-backdrop { position: fixed; inset: 0; z-index: 310; background: rgba(19, 39, 34, .28); opacity: 0; pointer-events: none; transition: opacity 300ms ease; }
.menu-open .menu-backdrop { opacity: 1; pointer-events: auto; }
.menu-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.menu-panel h2 { font-size: 2.2rem; }
.close-button { font-size: 2rem; line-height: 1; }
.menu-links { display: grid; gap: .2rem; margin: 1.8rem 0; }
.menu-links a { text-decoration: none; padding: .9rem .8rem; border-radius: 13px; color: var(--ink-soft); font-weight: 750; }
.menu-links a:hover { background: rgba(59,112,95,.09); color: var(--ink); }
.menu-tools { display: grid; gap: .55rem; border-top: 1px solid rgba(23,53,47,.12); padding-top: 1.2rem; }
.menu-tools button { width: 100%; text-align: left; padding: .95rem 1rem; border-radius: 14px; border: 1px solid rgba(23,53,47,.12); background: rgba(255,255,255,.48); color: var(--ink); font-weight: 760; cursor: pointer; }
.menu-tools button:hover { background: #fff; }
.menu-note { font-size: .74rem; line-height: 1.5; color: var(--ink-soft); margin-top: 1.2rem; }
.menu-theme-toggle {
  margin-top: auto;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .9rem 1rem;
  border-radius: 16px;
  border: 1px solid rgba(23,53,47,.14);
  background: rgba(255,255,255,.62);
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  box-shadow: 0 10px 28px rgba(18,49,42,.09);
}
.menu-theme-toggle:hover { background: rgba(255,255,255,.94); }
.menu-theme-copy { display: grid; gap: .16rem; }
.menu-theme-copy small { color: var(--ink-soft); font-size: .67rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 800; }
.menu-theme-copy strong { font-family: var(--serif); font-size: 1.08rem; }
.menu-theme-icon { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; background: rgba(79,119,85,.12); font-size: 1.25rem; }


.overlay-root {
  position: fixed;
  inset: 0;
  z-index: 420;
  padding: 0;
  background: rgba(21, 42, 36, .48);
  opacity: 0;
  pointer-events: none;
  transition: opacity 240ms ease;
}
.overlay-open .overlay-root { opacity: 1; pointer-events: auto; }
.overlay-shell {
  position: absolute;
  inset: 2.5vh 2.5vw;
  border-radius: 30px;
  background: #f6f2e3;
  box-shadow: 0 30px 100px rgba(9,25,21,.30);
  overflow: hidden;
  transform: translateY(24px) scale(.985);
  transition: transform 300ms cubic-bezier(.2,.8,.2,1);
}
.overlay-open .overlay-shell { transform: translateY(0) scale(1); }
.overlay-top {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.3rem 1.5rem;
  border-bottom: 1px solid rgba(23,53,47,.10);
  background: rgba(246,242,227,.94);
  backdrop-filter: blur(16px);
}
.overlay-shell h2 { font-size: clamp(2rem, 4vw, 3.5rem); }
.overlay-content { height: calc(95vh - 100px); overflow-y: auto; padding: clamp(1rem, 4vw, 3rem); }
.overlay-content > * { max-width: 1080px; margin-left: auto; margin-right: auto; }
.overlay-content h3 { font: 700 1.8rem/1.1 var(--serif); margin: 2rem 0 .7rem; }
.overlay-content p, .overlay-content li { color: var(--ink-soft); line-height: 1.58; }
.overlay-content table { width: 100%; border-collapse: collapse; min-width: 680px; }
.table-wrap { overflow-x: auto; border-radius: 18px; border: 1px solid rgba(23,53,47,.11); background: rgba(255,255,255,.40); }
th, td { padding: .9rem 1rem; text-align: left; border-bottom: 1px solid rgba(23,53,47,.09); vertical-align: top; }
th { background: var(--pine); color: #fff; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; }
td { font-size: .86rem; }
.info-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.info-card { padding: 1.1rem; border-radius: 18px; background: rgba(255,255,255,.52); border: 1px solid rgba(23,53,47,.10); }
.info-card h4 { margin: 0 0 .4rem; font: 700 1.2rem var(--serif); }
.info-card p { margin: 0; font-size: .86rem; }
.route-file-list { display: grid; gap: .65rem; }
.route-file { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 1rem; border-radius: 16px; background: rgba(255,255,255,.55); border: 1px solid rgba(23,53,47,.10); }
.route-file button { border: 0; border-radius: 999px; padding: .55rem .75rem; color: #7b786b; background: #e8e4d5; font-weight: 700; cursor: not-allowed; }
.checklist-toolbar { display: flex; flex-wrap: wrap; gap: .55rem; margin-bottom: 1.2rem; }
.checklist-toolbar button { border: 1px solid rgba(23,53,47,.14); border-radius: 999px; background: #fff; padding: .65rem .8rem; font-weight: 750; cursor: pointer; }
.checklist-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.check-group { padding: 1rem; border-radius: 18px; background: rgba(255,255,255,.48); border: 1px solid rgba(23,53,47,.10); }
.check-group h3 { margin-top: .2rem; }
.check-item { display: flex; align-items: flex-start; gap: .7rem; padding: .58rem 0; border-bottom: 1px solid rgba(23,53,47,.07); }
.check-item:last-child { border-bottom: 0; }
.check-item input { margin-top: .2rem; width: 18px; height: 18px; accent-color: var(--fern); }
.check-item label { cursor: pointer; color: var(--ink-soft); line-height: 1.4; font-size: .86rem; }
.check-item input:checked + label { text-decoration: line-through; color: #8c938b; }
.checklist-grid.hide-packed .check-item:has(input:checked) { display: none; }
.source-list { display: grid; gap: .65rem; }
.source-list a { display: block; padding: .9rem 1rem; border-radius: 14px; background: rgba(255,255,255,.52); border: 1px solid rgba(23,53,47,.10); text-decoration: none; font-weight: 750; }
.source-list a:hover { background: #fff; }
.photo-credit { font-size: .76rem; }

.explore-mode {
  position: fixed;
  inset: 0;
  z-index: 280;
  pointer-events: none;
  opacity: 0;
  transition: opacity 250ms ease;
}
.explore-open .explore-mode { opacity: 1; }
.explore-open .explore-bar { pointer-events: auto; }
.explore-open #story,
.explore-open .elevation-panel,
.explore-open .progress-pill { opacity: 0; pointer-events: none; }
.explore-open #map-tint { opacity: .22; }
.explore-bar {
  pointer-events: none;
  position: absolute;
  left: 18px;
  right: 18px;
  top: max(16px, env(safe-area-inset-top));
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .85rem 1rem;
  border-radius: 22px;
  background: rgba(248,246,237,.985);
  border: 1px solid rgba(23,53,47,.12);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}
.explore-bar .eyebrow { margin-bottom: .15rem; }
.day-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.day-filters button { border: 0; border-radius: 999px; padding: .55rem .7rem; background: #e6e7d8; color: var(--ink-soft); font-weight: 750; cursor: pointer; }
.day-filters button.active { background: var(--berry); color: #fff; box-shadow: 0 5px 14px rgba(168,79,99,.28); }

.bike-marker {
  transform-origin: 50% 50%;
  filter: drop-shadow(0 4px 6px rgba(16,43,35,.25));
}
.bike-pack {
  width: auto;
  height: auto;
  white-space: nowrap;
  font-size: clamp(18px, 2.1vw, 27px);
  line-height: 1;
  letter-spacing: -0.18em;
  transform-origin: 50% 50%;
}
.bike-pack span {
  display: block;
  padding-right: .18em;
}
.maplibregl-popup-content {
  border-radius: 16px;
  padding: 0;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(15,42,35,.22);
  background: #f8f5e9;
}
.maplibregl-popup-close-button { right: 6px; top: 5px; font-size: 18px; color: var(--ink-soft); }
.stop-popup { width: min(290px, 70vw); padding: 1rem; }
.stop-popup .eyebrow { margin: 0 0 .4rem; }
.stop-popup h4 { margin: 0 0 .45rem; font: 700 1.35rem/1.1 var(--serif); }
.stop-popup p { margin: .25rem 0; color: var(--ink-soft); line-height: 1.45; font-size: .82rem; }
.stop-popup .stop-time { font-weight: 800; color: var(--berry); }
.stop-hours {
  margin-top: .7rem;
  padding: .68rem .72rem;
  border-radius: 12px;
  background: rgba(227,234,211,.72);
  border: 1px solid rgba(23,53,47,.09);
}
.stop-hours span,
.stop-hours strong,
.stop-hours small { display: block; }
.stop-hours span { margin-bottom: .22rem; color: var(--ink-soft); font-size: .64rem; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.stop-hours strong { color: var(--ink); font-size: .79rem; line-height: 1.35; }
.stop-hours small { margin-top: .25rem; color: var(--ink-soft); font-size: .68rem; line-height: 1.35; }
.stop-popup a { display: inline-block; margin-top: .7rem; padding: .56rem .72rem; border-radius: 999px; text-decoration: none; background: var(--pine); color: #fff; font-weight: 760; font-size: .78rem; }
.maplibregl-ctrl-attrib { font-size: 9px !important; background: rgba(255,255,255,.72) !important; }

@media (max-width: 800px) {
  .topbar { left: 12px; right: 12px; }
  .progress-pill {
    flex: 1 1 0;
    width: 0;
    min-width: 0;
    max-width: none;
    height: 58px;
    min-height: 58px;
    max-height: 58px;
    grid-template-columns: 52px minmax(0, 1fr);
    grid-template-rows: 18px 18px;
    gap: .15rem .5rem;
    padding: .55rem .72rem;
  }
  #progress-day { grid-column: 1; grid-row: 1; }
  #progress-mile { grid-column: 2; grid-row: 1; }
  #progress-next { display: block; grid-column: 1 / -1; grid-row: 2; font-size: .65rem; }
  .text-button { display: none; }
  .cover { padding: 14vh 18px 10vh; align-items: flex-end; }
  .cover-card { width: 100%; border-radius: 26px; }
  .cover h1 { font-size: clamp(3rem, 15vw, 5.4rem); }
  .manifesto, .chapter, .finish { padding-left: 18px; padding-right: 18px; }
  .wide-card { width: 100%; }
  .mini-grid { grid-template-columns: 1fr; }
  .chapter-title { min-height: 78svh; }
  .chapter-title-card { width: 100%; border-radius: 24px; }
  .steps { gap: 18vh; }
  .story-step { min-height: 78svh; align-items: flex-end; padding-bottom: 8vh; }
  .story-step.align-right { justify-content: flex-start; }
  .story-card { width: 100%; border-radius: 23px; }
  .story-meta { gap: .65rem; }
  .route-range { font-size: .61rem; }
  .media-break { margin-left: -18px; margin-right: -18px; }
  .media-caption { padding: 10vw 20px; }
  .elevation-panel { left: 12px; bottom: 12px; width: calc(100vw - 24px); min-width: calc(100vw - 24px); max-width: calc(100vw - 24px); height: 116px; min-height: 116px; max-height: 116px; }
  .elevation-head { grid-template-columns: 78px minmax(0, 1fr); font-size: clamp(.62rem, 2.2vw, .72rem); }
  .overlay-shell { inset: 0; border-radius: 0; }
  .overlay-content { height: calc(100vh - 88px); padding: 1rem; }
  .info-grid, .checklist-grid { grid-template-columns: 1fr; }
  .explore-bar { align-items: flex-start; padding-right: 58px; }
  .day-filters { position: absolute; left: 12px; right: 12px; top: calc(100% + 8px); justify-content: center; padding: .45rem; background: rgba(248,246,237,.92); border-radius: 999px; box-shadow: 0 10px 30px rgba(18,49,42,.12); }
  .explore-bar .close-button { position: absolute; right: 8px; top: 8px; }
}

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

.map-fallback {
  position: absolute; inset: 0; display: grid; place-content: center; gap: .5rem;
  padding: 2rem; text-align: center; color: var(--ink);
  background: radial-gradient(circle at 30% 20%, rgba(225,182,75,.24), transparent 32%), linear-gradient(145deg, #dce8d5, #b8d0c5);
}
.map-fallback strong { font: 700 1.5rem/1.1 var(--serif); }
.map-fallback span { max-width: 34rem; color: var(--ink-soft); }
.map-unavailable .story-card, .map-unavailable .chapter-title-card, .map-unavailable .cover-card { background: rgba(248,246,237,.96); }

@media (max-width: 800px) {
  .step-gallery.multi { grid-template-columns: 1fr; }
}


/* Curated supplied-photo layout */
.cover {
  display: grid;
  grid-template-columns: minmax(0, 620px) minmax(340px, 1fr);
  gap: clamp(1.25rem, 3vw, 3rem);
}
.cover-visuals {
  width: min(680px, 100%);
  justify-self: end;
  display: grid;
  grid-template-columns: 1.4fr .6fr;
  grid-template-rows: minmax(220px, 1fr) minmax(150px, .7fr);
  gap: .75rem;
}
.cover-photo {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-radius: 24px;
  min-height: 0;
  border: 1px solid rgba(255,255,255,.48);
  box-shadow: 0 24px 70px rgba(17,44,38,.22);
  background: #e9e6da;
}
.cover-photo-main { grid-column: 1 / -1; }
.cover-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cover-photo-portrait img { object-fit: contain; background: #d9d8d1; }
.cover-photo figcaption,
.manifesto-visuals figcaption {
  position: absolute;
  left: .7rem;
  bottom: .65rem;
  padding: .32rem .55rem;
  border-radius: 999px;
  color: white;
  background: rgba(17,38,33,.66);
  font-size: .67rem;
  font-weight: 800;
  letter-spacing: .025em;
  backdrop-filter: blur(8px);
}
.manifesto-visuals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .75rem;
  margin-top: 1.2rem;
}
.manifesto-visuals figure {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  margin: 0;
  min-height: 180px;
  box-shadow: 0 14px 34px rgba(20,49,42,.14);
}
.manifesto-visuals img { width: 100%; height: 100%; object-fit: cover; display: block; }
.story-card { width: min(590px, 92vw); }
.step-gallery.multi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.step-gallery.count-2 { grid-template-columns: 1.2fr .8fr; }
.step-gallery.count-3 .step-photo:first-child,
.step-gallery.count-5 .step-photo:first-child { grid-column: 1 / -1; }
.step-gallery.count-3 .step-photo:first-child .step-image,
.step-gallery.count-5 .step-photo:first-child .step-image { aspect-ratio: 16 / 9; }
.step-photo {
  position: relative;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  border-radius: 19px;
  background: #ece7d8;
  box-shadow: 0 16px 38px rgba(20,49,42,.16);
}
.story-card .step-photo .step-image {
  display: block;
  border-radius: 0;
  box-shadow: none;
  min-height: 185px;
}
.step-photo.fit-contain .step-image {
  object-fit: contain;
  padding: .4rem;
  background: #e9e3d3;
}
.step-photo figcaption {
  position: absolute;
  left: .55rem;
  right: auto;
  bottom: .55rem;
  max-width: calc(100% - 1.1rem);
  padding: .3rem .5rem;
  border-radius: 999px;
  color: #fff;
  background: rgba(20,45,39,.73);
  font-size: .65rem;
  font-weight: 760;
  line-height: 1.2;
  backdrop-filter: blur(8px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.step-photo.fit-contain figcaption { background: rgba(20,45,39,.82); }
@media (max-width: 1000px) {
  .cover { grid-template-columns: 1fr; }
  .cover-visuals { justify-self: stretch; width: 100%; max-width: 720px; }
}
@media (max-width: 800px) {
  .cover-visuals { grid-template-columns: 1fr 1fr; grid-template-rows: 210px 155px; }
  .manifesto-visuals { grid-template-columns: 1fr; }
  .step-gallery.multi,
  .step-gallery.count-2 { grid-template-columns: 1fr; }
  .step-gallery.count-3 .step-photo:first-child,
  .step-gallery.count-5 .step-photo:first-child { grid-column: auto; }
  .story-card .step-photo .step-image { min-height: 210px; }
}

@keyframes rider-join-pop {
  0% { scale: 1; }
  42% { scale: 1.18; }
  100% { scale: 1; }
}
.bike-pack.rider-joined span {
  animation: rider-join-pop 520ms cubic-bezier(.2,.8,.2,1);
}
@media (prefers-reduced-motion: reduce) {
  .bike-pack.rider-joined span { animation: none; }
}

@media (max-width: 420px) {
  .topbar { gap: 8px; }
  .round-button { width: 44px; height: 44px; }
  .progress-pill { height: 56px; min-height: 56px; max-height: 56px; padding-left: .62rem; padding-right: .62rem; }
  .progress-pill span { font-size: .66rem; }
  .progress-pill strong { font-size: .74rem; }
  .elevation-panel { height: 112px; min-height: 112px; max-height: 112px; }
  .elevation-head { grid-template-columns: 72px minmax(0, 1fr); font-size: .61rem; }
}


/* Smaller desktop story cards preserve more of the map and rider pack. */
@media (min-width: 801px) {
  .story-card:not(.wide-card) {
    width: min(472px, 74vw);
    padding: clamp(1rem, 2.05vw, 1.6rem);
    border-radius: 21px;
  }
  .story-card:not(.wide-card) h3 { font-size: clamp(1.6rem, 3.2vw, 2.88rem); }
  .story-card:not(.wide-card) p { font-size: .82rem; line-height: 1.6; }
  .story-card:not(.wide-card) .eyebrow { font-size: .58rem; }
  .story-card:not(.wide-card) .route-range { font-size: .55rem; }
  .story-card:not(.wide-card) .step-gallery { margin-top: 1.05rem; gap: .52rem; }
  .story-card:not(.wide-card) .step-photo .step-image { min-height: 148px; }
  .story-card:not(.wide-card) .step-photo figcaption { font-size: .56rem; }
  .wide-card {
    width: min(624px, 78vw);
    padding: clamp(1.2rem, 2.4vw, 2.15rem);
  }
  .wide-card h2 { font-size: clamp(1.85rem, 4vw, 3.84rem); }
  .wide-card > p { font-size: .84rem; line-height: 1.58; }
  .wide-card .mini-grid strong { font-size: .95rem; }
  .wide-card .mini-grid span { font-size: .68rem; }
}

.bike-shop-note {
  max-width: 1080px;
  margin: 0 auto 1rem;
  padding: .9rem 1rem;
  border-radius: 16px;
  background: rgba(225,182,75,.13);
  border: 1px solid rgba(169,126,24,.18);
  color: var(--ink-soft);
  line-height: 1.5;
  font-size: .84rem;
}
.bike-shop-table a { color: var(--pine); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.bike-shop-table small { color: var(--ink-soft); line-height: 1.35; }
.bike-shop-table td:nth-child(1), .bike-shop-table td:nth-child(4) { white-space: nowrap; }



/* Toggleable night palette */
html[data-color-mode="dark"] {
  color-scheme: dark;
  --cream: #101a1b;
  --cream-deep: #172426;
  --paper: rgba(18, 30, 31, .975);
  --ink: #edf3ea;
  --ink-soft: #b8c9c3;
  --pine: #9ccbb1;
  --fern: #9bc989;
  --river: #8bb9ca;
  --sky: #6d94a3;
  --berry: #ed8fa2;
  --sun: #e8c76e;
  --dusk: #bc8fa8;
  --shadow: 0 24px 70px rgba(0, 0, 0, .48);
}
html[data-color-mode="dark"] body { background: #081113; }
html[data-color-mode="dark"] #map { background: #101b1d; }
#map .maplibregl-canvas { transition: filter 260ms ease; }
html[data-color-mode="dark"] #map .maplibregl-canvas { filter: brightness(.55) saturate(.72) contrast(1.14); }
html[data-color-mode="dark"] #map-tint {
  background:
    radial-gradient(circle at 82% 16%, rgba(122, 170, 158, .08), transparent 30%),
    linear-gradient(90deg, rgba(3, 12, 14, .33), rgba(5, 13, 17, .12) 52%, rgba(2, 8, 12, .25));
}
html[data-color-mode="dark"] body[data-theme="dusk"] #map-tint {
  background:
    linear-gradient(180deg, rgba(10, 13, 25, .20), rgba(53, 25, 45, .42)),
    radial-gradient(circle at 78% 18%, rgba(232, 170, 98, .10), transparent 34%);
}
html[data-color-mode="dark"] #grain { opacity: .16; mix-blend-mode: overlay; }
html[data-color-mode="dark"] .round-button,
html[data-color-mode="dark"] .text-button,
html[data-color-mode="dark"] .progress-pill,
html[data-color-mode="dark"] .elevation-panel,
html[data-color-mode="dark"] .story-restore {
  color: var(--ink);
  background: rgba(17, 29, 31, .93);
  border-color: rgba(211, 232, 223, .15);
  box-shadow: 0 12px 36px rgba(0,0,0,.36);
}
html[data-color-mode="dark"] .round-button:hover,
html[data-color-mode="dark"] .text-button:hover,
html[data-color-mode="dark"] .story-restore:hover { background: rgba(29, 47, 48, .99); }
html[data-color-mode="dark"] .theme-toggle { color: var(--sun); }
html[data-color-mode="dark"] .cover-card {
  background: linear-gradient(145deg, rgba(20, 34, 34, .992), rgba(15, 26, 29, .982));
  border-color: rgba(173, 210, 192, .17);
}
html[data-color-mode="dark"] .wide-card,
html[data-color-mode="dark"] .story-card,
html[data-color-mode="dark"] .story-step.active .story-card {
  background: rgba(17, 29, 30, .985);
  border-color: rgba(178, 211, 197, .15);
  box-shadow: 0 28px 80px rgba(0,0,0,.48);
}
html[data-color-mode="dark"] .wide-card > p,
html[data-color-mode="dark"] .story-card p { color: #c9d8d2; }
html[data-color-mode="dark"] .cover-stats span,
html[data-color-mode="dark"] .mini-grid > div {
  background: rgba(139, 174, 153, .10);
  border-color: rgba(184, 213, 199, .12);
}
html[data-color-mode="dark"] .route-range {
  background: color-mix(in srgb, var(--chapter-accent, var(--fern)) 18%, #132124);
  color: #d2dfda;
}
html[data-color-mode="dark"] .cover-photo,
html[data-color-mode="dark"] .step-photo,
html[data-color-mode="dark"] .story-card .step-image,
html[data-color-mode="dark"] .step-photo.fit-contain .step-image,
html[data-color-mode="dark"] .cover-photo-portrait img { background: #182527; }
html[data-color-mode="dark"] .chapter-title-card {
  background: linear-gradient(135deg, rgba(14, 40, 37, .98), rgba(28, 63, 60, .93));
}
html[data-color-mode="dark"] .chapter[data-day="2"] .chapter-title-card { background: linear-gradient(135deg, rgba(18, 36, 34, .98), rgba(47, 67, 46, .93)); }
html[data-color-mode="dark"] .chapter[data-day="3"] .chapter-title-card { background: linear-gradient(135deg, rgba(24, 52, 57, .98), rgba(43, 69, 65, .93)); }
html[data-color-mode="dark"] .chapter[data-day="4"] .chapter-title-card { background: linear-gradient(135deg, rgba(27, 43, 55, .98), rgba(66, 45, 68, .93)); }
html[data-color-mode="dark"] .story-hide-button {
  color: var(--ink);
  background: rgba(20, 35, 36, .94);
  border-color: rgba(202, 226, 215, .17);
  box-shadow: 0 7px 20px rgba(0,0,0,.30);
}
html[data-color-mode="dark"] .story-hide-button:hover { background: #243b3c; }
html[data-color-mode="dark"] .chapter-title-card .story-hide-button,
html[data-color-mode="dark"] .media-caption .story-hide-button,
html[data-color-mode="dark"] .finish-card .story-hide-button { color: #fff; background: rgba(6,18,19,.62); }
html[data-color-mode="dark"] .media-break > .media-break-hide-button { color: #fff; background: rgba(6,18,19,.72); border-color: rgba(255,255,255,.28); }
html[data-color-mode="dark"] #elevation-dot { stroke: #112022; }
html[data-color-mode="dark"] .menu-panel {
  background: rgba(13, 24, 26, .985);
  border-right-color: rgba(208, 229, 218, .12);
  box-shadow: 24px 0 60px rgba(0,0,0,.48);
}
html[data-color-mode="dark"] .menu-backdrop { background: rgba(0, 5, 7, .64); }
html[data-color-mode="dark"] .menu-links a:hover,
html[data-color-mode="dark"] .menu-tools button,
html[data-color-mode="dark"] .info-card,
html[data-color-mode="dark"] .route-file,
html[data-color-mode="dark"] .check-group,
html[data-color-mode="dark"] .source-list a,
html[data-color-mode="dark"] .table-wrap {
  background: rgba(119, 153, 139, .08);
  border-color: rgba(190, 216, 203, .12);
}
html[data-color-mode="dark"] .menu-tools button:hover,
html[data-color-mode="dark"] .source-list a:hover { background: rgba(145, 181, 163, .15); }
html[data-color-mode="dark"] .overlay-root { background: rgba(0, 6, 8, .70); }
html[data-color-mode="dark"] .overlay-shell { background: #101b1d; box-shadow: 0 30px 100px rgba(0,0,0,.66); }
html[data-color-mode="dark"] .overlay-top {
  background: rgba(15, 26, 28, .96);
  border-bottom-color: rgba(205, 226, 215, .11);
}
html[data-color-mode="dark"] th { background: #244d45; }
html[data-color-mode="dark"] th,
html[data-color-mode="dark"] td,
html[data-color-mode="dark"] .menu-tools,
html[data-color-mode="dark"] .check-item { border-color: rgba(191, 216, 203, .09); }
html[data-color-mode="dark"] .route-file button { background: #263335; color: #9baaa5; }
html[data-color-mode="dark"] .checklist-toolbar button {
  color: var(--ink);
  background: #1b2b2d;
  border-color: rgba(203, 225, 214, .14);
}
html[data-color-mode="dark"] .explore-bar,
html[data-color-mode="dark"] .day-filters {
  background: rgba(16, 28, 30, .985);
  border-color: rgba(205, 226, 215, .13);
}
html[data-color-mode="dark"] .day-filters button { background: #243437; color: var(--ink-soft); }
html[data-color-mode="dark"] .day-filters button.active { background: #ed8fa2; color: #1a1015; box-shadow: 0 5px 16px rgba(237,143,162,.30); }
html[data-color-mode="dark"] .maplibregl-popup-content { background: #132124; color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.54); }
html[data-color-mode="dark"] .maplibregl-popup-close-button { color: var(--ink-soft); }
html[data-color-mode="dark"] .stop-hours { background: rgba(139, 174, 153, .10); border-color: rgba(190, 216, 203, .11); }
html[data-color-mode="dark"] .maplibregl-popup-anchor-bottom .maplibregl-popup-tip { border-top-color: #132124; }
html[data-color-mode="dark"] .maplibregl-popup-anchor-top .maplibregl-popup-tip { border-bottom-color: #132124; }
html[data-color-mode="dark"] .maplibregl-popup-anchor-left .maplibregl-popup-tip { border-right-color: #132124; }
html[data-color-mode="dark"] .maplibregl-popup-anchor-right .maplibregl-popup-tip { border-left-color: #132124; }
html[data-color-mode="dark"] .maplibregl-ctrl-group,
html[data-color-mode="dark"] .maplibregl-ctrl-attrib { background: rgba(17, 29, 31, .90) !important; color: var(--ink-soft) !important; }
html[data-color-mode="dark"] .maplibregl-ctrl-icon { filter: invert(1) brightness(1.7); }
html[data-color-mode="dark"] .maplibregl-ctrl-attrib a { color: #b9d4ca !important; }
html[data-color-mode="dark"] .map-fallback {
  background: radial-gradient(circle at 30% 20%, rgba(232,199,110,.10), transparent 32%), linear-gradient(145deg, #101d1e, #182b2d);
}
html[data-color-mode="dark"] .map-unavailable .story-card,
html[data-color-mode="dark"] .map-unavailable .chapter-title-card,
html[data-color-mode="dark"] .map-unavailable .cover-card { background: rgba(17,29,30,.98); }


html[data-color-mode="dark"] .menu-theme-toggle {
  background: rgba(139, 174, 153, .10);
  border-color: rgba(184, 213, 199, .13);
  color: var(--ink);
  box-shadow: 0 10px 28px rgba(0,0,0,.25);
}
html[data-color-mode="dark"] .menu-theme-toggle:hover { background: rgba(139,174,153,.18); }
html[data-color-mode="dark"] .menu-theme-icon { background: rgba(232,199,110,.13); color: var(--sun); }
html[data-color-mode="dark"] .bike-shop-note { background: rgba(232,199,110,.08); border-color: rgba(232,199,110,.16); }
html[data-color-mode="dark"] .bike-shop-table a { color: #a9d8c2; }
