/* The planner app. Dark, flat, type-led. Two signature pieces: the ticket (a plan) and
   the signboard (an area). Colours and families come from tokens.css. */

/* ---------- fonts (self-hosted, latin; latin-ext only for the peso sign) ---------- */
@font-face {
  font-family: "Fraunces Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 100 900;
  src: url("../../assets/fonts/fraunces-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("../../assets/fonts/instrument-sans-latin-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Instrument Sans Variable";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  src: url("../../assets/fonts/instrument-sans-latin-ext-wght-normal.woff2") format("woff2-variations");
  unicode-range: U+20A0-20AB, U+20AD-20C0;
}
/* Metric-matched fallbacks (dn-code 12, CLS): while a web font loads, a local sans takes its
   width and line height, so nothing moves when it arrives. Values from
   `node scripts/font-fallbacks.mjs`; test/font-fallbacks.test.js keeps them in step. */
@font-face { font-family: "Fraunces Variable Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); font-display: swap; size-adjust: 115.90%; ascent-override: 84.38%; descent-override: 22.00%; line-gap-override: 0.00%; }
@font-face { font-family: "Instrument Sans Variable Fallback"; src: local("Arial"), local("Liberation Sans"), local("Helvetica"); font-display: swap; size-adjust: 103.10%; ascent-override: 94.08%; descent-override: 24.25%; line-gap-override: 0.00%; }
/* The width axis, used only by the signboards. */
@font-face {
  font-family: "Instrument Sans Signboard";
  font-style: normal;
  font-display: swap;
  font-weight: 400 700;
  font-stretch: 75% 100%;
  src: url("../../assets/fonts/instrument-sans-latin-wdth-normal.woff2") format("woff2-variations");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  --line: #3D2B33;          /* quiet rule on night */
  --line-strong: #7A656D;   /* control outlines: 3:1 on night */
  --gold-rule: #5B2446;     /* the ticket's rail: dim hot pink */
  --tabbar-h: 62px;
  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-left: env(safe-area-inset-left, 0px);
  --safe-right: env(safe-area-inset-right, 0px);
  --col: 480px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  background: var(--night);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--night);
  color: var(--cream);
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

h1, h2, h3, p, ul, ol, fieldset, legend { margin: 0; padding: 0; }
ul, ol { list-style: none; }
fieldset { border: 0; min-width: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; }
svg.icon { flex: none; display: block; }

:focus { outline: none; }
:focus-visible { outline: 2px solid var(--cream); outline-offset: 3px; border-radius: 4px; }
/* headings take focus on a screen change so screen readers start there; no ring for that */
[tabindex="-1"]:focus-visible { outline: none; }

.visually-hidden, .offscreen {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0;
}
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 10; background: var(--cream); color: var(--night); padding: 0.6rem 1rem; border-radius: var(--radius-sm); font-weight: 600; text-decoration: none; }
.skip:focus { top: 0.5rem; }

/* ---------- shell ---------- */
.app {
  max-width: var(--col);
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
}
@media (min-width: 520px) {
  .app { border-left: 1px solid var(--line); border-right: 1px solid var(--line); }
}

.screen {
  padding: calc(var(--safe-top) + 20px) calc(var(--gutter) + var(--safe-right)) calc(var(--tabbar-h) + var(--safe-bottom) + 40px) calc(var(--gutter) + var(--safe-left));
}

.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--col);
  z-index: 20;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 0 calc(6px + var(--safe-right)) var(--safe-bottom) calc(6px + var(--safe-left));
  background: var(--night);
  border-top: 1px solid var(--line);
}
.tab {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: var(--tabbar-h);
  color: var(--muted-on-night);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.01em;
  text-decoration: none;
}
.tab[aria-current="page"] { color: var(--cream); }
.tab[aria-current="page"]::before {
  content: "";
  position: absolute;
  top: -1px;
  left: 50%;
  width: 28px;
  margin-left: -14px;
  height: 3px;
  background: var(--coral);
}

/* ---------- type ---------- */
.display {
  font-family: var(--font-display);
  font-weight: 480;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.h-screen { font-size: 34px; }
.saved > .h-screen, .guides > .h-screen, .more > .h-screen { margin-top: 26px; }
.h-screen + .lede { margin-top: 8px; }
.h-section {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 22px;
  letter-spacing: -0.01em;
  line-height: 1.15;
}
.lede { color: var(--muted-on-night); font-size: 17px; }
.small { font-size: 14px; }
.muted { color: var(--muted-on-night); }
.gold { color: var(--coral); }

.wordmark {
  font-size: 13px;
  font-weight: 600;
  color: var(--coral);
  letter-spacing: 0.02em;
}

.stack > * + * { margin-top: var(--gap, 16px); }
.section { margin-top: 36px; }
.section > .h-section { margin-bottom: 14px; }
.details__quick-plan { position: sticky; bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 10px); z-index: 12; display: grid; gap: 8px; margin-top: 18px; padding: 10px; background: var(--night-2); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: 0 8px 18px rgb(0 0 0 / 0.22); }
.details__quick-summary { font-size: 13px; font-weight: 650; color: var(--blush); }
.rule { border: 0; border-top: 1px solid var(--line); margin: 28px 0; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 12px 20px;
  border-radius: var(--radius);
  font-weight: 650;
  font-size: 16px;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 80ms ease-out;
}
.btn:active { transform: scale(0.985); }
.btn--primary { background: var(--cta); color: var(--night); }
.btn--secondary { border: 1px solid var(--line-strong); color: var(--cream); }
.btn--block { display: flex; width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: default; }

.linkbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: var(--tap);
  padding: 0 2px;
  font-weight: 600;
  font-size: 15px;
  color: var(--cream);
  text-decoration: underline;
  text-decoration-color: var(--line-strong);
  text-underline-offset: 4px;
}
.linkbtn--action { color: var(--cta); text-decoration: none; }
.linkbtn--quiet { color: var(--muted-on-night); }

.backbtn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: var(--tap);
  min-width: var(--tap);
  margin-left: -8px;
  padding: 0 10px 0 4px;
  font-size: 15px;
  font-weight: 600;
  color: var(--muted-on-night);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: var(--tap);
  margin-bottom: 12px;
}

/* ---------- tonight ---------- */
.hero { padding: 4px 0 2px; }
.hero__title { font-size: clamp(54px, 17.2vw, 76px); font-weight: 440; letter-spacing: -0.035em; line-height: 0.92; margin-top: 14px; }
.hero__line { margin-top: 10px; font-size: 19px; color: var(--blush); }
.tonight .section { margin-top: 26px; }
.tonight .choice__body { padding-top: 10px; padding-bottom: 10px; }

/* choice rows: occasions, budget */
.choices { border-top: 1px solid var(--line); }
.choice { position: relative; display: block; border-bottom: 1px solid var(--line); }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__body {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 4px 14px;
  min-height: 64px;
  padding: 12px 10px 12px 14px;
  border-left: 3px solid transparent;
  cursor: pointer;
}
.choice__label { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; line-height: 1.15; }
.choice__line { grid-column: 1; color: var(--muted-on-night); font-size: 14.5px; line-height: 1.35; }
.choice__mark {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1.5px solid var(--line-strong);
  display: grid;
  place-items: center;
  color: transparent;
}
.choice input:checked + .choice__body, .choice[aria-current="true"] .choice__body { background: var(--night-2); border-left-color: var(--coral); }
.choice input:checked + .choice__body .choice__mark, .choice[aria-current="true"] .choice__mark { background: var(--coral); border-color: var(--coral); color: var(--night); }
.choice input:focus-visible + .choice__body { outline: 2px solid var(--cream); outline-offset: -2px; }
/* One-tap rows (spec 012): the occasion and the budget are buttons, the stored one marked aria-current. */
button.choice { width: 100%; text-align: left; }
button.choice:focus-visible { outline-offset: -2px; border-radius: 0; }

.choice--budget .choice__label { font-family: var(--font-ui); font-weight: 700; font-size: 18px; letter-spacing: 0.04em; color: var(--coral); min-width: 3.2em; }
.choice--budget .choice__body { grid-template-columns: auto 1fr auto; min-height: 54px; }
.choice--budget .choice__line { grid-column: 2; grid-row: 1; font-size: 15.5px; color: var(--cream); }
.choice--budget .choice__mark { grid-column: 3; grid-row: 1; }

.who { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; }
.who__text { font-size: 17px; color: var(--blush); text-align: right; }
.who__hint { display: block; font-family: var(--font-ui); font-size: 14px; font-weight: 400; letter-spacing: 0; color: var(--muted-on-night); margin-top: 2px; }

/* stepper */
.stepper { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.stepper__btn {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--cream);
}
.stepper__btn[disabled] { opacity: 0.35; cursor: default; }
.stepper__value {
  min-width: 2.4em;
  text-align: center;
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: 500;
  color: var(--coral);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stepper--time .stepper__value { min-width: 4.5em; font-size: 22px; }

/* ---------- vibe ---------- */
.progress { display: grid; grid-template-columns: repeat(5, 1fr); gap: 5px; flex: 1; max-width: 150px; }
.progress__seg { height: 3px; background: var(--night-3); }
.progress__seg--done { background: var(--coral); }

.question { font-size: clamp(32px, 9.6vw, 40px); margin-top: 18px; }
.question__who { color: var(--coral); font-size: 15px; font-weight: 600; margin-top: 6px; }
.answers { margin-top: 28px; display: grid; gap: 10px; }
.answer {
  display: block;
  width: 100%;
  text-align: left;
  padding: 16px 18px;
  min-height: 76px;
  background: var(--night-2);
  border-radius: var(--radius);
  border: 1px solid transparent;
}
.answer:active { border-color: var(--coral); }
.answer--picked { border-color: var(--coral); }
.answer__label { display: block; font-weight: 650; font-size: 18px; line-height: 1.25; }
.answer__sub { display: block; margin-top: 3px; color: var(--muted-on-night); font-size: 15px; }

.reuse {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: 22px;
  padding: 12px 0;
  min-height: 56px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.reuse__label { font-weight: 650; color: var(--cta); }
.reuse__sub { display: block; color: var(--muted-on-night); font-size: 14px; }

/* the archetype result: a wine plate */
.result {
  margin-top: 8px;
  padding: 26px 22px 24px;
  background: var(--wine);
  border-radius: var(--radius);
}
.result__lead { font-size: 15px; font-weight: 600; color: var(--blush); }
.result__name { font-size: clamp(38px, 11.4vw, 48px); margin-top: 8px; }
.result__blurb { margin-top: 14px; font-size: 18px; line-height: 1.4; }
.result__night { margin-top: 20px; padding-top: 16px; border-top: 1px solid #A8566A; }
.result__night-label { font-size: 14px; font-weight: 600; color: var(--blush); }
.result__night-text { margin-top: 4px; font-size: 16px; }
.result__pair { margin-top: 14px; font-size: 15px; color: var(--blush); }

.actions { margin-top: 20px; display: grid; gap: 10px; }
.actions--inline { display: flex; flex-wrap: wrap; gap: 4px 22px; justify-content: center; }

/* ---------- details ---------- */
/* THE SIGNBOARD: a jeepney route board. Condensed bold capitals on a solid plate. */
/* min-width: 0 lets the column and the plate shrink below a long name (WCAG 1.4.10, audit P1). */
.signboards { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
.signboard { position: relative; display: block; min-width: 0; max-width: 100%; }
.signboard input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.plate {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 84px;
  padding: 8px 16px 8px 18px;
  border-radius: 5px;
  background: var(--cream);
  color: var(--ink);
  border: 2px solid var(--cream);
  box-shadow: inset 0 0 0 2px var(--cream), inset 0 0 0 3.5px var(--ink);
  cursor: pointer;
  min-width: 0;
  max-width: 100%;
}
.plate__name {
  font-family: "Instrument Sans Signboard", var(--font-ui);
  font-weight: 700;
  font-stretch: 75%;
  font-variation-settings: "wdth" 75;
  font-size: clamp(46px, 14.2vw, 58px);
  line-height: 0.9;
  letter-spacing: 0.005em;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}
.plate__via { font-size: 13px; font-weight: 600; line-height: 1.25; text-align: right; max-width: 9.5em; }
.plate__tick {
  width: 26px;
  height: 26px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  border: 1.5px solid var(--muted-on-cream);
  color: transparent;
}
.plate__side { display: flex; align-items: center; gap: 12px; }
.signboard input:checked + .plate .plate__tick, .signboard[aria-current="true"] .plate__tick { background: var(--wine); border-color: var(--wine); color: var(--cream); }
.signboard input:focus-visible + .plate { outline: 2px solid var(--coral); outline-offset: 3px; }
button.signboard { width: 100%; text-align: left; }
button.signboard:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; border-radius: 5px; }
.signboard__blurb { margin-top: 8px; font-size: 14.5px; color: var(--muted-on-night); }

/* a small plate, for the ticket header */
.plate--mini {
  display: inline-flex;
  min-height: 0;
  padding: 5px 9px 4px;
  border-width: 0;
  box-shadow: inset 0 0 0 1.5px var(--ink);
  border: 2px solid var(--cream);
  border-radius: 4px;
  cursor: default;
}
.plate--mini .plate__name { font-size: 21px; line-height: 1; }

/* areas that are not open yet: the board is unlit */
.soon { border-top: 1px solid var(--line); margin-top: 20px; }
.soon__summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: 650; color: var(--blush); }
.soon__summary::marker { color: var(--coral); }
.soon__list { margin: 0; }
.soon__row { border-bottom: 1px solid var(--line); padding: 10px 0; }
.soon__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: var(--tap); }
.plate--off {
  display: inline-flex;
  min-height: 0;
  padding: 6px 10px 5px;
  background: var(--night-3);
  color: var(--muted-on-night);
  border: 0;
  box-shadow: none;
  cursor: default;
}
.plate--off .plate__name { font-size: 24px; line-height: 1; }
.soon__blurb { font-size: 14.5px; color: var(--muted-on-night); margin: 2px 0 14px; }
.soon__form { margin-top: 10px; padding-bottom: 6px; }

/* #/area and #/budget (spec 012) */
.steps__hint { margin-top: 8px; }
.steps__body { margin-top: 18px; }
.step-details { border-top: 1px solid var(--line); margin-top: 26px; }
.step-details__summary { min-height: var(--tap); display: flex; align-items: center; cursor: pointer; font-weight: 650; color: var(--blush); list-style: none; }
.step-details__summary::-webkit-details-marker { display: none; }
/* The disclosure's chevron: down while closed, up while open (as More on the plan). */
.step-details__summary::after {
  content: "";
  width: 8px;
  height: 8px;
  margin-left: 10px;
  border-right: 2px solid var(--coral);
  border-bottom: 2px solid var(--coral);
  transform: translateY(-2px) rotate(45deg);
  transition: transform 140ms ease-out;
}
.step-details[open] > .step-details__summary::after { transform: translateY(2px) rotate(-135deg); }

/* segmented control */
.segments {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 3px;
  gap: 3px;
}
.segment { position: relative; display: block; }
.segment input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.segment span {
  display: grid;
  place-items: center;
  min-height: 44px;
  padding: 4px 6px;
  border-radius: 9px;
  font-weight: 600;
  font-size: 15px;
  line-height: 1.15;
  text-align: center;
  cursor: pointer;
}
.segment input:checked + span { background: var(--cream); color: var(--ink); }
.segment input:focus-visible + span { outline: 2px solid var(--coral); outline-offset: 2px; }

.field-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 60px; }
.field-row + .field-row, .segments + .field-row, .field-row + .segments, .datefield + .field-row { margin-top: 10px; }
.field-row__label { font-size: 16px; font-weight: 600; }
.field-row__hint { display: block; font-weight: 400; font-size: 14px; color: var(--muted-on-night); }
.group-label { display: block; font-size: 14px; font-weight: 600; color: var(--muted-on-night); margin: 16px 0 8px; }

.datefield { margin-top: 10px; }

/* switches */
.switches { border-top: 1px solid var(--line); }
.switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 60px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.switch__text { font-weight: 600; }
.switch__hint { display: block; font-weight: 400; font-size: 14px; color: var(--muted-on-night); }
.switch__hint[hidden] { display: none; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch__track {
  flex: none;
  position: relative;
  width: 50px;
  height: 30px;
  border-radius: 15px;
  background: var(--night-3);
  border: 1px solid var(--line-strong);
}
.switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--muted-on-night);
  transition: transform 140ms ease-out;
}
.switch input:checked + .switch__track { background: var(--coral); border-color: var(--coral); }
.switch input:checked + .switch__track::after { transform: translateX(20px); background: var(--night); }
.switch input:focus-visible + .switch__track { outline: 2px solid var(--cream); outline-offset: 3px; }

/* ---------- forms ---------- */
.input {
  display: block;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  background: var(--night-2);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  color: var(--cream);
  font-size: 16px;
}
.input::placeholder { color: #9C8A90; }
.input:focus-visible { outline: 2px solid var(--cream); outline-offset: 1px; border-radius: 10px; }
textarea.input { min-height: 84px; resize: vertical; }
input[type="date"].input { color-scheme: dark; }
.label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }

.consent { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; font-size: 14px; color: var(--muted-on-night); line-height: 1.4; cursor: pointer; }
.consent input {
  flex: none;
  appearance: none;
  -webkit-appearance: none;
  width: 24px;
  height: 24px;
  margin: 0;
  border: 1.5px solid var(--line-strong);
  border-radius: 5px;
  background: var(--night-2);
  display: grid;
  place-items: center;
}
.consent input:checked { background: var(--coral); border-color: var(--coral); }
.consent input:checked::after {
  content: "";
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--night);
  border-bottom: 2px solid var(--night);
  transform: translateY(-1px) rotate(-45deg);
}
.consent a { color: var(--cream); }
.form__row { margin-top: 12px; }
.form__msg { margin-top: 10px; font-size: 14.5px; min-height: 1px; }
.form__msg--error { color: #F0908A; }
.form__msg--ok { color: #9CCBA5; }
.form__done { display: flex; gap: 10px; align-items: flex-start; color: #9CCBA5; font-weight: 600; }

.block { padding: 26px 0; border-top: 1px solid var(--line); }
.block__title { font-family: var(--font-display); font-weight: 500; font-size: 22px; letter-spacing: -0.01em; line-height: 1.2; }
.block__text { margin-top: 6px; color: var(--muted-on-night); font-size: 15.5px; }
.block__body { margin-top: 14px; }
.block__price { color: var(--coral); white-space: nowrap; }

/* ---------- THE TICKET ---------- */
.ticket {
  --rail: 70px;
  --pad: 18px;
  position: relative;
  background: var(--night-2);
  border-radius: var(--radius);
}
.ticket__head {
  padding: 18px var(--pad) 20px;
  background: var(--wine);
  border-radius: var(--radius) var(--radius) 0 0;
}
.ticket__headrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ticket__admit { font-size: 14px; font-weight: 600; color: var(--blush); }
.ticket__title { font-size: clamp(32px, 9.4vw, 38px); margin-top: 16px; }
.ticket__meta { margin-top: 8px; font-size: 15.5px; line-height: 1.4; }
.ticket__meta .t-time { font-weight: 600; }
.ticket__est { color: var(--blush); }
.ticket__estimate-note { display: block; margin-top: 4px; color: var(--cream); font-size: 13px; line-height: 1.35; }

/* the perforation: holes punched through to the night behind, a notch at each edge */
.perf {
  position: relative;
  height: 28px;
  display: flex;
  align-items: center;
  padding-left: calc(var(--rail) - 6px);
}
.perf::before, .perf::after {
  content: "";
  position: absolute;
  top: 50%;
  width: 20px;
  height: 20px;
  margin-top: -10px;
  border-radius: 50%;
  background: var(--night);
}
.perf::before { left: -10px; }
.perf::after { right: -10px; }
.perf__line {
  position: absolute;
  left: 18px;
  right: 18px;
  top: 50%;
  margin-top: -2px;
  border-top: 4px dotted var(--night);
}
.perf__leg {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0 8px 0 6px;
  background: var(--night-2);
  color: var(--blush);
  font-size: 13.5px;
  font-weight: 600;
  line-height: 28px;
  white-space: nowrap;
}
.perf--head { height: 0; }
.perf--head::before, .perf--head::after { margin-top: -10px; }
.perf--head .perf__line { margin-top: -2px; }

.stop {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
}
.stop__rail {
  padding: 16px 0 16px var(--pad);
  border-right: 1px solid var(--gold-rule);
  color: var(--coral);
  font-variant-numeric: tabular-nums;
}
.stop__time { display: block; font-family: var(--font-display); font-weight: 500; font-size: 21px; line-height: 1.1; font-variant-numeric: normal; }
.stop__ampm { display: block; font-size: 12px; font-weight: 600; margin-top: 2px; }
.stop__body { padding: 14px var(--pad) 8px 14px; min-width: 0; }
.stop__role { font-size: 13.5px; font-weight: 600; color: var(--coral); }
.stop__name { font-family: var(--font-display); font-weight: 500; font-size: 23px; letter-spacing: -0.012em; line-height: 1.12; margin-top: 3px; overflow-wrap: anywhere; }
.stop__where { font-size: 13.5px; color: var(--muted-on-night); margin-top: 3px; }
.stop__known { margin-top: 8px; font-size: 15px; line-height: 1.42; color: var(--blush); }
/* Our own photo of the stop. The width and height attributes plus the fixed ratio reserve
   the space before the file arrives, so the ticket never jumps. */
.stop__photo { margin: 10px 0 0; }
.stop__photo img, .stop__photo-slot { display: block; width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--radius-sm); background: rgba(255, 255, 255, 0.06); }
/* A Google Places photo is shown whole, never cropped, filtered or overlaid (spec 009). */
.stop__photo--places img { object-fit: contain; }
.stop__credit { margin-top: 4px; font-size: 11px; line-height: 1.35; color: var(--muted-on-night); overflow-wrap: anywhere; }
/* A stop with no photo: its name on a flat fill (ticket.js, placeholderFor). The same box as a
   .stop__photo img (that figure's margin-top is 6px, below), so a failed photo swaps in place. */
.stop__placeholder { display: flex; flex-direction: column; justify-content: flex-end; gap: 4px; width: 100%; aspect-ratio: 3 / 2; margin-top: 6px; padding: 12px 14px; overflow: hidden; border-radius: var(--radius-sm); border-left: 4px solid var(--ph-accent, var(--coral)); background-color: var(--ph-fill, var(--night-3)); box-shadow: inset 0 0 0 1px var(--line); color: var(--cream); }
.stop__placeholder-glyph { margin-bottom: auto; font-size: 26px; line-height: 1; }
.stop__placeholder-name { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden; font-family: var(--font-display); font-weight: 500; font-size: 22px; line-height: 1.15; overflow-wrap: anywhere; text-wrap: balance; }
.stop__placeholder-place { overflow: hidden; font-size: 13px; font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }
.stop__tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 12.5px; font-weight: 600; line-height: 1; padding: 5px 7px; border: 1px solid var(--line-strong); border-radius: 4px; color: var(--cream); }
.stop__order { margin-top: 10px; font-size: 14.5px; }
.stop__order b { font-weight: 650; }
.stop__hours { margin-top: 4px; font-size: 13.5px; color: var(--muted-on-night); }
.stop__hours-alert { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; margin-top: 8px; color: var(--coral); font-size: 14.5px; font-weight: 700; }
.stop__hours-alert .linkbtn { color: var(--cream); font-size: 14.5px; }
.stop__weekly { margin-top: 8px; font-size: 13.5px; color: var(--muted-on-night); }
.stop__weekly--tonight { font-size: 14.5px; color: var(--coral); }
.stop__talk { margin-top: 8px; font-size: 14.5px; line-height: 1.42; color: var(--cream); }
.stop__talk b { font-weight: 650; color: var(--coral); }
.stop__photo { margin-top: 6px; font-size: 14px; font-weight: 600; color: var(--coral); }
.stop__starters { margin-top: 10px; }
.stop__starters-label { font-size: 13px; font-weight: 650; color: var(--blush); }
.stop__starters ul { margin: 4px 0 0; padding-left: 18px; font-size: 14px; line-height: 1.4; color: var(--cream); }
.stop__actions { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0 16px; margin-top: 6px; }
.stop__links, .stop__edits { display: flex; flex-wrap: wrap; gap: 0 18px; }
.stop__actions .linkbtn { font-size: 14.5px; }

.stop--between .stop__rail { padding-top: 14px; padding-bottom: 12px; }
.stop--between .stop__time { font-size: 15px; }
.stop--between .stop__ampm { font-size: 11px; }
.stop--between .stop__body { padding-top: 11px; padding-bottom: 4px; }
.stop--between .stop__name { font-family: var(--font-ui); font-weight: 650; font-size: 16.5px; letter-spacing: 0; line-height: 1.25; margin-top: 1px; }
.stop--between .stop__known { margin-top: 4px; font-size: 14px; color: var(--muted-on-night); }

.stop--optional .stop__rail { border-right-style: dashed; }
.stop--optional .stop__role {
  display: inline-block;
  padding: 4px 7px;
  border: 1px dashed var(--coral);
  border-radius: 4px;
  line-height: 1;
}
.stop--optional .stop__name { margin-top: 8px; }

.ticket__foot {
  display: grid;
  grid-template-columns: var(--rail) minmax(0, 1fr);
  padding-bottom: 6px;
}
.ticket__foot-rail { padding: 12px 0 16px var(--pad); color: var(--coral); font-family: var(--font-display); font-size: 15px; font-weight: 500; line-height: 1.2; font-variant-numeric: tabular-nums; }
.ticket__foot-rail small { display: block; font-family: var(--font-ui); font-size: 11px; font-weight: 600; margin-top: 2px; }
.ticket__foot-text { padding: 12px var(--pad) 16px 15px; font-size: 14px; color: var(--muted-on-night); }

@media (max-width: 374px) {
  .ticket { --rail: 62px; --pad: 14px; }
  .stop__time { font-size: 19px; }
  .stop__edits .icon { display: none; }
}

/* the one orchestrated moment: a new plan prints, stop by stop */
@keyframes print-in {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
.ticket--print .ticket__stops > li, .ticket--print .ticket__foot { animation: print-in 320ms cubic-bezier(0.2, 0.7, 0.2, 1) both; animation-delay: calc(var(--i, 0) * 55ms); }

.notes { margin-top: 16px; display: grid; gap: 6px; font-size: 14.5px; color: var(--muted-on-night); }
.notes li { padding-left: 14px; position: relative; }
.notes li::before { content: ""; position: absolute; left: 0; top: 0.62em; width: 5px; height: 1.5px; background: var(--coral); }

.plan-actions { margin-top: 22px; }
.shared-plan__intro { margin: 0 0 16px; display: grid; gap: 8px; }
.tools {
  display: grid;
  grid-template-columns: repeat(var(--n, 3), 1fr);
  margin-top: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
}
.tool {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 68px;
  padding: 8px 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  color: var(--cream);
}
.tool + .tool { border-left: 1px solid var(--line); }
.tool--on { color: var(--coral); }

/* More, under Save and Share (spec 012): one button, and the panel it opens in place. */
.plan-more__toggle { margin-top: 14px; }
/* Closed, More is the last thing on the plan: room to scroll it clear of a snackbar (Undo after a remix). */
.plan-more__toggle:last-child { margin-bottom: 72px; }
.plan-more__toggle .icon { transform: rotate(90deg); transition: transform 140ms ease-out; }
.plan-more__toggle[aria-expanded="true"] .icon { transform: rotate(-90deg); }
.plan-more { margin-top: 6px; }
.plan-more__list { margin-top: 0; border-top: 0; }
.plan-more__stops { padding: 4px 0 14px; border-bottom: 1px solid var(--line); }
.plan-more__stop-name { margin-top: 10px; font-weight: 650; }

/* lodging */
.stay { margin-top: 30px; }
.stay__list { border-top: 1px solid var(--line); margin-top: 12px; }
.stay__item { padding: 14px 0 6px; border-bottom: 1px solid var(--line); }
.stay__name { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.2; }
.stay__known { margin-top: 4px; font-size: 15px; color: var(--blush); }
.stay__price { margin-top: 4px; font-size: 13.5px; color: var(--muted-on-night); }

/* insufficient / empty / error states */
.state { padding: 34px 0 8px; }
.state__title { font-size: 34px; }
.state__text { margin-top: 12px; font-size: 17px; color: var(--blush); }
.state__asked { margin-top: 22px; }
.state__asked-label { font-size: 14px; font-weight: 600; color: var(--muted-on-night); }
.state__asked .stop__tags { margin-top: 8px; }
.state__try { margin-top: 26px; font-size: 14px; font-weight: 600; color: var(--muted-on-night); }
.state__list { margin-top: 10px; display: grid; gap: 10px; }
.state .actions { margin-top: 14px; }
.suggest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  min-height: 56px;
  padding: 12px 16px;
  text-align: left;
  background: var(--night-2);
  border-radius: var(--radius);
  font-weight: 650;
}
.suggest .icon { color: var(--cta); }

/* ---------- saved ---------- */
.savedlist { display: grid; gap: 14px; margin-top: 22px; }
.stub {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  background: var(--night-2);
  border-radius: var(--radius);
}
.stub__open { display: block; text-align: left; padding: 16px 12px 16px 18px; min-width: 0; text-decoration: none; }
.stub__title, .stub__meta, .stub__names { display: block; }
.stub__title { font-family: var(--font-display); font-weight: 500; font-size: 20px; line-height: 1.2; letter-spacing: -0.01em; }
.stub__meta { margin-top: 4px; font-size: 13.5px; color: var(--coral); font-weight: 600; }
.stub__names { margin-top: 6px; font-size: 14.5px; color: var(--muted-on-night); }
.stub__tear {
  position: relative;
  display: grid;
  place-items: center;
  width: 58px;
  border-left: 4px dotted var(--night);
  color: var(--muted-on-night);
}
.stub__tear::before, .stub__tear::after {
  content: "";
  position: absolute;
  left: -11px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--night);
}
.stub__tear::before { top: -9px; }
.stub__tear::after { bottom: -9px; }

/* ---------- guides / more ---------- */
.linklist { border-top: 1px solid var(--line); margin-top: 22px; }
.linkrow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 2px 14px;
  width: 100%;
  min-height: 62px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-decoration: none;
}
.linkrow__title { font-weight: 650; font-size: 17px; }
.linkrow__line { grid-column: 1; font-size: 14.5px; color: var(--muted-on-night); }
.linkrow .icon { grid-column: 2; grid-row: 1 / span 2; color: var(--muted-on-night); }
.linkrow--display .linkrow__title { font-family: var(--font-display); font-weight: 500; font-size: 21px; letter-spacing: -0.01em; }
.linkrow__value { color: var(--muted-on-night); font-size: 15px; grid-column: 2; grid-row: 1 / span 2; }

.fineprint { margin-top: 26px; font-size: 14px; color: var(--muted-on-night); }
.fineprint + .fineprint { margin-top: 6px; }

.vibe-card { margin-top: 12px; padding: 18px 18px 8px; background: var(--wine); border-radius: var(--radius); }
.vibe-card__name { font-size: 28px; }
.vibe-card__blurb { margin-top: 8px; font-size: 15.5px; }
.vibe-card .linkbtn { margin-top: 6px; }

/* ---------- snackbar ---------- */
.snack {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 12px);
  z-index: 30;
  width: calc(100% - 32px);
  max-width: calc(var(--col) - 32px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 6px 8px 6px 16px;
  background: var(--cream);
  color: var(--ink);
  border-radius: 12px;
  font-weight: 600;
  font-size: 15px;
}
.snack[hidden] { display: none; }
.snack__action { min-height: var(--tap); padding: 0 12px; font-weight: 700; color: var(--wine); }
.snack__action:focus-visible { outline-color: var(--ink); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.noscript { max-width: var(--col); margin: 0 auto; padding: 40px var(--gutter); color: var(--cream); }

/* Reserve action and partner venues (stop cards). */
.linkbtn--reserve { color: var(--cta); font-weight: 700; text-decoration: none; }
.stop__partner { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; margin: 8px 0 0; }
.badge--partner {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; line-height: 1;
  padding: 5px 7px; border-radius: 4px; background: var(--coral); color: var(--night);
}
.stop__perk { font-size: 14.5px; color: var(--ink); }

/* Hours not confirmed, and the Something wrong? action on every stop. */
.stop__unconfirmed { margin: 8px 0 0; font-size: 14.5px; color: var(--coral); }
.stop__unconfirmed b { font-weight: 700; }
.stop__wrong { margin-top: 8px; }
.stop__wrong-panel { margin-top: 8px; }
.stop__wrong-ask { margin: 0 0 6px; font-size: 14px; color: var(--muted-on-night); }
.stop__wrong-list { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }

/* Printing the ticket: the actions are for the screen, not the paper. */
@media print {
  .stop__actions, .stop__wrong { display: none; }
}
.stop__wrong-list button {
  min-height: var(--tap); padding: 6px 14px; border: 1px solid var(--coral); border-radius: 999px;
  background: var(--night-2); color: var(--cream); font: inherit; font-size: 14.5px; font-weight: 600; cursor: pointer;
}
.stop__wrong-list button:hover { border-color: var(--cta); color: var(--cta); }

/* Post-date check-in card (src/app/ui/checkin.js) */
.checkin { margin: 0 0 18px; padding: 16px; border-radius: var(--radius); background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.checkin__stops { list-style: none; margin: 10px 0; padding: 0; }
.checkin__stop { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.08); }
.checkin__name { min-width: 0; overflow-wrap: anywhere; }
.checkin__pair { display: flex; gap: 6px; flex: none; }
.checkin__thumb { min-height: var(--tap); padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, 0.25); background: transparent; color: inherit; font: inherit; font-size: 0.9rem; }
.checkin__thumb[aria-pressed="true"] { background: var(--cta); border-color: var(--cta); color: #1a1420; font-weight: 700; }
.checkin__hint { margin: 10px 0 6px; }
.checkin__tags { display: flex; flex-wrap: wrap; gap: 6px; }
.checkin__tags .tag { min-height: var(--tap); }
.checkin__tags .tag[aria-pressed="true"] { background: var(--cta); color: #1a1420; }
.checkin__tags .tag:disabled { opacity: 0.45; }
.checkin .actions { margin-top: 14px; }

/* Group options (pick), Plan B and the pair card: one rule per divider, the same --line as .block. */
.pick__options { list-style: none; margin: 18px 0 0; padding: 0; display: grid; gap: 22px; }
.pick__option { padding-top: 16px; border-top: 1px solid var(--line); }
.pick__option .btn { margin: 12px 0 10px; }
.pick__time { margin: 4px 0 0; }
.pick__stops { margin: 8px 0 0; }
.planb__cards { display: grid; gap: 22px; margin: 18px 0 0; }
.planb__card { padding-top: 16px; border-top: 1px solid var(--line); }
.planb .actions { margin-top: 22px; display: grid; gap: 10px; }
.pair { margin: 22px 0 0; padding-top: 18px; border-top: 1px solid var(--line); }
.pair-card__img { display: block; width: 100%; max-width: 270px; height: auto; border-radius: 10px; margin-bottom: 12px; }
.pair-card .btn { margin-top: 10px; }
/* The Story card (spec 003): the preview box (sized from mount) on the left, the button and its note on the right. */
.story-card { margin-top: 18px; display: flex; gap: 14px; align-items: center; }
.story-card__thumb { flex: none; width: 108px; height: 192px; border-radius: 10px; background: rgba(255, 255, 255, 0.04); overflow: hidden; }
.story-card__body { flex: 1; min-width: 0; }
.story-card .btn { margin-top: 0; }
.story-card .btn[aria-busy="true"] { opacity: 0.45; cursor: progress; }
.story-card__img { max-width: 108px; margin-bottom: 0; }
.story-card__aside, .story-card__status:not(:empty) { margin: 8px 0 0; }
.story-card__status:empty { margin: 0; }

/* The surprise stop is for the person planning, never the printed plan (perfect-date P2). */
.surprise { margin-top: 14px; }
.secret { margin-top: 12px; padding: 14px 16px; border: 1px dashed var(--blush); border-radius: 12px; }
.secret__cover { margin-top: 6px; font-style: italic; color: var(--coral); }
@media print { .surprise, .secret { display: none !important; } }

/* "Play your route" (spec 005). The board is sized so the board, the points and the two buttons under a finished
   run fit one phone screen with the tab bar. Colours are the tokens; the board itself is drawn on the canvas. */
.play-entry { margin-top: 14px; }
.stub__play { grid-column: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; padding: 0 12px 10px 18px; }
.stub > .linkbtn, .stub > .went { grid-column: 1; margin-left: 18px; }
.stub__tear { grid-column: 2; grid-row: 1 / span 3; }
.play .topbar { margin-bottom: 4px; }
.play__title { font-size: 28px; line-height: 1.1; }
.play__status { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 2px 12px; margin: 8px 0 10px; font-size: 15px; font-weight: 600; }
.play__next { color: var(--blush); }
.play__points { color: var(--cta); font-variant-numeric: tabular-nums; }
.play__board {
  display: block;
  width: max(200px, min(100%, calc((100vh - 384px) * 11 / 17)));
  width: max(200px, min(100%, calc((100dvh - 384px) * 11 / 17)));
  height: auto;
  aspect-ratio: 11 / 17;
  margin: 0 auto;
  border-radius: var(--radius-sm);
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.play__board:focus-visible { outline: 2px solid var(--coral); outline-offset: 3px; }
.play__pad { display: flex; justify-content: center; gap: 10px; margin-top: 12px; }
.play__pad[hidden] { display: none; }
.play__key {
  display: grid;
  place-items: center;
  width: 60px;
  height: 48px;
  min-width: var(--tap);
  min-height: var(--tap);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  color: var(--cream);
}
.play__key:active { background: var(--night-3); }
.play__key--left .icon { transform: rotate(180deg); }
.play__key--up .icon { transform: rotate(-90deg); }
.play__key--down .icon { transform: rotate(90deg); }
.play__after:empty { display: none; }
.play__after { display: grid; gap: 10px; margin-top: 12px; }
.play__after .pair-card .btn:first-child { margin-top: 0; }
.play .switch { margin-top: 14px; border-top: 1px solid var(--line); }
/* The "Tagalog?" switch (spec 006, src/app/ui/controls.js langToggle): a pill with a 44px tap target. */
.lang-toggle {
  display: inline-flex; align-items: center; min-height: var(--tap); min-width: var(--tap); margin-top: 12px; padding: 0 16px;
  border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: inherit;
  font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
}
.lang-toggle:hover { border-color: var(--cta); color: var(--cta); }
.linkrow .lang-toggle { grid-column: 2; grid-row: 1 / span 2; margin-top: 0; }
