/* Cobalt signal -- Patrick's pick from the 2026-07-13 four-candidate palette experiment
   (PROJECT_LOG entry of that date has the full decision trail; UX_SPEC §10 has the color
   role sheet these values implement). Every text/background pair here verified >= 4.5:1
   (WCAG AA) computationally as part of that experiment. */
:root {
  --accent: #1d4ed8;
  --accent-bg: #dbeafe;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --border: #e2e8f0;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #fcfcfd;
  /* Hover tint for WHITE surfaces (outline buttons, list rows): the global
     `button:hover { opacity: 0.9 }` is visible on a filled cobalt button but
     mathematically invisible on #fff over a near-white page (Patrick, 2026-07-14).
     Slate-100, same family as --border/--bg. */
  --hover-bg: #f1f5f9;
  /* Departure-board character for times/service designators (F2, UX_SPEC §9 Rule 4) --
     structure without added color, no web font needed (system monospace stacks). */
  --mono: ui-monospace, "Cascadia Mono", "Segoe UI Mono", Consolas, monospace;
}
/* ---- Alternative palettes (color-experiment story, PROJECT_LOG 2026-07-13) ----
   Applied by setting data-palette on <html> (see shared.js initPaletteTools). Cobalt WON
   and now lives in :root above; the losing candidates below are kept "for now" (Patrick's
   words) so the ?palette switcher can still compare cheaply, plus "classic" preserving the
   pre-experiment steel-blue baseline. Each block overrides ONLY brand/atmosphere tokens
   plus a shared, contrast-fixed functional trio; the SEMANTIC meanings (red=broken,
   amber=caution, green=ok) never change per palette -- that's the role sheet's fixed half
   (UX_SPEC §10). Every text/background pair in every block verified >= 4.5:1 (WCAG AA)
   computationally; notable adaptations from the raw coolors.co picks: teal's amber D97706
   and slate-cyan's F59E0B fail as TEXT on white (~3.4:1 / ~2.2:1), so both use amber-700
   B45309 for text and keep the character in the washes; slate-cyan's 22D3EE fails as a
   button fill under white text (~1.9:1), so the accent is its darker cousin 0E7490.
   Delete all of this once the choice feels settled. */
:root[data-palette="classic"] {
  --accent: #185fa5;
  --accent-bg: #dce8f5;
  --success-bg: #eaf3de;
  --success-text: #27500a;
  --warning-bg: #faeeda;
  --warning-text: #633806;
  --danger-bg: #fcebeb;
  --danger-text: #791f1f;
  --border: #d3d1c7;
  --text: #2c2c2a;
  --muted: #5f5e5a;
  --bg: #f1efe8;
}
:root[data-palette="teal"] {
  --accent: #0f766e;
  --accent-bg: #ccfbf1;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --border: #e2e8f0;
  --text: #111827;
  --muted: #64748b;
  --bg: #f8fafc;
}
:root[data-palette="slate-cyan"] {
  --accent: #0e7490;
  --accent-bg: #cffafe;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --border: #cbd5e1;
  --text: #0f172a;
  --muted: #64748b;
  --bg: #f8fafc;
}
:root[data-palette="timetable"] {
  --accent: #4338ca;
  --accent-bg: #e0e7ff;
  --success-bg: #dcfce7;
  --success-text: #15803d;
  --warning-bg: #fef3c7;
  --warning-text: #b45309;
  --danger-bg: #fee2e2;
  --danger-text: #b91c1c;
  --border: #e7e5e4;
  --text: #292524;
  --muted: #57534e;
  --bg: #faf7f0;
}
* { box-sizing: border-box; }
/* ---- Focus states (E1, UX audit finding #10: "no focus styles") -- one visible, on-brand
   ring for every keyboard-focusable element, site-wide, rather than relying on each
   browser's own default outline (which several buttons/links here never explicitly
   override, but whose default appearance is inconsistent across browsers and easy to lose
   track of against custom backgrounds). :focus-visible (not :focus) so a mouse click still
   shows no ring -- only keyboard/other non-pointer focus does. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg);
  color: var(--text);
  margin: 0;
  padding: 0 16px 64px;
}
main {
  max-width: 480px;
  margin: 0 auto;
}

/* ---- Font-size discipline (F2, UX_SPEC §9 Rule 1): four sizes only --
   20 (page title) / 16 (verdict + major headings) / 14 (all body content) /
   12 (captions only -- provenance, meta, footer, timestamps). Rule 2: --muted is legal
   ONLY on 12px rules below; anything 14px+ uses --text or a semantic color, because if
   it matters enough to be body text, it matters enough to be readable. ---- */

h1 {
  font-size: 20px;
  font-weight: 500;
  margin: 0 0 4px;
}
p.subtitle {
  color: var(--text);
  font-size: 14px;
  margin: 0 0 4px;
}
p.scope-note {
  color: var(--muted);
  font-size: 12px;
  margin: 0 0 20px;
}
p.footer-note {
  color: var(--muted);
  font-size: 12px;
  margin: 24px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
p.footer-note a {
  color: var(--accent);
}

/* ---- Shared header (all pages, UX_SPEC.md §2) ---- */
.site-header {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px 0 20px;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.site-header .wordmark {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
}
/* Brand mark (2026-07-20, mockup-approved: docs/mockups/2026-07-20-branch-adoption.html
   "Tier 1" -- the fork, drawn for real). Colored via product tokens, not fixed brand
   hex, so it themes correctly with the ?palette switcher: structure/dead-branch in
   --muted, way-out in --accent, the X in --warning-text -- the same amber every result
   screen already uses for "was a problem, not a disaster". */
.wordmark-mark {
  width: 20px;
  height: 13.3px;
  margin-right: 6px;
  flex-shrink: 0;
}
.wordmark-mark .k-line,
.wordmark-mark .k-ring,
.wordmark-mark .k-dead { stroke: var(--muted); fill: none; }
.wordmark-mark .k-ring { fill: var(--bg); }
.wordmark-mark .k-dot { fill: var(--muted); }
.wordmark-mark .k-dead { stroke-dasharray: 6 5; }
.wordmark-mark .k-x { stroke: var(--warning-text); }
.wordmark-mark .k-live { stroke: var(--accent); fill: none; }
.wordmark-mark .k-end { stroke: var(--accent); fill: var(--bg); }
.wordmark-mark .k-enddot { fill: var(--accent); }
.wordmark-mark .k-line,
.wordmark-mark .k-x { stroke-width: 5; }
.wordmark-mark .k-dead { stroke-width: 4.5; }
.wordmark-mark .k-live { stroke-width: 6; }
.wordmark-mark .k-ring,
.wordmark-mark .k-end { stroke-width: 4.5; }
.wordmark-mark .k-line,
.wordmark-mark .k-dead,
.wordmark-mark .k-live,
.wordmark-mark .k-x { stroke-linecap: round; }
.wordmark-accent { color: var(--accent); }
.site-header .wordmark-by {
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  margin-left: 4px;
}
.site-header nav {
  display: flex;
  gap: 14px;
  align-items: baseline;
}
.site-header nav a {
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
}
.site-header nav a.current {
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
}
.test-mode-chip {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 8px;
  margin-left: 8px;
}

.orientation-strip {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 0 0 20px;
}
.orientation-step {
  background: #fff;
  border: 1px solid var(--border);
  border-top: 3px solid var(--border);
  border-radius: 12px;
  padding: 12px 8px;
  text-align: center;
}
.orientation-step-action { border-top-color: var(--accent); }
.orientation-step-watch { border-top-color: var(--warning-text); }
.orientation-step-resolve { border-top-color: var(--success-text); }
.orientation-icon {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 8px;
}
.orientation-icon svg { width: 18px; height: 18px; }
.orientation-icon-accent { background: var(--accent-bg); color: var(--accent); }
.orientation-icon-warning { background: var(--warning-bg); color: var(--warning-text); }
.orientation-icon-success { background: var(--success-bg); color: var(--success-text); }
.status-icon {
  display: inline-flex;
  vertical-align: -3px;
  margin-right: 6px;
}
.status-icon svg { width: 15px; height: 15px; }
.orientation-title {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 2px;
}
.orientation-text {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
  line-height: 1.3;
}
@media (max-width: 380px) {
  .orientation-strip { grid-template-columns: 1fr; }
}
.example-section {
  background: var(--accent-bg);
  border: 1px dashed var(--accent);
  border-radius: 16px;
  padding: 16px;
  margin-bottom: 28px;
}
.example-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin: 0 0 8px;
}
.example-caption {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
  font-style: italic;
}

/* ---- Landing hero, "two clocks" (2026-07-17, replaced the two-door section; A3
   refinement same day) ----
   The clock spans carry the app's own status colors on purpose: amber = running late,
   red = the thing you'll lose -- the same meanings every result screen uses. The times
   sit in their own grid column so they align like a departure board (ragged placement
   read as accidental, Patrick's live feedback). */
/* One column, same as every other section: main caps content at 480px (the page is
   deliberately phone-shaped), and both attempts at a side-by-side hero fought that shape
   and lost (A2/A3, withdrawn 2026-07-17 -- see index.html's hero comment). The release
   the old green card carried now lives in the timeline's green third row. */
.hero { padding: 8px 0 4px; margin-bottom: 26px; }
/* Alert timeline (Concept A', 2026-07-19 -- replaces the A4 clock grid; see index.html's
   hero comment). Each row: mono timestamp | rail with status dot | title + sub. The rail
   is what makes it read as "record of events, minute by minute" rather than three floating
   claims; the timestamp column is fixed so all times align, and the check mark lives in
   the title text, never beside a time. h1 wraps the rows (spans only -- h1 can't hold
   block elements), same pattern the clock grid used. */
.hero-context { font-size: 13px; color: var(--muted); margin: 0 0 14px; }
.hero-context strong { color: var(--text); font-weight: 700; }
.hero-tl {
  display: block;
  margin: 0 0 4px;
  font-size: inherit;
  font-weight: inherit;
  letter-spacing: normal;
  line-height: 1.4;
}
.hero-tl-row { display: grid; grid-template-columns: 42px 16px 1fr; column-gap: 8px; }
.hero-tl-time { font-family: var(--mono); font-size: 12px; font-weight: 600; color: var(--muted); text-align: right; padding-top: 4px; font-variant-numeric: tabular-nums; }
.hero-tl-rail { position: relative; display: block; }
.hero-tl-rail::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; background: var(--border); transform: translateX(-50%); }
.hero-tl-row:first-child .hero-tl-rail::before { top: 9px; }
.hero-tl-row:last-child .hero-tl-rail::before { height: 9px; bottom: auto; }
.hero-tl-dot { position: absolute; left: 50%; top: 6px; width: 10px; height: 10px; border-radius: 50%; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--bg); }
.hero-tl-card { display: block; padding: 0 0 16px; }
.hero-tl-row:last-child .hero-tl-card { padding-bottom: 0; }
.hero-tl-title { display: block; font-size: 17px; font-weight: 800; letter-spacing: -0.01em; }
.hero-tl-sub { display: block; font-size: 13.5px; font-weight: 400; color: var(--muted); margin-top: 1px; }
.hero-tl-warn .hero-tl-title { color: var(--warning-text); }
.hero-tl-warn .hero-tl-dot { background: var(--warning-text); }
.hero-tl-bad .hero-tl-title { color: var(--danger-text); }
.hero-tl-bad .hero-tl-dot { background: var(--danger-text); }
.hero-tl-ok .hero-tl-title { color: var(--success-text); }
.hero-tl-ok .hero-tl-dot { background: var(--success-text); }
.hero-tl-ok .hero-tl-sub { color: var(--success-text); }
.hero-answer {
  font-size: 17px;
  color: var(--text);
  margin: 14px 0 20px;
}
.hero-answer strong { color: var(--accent); }
.hero-cta-row { margin: 0; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.hero-cta-row .button-link { width: auto; }
.hero-ghost {
  color: var(--accent);
  font-size: 13.5px;
  font-weight: 500;
  text-decoration: none;
}
.hero-ghost:hover { text-decoration: underline; }
.hero-cta-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 8px 0 0;
}
@media (max-width: 480px) {
  .hero-tl-title { font-size: 15.5px; }
  .hero-tl-row { grid-template-columns: 38px 14px 1fr; column-gap: 7px; }
}

form {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 4px;
}
select, input[type="number"], input[type="text"], input[type="date"], input[type="datetime-local"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
input[type="number"] { width: 110px; }
.section-heading {
  font-size: 16px;
  font-weight: 500;
  margin: 0 0 4px;
}
.section-sub {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 12px;
}
.demo-section {
  margin-bottom: 20px;
}

/* A link that looks like <button> -- used for cross-page navigation CTAs (e.g. the landing
   hero's demo CTA) where a real <button> nested inside an <a> would be invalid HTML. */
a.button-link {
  display: inline-block;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  text-decoration: none;
  text-align: center;
  width: 100%;
}
a.button-link:hover { opacity: 0.9; }
@media (pointer: coarse) {
  a.button-link { min-height: 44px; display: flex; align-items: center; justify-content: center; }
}

/* ---- Scenario cards (UX_SPEC.md §4-5, replaces the old demo-grid buttons) ---- */
.scenario-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 16px;
}
.scenario-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}
/* S1 only (F3) -- the page's one primary-blue CTA lives here; the plain `button` base
   style already IS accent-blue, so this card just omits `.fill-example` rather than
   needing its own button variant. */
.scenario-card-primary .scenario-card-title { display: flex; align-items: center; gap: 8px; }
.scenario-card-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 4px;
}
.scenario-card-situation {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 6px;
}
.scenario-card-meta {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.scenario-tried-chip {
  font-size: 12px;
  color: var(--success-text);
  margin-left: 8px;
}
/* Compact rows for S2/S3 (F3) -- deliberately lighter than the S1 card so the eye lands
   on "Start here" first: no border/background of its own, just a divider between rows. */
.scenario-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 2px;
  border-bottom: 1px solid var(--border);
}
.scenario-row-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0 0 2px;
}
.scenario-row-situation {
  font-size: 12px;
  color: var(--muted);
  margin: 0;
}
.scenario-row-button {
  flex-shrink: 0;
}
.scenario-bus-link {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 16px;
}
.scenario-bus-link a { color: var(--accent); }

/* ---- Staged scenario run (D2, TESTER_SCENARIOS.md's "Run structure") ---- */
/* Scenario picker (2026-07-13, Patrick): one framed card -- a tab row on top to choose a
   scenario, the picked one's run + result below. Replaces the earlier two-zone card menu,
   keeping the screen focused on the active scenario with the others one click away. */
.scenario-picker {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  scroll-margin-top: 12px;
}
.scenario-tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 14px;
}
/* Unselected tabs read as real buttons, not labels (tester feedback 2026-07-17: white on
   the near-white page bg made the demo's FIRST required click invisible). Accent text +
   a slightly darker border + a lift shadow = the classic secondary-button affordance,
   while the active tab keeps its filled accent-bg treatment so selection still reads. */
.scenario-tab {
  flex: 1 1 0;
  min-width: 0;
  border: 1px solid #cbd5e1;
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  padding: 8px 6px;
  border-radius: 8px;
  text-align: center;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.12);
}
/* Selected tab is a quiet accent tint, NOT a filled button -- the trigger button stays the
   one loud element on the screen (UX_SPEC §9). */
.scenario-tab.active {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent);
  font-weight: 700;
}
.scenario-tab-tried { color: var(--success-text); }
.scenario-active-title { margin: 0 0 8px; }
/* The "what do I do now" hint under the tabs. Accent-colored since 2026-07-17 (same
   tester feedback as the tab treatment above): as the only instruction on an otherwise
   quiet screen it must not read as fine print. */
.scenario-run-empty {
  font-size: 14px;
  color: var(--accent);
  font-weight: 500;
  text-align: center;
  margin: 0;
  padding: 8px 0;
}
.scenario-run { margin-top: 4px; }
.scenario-run-situation {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 10px;
}
.scenario-trigger {
  width: 100%;
}
.scenario-trigger-caption {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  margin: 6px 0 0;
}
.scenario-notice {
  margin: 14px 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.scenario-notice summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
.scenario-notice-heading {
  font-size: 12px;
  font-weight: 600;
  margin: 10px 0 4px;
}
.scenario-notice ul {
  margin: 0;
  padding-left: 18px;
  font-size: 14px;
  color: var(--text);
}
.scenario-notice li {
  margin-bottom: 6px;
}
.scenario-completion {
  background: var(--success-bg);
  border-radius: 12px;
  padding: 14px 16px;
  margin-top: 14px;
}
.scenario-completion-heading {
  font-size: 16px;
  font-weight: 500;
  color: var(--success-text);
  margin: 0 0 8px;
}

/* ---- Tester feedback blocks (D2 renders, D3 wires the POST) ---- */
.feedback-block {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px;
  margin-top: 14px;
}
.feedback-heading {
  font-size: 14px;
  font-weight: 600;
  margin: 0 0 10px;
}
.feedback-question {
  margin-bottom: 12px;
}
.feedback-question-text {
  font-size: 14px;
  color: var(--text);
  margin: 0 0 6px;
}
.feedback-buttons {
  display: flex;
  gap: 6px;
}
.feedback-buttons button {
  padding: 6px 12px;
  font-size: 12px;
}
.feedback-buttons button.selected {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.feedback-text {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
  margin-bottom: 10px;
}
/* Recruitment R0.2: the optional waitlist-email opt-in in the session-final block. */
.feedback-email-label {
  display: block;
  font-size: 14px;
  color: var(--text);
  margin: 0 0 6px;
}
.feedback-email {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
  margin-bottom: 4px;
}
.feedback-email-invalid {
  border-color: var(--danger-text);
}
.feedback-email-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
.feedback-thanks {
  font-size: 14px;
  color: var(--success-text);
  margin: 0;
}
.feedback-session-final {
  margin-top: 14px;
}

/* ---- Persistent "Give feedback" button (/test only) ---- */
.persistent-feedback-button {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  border-radius: 999px;
  padding: 12px 18px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}
.persistent-feedback-panel {
  position: fixed;
  right: 16px;
  bottom: 72px;
  z-index: 20;
  width: min(340px, calc(100vw - 32px));
  max-height: 70vh;
  overflow-y: auto;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.persistent-feedback-panel[hidden] { display: none; }

.fill-example {
  border-color: var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  padding: 8px 12px;
}
button {
  border: 1px solid var(--accent);
  background: var(--accent);
  color: #fff;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  cursor: pointer;
}
button:hover { opacity: 0.9; }
/* White/outline buttons need a real hover tint -- the opacity dim above does nothing
   visible on a white fill (see --hover-bg's comment). opacity reset so the two hover
   mechanisms don't stack into a washed-out look. */
.fill-example:hover,
.scenario-tab:not(.active):hover {
  background: var(--hover-bg);
  opacity: 1;
}
/* Pressed feedback (Patrick, 2026-07-14): a click previously looked identical to a hover,
   so nothing confirmed the press registered. Scale-down on :active is the standard subtle
   cue, applied to every button-like element in one place. The transition makes the
   release visible too, not just the press. */
button, a.button-link {
  transition: transform 80ms ease;
}
button:active, a.button-link:active {
  transform: scale(0.96);
  opacity: 0.85;
}
/* Touch devices only (not a width breakpoint) -- desktop's compact padding stays as-is,
   since a mouse doesn't need the ~44px minimum comfortable tap target a finger does. */
@media (pointer: coarse) {
  button, .fill-example { min-height: 44px; }
}
.card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 14px;
}
.card-delayed {
  border-left: 4px solid var(--warning-text);
}
.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}
.card-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.card-sub {
  font-size: 14px;
  color: var(--text);
  margin: 6px 0 0;
}
.card-sub.struck {
  text-decoration: line-through;
  color: var(--muted);
}

/* ---- Saved-trips list rows (density pass, PROJECT_LOG 2026-07-14) -- a plain divided
   row instead of a bordered .card per trip, with the three actions collapsed into
   lightweight text-link buttons instead of three separate bordered buttons. Matters once
   someone has several saved trips, not just one. ---- */
.trip-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 2px;
  border-bottom: 1px solid var(--border);
}
.trip-row:last-child {
  border-bottom: none;
}
.trip-row-title {
  font-size: 14px;
  font-weight: 500;
  margin: 0;
}
.trip-row-sub {
  font-size: 12px;
  color: var(--muted);
  margin: 2px 0 0;
}
.trip-row-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.trip-row-actions[hidden] { display: none; }
.trip-row-actions button {
  border: none;
  background: none;
  padding: 0;
  font-size: 13px;
  color: var(--accent);
  cursor: pointer;
}
.trip-row-actions button:hover {
  text-decoration: underline;
}
.trip-row-actions button.trip-row-danger {
  color: var(--danger-text);
}
@media (pointer: coarse) {
  .trip-row-actions button { min-height: 44px; }
}
.pill {
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 999px;
  white-space: nowrap;
}
.pill-success { background: var(--success-bg); color: var(--success-text); }
.pill-warning { background: var(--warning-bg); color: var(--warning-text); }
.pill-danger { background: var(--danger-bg); color: var(--danger-text); }
.pill-muted { background: var(--bg); color: var(--muted); border: 1px solid var(--border); }
/* Marks a personal result as the user's OWN trip, as distinct from a sample scenario --
   the accent color ties it to the app's brand/action color rather than any status meaning. */
.pill-accent { background: var(--accent-bg); color: var(--accent); }
/* A neutral, non-alarming informational strip -- deliberately NOT warning/danger colored,
   since "this is sample data" is orientation, not a risk signal. Used both on the page itself
   (demo/test) and prefixed onto a result, so the label travels with the data it describes. */
.mode-banner {
  font-size: 12px;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  margin: 0 0 8px;
}
/* Unlike .mode-banner above, this one IS warning-colored on purpose: "your trips aren't being
   watched" is a real risk signal about a broken promise, not orientation. Shown only when the
   alert credit balance is provably exhausted (see httpServer's alertsCurrentlyPaused). */
.alerts-paused {
  font-size: 13px;
  color: var(--warning-text);
  background: var(--warning-bg);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 0 0 12px;
}
.own-trip-tag {
  display: inline-block;
  margin-bottom: 10px;
}
.journey-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}
.journey-transfer {
  margin: -6px 0 14px 18px;
  padding: 6px 0 4px 16px;
  border-left: 3px solid var(--border);
  font-size: 14px;
  color: var(--text);
}
.journey-transfer-ok { border-left-color: var(--success-text); }
.journey-transfer-tight { border-left-color: var(--warning-text); }
.journey-transfer-at_risk, .journey-transfer-broken { border-left-color: var(--danger-text); }
.journey-transfer-label {
  font-size: 12px;
  font-weight: 600;
  margin: 0 0 2px;
  text-transform: capitalize;
}
.data-tag {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 0;
}
.connection {
  margin: -6px 0 14px 18px;
  padding: 6px 0 4px 16px;
  border-left: 3px solid var(--warning-text);
}
/* Any connection the engine has judged unmakeable (delay-broken or cancelled) is a
   confirmed loss -- red, not a hedged amber (F1 severity fix; was .connection-cancelled,
   which only covered the cancellation case and left delay-broken connections amber). */
.connection-broken {
  border-left-color: var(--danger-text);
}
.connection-broken > .connection-label {
  color: var(--danger-text);
}

/* ---- Verdict band (F1): the interpretation layer's one-sentence answer, always the
   first content of a result. The ONLY loud element on a result screen (§9 Rule 3). ---- */
.verdict-band {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  border-radius: 12px;
  border-left: 4px solid;
  padding: 12px 14px;
  margin-bottom: 10px;
}
.verdict-band .status-icon {
  margin-top: 2px;
  flex-shrink: 0;
}
.verdict-text {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}
.verdict-reason {
  font-size: 14px;
  margin: 4px 0 0;
}
/* Labeled story structure (2026-07-14, Patrick): WHAT HAPPENED / WHAT IT MEANS / YOUR
   NEXT STEP. Labels are 12px captions inheriting the band's own color (never grey inside
   a colored band); the bold line stays "what it means" -- one loud line per band. */
.verdict-label {
  font-size: 12px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 10px 0 1px;
}
.verdict-label:first-child { margin-top: 0; }
.verdict-line {
  font-size: 14px;
  margin: 0;
}
.verdict-broken { background: var(--danger-bg); color: var(--danger-text); border-left-color: var(--danger-text); }
/* Color doctrine (2026-07-20, PROJECT_LOG same date): color = CURRENT status only;
   history (a superseded fact) gets strikethrough, never color. Two consequences below.
   1) The "green exit door": when the next step is a genuine rescue (severity broken +
   a real recommendation), it gets its own small success-colored room inside the red
   band -- the band walks red -> green, same arc the landing hero teaches, instead of
   dressing the rescue in alarm color. Non-rescue next steps (an apology, an amber
   warning, an already-green "nothing to do") stay plain -- painting those green would
   be a false-relief claim. */
.verdict-step-panel {
  background: var(--success-bg);
  color: var(--success-text);
  border-left: 3px solid var(--success-text);
  border-radius: 8px;
  padding: 8px 11px;
  margin-top: 10px;
}
.verdict-step-panel .verdict-label { margin-top: 0; }
/* 2) The "scar": a missed/superseded time stays visible for context (never silently
   vanishes) but never wears status color -- plain strikethrough only. Used by the
   route strip at a healed break (the old, missed departure) and the final arrival
   (the old, now-moot arrival), both replaced by the recommendation's real time. */
.scar {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  opacity: 0.7;
  margin-right: 4px;
}
.verdict-attention { background: var(--warning-bg); color: var(--warning-text); border-left-color: var(--warning-text); }
.verdict-ok { background: var(--success-bg); color: var(--success-text); border-left-color: var(--success-text); }
/* The one primary button on a result screen -- lives inside the verdict band, directly
   under the sentence that names it. Full-width so it's easy to hit one-handed (§14). */
.verdict-action {
  display: block;
  margin-top: 10px;
  background: var(--accent);
  color: #fff;
  text-align: center;
  text-decoration: none;
  border-radius: 8px;
  padding: 9px 16px;
  font-size: 14px;
  font-weight: 500;
}
.verdict-action:hover { opacity: 0.9; }

/* ---- Mini route strip (F2, UX_SPEC.md §9 Rule 5) ---- */
.route-strip {
  margin: 0 0 8px;
  padding: 4px 2px 0;
}
.mini-track {
  position: relative;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  /* Top margin holds headroom for the mode icons riding above the segments. */
  margin: 32px 5px 10px;
}
/* Mode icons (mockup approved 2026-07-14): silhouette above the segment midpoint, colored
   by the segment's own status (mode = shape, status = color). Decorative -- the mode is
   always also named in the Details leg cards, so hiding these loses nothing. */
.mini-icon {
  position: absolute;
  top: -26px;
  transform: translateX(-50%);
  line-height: 1;
}
.mini-icon svg {
  width: 17px;
  height: 17px;
  display: block;
}
.mini-icon-cancel {
  position: absolute;
  top: -7px;
  right: -9px;
  font-size: 10px;
  font-weight: 700;
  color: var(--danger-text);
  background: var(--bg);
  border-radius: 50%;
  line-height: 1;
  padding: 1px 2px;
}
/* 5+ legs never render icons (shared.js), so the track keeps its original headroom. */
.route-strip-noicons .mini-track { margin-top: 18px; }
@media (max-width: 480px) {
  .mini-icon svg { width: 15px; height: 15px; }
  .mini-icon { top: -24px; }
  /* 4 legs on a phone squeezes segments under ~45px -- icons hide, color still carries
     status. 5+ legs never render icons at all (handled in shared.js). */
  .route-strip-dense .mini-icon { display: none; }
  .route-strip-dense .mini-track { margin-top: 18px; }
}
.mini-seg {
  position: absolute;
  top: 0;
  height: 4px;
  border-radius: 2px;
}
/* Transfer gap (mockup-approved 2026-07-16): the short stretch between two legs is the
   transfer itself -- dashed, so it reads as "time on the ground" against the solid legs.
   Colored by the transfer's state: green = evaluated and holding, red = the confirmed
   break, neutral = not evaluated / nothing to claim (same honesty rules as the legs). */
.mini-gap {
  position: absolute;
  top: 0;
  height: 4px;
  border-top: 2px dashed var(--muted);
  background: transparent;
}
.mini-gap-ok { border-top-color: var(--success-text); }
.mini-gap-broken { border-top-color: var(--danger-text); background: var(--danger-bg); }
.mini-node {
  position: absolute;
  top: -4.5px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  transform: translateX(-50%);
  /* White ring lifts the stop off the track line -- reads as a punched-out node. */
  border: 2px solid #fff;
  border: 2px solid var(--bg);
}
.mini-node-break {
  box-shadow: 0 0 0 4px rgba(121, 31, 31, 0.15);
}
.mini-node-break::after {
  content: "";
  position: absolute;
  inset: -6px;
  border-radius: 50%;
  border: 1px solid var(--danger-text);
  animation: mini-node-pulse 1.8s ease-out infinite;
}
@keyframes mini-node-pulse {
  0% { transform: scale(0.8); opacity: 0.9; }
  100% { transform: scale(2.1); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .mini-node-break::after { animation: none; }
}
/* Departure-board labels: dark, not grey (Patrick 2026-07-13) -- station name above,
   time below and bolder, since the time is the key piece of information. */
.mini-labels {
  display: flex;
  justify-content: space-between;
  font-family: var(--mono);
}
.mini-label {
  display: flex;
  flex-direction: column;
  gap: 1px;
  align-items: center;
}
.mini-label:first-child { align-items: flex-start; }
.mini-label:last-child { align-items: flex-end; }
.mini-stop {
  font-size: 12px;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}
.mini-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}
/* The change window under a transfer label ("1 h to change"). Hidden on the same dense
   strips that already drop icons -- with 4+ legs the label row has no room for a third
   line, and the gap's color still carries the state. */
.mini-change {
  font-size: 11px;
  white-space: nowrap;
}
.mini-change-ok { color: var(--success-text); }
.mini-change-broken { color: var(--danger-text); }
.mini-change-neutral { color: var(--muted); }
.route-strip-noicons .mini-change { display: none; }
@media (max-width: 480px) {
  .route-strip-dense .mini-change { display: none; }
}

/* ---- Fork strip (T3, 2026-07-20) -- the logo's own drawing at product scale, for
   exactly the shape it was designed for: a single break with a real recovery, two legs
   (routeStripHtml() falls back to the compact strip above for every other shape). Fixed
   480x92 viewBox, same principle as the mark itself: the coordinate system is fixed,
   the CSS scales it, not the leg count. Dead branch rises up to the amber X (orientation
   matches the mark); the way out drops below and carries on. */
/* padding-top reserves a clean row for .fork-deadlabel above the SVG (Patrick caught it
   live, 2026-07-20: the label's own text height ran into the dashed curve/X below it --
   the SVG's X sits only ~10px down from its own top at real container widths, shorter
   than the label's ~14-16px line box). Absolute children measure `top` from the padding
   edge, so this pushes the SVG (a normal-flow child) down while the label stays put --
   the label gets its own space instead of overlapping the curve it's labeling. */
.fork-strip { position: relative; margin: 6px 0 4px; padding-top: 8px; }
.fork-svg { width: 100%; height: auto; display: block; }
/* Positioned to sit near the X regardless of container width -- the X's x-coordinate
   (~280 of 480) is a fixed fraction of the fixed viewBox, so a fixed percentage tracks it. */
.fork-deadlabel { position: absolute; left: 58%; top: 0; font-family: var(--mono); font-size: 11px; font-weight: 600; white-space: nowrap; }
.fork-labels { display: flex; justify-content: space-between; font-family: var(--mono); margin-top: 2px; }
.fork-strip .delta-line { font-size: 12px; color: var(--warning-text); margin: 6px 0 0; font-family: var(--mono); font-weight: 600; }

/* ---- Recommendation chip (density pass, PROJECT_LOG 2026-07-14) -- the recommended
   alternative's own line/times/transfer-count, always visible below the route strip
   instead of hidden inside Details alongside the other, non-recommended options. ---- */
.recommendation-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 8px;
}
.recommendation-chip-time {
  font-family: var(--mono);
  font-weight: 600;
}

/* ---- Collapsed Details on a result screen (F2) -- everything the verdict + strip
   already summarized: full leg cards, the struck original plan, every alternative. ---- */
.result-details {
  margin-top: 4px;
}
.result-details > summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
  padding: 4px 0;
}
.result-details-body {
  margin-top: 10px;
}
.connection-label {
  display: flex;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--warning-text);
  margin: 0;
}
.connection p {
  font-size: 14px;
  color: var(--text);
  margin: 6px 0 8px;
}
.connection p.connection-original {
  font-size: 12px;
  color: var(--muted);
  text-decoration: line-through;
  margin: 6px 0 8px;
}
.connection p.connection-route {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  margin: 0 0 8px;
}
.trip-overview {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 12px;
}
.connection-solution {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--border);
}
.connection-solution .connection-label {
  color: var(--success-text);
}
.alt {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: var(--mono);
  margin-bottom: 6px;
}
.alt:last-child { margin-bottom: 0; }
.alt-link {
  color: var(--accent);
  white-space: nowrap;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}
.delta {
  font-size: 14px;
  font-weight: 500;
  margin-top: 8px;
}
.delta.worse { color: var(--danger-text); }
.delta.better { color: var(--success-text); }
.error-box {
  background: var(--danger-bg);
  color: var(--danger-text);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 14px;
}
.empty {
  color: var(--text);
  font-size: 14px;
}
.auth-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
input[type="email"], input[type="password"] {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}
.leg-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  width: 100%;
}
.leg-fields {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
.leg-fields[hidden] { display: none; }
.typeahead { position: relative; }
.typeahead-list {
  position: absolute;
  z-index: 10;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-top: 2px;
  max-height: 200px;
  overflow-y: auto;
  list-style: none;
  padding: 4px 0;
}
.typeahead-list[hidden] { display: none; }
.typeahead-list li { padding: 6px 10px; font-size: 14px; cursor: pointer; display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
/* --hover-bg, not --bg: #fcfcfd on a #fff dropdown was the same invisible-hover bug the
   white buttons had. */
.typeahead-list li[aria-selected="true"], .typeahead-list li:hover { background: var(--hover-bg); }
/* Which national feed a suggestion comes from -- the same station name can exist in both
   the DB and SNCF feeds, and a From/To pair split across the two can't be searched. */
.typeahead-system {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.typeahead input.confirmed { border-color: var(--accent); }

/* ---- /app hash-state sections + back link (UX_SPEC.md §6) ---- */
.back-link {
  display: inline-block;
  font-size: 14px;
  color: var(--accent);
  text-decoration: none;
  margin-bottom: 12px;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}
.app-view[hidden] { display: none; }

/* ---- "Preview a disruption" disclosure inside the journey view (UX_SPEC.md §6d) ---- */
.preview-disruption {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.preview-disruption summary {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  cursor: pointer;
}
.preview-disruption-body {
  margin-top: 10px;
}
.preview-disruption-body p {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}
/* Quiet by design (F4): this renders ABOVE renderJourney()'s verdict band, so a filled
   amber box here would be a second loud element on the same screen (§9 Rule 3) -- a
   plain caption instead. */
.preview-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
}

/* ---- Tester welcome block (/test only, UX_SPEC.md §5 / TESTER_SCENARIOS.md) ---- */
.tester-welcome {
  background: var(--accent-bg);
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 20px;
}
.tester-welcome-title {
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 8px;
}
.tester-welcome-body {
  font-size: 14px;
  color: var(--text);
  margin: 0;
}

/* ---- Palette switcher (temporary experiment tool, PROJECT_LOG 2026-07-13) ----
   Bottom-LEFT deliberately: /test's persistent "Give feedback" button owns bottom-right.
   Hidden unless enabled via ?palette (see shared.js initPaletteTools) so testers who get
   a plain /test link never see it. Delete this whole block when the experiment ends. */
.palette-tools-button {
  position: fixed;
  bottom: 16px;
  left: 16px;
  z-index: 40;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}
.palette-tools-panel {
  position: fixed;
  bottom: 64px;
  left: 16px;
  z-index: 40;
  width: 230px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}
.palette-tools-panel[hidden] { display: none; }
.palette-tools-title {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 8px;
}
.palette-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: 14px;
  padding: 7px 10px;
  margin-bottom: 6px;
  text-align: left;
}
.palette-option.selected {
  border-color: var(--accent);
  background: var(--accent-bg);
}
.palette-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(0, 0, 0, 0.15);
  flex-shrink: 0;
}
.palette-tools-hide {
  font-size: 12px;
  color: var(--muted);
  background: none;
  border: none;
  padding: 4px 0 0;
  cursor: pointer;
  text-decoration: underline;
}
