:root {
  color-scheme: light;
  --ink: #1f2523;
  --muted: #656f6a;
  --paper: #f7f5f0;
  --page-background: #eef0ec;
  --panel: #ffffff;
  --grouped-panel: #ffffff;
  --banner-surface: var(--paper);
  --home-inactive-tab: var(--banner-surface);
  --note-inactive-tab: #edf0ec;
  --active-tab-ink: #4b514e;
  --primary-button-ink: #ffffff;
  --tab-underline: #d59b6a;
  --note-max-width: 980px;
  --content-panel-shadow: 0 4px 14px rgb(0 0 0 / 16%);
  --full-width-button-shadow: 0 3px 9px rgb(31 37 35 / 18%);
  --line: #d0d5ce;
  --item-divider: #c5c5c1;
  --forest: #4b514e;
  --forest-dark: #6c7772;
  --wordmark: #4e5652;
  --moss: #a2ae9d;
  --route-default-walked: #89f336;
  --route-terrain-outline: rgba(0, 0, 0, .8);
  --route-aerial-ahead: #da2c43;
  --route-walked: var(--route-default-walked);
  --route-ahead: #614051;
  --gold: #d3b96e;
  --lake: #a2ae9d;
  --danger: #c75f61;
  --reminder: #2f7d4a;
  --alert: #d59a00;
  --warning: #c43d35;
  --active-yellow: #ffe600;
  --ui-font: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-family: var(--ui-font);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body[data-public-sample] [data-demo-only],
body:not([data-public-sample]) [data-sample-only] { display: none !important; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  background: var(--page-background);
  color: var(--ink);
  min-width: 320px;
  line-height: 1.5;
}

a { color: inherit; }

.topbar {
  min-height: 68px;
  padding: 0 5vw;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: var(--banner-surface);
}

.brand { display: flex; gap: 10px; align-items: center; text-decoration: none; font-weight: 700; letter-spacing: -.02em; }
.brand-copy { display: grid; gap: 2px; }
.brand-copy > span {
  color: var(--wordmark);
  font: 800 16px/1.2 var(--ui-font);
  letter-spacing: 0;
}
.brand small { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: normal; }
.brand-mark { display: block; flex: none; }
.topbar nav { display: flex; align-items: center; gap: 20px; }
.topbar nav a { color: var(--muted); font-size: 14px; text-decoration: none; }
.topbar nav > a:hover { color: var(--ink); }
.index-tabs {
  --inactive-tab-weight: 400;
  --index-tab-shadow-color: rgb(0 0 0 / 24%);
  --index-tab-shadow: 0 1px 6px var(--index-tab-shadow-color);
  --index-tab-underline: inset 0 -3px var(--tab-underline);
  --index-tab-top-edge: inset 0 1px var(--line);
}
.index-tabs > :is(a, button) {
  color: var(--muted);
  font-size: 16px;
  font-weight: var(--inactive-tab-weight);
  line-height: 1.2;
}
.index-tabs > :is(a, button):not(:is([aria-selected="true"], [aria-current="page"])) {
  box-shadow: inset 0 -6px 6px -6px var(--index-tab-shadow-color);
}
.index-tabs > :is([aria-selected="true"], [aria-current="page"]) {
  position: relative;
  z-index: 1;
  color: var(--active-tab-ink);
  box-shadow: var(--index-tab-underline), var(--index-tab-top-edge),
    inset 1px 0 var(--line), inset -1px 0 var(--line), var(--index-tab-shadow);
  font-weight: 800;
}
.index-tabs > [aria-current="page"] {
  box-shadow: var(--index-tab-underline), var(--index-tab-top-edge),
    inset 1px 0 var(--line), inset -1px 0 var(--line);
}
.index-tabs > [aria-current="page"]::after {
  content: "";
  position: absolute;
  inset: 0;
  box-shadow: var(--index-tab-shadow);
  clip-path: inset(-16px -16px 0);
  pointer-events: none;
}
@media (prefers-color-scheme: dark) {
  .index-tabs { --index-tab-shadow-color: rgb(0 0 0 / 45%); }
}
.note-corner-action {
  width: 44px;
  min-height: 44px;
  flex: none;
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 6px;
  color: var(--forest);
  background: transparent;
  box-shadow: none;
  text-decoration: none;
}
.note-corner-action:hover { color: var(--ink); background: color-mix(in srgb, var(--forest) 12%, transparent); }
.note-corner-action:active { opacity: .72; }
.note-corner-action:focus-visible { outline: 2px solid var(--forest); outline-offset: -3px; }
.note-corner-action svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.maple-corner-actions { display: flex; align-items: center; }
.library-button { min-height: 38px; padding: 0 13px; display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); border-radius: 9px; color: var(--forest); background: var(--panel); font-size: 13px; box-shadow: none; }
.link-preview-card { margin: 8px 0 12px; overflow: hidden; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); }
.link-preview-cover { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; background: var(--banner-surface, var(--panel)); }
.link-preview-details { padding: 10px 12px; }
.link-preview-details strong { display: block; color: var(--ink); font-size: 16px; line-height: 1.3; overflow-wrap: anywhere; }
.link-preview-brand { display: flex; justify-content: flex-end; align-items: center; gap: 5px; margin-top: 8px; color: var(--muted); font-size: 11px; line-height: 1.3; }
.link-preview-brand img { flex: none; object-fit: contain; }
.link-preview-card[hidden], .link-preview-cover[hidden] { display: none; }
.library-button:hover { border-color: var(--forest); background: rgba(162,174,157,.12); }
.library-button svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

main { max-width: 1440px; margin: 0 auto; padding: 48px 5vw 64px; }
.intro { display: flex; align-items: end; justify-content: space-between; gap: 30px; }
.eyebrow { margin: 0 0 7px; color: var(--forest); font-size: 11px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1, h2 { font-weight: 700; letter-spacing: 0; }
h1 { margin-bottom: 10px; max-width: 850px; font-size: 28px; line-height: 1.2; }
h2 { margin-bottom: 0; font-size: 18px; line-height: 1.3; }
.trip-note-title-row { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.trip-note-title-row h1 { min-width: 0; overflow-wrap: anywhere; }
.trip-read-only {
  flex: none;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--forest);
  background: #f0e9da;
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.intro h1, .trip-detail-heading h1, .live-main h1 { font-size: 28px; }
.lede { margin-bottom: 0; max-width: 720px; color: var(--muted); font-size: 16px; line-height: 1.55; }
.actions { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; }
.actions-primary { display: flex; align-items: center; justify-content: flex-end; gap: 9px; }
button { min-height: 44px; border: 0; border-radius: 999px; padding: 0 21px; font: inherit; font-weight: 700; }
button.primary { color: var(--primary-button-ink); background: var(--forest); box-shadow: 0 8px 24px rgba(75, 81, 78, .16); }
button.primary:hover { background: var(--forest-dark); }
.sync-demo-button { min-height: 40px; border: 1px solid var(--line); border-radius: 10px; color: var(--forest); background: var(--panel); box-shadow: none; }
.sync-demo-button:hover { border-color: var(--forest); background: rgba(162,174,157,.12); }
.rehearsal-open, .maple-follow-button, .maple-follow-actions button, .route-alert-banner {
  box-shadow: var(--full-width-button-shadow);
  font-weight: 600;
}
.sync-demo-help { max-width: 250px; margin-top: -5px; color: var(--muted); font-size: 11px; line-height: 1.35; text-align: right; }
button:disabled { cursor: wait; opacity: .6; }
.connection { color: var(--muted); font-size: 12px; }
.connection i { display: inline-block; width: 8px; height: 8px; margin-right: 6px; border-radius: 50%; background: var(--gold); }
.connection.online i { background: var(--forest); box-shadow: 0 0 0 4px rgba(75, 81, 78, .12); }

.content-index { margin: 40px 0 24px; }
.content-index-heading { margin-bottom: 10px; display: flex; align-items: end; justify-content: space-between; gap: 24px; }
.content-index-heading > p { max-width: 440px; margin: 0; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: right; }
.content-index-links { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: rgba(255,255,255,.32); }
.content-index-links a { min-height: 72px; padding: 14px 16px; display: flex; flex-direction: column; justify-content: center; gap: 4px; border-right: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.content-index-links a:last-child { border-right: 0; }
.content-index-links a:hover, .content-index-links a:focus-visible { background: rgba(162,174,157,.16); box-shadow: inset 0 -3px var(--forest); outline: none; }
.content-index-links strong { font-size: 13px; }
.content-index-links small { color: var(--muted); font-size: 11px; line-height: 1.35; }
#trace, #description, #photos, #elevation, #start-finish, #weather { scroll-margin-top: 20px; }

.metrics { display: grid; grid-template-columns: repeat(4, 1fr); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.metrics article { padding: 23px 18px 22px 0; display: flex; flex-direction: column; }
.metrics span, .metrics small { color: var(--muted); font-size: 11px; }
.metrics strong { margin: 4px 0 3px; font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; font-variant-numeric: tabular-nums; }

.replay-controls { position: relative; z-index: 1000; margin: -14px -16px 14px; padding: 13px 16px 12px; display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 9px 20px; border-bottom: 1px solid var(--line); border-radius: 12px 12px 0 0; background: rgba(162,174,157,.1); }
#replay-clock { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(0, 1fr) minmax(9.25rem, 1.25fr) minmax(0, 1fr); border: 1px solid var(--line); border-radius: 999px; box-shadow: 0 8px 24px rgba(75,81,78,.16); }
#replay-clock .play-button { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px; min-width: 0; padding: 6px 10px; border-inline: 1px solid var(--line); border-radius: 0; box-shadow: none; }
.play-button:focus-visible { z-index: 1; outline: 2px solid currentColor; outline-offset: -4px; }
.play-button:disabled { cursor: not-allowed; }
#replay-icon { flex: 0 0 12px; font-size: 12px; }
.replay-time { display: grid; place-content: center; gap: 2px; min-height: 54px; padding: 6px 3px; text-align: center; }
.replay-time-label { font-size: 12px; font-weight: 600; }
.replay-time strong { font: 700 25px/1 Georgia, "Times New Roman", serif; font-variant-numeric: tabular-nums; }
.replay-time.is-walked { border-radius: 999px 0 0 999px; color: #1f2523; background: var(--route-walked); }
.replay-time.is-ahead { border-radius: 0 999px 999px 0; color: #fff; background: var(--route-ahead); }
#replay-status { min-width: 0; overflow: hidden; color: var(--muted); font-size: 12px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.replay-total-time { justify-self: center; color: var(--ink); font-size: 18px; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
#replay-timeline { --replay-progress: 0%; grid-column: 1 / -1; width: 100%; height: 22px; margin: 0; appearance: none; -webkit-appearance: none; border: 0; border-radius: 999px; background: linear-gradient(to right, var(--route-walked) 0 var(--replay-progress), var(--route-ahead) var(--replay-progress) 100%) center / calc(100% - 2px) 6px no-repeat, linear-gradient(var(--line), var(--line)) center / 100% 8px no-repeat; cursor: pointer; }
#replay-timeline::-webkit-slider-runnable-track { height: 8px; border-radius: 999px; background: transparent; }
#replay-timeline::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -5px; appearance: none; -webkit-appearance: none; border: 3px solid var(--panel); border-radius: 50%; background: var(--route-walked); box-shadow: 0 2px 7px rgba(31,37,35,.34); }
#replay-timeline::-moz-range-track { height: 8px; border-radius: 999px; background: transparent; }
#replay-timeline::-moz-range-thumb { width: 12px; height: 12px; border: 3px solid var(--panel); border-radius: 50%; background: var(--route-walked); box-shadow: 0 2px 7px rgba(31,37,35,.34); }
#replay-timeline:focus-visible { outline: 3px solid color-mix(in srgb, var(--route-walked) 45%, transparent); outline-offset: 2px; }
:is(.trip-photo-index, .maple-photo-index) .photo-slideshow-toggle { color: var(--forest); font-size: 12px; }
:is(.trip-photo-index, .maple-photo-index) .photo-slideshow-toggle::before { content: none; }
#replay-timeline:disabled { cursor: not-allowed; }
.speed-control { justify-self: end; display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: 11px; font-weight: 700; }
.speed-control select { min-inline-size: 5rem; min-height: 38px; padding: 0 30px 0 11px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel); font: inherit; font-variant-numeric: tabular-nums; }

.rehearsal-open { position: relative; width: 100%; min-height: 48px; display: inline-flex; align-items: center; justify-content: center; gap: 9px; border: 1px solid var(--forest); color: var(--primary-button-ink); background: var(--forest); }
.rehearsal-open:hover:not(:disabled), .rehearsal-open:focus-visible { background: var(--forest-dark); }
.rehearsal-open::after, .play-button::after { content: attr(data-tooltip); position: absolute; z-index: 1200; left: 50%; bottom: calc(100% + 8px); width: max-content; max-width: min(420px, calc(100vw - 56px)); padding: 8px 10px; border-radius: 7px; color: #fff; background: rgba(23,39,33,.98); box-shadow: 0 7px 22px rgba(31,37,35,.3); font-size: 11px; font-weight: 600; line-height: 1.4; opacity: 0; pointer-events: none; transform: translate(-50%, 4px); transition: opacity .16s ease, transform .16s ease; }
.rehearsal-open:hover::after, .rehearsal-open:focus-visible::after, .play-button:hover::after, .play-button:focus-visible::after { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }

.rehearsal-dialog {
  --chapter-accent: #f9d65a;
  --chapter-walked: #ffce1b;
  --chapter-playhead: #89f336;
  --chapter-progress-outline: rgb(13 27 20 / 88%);
  --chapter-progress-outline-width: 1px;
  --chapter-light-text: #f4f6ed;
  --chapter-gutter: clamp(14px, 3vw, 44px);
  width: 100%;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 0;
  color: #fff;
  background: #2e4838;
}
.rehearsal-dialog::backdrop { background: #263c30; }
.rehearsal-shell {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(164px, 242px);
  grid-template-rows: auto auto minmax(72px, 1fr) auto auto auto;
  grid-template-areas:
    "heading heading"
    "chapter minimap"
    ". ."
    "note telemetry"
    "progress progress"
    "controls controls";
  min-height: 100%;
}
.rehearsal-illustrated {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  background: #2e4838;
}
.rehearsal-plate {
  position: absolute;
  inset: -8%;
  width: 116%;
  height: 116%;
  object-fit: cover;
  object-position: center;
  filter: brightness(var(--rehearsal-brightness, 1.025)) saturate(1.04);
}
.rehearsal-plate-approach {
  transform: translate3d(var(--approach-x, 0px), var(--approach-y, 0px), 0) scale(var(--approach-scale, 1));
}
.rehearsal-plate-overlook {
  opacity: var(--reveal, 0);
  transform: translate3d(var(--overlook-x, 0px), 0, 0) scale(var(--overlook-scale, 1));
}
.rehearsal-plate-foreground {
  object-fit: fill;
  opacity: var(--foreground-opacity, 1);
  transform: translate3d(var(--foreground-x, 0px), var(--foreground-y, 0px), 0) scale(var(--foreground-scale, 1));
}
.rehearsal-plate-shot { visibility: hidden; }
.rehearsal-plate-shot.is-current {
  visibility: visible;
  object-position: var(--shot-position, center);
  transform: translate3d(var(--shot-x, 0px), var(--shot-y, 0px), 0) scale(var(--shot-scale, 1));
}
.rehearsal-motion { visibility: hidden; pointer-events: none; }
.rehearsal-motion.is-current { visibility: visible; }
.rehearsal-illustrated:has(.rehearsal-plate-framed.is-current)
  :is(.rehearsal-plate-framed.is-current, .rehearsal-motion) {
  inset: 0;
  width: 100%;
  height: 100%;
}
.rehearsal-shade {
  position: absolute;
  z-index: -1;
  inset: 0;
  background: linear-gradient(180deg, rgb(16 33 23 / 61%), transparent 27%, transparent 72%, rgb(20 38 29 / 43%));
}
.rehearsal-header {
  grid-area: heading;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px var(--chapter-gutter) 12px;
}
.rehearsal-header h2 { font-size: clamp(25px, 3vw, 40px); line-height: 1.03; text-shadow: 0 2px 14px rgb(12 30 21 / 75%); }
.rehearsal-header .eyebrow { color: var(--chapter-light-text); text-shadow: 0 1px 7px #172d20; }
.rehearsal-header-actions { display: flex; align-items: center; gap: 8px; }
.rehearsal-dialog.overlays-hidden [data-rehearsal-overlay] { display: none; }
.rehearsal-dialog.overlays-hidden .rehearsal-header-actions { margin-inline-start: auto; padding-inline-end: 52px; }
.rehearsal-safety { padding: 6px 10px; border-radius: 6px; color: var(--chapter-light-text); background: rgb(24 43 32 / 90%); font-size: 12px; }
.rehearsal-audio, .rehearsal-overlays, .rehearsal-close, .rehearsal-controls button {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 8px;
  color: #fff;
  background: rgb(24 43 32 / 92%);
}
.rehearsal-close { width: 44px; padding: 0; font-size: 27px; line-height: 1; }
.rehearsal-overlays { display: grid; place-items: center; width: 44px; padding: 0; }
.rehearsal-overlays svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.rehearsal-overlays[aria-pressed="true"] .rehearsal-eye-closed, .rehearsal-overlays[aria-pressed="false"] .rehearsal-eye-open { display: none; }
.rehearsal-overlays[aria-pressed="false"] { border-color: transparent; background: transparent; filter: drop-shadow(0 1px 3px #14261d); }
.rehearsal-audio { padding: 0 12px; font-size: 13px; }
.rehearsal-audio[aria-pressed="true"] { color: var(--chapter-accent); border-color: var(--chapter-accent); }
.rehearsal-camera-cue, .rehearsal-minimap, .rehearsal-telemetry {
  align-self: start;
  border: 1px solid rgb(244 247 235 / 30%);
  border-radius: 8px;
  color: #f8f9f3;
  background: rgb(20 38 29 / 85%);
}
.rehearsal-camera-cue {
  grid-area: chapter;
  justify-self: start;
  display: grid;
  gap: 3px;
  max-width: calc(100% - var(--chapter-gutter));
  margin-inline-start: var(--chapter-gutter);
  padding: 8px 10px;
  overflow-wrap: anywhere;
  background: rgb(20 38 29 / 56%);
}
.rehearsal-chapter-caption { font: 500 clamp(16px, 2vw, 22px)/1.12 Georgia, "Times New Roman", serif; }
#rehearsal-camera-label { color: #dbe6d7; font-size: 11px; font-weight: 600; }
.rehearsal-minimap, .rehearsal-telemetry { margin-inline-end: var(--chapter-gutter); }
.rehearsal-minimap { grid-area: minimap; justify-self: end; width: min(100%, 184px); padding: 8px 10px; background: rgb(20 38 29 / 64%); }
.rehearsal-minimap svg { display: block; width: 100%; height: clamp(54px, 11dvh, 90px); overflow: visible; }
#rehearsal-minimap-base, #rehearsal-minimap-progress { fill: none; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
#rehearsal-minimap-base { stroke: var(--chapter-light-text); stroke-width: 3; }
#rehearsal-minimap-progress { stroke: var(--chapter-walked); stroke-width: 4; }
#rehearsal-minimap-moments circle { fill: #203b2b; stroke: var(--chapter-light-text); stroke-width: 1; vector-effect: non-scaling-stroke; }
#rehearsal-minimap-marker { fill: var(--chapter-playhead); stroke: var(--chapter-progress-outline); stroke-width: var(--chapter-progress-outline-width); vector-effect: non-scaling-stroke; }
.rehearsal-focus {
  grid-area: note;
  align-self: end;
  width: min(420px, calc(100% - 2 * var(--chapter-gutter)));
  margin-inline-start: var(--chapter-gutter);
  padding: 12px 14px;
  border: 1px solid rgb(244 247 235 / 30%);
  border-radius: 8px;
  color: var(--chapter-light-text);
  background: rgb(20 38 29 / 78%);
  box-shadow: 0 5px 20px rgb(18 33 24 / 20%);
}
.rehearsal-focus.has-photo {
  display: grid;
  grid-template-columns: minmax(78px, 32%) minmax(0, 1fr);
  align-items: start;
  gap: 2px 12px;
  width: min(520px, calc(100% - 2 * var(--chapter-gutter)));
}
.rehearsal-photo-button {
  position: relative;
  grid-row: 1 / span 3;
  align-self: stretch;
  display: block;
  width: 100%;
  min-height: 70px;
  padding: 0;
  border: 0;
  border-radius: 5px;
  background: #173027;
}
.rehearsal-photo-button[hidden] { display: none; }
#rehearsal-focus-photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}
.rehearsal-photo-button svg {
  position: absolute;
  right: 5px;
  bottom: 5px;
  width: 25px;
  height: 25px;
  padding: 4px;
  border-radius: 50%;
  color: var(--chapter-light-text);
  background: rgb(20 38 29 / 85%);
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.rehearsal-photo-detail {
  width: min(560px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  margin: auto;
  padding: 14px;
  border: 1px solid rgb(244 247 235 / 30%);
  border-radius: 12px;
  color: var(--chapter-light-text);
  background: #182b20;
}
.rehearsal-photo-detail::backdrop { background: rgb(13 27 20 / 68%); }
.rehearsal-photo-detail header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.rehearsal-photo-detail h3 { margin: 0; font: 500 22px/1.15 Georgia, "Times New Roman", serif; }
.rehearsal-photo-detail img { display: block; width: 100%; max-height: 55dvh; object-fit: contain; border-radius: 8px; }
.rehearsal-photo-detail p { margin-block: 8px 0; line-height: 1.4; }
#rehearsal-photo-credit { color: #dbe6d7; font-size: 12px; }
.rehearsal-focus .eyebrow { margin-bottom: 4px; color: #dbe6d7; }
.rehearsal-focus h3 { margin: 0; font: 500 clamp(21px, 2.5vw, 30px)/1.05 Georgia, "Times New Roman", serif; }
#rehearsal-focus-copy { margin: 4px 0 0; font-size: 14px; line-height: 1.4; }
.rehearsal-telemetry {
  grid-area: telemetry;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}
.rehearsal-telemetry div { display: grid; align-content: center; gap: 3px; min-height: 50px; padding: 6px 8px; border-right: 1px solid rgb(244 247 235 / 20%); }
.rehearsal-telemetry div:nth-child(even) { border-right: 0; }
.rehearsal-telemetry div:nth-child(-n+2) { border-bottom: 1px solid rgb(244 247 235 / 20%); }
.rehearsal-telemetry span { color: #e0e8dd; font-size: 11px; }
.rehearsal-telemetry strong { color: var(--chapter-accent); font-size: 14px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.rehearsal-route { grid-area: progress; margin-inline: var(--chapter-gutter); }
#rehearsal-scrubber {
  --film-progress: 0%;
  width: 100%;
  height: 34px;
  margin: 0;
  display: block;
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  border-radius: 7px;
  background: linear-gradient(to right, var(--chapter-walked) 0 var(--film-progress), var(--chapter-light-text) var(--film-progress) 100%) center / calc(100% - 12px) 4px no-repeat,
    linear-gradient(var(--chapter-progress-outline), var(--chapter-progress-outline)) center / calc(100% - 10px) 6px no-repeat;
  cursor: pointer;
  touch-action: pan-y;
}
#rehearsal-scrubber:disabled { cursor: default; }
#rehearsal-scrubber:focus-visible { outline: 2px solid var(--chapter-accent); outline-offset: 2px; }
#rehearsal-scrubber::-webkit-slider-thumb {
  appearance: none;
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  border: var(--chapter-progress-outline-width) solid var(--chapter-progress-outline);
  border-radius: 50%;
  background: var(--chapter-playhead);
}
#rehearsal-scrubber::-moz-range-thumb {
  box-sizing: border-box;
  width: 12px;
  height: 12px;
  border: var(--chapter-progress-outline-width) solid var(--chapter-progress-outline);
  border-radius: 50%;
  background: var(--chapter-playhead);
}
.rehearsal-controls {
  grid-area: controls;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: end;
  gap: 8px;
  max-width: none;
  margin: 0;
  padding: 0 var(--chapter-gutter) max(14px, env(safe-area-inset-bottom));
  border: 0;
  background: transparent;
}
.rehearsal-transport { grid-column: 2; display: flex; align-items: center; gap: 8px; }
.rehearsal-controls button { font-size: 13px; }
.rehearsal-controls .rehearsal-skip { display: grid; place-items: center; width: 44px; padding: 0; }
.rehearsal-skip svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rehearsal-controls .rehearsal-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 90px;
  padding-inline: 10px;
  border-color: var(--chapter-accent);
  color: var(--chapter-accent);
}
.rehearsal-controls > p {
  justify-self: end;
  align-self: center;
  margin: 0;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--chapter-light-text);
  background: rgb(24 43 32 / 90%);
  font-size: 12px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}
.rehearsal-dialog button { transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease; }
.rehearsal-dialog button:focus-visible { outline: 2px solid var(--chapter-accent); outline-offset: 3px; }
@media (hover: hover) {
  .rehearsal-audio:hover, .rehearsal-overlays:hover, .rehearsal-close:hover, .rehearsal-controls button:hover:not(:disabled) { background: #385743; box-shadow: 0 3px 10px rgb(16 31 23 / 24%); }
}
@media (max-width: 640px) {
  .rehearsal-shell {
    grid-template-columns: minmax(0, 1fr) minmax(132px, 37%);
    grid-template-rows: auto auto minmax(60px, 1fr) auto auto auto auto;
    grid-template-areas:
      "heading heading"
      "chapter minimap"
      ". ."
      "note note"
      "telemetry telemetry"
      "progress progress"
      "controls controls";
  }
  .rehearsal-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas: "label actions" "title title";
    align-items: center;
    gap: 5px;
    padding-block: 14px 9px;
  }
  .rehearsal-header > div:first-child { display: contents; }
  .rehearsal-header h2 { grid-area: title; font-size: clamp(20px, 5vw, 26px); }
  .rehearsal-header .eyebrow { grid-area: label; font-size: 10px; }
  .rehearsal-header-actions { grid-area: actions; }
  .rehearsal-safety { display: none; }
  .rehearsal-climb-close :is(#rehearsal-shot-climb.is-current, .rehearsal-motion) { object-position: 77% center; }
  .rehearsal-illustrated:has(#rehearsal-shot-descent-aerial.is-current)
    :is(.rehearsal-plate-shot.is-current, .rehearsal-motion) { top: -16%; object-position: 44% center; }
  .rehearsal-audio { padding-inline: 8px; font-size: 12px; }
  .rehearsal-minimap { padding-inline: 6px; }
  .rehearsal-focus, .rehearsal-focus.has-photo { width: auto; margin-inline: var(--chapter-gutter); padding: 10px; }
  .rehearsal-telemetry {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    margin: 6px var(--chapter-gutter) 0;
  }
  .rehearsal-telemetry div:nth-child(n) { min-height: 44px; padding: 4px 5px; border-right: 1px solid rgb(244 247 235 / 20%); border-bottom: 0; }
  .rehearsal-telemetry div:last-child { border-right: 0; }
  .rehearsal-telemetry strong { font-size: 12px; }
  .rehearsal-controls { grid-template-columns: auto minmax(0, 1fr); gap: 6px; }
  .rehearsal-transport { grid-column: 1; gap: 6px; }
  .rehearsal-controls button { font-size: 12px; }
  .rehearsal-controls .rehearsal-play { gap: 5px; }
  .rehearsal-controls > p { padding-inline: 6px; font-size: 11px; }
}

.visuals, .story-grid { display: grid; gap: 20px; margin-top: 20px; }
.visuals { grid-template-columns: minmax(0, 1fr); }
.story-grid { grid-template-columns: 1fr 1fr; }
.panel { padding: 24px; border: 1px solid var(--line); border-radius: 16px; background: var(--panel); box-shadow: 0 8px 35px rgba(31, 37, 35, .035); }
.panel-heading { min-height: 44px; display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.warning, .legend, #photo-sequence { color: var(--muted); font-size: 11px; }
.map-modes { position: absolute; z-index: 680; top: 10px; right: 10px; display: flex; gap: 3px; pointer-events: none; }
.map-modes button, .map-icon-button { position: relative; width: 40px; min-height: 40px; padding: 0; display: grid; place-items: center; border-radius: 8px; color: var(--map-control-ink); background: transparent; pointer-events: auto; }
.map-modes button:focus-visible, .map-icon-button:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
.map-modes button.selected, .map-icon-button[aria-pressed="true"] { box-shadow: inset 0 0 0 1px currentColor; }
.map-modes button svg, .map-icon-button svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 2px var(--map-control-halo)); }
.map-icon-button { position: absolute; z-index: 690; right: 10px; bottom: 8px; }
.map-modes, #tile-map .leaflet-control-zoom, .map-icon-button, .map-key {
  border: 1px solid var(--map-control-edge);
  border-radius: 9px;
  background: var(--map-control-glass);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.map-modes button:hover:not(:disabled),
.map-icon-button:hover:not(:disabled),
#tile-map .leaflet-control-zoom a:hover:not(.leaflet-disabled) {
  background: var(--map-control-hover);
  box-shadow: inset 0 0 0 1px var(--map-control-hover-edge);
}
.map-modes button::after, .map-icon-button::after { content: attr(data-tooltip); position: absolute; z-index: 1; right: 0; width: max-content; max-width: 170px; padding: 6px 8px; border-radius: 6px; color: #fff; background: #343936; font-size: 11px; font-weight: 700; line-height: 1.2; opacity: 0; pointer-events: none; transition: opacity .15s ease; }
.map-modes button::after { top: calc(100% + 5px); }
.map-icon-button::after { bottom: calc(100% + 5px); }
.map-modes button:hover::after, .map-modes button:focus-visible::after, .map-icon-button:not([aria-pressed="true"]):hover::after, .map-icon-button:not([aria-pressed="true"]):focus-visible::after { opacity: 1; }
.map-alert-placement {
  --map-alert-crosshair-size: 84px;
  --map-alert-crosshair-color: #ff3131;
  position: absolute; z-index: 695; inset: 0; pointer-events: none;
}
.route-wrap[data-map-mode="terrain"] .map-alert-placement { --map-alert-crosshair-color: #ff0090; }
.route-wrap[data-map-mode="aerial"] .map-alert-placement { --map-alert-crosshair-color: #89f336; }
.map-alert-placement[hidden], .map-placement-zoom[hidden] { display: none; }
.map-alert-crosshair {
  position: absolute; top: 50%; left: 50%; width: var(--map-alert-crosshair-size);
  height: var(--map-alert-crosshair-size); transform: translate(-50%, -50%);
}
.map-alert-crosshair path {
  fill: none; stroke: var(--map-alert-crosshair-color); stroke-width: 2.75px; vector-effect: non-scaling-stroke;
}
.map-alert-crosshair circle { fill: var(--map-alert-crosshair-color); }
.map-alert-instructions {
  position: absolute; top: calc(50% + var(--map-alert-crosshair-size) / 2 + 10px); left: 50%;
  width: max-content; max-width: calc(100% - 24px);
  display: flex; align-items: center; gap: 10px; padding: 5px 5px 5px 12px; transform: translateX(-50%);
  border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: var(--panel);
  box-shadow: 0 4px 16px rgba(23,28,25,.22); font-size: 12px; font-weight: 650; line-height: 1.35;
}
.map-alert-actions { display: flex; gap: 4px; }
.map-alert-actions button { width: 44px; min-height: 44px; padding: 0; display: grid; place-items: center; border-radius: 7px; pointer-events: auto; }
.map-alert-actions button:not(.primary) { border: 1px solid var(--line); color: var(--ink); background: var(--panel); }
.map-alert-actions button:not(.primary):hover { background: color-mix(in srgb, var(--panel) 85%, var(--ink)); }
.map-alert-actions svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.map-modes.map-placement-zoom { right: auto; left: 10px; }
.map-placement-zoom button { font-size: 20px; }
.map-placement-zoom button::after { content: none; }
.legend { display: flex; align-items: center; gap: 7px; }
.legend i { width: 18px; height: 3px; border-radius: 3px; background: var(--route-walked); }
.legend i:nth-of-type(2) { background: var(--route-ahead); }
.legend i:nth-of-type(3) { background: var(--gold); }
.route-wrap {
  --map-control-ink: #252b28;
  --map-control-halo: #fff;
  --map-control-hover: rgba(255,255,255,.82);
  --map-control-hover-edge: rgba(37,43,40,.4);
  --map-control-glass: rgba(255,255,255,.42);
  --map-control-edge: rgba(255,255,255,.5);
  position: relative;
  height: clamp(420px, 48vw, 680px);
  border-radius: 11px;
}
.route-wrap::after {
  content: "";
  position: absolute;
  z-index: 650;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: inherit;
  pointer-events: none;
}
.route-wrap[data-map-mode="default"] {
  --map-control-ink: var(--ink);
  --map-control-halo: var(--panel);
  --map-control-hover: color-mix(in srgb, var(--panel) 81%, var(--ink));
  --map-control-hover-edge: color-mix(in srgb, var(--ink) 45%, transparent);
  --map-control-glass: color-mix(in srgb, var(--panel) 42%, transparent);
  --map-control-edge: color-mix(in srgb, var(--line) 65%, transparent);
}
.route-wrap[data-map-mode="aerial"] {
  --map-control-ink: #fff;
  --map-control-halo: #171c19;
  --map-control-hover: rgba(23,28,25,.91);
  --map-control-hover-edge: rgba(255,255,255,.72);
  --map-control-glass: rgba(23,28,25,.48);
  --map-control-edge: rgba(255,255,255,.29);
}
#route-chart, .tile-map { display: block; width: 100%; height: 100%; border-radius: inherit; }
#route-chart[hidden], .tile-map[hidden] { display: none; }
#elevation-chart { width: 100%; height: auto; display: block; overflow: visible; }
.tile-map { overflow: hidden; background: #e4e6e2; }
.google-route-map { position: absolute; inset: 0; visibility: hidden; border-radius: inherit; }
.google-route-map[data-active] { visibility: visible; }
.google-route-map iframe { display: block; width: 100%; height: 100%; border: 0; }
.route-wrap[data-google-map] :is(.map-key, .map-icon-button) { bottom: 26px; }
.route-basemap-status { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.placing-alert #route-chart { cursor: grab; touch-action: none; }
.placing-alert #route-chart:active { cursor: grabbing; }
.placing-alert .route-point, .placing-alert .tile-map .leaflet-marker-icon { pointer-events: none; }
.placing-alert .nearby-photos { visibility: hidden; }
.route-point { cursor: pointer; }
#route-chart .route-point-target { fill: transparent; stroke: transparent; stroke-width: 13px; vector-effect: non-scaling-stroke; }
#route-chart .route-point:focus-visible .route-point-target { stroke: var(--ink); stroke-width: 2px; }
.route-point > :not(.route-point-target), .route-point-leader, #route-chart .map-label, #route-chart .replay-marker { pointer-events: none; }
.route-point-leader { stroke: var(--muted); stroke-width: 1px; vector-effect: non-scaling-stroke; }
.route-moment-point.active .photo-point { stroke: var(--ink); }
.leaflet-container { font: 11px var(--ui-font); }
#tile-map .leaflet-control-zoom { box-shadow: none; }
#tile-map .leaflet-control-zoom a { border: 0; border-radius: 6px; color: var(--map-control-ink); background: transparent; text-shadow: 0 0 3px var(--map-control-halo), 0 0 5px var(--map-control-halo); }
#tile-map .leaflet-control-zoom a.leaflet-disabled { opacity: .5; }
.leaflet-top .leaflet-control-attribution { max-width: min(280px, calc(100vw - 150px)); margin-top: 6px; margin-left: 10px; padding: 0; color: rgba(31,37,35,.72); background: transparent; box-shadow: none; font-size: 9px; line-height: 1.2; white-space: normal; text-shadow: 0 1px 2px rgba(255,255,255,.92); }
.leaflet-top .leaflet-control-attribution a { color: inherit; text-decoration-color: rgba(31,37,35,.35); text-underline-offset: 2px; }
.map-moving-marker, .map-moment-marker { display: block; border-radius: 50%; }
.map-moving-marker { width: 18px; height: 18px; border: 4px solid var(--panel); background: var(--route-walked); box-shadow: 0 0 0 5px color-mix(in srgb, var(--route-walked) 30%, transparent); }
.route-wrap[data-map-mode="terrain"] .map-moving-marker { border: 1px solid var(--route-terrain-outline); }
.map-moment-marker { width: 13px; height: 13px; border: 3px solid var(--panel); background: var(--gold); box-shadow: 0 0 0 3px rgba(211,185,110,.2); }
.map-alert-marker { width: 25px; height: 25px; display: grid; place-items: center; border: 3px solid var(--panel); border-radius: 50% 50% 50% 4px; color: #fff; background: var(--kind-color, var(--warning)); box-shadow: 0 5px 15px rgba(31,37,35,.3); font-size: 13px; font-weight: 900; transform: rotate(-45deg); }
.map-alert-marker > span { transform: rotate(45deg); }
.map-alert-marker.kind-reminder { --kind-color: var(--reminder); }
.map-alert-marker.kind-alert { --kind-color: var(--alert); color: #292313; }
.map-alert-marker.kind-warning { --kind-color: var(--warning); }
.route-alert-point.kind-reminder circle { fill: var(--reminder); }
.route-alert-point.kind-alert circle { fill: var(--alert); }
.route-alert-point.kind-alert text { fill: #292313; }
.route-alert-point.kind-warning circle { fill: var(--warning); }
.map-popup { width: 170px; }
.map-popup img { width: 100%; height: 92px; display: block; object-fit: cover; border-radius: 6px; }
.map-popup strong { display: block; margin-top: 7px; color: var(--ink); }
.map-popup span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; }
.map-popup .alert-kind { color: var(--kind-color, var(--warning)); font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.map-popup .alert-kind.kind-reminder { --kind-color: var(--reminder); }
.map-popup .alert-kind.kind-alert { --kind-color: var(--alert); }
.map-popup .alert-kind.kind-warning { --kind-color: var(--warning); }
.nearby-photos { position: absolute; z-index: 650; inset: 0; pointer-events: none; }
.nearby-photo-card { position: absolute; width: min(220px, calc(100% - 20px)); min-height: 66px; padding: 6px; display: grid; grid-template-columns: 72px 1fr; gap: 9px; align-items: center; border: 1px solid rgba(255,255,255,.72); border-radius: 11px; color: var(--ink); background: rgba(255,255,255,.94); box-shadow: 0 12px 34px rgba(31,37,35,.2); opacity: 0; animation: photo-slide-in .28s ease forwards; pointer-events: auto; text-align: left; backdrop-filter: blur(12px); }
.nearby-photo-card img { width: 72px; height: 54px; object-fit: cover; border-radius: 7px; }
.nearby-photo-card strong, .nearby-photo-card small { display: block; }
.nearby-photo-card strong { margin-bottom: 4px; font-size: 11px; }
.nearby-photo-card small { color: var(--muted); font-size: 9px; font-weight: 600; line-height: 1.3; }
@keyframes photo-slide-in { to { opacity: 1; } }
.route-alert-banner { --kind-color: var(--warning); --kind-ink: #651f1b; --kind-bg: rgba(255,244,242,.96); display: block; width: 100%; min-height: 0; margin-top: 10px; padding: 11px 14px; border: 1px solid var(--line); border-left: 5px solid var(--kind-color); border-radius: 9px; color: var(--kind-ink); background: var(--kind-bg); text-align: left; }
.route-alert-banner.kind-reminder { --kind-color: var(--reminder); --kind-ink: #17492c; --kind-bg: rgba(241,250,244,.96); }
.route-alert-banner.kind-alert { --kind-color: var(--alert); --kind-ink: #5c4500; --kind-bg: rgba(255,249,224,.97); }
.route-alert-banner.kind-warning { --kind-color: var(--warning); --kind-ink: #651f1b; --kind-bg: rgba(255,244,242,.96); }
.route-alert-banner[hidden] { display: none; }
.route-alert-banner strong, .route-alert-banner span { display: block; }
.route-alert-banner strong { font-size: 13px; }
.route-alert-banner span { margin-top: 3px; font-size: 12px; line-height: 1.4; }
.map-key { position: absolute; z-index: 660; left: 10px; bottom: 10px; display: flex; flex-wrap: wrap; gap: 5px 13px; max-width: calc(100% - 62px); padding: 5px 8px; color: var(--map-control-ink); font-size: 11px; font-weight: 700; text-shadow: 0 0 3px var(--map-control-halo), 0 0 5px var(--map-control-halo); pointer-events: none; }
.map-key span { display: flex; align-items: center; gap: 6px; }
.map-key i { display: inline-block; }
.walked-line { width: 20px; border-top: 4px solid var(--route-walked); }
.ahead-line { width: 20px; border-top: 4px dashed var(--route-ahead); }
.photo-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 3px rgba(211,185,110,.2); }
.chart-caption { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.route-insights { margin-top: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; }
.elevation-strip, .trailhead-strip { min-width: 0; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: rgba(162,174,157,.1); }
.elevation-strip { position: relative; z-index: 700; }
.elevation-weather-layout { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, .72fr); gap: 18px; align-items: stretch; }
.elevation-content, .weather-inline { min-width: 0; }
.weather-inline { padding-left: 18px; border-left: 1px solid var(--line); }
.elevation-heading, .trailhead-heading, .weather-heading { display: flex; align-items: start; justify-content: space-between; gap: 16px; }
.elevation-heading h3, .trailhead-heading h3, .weather-heading h3 { margin: 0; font: 700 18px/1.3 var(--ui-font); }
.elevation-strip #elevation-chart { width: 100%; max-height: 230px; margin-top: 8px; }
#weather-freshness { color: var(--muted); font-size: 12px; text-align: right; }
.weather-heading-controls { display: flex; align-items: center; gap: 4px; }
.weather-credit-button { display: grid; flex: none; place-items: center; width: 24px; min-height: 24px; padding: 0; color: var(--muted); background: transparent; cursor: pointer; }
.weather-credit-button svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.35; stroke-linecap: round; }
.weather-credit-button:hover { color: var(--ink); }
.weather-credit-button:focus-visible { outline: 2px solid var(--forest); outline-offset: 1px; }
.weather-credit { position: fixed; inset: auto; width: min(224px, calc(100vw - 16px)); max-height: calc(100dvh - 16px); margin: 0; padding: 10px 12px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--panel); font-size: 12px; line-height: 1.5; box-shadow: 0 6px 22px rgba(31,37,35,.16); }
.weather-credit a { color: var(--forest); text-underline-offset: 2px; }
.weather-values { margin-top: 12px; display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px 18px; align-items: center; }
.route-insights .weather-values { grid-template-columns: auto 1fr; gap: 9px 14px; }
.weather-inline .weather-values { grid-template-columns: 1fr; }
.weather-inline #weather-temperature { justify-self: center; min-height: 54px; padding: 2px 17px; border: 1px solid var(--line); background: var(--weather-pill-surface, var(--panel)); font: 700 36px/1 ui-rounded, var(--ui-font); }
.weather-inline #weather-temperature:not(:disabled) { cursor: pointer; box-shadow: 0 2px 7px rgba(31,37,35,.13); }
.weather-inline #weather-temperature:hover:not(:disabled) { border-color: var(--forest); background: color-mix(in srgb, var(--weather-pill-surface, var(--panel)) 95%, #000); box-shadow: 0 3px 9px rgba(31,37,35,.16); }
.weather-inline #weather-temperature:active:not(:disabled) { background: color-mix(in srgb, var(--weather-pill-surface, var(--panel)) 91%, #000); box-shadow: inset 0 1px 3px rgba(31,37,35,.16); }
.weather-inline #weather-temperature:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
.weather-inline #weather-temperature:is(.temperature-cool, .temperature-warm) { --weather-pill-surface: #242E29; }
.weather-inline #weather-temperature.temperature-cold { --weather-pill-surface: #E8F2FC; color: #000080; }
.weather-inline #weather-temperature.temperature-cool { color: #A8DCAB; }
.weather-inline #weather-temperature.temperature-warm { color: #F1C338; }
.weather-inline #weather-temperature.temperature-hot { --weather-pill-surface: #1F2523; color: #C8493F; }
.weather-inline #weather-temperature.temperature-unknown { color: var(--muted); }
.weather-inline #weather-condition { justify-self: center; text-align: center; }
.weather-inline #weather-wind, .weather-inline #weather-precipitation { grid-column: 1; }
.weather-values strong { font-family: Georgia, "Times New Roman", serif; font-size: 28px; font-weight: 500; }
.weather-values span { color: var(--ink); font-size: 13px; font-weight: 700; }
#weather-location { margin: 9px 0 0; color: var(--muted); font-size: 11px; line-height: 1.45; }
.trailhead-endpoints, .trailhead-endpoints > span { display: flex; align-items: center; }
.trailhead-endpoints { gap: 5px; }
.trailhead-endpoints > span { gap: 4px; }
.trailhead-pin { flex: none; }
.trailhead-pin-start { color: var(--route-default-walked); }
.trailhead-pin-finish { color: var(--route-aerial-ahead); }
.trailhead-strip address { margin-top: 10px; color: var(--muted); font-size: 12px; font-style: normal; line-height: 1.55; }
.trailhead-strip a { flex: 0 0 auto; padding: 8px 10px; border: 1px solid var(--forest); border-radius: 8px; color: var(--forest); font-size: 11px; font-weight: 800; text-decoration: none; }
.trailhead-strip a:hover, .trailhead-strip a:focus-visible { color: #fff; background: var(--forest); }

.note-copy { margin-top: 23px; font-size: 16px; line-height: 1.65; white-space: pre-line; }
.note-copy p { margin-bottom: 13px; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 24px 0 0; border-top: 1px solid var(--line); }
.facts div { padding: 15px 12px 0 0; }
.facts dt { color: var(--muted); font-size: 11px; }
.facts dd { margin: 4px 0 0; color: var(--forest); font-size: 13px; font-weight: 700; }
.photo-frame { position: relative; margin-top: 21px; aspect-ratio: 16/10; display: grid; place-items: center; overflow: hidden; border-radius: 12px; background: #e3e8e2; }
.photo-frame img { width: 100%; height: 100%; object-fit: cover; opacity: .23; filter: saturate(.65) blur(1px); transform: scale(1.025); transition: opacity .35s ease, filter .35s ease, transform .6s ease; }
.photo-frame.reached img { opacity: 1; transform: scale(1); }
.photo-frame.reached img { filter: none; }
.photo-pending { position: absolute; inset: 0; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); text-align: center; transition: opacity .2s ease; }
.photo-pending > span { display: grid; place-items: center; width: 48px; height: 48px; border: 1px solid var(--line); border-radius: 50%; color: var(--gold); font-size: 23px; background: rgba(255,255,255,.34); }
.photo-pending strong { color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 18px; font-weight: 500; }
.photo-pending small { max-width: 230px; font-size: 11px; }
.photo-pending[hidden] { display: none; }
.photo-frame.reached .photo-pending { opacity: 0; pointer-events: none; }
.photo-panel > p { margin: 12px 0 0; color: var(--muted); font-size: 12px; }
.gallery-panel { margin-top: 20px; }
.gallery-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 22px; }
.gallery-grid figure { min-width: 0; margin: 0; }
.gallery-grid .gallery-hero { grid-column: span 2; grid-row: span 2; }
.gallery-grid img { width: 100%; aspect-ratio: 4/3; display: block; object-fit: cover; border-radius: 10px; background: #e3e8e2; }
.gallery-grid .gallery-hero img { height: calc(100% - 76px); min-height: 338px; aspect-ratio: auto; }
.gallery-grid figcaption { min-height: 76px; padding-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.gallery-grid figcaption strong { font-size: 12px; font-weight: 700; }
.gallery-grid figcaption span { color: var(--muted); font-size: 10px; line-height: 1.35; }
.gallery-grid figcaption a, .source-row a { text-underline-offset: 2px; }
.moment-location { align-self: flex-start; min-height: 0; margin-top: 4px; padding: 0; border-radius: 0; color: var(--forest); background: transparent; font-size: 10px; font-weight: 800; text-align: left; text-decoration: underline; text-decoration-color: rgba(75,81,78,.35); text-underline-offset: 3px; }
.moment-location:hover { color: var(--forest-dark); text-decoration-color: currentColor; }
.gallery-grid figure.targeted img { outline: 3px solid var(--gold); outline-offset: 2px; }
.source-row { margin-top: 22px; padding-top: 15px; display: flex; flex-wrap: wrap; gap: 10px 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.source-row span { color: var(--ink); font-weight: 700; }
.error { margin: 20px 0 0; padding: 14px 16px; border-left: 3px solid var(--danger); color: var(--danger); background: rgba(166, 66, 50, .06); }

.library-dialog { width: min(820px, calc(100% - 28px)); max-height: min(720px, calc(100vh - 28px)); padding: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); box-shadow: 0 28px 90px rgba(31,37,35,.3); }
.library-dialog::backdrop { background: rgba(31,37,35,.48); backdrop-filter: blur(3px); }
.library-dialog-heading { padding-bottom: 15px; display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; border-bottom: 1px solid var(--line); }
.library-dialog-heading h2 { margin-bottom: 5px; }
.library-dialog-heading p:last-child { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.45; }
.library-layout { min-height: 380px; display: grid; grid-template-columns: minmax(230px, .82fr) minmax(0, 1.35fr); }
.library-list { padding: 12px 14px 12px 0; display: flex; flex-direction: column; gap: 7px; border-right: 1px solid var(--line); }
.library-document { width: 100%; min-height: 72px; padding: 11px; display: grid; grid-template-columns: 34px 1fr; align-items: center; gap: 10px; border: 1px solid transparent; border-radius: 10px; color: var(--ink); background: transparent; text-align: left; box-shadow: none; }
.library-document:hover { background: rgba(162,174,157,.1); }
.library-document.selected { border-color: rgba(75,81,78,.3); background: rgba(75,81,78,.1); }
.document-mark { width: 32px; height: 32px; display: grid; place-items: center; border-radius: 8px; color: var(--forest); background: var(--panel); box-shadow: inset 0 0 0 1px var(--line); font-size: 16px; }
.library-document strong, .library-document small { display: block; }
.library-document strong { font-size: 14px; line-height: 1.35; }
.library-document small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 600; line-height: 1.35; }
.library-preview { min-width: 0; padding: 22px 4px 16px 24px; overflow-y: auto; }
.library-preview h3 { margin: 0 0 7px; font-family: Georgia, "Times New Roman", serif; font-size: 25px; font-weight: 500; }
.library-preview > p { color: var(--muted); font-size: 13px; line-height: 1.5; }
.library-preview ul { margin: 20px 0 0; padding: 0; display: grid; gap: 10px; list-style: none; }
.library-preview li { position: relative; padding: 10px 12px 10px 36px; border: 1px solid var(--line); border-radius: 9px; font-size: 13px; line-height: 1.45; }
.library-preview li::before { content: ""; position: absolute; left: 13px; top: 15px; width: 9px; height: 9px; border: 2px solid var(--moss); border-radius: 2px; }
.library-preview .document-note { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--gold); color: var(--ink); background: rgba(211,185,110,.12); }

.alert-dialog { width: min(520px, calc(100% - 28px)); padding: 24px; border: 1px solid var(--line); border-radius: 16px; color: var(--ink); background: var(--panel); box-shadow: 0 28px 90px rgba(0,0,0,.32); }
.alert-dialog::backdrop { background: rgba(11,24,20,.62); backdrop-filter: blur(4px); }
.alert-dialog form { display: grid; gap: 16px; }
.alert-dialog-heading { display: flex; justify-content: space-between; gap: 20px; }
.dialog-close { min-height: 38px; width: 38px; padding: 0; border: 1px solid var(--line); color: var(--muted); background: transparent; font-size: 22px; }
.forecast-dialog {
  --forecast-high: #EE4B2B;
  --forecast-low: #005FCC;
  --forecast-sun: #A4600D;
  --forecast-cloud: #58697D;
  --forecast-rain: #2674AC;
  --forecast-snow: #157C73;
  --forecast-storm: #74499F;
  max-height: calc(100dvh - 28px);
  padding: clamp(16px, 4vw, 24px);
}
.forecast-heading-controls { flex: none; align-self: flex-start; gap: 6px; }
.forecast-dialog .dialog-close { flex: 0 0 38px; }
.forecast-dialog .dialog-close:focus-visible { outline: 2px solid var(--forest); outline-offset: 2px; }
#weather-forecast-location, #weather-forecast-status { margin: 7px 0 0; color: var(--muted); font-size: 12px; line-height: 1.45; }
#weather-forecast-status { margin-block: 13px; }
.forecast-trend { margin: 0 0 12px; padding: 8px 8px 3px; border: 1px solid var(--line); border-radius: 10px; }
.forecast-trend figcaption { display: flex; flex-wrap: wrap; gap: 4px 12px; justify-content: space-between; font-size: 12px; }
.forecast-legend, .forecast-legend span { display: inline-flex; gap: 8px; align-items: center; }
.forecast-legend span { gap: 4px; color: var(--ink); }
.forecast-high { --forecast-series: var(--forecast-high); color: var(--forecast-series); }
.forecast-low { --forecast-series: var(--forecast-low); color: var(--forecast-series); }
.forecast-legend span::before { content: ""; width: 12px; border-top: 2px solid var(--forecast-series); }
.forecast-trend svg { display: block; width: 100%; max-height: 110px; margin-top: 3px; overflow: visible; }
.forecast-trend svg text { fill: var(--muted); font-size: 11px; }
.forecast-trend svg line { stroke: var(--line); vector-effect: non-scaling-stroke; }
.forecast-trend svg .forecast-freezing-line { stroke: url(#forecast-freezing-guide-gradient); stroke-width: 2; stroke-linecap: round; stroke-dasharray: .5 4.5; }
.forecast-trend svg path { fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.forecast-trend svg .forecast-freezing-snowflake { stroke: var(--muted); stroke-width: 1.25; stroke-linejoin: round; }
.forecast-trend svg circle { fill: currentColor; }
.forecast-days { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.forecast-days li { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--item-divider); font-size: 13px; line-height: 1.35; }
.forecast-days li span { display: block; margin-top: 3px; color: var(--muted); font-size: 12px; }
.forecast-days .forecast-condition { display: flex; align-items: flex-start; gap: 5px; }
.forecast-condition svg { width: 17px; height: 17px; flex: 0 0 17px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.forecast-condition .icon-sun { color: var(--forecast-sun); }
.forecast-condition .icon-cloud { color: var(--forecast-cloud); }
.forecast-condition .icon-rain { color: var(--forecast-rain); }
.forecast-condition .icon-snow { color: var(--forecast-snow); }
.forecast-condition .icon-storm { color: var(--forecast-storm); }
.forecast-values { text-align: right; font-variant-numeric: tabular-nums; }
#weather-forecast-retry { margin-top: 12px; }
.alert-location { margin: -3px 0 0; color: var(--muted); font-size: 13px; }
.alert-dialog label { display: grid; gap: 7px; color: var(--muted); font-size: 13px; font-weight: 700; }
.alert-dialog input, .alert-dialog textarea, .alert-dialog select { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 9px; color: var(--ink); background: var(--paper); font: inherit; font-weight: 500; }
.alert-dialog textarea { resize: vertical; line-height: 1.5; }
.alert-dialog-actions { display: flex; justify-content: flex-end; gap: 10px; padding-top: 4px; }
.alert-dialog-actions button:not(.primary) { border: 1px solid var(--line); color: var(--muted); background: transparent; }

footer { max-width: 1440px; margin: 0 auto; padding: 24px 5vw 42px; display: flex; justify-content: space-between; gap: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: 11px; }
footer code { overflow-wrap: anywhere; }

@media (max-width: 920px) {
  .intro { align-items: start; flex-direction: column; }
  .actions { align-items: flex-start; }
  .actions-primary { justify-content: flex-start; }
  .sync-demo-help { text-align: left; }
  .visuals, .story-grid { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr 1fr; }
  .gallery-grid .gallery-hero { grid-column: span 2; }
  .metrics { grid-template-columns: 1fr 1fr; }
  .route-insights { grid-template-columns: minmax(0, 1fr); }
  .content-index-links { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .content-index-links a:nth-child(3) { border-right: 0; }
  .content-index-links a:nth-child(-n+3) { border-bottom: 1px solid var(--line); }
}

@media (max-width: 760px) {
  .route-insights { grid-template-columns: 1fr; }
  .elevation-weather-layout { grid-template-columns: 1fr; gap: 16px; }
  .weather-inline { padding: 16px 0 0; border-top: 1px solid var(--line); border-left: 0; }
}

@media (max-width: 620px) {
  .topbar { padding: 0 20px; }
  .topbar nav { gap: 10px; }
  .actions { width: 100%; }
  .actions-primary { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .actions-primary > button { width: 100%; padding-inline: 12px; justify-content: center; }
  main { padding: 34px 20px 48px; }
  .content-index-heading { align-items: start; flex-direction: column; gap: 6px; }
  .content-index-heading > p { text-align: left; }
  .content-index-links { grid-template-columns: 1fr 1fr; }
  .content-index-links a { min-height: 68px; }
  .content-index-links a:nth-child(odd) { border-right: 1px solid var(--line); }
  .content-index-links a:nth-child(even) { border-right: 0; }
  .content-index-links a:nth-child(-n+4) { border-bottom: 1px solid var(--line); }
  .metrics article { padding-right: 8px; }
  .metrics strong { font-size: 22px; white-space: nowrap; }
  .replay-controls { padding: 12px 13px 11px; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 7px; }
  #replay-clock { grid-template-columns: minmax(0, 1fr) minmax(6.75rem, 1.25fr) minmax(0, 1fr); }
  #replay-clock .play-button { gap: 6px; padding-inline: 6px; }
  #replay-status { font-size: 11px; }
  .replay-time strong { font-size: 20px; }
  .speed-control { gap: 6px; }
  .speed-control > span { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  .speed-control select { min-inline-size: 4.5rem; min-height: 32px; padding: 0 18px 0 6px; }
  .panel { padding: 18px; border-radius: 13px; }
  .panel-heading { flex-direction: column; }
  .map-modes { top: 8px; right: 8px; }
  .route-wrap { height: 340px; }
  .nearby-photo-card { width: min(190px, calc(100% - 16px)); grid-template-columns: 58px 1fr; }
  .nearby-photo-card img { width: 58px; height: 48px; }
  .weather-values { grid-template-columns: 1fr 1fr; gap: 8px 14px; }
  .weather-values strong { font-size: 25px; }
  .trailhead-heading { align-items: start; flex-direction: column; }
  .elevation-heading { flex-direction: column; gap: 8px; }
  .elevation-strip #elevation-chart { min-height: 170px; }
  .map-key { left: 7px; bottom: 10px; gap: 5px 9px; font-size: 10px; }
  .library-dialog { max-height: calc(100vh - 16px); padding: 18px; }
  .library-dialog-heading { gap: 12px; }
  .library-layout { min-height: 0; display: block; overflow-y: auto; }
  .library-list { padding: 12px 0; border-right: 0; border-bottom: 1px solid var(--line); }
  .library-document { min-height: 62px; }
  .library-preview { padding: 18px 0 4px; overflow: visible; }
  .alert-dialog-actions { flex-direction: column-reverse; }
  .alert-dialog-actions button { width: 100%; box-shadow: var(--full-width-button-shadow); }
  .facts { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: 1fr; }
  .gallery-grid .gallery-hero { grid-column: auto; grid-row: auto; }
  .gallery-grid .gallery-hero img { height: auto; min-height: 0; aspect-ratio: 4/3; }
  footer { padding: 20px; flex-direction: column; }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --ink: #f1f3ef;
    --muted: #adb5b0;
    --paper: #000000;
    --page-background: var(--paper);
    --panel: #000000;
    --grouped-panel: #1c1c1e;
    --home-inactive-tab: #292f2c;
    --note-inactive-tab: #373e39;
    --active-tab-ink: var(--ink);
    --primary-button-ink: #1f2523;
    --line: #4b514e;
    --forest: #a2ae9d;
    --forest-dark: #c2cbc5;
    --item-divider: var(--line);
    --wordmark: var(--ink);
    --content-panel-shadow: 0 4px 14px rgb(0 0 0 / 36%);
    --full-width-button-shadow: 0 3px 9px rgb(0 0 0 / 38%);
  }
  .trip-read-only { background: var(--note-inactive-tab); }
  .forecast-dialog { --forecast-sun: #F7BC62; --forecast-cloud: #B3BECF; --forecast-rain: #78BFF7; --forecast-snow: #78D3C9; --forecast-storm: #C5A4F5; }
  .photo-frame { background: #24332d; }
}

@media (prefers-reduced-motion: reduce) {
  .nearby-photo-card { animation: none; transform: none; opacity: 1; }
  .photo-frame img { transition: none; }
  .rehearsal-dialog button { transition: none; }
  .rehearsal-plate, .rehearsal-plate-shot.is-current { transform: none; }
  .rehearsal-motion { display: none; }
}
