/*
  Layout: built for a phone first. One stop of the ride per screen, a thumb-reach tab bar
  along the bottom, station details in a bottom sheet, and the coaster pinned while you pick
  exits. On a wide screen the same screens sit in a centered column; the loop gets a side panel.
  Palette comes from the podcast's own paper: blush and mint, with the violet of
  Jonathan's first scribble of the ride as the single accent.
*/
:root {
  --paper: #FBEDE6;      /* blush paper, page ground */
  --mint: #DDF0E6;       /* podcast mint, quiet panels */
  --peach: #F6D2C1;      /* podcast peach, warm panels */
  --ink: #3D2A3A;        /* plum ink, all text */
  --ink-soft: #6B5466;   /* secondary text */
  --violet: #6A4BBE;     /* the ride line */
  --violet-wash: #E7DEF8;
  --sun: #F2BE4A;        /* "my main one" */
  --sun-ink: #5E4100;
  --line: rgba(61, 42, 58, 0.16);
  --card: #FFF8F3;
  --scrim: rgba(40, 24, 36, 0.45);
  --focus: #6A4BBE;

  --font-display: "Grandstander", "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Atkinson Hyperlegible", "Segoe UI", system-ui, -apple-system, sans-serif;
  --font-hand: "Caveat", "Segoe Print", "Bradley Hand", cursive;

  --step--1: 0.9rem;
  --step-0: 1.0625rem;
  --step-1: 1.25rem;
  --step-2: 1.55rem;
  --step-3: clamp(1.9rem, 7vw, 2.4rem);
  --step-4: clamp(2.5rem, 11.5vw, 4.4rem);
  --radius-soft: 18px;
  --gutter: 18px;
  --lane: 30px;          /* side padding on phones: the coaster's two lanes */
  --tabbar-h: 64px;
  --tap: 48px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #241A23; --mint: #22322B; --peach: #3A2925; --ink: #F7EAF1; --ink-soft: #CDB6C6;
    --violet: #B9A2F4; --violet-wash: #3A2F55; --sun: #F2BE4A; --sun-ink: #2B1E00;
    --line: rgba(247, 234, 241, 0.16); --card: #2D222C; --scrim: rgba(0, 0, 0, 0.55); --focus: #B9A2F4; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #241A23; --mint: #22322B; --peach: #3A2925; --ink: #F7EAF1; --ink-soft: #CDB6C6;
  --violet: #B9A2F4; --violet-wash: #3A2F55; --sun: #F2BE4A; --sun-ink: #2B1E00;
  --line: rgba(247, 234, 241, 0.16); --card: #2D222C; --scrim: rgba(0, 0, 0, 0.55); --focus: #B9A2F4; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html.sheet-open, html.sheet-open body { overflow: hidden; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  -webkit-tap-highlight-color: transparent;
}
img { max-width: 100%; height: auto; }
a { color: var(--violet); text-underline-offset: 3px; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; border-radius: 6px; }
[tabindex="-1"]:focus { outline: none; } /* headings that receive focus when a new stop opens */

.wrap { max-width: 40rem; margin-inline: auto; padding-inline: var(--lane); }
.wrap.wide { max-width: 70rem; }

h1, h2, h3 { font-family: var(--font-display); font-weight: 800; line-height: 1.08; text-wrap: balance; margin: 0; }
h2 { font-size: var(--step-3); margin-block: 0.15em 0.6em; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 1em; }

/* ---------- Screens and tab bar ---------- */
.app { min-height: 100dvh; }
#screens { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px) + 24px); }
.screen { padding-top: 28px; position: relative; }
.screen-loop { background: var(--card); }
.screen-off { background: var(--mint); }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(5, minmax(0, 1fr));
  background: var(--card); border-top: 2px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tab {
  background: none; border: 0; cursor: pointer; min-height: var(--tabbar-h);
  display: grid; justify-items: center; align-content: center; gap: 2px;
  font-size: 0.7rem; font-weight: 700; color: var(--ink-soft); padding: 6px 1px; line-height: 1.1;
}
.tab svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.tab[aria-current="page"] { color: var(--violet); }
.tab[aria-current="page"] svg { stroke-width: 2.8; }
.tab .dot { width: 5px; height: 5px; border-radius: 50%; background: transparent; }
.tab[aria-current="page"] .dot { background: var(--violet); }

.next-slot { margin: 2.4rem 0 0.5rem; }
.next {
  display: flex; width: 100%; min-height: 56px; align-items: center; justify-content: space-between; gap: 1rem;
  background: var(--ink); color: var(--paper); border: 0; border-radius: 16px; padding: 0.8rem 1.2rem;
  cursor: pointer; text-align: left;
}
.next small { display: block; font-size: var(--step--1); opacity: 0.8; font-weight: 400; }
.next b { font-family: var(--font-display); font-size: var(--step-1); font-weight: 800; }
.next svg { width: 28px; height: 28px; flex: none; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }

.band { padding-block: 40px; margin-top: 32px; border-top: 2px dashed var(--line); }

/* ---------- Hero ---------- */
.hero { padding-top: 12px; }
.byline { color: var(--ink-soft); font-size: var(--step--1); margin-bottom: 1rem; }
.byline cite { font-style: normal; font-weight: 700; color: var(--ink); }
.hero h1 { font-size: var(--step-4); letter-spacing: -0.01em; max-width: 11ch; }
.rider { margin-top: 1.6rem; }
.rider-q { font-family: var(--font-hand); font-size: 2rem; line-height: 1.1; margin-bottom: 0.7rem; }
.rider-picks { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pick {
  font-weight: 700; cursor: pointer; background: var(--card); border: 2px solid var(--ink); border-radius: 16px;
  min-height: 56px; padding: 0.5em 0.9em; display: flex; gap: 0.5em; align-items: baseline; justify-content: center;
}
.pick small { font-weight: 400; color: var(--ink-soft); font-size: var(--step--1); }
.pick[aria-pressed="true"] { background: var(--violet); border-color: var(--violet); color: var(--paper); }
.pick[aria-pressed="true"] small { color: var(--paper); }
.rider-reveal { margin-top: 1.3rem; display: grid; gap: 0.3rem; }
.rider-reveal .hand-line { font-size: 2.3rem; }
.rider-reveal .note { color: var(--ink-soft); margin-top: 0.4rem; }

/* ---------- Shared text pieces ---------- */
.stop { font-family: var(--font-hand); font-size: 1.5rem; color: var(--violet); margin: 0; }
.lede { font-size: var(--step-1); line-height: 1.5; }
.quote { margin: 1.3rem 0; padding: 0; }
.quote p { font-size: var(--step-1); line-height: 1.45; margin: 0 0 0.35rem; }
.quote.is-ryan p { font-size: var(--step-0); color: var(--ink-soft); }
.cite { font-size: var(--step--1); color: var(--ink-soft); display: block; }
.cite b { color: var(--ink); font-weight: 700; }
.hand-line { font-family: var(--font-hand); font-weight: 700; font-size: 1.9rem; line-height: 1.15; margin: 0; }
.scrap {
  display: inline-block; max-width: 100%; background: var(--mint); padding: 0.5rem 1rem 0.6rem; border-radius: 4px;
  transform: rotate(-1deg); margin: 0.6rem 0 1rem; box-shadow: 0 1px 0 var(--line);
}
.scrap .cite { font-family: var(--font-body); margin-top: 0.15rem; }
.scrap:nth-of-type(even) { transform: rotate(0.8deg); background: var(--peach); }
.screen-off .scrap, .screen-off .scrap:nth-of-type(even) { background: var(--paper); }
.draft-mark { outline: 1.5px dashed var(--line); outline-offset: 4px; border-radius: 4px; }
.slot { border: 2px dashed var(--line); border-radius: var(--radius-soft); padding: 1rem 1.1rem; margin: 1rem 0; color: var(--ink-soft); }
.slot b { color: var(--ink); display: block; margin-bottom: 0.25rem; }

.field { display: grid; gap: 0.4rem; margin: 1.4rem 0; }
.field label { font-family: var(--font-hand); font-size: 1.65rem; line-height: 1.1; }
.field .sub { font-size: var(--step--1); color: var(--ink-soft); }
textarea, input[type="text"] {
  font: inherit; font-size: max(16px, 1rem); color: var(--ink); background: var(--card); border: 2px solid var(--line);
  border-radius: 14px; padding: 0.75rem 0.9rem; width: 100%; min-height: var(--tap); resize: vertical;
}
textarea:focus, input[type="text"]:focus { border-color: var(--violet); outline: none; }

.story { background: var(--peach); border-radius: var(--radius-soft); padding: 1.2rem 1.2rem; margin: 2rem 0; }
.story h3 { margin-bottom: 0.4rem; }
.story p { margin-bottom: 0.4rem; }
.story .foot-note { font-size: var(--step--1); color: var(--ink-soft); margin: 0.6rem 0 0; }
.pop { border-left: 4px solid var(--violet); padding-left: 1rem; margin: 2rem 0; }

/* ---------- The loop ---------- */
.loop { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); margin-block: 0.5rem 1.5rem; }
.vortex-wrap { margin: 0; }
.vortex { width: 100%; max-width: 560px; aspect-ratio: 1; display: block; margin-inline: auto; overflow: visible; touch-action: manipulation; }
.vortex-hint { text-align: center; font-family: var(--font-hand); font-size: 1.5rem; color: var(--ink-soft); margin: 0; min-height: 1.6em; }
.spiral { fill: none; stroke: var(--violet); stroke-linecap: round; }
.spin { transform-origin: 260px 260px; animation: spin 80s linear infinite; }
@keyframes spin { to { transform: rotate(-360deg); } }
.arc { fill: none; stroke: var(--ink-soft); stroke-width: 2.5; stroke-linecap: round; }
.arrowhead { fill: var(--ink-soft); }
.feed-link { fill: none; stroke: var(--violet); stroke-width: 4.5; stroke-dasharray: 2 9; stroke-linecap: round; }
.feed-head { fill: var(--violet); }
.node { cursor: pointer; }
.node circle { fill: var(--paper); stroke: var(--violet); stroke-width: 3; }
.node .hit { fill: transparent; stroke: none; }
.node .n-name { font-family: var(--font-display); font-weight: 800; font-size: 21px; fill: var(--ink); text-anchor: middle; }
.node .n-voice { font-family: var(--font-hand); font-weight: 700; font-size: 19px; fill: var(--ink-soft); text-anchor: middle; }
.node .n-tag { font-family: var(--font-body); font-weight: 700; font-size: 14px; fill: var(--sun-ink); text-anchor: middle; }
.node.is-feeder .n-tag, .node.is-small .n-tag { fill: var(--ink-soft); }
.node:focus { outline: none; }
.node:focus-visible circle.ring, .node.is-open circle.ring { stroke-width: 6; }
.node.is-dominant circle.ring { fill: var(--sun); stroke: var(--sun-ink); }
.node.is-dominant .n-name, .node.is-dominant .n-voice { fill: var(--sun-ink); }
.node.is-feeder circle.ring { fill: var(--violet-wash); }
.node.is-small { opacity: 0.6; }

.station-panel { background: var(--paper); border-radius: var(--radius-soft); padding: 18px; border: 2px solid var(--line); }
.station h3 { font-size: var(--step-2); font-weight: 800; }
.station .voice { font-family: var(--font-hand); font-size: 1.8rem; color: var(--violet); margin: 0 0 0.6rem; }
.notelist { list-style: none; padding: 0.6rem 1rem; margin: 0 0 1rem; background: var(--mint); border-radius: 4px; display: flex; flex-wrap: wrap; gap: 0.1rem 1.1rem; font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.2; transform: rotate(-0.5deg); }
.notelist li::before { content: "\2013  "; }
.notelist .tail { flex-basis: 100%; font-weight: 700; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.notelist .tail::before { content: ""; }
.notelist-src { font-size: var(--step--1); color: var(--ink-soft); margin: -0.6rem 0 1rem; }
.where { font-weight: 700; margin: 1.4rem 0 0; }
.roles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; margin: 0.6rem 0 0.4rem; }
.role { font-size: var(--step--1); font-weight: 700; cursor: pointer; background: var(--card); border: 2px solid var(--line); border-radius: 14px; min-height: var(--tap); padding: 0.4em 0.5em; line-height: 1.2; }
.role[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.role[data-role="dominant"][aria-pressed="true"] { background: var(--sun); border-color: var(--sun-ink); color: var(--sun-ink); }
.exit-jump { display: inline-flex; align-items: center; min-height: var(--tap); margin-top: 0.4rem; font-weight: 700; background: none; border: 0; padding: 0; color: var(--violet); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.picks-so-far { display: grid; gap: 6px; margin: 0.8rem 0 0; padding: 0; list-style: none; }
.picks-so-far li { display: flex; justify-content: space-between; gap: 1rem; border-bottom: 1px solid var(--line); padding-bottom: 6px; }
.picks-so-far span { color: var(--ink-soft); }
.panel-empty .hand-line { margin-bottom: 0.3rem; }

.friends { display: grid; gap: 8px; margin: 0.8rem 0 0.4rem; grid-template-columns: minmax(0, 1fr); }
.friend {
  cursor: pointer; text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: 16px;
  min-height: 64px; padding: 6px 14px 6px 8px; display: grid; grid-template-columns: 52px minmax(0, 1fr); align-items: center; gap: 10px;
}
.friend svg { width: 52px; height: 52px; stroke: var(--ink); fill: none; stroke-width: 3.2; stroke-linecap: round; stroke-linejoin: round; }
.friend svg .fill { fill: var(--ink); stroke: none; }
.friend span { font-weight: 700; }
.friend b { font-family: var(--font-display); font-weight: 600; margin-right: 0.3em; color: var(--ink-soft); }
.friend[aria-pressed="true"] { border-color: var(--violet); background: var(--violet-wash); }
.figure-note { margin: 2rem 0 0; }
.figure-note img { border-radius: 6px; border: 1px solid var(--line); display: block; }
.figure-note figcaption { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.4rem; }

/* ---------- The ride: a track down every screen, with a cart that rides along ---------- */
.ride-layer { position: absolute; left: 0; top: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.screen > .wrap, .band > .wrap { position: relative; z-index: 2; }
.ride-gap { height: 96px; }
.ride-gap[data-kind="loop"] { height: 156px; }
.ride-gap[data-kind="cross"] { height: 64px; }
.ride-gap[data-kind="zigzag"], .ride-gap[data-kind="wave"] { height: 124px; }
.ride-gap[data-kind="double"] { height: 196px; }
.ride-ties { fill: none; stroke: var(--ink-soft); stroke-width: 12; stroke-dasharray: 2.5 9; opacity: 0.32; }
.ride-rail { fill: none; stroke: var(--violet); stroke-width: 3.5; stroke-linecap: round; stroke-linejoin: round; opacity: 0.85; }
.ride-cart .body { fill: var(--sun); stroke: var(--ink); stroke-width: 2; }
.ride-cart .head { fill: var(--ink); }
.ride-cart .wheel { fill: var(--ink); }
@media (prefers-reduced-motion: reduce) { .ride-cart { display: none; } }

/* ---------- Sources, shown on hover (computers) or a tap (phones) ---------- */
.has-ref { cursor: pointer; border-radius: 6px; }
.has-ref:focus { outline: none; }
.has-ref:focus-visible { outline: 2px dashed var(--focus); outline-offset: 4px; }
.ref {
  display: block; font-family: var(--font-body); font-size: var(--step--1); line-height: 1.4; color: var(--ink-soft);
  max-height: 0; opacity: 0; overflow: hidden; margin: 0; transition: max-height 220ms ease, opacity 180ms ease, margin 180ms ease;
}
.ref a { color: var(--violet); }
.has-ref.show .ref, .has-ref:focus-within .ref { max-height: 9em; opacity: 1; margin-top: 0.35rem; }
@media (hover: hover) { .has-ref:hover .ref { max-height: 9em; opacity: 1; margin-top: 0.35rem; } }
.ref-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); opacity: 0.45; margin-left: 0.45em; vertical-align: middle; position: relative; top: -0.08em; }
.has-ref.show .ref-dot, .has-ref:focus-within .ref-dot { opacity: 1; }
@media (hover: hover) { .has-ref:hover .ref-dot { opacity: 1; } }
.hint { font-size: var(--step--1); color: var(--ink-soft); }
.hint::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--violet); opacity: 0.6; margin-right: 0.5em; vertical-align: middle; }
.h-ref h3 { margin: 0; }
.notes .notelist { margin-bottom: 0.4rem; }
.src-hint { font-size: var(--step--1); color: var(--ink-soft); margin: 0.3rem 0 0; }
.bars-box { display: block; }
.fact .ref { grid-column: 1 / -1; }
.res-list { list-style: none; padding: 0; margin: 0.8rem 0 1.8rem; display: grid; gap: 0.7rem; }
.res-list li { display: grid; gap: 0.1rem; padding-bottom: 0.7rem; border-bottom: 1px solid var(--line); }
.res-list li:last-child { border-bottom: 0; }
.res-list span { font-size: var(--step--1); color: var(--ink-soft); }
#res-body h3 { margin-top: 1.8rem; margin-bottom: 0.6rem; }
.seventeen { display: flex; align-items: baseline; gap: 0.6rem; margin: 0.4rem 0 0.2rem; }
.seventeen .big { font-family: var(--font-display); font-weight: 800; font-size: 3.4rem; line-height: 1; color: var(--violet); }
.seventeen .big-label { font-family: var(--font-hand); font-size: 1.6rem; color: var(--ink-soft); }
.calm { list-style: none; padding: 0; margin: 0.6rem 0 1.6rem; display: grid; gap: 8px; counter-reset: calm; }
.calm li { display: grid; grid-template-columns: 2rem minmax(0, 1fr); gap: 2px 12px; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 0.7rem 0.9rem; counter-increment: calm; }
.calm li::before { content: counter(calm); grid-row: 1 / 3; font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: var(--violet); line-height: 1; }
.calm b { font-family: var(--font-display); font-weight: 800; }
.calm-voice { font-family: var(--font-hand); font-size: 1.4rem; margin-left: 0.5em; color: var(--ink-soft); }
.calm-note { grid-column: 2; font-size: var(--step--1); color: var(--ink-soft); }
@media (prefers-reduced-motion: reduce) { .ref { transition: none; } }

/* ---------- Bottom sheet (station details on phones) ---------- */
.sheet { position: fixed; inset: 0; z-index: 40; }
.sheet-scrim { position: absolute; inset: 0; background: var(--scrim); }
.sheet-card {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 88dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border-radius: 22px 22px 0 0; padding: 4px var(--gutter) calc(20px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.18); outline: none;
  animation: sheet-up 220ms ease-out;
}
@keyframes sheet-up { from { transform: translateY(40px); opacity: 0.6; } to { transform: none; opacity: 1; } }
.sheet-grab { display: flex; justify-content: center; padding: 8px 0 4px; cursor: grab; touch-action: none; }
.sheet-grab span { width: 44px; height: 5px; border-radius: 99px; background: var(--line); }
.sheet-close { position: absolute; top: 10px; right: 12px; min-height: 40px; padding: 0 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--card); font-weight: 700; font-size: var(--step--1); cursor: pointer; }
.sheet-body { padding-top: 10px; max-width: 40rem; margin-inline: auto; }
.sheet-steps { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1.4rem; }
.sheet-steps button { min-height: var(--tap); border-radius: 14px; border: 2px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; padding: 0.3em 0.6em; }

/* ---------- Getting off ---------- */
.coaster-pin { position: sticky; top: 0; z-index: 5; background: var(--mint); padding-top: max(8px, env(safe-area-inset-top, 0px)); padding-bottom: 6px; border-bottom: 2px dashed var(--line); }
.coaster { margin: 0; }
.coaster-svg { width: 100%; height: auto; max-height: 120px; display: block; overflow: visible; }
.coaster-svg .track { fill: none; stroke: var(--violet); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; transition: d 500ms ease; }
.coaster-svg .ties { stroke: var(--ink-soft); stroke-width: 2; opacity: 0.5; }
.coaster-svg .ground { stroke: var(--ink); stroke-width: 2.5; }
.coaster-svg .cart { fill: var(--sun); stroke: var(--ink); stroke-width: 2.5; }
.coaster-svg .lbl { font-family: var(--font-hand); font-size: 30px; fill: var(--ink-soft); }
.gauge { display: flex; align-items: baseline; gap: 0.3rem 0.8rem; flex-wrap: wrap; }
.gauge .gs { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; font-variant-numeric: tabular-nums; }
.gauge .gs-label { color: var(--ink-soft); font-size: var(--step--1); }
.exits { display: grid; gap: 12px; margin: 1.2rem 0; }
.exit { background: var(--paper); border: 2px solid var(--line); border-radius: var(--radius-soft); padding: 1rem 1.05rem; scroll-margin-top: 170px; }
.exit.is-on { border-color: var(--violet); }
.exit h3 { font-size: var(--step-1); font-weight: 800; }
.exit .for { font-size: var(--step--1); color: var(--ink-soft); display: inline-block; margin-top: 0.2rem; }
.exit .for.mine { color: var(--sun-ink); background: var(--sun); padding: 0.05em 0.6em; border-radius: 999px; font-weight: 700; }
.try { display: block; width: 100%; font-weight: 700; cursor: pointer; border-radius: 14px; min-height: var(--tap); margin-top: 0.4rem; border: 2px solid var(--violet); background: transparent; color: var(--violet); }
.try[aria-pressed="true"] { background: var(--violet); color: var(--paper); }
.exit .quote p { font-size: var(--step-0); }
.exit .quote { margin: 0.8rem 0; }
.exit .pairing { font-size: var(--step--1); color: var(--ink-soft); margin-top: 0.6rem; }
.moves-title { margin-top: 2.2rem; }

/* ---------- Not your fault ---------- */
.sort { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; margin: 1rem 0; }
.sort h3 { font-size: var(--step-0); font-family: var(--font-body); font-weight: 700; margin-bottom: 0.5rem; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: var(--step--1); cursor: pointer; text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: 14px; min-height: 44px; padding: 0.4em 0.85em; }
.chip[aria-pressed="true"] { border-color: var(--ink); background: var(--peach); }
.sort .col-mine .chip[aria-pressed="true"] { background: var(--mint); }
.tally { font-size: var(--step-1); min-height: 1.5em; }
.bars { margin: 1rem 0 0.4rem; display: grid; gap: 10px; }
.bar-row { display: grid; grid-template-columns: minmax(0, 1fr) 3.6rem; align-items: center; gap: 4px 10px; font-size: var(--step--1); }
.bar-track { grid-column: 1 / -1; grid-row: 2; height: 14px; background: var(--line); border-radius: 999px; overflow: hidden; }
.bar-fill { height: 100%; background: var(--violet); border-radius: 999px; }
.bar-row.ref .bar-fill { background: var(--ink-soft); }
.bar-row.ref { color: var(--ink-soft); }
.bar-val { font-variant-numeric: tabular-nums; text-align: right; font-weight: 700; }
.src { font-size: var(--step--1); color: var(--ink-soft); }
.house { background: var(--card); border-radius: var(--radius-soft); padding: 1rem 1.1rem; margin: 1.6rem 0; border: 2px solid var(--line); }
.house p { margin-bottom: 0.4rem; }

/* ---------- Not alone ---------- */
.facts { list-style: none; padding: 0; margin: 1.2rem 0; display: grid; gap: 1.1rem; }
.fact { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.2rem; padding-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.fact:last-child { border-bottom: 0; }
.fact .big { font-family: var(--font-display); font-weight: 800; font-size: 2.3rem; line-height: 1; color: var(--violet); }
.fact p { margin: 0 0 0.3rem; }

/* ---------- Therapist ---------- */
.therapist { background: var(--peach); }
.therapist .who { font-family: var(--font-hand); font-size: 1.8rem; margin: -0.4rem 0 0.8rem; }
.therapist .slot { background: color-mix(in srgb, var(--paper) 55%, transparent); }

/* ---------- My ride ---------- */
.ticket { background: var(--card); border: 2px solid var(--ink); border-radius: var(--radius-soft); padding: 1.1rem 1.2rem; position: relative; }
.ticket::before, .ticket::after { content: ""; position: absolute; top: 50%; width: 22px; height: 22px; border-radius: 50%; background: var(--paper); border: 2px solid var(--ink); transform: translateY(-50%); }
.ticket::before { left: -13px; clip-path: inset(0 0 0 50%); }
.ticket::after { right: -13px; clip-path: inset(0 50% 0 0); }
.ticket dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr); gap: 0; }
.ticket dt { color: var(--ink-soft); font-size: var(--step--1); }
.ticket dd { margin: 0 0 0.7rem; font-weight: 700; }
.ticket dd:last-child { margin-bottom: 0; }
.ticket dd.empty { font-weight: 400; color: var(--ink-soft); font-style: italic; }
.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 1rem; }
.btn { font-weight: 700; cursor: pointer; border-radius: 14px; min-height: 52px; padding: 0.5em 1em; border: 2px solid var(--ink); background: var(--ink); color: var(--paper); }
.btn.ghost { background: transparent; color: var(--ink); }
.copy-fallback { width: 100%; min-height: 10rem; margin-top: 0.8rem; font-size: var(--step--1); }

/* ---------- Listen ---------- */
.eps { list-style: none; padding: 0; margin: 1rem 0; display: grid; gap: 0.8rem; }
.eps b { font-family: var(--font-display); font-weight: 600; display: block; }
.links { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.links a { display: flex; align-items: center; justify-content: center; min-height: 52px; border-radius: 14px; border: 2px solid var(--violet); font-weight: 700; text-decoration: none; }
.qs { margin: 1.4rem 0 0; padding: 1rem 1.2rem 1rem 2.4rem; background: var(--mint); border-radius: 4px; font-family: var(--font-hand); font-size: 1.5rem; line-height: 1.3; transform: rotate(-0.4deg); }

/* ---------- Footer ---------- */
.foot-slot { margin-top: 2.4rem; padding-top: 1.2rem; border-top: 2px dashed var(--line); color: var(--ink-soft); font-size: var(--step--1); }
.foot-slot p { margin-bottom: 0.6em; }
.foot-slot .care { color: var(--ink); font-weight: 700; }

/* ---------- Wider screens: same screens, more room ---------- */
@media (min-width: 900px) {
  :root { --gutter: 32px; --lane: 32px; }
  .ride-gap { height: 120px; }
  .ride-gap[data-kind="loop"] { height: 190px; }
  .ride-gap[data-kind="cross"] { height: 84px; }
  .ride-gap[data-kind="zigzag"], .ride-gap[data-kind="wave"] { height: 150px; }
  .ride-gap[data-kind="double"] { height: 230px; }
  .screen { padding-top: 56px; }
  .hero h1 { max-width: 12ch; }
  .rider-picks { display: flex; flex-wrap: wrap; }
  .pick { border-radius: 999px; min-height: 48px; padding-inline: 1.2em; }
  .loop { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; gap: 40px; }
  .vortex-wrap { margin-inline: 0; }
  .station-panel { padding: 26px; position: sticky; top: 24px; }
  .friends { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .friend { grid-template-columns: minmax(0, 1fr); justify-items: center; text-align: center; padding: 12px 8px; }
  .sort { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .bar-row { grid-template-columns: minmax(8rem, 14rem) minmax(0, 1fr) 3.6rem; }
  .bar-track { grid-column: auto; grid-row: auto; }
  .fact { grid-template-columns: 8rem minmax(0, 1fr); gap: 1rem; align-items: baseline; }
  .ticket dl { grid-template-columns: minmax(8rem, 11rem) minmax(0, 1fr); gap: 0.5rem 1rem; }
  .ticket dd { margin: 0; }
  .exit-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 1rem; }
  .try { width: auto; padding-inline: 1.2em; margin-top: 0; white-space: nowrap; }
  .coaster-svg { max-height: 150px; }
  .tabbar {
    left: 50%; right: auto; bottom: 16px; transform: translateX(-50%); width: min(560px, calc(100% - 32px));
    border: 2px solid var(--line); border-radius: 22px; box-shadow: 0 6px 24px rgba(0, 0, 0, 0.12); padding-bottom: 0;
  }
  #screens { padding-bottom: calc(var(--tabbar-h) + 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .spin, .sheet-card { animation: none; }
  .coaster-svg .track { transition: none; }
}
