/* The headline face is the wordmark's own: Bricolage Grotesque ExtraBold,
   subset to Latin and served from /fonts (the same file the front page uses). */
@font-face {
  font-family: 'Bricolage Grotesque';
  src: url('/fonts/bricolage-extrabold.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* Body and UI text: Figtree, the face brand/logo-brief.html picks for taglines
   and in-app UI — humanist, clear at small sizes, and it doesn't compete with
   the mark. One 18 KB file carries every weight from 300 to 900, so labels,
   hints and semibold buttons all come out of it (brand/source/make_body_font.py
   cuts it). Until this shipped the builder fell back to whatever font the
   device had, which is most of why a page of ours looked like anybody's form. */
@font-face {
  font-family: 'Figtree';
  src: url('/fonts/figtree.ttf') format('truetype');
  font-weight: 300 900;
  font-style: normal;
  font-display: swap;
}

/* Brand palette: see brand/README.md. Midnight Atlas is the ink and the
   primary action; Lagoon carries focus, links and anything that has gone
   right. Live Coral appears exactly once on the page — inside the lockup at
   the top left — so nothing else here may use it. */
:root {
  --bg: #F3F6F7;             /* Cloud */
  --card: #FFFFFF;
  --ink: #0E1B2C;            /* Midnight Atlas */
  --soft: #46586B;           /* Slate */
  --line: #DCE4E9;
  --field: #FFFFFF;
  --navy: #0E1B2C;           /* the primary action, and the ink it's named for */
  --on-navy: #FFFFFF;
  --lagoon: #0E8F86;         /* Lagoon, darkened for 4.5:1 on Cloud */
  --tint: rgba(14, 27, 44, 0.06);
  --focus: #16C2B5;          /* Lagoon at full strength — it only ever outlines */
  --ok: #0E7A62;
  --warn: #8a5300;
  --warn-bg: #FFF4E2;
  --bad: #A8231C;
  --bad-bg: #FDECEA;
  --body: 'Figtree', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --display: 'Bricolage Grotesque', var(--body);
  --header: #0E1B2C;                          /* Midnight Atlas, in both themes */
  --header-ink: #FFFFFF;
  --header-soft: #9AABB9;                     /* Mist — 7:1 on Midnight Atlas */
  --header-line: rgba(154, 171, 185, 0.24);
  --header-tint: rgba(255, 255, 255, 0.09);
  --header-bad: #FF8A80;                      /* the warning colour, on ink */
  --shadow-pop: 0 12px 28px -12px rgba(14, 27, 44, 0.32);
  --step: 160ms cubic-bezier(0.22, 1, 0.36, 1);
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0A1520;
    --card: #111F2E;
    --ink: #E9EFF2;
    --soft: #9AABB9;           /* Mist — Slate's partner on dark */
    --line: #22354A;
    --field: #0F1826;
    --navy: #2FD3C5;           /* on dark the action goes Lagoon, ink-lettered */
    --on-navy: #06101E;
    --lagoon: #2FD3C5;
    --tint: rgba(47, 211, 197, 0.12);
    --focus: #2FD3C5;
    --ok: #5FCF8F;
    --warn: #FFC56B;
    --warn-bg: #2B2210;
    --bad: #FF8A80;
    --bad-bg: #2D1416;
    --shadow-pop: 0 12px 28px -12px rgba(0, 0, 0, 0.6);
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--body);
  -webkit-text-size-adjust: 100%;
}
a { color: var(--lagoon); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
::selection { background: var(--focus); color: #06101E; }
:root { accent-color: var(--navy); caret-color: var(--lagoon); }

/* Dates, versions and times line up column-wise instead of wobbling. */
.save-status, .day-tabs small, .card-title .sub, input[type="date"] { font-variant-numeric: tabular-nums; }

/* The step rail and day tabs scroll sideways; give them a scrollbar that
   belongs to the page rather than the operating system's. */
.steps, .day-tabs, .previews, pre.code {
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.steps::-webkit-scrollbar, .day-tabs::-webkit-scrollbar,
.previews::-webkit-scrollbar, pre.code::-webkit-scrollbar { height: 8px; width: 8px; }
.steps::-webkit-scrollbar-thumb, .day-tabs::-webkit-scrollbar-thumb,
.previews::-webkit-scrollbar-thumb, pre.code::-webkit-scrollbar-thumb {
  background: var(--line); border-radius: 99px;
}

/* ── Header and step pills ─────────────────────────────────────────── */
.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--header);
  color: var(--header-ink);
}
.top-inner, .steps, .wrap, .bottom-inner {
  max-width: 900px; margin: 0 auto; padding-left: 16px; padding-right: 16px;
}
.top-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 6px; }
.mark { display: flex; align-items: baseline; gap: 10px; font-weight: 700; color: var(--header-ink); white-space: nowrap; }
.mark img { height: 28px; width: auto; display: block; align-self: center; }
.mark-sub {
  font-family: var(--display); font-weight: 800; font-size: 17px;
  color: var(--header-ink); letter-spacing: -0.02em;
}
/* The status takes whatever room the lockup, the switch and the buttons leave
   it, and asks for none of its own: "Saved · v3", "Saving…" and "Changes to
   save" are different widths, and when it sized itself every change shoved
   Help, My trips and Tools sideways (Nick, 4 December 2026). */
.save-status { flex: 1 1 0; min-width: 0; margin: 0; font-size: 13.5px; color: var(--header-soft); text-align: right; }
.save-status.warn { color: var(--header-bad); }

.tools { position: relative; }
.tools summary {
  list-style: none; cursor: pointer; padding: 8px 14px; border: 1px solid var(--header-line);
  border-radius: 9px; font-size: 14.5px; user-select: none; color: var(--header-ink);
  transition: background var(--step), border-color var(--step);
}
.tools summary:hover { background: var(--header-tint); border-color: var(--header-soft); }
.tools summary::-webkit-details-marker { display: none; }
.tools-menu {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px;
  background: var(--card); border: 0; border-radius: 12px;
  box-shadow: var(--shadow-pop); display: grid;
}
.tools-menu button {
  background: none; border: 0; color: var(--ink); text-align: left; padding: 9px 10px;
  border-radius: 6px; font: inherit; font-size: 14px; cursor: pointer;
}
.tools-menu button:hover { background: var(--tint); }
/* Three of these needed explaining — a backup file that isn't a document, a
   loader with no template to fill in, and an example that replaces your work. */
.tools-menu button small {
  display: block; margin-top: 2px; font-size: 12.5px; line-height: 1.4;
  color: var(--soft); white-space: normal;
}
.tools-menu .danger small { color: var(--soft); }
.tools-menu { max-width: 320px; }

/* "My trips" is a place to go, not a tool, so it sits on the bar. */
/* Doubled class: the general .btn rules come later in this file and would
   otherwise paint it as a white card button sitting on the ink. */
.btn.top-btn {
  background: none; border-color: var(--header-line); color: var(--header-ink);
  padding: 8px 14px; font-size: 14.5px; min-height: 0;
  white-space: nowrap; text-decoration: none;   /* some are links (My trips, Owner) */
}
.btn.top-btn:hover:not(:disabled) { background: var(--header-tint); border-color: var(--header-soft); }
.only-phone { display: none; }
@media (max-width: 640px) { .tools-menu .only-phone { display: block; } }
.tools-who { margin: 4px 10px 6px; font-size: 13px; color: var(--soft); }
.tools-who:empty { display: none; }
.btn.disabled { opacity: 0.45; pointer-events: none; }
.tools-menu .danger { color: var(--bad); }

/* The pills scroll sideways when they don't fit, but the browser's own
   scrollbar across the bar read as a mistake. The step you are on is scrolled
   into view for you, and the progress line under it is the real indicator. */
.steps {
  display: flex; gap: 6px; overflow-x: auto; padding-top: 2px; padding-bottom: 12px;
  scrollbar-width: none;
}
.steps::-webkit-scrollbar { display: none; }
.step-pill {
  display: inline-flex; align-items: center; gap: 7px; flex: none;
  border: 1px solid var(--header-line); background: none; color: var(--header-soft);
  padding: 7px 13px 7px 7px; border-radius: 999px; font: inherit; font-size: 14.5px; cursor: pointer;
  transition: border-color var(--step), color var(--step), background var(--step);
}
.step-pill:hover { color: var(--header-ink); border-color: var(--header-soft); }
.step-pill .num {
  display: inline-grid; place-items: center; width: 23px; height: 23px; border-radius: 50%;
  background: var(--header-tint); color: var(--header-ink); font-size: 12.5px; font-weight: 700;
  transition: background var(--step), color var(--step);
}
.step-pill .count {
  font-size: 12px; background: var(--header-tint); color: var(--header-soft);
  border-radius: 999px; padding: 0 7px;
}
/* "optional" sits where a count would, and reads quieter than one: a count is
   something you did, this is permission not to. It is the first thing the bar
   gives up when it runs out of room (fitStepBar), because a step you are
   standing on has already answered the question. */
.step-pill .count.optional {
  background: none; padding: 0 2px;
  font-size: 11px; font-style: italic; letter-spacing: 0.01em;
  opacity: 0.75;
}

/* The step you are on is the one solid thing on the bar. */
.step-pill[aria-current="step"] {
  background: var(--header-ink); border-color: var(--header-ink);
  color: var(--header); font-weight: 600;
}
.step-pill[aria-current="step"] .num { background: var(--header); color: var(--header-ink); }
.step-pill[aria-current="step"] .count { background: rgba(14, 27, 44, 0.12); color: var(--header); }
/* The eighth step has two names; only one of them is ever in the page, so a
   screen reader is only ever read the one on screen. */
.pill-brief { display: none; }

/* Beside the preview rail the header spans the form's column only — between
   about 540px and 1240px of bar, depending on how much of the window's height
   the phone took — and the eight pills as drawn above need 1040. Sideways
   scroll is no answer here: what it hides is "Review", which is the way out
   of the builder.

   Two things give the bar more room than the form has, and then it gives
   things up in order of what they are worth, never a step's name.

   **The bar is not held to the form's reading column.** 900px is how wide
   text should be to read comfortably; it is not how wide a row of eight
   buttons should be. So from 1180px up the bar may take 960px where the
   window has it — just enough for eight pills carrying a number and a
   three-digit count (928px of content against the 909px they want). It is
   capped there rather than given the whole region, because the row has to go
   on looking like it belongs to the form under it: at 1920 the region is
   1269px wide, and a bar that took all of it started 184px to the left of
   both the lockup and the form, with the pills spread to 150px apiece, which
   read as a mistake rather than a choice. The lockup row, the form and the
   bottom bar all keep their 900px, and the bar starts on the left edge they
   share and runs 60px past their right.

   **Then it sheds, in this order.** The type and the padding tighten, the
   pills share out whatever room is left rather than hugging the left, and the
   eighth step reads "Review", which is what the Next button on step 7 already
   calls it. After that:

     — The numbered circle goes first. It is the cheapest thing on the pill to
       lose: the steps still read in order left to right, the progress line is
       still under them, and the bottom bar still says "Step 5 of 8".
     — The count goes second, and only when the circle going was not enough.
       It is the one thing on the bar that says something the bar does not
       otherwise say at all.

   Measured with the Chicago example: eight pills want 843px with both, 667px
   with the count alone, 686px with the circle alone and 510px with neither.
   A trip with three-digit counts wants 909px, 733px and the same 686px and
   510px. Against that, the bar is given 541px at 1180 × 1080, 673px at 1280,
   764px at 1366, 774px at 1440, 892px at 1600 and 928px at 1920 — so both
   markers fit from about 1570px up, the count alone from 1280 (1366 for a big
   trip), and below that the names stand on their own.

   No width rule could do this: a badge is as wide as the trip makes it, and
   the bar is as wide as the window's *height* leaves it, since the rail is
   sized from how tall the phone can be drawn. So fitStepBar, in builder.js,
   asks for all three and sheds what does not fit. Hidden is the default here,
   so a bar nobody measured is a bar that never overflows.

   None of this reaches below 1180px, where the header spans the window, the
   counts and circles are always shown, and the bar scrolls sideways as it
   always has. */
@media (min-width: 1180px) {
  /* The bar starts where the form starts and is allowed to run on past its
     right, rather than being centered on it: the lockup, the form and the
     bottom bar all share that left edge, and a row that began 30px to the
     left of it read as a slip rather than a decision. `margin-left` is the
     900px column's own left gutter, worked out the way the column works it
     out, and 0 once the window is too narrow for one. */
  .steps { max-width: 960px; margin-left: max(0px, (100% - 900px) / 2); gap: 4px; }
  /* `1 0 auto`: a pill may take a share of the room left over, but may never
     be squeezed below its own label — the bar has to fit without a single
     word being cut. */
  .step-pill {
    flex: 1 0 auto; justify-content: center;
    gap: 4px; padding: 8px 9px; font-size: 13px;
  }
  /* The circle and the count both wait to be let in: fitStepBar puts these
     classes on when the pills still fit with them, and takes them off again
     when a growing trip or a narrowing window means they don't. */
  .step-pill .num { display: none; width: 20px; height: 20px; font-size: 12px; }
  .steps.circles-fit .step-pill .num { display: inline-grid; }
  /* The circle needs the pill's left padding tucked in around it; without one
     the pill is even again. */
  .steps.circles-fit .step-pill { padding-left: 7px; }
  .step-pill .count { display: none; }
  .steps.counts-fit .step-pill .count { display: inline; }
  .pill-long { display: none; }
  .pill-brief { display: inline; }
}

/* How far through the eight steps you are, as a line rather than a sentence.
   Lagoon, which is already what this builder uses for anything going right. */
.progress { height: 3px; background: var(--header-line); }
.progress i {
  display: block; height: 100%; width: 100%; background: var(--focus);
  transform: scaleX(0); transform-origin: left;
  transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

/* ── Page body ─────────────────────────────────────────────────────── */
.wrap { padding-top: 24px; padding-bottom: 120px; }
.step-optional {
  display: inline-block; vertical-align: middle; margin-left: 10px;
  font-family: var(--body); font-size: 13px; font-weight: 600;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--soft); background: var(--tint);
  border: 1px solid var(--line); border-radius: 999px; padding: 3px 10px;
}
.step-body h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(34px, 8vw, 46px); line-height: 1.05; letter-spacing: -0.035em;
  margin: 0 0 8px; text-wrap: balance;
}
.intro { color: var(--soft); margin: 0 0 22px; max-width: 62ch; font-size: 16.5px; }
.step-body > .hint { margin: 0 0 20px; max-width: 62ch; }
.intro + .hint { margin-top: -12px; }
.step-body > .toolbar + .hint { margin-top: 12px; }
.empty { color: var(--soft); font-style: italic; }

.banner {
  display: flex; align-items: flex-start; gap: 10px; margin-bottom: 16px; padding: 12px 14px;
  border-radius: 12px; background: var(--tint); font-size: 14px;
  animation: banner-in 320ms cubic-bezier(0.16, 1, 0.3, 1) both;
}
.banner.warn { background: var(--warn-bg); color: var(--warn); }
.banner p { margin: 0; flex: 1; }
/* The one authored moment: a banner is the page answering back, so it arrives
   rather than appearing. Everything else just changes state. */
@keyframes banner-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .banner { animation: none; }
  * { transition-duration: 1ms !important; }
}

.card {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  padding: 16px; margin-bottom: 14px;
}
.card-head { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.card-title { flex: 1 1 220px; min-width: 0; }   /* on a phone the buttons drop below the title */
/* Card headings take the wordmark's face too, so the type on a page is one
   system rather than a display headline sitting above a stack of UI text. */
.card-title h3 {
  margin: 0; font-family: var(--display); font-weight: 800;
  font-size: 19px; letter-spacing: -0.02em;
}
.card-title .sub { margin: 3px 0 0; color: var(--soft); font-size: 14px; }
.card h4 { margin: 20px 0 6px; font-size: 15px; letter-spacing: -0.01em; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 12px; }
@media (max-width: 640px) {
  .grid, .grid.three { grid-template-columns: minmax(0, 1fr); }
  .mark-sub { display: none; }
  /* No room on a phone for the lockup, the save status and two buttons, so
     My trips goes back in the menu rather than wrapping onto a second line. */
  #tool-trips { display: none; }   /* only this one: the dashboard's Sign out stays */
  /* The save status stays on phones — "did it save?" is the question people
     ask most. It shrinks to a dot and a couple of words instead of vanishing.
     It takes only the room the logo, Help and Tools leave it (asking for none
     of its own), so "Changes to save" — there the whole time someone is
     editing — can't push Tools onto a second row under the logo, as it did
     on a 390px phone (Nick, 3 December 2026). */
  .save-status {
    flex: 1 1 0; min-width: 0;
    font-size: 12px; max-width: 8.5em; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field.wide { grid-column: 1 / -1; margin-top: 12px; }
.grid .field.wide { margin-top: 0; }
.field label, fieldset legend { font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.hint { margin: 0; font-size: 13px; color: var(--soft); line-height: 1.45; }

/* A thing the builder has worked out for itself, stated rather than asked.
   It sits on the page's own tint so it reads as settled next to the white
   boxes that still want filling in. */
.settled { margin-top: 12px; }
.settled-row {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 8px 16px; flex-wrap: wrap;
  padding: 10px 14px; border-radius: 10px; background: var(--tint);
}
.settled-line { margin: 0; font-size: 14px; line-height: 1.5; min-width: 0; }
.settled-label { color: var(--soft); }
.settled-value { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.settled-row .btn.link { flex: none; }

/* The link under a day's meals that swaps the three boxes for one line, and
   back. Pulled left by the link's own padding so it starts under the labels
   above it rather than a few pixels in. */
.meals-switch { margin: 6px 0 0 -4px; }

.hint.warn { color: var(--warn); }

input[type="text"], input[type="url"], input[type="tel"], input[type="email"], input[type="date"], input[type="time"],
input:not([type]), textarea, select {
  width: 100%; font: inherit; color: var(--ink); background: var(--field);
  border: 1px solid var(--line); border-radius: 10px; padding: 9px 11px; min-height: 44px;
  transition: border-color var(--step), box-shadow var(--step);
}
input:hover:not(:disabled), textarea:hover, select:hover { border-color: var(--soft); }
input:focus, textarea:focus, select:focus { border-color: var(--focus); }
textarea { resize: vertical; }
/* 4.6:1 on white — a placeholder has to be readable, not a whisper. */
input::placeholder, textarea::placeholder { color: var(--soft); opacity: 0.8; }
/* ── Emoji picker ─────────────────────────────────────────────────── */
/* The emoji is the content — it goes into the app as it is — so it gets a
   full 44px square and a size you can actually see, where it used to sit in
   a text box a few characters wide. */
.emoji-pick { position: relative; flex: none; }
.emoji-btn {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  font: inherit; font-size: 22px; line-height: 1; cursor: pointer;
  background: var(--field); border: 1px solid var(--line); border-radius: 10px;
  transition: border-color var(--step), background var(--step);
}
.emoji-btn:hover { border-color: var(--soft); }
.emoji-btn[aria-expanded="true"] { border-color: var(--focus); }
.emoji-empty { font-size: 20px; color: var(--soft); }
.emoji-panel {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
  width: max-content; max-width: calc(100vw - 32px); padding: 10px;
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-pop);
}
.emoji-grid { display: grid; grid-template-columns: repeat(6, 44px); gap: 4px; }
.emoji-choice {
  width: 44px; height: 44px; display: grid; place-items: center; padding: 0;
  font: inherit; font-size: 24px; line-height: 1; cursor: pointer;
  background: none; border: 1px solid transparent; border-radius: 10px;
  transition: background var(--step), border-color var(--step);
}
.emoji-choice:hover { background: var(--tint); }
.emoji-choice[aria-pressed="true"] { background: var(--tint); border-color: var(--focus); }
.emoji-foot {
  display: flex; align-items: center; gap: 8px;
  margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--line);
}
.emoji-foot .emoji-own { flex: 1; min-width: 0; }
.emoji-foot .btn.link { flex: none; }

.category-own { margin-top: 6px; }

/* ── Buttons ───────────────────────────────────────────────────────── */
.btn {
  font: inherit; font-size: 15px; cursor: pointer; border-radius: 10px; padding: 9px 14px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); min-height: 44px;
  transition: border-color var(--step), background var(--step), transform var(--step), box-shadow var(--step);
}
.btn:hover:not(:disabled) { border-color: var(--navy); background: var(--tint); }
.btn:active:not(:disabled) { transform: translateY(1px); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary {
  background: var(--navy); border-color: var(--navy); color: var(--on-navy); font-weight: 600;
  /* Its edge and its fill are the same ink, so this is elevation, not an
     outline with a halo behind it. Kept short and offset for that reason. */
  box-shadow: 0 6px 14px -8px rgba(14, 27, 44, 0.5);
}
.btn.primary:hover:not(:disabled) { background: var(--ink); box-shadow: 0 8px 18px -10px rgba(14, 27, 44, 0.45); }
.btn.primary:disabled { box-shadow: none; }
.btn.big { font-size: 17px; padding: 12px 26px; letter-spacing: -0.01em; }
.btn.small { font-size: 14px; min-height: 36px; padding: 6px 12px; }
.btn.link { border: 0; background: none; color: var(--lagoon); text-decoration: underline; text-underline-offset: 3px; padding: 0 4px; min-height: 0; font-size: 14px; }
.btn.link:hover:not(:disabled) { background: none; }
.btn.icon { width: 38px; min-height: 38px; padding: 0; font-size: 16px; display: inline-grid; place-items: center; }
/* Drawn icons (icons.mjs) take the button's text color, so a danger button's
   cross is red and a disabled arrow fades with its button. */
.icon-svg { display: block; flex: none; }

/* The save status's sign: a dot while there is something left to save, a
   check once it is saved. Mist and Lagoon — never coral, which means live. */
.save-status .status-dot,
.save-status .icon-check { display: inline-block; vertical-align: -1px; margin-right: 6px; }
.save-status .status-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; vertical-align: 1px; }
.save-status .icon-check { color: var(--focus); vertical-align: -2px; margin-right: 5px; }
.btn.danger { color: var(--bad); }
.btn.danger:hover:not(:disabled) { border-color: var(--bad); }
.btn.chip { font-size: 13px; min-height: 32px; padding: 3px 12px; border-radius: 999px; background: var(--tint); border-color: transparent; }
/* Wraps rather than running off a phone: the "move to day" box and the three
   icon buttons together are wider than a 375 px screen. */
.row-controls { display: flex; gap: 4px; flex: 0 1 auto; flex-wrap: wrap; justify-content: flex-end; max-width: 100%; }
.toolbar, .adders { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 14px; }
.adders { margin-top: 4px; }

/* ── Palette picker ────────────────────────────────────────────────── */
fieldset.palettes { border: 0; padding: 0; margin: 0 0 14px; }
.palette-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; margin-top: 6px; }
.palette {
  display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 2px solid var(--line);
  border-radius: 10px; cursor: pointer; font-size: 14px;
}
.palette input { position: absolute; opacity: 0; pointer-events: none; }
.palette:has(input:checked) { border-color: var(--navy); background: var(--tint); font-weight: 600; }
.palette:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatches { display: flex; height: 26px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.swatches i { flex: 1; }
.own-colors { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin-top: 12px; }
.own-color label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.own-color-inputs { display: flex; gap: 8px; align-items: center; }
.own-color input[type=color] {
  inline-size: 44px; block-size: 44px; padding: 3px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--card); cursor: pointer; flex: none;
}
.own-color input.hex { inline-size: 100%; font-variant-numeric: tabular-nums; text-transform: uppercase; }
.own-color .hint { margin: 4px 0 0; }
/* The logo's own colors (logo-colors.mjs): a row above the palettes with one
   button that uses them all, and the same colors as small one-click chips
   under each of "Your own colors". */
.logo-colors { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: 6px 0 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); }
.logo-colors-label { font-size: 14px; font-weight: 600; }
.logo-chips { display: flex; height: 26px; min-width: 96px; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); }
.logo-chips i { flex: 1; min-width: 24px; }
.logo-colors .btn { margin-left: auto; }
.own-color-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 6px; font-size: 13px; color: var(--soft); }
.logo-chip { inline-size: 26px; block-size: 26px; padding: 0; border: 1px solid var(--line); border-radius: 50%; background: var(--chip); cursor: pointer; }
.logo-chip:hover { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--line); }
.logo-chip:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.own-color-warn .btn.link { padding: 0; }

/* ── Town picker ───────────────────────────────────────────────────── */
.town-wrap { position: relative; }
.town-list {
  position: absolute; z-index: 5; left: 0; right: 0; top: calc(100% + 4px); margin: 0; padding: 4px;
  list-style: none; background: var(--card); border: 0; border-radius: 12px;
  box-shadow: var(--shadow-pop);
}
.town-list li[role="option"] { padding: 8px 10px; border-radius: 6px; cursor: pointer; display: flex; flex-direction: column; }
.town-list li[role="option"] small { color: var(--soft); }
.town-list li.active, .town-list li[role="option"]:hover { background: var(--tint); }
.town-list li.none { padding: 8px 10px; color: var(--soft); font-size: 14px; }
.town-list li.credit { padding: 4px 10px 2px; font-size: 11px; color: var(--soft); border-top: 1px solid var(--line); margin-top: 4px; }
.town-badge { font-size: 13px; }
.town-badge.ok { color: var(--ok); }
.town-badge.pending { color: var(--warn); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--soft); }

/* ── Pictures ──────────────────────────────────────────────────────── */
.previews { display: flex; gap: 8px; overflow-x: auto; margin-top: 6px; }
.previews figure { margin: 0; flex: none; width: 96px; }
.previews img { width: 96px; height: 96px; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); background: var(--tint); display: block; }
.previews figcaption { font-size: 11px; color: var(--soft); line-height: 1.3; margin-top: 2px; }
.previews figure.broken img { display: none; }
.previews figure.broken figcaption { color: var(--bad); }
/* "Draw again…" under a picture we drew. It is deliberately quiet — every
   press costs another picture, so it shouldn't invite an idle click. */
.previews figure .btn.small { margin-top: 4px; width: 100%; padding: 2px 4px; font-size: 11px; }

/* ── Collapsible sections ──────────────────────────────────────────── */
details.more { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
details.more > summary {
  cursor: pointer; color: var(--lagoon); font-weight: 600; font-size: 14px;
  padding: 2px 0; border-radius: 6px; transition: color var(--step);
  list-style-position: outside;
}
details.more > summary:hover { color: var(--ink); }
details.more > summary::marker { font-size: 0.85em; }
.details-body { margin-top: 14px; }

/* ── Lists of like things (listRow in builder.js) ──────────────────── */
/* People and bookings: one card holding a line per entry, each opening to its
   boxes. The chevron turns when a row is open. */
.list-rows {
  background: var(--card); border: 1px solid var(--line); border-radius: 14px;
  margin-bottom: 14px; overflow: clip;
}
.list-row + .list-row { border-top: 1px solid var(--line); }
.list-row > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; gap: 12px;
  min-height: 60px; padding: 12px 16px; transition: background var(--step);
}
.list-row > summary::-webkit-details-marker { display: none; }
.list-row > summary:hover { background: var(--tint); }
.list-row > summary:focus-visible { outline-offset: -3px; border-radius: 12px; }
.list-row > summary .icon-svg { color: var(--soft); transition: transform var(--step); }
.list-row[open] > summary .icon-svg { transform: rotate(180deg); }
.list-row-text { display: grid; gap: 1px; flex: 1; min-width: 0; }
.list-row-title {
  font-family: var(--display); font-weight: 800; font-size: 17px;
  letter-spacing: -0.02em; line-height: 1.25; overflow-wrap: anywhere;
}
.list-row-sub { font-size: 14px; color: var(--soft); overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.list-row-body { padding: 4px 16px 16px; }
/* A stop's line: its time in a column of its own, so a closed day reads down
   the left like a timetable. */
.stop-line { display: flex; gap: 14px; align-items: baseline; }
.stop-time {
  flex: none; min-width: 5.6em; font-family: var(--body); font-weight: 600; font-size: 14px;
  letter-spacing: 0; color: var(--soft); font-variant-numeric: tabular-nums;
}
.stop-time.missing { color: var(--warn); }
.stop-line + .list-row-sub, .list-row-text .stop-line ~ .list-row-sub { padding-left: calc(5.6em * 14 / 15 + 14px); }
@media (max-width: 480px) {
  .stop-line { flex-direction: column; gap: 0; }
  .list-row-text .stop-line ~ .list-row-sub { padding-left: 0; }
}
.row-controls.labelled {
  justify-content: flex-start; gap: 8px; margin-top: 16px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.row-controls.labelled .btn { display: inline-flex; align-items: center; gap: 6px; }
.row-controls.labelled .btn.danger { margin-left: auto; }

/* ── People ────────────────────────────────────────────────────────── */
.check { display: flex; gap: 10px; align-items: flex-start; font-size: 15px; cursor: pointer; }
.check input { width: 20px; height: 20px; margin-top: 2px; flex: none; accent-color: var(--navy); }
.switch-field { justify-content: center; }

/* ── Schedule ──────────────────────────────────────────────────────── */
.day-tabs { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 16px; padding-bottom: 6px; }
.day-tabs button {
  flex: none; display: flex; flex-direction: column; align-items: flex-start; text-align: left;
  font: inherit; font-size: 14px; font-weight: 600; padding: 8px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--card); color: var(--ink); cursor: pointer;
  transition: border-color var(--step), background var(--step);
}
.day-tabs button:hover { border-color: var(--soft); }
.day-tabs button small { font-weight: 400; color: var(--soft); font-size: 12px; }
.day-tabs button[aria-selected="true"] { border-color: var(--navy); background: var(--tint); }
/* Adding a day sits at the end of the row of days, where the new one appears. */
.day-tabs button.day-tab-add { justify-content: center; border-style: dashed; background: none; color: var(--soft); font-weight: 600; }
.day-tabs button.day-tab-add:hover { color: var(--ink); }
/* The day's own card and its activities read as one day: a little air between. */
.day-tabs + .card { margin-bottom: 22px; }
/* A Before the trip tab's own heading, under the step's. */
.tab-body > h3 { margin: 4px 0 6px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.day-heading { margin: 0 0 12px; font-family: var(--display); font-weight: 800; font-size: 20px; letter-spacing: -0.02em; }
.item-grid { display: grid; grid-template-columns: 130px minmax(0, 1fr) 180px; gap: 12px; }
@media (max-width: 640px) { .item-grid { grid-template-columns: minmax(0, 1fr); } }
.move-to { width: auto; max-width: 100%; min-height: 38px; padding: 4px 8px; font-size: 14px; }

/* The heading suggestions: a quiet row, not a wall of buttons. */
.suggest { margin: -8px 0 18px; }
.suggest .hint { margin-bottom: 8px; }
.suggest .toolbar { gap: 8px; }

/* The hand-off at the bottom of a step: what the next one is for. */
.onward { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
.onward .hint { margin-bottom: 10px; max-width: 62ch; }

/* ── Rules and packing ─────────────────────────────────────────────── */
.group-head { display: flex; gap: 8px; align-items: center; }
.group-head input:not(.emoji) { font-weight: 600; }
.group-items { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 6px; }
.group-items li { display: flex; gap: 6px; align-items: center; }
/* The text takes whatever the emoji and the three buttons leave. Left to
   itself it asked for the whole row, squeezed the buttons into two lines, and
   every rule came out twice as tall as it should with the emoji adrift. */
.group-items li > .line-box { flex: 1 1 auto; min-width: 0; }
/* The line's box looks like every other one-line box until its words need a
   second line, then grows to fit them (lineBox in builder.js). No handle and
   no scrollbar: its size is the words'. */
.line-box { resize: none; overflow: hidden; display: block; line-height: 1.5; }
.group-items li > .row-controls { flex: none; flex-wrap: nowrap; }
/* On a phone the three buttons would leave the text a third of the row, so
   they drop to a line of their own under it, lined up with the text — the
   same way a heading's buttons already sit below the heading. */
@media (max-width: 640px) {
  .group-items { gap: 12px; }
  .group-items li { flex-wrap: wrap; }
  .group-items li > .line-box { flex-basis: calc(100% - 50px); }
  .group-items li > .row-controls { margin-left: 50px; }
}

/* ── Review ────────────────────────────────────────────────────────── */
.summary { margin: 0; padding-left: 20px; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; }
.checks li.stop { background: var(--bad-bg); color: var(--bad); }
.checks li.note { background: var(--warn-bg); color: var(--warn); }
/* A tip isn't a problem — it says what will happen, so it stays quiet. */
.checks li.tip { background: var(--tint); color: var(--soft); }
.card.needed { border-color: var(--bad); }
/* A box the organizer was sent to by holding something in the preview
   (goToBox in builder.js). A card can only be focused that way — nothing else
   on the form hands one focus — so a ring around a card always means "this is
   the box you asked for". It is the same Lagoon outline the preview drew
   around the thing that was held, moved onto the form, and it waits there
   until focus moves on. `:focus` rather than `:focus-visible`, because the
   gesture that sends them here is a press, and a press doesn't count as
   keyboard use. The card keeps its own 14px corners: the rule above is later
   in this file than the one that rounds a focus ring to 4px. */
.card:focus { outline: 3px solid var(--focus); outline-offset: 3px; }
.list-row:focus { outline: 3px solid var(--focus); outline-offset: -3px; border-radius: 12px; }
.generate { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin: 20px 0; }
.result.bad { border-color: var(--bad); }
.warnings { margin: 0; padding-left: 20px; color: var(--warn); }
.daylist { margin: 0; padding-left: 22px; }
pre.code {
  background: var(--field); border: 1px solid var(--line); border-radius: 8px; padding: 12px;
  font-size: 12.5px; line-height: 1.45; max-height: 420px; overflow: auto; white-space: pre;
}

/* ── The trip on LiveTripApp ───────────────────────────────────────── */
.status-line { margin: 0 0 12px; padding: 10px 12px; border-radius: 10px; font-size: 14px; line-height: 1.5; background: var(--tint); }
.status-line.draft { background: var(--warn-bg); color: var(--warn); }
.status-line.live { background: rgba(14, 122, 98, 0.12); color: var(--ok); }
.link-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 6px; }
.link-row input { flex: 1 1 260px; min-width: 0; font-size: 14px; }
.link-label { font-size: 14px; font-weight: 600; margin: 10px 0 0; }
.upload-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 6px; }
.upload-row .hint { flex: 1 1 200px; }

/* ── My trips ──────────────────────────────────────────────────────── */
.dialog {
  border: 1px solid var(--line); border-radius: 14px; padding: 0;
  width: min(640px, calc(100vw - 24px)); background: var(--card); color: var(--ink);
}
.dialog::backdrop { background: rgba(14, 27, 44, 0.5); }
.dialog-body { padding: 16px; }
.dialog-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dialog-head h2 { margin: 0; font-size: 20px; }
/* A refused save's question (save-conflict.mjs): a short sentence and two buttons. */
.dialog-ask { width: min(460px, calc(100vw - 24px)); }
.ask-text { margin: 0 0 14px; font-size: 16px; line-height: 1.45; }
/* ── Drawing the pictures ──────────────────────────────────────────── */
/* A trip can want two dozen stickers, so the list scrolls inside the panel
   while the heading and the Draw button stay where they are — otherwise the
   button sits below twenty-seven cards and nobody finds it. */
.draw-list {
  list-style: none; padding: 0; margin: 12px 0;
  display: grid; gap: 10px;
  max-height: min(52vh, 460px); overflow-y: auto;
}
.draw-row { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.draw-row .grid { margin-top: 8px; }
.draw-row .hint:empty { display: none; }
.draw-where { font-size: 14px; font-weight: 600; margin: 0; }

.trip-list { list-style: none; padding: 0; margin: 12px 0; display: grid; gap: 10px; }
.trip-list li { border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; display: grid; gap: 8px; }
.trip-list .toolbar { margin: 0; }
.tag { margin-left: 8px; font-size: 12px; font-weight: 600; background: var(--tint); color: var(--navy); border-radius: 999px; padding: 1px 8px; }

/* ── Bottom bar ────────────────────────────────────────────────────── */
.bottom {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10;
  background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);   /* clears the iPhone home bar */
}
.bottom-inner { display: flex; align-items: center; gap: 12px; padding-top: 10px; padding-bottom: 4px; }
.where { flex: 1; text-align: center; font-size: 14px; color: var(--soft); font-variant-numeric: tabular-nums; }
.credit { max-width: 900px; margin: 0 auto; padding: 0 16px 8px; font-size: 11px; color: var(--soft); text-align: center; }
.credit a { color: inherit; }

/* ── Live preview ──────────────────────────────────────────────────── */
/* On a wide screen the real trip app stands in a rail down the right-hand edge
   of the window, the full height of it, and stays there while the form scrolls.
   Below 1180px the rail is gone (phones and tablets get a Preview button
   instead), and the page is exactly as it was.

   The rail owns the whole height because that is what decides how big the app
   can be drawn. Everything else on the page — the header, the step pills, the
   bottom bar — belongs to the form, so all of it now stops where the rail
   starts: the lockup lines up with the form's left edge and Tools with the
   form's right, which is the alignment the old full-width header never had.
   The words about the preview moved out of the phone's way too: they sit in a
   slim column beside it rather than above and below, where they were taking
   165px of the height the app needed.

   1180px is where a full-height phone and a workable form first fit side by
   side. The form is narrower here than it was under the old arrangement: it
   keeps its usual 900px on a window wide enough for both (about 1450px at a
   laptop's height, more on a tall window, where the phone is bigger) and gives
   up width to the rail below that — the price of an app screen that isn't
   cut. */
/* --preview-scale is set by preview-panel.mjs, on the panel's root rather than
   on the stage, so that everything in the panel can see it — the words beside
   the phone work out how tall it is drawn from the same number the phone does.
   0.6 is only what stands there until the first measurement, a moment later. */
.preview-side, .preview-sheet { --preview-scale: 0.6; --bezel: 6px; }
.preview-side { display: none; }
@media (min-width: 1180px) {
  :root {
    /* The phone's own column, worked out from the height there is rather than
       measured: the app is 390 × 844 and the bezel takes 6px a side, so a
       window this tall can draw it `(height - padding - bezels) / 844` of life
       size, and the column is that much of its width plus the bezels. Capped
       at life size (402px), and floored at the smallest size its text can be
       read at (MIN_SCALE in preview-panel.mjs — 0.75, so 305px), below which
       the bezel cuts the app instead. Sizing the column this way means the
       phone never asks the form for width it can't use. */
    --rail-pad: 16px;
    --phone-col: clamp(325px, calc((100dvh - 2 * var(--rail-pad) - 32px) / 844 * 390 + 32px), 422px);
    /* The words beside the phone. Narrow enough to read as a label on it,
       wide enough that a sentence about driving times isn't a ragged ladder:
       about 22 characters at the narrow end, 30 on a desk monitor. */
    --rail-words: clamp(132px, 11vw, 176px);
    --rail-gap: 14px;
    /* The page stops here, not against the phone: the header band is Midnight
       Atlas and so is the bezel, so with nothing between them the two ran
       together into one dark shape. */
    --rail-lead: 28px;
    --rail-w: calc(var(--rail-lead) + var(--phone-col) + var(--rail-gap) + var(--rail-words) + var(--rail-pad));
  }
  /* The page keeps clear of the rail; the bottom bar is fixed, so it is told
     where to stop rather than padded.

     Only where there is a rail. My trips loads this stylesheet too, so for a
     while it was holding 495px open on the right for a phone that was never
     coming — which read as a page that had failed to finish loading rather
     than a page that is simply the width of the window. */
  body:has(.preview-side) { padding-right: var(--rail-w); }
  body:has(.preview-side) .bottom { right: var(--rail-w); }

  /* The rail itself: fixed to the window's right edge, top to bottom, so it
     stays put while the form scrolls under its own header. The phone takes
     the first column and the whole height; the words take the second, in the
     order they always read in — what this is, which screen it is, that it's
     private and fresh, and what it can't show.

     They are spread to the phone's two ends rather than stacked at the top:
     "What your group will see" sits level with the phone's top edge, and the
     screen's name, the status line and the notes sit level with its foot.
     Stacked together they read as a block of notes that happens to be next to
     a phone; split to its ends they read as labels on it, and neither end is
     a paragraph long. */
  .preview-side {
    position: fixed; top: 0; right: 0; bottom: 0; width: var(--rail-w);
    /* How tall the phone is actually drawn: its own height at the scale
       preview-panel.mjs measured, or the room there is, whichever is less —
       the same two numbers .preview-screen settles its height from. */
    --phone-h: min(100%, calc(844px * var(--preview-scale) + 2 * var(--bezel)));
    display: grid;
    grid-template-columns: var(--phone-col) minmax(0, 1fr);
    /* Five rows, so the words can hang off the phone rather than off the
       window. The phone is drawn as tall as it can be and centered, which on
       a tall window leaves a hand's width of nothing above and below it; the
       outer two rows are exactly that slack, so the heading starts level with
       the phone's top edge and the rest ends level with its foot. The 1fr
       between them is what pushes the two apart, and it is also what gives
       way first: a trip with a long name and four notes closes the gap
       instead of the two blocks running into each other. */
    grid-template-rows:
      minmax(0, calc((100% - var(--phone-h)) / 2))
      auto
      minmax(0, 1fr)
      auto
      minmax(0, calc((100% - var(--phone-h)) / 2));
    column-gap: var(--rail-gap);
    padding: var(--rail-pad) var(--rail-pad) var(--rail-pad) var(--rail-lead);
  }
  .preview-side .preview-stage { grid-area: 1 / 1 / 6 / 2; }
  .preview-side .preview-above { grid-area: 2 / 2 / 3 / 3; }
  .preview-side .preview-told { grid-area: 4 / 2 / 5 / 3; }
  /* Beside the phone the words are a label, not a column of page text: they
     line up with the phone's edge, read small and quiet, and wrap where they
     must. Slate on Cloud, Mist on ink — the text pair, never coral. */
  .preview-side .preview-above,
  .preview-side .preview-told > * {
    width: auto; max-width: none; text-align: left; text-wrap: pretty;
  }
  .preview-side .preview-above { margin: 0; font-size: 13px; line-height: 1.3; }
  .preview-side .preview-caption { margin: 0; font-size: 13px; line-height: 1.3; }
  .preview-side .preview-status { margin: 6px 0 0; font-size: 12px; }
  /* The notes are the one thing beside the phone that a trip can make as long
     as it likes: the converter writes one for every contact without a phone
     number and every stop without a time, which is exactly the half-filled
     state the preview is for. Twenty of them were taller than the rail, and
     because the rail is fixed to the window the ones past its bottom edge
     couldn't be scrolled to at all. So they stop at a third of the window's
     height and scroll inside that, the way the sheet's list already does.
     A third is what the rest of the rail can spare at every window height the
     wide layout is used at. */
  .preview-side .preview-notes {
    margin: 8px 0 0; font-size: 12px; gap: 6px;
    max-height: 33dvh; overflow-y: auto; overscroll-behavior: contain;
  }
  /* Last in the column, under the notes, in the same quiet voice. The notes
     are what this trip can't show; this is how the preview is used, which is
     true of every trip — so it reads after them. */
  .preview-side .preview-hold { margin: 8px 0 0; font-size: 11.5px; }
}

/* The words around the phone are quiet on purpose: the app is what matters.
   `contain: inline-size` keeps a long note from widening the column. */
.preview-above, .preview-caption, .preview-status, .preview-notes, .preview-hold {
  margin: 0; width: 100%; max-width: 36ch; text-align: center;
  font-size: 13.5px; line-height: 1.45; color: var(--soft);
  contain: inline-size; text-wrap: balance;
}
.preview-above { font-weight: 600; color: var(--ink); margin-bottom: 14px; }
.preview-caption { margin-top: 14px; color: var(--ink); font-variant-numeric: tabular-nums; }
.preview-caption:empty { display: none; }
.preview-status { margin-top: 2px; font-size: 12.5px; }
.preview-status.warn { color: var(--warn); text-align: left; text-wrap: pretty; }
.preview-notes { list-style: none; padding: 0; margin-top: 10px; font-size: 12.5px; display: grid; gap: 4px; }
.preview-notes:empty { display: none; }
/* A list of notes too long for its cap is given a Tab stop so a keyboard can
   scroll it (preview-panel.mjs puts the tabindex on and takes it off). Its
   ring sits just inside it rather than around it: in the sheet the list runs
   the whole width of the screen, so a ring held off its edges would hang past
   both of them. */
.preview-notes[tabindex]:focus-visible { outline-offset: -3px; }
/* How to get from the app back to the form. The quietest line of the lot: it
   is read once and then known, so it sits under everything the trip itself
   has to say and never competes with it. */
.preview-hold { margin-top: 10px; font-size: 12px; text-wrap: pretty; }

/* The stage is whatever height is left once the words have theirs; the phone
   is drawn as big as fits in it, and no smaller than MIN_SCALE.
   preview-panel.mjs measures the stage and sets --preview-scale, because CSS
   can't yet turn a length into a plain number. */
.preview-stage {
  position: relative; flex: 1 1 auto; min-height: 0; width: 100%;
  display: grid; place-items: center;
  /* One cell, exactly the stage: an `auto` row would grow to fit a phone
     taller than the stage, and the phone's own `max-height: 100%` would then
     measure itself against that instead of against the room there really is. */
  grid-template: minmax(0, 1fr) / minmax(0, 1fr);
}
/* A phone's own proportions — 390 × 844, kept exactly — behind a thin Midnight
   Atlas edge, sitting on the page with one soft shadow. No notch, no buttons:
   it's a tool, not an advert. It's ink inside too, so before the first build it
   reads as a phone that's off rather than as a blank box. On a short window the
   phone keeps those proportions but no longer fits the room, so the bezel cuts
   it and the app scrolls inside (see the floor in preview-panel.mjs); the fades
   below say which way the rest of it is. */
.preview-screen {
  position: relative; z-index: 1;
  width: calc(390px * var(--preview-scale) + 2 * var(--bezel));
  height: calc(844px * var(--preview-scale) + 2 * var(--bezel));
  /* Once the scale has reached its floor the phone wants more height than the
     stage has, so it is cut to the stage and the app scrolls inside the bezel
     instead of shrinking further. Its scrollbar is hidden for the same reason
     the frame's own is (preview.mjs): no phone has a gray strip down the side,
     and a 15px-wide one would also narrow the app. */
  max-width: 100%; max-height: 100%;
  overflow-x: hidden; overflow-y: auto;
  overscroll-behavior: contain;   /* so the form behind doesn't scroll with it */
  scrollbar-width: none;
  border: var(--bezel) solid var(--header);
  border-radius: calc(44px * var(--preview-scale) + var(--bezel));
  background: var(--header);
  box-shadow: var(--cut-above), var(--cut-below), 0 22px 44px -18px rgba(14, 27, 44, 0.38);
}
.preview-screen::-webkit-scrollbar { display: none; }
/* Where the app carries on past the bezel, it fades into the bezel's own ink,
   so it reads as the screen sliding under the edge rather than as a scrollbar.
   It has to be an inset shadow: anything in the page would scroll away with
   the frame, and the scrollbar itself is hidden on purpose. preview-panel.mjs
   puts these classes on whenever there is more app than bezel — so they show
   up only on a short window, and never in the sheet, which always fits.
   Nothing moves: nothing in the preview is live. */
.preview-screen { --cut-above: 0 0 #0000; --cut-below: 0 0 #0000; }
.preview-screen.more-above { --cut-above: inset 0 22px 18px -14px var(--header); }
.preview-screen.more-below { --cut-below: inset 0 -22px 18px -14px var(--header); }
/* The page's own focus ring squares its corners off; a phone keeps its own. */
.preview-screen:focus-visible { border-radius: calc(44px * var(--preview-scale) + var(--bezel)); }
/* The app is laid out at a true phone size, 390 × 844, and scaled down whole —
   so it wraps its text exactly as a phone would, and the text stays sharp. */
.preview-frame {
  position: absolute; top: 0; left: 0; width: 390px; height: 844px; border: 0;
  transform: scale(var(--preview-scale)); transform-origin: 0 0;
  background: var(--header);
  opacity: 1; transition: opacity 200ms ease;
}
/* A frame being built is out of sight and out of reach: preview-panel.mjs
   also marks it inert, so Tab can't land in a page nobody can see. */
.preview-frame.is-building { opacity: 0; pointer-events: none; }

/* On a real pause in typing, one faint Lagoon ring leaves from behind the
   phone — the coming-soon page's signal, saying "this changed". It starts
   hidden under the phone and fades as it grows, so what sweeps past the
   phone's column and over the form is already almost invisible; it is left
   unclipped on purpose, because cutting it at the column's edge would show
   two hard-edged arcs instead of a ring. The rail it lives in is fixed to the
   window, so a ring wider than the window can't give the page a sideways
   scrollbar — measured in a browser at 1920 × 1080, where it reaches 65px past
   the edge. It never repeats: it runs once each time preview-panel.mjs puts
   .rippling back on the stage. */
.preview-ripple {
  position: absolute; left: 50%; top: 50%; z-index: 0;
  width: calc(844px * var(--preview-scale)); aspect-ratio: 1;
  margin-left: calc(-422px * var(--preview-scale));
  margin-top: calc(-422px * var(--preview-scale));
  border: 2px solid var(--focus); border-radius: 50%;
  opacity: 0; pointer-events: none;
}
.preview-stage.rippling .preview-ripple {
  animation: preview-ring 1.4s cubic-bezier(.16, .84, .44, 1) both;
}
@keyframes preview-ring {
  from { transform: scale(.5); opacity: .55; }
  to   { transform: scale(1.12); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .preview-frame { transition: none; }
  .preview-stage.rippling .preview-ripple { animation: none; }
}
/* On a dark page an ink phone would vanish, so it takes a faint Mist edge,
   and the shadow deepens to read as height rather than as a glow. */
@media (prefers-color-scheme: dark) {
  .preview-screen {
    box-shadow: var(--cut-above), var(--cut-below),
      0 0 0 1px rgba(154, 171, 185, 0.32), 0 22px 44px -18px rgba(0, 0, 0, 0.7);
  }
}

/* ── The preview on a phone or tablet ──────────────────────────────── */
/* Below 1180px there's no room beside the form, so a Preview button sits in
   the bottom bar and slides the app up full-screen. Three buttons and "Step 3
   of 8" don't fit a small phone's bar, so the words give way first: "3 of 8"
   below 400px, and nothing under 360px, where the step pills at the top
   already say which step this is. */
.preview-open { margin-left: auto; }
@media (min-width: 1180px) { .preview-open { display: none; } }
@media (max-width: 399px) {
  .top-inner { gap: 8px; }   /* so "• Changes to save" keeps both its lines in the header */
  .bottom-inner { gap: 8px; }
  .where-word { display: none; }
}
@media (max-width: 359px) { .where { display: none; } }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* The sheet covers everything, bar and all, and slides up from the bottom.
   It's ink behind the app so the slide never shows a white page. */
.preview-sheet {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column;
  background: var(--header); color: var(--header-ink);
  transform: translateY(100%);
  transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1);
}
.preview-sheet.open { transform: none; }
html.sheet-open, html.sheet-open body { overflow: hidden; }

.preview-sheet-bar {
  flex: none; display: flex; align-items: center; min-width: 0;
  padding: env(safe-area-inset-top) 12px 0 4px;
  min-height: 52px; border-bottom: 1px solid var(--header-line);
}
.preview-sheet-back {
  flex: none; font: inherit; font-size: 15px; font-weight: 600;
  color: var(--header-ink); background: none; border: 0; border-radius: 9px;
  min-height: 44px; padding: 0 10px; cursor: pointer;
  transition: background var(--step);
}
.preview-sheet-back:hover { background: var(--header-tint); }
.preview-sheet-title {
  margin: 0; min-width: 0; font-size: 14px; color: var(--header-soft);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
/* The caption's own look is for the page beside the form; on the bar it's
   one quiet line in the bar's colours. One line really: its balancing beside
   the form broke "Packing list screen" in two, which the bar has no height
   for; cut short with an ellipsis instead. */
.preview-sheet-title .preview-caption {
  margin: 0; width: auto; max-width: none; contain: none;
  font-size: inherit; color: inherit; text-align: left; text-wrap: nowrap;
}
.preview-sheet-title .preview-caption:not(:empty)::before { content: "·\00a0" / ""; }

/* ── The notes, folded on a phone (Nick, 3 December 2026) ── */
/* On a phone the notes and the line about holding took 90px between the bar
   and the app, and the app is laid out to the height it's given — so its
   opening screen came out cut, the top of the cover picture under the bar and
   "Enter the App" off the bottom. There they fold behind a Notes button at the
   end of the bar, and open in their usual place, pushing the app down, when
   it's pressed (builder.js opens them the first time, so the gesture is still
   found). Folded, they are out of sight rather than gone: the list is a live
   region, and a screen reader should still hear a note arrive. On a tablet
   the button never shows; the words cost the phone drawn there nothing. */
.preview-sheet-more { display: none; }
@media (max-width: 599px), (max-height: 699px) {
  .preview-sheet-more {
    display: inline-flex; align-items: center; gap: 6px; flex: none; margin-left: auto;
    font: inherit; font-size: 14px; font-weight: 600; color: var(--header-ink);
    background: none; border: 1px solid var(--header-line); border-radius: 999px;
    min-height: 36px; padding: 0 12px; cursor: pointer;
    transition: background var(--step), border-color var(--step);
  }
  .preview-sheet-more:hover { background: var(--header-tint); border-color: var(--header-soft); }
  .preview-sheet-more[aria-expanded="true"] { background: var(--header-tint); }
  .preview-sheet-more .count {
    font-size: 12px; font-weight: 700; color: var(--header-soft);
    background: var(--header-tint); border-radius: 999px; padding: 0 7px;
  }
  .preview-sheet-more .count[hidden] { display: none; }
  .preview-sheet-title { flex: 1 1 auto; }
  .preview-sheet:not(.words-open) .preview-notes,
  .preview-sheet:not(.words-open) .preview-hold {
    position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}

/* The notes belong with the bar, not under the app: on a phone there is
   nothing under the app, and a quiet line in the sheet's own ink reads as the
   preview talking rather than as part of the trip. The stage gives up the room
   (it's the flexible one), so the app is never covered — and because the app
   is laid out to whatever height the frame has, a shorter frame means a
   shorter app screen, not an app pushed into a scroll. A trip with a long list
   of warnings stops at a third of the sheet and scrolls, rather than squeezing
   the app into a strip. */
.preview-sheet .preview-notes {
  flex: none; width: auto; max-width: none; margin: 0; contain: none;
  padding: 8px 14px 2px;
  max-height: 33%; overflow-y: auto; overscroll-behavior: contain;
  font-size: 12.5px; line-height: 1.4; color: var(--header-soft);
  text-align: left; text-wrap: pretty;
}
/* The sheet is the only preview a phone has, so the line about holding belongs
   here more than anywhere. It reads with the notes, in the bar's own ink, and
   it is the one that carries the rule separating the words from the app: the
   notes above it are empty as often as not, and two rules in a row between the
   bar and the app read as a mistake. */
.preview-sheet .preview-notes:empty + .preview-hold { padding-top: 8px; }
.preview-sheet .preview-hold {
  flex: none; width: auto; max-width: none; margin: 0; contain: none;
  padding: 2px 14px 10px; border-bottom: 1px solid var(--header-line);
  font-size: 12px; line-height: 1.4; color: var(--header-soft);
  text-align: left; text-wrap: pretty;
}

/* On a phone the app fills the screen at the phone's own width — it is what
   the group will see on theirs. */
.preview-sheet .preview-stage {
  --bezel: 0px;
  position: relative; flex: 1 1 auto; min-height: 0;
}
.preview-sheet .preview-screen {
  position: absolute; inset: 0; width: auto; height: auto;
  border: 0; border-radius: 0; box-shadow: none;
}
.preview-sheet .preview-frame { width: 100%; height: 100%; transform: none; }
/* On a tablet the same app at a whole phone's width would be a stretched page
   nobody will see, so it's drawn as a true-size phone, centered and scaled to
   the height like the one beside the form on a laptop. A phone turned on its
   side is too short for that and keeps the full-screen view.

   Unlike the laptop's, this phone has no smallest size: it is always drawn to
   fit, however short the tablet (builder.js passes NO_FLOOR). A touch screen
   has no wheel and no keyboard, so a phone cut to the bezel would simply hide
   its own foot with no way to reach it. */
@media (min-width: 600px) and (min-height: 700px) {
  .preview-sheet .preview-stage {
    --bezel: 6px;
    display: grid; place-items: center; padding: 24px 16px;
  }
  .preview-sheet .preview-screen {
    position: relative; inset: auto;
    width: calc(390px * var(--preview-scale) + 2 * var(--bezel));
    height: calc(844px * var(--preview-scale) + 2 * var(--bezel));
    border: var(--bezel) solid var(--header);
    border-radius: calc(44px * var(--preview-scale) + var(--bezel));
    /* Ink phone on an ink sheet: the Mist edge from dark mode, in both themes. */
    box-shadow: var(--cut-above), var(--cut-below),
      0 0 0 1px rgba(154, 171, 185, 0.32), 0 22px 44px -18px rgba(0, 0, 0, 0.7);
  }
  .preview-sheet .preview-frame { width: 390px; height: 844px; transform: scale(var(--preview-scale)); }
}
/* While the first build is on its way the screen is ink, so it says so. Once
   a frame is showing, only a problem is worth covering it for. */
.preview-sheet .preview-status {
  position: absolute; left: 50%; top: 50%; z-index: 2; transform: translate(-50%, -50%);
  width: calc(100% - 48px); max-width: 36ch; margin: 0;
  font-size: 14px; color: var(--header-soft); text-align: center;
}
.preview-sheet .preview-status.warn {
  color: var(--warn); background: var(--warn-bg); padding: 12px 14px; border-radius: 12px;
  text-align: left;
}
.preview-sheet .preview-stage:has(.preview-frame:not(.is-building)) .preview-status:not(.warn) { display: none; }
@media (prefers-reduced-motion: reduce) {
  .preview-sheet { transition: none; }
}

/* ── Dark theme, last word ─────────────────────────────────────────── */
/* These sit at the end because they overrule rules set further up. A wide soft
   shadow separates nothing on a dark page, so the floating panels take an edge
   and just enough shadow to lift them off the card behind. The filled button
   drops its shadow entirely: a dark halo under a Lagoon button reads as a
   glow, not as height. */
@media (prefers-color-scheme: dark) {
  .tools-menu, .town-list { border: 1px solid var(--line); box-shadow: 0 8px 16px -12px #000; }
  .btn.primary, .btn.primary:hover:not(:disabled) { box-shadow: none; }
}

/* ── Build / During the trip ───────────────────────────────────────── */
/* Two halves of one switch in the header, the open one filled. Lagoon on the
   dark header, as the step pills use; never coral, which only means live. */
.mode-switch {
  display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px;
  border: 1px solid var(--header-line); margin-left: 8px;
}
.mode-switch[hidden] { display: none; }
.mode-switch button {
  font: inherit; font-size: 14px; font-weight: 600; padding: 6px 12px; border: 0; border-radius: 7px;
  background: none; color: var(--header-soft); cursor: pointer; white-space: nowrap;
  transition: background var(--step), color var(--step);
}
.mode-switch button:hover { color: var(--header-ink); }
.mode-switch button[aria-pressed="true"] { background: var(--header-ink); color: var(--header); }
/* On a phone the header has no room for it beside the logo and Tools, so it
   takes a row of its own under them, its two halves sharing the width. */
@media (max-width: 640px) {
  .top-inner { flex-wrap: wrap; }
  .mode-switch { order: 10; flex: 1 0 100%; margin: 2px 0 4px; }
  .mode-switch button { flex: 1; }
}
/* During the trip has no steps: the rail, the progress line and Back/Next go. */
.mode-during #steps, .mode-during .progress, .mode-during #back,
.mode-during #next, .mode-during #where { display: none; }
.mode-during .bottom-inner { justify-content: flex-end; }

.during textarea, .during input[type="text"] { width: 100%; }
.during .link-label { margin-top: 10px; }
.during .count-line { margin: 4px 0 0; }
.push-preview {
  display: grid; gap: 2px; margin: 4px 0 12px; padding: 12px 14px; border-radius: 14px;
  background: var(--field); border: 1px solid var(--line);
  box-shadow: 0 6px 18px -8px rgba(0, 20, 50, 0.18); overflow-wrap: anywhere;
}
.during-when { margin: 4px 0 12px; }
.during-when .field > span { display: block; font-weight: 600; font-size: 14px; margin-bottom: 4px; }
.during-list { list-style: none; padding: 0; margin: 0 0 10px; display: grid; gap: 0; }
.during-list li { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; }
.during-list li + li { border-top: 1px solid var(--line); }
.during-list p { margin: 2px 0; }
.during-list .hint { margin: 0; }
.during-qr-row { display: flex; gap: 18px; align-items: center; margin-top: 14px; }
.during-qr { width: 132px; height: 132px; border-radius: 8px; border: 1px solid var(--line); flex: none; }
@media (max-width: 480px) { .during-qr-row { flex-direction: column; align-items: flex-start; } }

/* ── The rendered phone ────────────────────────────────────────────── */
/* Beside the form the app sits in the same rendered phone the operators page
   shows (Season plans, cropped to the phone), not a plain ink edge. The
   screen box keeps doing everything it did — the scale, the scrolling, the
   fades — with a clear 16px border that leaves the frame its room; the frame
   is drawn over it, centered on the same cell, sized from the same scale.
   Its opening is 674 × 1458 of its 744 × 1508, centered both ways, so it is
   sized as if the opening were 2px smaller: the frame then laps a hair over
   the app's edge and no seam shows. The opening's corners are about 62px
   round in those pixels, 36px on the 390px app, so the app is rounded at
   36px: rounder, as it was at 56px, and the page showed through at every
   corner between the app and the frame (Nick, 4 December 2026). The sheet
   keeps the plain edge. */
.preview-side { --bezel: 16px; }
.preview-side .preview-screen {
  grid-area: 1 / 1;   /* the frame shares this cell; without it the screen is pushed to a row of its own */
  border-color: transparent; background: var(--header); background-clip: padding-box;
  border-radius: calc(36px * var(--preview-scale) + var(--bezel));
  box-shadow: var(--cut-above), var(--cut-below);
}
.preview-phone { display: none; }
.preview-side .preview-phone {
  display: block; grid-area: 1 / 1; z-index: 2; pointer-events: none; max-width: none;
  width: calc(390px * var(--preview-scale) * 744 / 676);
  height: calc(844px * var(--preview-scale) * 1508 / 1460);
  filter: drop-shadow(0 22px 26px rgba(14, 27, 44, 0.32));
}
/* A window too short for the smallest readable phone cuts it, and a cut
   phone in a whole phone's frame would be a lie about its size: there the
   frame steps aside and the screen takes the plain ink edge back.
   preview-panel.mjs says when. */
.preview-side.is-cut .preview-phone { display: none; }
.preview-side.is-cut .preview-screen {
  border-color: var(--header); background-clip: border-box;
  border-radius: calc(44px * var(--preview-scale) + var(--bezel));   /* the plain edge's own, as before */
  box-shadow: var(--cut-above), var(--cut-below), 0 22px 44px -18px rgba(14, 27, 44, 0.38);
}
@media (prefers-color-scheme: dark) {
  .preview-side .preview-phone { filter: drop-shadow(0 0 1px rgba(154, 171, 185, 0.5)) drop-shadow(0 22px 26px rgba(0, 0, 0, 0.6)); }
}
/* A real phone keeps its top strip for the clock and the camera, and the app
   starts below it. Here the app would otherwise run under the frame's camera
   and lose the middle of its own heading, so it starts 47px down (an iPhone's
   strip), and is laid out 47px shorter to match. On a phone that strip shows
   the app's own top color, so here it takes the trip's main color
   (preview-panel.mjs sets --app-top with each build); before the first build
   it is the screen's ink, a phone that's off. */
.preview-side:not(.is-cut) .preview-frame { top: calc(47px * var(--preview-scale)); height: 797px; }
.preview-side:not(.is-cut) .preview-screen { background-color: var(--app-top, var(--header)); transition: background-color 0.35s ease; }
@media (prefers-reduced-motion: reduce) { .preview-side:not(.is-cut) .preview-screen { transition: none; } }

/* ── Help (help-panel.mjs) ─────────────────────────────────────────── */
/* The guide in a frame, down the right-hand side under the header. It sits
   over the preview rail while it's open: Help and the phone are both things
   you look at beside the form, and the panel is the one you just asked for.
   Below 760px it takes the whole screen, header and all. */
.help-panel {
  position: fixed; z-index: 20; top: var(--help-top, 0); right: 0; bottom: 0; width: min(440px, 100%);
  display: grid; grid-template-rows: auto minmax(0, 1fr);
  background: var(--bg); color: var(--ink);
  box-shadow: -1px 0 0 var(--line), -24px 0 48px -32px rgba(14, 27, 44, 0.45);
  animation: help-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes help-in { from { transform: translateX(24px); opacity: 0; } }
.help-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 14px 14px 20px; border-bottom: 1px solid var(--line); background: var(--card); }
.help-head h2 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 24px; line-height: 1.1; letter-spacing: -0.02em; }
.help-sub { margin: 2px 0 0; font-size: 13.5px; color: var(--soft); }
.help-sub a { color: inherit; }
.help-frame { display: block; width: 100%; height: 100%; border: 0; background: var(--bg); }
.btn.top-btn[aria-expanded="true"] { background: var(--header-tint); border-color: var(--header-soft); }
#help-open { display: inline-flex; align-items: center; gap: 6px; padding-left: 11px; }
#help-open .icon-svg { color: var(--header-soft); }
/* Help made the header one button longer. Beside the preview rail on a
   laptop the header is only as wide as the rail leaves it (about 700px at
   1280 × 800), and the lockup, the switch, the save status and three buttons
   no longer fit, so "Trip builder" beside the lockup gives way first, as it
   already does on a phone. The header's own width decides, not the window's:
   the rail takes its width from the window's height. The bar around the
   header is what's measured, not the header itself: a rule can't restyle the
   box it measures, and the narrower rules below change the header's own gap
   and wrapping. The two are the same width wherever these rules apply. */
.top { container-type: inline-size; }
/* 860px, not 750: once the status took only the room left over, "Trip
   builder" at 1440 × 900 (about 790px of header) left it about 50px. */
@container (max-width: 860px) { .mark-sub { display: none; } }
/* Narrower still, beside the phone on a 1200 × 750 window the header is about
   650px and its contents needed more even with the shortest status, so Tools
   ran past the edge under the phone's column. Help shows its icon alone, as
   on a phone, the gaps close up, and the status keeps to two short lines that
   can't spill onto Help. */
@container (max-width: 700px) {
  .top-inner { gap: 8px; }
  #help-open { width: 40px; height: 40px; padding: 0; justify-content: center; }
  #help-open .help-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #help-open .icon-svg { color: var(--header-ink); }
  .save-status {
    font-size: 12.5px; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
}
/* Under 670px that still left the status too little room for "Changes to
   save", so My trips goes into the Tools menu, as it does on a phone. */
@container (max-width: 670px) {
  #tool-trips { display: none; }
  .tools-menu .only-phone { display: block; }
}
/* A tall window only just wide enough for the phone (1180 × 1000) leaves
   about 550px: the Build switch takes a row of its own, as on a phone. */
@container (max-width: 600px) {
  .top-inner { flex-wrap: wrap; }
  .mode-switch { order: 10; flex: 1 0 100%; margin: 2px 0 4px; }
  .mode-switch button { flex: 1; }
}
@media (max-width: 640px) {
  #help-open { width: 40px; height: 40px; padding: 0; justify-content: center; }
  #help-open .help-word { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  #help-open .icon-svg { color: var(--header-ink); }
}
/* "How this works", under each step's heading. */
.how-link {
  display: inline-flex; align-items: center; margin: -2px 0 14px; padding: 0; border: 0; background: none;
  color: var(--lagoon); font: 600 14px/1.4 var(--body); cursor: pointer;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px;
}
.how-link:hover { text-decoration-thickness: 2px; }
/* The first-visit line, just under the Help button (placed by help-panel.mjs). */
.help-tip {
  position: fixed; z-index: 21; display: flex; align-items: center; gap: 6px; padding: 6px 6px 6px 14px;
  border-radius: 12px; background: var(--card); color: var(--ink); box-shadow: var(--shadow-pop); font-size: 14px;
  animation: help-in 220ms cubic-bezier(0.22, 1, 0.36, 1);
}
.help-tip p { margin: 0; }
.help-tip .btn.icon { width: 32px; min-height: 32px; border: 0; background: none; }
/* Beside the phone rail, Help takes the rail's place whole, top to bottom, as
   the Private builder's Help takes the place of its stage. A narrower sheet
   under the header left the top and side of the phone showing around it. */
@media (min-width: 1180px) {
  .help-panel { top: 0; width: var(--rail-w); }
}
@media (max-width: 760px) {
  .help-panel { top: 0; width: 100%; box-shadow: none; z-index: 40; }
  html.help-open body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .help-panel, .help-tip { animation: none; }
}
