/*
 * story.css — the scroll-driven story layout (issue #20).
 *
 * Replaces the old auto-reel's reel.css stage with a single vertical scroll page: a hero, a
 * sticky 4-step progress bar, four step sections that fade-and-rise in as they enter view, and
 * an end CTA. The fade-and-rise itself is set inline by scroll-story.js (the incubator "Reveal"
 * technique); this file owns the page furniture, the sticky bar, and the section frames. The
 * components inside each step (crew-feed, dossier, reveal map, guide) keep their own looks from
 * their own stylesheets. Warm Fraunces/clay system stays; tokens come from crew-feed.css.
 */

/* ---- The scroll cue under the hero -------------------------------------- */

.scroll-cue {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin: 26px auto 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
}
.scroll-cue .chev {
  font-size: 20px;
  line-height: 1;
  animation: cuebob 1.8s ease-in-out infinite;
}
@keyframes cuebob {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(5px); opacity: 1; }
}

/* ---- The shared floating "keep scrolling" cue --------------------------- */

/* Shown by story.js when the active step's content finishes animating, hidden the moment the
 * viewer scrolls (or the next section reveals). Fixed, bottom-center, reusing the hero cue look.
 * Starts faded out + non-interactive; .show fades it in with a soft bounce. */
.floating-cue {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 8px);
  z-index: 900;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 9px 16px 7px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.02em;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.35s ease;
}
.floating-cue.show {
  opacity: 1;
  transform: translate(-50%, 0);
}
.floating-cue .chev {
  font-size: 17px;
  line-height: 1;
  animation: cuebob 1.8s ease-in-out infinite;
}
/* The terminal cue on the last step points UP at the CTA rather than down to nowhere. */
.floating-cue.is-terminal .chev {
  animation: cuebobup 1.8s ease-in-out infinite;
}
@keyframes cuebobup {
  0%, 100% { transform: translateY(0); opacity: 0.7; }
  50% { transform: translateY(-5px); opacity: 1; }
}

/* The prompt that appears under the hero subhead — the "rough idea" the viewer starts from. */
.hero-prompt {
  max-width: 620px;
  margin: 26px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-left: 3px solid var(--clay);
  border-radius: 0 14px 14px 0;
  padding: 16px 20px;
  box-shadow: var(--shadow-card);
  text-align: left;
}
.hero-prompt .k {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 6px;
}
.hero-prompt p {
  margin: 0;
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
}

/* ---- U7: the token-free, menu-driven try-it (issue #6) ------------------ */
/* A compact, on-brand builder under the fixed ask: pick a destination / who / pace, then watch
   the crew replay the nearest canned sample run. Hidden until JS un-hides it (try-it.js). */
.tryit {
  max-width: 620px;
  margin: 14px auto 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px 20px 18px;
  box-shadow: var(--shadow-card);
  text-align: left;
}
.tryit[hidden] {
  display: none;
}
.tryit-lead {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.01em;
  color: var(--ink-2);
}
.tryit-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tryit-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  align-items: center;
  gap: 12px;
}
.tryit-label {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
}
.tryit-opts {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.tryit-chip {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  background: #fbf6ec;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}
.tryit-chip:hover {
  border-color: var(--clay);
  color: var(--clay-deep);
}
.tryit-chip.is-on {
  background: var(--clay);
  border-color: var(--clay);
  color: #fffbf4;
  box-shadow: 0 1px 6px rgba(197, 97, 58, 0.25);
}
.tryit-chip:focus-visible {
  outline: 2px solid var(--clay-deep);
  outline-offset: 2px;
}
.tryit-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 14px;
  margin-top: 16px;
}
.tryit-cta {
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 700;
  color: #fffbf4;
  background: var(--clay);
  border: 1px solid var(--clay-deep);
  border-radius: 11px;
  padding: 11px 20px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.12s ease, box-shadow 0.18s ease;
  box-shadow: 0 2px 10px rgba(197, 97, 58, 0.22);
}
.tryit-cta:hover {
  background: var(--clay-deep);
}
.tryit-cta:active {
  transform: translateY(1px);
}
.tryit-cta:focus-visible {
  outline: 2px solid var(--clay-deep);
  outline-offset: 2px;
}
.tryit-note {
  margin: 0;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--muted);
  font-style: italic;
}
.tryit-note[hidden] {
  display: none;
}
@media (max-width: 560px) {
  .tryit {
    padding: 14px 16px 16px;
  }
  .tryit-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .tryit-actions {
    margin-top: 14px;
  }
  .tryit-cta {
    width: 100%;
    text-align: center;
  }
}

/* ---- The sticky step-progress bar --------------------------------------- */

.story-progress {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(247, 241, 231, 0.86);
  backdrop-filter: saturate(1.1) blur(8px);
  -webkit-backdrop-filter: saturate(1.1) blur(8px);
  border-bottom: 1px solid var(--line);
}
.story-progress-inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  overflow-x: auto;
  scrollbar-width: none;
}
.story-progress-inner::-webkit-scrollbar {
  display: none;
}
.pstep {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: none;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.2px;
  color: var(--muted);
  opacity: 0.55;
  transition: opacity 0.45s ease, color 0.45s ease;
}
.pstep .num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #e3dac9;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  flex: none;
  transition: background 0.45s ease, color 0.45s ease, box-shadow 0.45s ease, transform 0.3s ease;
}
.pstep .sep {
  color: #d6cdbb;
  flex: none;
}
/* Lit (current + passed) steps. */
.pstep.lit {
  opacity: 1;
  color: var(--ink);
}
.pstep.lit .num {
  background: var(--clay);
  color: #fffbf4;
}
.pstep.current .num {
  box-shadow: 0 0 0 4px rgba(197, 97, 58, 0.18);
  transform: scale(1.06);
}
/* The DONE state: every step lit (pine), and a "Trip planned ✓" badge slides in. */
.story-progress.done .pstep .num {
  background: var(--pine);
  color: #fffbf4;
}
.story-progress.done .pstep {
  opacity: 1;
  color: var(--ink);
}
.trip-planned {
  flex: none;
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--pine);
  background: var(--pine-tint);
  border: 1px solid rgba(31, 111, 84, 0.25);
  border-radius: 999px;
  padding: 5px 12px;
  opacity: 0;
  transform: translateX(6px);
  transition: opacity 0.4s ease, transform 0.4s ease;
  white-space: nowrap;
}
.story-progress.done .trip-planned {
  opacity: 1;
  transform: none;
}

/* ---- Scroll-snap sectioning (issue #11) --------------------------------- */

/* The page (html) is the scroll root, so snap lives there. MANDATORY (issue: decisive snap): a
 * scroll toward the next scene lands FULLY on it — no resting halfway between sections in scroll
 * limbo. Each step is sized to fit inside the viewport (step 3's dossier list and step 4's columns
 * each scroll INTERNALLY in their own bounded windows), so mandatory snap moves between scenes
 * without ever trapping the viewer on tall content: the nested scroll consumes the wheel first, then
 * the outer snaps once it hits the bound. Reduced-motion drops snap entirely (rule at the bottom).
 * The sticky progress bar lives in this same scroll flow, so it stays pinned through every snap. */
html {
  scroll-snap-type: y mandatory;
}
/* Hero + each step + the end CTA are snap targets. They snap to their start, just below the
 * pinned progress bar (scroll-margin-top clears the ~46px bar so a snapped heading isn't tucked
 * under it). */
.hero,
.step-section,
.story-end {
  scroll-snap-align: start;
  scroll-margin-top: 52px;
}
/* The step scenes read as full "scenes": tall enough to fill the viewport so each snap lands on
 * one section at a time. min-height (not fixed height) lets a long section — step 4's map +
 * itinerary — grow past the fold and scroll inside its own snap zone. */
.step-section {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* ---- The step sections -------------------------------------------------- */

.story {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 22px;
}
.step-section {
  padding: 56px 0;
  border-bottom: 1px solid var(--line);
}
.step-section:last-of-type {
  border-bottom: 0;
}
.step-head {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin: 0 0 22px;
}
.step-head .step-n {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--clay-tint);
  color: var(--clay-deep);
  font-size: 14px;
  font-weight: 700;
  flex: none;
}
.step-head h2 {
  margin: 0;
  font-size: clamp(22px, 3.2vw, 30px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.step-head .step-sub {
  display: block;
  margin-top: 4px;
  font-size: 14.5px;
  font-weight: 400;
  color: var(--ink-2);
  letter-spacing: 0;
}

/* The ask card that opens step 1 (reuses the warm card look). */
.step-ask {
  max-width: 680px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 22px 24px;
  box-shadow: var(--shadow-card);
}
.step-ask .k {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--muted);
  margin-bottom: 8px;
}
.step-ask .ask-text {
  font-size: 19px;
  line-height: 1.5;
  /* While the ask types in, hold the box height steady (the full ask is ~2 lines) so the card
   * doesn't grow line-by-line and shove the page around. min-height ~ two lines at this size. */
  min-height: 1.5em;
}
/* The blinking caret that trails the ask while it types (story.js adds .typing during the stream).
 * A thin clay bar after the text, fading in/out; it's gone the moment typing finishes (.typing off). */
.step-ask .ask-text.typing::after {
  content: '';
  display: inline-block;
  width: 2px;
  height: 1.05em;
  margin-left: 1px;
  vertical-align: -0.16em;
  background: var(--clay);
  border-radius: 1px;
  animation: caretblink 1s step-end infinite;
}
@keyframes caretblink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0; }
}

/* Step 2 — the crew feed in a calm card. The feed scroll window is capped so the section reads
 * on mobile, but it does NOT trap the page scroll (overflow-y:auto inside, page scrolls past). */
.step-crew {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow-card);
}
.step-crew .feed-scroll {
  max-height: 460px;
}

/* Step 3 — the REAL itinerary BUILDS, slowly (issue #34). The same day-grouped itinerary step 4
 * rests on, but here every day + stop starts hidden and pops in one at a time as the crew assembles
 * the trip. It lives in a fixed-height internal scroll window so the whole section fits inside the
 * snapped viewport (the heading stays above the fold, the rows scroll internally and auto-follow the
 * newest pop-in). The built node then CARRIES into step 4 (story.js relocates it), so step 4 never
 * rebuilds it. */
.step-build {
  max-width: 640px;
  margin: 0 auto;
}
.step-build-scroll {
  max-height: 60vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

/* The build-in transition for each day + stop + booked row (issue #34). Pending = hidden + slightly
 * risen + clipped to zero height so the list grows as rows arrive (no big empty gap waiting). .show
 * pops it to full. Mirrors the crew feed / dossier pop. Reduced-motion drops the movement below. */
.itin-pending {
  opacity: 0;
  transform: translateY(10px);
}
.itinerary-day.itin-pending {
  /* A pending DAY collapses its whole block (the grid-rows trick) so the list assembles top-down. */
  max-height: 0;
  overflow: hidden;
}
.itin-show {
  opacity: 1;
  transform: none;
  max-height: 2000px;
  transition: opacity 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.5s ease;
}

/* Step 4 — the finished trip (issue #29): three LIVING columns. The day-by-day itinerary on the
 * left, the map in the middle, the featured stop's guide on the right. After the build animation
 * the map rests zoomed to one featured stop's city, that stop's day is pre-expanded on the left, and
 * its guide fills the right column. Tapping any stop/pin re-features it across all three. The detail
 * pane is a PERSISTENT third column here, not a tap-to-open overlay. Roughly 28% / 44% / 28%. */
.step-finished {
  display: grid;
  grid-template-columns: 0.64fr 1fr 0.64fr;
  gap: 18px;
  align-items: start;
}
/* The mobile tab bar (issue #34) is HIDDEN on desktop: the three columns show side by side, no tabs.
 * It only appears at the mobile breakpoint, where it switches the one visible panel. */
.finished-tabs {
  display: none;
}

/* ---- Step 4 on mobile = TABS (issue #34) -------------------------------- */
/* On a narrow phone the three columns don't fit AND a live Leaflet map traps the page scroll (it
 * grabs touch-drag), so the page can't scroll past step 4. The fix: tabs — Itinerary / Map / Details,
 * ONE panel at a time, defaulting to Itinerary. The map column is display:none until the Map tab is
 * opened, so Leaflet can't capture touch (and trap the scroll) until the viewer deliberately opens it.
 * story.js calls invalidateSize() when Map first shows so the hidden-mounted map paints its tiles. */
@media (max-width: 980px) {
  /* Show the tab bar; make it sticky just under the progress bar so it's always reachable. */
  .finished-tabs {
    display: flex;
    position: sticky;
    top: 52px;
    z-index: 20;
    gap: 4px;
    margin: 0 0 14px;
    padding: 5px;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 14px;
    box-shadow: var(--shadow-card);
  }
  .finished-tab {
    flex: 1;
    font: inherit;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--muted);
    background: transparent;
    border: 0;
    border-radius: 10px;
    padding: 10px 6px;
    cursor: pointer;
    transition: background 0.16s ease, color 0.16s ease;
  }
  .finished-tab.is-on {
    color: var(--clay-deep);
    background: var(--clay-tint);
  }
  .finished-tab:focus-visible {
    outline: 2px solid var(--clay-deep);
    outline-offset: 1px;
  }

  /* One panel at a time: the grid collapses to a single column, and only the panel matching the
   * active tab (#stepFinished[data-tab=…]) is shown. Everything else is display:none — which is what
   * keeps the Leaflet map off-screen (and therefore unable to grab touch) on the Itinerary tab. */
  .step-finished {
    display: block;
  }
  .step-finished > [data-panel] {
    display: none;
  }
  .step-finished[data-tab='itinerary'] [data-panel='itinerary'],
  .step-finished[data-tab='map'] [data-panel='map'],
  .step-finished[data-tab='details'] [data-panel='details'] {
    display: block;
  }

  /* The panels are no longer sticky bounded columns on mobile — each tab gets the full width and its
   * own natural height (the page scrolls normally; the active panel isn't a scroll-trap). */
  .finished-itincol,
  .finished-detailcol,
  .finished-mapcol {
    position: static;
    height: auto;
    max-height: none;
  }
  .finished-itinerary {
    height: auto;
    overflow: visible;
  }
  /* The detail pane is a plain tab panel on mobile (its own tab), not a fixed bottom sheet. */
  .finished-detail-body {
    height: auto;
    overflow: visible;
  }
  /* The back/× control bar IS shown on the Details tab so a tap from the map can return to the
   * itinerary tab; story.js doesn't auto-switch back, but the control reads as the way out. */
  .finished-detail-body .detail-controls {
    display: flex;
  }
  /* When nothing's been tapped yet the Details tab shows a quiet placeholder prompt. */
  .finished-detail-body:empty::before {
    content: 'Tap a stop on the Itinerary or Map tab to see the crew’s notes here.';
    display: block;
    padding: 28px 22px;
    color: var(--muted);
    font-size: 14px;
    line-height: 1.5;
    text-align: center;
  }
  /* The itinerary is never dimmed on mobile (the detail is its own tab, not an overlay). */
  .finished-itinerary.overlaid {
    filter: none;
    opacity: 1;
    pointer-events: auto;
  }
}
.finished-itincol {
  min-width: 0;
}
.finished-mapcol {
  min-width: 0;
  position: relative;
}
/* The "tap a pin" hint floats over the top of the map (issue #20) so the affordance is obvious. */
.map-hint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  background: rgba(43, 39, 34, 0.82);
  color: #f7f1e7;
  font-size: 12.5px;
  font-weight: 600;
  padding: 6px 13px;
  border-radius: 999px;
  box-shadow: var(--shadow-lift);
  pointer-events: none;
  white-space: nowrap;
  transition: opacity 0.4s ease;
}
/* Each column is bounded to the map's height and sticks beside it, so the itinerary and the detail
 * pane each scroll inside their own frame and the trio stays aligned to the map (issue #29). */
.finished-itincol,
.finished-detailcol {
  min-width: 0;
  position: sticky;
  top: 64px;
  height: 540px;
  max-height: calc(100vh - 90px);
}

/* The resting itinerary fills the left column and scrolls inside it. */
.finished-itinerary {
  width: 100%;
  height: 100%;
  overflow-y: auto;
}
/* The itinerary card grows to its content; the wrapper scrolls. */
.finished-itinerary .itinerary {
  min-height: 100%;
}
/* On desktop the detail is a real third column, never an overlay over the itinerary — so the
 * `.overlaid` dim is a no-op here (it only applies to the mobile sheet, below). */
.finished-itinerary.overlaid {
  filter: none;
  opacity: 1;
  pointer-events: auto;
}

/* The PERSISTENT detail column (issue #29): the featured stop's guide rests here from the moment
 * beat 4 settles, and every stop/pin tap re-features it in place. Scrolls internally for long
 * guides. On desktop it's always shown as the third column; the mobile rule (further down) turns it
 * back into a tap-to-open sheet. The detail-open class is set whenever a stop is featured/selected. */
.finished-detail-body {
  width: 100%;
  height: 100%;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}
.finished-detail-body.detail-open {
  animation: detailrise 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}
/* Before the first stop is featured (the brief build animation) the column is empty — render it as
 * a quiet placeholder frame rather than a hard empty box. */
.finished-detail-body:empty {
  border-style: dashed;
  box-shadow: none;
}
@keyframes detailrise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.finished-detail-body .guide-panel,
.finished-detail-body .checkin-panel {
  max-width: none;
  margin: 0;
}
.finished-detail-body .guide-body {
  max-height: 360px;
}
/* The back/× control bar belongs to the mobile sheet only — on desktop the left itinerary is always
 * visible, so there's nothing to go "back" to. Hide it on the persistent column. */
.finished-detail-body .detail-controls {
  display: none;
}

/* The ×/"back to itinerary" control bar that sits atop every overlay (reveal.js builds it). */
.detail-controls {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: rgba(255, 251, 244, 0.94);
  backdrop-filter: saturate(1.1) blur(6px);
  -webkit-backdrop-filter: saturate(1.1) blur(6px);
  border-bottom: 1px solid var(--line);
  border-radius: 18px 18px 0 0;
}
.detail-back {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--clay-deep);
  background: var(--clay-tint);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 13px;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}
.detail-back:hover,
.detail-back:focus-visible {
  background: var(--clay);
  color: #fffbf4;
  outline: none;
}
.detail-close {
  margin-left: auto;
  font: inherit;
  font-size: 20px;
  line-height: 1;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.detail-close:hover,
.detail-close:focus-visible {
  background: var(--surface-sunken);
  color: var(--ink);
  outline: none;
}

/* ---- The full-trip itinerary accordion (issue #8) ----------------------- */

.itinerary {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.itinerary-head {
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line);
}
.itinerary-kicker {
  display: block;
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--clay-deep);
  margin-bottom: 4px;
}
.itinerary-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.12;
}
.itinerary-hint {
  margin: 6px 0 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: var(--muted);
}

.itinerary-days {
  display: block;
}
.itinerary-day {
  border-bottom: 1px solid var(--line);
}
.itinerary-day:last-child {
  border-bottom: 0;
}
.itinerary-day-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 13px 18px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.16s ease;
}
.itinerary-day-head:hover,
.itinerary-day-head:focus-visible {
  background: var(--surface-sunken);
  outline: none;
}
.itinerary-day-name {
  font-weight: 700;
  font-size: 14.5px;
}
.itinerary-day-count {
  font-size: 12px;
  color: var(--muted);
}
.itinerary-day-chev {
  margin-left: auto;
  font-size: 12px;
  color: var(--muted);
  transition: transform 0.22s ease;
}
.itinerary-day.open .itinerary-day-chev {
  transform: rotate(180deg);
}
/* Collapsed by default; the open day reveals its rows. Grid-rows trick animates the height. */
.itinerary-day-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.26s ease;
}
.itinerary-day.open .itinerary-day-body {
  grid-template-rows: 1fr;
}
.itinerary-day-body > * {
  overflow: hidden;
}
.itinerary-day-rows {
  display: block;
}
/* Each stop is a tappable row inside the day's collapsible body. */
.itinerary-stop {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-top: 1px solid var(--line);
  padding: 11px 18px 11px 22px;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.16s ease;
}
.itinerary-day-rows .itinerary-stop:first-child {
  border-top: 1px solid var(--line);
}
.itinerary-stop:hover,
.itinerary-stop:focus-visible {
  background: var(--clay-tint);
  outline: none;
}
.itinerary-stop.active {
  background: var(--clay-tint);
  box-shadow: inset 3px 0 0 var(--clay);
}
.itinerary-stop-icon {
  font-size: 17px;
  line-height: 1;
  flex: none;
}
.itinerary-stop-body {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.itinerary-stop-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
}
.itinerary-stop-sub {
  font-size: 12px;
  color: var(--muted);
}
.itinerary-stop-go {
  margin-left: auto;
  font-size: 18px;
  color: var(--muted);
  flex: none;
}

/* The "Booked + watched" tail — flights + the permit watch (not map pins). */
.itinerary-booked {
  padding: 14px 18px 16px;
  border-top: 1px solid var(--line);
  background: var(--surface-sunken);
}
.itinerary-booked-h {
  margin: 0 0 8px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
  color: var(--muted);
}
.itinerary-booked-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
}
.itinerary-booked-icon {
  font-size: 15px;
  flex: none;
}
.itinerary-booked-body {
  display: flex;
  flex-direction: column;
  gap: 1px;
  min-width: 0;
}
.itinerary-booked-title {
  font-size: 13.5px;
  font-weight: 600;
}
.itinerary-booked-sub {
  font-size: 11.5px;
  color: var(--muted);
}

/* ---- The end CTA + the "see other examples" ----------------------------- */

.story-end {
  max-width: 1080px;
  margin: 0 auto;
  padding: 60px 22px 30px;
}
.end-cta {
  background: linear-gradient(180deg, var(--surface) 0%, #fdf7ec 100%);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 40px 32px;
  box-shadow: var(--shadow-card);
  text-align: center;
}
.end-cta .end-kicker {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--pine);
}
.end-cta h2 {
  margin: 8px 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  font-weight: 500;
  letter-spacing: -0.01em;
  line-height: 1.08;
}
.end-cta p.lede {
  max-width: 560px;
  margin: 0 auto 22px;
  font-size: 16px;
  line-height: 1.55;
  color: var(--ink-2);
}

/* The examples ("plan my trip" lives here, at the end). */
.examples-block {
  margin-top: 40px;
}
.examples-block .examples-h {
  text-align: center;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--clay-deep);
  margin: 0 0 4px;
}
.examples-block .examples-sub {
  text-align: center;
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 20px;
}
.example-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (max-width: 760px) {
  .example-grid {
    grid-template-columns: 1fr;
  }
}
.example-card {
  display: block;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 20px;
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
  font: inherit;
  color: var(--ink);
  width: 100%;
}
.example-card:hover,
.example-card:focus-visible {
  transform: translateY(-3px);
  border-color: var(--clay);
  box-shadow: var(--shadow-lift);
  outline: none;
}
/* Roadmap examples (no real run yet): read as "coming soon", not clickable runs. */
.example-card.coming-soon {
  cursor: default;
  opacity: 0.68;
}
.example-card.coming-soon:hover,
.example-card.coming-soon:focus-visible {
  transform: none;
  border-color: var(--line);
  box-shadow: var(--shadow-card);
}
.example-card.coming-soon .ex-go {
  color: var(--ink-2);
  font-weight: 500;
}
.example-card .ex-emoji {
  font-size: 26px;
  line-height: 1;
}
.example-card h3 {
  margin: 12px 0 5px;
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
}
.example-card p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--ink-2);
}
.example-card .ex-go {
  display: inline-block;
  margin-top: 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--clay-deep);
}

/* ---- Mobile (<= 760px) — calm, one focus at a time ---------------------- */
@media (max-width: 760px) {
  .story-progress-inner {
    padding: 10px 14px;
    gap: 6px;
  }
  .pstep {
    font-size: 11px;
    gap: 6px;
  }
  .pstep .num {
    width: 20px;
    height: 20px;
    font-size: 11px;
  }
  /* On a phone the long step labels would overflow; show numbers + the current label only. */
  .pstep .plabel {
    display: none;
  }
  .pstep.current .plabel {
    display: inline;
  }
  .trip-planned {
    font-size: 11px;
    padding: 4px 9px;
  }
  .step-section {
    padding: 40px 0;
    /* On a phone the snap target should clear the shorter pinned bar (~44px). */
    scroll-margin-top: 46px;
  }
  .hero,
  .story-end {
    scroll-margin-top: 46px;
  }
  /* On a phone, dvh tracks the real visible height (no jump when the URL bar hides), so a scene
   * fills the screen and snaps clean. */
  .step-section {
    min-height: 100svh;
  }
  .hero-prompt p {
    font-size: 16px;
  }
  .step-ask .ask-text {
    font-size: 17px;
  }
  /* On a phone the step heading eats more of the fold, so the step-3 build window is a touch
   * shorter to keep the whole section inside the snap as the itinerary assembles. */
  .step-build-scroll {
    max-height: 56svh;
  }
  .floating-cue {
    bottom: 18px;
    font-size: 12px;
    padding: 8px 14px 6px;
  }
  /* The map tab gets a tall, comfortable map (it only mounts when the Map tab is open, so it never
   * traps the page scroll on the default Itinerary tab — issue #34). */
  .reveal-map {
    height: 62svh;
    min-height: 320px;
  }
  .finished-detail-body .guide-body {
    max-height: none;
  }
  /* On the Itinerary tab the list is the whole panel and the PAGE scrolls (no internal scroll-trap).
   * Because each tab shows one panel at a time, the section is short enough to scroll past cleanly. */
  .finished-itincol {
    height: auto;
    max-height: none;
    overflow: visible;
  }
  .finished-itinerary {
    height: auto;
    overflow: visible;
  }
  .itinerary-stop {
    padding: 13px 16px 13px 18px;
  }
  .itinerary-day-head {
    padding: 14px 16px;
  }
  .end-cta {
    padding: 30px 20px;
  }
}

/* Reduced-motion: kill the cue bob + the trip-planned slide (the reveal itself is already
 * transform-free under reduced motion via scroll-story.js). */
@media (prefers-reduced-motion: reduce) {
  .scroll-cue .chev {
    animation: none;
  }
  /* The floating cue still appears (statically), just without the bounce or the slide-in. */
  .floating-cue .chev {
    animation: none;
  }
  .floating-cue {
    transition: opacity 0.2s ease;
    transform: translate(-50%, 0);
  }
  .floating-cue.show {
    transform: translate(-50%, 0);
  }
  .trip-planned {
    transition: opacity 0.2s ease;
    transform: none;
  }
  /* Drop the snap-forcing entirely: no snap, no forced full-height scenes, no smooth-scroll. The
   * sections just flow and appear on scroll (the JS read-beat collapses to zero too, scroll-story.js).
   */
  html {
    scroll-snap-type: none;
    scroll-behavior: auto;
  }
  .hero,
  .step-section,
  .story-end {
    scroll-snap-align: none;
  }
  .step-section {
    min-height: 0;
    display: block;
  }
}
