/* Platform 47 — prototype styling.
   Tokens mirror Platform47/Design/DesignTokens.swift and Typography.swift.
   If you change a value here, change it there too, or the SwiftUI build and
   this prototype will drift apart and neither will be the reference. */

/* Fonts are self-hosted (OFL; licences beside the files). The app is used on
   trains with patchy signal, so its type must not depend on a third-party CDN,
   and embedding Google Fonts sends every visitor's IP to Google. */
@font-face {
  font-family: "Atkinson Hyperlegible Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/static/atkinson-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Mono"; font-style: normal; font-weight: 400 600; font-display: swap;
  src: url("/static/atkinson-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/atkinson-next-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Atkinson Hyperlegible Next"; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url("/static/atkinson-next-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Jaro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/jaro-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Jaro"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/jaro-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* Colour: design/tokens.json, Dusk theme. tokens_test checks they match. */
  --indigo: #200832;
  --plum: #451e44;
  --vermilion: #c64733;
  --lavender: #9595c0;
  --sand: #f0daa2;
  --teal: #55b3bd;
  --sky: #63cee1;
  --lime: #c3db67;
  --marigold: #f7b230;
  --mint: #96dac7;
  --white: #ffffff;
  --ember: #e8843d;
  --ground: #12061d;
  --surface: #200832;
  --surface-raised: #2d1242;
  --line: #3b1d52;
  --ink: #ffffff;
  --ink-muted: #a9a9d2;
  --ink-faint: #8c88b8;
  --accent: #f7b230;
  --accent-text: #f7b230;
  --on-accent: #200832;
  --accent-soft: #f7b23024;
  --accent-line: #f7b23066;
  --status-ontime: #96dac7;
  --status-late: #e8843d;
  --status-severe: #f2735c;
  --status-live: #63cee1;
  --signal: #c64733;
  --on-signal: #ffffff;
  --arrived: #c3db67;
  --on-arrived: #200832;
  --glass: #2d1242b8;
  --glass-line: #ffffff24;
  --focus-ring: #f7b230;

  /* Type */
  --font-display: "Jaro", "Arial Narrow", system-ui, sans-serif;
  --font-sans: "Atkinson Hyperlegible Next", -apple-system, "Segoe UI", system-ui, sans-serif;
  --font-mono: "Atkinson Hyperlegible Mono", ui-monospace, "SF Mono", Menlo, monospace;

  /* Spacing — 8pt grid */
  --oh-ms: 22s;   /* the open-in-app hint's life; app.js sets the real value (OPEN_HINT_MS) */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 12px;
  --space-lg: 16px;
  --space-xl: 20px;
  --space-xxl: 24px;
  --space-xxxl: 32px;
  --space-section: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 10px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-xxl: 24px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-float: 0 12px 32px rgba(8, 2, 16, 0.6);

  /* Motion (P47Motion) */
  --spring: cubic-bezier(0.34, 1.26, 0.64, 1);
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);
  --dur-micro: 150ms;
  --dur-standard: 250ms;

  /* Layout: scrolling content keeps clear of the floating dock. */
  --dock-clearance: 104px;

  /* Live sky: where the moon's shadow disc sits. The app sets it from the phase. */
  --moon-cut: 20%;

  /* Intro headline: each word's place in the line, for its entrance delay.
     The app sets it per word. */
  --i: 0;

  /* The Dusk gradient: five palette stops, sky at the top, sun at the bottom.
     One per screen at most. */
  --gradient-dusk: linear-gradient(180deg, var(--indigo) 0%, var(--plum) 34%,
                   var(--vermilion) 62%, var(--marigold) 84%, var(--sand) 100%);

  color-scheme: dark;
  /* glyph masks for the ICONS section below */
  --gl: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'/%3E");
  --gl-gap: 4px;
  --gl-check: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7'/%3E%3C/svg%3E");
  --gl-clock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3 2'/%3E%3C/svg%3E");
  --gl-alert: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 16H3z'/%3E%3Cpath d='M12 10v4M12 17v.01'/%3E%3C/svg%3E");
  --gl-dot: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3.5' fill='black'/%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3C/svg%3E");
  --gl-ellipsis: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h.01M12 12h.01M19 12h.01' stroke-width='3.5'/%3E%3C/svg%3E");
  --gl-sparkle: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v5M12 16v5M3 12h5M16 12h5M6.5 6.5l2.5 2.5M15 15l2.5 2.5M17.5 6.5L15 9M9 15l-2.5 2.5'/%3E%3C/svg%3E");
  --gl-dep: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17L17 7M9 7h8v8'/%3E%3C/svg%3E");
  --gl-arr: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 7l10 10M17 9v8H9'/%3E%3C/svg%3E");
  --gl-pin: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 21s7-6 7-11a7 7 0 0 0-14 0c0 5 7 11 7 11z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
  --gl-ticket: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2v2a2 2 0 0 0 0 4v2a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-2a2 2 0 0 0 0-4z'/%3E%3Cpath d='M14 6v2M14 11v2M14 16v2'/%3E%3C/svg%3E");
  --gl-train: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='3' width='14' height='14' rx='3'/%3E%3Cpath d='M5 11h14M9 21l-2-4M15 21l2-4'/%3E%3C/svg%3E");
  --gl-star: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3l2.7 5.6 6.1.9-4.4 4.3 1 6.1L12 17l-5.4 2.9 1-6.1L3.2 9.5l6.1-.9z'/%3E%3C/svg%3E");
  --gl-swap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 20V4M7 4L4 7M7 4l3 3M17 4v16M17 20l-3-3M17 20l3-3'/%3E%3C/svg%3E");
  --gl-trash: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M10 7V4h4v3M6 7l1 13h10l1-13M10 11v6M14 11v6'/%3E%3C/svg%3E");
  --gl-user: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21c0-4 4-6 8-6s8 2 8 6'/%3E%3C/svg%3E");
  --gl-users: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='9' cy='8' r='3.5'/%3E%3Cpath d='M2 20c0-3.5 3-5.5 7-5.5s7 2 7 5.5M16 4.8a3.5 3.5 0 0 1 0 6.4M18 14.8c2.5.7 4 2.3 4 5.2'/%3E%3C/svg%3E");
  --gl-share: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='18' cy='5' r='3'/%3E%3Ccircle cx='6' cy='12' r='3'/%3E%3Ccircle cx='18' cy='19' r='3'/%3E%3Cpath d='M8.6 13.5l6.8 4M15.4 6.5l-6.8 4'/%3E%3C/svg%3E");
  --gl-bell: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 16v-5a6 6 0 0 1 12 0v5l2 2H4z'/%3E%3Cpath d='M10 21h4'/%3E%3C/svg%3E");
  --gl-cloud: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 18a4.5 4.5 0 0 1-.5-9A6 6 0 0 1 18 10a4 4 0 0 1-.5 8z'/%3E%3C/svg%3E");
  --gl-download: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4v11M7 11l5 5 5-5M5 20h14'/%3E%3C/svg%3E");
  --gl-chat: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 5h16v11H9l-5 4z'/%3E%3C/svg%3E");
  --gl-speaker: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 9h4l5-4v14l-5-4H4z'/%3E%3Cpath d='M16.5 8.5a5 5 0 0 1 0 7M19 6a8.5 8.5 0 0 1 0 12'/%3E%3C/svg%3E");
  --gl-eye: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s4-7 10-7 10 7 10 7-4 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
  --gl-tube: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='8.5'/%3E%3Cpath d='M2 10.5h20v3H2z'/%3E%3C/svg%3E");
  --gl-walk: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='13' cy='4.5' r='1.8'/%3E%3Cpath d='M12 8l-3 4 3 3v6M12 8l3 3 3 1M9 12l-2 4'/%3E%3C/svg%3E");
  --gl-bus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='3' width='16' height='15' rx='3'/%3E%3Cpath d='M4 11h16M7 21v-3M17 21v-3M8 15h.01M16 15h.01'/%3E%3C/svg%3E");
  --gl-taxi: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 16v-4l2-5h10l2 5v4zM3 16h18M7 19v-3M17 19v-3'/%3E%3C/svg%3E");
  --gl-route: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='6' cy='18' r='2.5'/%3E%3Ccircle cx='18' cy='6' r='2.5'/%3E%3Cpath d='M8.5 18H15a3 3 0 0 0 0-6H9a3 3 0 0 1 0-6h6.5'/%3E%3C/svg%3E");
  --gl-hourglass: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 3h10M7 21h10M8 3v3l4 6-4 6v3M16 3v3l-4 6 4 6v3'/%3E%3C/svg%3E");
  --gl-lock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
  --gl-unlock: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='9' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 7.5-2'/%3E%3C/svg%3E");
  --gl-refresh: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 11a8 8 0 0 0-14-4M4 4v4h4M4 13a8 8 0 0 0 14 4M20 20v-4h-4'/%3E%3C/svg%3E");
  --gl-help: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.7.4-1 .9-1 1.7M12 17v.01'/%3E%3C/svg%3E");
  --gl-eyeoff: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18M10.6 6.2A9 9 0 0 1 12 6c6 0 10 6 10 6a17 17 0 0 1-3 3.6M6.6 7.6A17 17 0 0 0 2 12s4 7 10 7a9 9 0 0 0 4-1'/%3E%3C/svg%3E");
  --gl-coach: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='7' width='18' height='9' rx='2.5'/%3E%3Cpath d='M3 12h18M7 19h.01M17 19h.01'/%3E%3C/svg%3E");
  --gl-calendar: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='5' width='16' height='15' rx='3'/%3E%3Cpath d='M4 10h16M8 3v4M16 3v4'/%3E%3C/svg%3E");
  --gl-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M10 14a4 4 0 0 0 5.7 0l3-3a4 4 0 0 0-5.7-5.7l-1 1M14 10a4 4 0 0 0-5.7 0l-3 3a4 4 0 0 0 5.7 5.7l1-1'/%3E%3C/svg%3E");
  --gl-pound: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M14.5 8.5A3 3 0 0 0 9.5 10v2.5H14M9.5 12.5V15c0 1-.7 1.7-1.7 2h8'/%3E%3C/svg%3E");
  --gl-size: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* The UA rule for [hidden] is display:none, but any later `display:` on a
   class beats it on specificity — which silently showed the platform-change
   banner on every journey. Make hidden mean hidden. */
[hidden] { display: none !important; }

html {
  -webkit-tap-highlight-color: transparent;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior: none;
}

button, a, [role="button"] {
  touch-action: manipulation;
}

button, [role="button"], .chip, .dock-tab, .dock-add, .glass-btn, .day, .leg-btn, .sheet-grip {
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  /* Jaro has one weight; never let the browser fake a bold or italic. */
  font-synthesis: none;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
  display: flex;
  justify-content: center;
  min-height: 100vh;
  min-height: 100dvh;
}

/* --- app column -------------------------------------------------------
   A phone-shaped app on any screen, but never a picture of a phone: on a
   wide screen it's a full-height column in the middle of the page. */

.phone {
  width: 430px;
  max-width: 100%;
  background: var(--ground);
  padding: var(--space-lg) 0 0;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


/* --- route header ------------------------------------------------------ */

.route-header { padding: 0 var(--space-xxl) var(--space-lg); }
.route-line { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-sm); }
.route-name { font-size: 22px; font-weight: 700; letter-spacing: -0.2px; }
.route-sub { font-size: 12px; color: var(--ink-muted); margin-top: var(--space-xs); }

.station-btn {
  background: none; border: 1px solid var(--line);
  color: var(--ink-muted);
  font: inherit; font-size: 11px;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  cursor: pointer;
  min-height: 28px;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.station-btn:active { transform: scale(0.97); }
@media (hover: hover) and (pointer: fine) {
  .station-btn:hover { color: var(--accent); border-color: var(--accent-line); }
}

/* --- labels ------------------------------------------------------------ */

.data-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-muted);
}

/* --- badge and platform number (now in the trip hero) ------------------ */

.badge {
  display: inline-block;
  font-size: 10px; font-weight: 800; letter-spacing: 1.5px;
  padding: var(--space-xs) var(--space-md);
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: var(--on-accent);
}
.badge.unconfirmed {
  background: none;
  color: var(--ink-muted);
  border: 1px solid var(--ink-muted);
}
.badge.awaiting { background: none; color: var(--ink-faint); border: 1px solid var(--ink-faint); }
.badge.likely { background: none; color: var(--accent-text); border: 1px dashed var(--accent-line); }

.platform-hero {
  font-family: var(--font-display);
  font-size: 128px; font-weight: 400; line-height: 0.85;
  color: var(--accent-text);
  font-variant-numeric: tabular-nums;
  transition: color var(--dur-standard) var(--ease-out);
}
.platform-hero.unconfirmed { font-size: 100px; color: var(--ink); }
.platform-hero.awaiting {
  font-size: 40px; color: var(--ink-faint);
  animation: pulse 1.2s ease-in-out infinite alternate;
}
@keyframes pulse { from { opacity: 1; } to { opacity: 0.45; } }

/* --- boards ------------------------------------------------------------ */

.board { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding-bottom: var(--space-lg); }

.section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--ink-muted);
  padding: var(--space-xl) var(--space-xxl) var(--space-sm);
  display: flex; flex-direction: column; gap: 2px;
}
.section-hint {
  font-size: 10px; font-weight: 400; letter-spacing: 0.2px;
  text-transform: none; color: var(--ink-faint);
}

.dep-list, .arr-list { list-style: none; }

.dep-row, .arr-row {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: var(--space-md);
  align-items: center;
  padding: var(--space-md) var(--space-xxl);
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}
.dep-row { cursor: pointer; transition: background var(--dur-micro) var(--ease-out); }
.dep-row:focus-visible, .dep-row:active { background: var(--surface); outline: none; }
@media (hover: hover) and (pointer: fine) {
  .dep-row:hover { background: var(--surface); }
}

.row-time { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.row-time.late { color: var(--status-late); }
.row-time.cancelled { color: var(--status-severe); text-decoration: line-through; }

.row-dest { font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row-sub { font-size: 11px; color: var(--ink-faint); margin-top: 1px; }

.row-plat {
  font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums;
  min-width: 34px; text-align: right;
}
.row-plat.confirmed { color: var(--accent); }
.row-plat.planned { color: var(--ink-muted); }
.row-plat.none { color: var(--ink-faint); font-weight: 400; }

.arr-row .row-plat.confirmed { color: var(--status-ontime); }

/* --- footer ------------------------------------------------------------ */

.foot {
  display: flex; justify-content: space-between;
  padding: var(--space-md) var(--space-xxl) var(--space-xxl);
  font-size: 11px; color: var(--ink-faint);
  border-top: 1px solid var(--line);
}

/* --- attribution (RTT terms: clearly visible credit on public use) ------ */

.credit {
  padding: 0 var(--space-xxl) var(--space-xl);
  font-size: 12px;
  color: var(--ink-muted);
  text-align: center;
}
.credit a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.attribution { color: var(--ink-faint); font-size: 11px; }

/* Reduced motion means gentler, not zero: drop movement, blur, and infinite
   loops, while keeping short opacity/colour transitions that aid comprehension. */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
  }
  .oh-timer { animation-duration: var(--oh-ms, 22s) !important; }
  .sheet-panel, .toast, .open-hint {
    transition: opacity 180ms ease !important;
  }
  .rl-train.moving::after, .cp.next .cp-dot, .platform-hero.awaiting, .oh-step, .pr-train {
    animation: none !important;
  }
  .intro-copy.enter .w, .intro-copy.enter .intro-kicker,
  .intro-copy.enter .intro-sub, .intro-copy.enter .install-steps,
  .hero .platform-hero.drop {
    animation: fade-only 180ms ease both !important;
  }
}
@keyframes fade-only { from { opacity: 0; } to { opacity: 1; } }

/* --- platform change: the hero moment ---------------------------------- */

.platform-change {
  margin: var(--space-md) var(--space-lg) 0;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--signal);
  border: 1px solid var(--signal);
  display: flex; flex-direction: column; gap: 2px; align-items: center;
  animation: flash 900ms ease-out 3;
}
@keyframes flash { 0%,100% { opacity: 1 } 50% { opacity: 0.55 } }
.change-label { font-size: 10px; font-weight: 700; letter-spacing: 1.5px; }

/* --- delay repay strip -------------------------------------------------- */

/* Whether you'll make the next train, under the trip's title. */
.connect-note {
  margin: var(--space-md) var(--space-xxl) 0;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 13px; line-height: 1.4; color: var(--ink-muted);
}
.connect-note.ok { border: 1px solid var(--status-ontime); color: var(--status-ontime); }
.connect-note.tight { border: 1px solid var(--status-late); color: var(--status-late); font-weight: 600; }
.connect-note.missed { border: 1px solid var(--status-severe); color: var(--status-severe); font-weight: 600; }
.add-step { margin: var(--space-md) var(--space-xxl) 0; min-height: 44px; }
.connect-field .field-input { max-width: 8rem; }
.connect-field .field-hint { min-height: 0; margin-top: var(--space-sm); }
.connect-field .field-label { margin-top: var(--space-sm); }
.connect-field legend.field-label { margin-top: 0; }

.repay-strip {
  margin: var(--space-md) var(--space-xxl) 0;
  padding: var(--space-md);
  border-radius: var(--radius-md);
  background: var(--surface);
  font-size: 12px; color: var(--ink-muted);
  text-align: center;
}
.repay-strip.eligible {
  background: color-mix(in srgb, var(--status-ontime) 14%, transparent);
  border: 1px solid var(--status-ontime);
  color: var(--status-ontime);
  font-weight: 600;
}

/* --- alerts ------------------------------------------------------------- */

.alerts {
  margin: 0 var(--space-xxl); padding: var(--space-lg);
  border-radius: var(--radius-xl); background: var(--surface); border: 1px solid var(--line);
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.alerts + .alerts { margin-top: var(--space-md); }
.alerts-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md); }
.alerts-title { font-size: 15px; font-weight: 700; }
.alerts-state { font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: var(--ink-faint); }
.alerts.on .alerts-state { color: var(--status-ontime); }
.alerts.blocked .alerts-state { color: var(--status-severe); }
.alerts-text { font-size: 13px; line-height: 1.45; color: var(--ink-muted); }
.alerts-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.alerts-actions:not(:has(button:not([hidden]))) { display: none; }
.alerts-actions .cta { padding: var(--space-sm) var(--space-xl); }
.alerts-actions .text-btn { min-height: 44px; }
.alerts-actions .text-btn:first-child { margin-left: calc(-1 * var(--space-sm)); }   /* text lines up with the copy */

/* Tips: the app explaining itself (the first-trip guide, the coach tip, the
   alerts offer). One family, tinted lavender, so a tip never reads as a card
   of trip data, a picked chip (marigold tint) or a status. */
.guide, .coach-tip, .nudge {
  background: color-mix(in srgb, var(--lavender) 16%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--lavender) 42%, transparent);
}

/* The trip's one-time offer of alerts: small, and gone once answered. */
.nudge {
  margin: var(--space-md) var(--space-md) 0; padding: var(--space-sm) var(--space-sm) var(--space-sm) var(--space-lg);
  border-radius: var(--radius-lg);
  display: flex; align-items: center; gap: var(--space-sm);
}
.nudge-text { flex: 1; font-size: 13px; line-height: 1.4; color: var(--ink-muted); }
.nudge .cta.secondary.inline { padding: var(--space-sm) var(--space-lg); min-height: 40px; font-size: 14px; }
.dismiss-btn {
  width: 44px; height: 44px; flex: none; display: grid; place-items: center;
  background: none; border: none; color: var(--ink-faint); cursor: pointer; border-radius: var(--radius-pill);
  transition: color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.dismiss-btn:active { transform: scale(0.95); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .dismiss-btn:hover { color: var(--ink); }
}
.dismiss-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.version { display: block; margin-bottom: var(--space-xs); }

/* A card with more than one line: the words get the width, the actions a row below. */
.stacked-nudge {
  flex-direction: column; align-items: stretch;
  padding: var(--space-lg); gap: var(--space-md);
}
.nudge-actions { display: flex; gap: var(--space-sm); align-items: center; }
.nudge-actions .cta { flex: 1; }
.nudge-actions .text-btn { min-height: 44px; }   /* a thumb's reach, like every action */
/* The nudge's compact buttons are 40px; in a card with room, they get the full reach too. */
.stacked-nudge .cta.secondary.inline { min-height: 44px; }

/* Live Trip Sharing (#23) */
.share-card-head {
  display: flex; justify-content: space-between; align-items: center;
}
.share-code-box {
  background: var(--surface); border-radius: var(--radius-md);
  padding: var(--space-md); text-align: center; border: 1px solid var(--line);
}
.share-code-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.5px;
  text-transform: uppercase; color: var(--ink-faint); display: block;
  margin-bottom: var(--space-xs);
}
.share-code-display {
  font-family: var(--font-mono); font-size: 28px; font-weight: 700;
  letter-spacing: 4px; color: var(--accent-text); margin: 0;
}

.following-banner { border-color: var(--accent-line); }

.friend-track-form { display: flex; gap: var(--space-sm); margin-top: var(--space-sm); }
.friend-code-input {
  font-family: var(--font-mono); letter-spacing: 2px;
  text-transform: uppercase; text-align: center; font-size: 16px; font-weight: 700;
}
/* The example reads as words ("e.g."), not in the code's capitals. */
.friend-code-input::placeholder { text-transform: none; letter-spacing: normal; font-weight: 400; }
.profile-field { margin-top: var(--space-sm); }

/* --- calling points (the journey spine) --------------------------------- */

.calling-points { list-style: none; padding: 0 var(--space-xxl) var(--space-lg); }

.cp {
  display: grid;
  grid-template-columns: 18px 1fr auto auto;
  gap: var(--space-md);
  align-items: baseline;
  padding: var(--space-sm) 0;
  position: relative;
}
/* the line joining the dots */
.cp::before {
  content: ""; position: absolute;
  left: 8px; top: 0; bottom: 0; width: 2px;
  background: var(--line);
}
.cp:first-child::before { top: 50%; }
.cp:last-child::before { bottom: 50%; }

.cp-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--ink-faint);
  position: relative; z-index: 1;
  margin-left: 3px;
  box-shadow: 0 0 0 3px var(--ground);
}
.cp.passed .cp-dot { background: var(--ink-muted); }
.cp.next .cp-dot {
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--ground), 0 0 12px var(--accent);
}

.cp-name { font-size: 14px; color: var(--ink-muted); }
.cp.passed .cp-name { color: var(--ink-faint); }
.cp.next .cp-name { color: var(--ink); font-weight: 600; }

.cp-plat {
  font-size: 11px; color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.cp-plat.confirmed { color: var(--accent); }

.cp-time {
  font-size: 14px; font-variant-numeric: tabular-nums;
  color: var(--ink-muted); min-width: 46px; text-align: right;
}
.cp-time.actual { color: var(--ink); font-weight: 600; }
.cp-time.late { color: var(--status-late); }
.cp-time.cancelled { color: var(--status-severe); text-decoration: line-through; }

/* --- wide screens get a hairline edge; a phone gets the whole screen --- */

@media (min-width: 701px) {
  .phone { border-inline: 1px solid var(--line); }
}
@media (max-width: 700px) {
  body { display: block; }
  .phone {
    width: 100%;
    padding-top: env(safe-area-inset-top, 12px);
  }
}

/* === ONBOARDING ========================================================
   ASO principle applied to product: screenshot 1 states the main benefit,
   and there are ~3 seconds before attention goes. So: no splash, no logo,
   no menu. The intro (below) is three scenes of the real trip hero, each
   one benefit, then this: one question, then the value. */

.view { display: flex; flex-direction: column; flex: 1; min-height: 0; }

.onboarding { padding: var(--space-xxl); gap: var(--space-xl); justify-content: flex-start; }
.ob-head { margin-top: var(--space-xl); }
.ob-title { font-size: 30px; font-weight: 800; line-height: 1.12; letter-spacing: -0.6px; text-wrap: balance; }
.ob-sub {
  font-size: 15px; color: var(--ink-muted);
  margin-top: var(--space-md); line-height: 1.45;
}

.ob-fields { display: flex; flex-direction: column; gap: var(--space-sm); position: relative; }

.field { position: relative; display: flex; flex-direction: column; gap: var(--space-xs); }
.field-label {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: var(--ink-muted);
}
.field-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid transparent;
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font: inherit; font-size: 17px;
  color: var(--ink);
  min-height: 52px;              /* comfortable thumb target */
  transition: border-color var(--dur-micro) var(--ease-out);
}
.field-input::placeholder { color: var(--ink-faint); }
.field-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);   /* a 2px edge in all, not a colour change alone */
}
.field-input[aria-invalid="true"] { border-color: var(--status-severe); }
/* On a card (surface), a field takes the raised surface and the secondary
   control's edge, or it reads as bare placeholder text until tapped. */
.alerts .field-input, .sheet-panel .field-input { background: var(--surface-raised); }
/* Its resting edge only: focus and the error state keep theirs. */
.alerts .field-input:not(:focus):not([aria-invalid="true"]),
.sheet-panel .field-input:not(:focus):not([aria-invalid="true"]) {
  border-color: color-mix(in srgb, var(--lavender) 40%, transparent);
}
.field-input[aria-invalid="true"]:focus { box-shadow: 0 0 0 2px var(--status-severe); }

/* A button, so it looks like one: the secondary button's raised fill and
   edge, ink not muted, and a touch target worth the name. */
.swap-btn {
  align-self: flex-end;
  background: var(--surface-raised);
  border: 1px solid color-mix(in srgb, var(--lavender) 40%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-line);
  color: var(--ink);
  border-radius: 50%;
  width: 44px; height: 44px;
  font-size: 17px; cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
  margin: calc(var(--space-sm) * -1) var(--space-md);
  z-index: 2;
}
@media (hover: hover) and (pointer: fine) {
  .swap-btn:hover { color: var(--accent); border-color: var(--accent-line); }
}
.swap-btn:active { transform: rotate(180deg) scale(0.94); }

.suggestions {
  list-style: none;
  position: absolute; top: 100%; left: 0; right: 0; z-index: 5;
  margin-top: var(--space-xs);
  background: var(--surface-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-float);
}
.suggestion {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-md);
  padding: var(--space-md) var(--space-lg);
  font-size: 15px; cursor: pointer;
  min-height: 44px;
  border-bottom: 1px solid var(--line);
}
.suggestion:last-child { border-bottom: none; }
.suggestion:focus-visible, .suggestion:active {
  background: var(--accent-soft); outline: none;
}
@media (hover: hover) and (pointer: fine) {
  .suggestion:hover { background: var(--accent-soft); }
}
.suggestion-crs {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  color: var(--ink-faint);
}

.cta {
  background: var(--accent);
  color: var(--on-accent);
  border: none; border-radius: var(--radius-lg);
  padding: var(--space-lg);
  font: inherit; font-size: 16px; font-weight: 700;
  min-height: 52px; cursor: pointer;
  transition: opacity var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out);
}
.cta:active:not(:disabled) { transform: scale(0.97); }
.cta:disabled { opacity: 0.3; cursor: not-allowed; }
/* The second action: a raised, filled button in the ink of the page. An
   outline in marigold read as a badge or a chip, not as something to press. */
.cta.secondary {
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--lavender) 40%, transparent);
  box-shadow: inset 0 1px 0 var(--glass-line);
  margin: var(--space-lg) var(--space-xxl) var(--space-xxl);
}
/* On a tip's tinted surface the raised fill would read sunken: lift it above the tip. */
.guide .cta.secondary, .nudge .cta.secondary { background: color-mix(in srgb, var(--lavender) 30%, var(--surface)); border-color: color-mix(in srgb, var(--lavender) 60%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .cta.secondary:hover { border-color: var(--accent-line); color: var(--accent-text); }
  .guide .cta.secondary:hover, .nudge .cta.secondary:hover { border-color: var(--accent-line); }
}
.ob-note { font-size: 13px; color: var(--ink-muted); text-align: center; min-height: 18px; }
.ob-note.is-error { color: var(--status-severe); }

.text-btn {
  background: none; border: none;
  color: var(--ink-muted);
  font: inherit; font-size: 14px;
  cursor: pointer; padding: var(--space-sm);
  transition: color var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}
.text-btn:active:not(:disabled) { opacity: 0.7; }
@media (hover: hover) and (pointer: fine) {
  .text-btn:hover:not(:disabled) { color: var(--accent); }
}
.text-btn.back { align-self: flex-start; }

/* === PICKER ============================================================ */

.pick-head { padding: var(--space-lg) var(--space-xxl) var(--space-sm); }
.pick-title { font-size: 22px; font-weight: 700; margin-top: var(--space-sm); letter-spacing: -0.3px; }
.pick-sub { font-size: 13px; color: var(--ink-muted); margin-top: var(--space-xs); }
.earlier-btn { margin: var(--space-md) var(--space-md) 0; }
.via-field { margin: var(--space-md) var(--space-md) 0; }

.service-list, .saved-list { list-style: none; overflow-y: auto; overscroll-behavior: contain; flex: 1; }

.service-row {
  display: grid; grid-template-columns: 52px 1fr auto;
  gap: var(--space-md); align-items: center;
  padding: var(--space-lg) var(--space-xxl);
  min-height: 56px; cursor: pointer;
  border-bottom: 1px solid var(--line);
  transition: background var(--dur-micro) var(--ease-out);
}
.change-row { grid-template-columns: 1fr; }   /* one column of text: a train row's time and platform aren't here */
.change-row .row-dest { white-space: normal; }
.service-row:focus-visible, .service-row:active { background: var(--surface); outline: none; }
@media (hover: hover) and (pointer: fine) {
  .service-row:hover { background: var(--surface); }
}

/* the user's own boarding/alighting stops stand out from intermediate ones */
.cp.mine .cp-name { color: var(--ink); font-weight: 600; }
.cp.mine .cp-dot { box-shadow: 0 0 0 3px var(--ground), 0 0 0 5px var(--accent-line); }

/* === SAVED JOURNEYS ==================================================== */

.saved-row {
  display: flex; align-items: center; gap: var(--space-md);
  border-bottom: 1px solid var(--line);
}
.saved-row.active { background: var(--accent-soft); }
.saved-main {
  flex: 1; text-align: left;
  background: none; border: none; color: var(--ink);
  font: inherit; font-size: 16px; cursor: pointer;
  padding: var(--space-lg) var(--space-xxl);
  display: flex; flex-direction: column; gap: 2px;
  min-height: 56px;
}
.saved-del {
  background: none; border: none; color: var(--ink-faint);
  font-size: 16px; cursor: pointer; padding: var(--space-lg);
  min-width: 44px; min-height: 44px;
  transition: color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.saved-del:active { transform: scale(0.94); color: var(--status-severe); }
@media (hover: hover) and (pointer: fine) {
  .saved-del:hover { color: var(--status-severe); }
}

/* === DATE / TIME / RETURN ============================================== */

.when { display: flex; flex-direction: column; gap: var(--space-sm); }

/* One field for the day and the time; it opens the when sheet. */
.when-btn {
  display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-md);
  text-align: left; cursor: pointer;
  padding: var(--space-md) var(--space-lg); min-height: 52px;
  transition: border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.when-btn:active { transform: scale(0.99); }
.when-btn:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
.when-day { font-size: 17px; }
.when-time {
  font-family: var(--font-display); font-size: 26px; line-height: 1; font-weight: 400;
  font-variant-numeric: tabular-nums; color: var(--accent-text);
}

/* --- when sheet: a strip of days and two time wheels -------------------- */

.sheet { position: absolute; inset: 0; z-index: 30; display: flex; flex-direction: column; justify-content: flex-end; }
@media (max-width: 700px) { .sheet { position: fixed; } }
.sheet-scrim {
  position: absolute; inset: 0;
  background: color-mix(in srgb, var(--ground) 72%, transparent);
  opacity: 1;
  transition: opacity 220ms var(--ease-out);
}
@starting-style {
  .sheet-scrim { opacity: 0; }
}
.sheet-panel {
  position: relative;
  background: var(--surface);
  border-top: 1px solid var(--line);
  border-radius: var(--radius-xxl) var(--radius-xxl) 0 0;
  padding: var(--space-sm) var(--space-xxl) calc(var(--space-xxl) + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: var(--space-lg);
  box-shadow: var(--shadow-float);
  transform: translateY(0);
  transition: transform 320ms var(--ease-drawer);
}
@starting-style {
  .sheet-panel { transform: translateY(100%); }
}
.sheet-grip {
  width: 36px; height: 4px; border-radius: 2px; background: var(--line);
  margin: 0 auto var(--space-xs); position: relative; touch-action: pan-x; cursor: grab;
}
.sheet-grip::before {
  content: ""; position: absolute; inset: -16px -48px;
}
/* The grip and title are the drag handles (wireSheetDrag): vertical touches there go to the page, not the browser's pan. */
.sheet-title { touch-action: none; font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-muted); }

.day-strip {
  display: flex; gap: var(--space-sm); overflow-x: auto;
  margin: 0 calc(var(--space-xxl) * -1); padding: 2px var(--space-xxl);
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.day-strip::-webkit-scrollbar { display: none; }
.day {
  flex: none; width: 52px; min-height: 64px; scroll-snap-align: center;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  font: inherit; cursor: pointer;
  transition: background var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.day:active:not(:disabled) { transform: scale(0.96); }
.day-dow { font-size: 10px; font-weight: 700; letter-spacing: 1px; color: var(--ink-muted); }
.day-num { font-family: var(--font-display); font-size: 24px; line-height: 1; font-weight: 400; }
/* Picked, like a chip: tinted, never the primary button's solid marigold. */
.day.active { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-text); }
.day.active .day-dow { color: var(--accent-text); }
/* Days gone: for adding a journey already made. */
.day.past:not(.active) { background: none; border-style: dashed; border-color: var(--ink-faint); }
.day:disabled { opacity: 0.3; cursor: not-allowed; }
.day:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

/* Two wheels: five rows showing, the middle one is the value. */
.wheels {
  position: relative; display: flex; justify-content: center; align-items: center; gap: var(--space-sm);
  height: 200px;
}
.wheel-band {
  position: absolute; left: 0; right: 0; top: 80px; height: 40px;
  border-radius: var(--radius-lg); background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  pointer-events: none;
}
.wheel {
  position: relative; width: 84px; height: 200px; overflow-y: auto;
  padding: 80px 0; box-sizing: border-box;
  scroll-snap-type: y mandatory; scrollbar-width: none; overscroll-behavior: contain;
  -webkit-mask: linear-gradient(transparent, var(--indigo) 30%, var(--indigo) 70%, transparent);
          mask: linear-gradient(transparent, var(--indigo) 30%, var(--indigo) 70%, transparent);
}
.wheel::-webkit-scrollbar { display: none; }
.wheel:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; border-radius: var(--radius-lg); }
.wheel-row {
  height: 40px; display: grid; place-items: center; scroll-snap-align: center;
  font-family: var(--font-display); font-size: 30px; line-height: 1; font-weight: 400;
  font-variant-numeric: tabular-nums; color: var(--ink-muted); cursor: pointer;
}
.wheel-row[aria-selected="true"] { color: var(--accent-text); }
.wheel-colon { font-family: var(--font-display); font-size: 30px; color: var(--ink-muted); position: relative; }
.sheet-actions { display: flex; align-items: center; gap: var(--space-md); }
.sheet-actions .cta { flex: 1; }

.chips { display: flex; gap: var(--space-sm); flex-wrap: wrap; }
.chip {
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--ink-muted);
  border-radius: 999px;
  padding: var(--space-xs) var(--space-md);
  font: inherit; font-size: 13px;
  min-height: 32px; cursor: pointer;
  transition: color var(--dur-micro) var(--ease-out), border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .chip:hover { color: var(--accent); border-color: var(--accent-line); }
}
.chip:not(.ruled-out):active { transform: scale(0.96); }
/* Picked, not pressed: a tinted chip with a tick. Solid marigold is the
   primary button's, so a choice never reads as an action. */
.chip.active {
  color: var(--accent-text); background: var(--accent-soft);
  border-color: var(--accent); font-weight: 700;
}
/* The tick is decoration: the radio already says "checked" (empty alt text). */
.chip.active::before { content: "✓"; content: "✓" / ""; margin-right: var(--space-xs); font-weight: 800; }

.toggle {
  display: flex; align-items: center; gap: var(--space-md);
  cursor: pointer; min-height: 44px;
}
.toggle input { position: absolute; opacity: 0; width: 0; height: 0; }
.toggle-track {
  width: 46px; height: 28px; border-radius: 999px;
  background: var(--surface-raised);
  border: 1px solid var(--line);
  position: relative; transition: background var(--dur-standard) var(--ease-out);
  flex: none;
}
.toggle-knob {
  position: absolute; top: 3px; left: 3px;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink-muted);
  transition: transform var(--dur-standard) var(--spring), background var(--dur-standard) var(--ease-out);
}
.toggle input:checked + .toggle-track { background: var(--accent-soft); border-color: var(--accent); }
.toggle input:checked + .toggle-track .toggle-knob {
  transform: translateX(18px); background: var(--accent);
}
.toggle input:focus-visible + .toggle-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.toggle-label { font-size: 15px; color: var(--ink); }

/* === LEG INDICATORS ==================================================== */

.leg-chip {
  display: inline-block;
  font-size: 10px; font-weight: 700; letter-spacing: 1.5px;
  padding: 3px var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--accent); color: var(--on-accent);
}

.leg-switch {
  display: flex; gap: var(--space-xs);
  margin: 0 var(--space-xxl) var(--space-sm);
  background: var(--surface);
  border-radius: var(--radius-md);
  padding: 3px;
}
.leg-btn {
  flex: 1; background: none; border: none;
  color: var(--ink-muted);
  font: inherit; font-size: 13px; font-weight: 600;
  padding: var(--space-sm); border-radius: var(--radius-sm);
  cursor: pointer; min-height: 36px;
  transition: background var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.leg-btn:active:not(:disabled) { transform: scale(0.97); }
.leg-btn.active { background: var(--surface-raised); color: var(--accent); }
.leg-btn:disabled { opacity: 0.35; cursor: not-allowed; }

/* === APP SHELL: views scroll, tab bar stays ============================ */

.phone { height: 100vh; height: 100dvh; min-height: 0; }
.view { overflow-y: auto; overscroll-behavior: contain; }
.onboarding { padding-bottom: var(--space-xxxl); }
.credit { padding: var(--space-lg) var(--space-xxl) 0; font-size: 11px; color: var(--ink-faint); text-align: center; }
.credit a { color: var(--ink-muted); }

.toast {
  position: absolute; left: 50%; bottom: 100px;
  transform: translateX(-50%) translateY(0) scale(1);
  opacity: 1;
  transition: opacity 220ms var(--ease-out), transform 220ms var(--ease-out);
  background: var(--surface-raised); color: var(--ink);
  border: 1px solid var(--line);
  padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-lg);
  font-size: 13px; z-index: 20;
  width: max-content; max-width: calc(100% - 2 * var(--space-lg)); text-align: center;
  box-shadow: var(--shadow-float);
}
@starting-style {
  .toast {
    opacity: 0;
    transform: translateX(-50%) translateY(10px) scale(0.97);
  }
}

/* === TRIP: one scroll, hero card first ================================== */

.trip { overflow: hidden; }
.trip-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-bottom: var(--dock-clearance); }
.trip-scroll .foot { border-top: none; padding-bottom: var(--space-sm); }

/* === TICKET ============================================================ */

/* Asked once, in onboarding: chips that behave as radio buttons. */
.ticket-field { border: none; padding: 0; margin: 0; min-width: 0; }
.ticket-field legend { padding: 0; margin-bottom: var(--space-xs); }
.chip input { position: absolute; opacity: 0; width: 0; height: 0; }
label.chip { display: inline-flex; align-items: center; }
.chip:has(input:focus-visible) { outline: 2px solid var(--focus-ring); outline-offset: 2px; }
/* Ruled out by the time asked for (static/peak.js): there, but not pickable. */
.chip.ruled-out { color: var(--ink-faint); border-style: dashed; border-color: var(--ink-faint); text-decoration: line-through; cursor: not-allowed; }
@media (hover: hover) and (pointer: fine) {
  .chip.ruled-out:hover { color: var(--ink-faint); border-color: var(--ink-faint); }
}
.field-hint { font-size: 13px; line-height: 1.45; color: var(--ink-muted); min-height: 38px; }
.past-hint { min-height: 0; margin-top: var(--space-sm); color: var(--ink); }
/* The longest ticket rules run to three lines on a phone; keep that room so
   the return chips under the outbound's hint don't move as it changes. */
.ticket-field .field-hint { min-height: calc(3 * 1.45em); }

/* The hero's change-train button: quiet glass, marigold when the train is cancelled. */
.glass-btn.urgent { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.cta.secondary.inline { margin: 0; min-height: 44px; padding: var(--space-md); font-size: 15px; }

/* === ARRIVAL =========================================================== */

.arrival {
  margin: var(--space-xs) var(--space-xxl) 0;
  display: flex; flex-direction: column; gap: var(--space-md);
}
.badge.arrived { align-self: flex-start; background: var(--arrived); color: var(--on-arrived); }
.badge.disrupted { align-self: flex-start; background: var(--status-severe); color: var(--on-arrived); }
.arrival-lede { font-size: 21px; font-weight: 700; line-height: 27px; letter-spacing: -0.2px; text-wrap: balance; }
.gotoff { display: flex; flex-direction: column; gap: var(--space-xs); }
.gotoff-label { font-size: 13px; color: var(--ink-muted); font-weight: 600; }
.arrival-stats {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--space-sm);
  background: var(--surface); border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
}
.arrival-stats > div { display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); }
.arrival-stats .data-label { font-size: 11px; }
.arrival-num { font-family: var(--font-display); font-size: 34px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.arrival-stats > div:first-child .arrival-num { color: var(--accent-text); }

.arrival-verdict {
  border-radius: var(--radius-lg);
  padding: var(--space-md) var(--space-lg);
  display: flex; flex-direction: column; gap: 2px;
  font-size: 13px; line-height: 1.45; color: var(--ink-muted);
  background: var(--surface);
}
.arrival-verdict strong { font-size: 15px; color: var(--ink); }
.arrival-verdict.good { background: color-mix(in srgb, var(--status-ontime) 12%, transparent); }
.arrival-verdict.good strong { color: var(--status-ontime); }
.arrival-verdict.claim { background: var(--accent-soft); border: 1px solid var(--accent-line); }
.arrival-verdict.claim strong { color: var(--accent); }

.arrival-count { font-size: 14px; color: var(--ink); }
.arrival-share-note { font-size: 12px; color: var(--ink-faint); text-align: center; margin-top: calc(var(--space-sm) * -1); }

/* === PICKER additions ================================================== */

.pick-note {
  font-size: 12px; line-height: 1.45; color: var(--ink-muted);
  margin-top: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border-left: 2px solid var(--accent-line);
}
.service-row.current { background: var(--accent-soft); }
/* A train the leg's ticket isn't valid on (peak, for an Off-Peak): still tappable, but quieter. */
.service-row.ruled-out .row-time, .service-row.ruled-out .row-dest { color: var(--ink-muted); }

/* === TABS: Trips + Logbook ============================================= */

.tab-view { overflow: hidden; }
.tab-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: var(--space-sm) var(--space-xxl) var(--space-md);
  flex: none;
}
.tab-title { font-family: var(--font-display); font-size: 40px; font-weight: 400; line-height: 1; letter-spacing: 0.5px; text-transform: uppercase; }
.tab-scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; min-height: 0; padding-bottom: var(--dock-clearance); }
.trip-list { list-style: none; padding: 0 var(--space-lg); display: flex; flex-direction: column; gap: var(--space-sm); }
.trip-row {
  display: flex; align-items: stretch;
  background: var(--surface); border-radius: var(--radius-xl);
  overflow: hidden;
}
.trip-main {
  flex: 1; min-width: 0; text-align: left;
  background: none; border: none; color: var(--ink);
  font: inherit; cursor: pointer;
  padding: var(--space-lg);
  display: flex; flex-direction: column; gap: var(--space-xs);
  transition: background var(--dur-micro) var(--ease-out);
}
.trip-main:active { background: var(--surface-raised); }
@media (hover: hover) and (pointer: fine) {
  .trip-main:hover { background: var(--surface-raised); }
}
/* The row clips its overflow, so the focus rings sit inside, rounded with
   the row's corners: the trip on the left, ✕ on the right, or the whole row. */
.trip-main:focus-visible { outline-offset: -2px; border-radius: var(--radius-xl) 0 0 var(--radius-xl); }
.trip-main:only-child:focus-visible { border-radius: var(--radius-xl); }
.saved-del:focus-visible { outline-offset: -2px; border-radius: 0 var(--radius-xl) var(--radius-xl) 0; }
.trip-row-title { font-size: 16px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trip-leg {
  display: flex; justify-content: space-between; align-items: center; gap: var(--space-sm);
  font-size: 12px; color: var(--ink-muted); font-variant-numeric: tabular-nums;
}
.pill {
  font-size: 11px; font-weight: 700; white-space: nowrap;
  padding: 2px var(--space-sm); border-radius: 999px;
  color: var(--ink-muted); background: var(--surface-raised);
}
.pill:empty { display: none; }
.pill.good { color: var(--status-ontime); background: color-mix(in srgb, var(--status-ontime) 14%, transparent); }
.pill.warn { color: var(--status-late); background: color-mix(in srgb, var(--status-late) 14%, transparent); }
.pill.bad { color: var(--status-severe); background: color-mix(in srgb, var(--status-severe) 14%, transparent); }
.pill.live { color: var(--indigo); background: var(--sky); }
.pill.soon { color: var(--accent); background: var(--accent-soft); }
.list-empty { font-size: 14px; color: var(--ink-muted); padding: var(--space-md) var(--space-sm); }

.log-empty { font-size: 15px; line-height: 1.5; color: var(--ink-muted); padding: var(--space-sm) var(--space-xxl); }
.stat-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-sm);
  padding: 0 var(--space-lg);
}
.stat {
  background: var(--surface); border-radius: var(--radius-xl);
  padding: var(--space-lg);
  display: flex; flex-direction: column; gap: 2px;
}
.stat-value { font-family: var(--font-display); font-size: 40px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; }
.stat .data-label { font-size: 11px; }
.stat-sub { font-size: 11px; color: var(--ink-faint); }


.rank-list { list-style: none; padding: 0 var(--space-xxl); }
.rank-row {
  display: grid; grid-template-columns: 1fr auto; gap: var(--space-xs) var(--space-md);
  padding: var(--space-sm) 0; font-size: 14px;
}
.rank-count { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--ink-muted); }
.rank-bar { grid-column: 1 / -1; height: 3px; border-radius: 2px; background: var(--accent-line); }


/* === DESIGN SYSTEM: focus, illustration, passport ====================== */

:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.change-label { color: var(--on-signal); }
.change-detail { color: var(--on-signal); font-weight: 600; }

/* Illustrations are flat SVG in palette colours; they sit in a panel with
   the xxl radius and never carry text. */
.illo { display: block; width: 100%; height: auto; }
.illo-panel { border-radius: var(--radius-xxl); overflow: hidden; background: var(--surface); }
.ob-illo { margin: calc(var(--space-sm) * -1) calc(var(--space-sm) * -1) 0; }
/* The first screens' scene (makeStage): the trip hero's live sky and moving
   land, in the illustration panel. The sky fills the same box as the land,
   so the sun meets the hills where it does in the hero. */
.ob-stage { position: relative; isolation: isolate; aspect-ratio: 390 / 200; background: var(--indigo); }
.ob-stage .hero-sky { inset: 0; height: auto; z-index: 0; }
.ob-stage .hero-land { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.arrival-illo { margin-bottom: calc(var(--space-xs) * -1); position: relative; }
.arrival-illo .badge.arrived { position: absolute; left: var(--space-lg); top: var(--space-lg); }
.log-empty-illo { margin: var(--space-sm) var(--space-lg) 0; }
.list-empty-illo { margin: 0 0 var(--space-md); }

/* The Logbook's one bold moment: the Dusk gradient as a passport card. */
.passport {
  margin: 0 var(--space-lg) var(--space-sm);
  padding: var(--space-xl);
  border-radius: var(--radius-xxl);
  /* Warm stops pulled earlier than the page gradient so the figures, which
     sit in the lower half, always land on vermilion-to-sand (indigo 4.5:1+). */
  background: linear-gradient(180deg, var(--indigo) 0%, var(--plum) 24%,
              var(--vermilion) 46%, var(--marigold) 72%, var(--sand) 100%);
  color: var(--indigo);
  display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-md) var(--space-lg);
  position: relative; overflow: hidden;
  min-height: 208px;
}
.passport-kicker {
  grid-column: 1 / -1;
  font-family: var(--font-mono); font-size: 12px; letter-spacing: 0.5px;
  color: var(--sand);
}
.passport-fig { display: flex; flex-direction: column; gap: var(--space-xs); align-self: end; }
.passport-num {
  font-family: var(--font-display); font-size: 56px; font-weight: 400; line-height: 0.9;
  font-variant-numeric: tabular-nums; color: var(--indigo);
}
.passport-label {
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: var(--indigo);
}
.passport-sun {
  position: absolute; right: -28px; top: -28px; width: 120px; height: 120px;
  border-radius: 50%; background: var(--marigold); opacity: 0.9;
  box-shadow: 0 0 0 18px color-mix(in srgb, var(--marigold) 25%, transparent);
}
.passport > :not(.passport-sun) { position: relative; }

/* A flex column with a fixed height shrinks its children to fit; the
   onboarding illustration was being crushed to a sliver. Nothing in the form
   should shrink — the view scrolls instead. */
.onboarding > * { flex-shrink: 0; }

/* Figures never break across lines ("176 / mi"). */
.arrival-num, .stat-value, .passport-num { white-space: nowrap; }

/* === TRIP HERO ==========================================================
   One card holds what you glance at. The illustration fills the top, a
   scrim takes it to indigo underneath, and every word sits on the scrim or
   the dark sky, never on the bright horizon. Text in here is white and sand
   in both themes: the scene is dusk either way. */

.hero {
  position: relative; isolation: isolate; overflow: hidden;
  margin: var(--space-sm) var(--space-md) 0;
  padding: var(--space-md) var(--space-lg) var(--space-sm);
  border-radius: var(--radius-xxl);
  background: var(--indigo);
  color: var(--white);
  display: flex; flex-direction: column;
  min-height: 392px;
}
.hero-art {
  position: absolute; left: 0; right: 0; top: 0; z-index: -2;
  width: 100%; height: 232px; object-fit: cover; object-position: 50% 100%;
}
.hero-scrim {
  position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--indigo) 40%, transparent) 0,
    transparent 64px,
    transparent 150px,
    color-mix(in srgb, var(--indigo) 88%, transparent) 212px,
    var(--indigo) 240px);
}

.hero-top { display: flex; align-items: center; gap: var(--space-sm); min-height: 36px; }
.hero-date {
  flex: 1; min-width: 0;
  font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.5px;
  color: var(--sand); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hero .pill:empty { display: none; }

.glass-btn {
  width: 36px; height: 36px; flex: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: var(--white);
  transition: transform var(--dur-micro) var(--ease-out);
}
.glass-btn:active { transform: scale(0.95); }
.glass-btn svg, .dock-tab svg, .dock-add svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}

.hero-body { margin-top: var(--space-sm); max-width: 92%; }
.hero-title {
  font-size: 21px; line-height: 26px; font-weight: 700; letter-spacing: -0.2px;
  text-wrap: balance; text-shadow: 0 1px 12px color-mix(in srgb, var(--indigo) 70%, transparent);
}
.hero-meta {
  font-size: 13px; color: var(--sand); margin-top: 2px;
  text-shadow: 0 1px 8px color-mix(in srgb, var(--indigo) 80%, transparent);
}

.hero-main {
  margin-top: auto;
  display: flex; align-items: flex-end; justify-content: space-between; gap: var(--space-md);
}
.hero-plat { display: flex; flex-direction: column; gap: var(--space-xs); min-width: 0; }
.hero-label {
  display: flex; align-items: center; gap: var(--space-sm);
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
  color: color-mix(in srgb, var(--white) 82%, transparent);
  white-space: nowrap;
}
.hero-label span:last-child { overflow: hidden; text-overflow: ellipsis; }
.hero .platform-hero { color: var(--marigold); margin: var(--space-xs) 0 0 -4px; }
.hero .platform-hero.unconfirmed { color: var(--white); }
.hero .platform-hero.awaiting { color: var(--lavender); font-size: 64px; }
.hero .badge.unconfirmed, .hero .badge.awaiting {
  color: var(--white); background: none;
  border: 1px solid color-mix(in srgb, var(--white) 55%, transparent);
}
/* LIKELY: inferred from the train that forms yours. Marigold, but dashed:
   the brand colour says "this is your platform", the dash says "not yet official". */
.hero .badge.likely {
  color: var(--marigold); border: 1px dashed var(--marigold);
  background: color-mix(in srgb, var(--indigo) 72%, transparent);   /* it can sit over the train */
}
.hero-note { font-size: 12px; color: color-mix(in srgb, var(--white) 72%, transparent); min-height: 16px; }
.hero-times { display: flex; flex-direction: column; gap: var(--space-md); text-align: right; padding-bottom: 22px; }
.hero-times > div { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.hero-times .hero-label { justify-content: flex-end; }
.hero-fig {
  font-family: var(--font-display); font-size: 34px; line-height: 1; font-weight: 400;
  font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* --- route line: National Rail style ----------------------------------- */

.route-line { position: relative; height: 40px; margin-top: var(--space-md); }
.route-line > span { position: absolute; }
.rl-track {
  top: 9px; height: 3px; border-radius: 2px;
  background: color-mix(in srgb, var(--white) 28%, transparent);
}
.rl-stub { top: 10px; border-top: 2px dashed color-mix(in srgb, var(--white) 40%, transparent); }
.rl-done { top: 9px; height: 3px; border-radius: 2px; background: var(--marigold); }
.rl-stop {
  top: 10.5px; width: 9px; height: 9px; border-radius: 50%;
  transform: translate(-50%, -50%);
  background: var(--indigo);
  border: 2px solid color-mix(in srgb, var(--white) 75%, transparent);
  box-sizing: border-box;
}
.rl-stop.passed { background: var(--white); border-color: var(--white); }
.rl-stop.mine { width: 13px; height: 13px; border-color: var(--marigold); }
.rl-stop.mine.passed { background: var(--marigold); }
.rl-stop.next { border-color: var(--marigold); box-shadow: 0 0 0 3px color-mix(in srgb, var(--marigold) 30%, transparent); }
.rl-code {
  top: 21px; transform: translateX(-50%);
  font-family: var(--font-mono); font-size: 10px; font-weight: 500; letter-spacing: 0.5px;
  color: color-mix(in srgb, var(--white) 78%, transparent);
}
.rl-code.next { color: var(--marigold); }
.rl-layer { position: absolute; inset: 0; }
.rl-layer > span { position: absolute; }
.rl-done { transition: width 1s linear; }
.rl-train {
  top: 10.5px; width: 16px; height: 16px; border-radius: 50%; z-index: 2;
  transform: translate(-50%, -50%);
  background: var(--marigold); border: 3px solid var(--indigo);
  box-sizing: border-box;
  /* One second per render tick, linear: the dot glides at the train's pace. */
  transition: left 1s linear;
}
/* Only a moving train breathes. Waiting at the platform it holds still.
   Rendered on a pseudo-element with transform + opacity so it stays on the compositor. */
.rl-train.moving::after {
  content: ""; position: absolute; inset: -3px; border-radius: 50%;
  border: 2px solid var(--marigold); pointer-events: none;
  animation: ping 1.8s var(--ease-out) infinite;
}
.route-line.instant .rl-train, .route-line.instant .rl-done { transition: none; }
/* The moment it leaves: a burst from the dot, once. */
.route-line.departing .rl-train { animation: depart 1.6s var(--ease-out) 1; }
@keyframes depart {
  0% { transform: translate(-50%, -50%) scale(1); }
  25% { transform: translate(-50%, -50%) scale(1.5); }
  100% { transform: translate(-50%, -50%) scale(1); }
}
@keyframes ping {
  0% { transform: scale(1); opacity: 0.7; }
  100% { transform: scale(2.6); opacity: 0; }
}

.trip-scroll .leg-switch { margin-top: var(--space-md); }
/* One tab per train in a chain: each as wide as its text allows, wrapping rather than cutting the names. */
.chain-switch { flex-wrap: wrap; }
.chain-switch .leg-btn { flex: 1 1 45%; white-space: normal; line-height: 1.25; }

/* === DOCK: floating tabs and the add button ============================= */

.dock {
  position: absolute; z-index: 10;
  left: var(--space-lg); right: var(--space-lg);
  bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; justify-content: space-between;
  pointer-events: none;
}
.dock > * { pointer-events: auto; }
.dock-tabs {
  display: flex; gap: var(--space-xs); padding: 6px;
  border-radius: var(--radius-pill);
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow-float);
}
.dock-tab {
  width: 64px; height: 48px; border-radius: var(--radius-pill);
  display: grid; place-items: center; cursor: pointer;
  background: none; border: none; color: var(--ink-muted);
  transition: background var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.dock-tab:active { transform: scale(0.95); }
@media (hover: hover) and (pointer: fine) {
  .dock-tab:hover { color: var(--ink); }
}
.dock-tab.active { background: var(--accent-soft); color: var(--accent-text); }
.dock-add {
  width: 60px; height: 60px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-line);
  -webkit-backdrop-filter: blur(16px) saturate(1.3); backdrop-filter: blur(16px) saturate(1.3);
  box-shadow: var(--shadow-float);
  color: var(--accent-text);
  transition: transform var(--dur-micro) var(--ease-out);
}
.dock-add:active { transform: scale(0.94); }
.dock-add svg { width: 26px; height: 26px; stroke-width: 2; }
.dock-add.sharing { background: var(--accent-soft); border-color: var(--accent-line); }
.preview-bar .cta { flex: 1; box-shadow: var(--shadow-float); }

/* === LOGBOOK MAP: routes to their real shape, no basemap ================ */

.log-map {
  height: 340px; margin: 0 var(--space-lg) var(--space-sm);
  border-radius: var(--radius-xxl); overflow: hidden;
  background: radial-gradient(120% 90% at 50% 30%, var(--surface) 0%, var(--ground) 80%);
}
.log-map-draw { width: 100%; height: 100%; }

/* The arrival scene carries its train and canopy higher than the viaduct
   scene; drop it below the title so no word ever sits on the train. */
.hero.arrived .hero-art { top: 60px; height: 150px; }
.hero.arrived .hero-scrim {
  background: linear-gradient(180deg, transparent 0, transparent 168px,
    color-mix(in srgb, var(--indigo) 92%, transparent) 204px, var(--indigo) 216px);
}

/* Logbook map (SVG): routes on the page's ground; the HUD styles are below. */
.map-svg { width: 100%; height: 100%; display: block; }
.svg-mine { fill: none; stroke: var(--accent-text); stroke-linecap: round; stroke-linejoin: round; }

/* On a phone the dock floats over the screen itself, not the page frame:
   fixed positioning is what iOS Safari keeps above its own toolbar and the
   home indicator whatever the page height does. A deeper shadow and a
   touch more body let it read as lifted even over an empty list. */
@media (max-width: 700px) {
  .dock { position: fixed; }
  .toast { position: fixed; }
}
.dock-tabs, .dock-add {
  box-shadow: var(--shadow-float), 0 2px 0 color-mix(in srgb, var(--white) 6%, transparent) inset;
}

/* === LIVE SKY ===========================================================
   Sits in exactly the box the land image fills, so percentages line up
   with the illustration: the hills meet the sky at about 64% down. */

.hero-sky {
  position: absolute; left: 0; right: 0; top: 0; height: 232px; z-index: -3;
  overflow: hidden;
  background: linear-gradient(180deg, var(--indigo) 0%, var(--plum) 38%,
              var(--vermilion) 66%, var(--marigold) 86%, var(--sand) 100%);
}
.hero.arrived .hero-sky { top: 60px; height: 150px; }
/* After dark: the warm bands go, the horizon keeps a plum glow. */
.hero-sky.night {
  background: linear-gradient(180deg, var(--indigo) 0%, var(--indigo) 46%, var(--plum) 100%);
}
/* By day: a clear sky, palest at the horizon. The sun climbs high into it. */
.hero-sky.daytime {
  background: linear-gradient(180deg, var(--teal) 0%, var(--sky) 55%, var(--mint) 86%, var(--sand) 100%);
}
/* Between sunset and civil dusk: the warm bands sink and darken. */
.hero-sky.twilight {
  background: linear-gradient(180deg, var(--indigo) 0%, var(--plum) 52%, var(--vermilion) 100%);
}
.hero-stars {
  position: absolute; inset: 0 0 40% 0; opacity: 0.55;
  background-image:
    radial-gradient(1.4px 1.4px at 8% 11%, var(--white) 98%, transparent),
    radial-gradient(1px 1px at 22% 20%, var(--white) 98%, transparent),
    radial-gradient(1.2px 1.2px at 36% 7%, var(--white) 98%, transparent),
    radial-gradient(1px 1px at 55% 15%, var(--white) 98%, transparent),
    radial-gradient(1.4px 1.4px at 67% 6%, var(--white) 98%, transparent),
    radial-gradient(1px 1px at 85% 17%, var(--white) 98%, transparent),
    radial-gradient(1.2px 1.2px at 94% 8%, var(--white) 98%, transparent),
    radial-gradient(1px 1px at 45% 28%, var(--white) 98%, transparent);
  transition: opacity var(--dur-standard);
}
.hero-sky.daytime .hero-stars, .hero-sky.golden .hero-stars { opacity: 0; }
.hero-sky.twilight .hero-stars { opacity: 0.5; }
.hero-sky.night .hero-stars { opacity: 0.95; }

.hero-sun, .hero-moon {
  position: absolute; border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: left 1s linear, top 1s linear, opacity var(--dur-standard);
}
.hero-sun {
  width: 16%; aspect-ratio: 1; height: auto;
  background: var(--marigold);
  box-shadow: 0 0 0 12px color-mix(in srgb, var(--sand) 30%, transparent);
}
.hero-sky.arrived-sky .hero-sun { width: 18%; }
/* Tonight's moon: a sand disc with a shadow disc of the same size slid
   across it. The app sets how far (--moon-cut) from the real phase. */
.hero-moon {
  /* Placed by the app where the real moon is; shown while it's up. */
  width: 26px; height: 26px; left: 20%; top: 59%; opacity: 0;
  background: var(--sand);
  -webkit-mask: radial-gradient(circle 13px at var(--moon-cut) 50%, transparent 97%, var(--indigo) 100%);
          mask: radial-gradient(circle 13px at var(--moon-cut) 50%, transparent 97%, var(--indigo) 100%);
}
.hero-moon.up { opacity: 1; }
.hero-sky.daytime .hero-moon.up { opacity: 0.7; }

/* The viaduct scene, drawn in layers so the land can pass the train. */
.hero-land .land-far { fill: var(--lavender); }
.hero-land .land-mid { fill: var(--teal); }
.hero-land .land-near { fill: var(--plum); }
.hero-land .land-viaduct { fill: var(--indigo); }
.hero-land .land-mast { fill: var(--indigo); }
.hero-land .land-wire { opacity: 0.7; }
.hero-land .land-fore { fill: var(--lime); }
.hero-land .land-tree { fill: var(--mint); }
.hero-land .land-trunk { fill: var(--plum); }
.hero-land .train-body { fill: var(--sand); }
.hero-land .train-stripe { fill: var(--vermilion); }
.hero-land .train-win { fill: var(--indigo); transition: fill var(--dur-standard) var(--ease-out); }
.hero-land .train-lamp { fill: var(--marigold); }
/* After dark the carriages are lit. */
.hero-land.night .train-win { fill: var(--marigold); }
/* Masts are indigo against the evening sky; after dark, moonlit lavender, or they vanish into it. */
.hero-land.night .land-mast { fill: var(--lavender); }
.hero-sky.night .hero-sun { opacity: 0; }

/* Platform block: badge alone on top, the number, then which station, just
   above the route line. The badge says the state; the label says where. */
.hero-at { margin-top: var(--space-xs); font-size: 10px; }
.hero-note:empty { display: none; }
.hero-times { padding-bottom: 0; }

/* Darker under the badge row, where it crosses the viaduct and the hills. */
.hero-scrim {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--indigo) 40%, transparent) 0,
    transparent 64px,
    transparent 132px,
    color-mix(in srgb, var(--indigo) 72%, transparent) 178px,
    color-mix(in srgb, var(--indigo) 94%, transparent) 212px,
    var(--indigo) 236px);
}

/* By day the sun climbs behind the title: a deeper band keeps the words
   readable over a bright sky and a high sun. */
.hero.daylight .hero-scrim {
  background: linear-gradient(180deg,
    color-mix(in srgb, var(--indigo) 72%, transparent) 0,
    color-mix(in srgb, var(--indigo) 55%, transparent) 84px,
    transparent 124px,
    transparent 132px,
    color-mix(in srgb, var(--indigo) 72%, transparent) 178px,
    color-mix(in srgb, var(--indigo) 94%, transparent) 212px,
    var(--indigo) 236px);
}

/* A soft fade at the foot of the screen, under the floating dock. */
.dock-fade {
  position: absolute; left: 0; right: 0; bottom: 0; height: 120px; z-index: 9;
  pointer-events: none;
  background: linear-gradient(to top, var(--ground) 0%,
              color-mix(in srgb, var(--ground) 70%, transparent) 45%, transparent 100%);
}
@media (max-width: 700px) { .dock-fade { position: fixed; } }

/* Station mesh: the routes' glow. */
.svg-glow { fill: none; stroke: var(--accent-text); opacity: 0.2; stroke-linecap: round; stroke-linejoin: round; }

/* === LOGBOOK MAP AS A HUD ===============================================
   The coast in one thin line, a degree grid, the routes glowing on top,
   stations as reticles, readouts in mono. No roads, towns or terrain. */
.map-svg.hud { font-family: var(--font-mono); }
.hud-grid { stroke: var(--line); stroke-width: 1; opacity: 0.55; }
.hud-tick { fill: var(--ink-faint); font-size: 8px; letter-spacing: 0.5px; opacity: 0.8; }
.hud-coast {
  fill: color-mix(in srgb, var(--lavender) 6%, transparent);
  stroke: var(--lavender); stroke-width: 0.9; stroke-linejoin: round; opacity: 0.7;
}
.hud-pass { fill: var(--lavender); opacity: 0.8; }
.hud-ring { fill: none; stroke: var(--marigold); stroke-width: 1.2; opacity: 0.9; }
.hud-dot { fill: var(--marigold); }
.hud-label {
  fill: var(--white); font-size: 11px; font-weight: 600; letter-spacing: 0.2px;
  paint-order: stroke; stroke: var(--ground); stroke-width: 2.5px; stroke-linejoin: round;
  text-rendering: geometricPrecision;
}
.hud-frame { fill: none; stroke: var(--accent-line); stroke-width: 1.2; }
.hud-readout { fill: var(--accent-text); font-size: 9px; font-weight: 500; letter-spacing: 0.8px; }
.hud-readout.dim { fill: var(--ink-faint); }

/* The claim link inside the Delay Repay verdict: the operator's own page. */
.verdict-claim {
  margin-top: var(--space-sm); align-self: flex-start;
  font-weight: 700; font-size: 14px; color: var(--accent-text);
  text-decoration: underline; text-underline-offset: 3px;
}
.arrival-verdict.good .verdict-claim { color: var(--status-ontime); }

/* === INTRO ==============================================================
   First run: one trip in three scenes on the trip hero itself, the words
   under it, one button. The stage stays put and its scene changes, so it
   reads as one journey rather than a slideshow. */

.intro { gap: var(--space-lg); padding-bottom: calc(var(--space-xxl) + env(safe-area-inset-bottom, 0px)); }
.intro > * { flex-shrink: 0; }

.intro-top {
  display: flex; align-items: center; gap: var(--space-md);
  padding: 0 var(--space-sm);
}
.icon-btn {
  width: 44px; height: 44px; flex: none; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  background: none; border: none; color: var(--ink-muted);
  transition: color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.icon-btn:active { transform: scale(0.94); color: var(--ink); }
@media (hover: hover) and (pointer: fine) {
  .icon-btn:hover { color: var(--ink); }
}
.icon-btn svg {
  width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.intro-steps { flex: 1; display: flex; gap: 6px; }
.intro-bar {
  flex: 1; height: 3px; border-radius: var(--radius-pill);
  background: var(--line);
  transition: background var(--dur-standard);
}
.intro-bar.done, .intro-bar.on { background: var(--accent); }

/* Tall enough that every scene's badge sits under the picture: the scenes
   share one box and sit at its foot, so a taller scene (the route line, the
   Delay Repay line) pushed its badge up over the train. On short phones
   (an SE) that means a short scroll to the button, as it already did. */
.intro-stage {
  margin: 0 var(--space-md); min-height: 432px;
  touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
/* The sun low over the hills: the intro is always at dusk. */
.intro-sky .hero-sun { left: 76%; top: 58%; }
.hero.arrived .intro-sky .hero-sun { left: 70%; top: 52%; }

.intro-scenes { margin-top: auto; display: grid; }
.intro-scene {
  grid-area: 1 / 1; display: flex; flex-direction: column; justify-content: flex-end;
  opacity: 0; visibility: hidden;
  transition: opacity var(--dur-standard), visibility 0s var(--dur-standard);
}
.intro-scene.active { opacity: 1; visibility: visible; transition: opacity var(--dur-standard); }
.intro-scene .hero-main { margin-top: 0; }
.intro-scene[data-scene="platform"] .hero-main { padding-bottom: var(--space-sm); }

/* The platform drop: the number lands, and settles. */
.hero .platform-hero.drop { animation: platform-drop 700ms cubic-bezier(0.2, 0.9, 0.3, 1.2) both; }
@keyframes platform-drop {
  0% { transform: translateY(-32px) scale(1.18); opacity: 0; filter: blur(8px); }
  55% { transform: translateY(4px) scale(1); opacity: 1; filter: blur(0); }
  100% { transform: none; }
}

.intro-verdict {
  margin-top: var(--space-md); padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--marigold) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--marigold) 45%, transparent);
  color: var(--sand); font-size: 14px; font-weight: 700;
}

/* The home-screen scene: night falls, the trip steps aside, the icon is all. */
.intro-stage.home .hero-top, .intro-stage.home .hero-body { visibility: hidden; }
.intro-stage.home .intro-scenes { margin: auto 0; }
.intro-home { align-items: center; gap: var(--space-sm); padding-bottom: var(--space-xxl); }
.intro-icon {
  width: 76px; height: 76px; border-radius: 18px;
  box-shadow: var(--shadow-float);
}
.intro-icon-name { font-size: 12px; font-weight: 600; color: var(--white); }

.intro-copy { padding: 0 var(--space-xxl); display: flex; flex-direction: column; gap: var(--space-sm); }
.intro-kicker {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  padding: var(--space-xs) 10px; border-radius: var(--radius-pill);
  background: var(--accent-soft); color: var(--accent-text);
  font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase;
}
.intro-kicker::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent);
}
.intro-title { font-size: 30px; font-weight: 800; line-height: 1.12; letter-spacing: -0.6px; text-wrap: balance; }
.intro-title .w { display: inline-block; }
.intro-sub { font-size: 15px; line-height: 1.5; color: var(--ink-muted); }

/* Each step arrives: headline in a short, tapering wave (no per-word blur), then the rest. */
.intro-copy.enter .w {
  animation: word-in 280ms var(--ease-out) both;
  animation-delay: min(140ms, calc(var(--i) * 32ms));
}
.intro-copy.enter .w:nth-child(2) { animation-delay: 35ms; }
.intro-copy.enter .w:nth-child(3) { animation-delay: 62ms; }
.intro-copy.enter .w:nth-child(4) { animation-delay: 82ms; }
.intro-copy.enter .w:nth-child(5) { animation-delay: 98ms; }
.intro-copy.enter .intro-kicker { animation: rise-in 220ms var(--ease-out) both; }
.intro-copy.enter .intro-sub, .intro-copy.enter .install-steps { animation: rise-in 260ms var(--ease-out) 110ms both; }
@keyframes word-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes rise-in { from { opacity: 0; transform: translateY(6px); } }

.install-steps { list-style: none; display: flex; flex-direction: column; gap: var(--space-sm); margin-top: var(--space-xs); }
.install-steps li { display: flex; gap: var(--space-md); align-items: flex-start; font-size: 14px; line-height: 1.45; }
.install-n {
  width: 22px; height: 22px; flex: none; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-raised); color: var(--accent-text);
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
}
.share-glyph {
  width: 18px; height: 18px; vertical-align: -3px;
  fill: none; stroke: var(--accent-text); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}

.intro-actions { margin-top: auto; padding: 0 var(--space-xxl); display: flex; flex-direction: column; gap: var(--space-xs); }
.intro-actions .text-btn { min-height: 44px; }

/* Back to the intro, from the form and the Trips tab. */
.intro-link { text-decoration: underline; text-underline-offset: 3px; min-height: 44px; }
.ob-head .intro-link { padding-left: 0; margin-top: var(--space-xs); }
.tab-scroll .intro-link { display: block; margin: var(--space-lg) auto 0; }

/* Sign in: two steps, email then code, with the onboarding's look. */
.login-step { display: flex; flex-direction: column; gap: var(--space-xl); }
.login-step .ob-sub strong { color: var(--ink); font-weight: 600; overflow-wrap: anywhere; }
.login-step .text-btn { align-self: center; min-height: 44px; }
.text-btn:disabled { opacity: 0.5; cursor: default; }
#loginLinkStep #loginMessage:empty { display: none; }
.login-code { font-family: var(--font-mono); font-size: 24px; letter-spacing: 6px; }
.account-line {
  display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-xs);
  padding-top: var(--space-sm); border-top: 1px solid var(--line);
  font-size: 13px; line-height: 18px; color: var(--ink-muted);
}
.account-line span { overflow-wrap: anywhere; }
.account-line .text-btn { font-size: 13px; padding: var(--space-xs); text-decoration: underline; min-height: 44px; }

/* --- settings groups, and the + chooser ------------------------------------ */
.settings-group {
  margin: var(--space-xl) var(--space-xxl) var(--space-sm);
  font-size: 11px; font-weight: 700; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ink-muted);
}
.settings-group:first-child { margin-top: var(--space-sm); }
.settings-group + .alerts { margin-top: 0; }
.alerts-state.saved { color: var(--status-ontime); }
.choice {
  font: inherit;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left;
  min-height: 64px; padding: var(--space-md) var(--space-lg); cursor: pointer;
  border-radius: var(--radius-xl); background: var(--surface-raised); color: var(--ink);
  border: 1px solid color-mix(in srgb, var(--lavender) 40%, transparent);
  transition: border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out);
}
.choice:active { transform: scale(0.98); }
@media (hover: hover) and (pointer: fine) {
  .choice:hover { border-color: var(--accent-line); }
}
.choice-title { font-size: 16px; font-weight: 700; }
.choice-sub { font-size: 13px; line-height: 1.4; color: var(--ink-muted); }

/* === FIRST-TRIP GUIDE ===================================================
   How to read the hero, under it, on your first trip only. */

.guide {
  margin: var(--space-md) var(--space-md) 0; padding: var(--space-lg);
  border-radius: var(--radius-xl);
  display: flex; flex-direction: column; gap: var(--space-md);
}
.guide-title { font-size: 15px; font-weight: 700; color: var(--ink); display: flex; align-items: center; gap: var(--space-sm); }
/* The tip's mark: a lavender "i" in a disc. */
.guide-title::before {
  content: "i"; content: "i" / ""; flex: none; width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--font-sans); font-size: 12px; font-weight: 700;
  background: var(--lavender); color: var(--indigo);
}
.guide-list { list-style: none; display: flex; flex-direction: column; gap: var(--space-md); }
.guide-list li {
  display: grid; grid-template-columns: 104px 1fr; gap: var(--space-md); align-items: center;
  font-size: 13px; line-height: 1.4; color: var(--ink-muted);
}
.guide-list .badge { justify-self: start; }
.guide-dot {
  justify-self: start; margin-left: var(--space-md);
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--marigold); box-shadow: 0 0 0 3px var(--accent-soft);
}
.guide .cta { align-self: flex-start; padding: var(--space-sm) var(--space-xl); }

/* === COACHES ============================================================
   The coaches nearest the way out carry a marigold roof band in the hero,
   and this line under it says why. */
.hero-land .train-best { fill: var(--marigold); }
.coach-tip {
  margin: var(--space-md) var(--space-md) 0; padding: var(--space-md) var(--space-xs) var(--space-md) var(--space-lg);
  border-radius: var(--radius-md);
  display: flex; gap: var(--space-md); align-items: flex-start;
  font-size: 13px; line-height: 1.45; color: var(--ink);
}
.coach-tip-mark {
  flex: none; margin-top: 5px; width: 18px; height: 4px; border-radius: 2px; background: var(--marigold);
}
.coach-tip-board { color: var(--ink-muted); }
.coach-tip p { flex: 1; }
.coach-tip .dismiss-btn { margin: calc(-1 * var(--space-sm)) 0; color: var(--ink-muted); }

/* --- settings lists, data, feedback ----------------------------------------- */
.set-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.set-list:empty { display: none; }
.set-row {
  display: flex; align-items: center; gap: var(--space-sm); padding: var(--space-sm) 0;
  border-top: 1px solid var(--line);
}
.set-row-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.set-row-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.set-row-sub { font-size: 12px; color: var(--ink-muted); overflow-wrap: anywhere; }
.set-row-sub .code { font-family: var(--font-mono); letter-spacing: 1px; color: var(--ink); }
.set-row .text-btn { min-height: 44px; font-size: 13px; }
.set-row .text-btn + .text-btn.danger { margin-left: var(--space-sm); }
.text-btn.danger { color: var(--status-severe); }
@media (hover: hover) and (pointer: fine) {
  .text-btn.danger:hover:not(:disabled) { color: var(--status-severe); text-decoration: underline; }
}
@media (max-width: 380px) { .set-row { flex-wrap: wrap; } .set-row-main { flex-basis: 100%; } }
.feedback-text { resize: none; font-family: inherit; line-height: 1.45; }
.sheet-panel .alerts-text { margin: 0; }

/* The feedback sheet's Cancel is a full-size tap target, like the other buttons. */
#feedbackSheet .chip { min-height: 44px; padding: 0 var(--space-lg); font-size: 14px; }
/* On a short phone with the keyboard up, the sheet scrolls instead of hiding its buttons. */
#feedbackSheet .sheet-panel { max-height: 100dvh; overflow-y: auto; overscroll-behavior: contain; }
#feedbackSheet .field-hint, #trackSheet .field-hint { min-height: 0; }

/* === OPEN-IN-APP HINT: a /t/ link opened in a browser tab ================ */
.open-hint {
  position: absolute; left: var(--space-md); right: var(--space-md); bottom: 100px; z-index: 21;
  display: flex; flex-direction: column; gap: var(--space-sm);
  padding: var(--space-md) var(--space-lg); border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface-raised); border: 1px solid var(--accent-line); box-shadow: var(--shadow-float);
  opacity: 1; transform: translateY(0);
  transition: opacity 250ms var(--ease-out), transform 250ms var(--ease-out);
}
@starting-style {
  .open-hint { opacity: 0; transform: translateY(12px); }
}
.open-hint.leaving {
  opacity: 0; transform: translateY(8px);
  transition: opacity 180ms var(--ease-out), transform 180ms var(--ease-out);
}
.oh-steps { display: flex; align-items: center; justify-content: space-between; gap: var(--space-xs); font-size: 12px; color: var(--ink-muted); }
.oh-step { display: flex; flex-direction: column; align-items: center; gap: var(--space-xs); opacity: 0.45; animation: oh-step 9s infinite; }
.oh-s2 { animation-delay: 3s; }
.oh-s3 { animation-delay: 6s; }
.oh-arrow { color: var(--ink-faint); font-size: 18px; }
.oh-glyph {
  min-width: 40px; height: 40px; padding: 0 var(--space-sm); display: grid; place-items: center;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line);
  font-family: var(--font-mono); font-size: 16px; color: var(--ink);
}
.oh-app { background: var(--accent); color: var(--on-accent); font-family: var(--font-display); }
.oh-code { letter-spacing: 1px; font-size: 13px; }
.oh-text { font-size: 13px; line-height: 1.4; color: var(--ink-muted); }
.oh-actions { display: flex; align-items: center; justify-content: space-between; }
.oh-timer { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--accent); transform-origin: left; animation: oh-drain var(--oh-ms, 22s) linear forwards; }
@keyframes oh-step { 0%, 30%, 100% { opacity: 0.45; transform: none; } 5%, 25% { opacity: 1; transform: translateY(-3px) scale(1.06); } }
@keyframes oh-drain { to { transform: scaleX(0); } }

/* === PICKUP: ring me when their train is this far away =================== */
.pickup-card {
  margin: var(--space-md) var(--space-md) 0; padding: var(--space-lg); border-radius: var(--radius-lg);
  background: var(--surface-raised); border: 1px solid var(--accent-line);
  display: flex; flex-direction: column; gap: var(--space-sm);
}
.pickup-eta { font-family: var(--font-display); font-size: 56px; line-height: 1; text-transform: uppercase; color: var(--accent-text); }
.pickup-sub { font-size: 14px; color: var(--ink-muted); }
.pickup-label { font-size: 12px; text-transform: uppercase; letter-spacing: 0.5px; color: var(--ink-muted); margin-top: var(--space-sm); }
.pickup-hint { font-size: 13px; color: var(--ink-muted); min-height: 1em; }
.pickup-ring {
  position: absolute; inset: 0; z-index: 40; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: var(--space-lg); padding: var(--space-xxl); text-align: center;
  background: var(--signal); color: var(--on-signal); animation: pr-flash 0.9s steps(2) infinite;
}
.pickup-card .chip, .open-hint .cta.secondary.inline { min-height: 44px; }
.pr-train { font-size: 72px; animation: pr-shake 0.5s ease-in-out infinite; }
.pr-title { font-family: var(--font-display); font-size: 36px; line-height: 1.05; text-transform: uppercase; }
.pr-sub { font-size: 16px; }
.pickup-ring .cta { background: var(--white); color: var(--indigo); min-width: 200px; }
@keyframes pr-flash { 50% { background: color-mix(in srgb, var(--signal) 70%, var(--ground)); } }
@keyframes pr-shake { 25% { transform: translateX(-6px) rotate(-3deg); } 75% { transform: translateX(6px) rotate(3deg); } }
/* Simple view: the train's time and where it is, and little else. */
.trip.pickup-simple .progress, .trip.pickup-simple .foot, .trip.pickup-simple .credit,
.trip.pickup-simple .route-line, .trip.pickup-simple .coach-tip, .trip.pickup-simple .repay-strip,
.trip.pickup-simple .hero-times, .trip.pickup-simple #tripGuide,
.trip.pickup-simple .hero-land, .trip.pickup-simple .hero-sky, .trip.pickup-simple #followingBanner { display: none; }
.trip.pickup-simple .hero { min-height: 0; }

/* === TRIPS: the next trip, on the map ==================================== */
.next-up { margin: 0 var(--space-lg) var(--space-sm); }
.next-card {
  display: block; width: 100%; padding: 0; text-align: left; cursor: pointer; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden;
  transition: transform var(--dur-micro) var(--ease-out);
}
.next-card:active { transform: scale(0.985); }
.next-map { height: 150px; background: var(--ground); border-bottom: 1px solid var(--line); }
.next-card.no-map .next-map { display: none; }
.next-map .map-svg { width: 100%; height: 100%; display: block; }
.next-body { display: flex; align-items: center; gap: var(--space-md); padding: var(--space-md) var(--space-lg); }
.next-time { font-family: var(--font-display); font-size: 34px; line-height: 1; color: var(--accent-text); }
.next-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.next-route { font-weight: 600; font-size: 15px; }
.next-sub { font-size: 12px; color: var(--ink-muted); }

/* === PORTRAIT-ONLY LOCK ==================================================
   Android PWAs honour manifest.orientation = "portrait"; iOS Safari and
   mobile browsers ignore it. On a phone rotated sideways (landscape, short
   height, and wide enough to distinguish from a portrait phone with the
   software keyboard open), hold the screen until turned upright. Touch-first
   devices only: a short desktop window is not a rotated phone. The pickup
   ring is an alarm, so it stays above the lock. */
.portrait-lock { display: none; }
@media (orientation: landscape) and (max-height: 540px) and (min-width: 500px) and (pointer: coarse) and (hover: none) {
  body { overflow: hidden; }
  /* The ring lives inside .phone, and display:none on a parent hides every child, so hide the app
     with visibility (a child can opt back in) rather than display. */
  .phone { visibility: hidden; }
  .pickup-ring:not([hidden]) { visibility: visible; position: fixed; z-index: 200; }
  .portrait-lock {
    position: fixed; inset: 0; z-index: 100;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: var(--space-sm); text-align: center;
    padding: var(--space-xxl) calc(var(--space-xxl) + env(safe-area-inset-right, 0px))
             var(--space-xxl) calc(var(--space-xxl) + env(safe-area-inset-left, 0px));
    background: var(--ground); color: var(--ink);
  }
  .portrait-lock-icon {
    width: 48px; height: 48px; margin-bottom: var(--space-xs);
    fill: none; stroke: var(--accent); stroke-width: 2.2;
    stroke-linecap: round; stroke-linejoin: round;
  }
  .portrait-lock-title {
    font-family: var(--font-display); font-size: 30px; font-weight: 400;
    line-height: 1.05; letter-spacing: 0.3px; text-transform: uppercase;
  }
  .portrait-lock-sub {
    font-size: 14px; line-height: 1.45; color: var(--ink-muted);
  }
}

/* The leading trip is a card, not a row: its own quiet way to remove it. */
.next-remove {
  display: block; margin: var(--space-xs) var(--space-xxl) 0 auto; padding: var(--space-sm) var(--space-md);
  background: none; border: none; font: inherit; font-size: 13px; color: var(--ink-muted); cursor: pointer; min-height: 36px;
}
.next-remove:active { color: var(--status-severe); }

/* === ICONS ===============================================================
   One 24px stroke set (2px, a hair heavier than the dock's 1.8 so small glyphs hold), drawn as masks so each glyph takes the
   colour of the text beside it, in light and dark. A glyph sits next to the words,
   never in place of them: the words stay in the page for screen readers.
   Add one to anything with data-gl="name", or map a selector to a glyph below. */
.pill.good::before,
.pill.warn::before,
.pill.bad::before,
.pill.live::before,
.pill.soon::before,
.badge::before,
.badge.unconfirmed::before,
.badge.awaiting::before,
.badge.likely::before,
.badge.disrupted::before,
#shareBadge::before,
.hero-times > div:first-child > .hero-label::before,
.hero-times > div:last-child > .hero-label::before,
.hero-at:not(:empty)::before,
.arrival-stats > div:nth-child(1) .data-label::before,
.arrival-stats > div:nth-child(2) .data-label::before,
.arrival-stats > div:nth-child(3) .data-label::before,
#profileCard .alerts-title::before,
#sharesCard .alerts-title::before,
#followsCard .alerts-title::before,
#alertsCard .alerts-title::before,
#syncCard .alerts-title::before,
#dataCard .alerts-title::before,
#feedbackCard .alerts-title::before,
#followingTitle::before,
#upcomingTitle::before,
#pastTitle::before,
#stationsTitle::before,
#topRoutesTitle::before,
#operatorsTitle::before,
#friendsLogbookTitle::before,
#pickupHearBtn::before,
#pickupSimpleBtn::before,
#shareBtn::before,
#copyShareLinkBtn::before,
#exportBtn::before,
#feedbackBtn::before,
#alertsOnBtn::before,
#unfollowBtn::before,
#legOutBtn::before,
#legRetBtn::before,
.arrival-verdict.good strong::before,
.arrival-verdict.claim strong::before,
#addOwnBtn::before,
#addFriendBtn::before,
.credit::before,
#footRight:not(:empty)::before,
.next-remove::before,
#platformChange .change-label::before,
[data-gl]:not(.chip)::before {
  content: ""; display: inline-block; flex: none; vertical-align: -0.2em;
  width: var(--gl-size); height: var(--gl-size); background: currentColor;
  -webkit-mask: var(--gl) center / contain no-repeat; mask: var(--gl) center / contain no-repeat;
}
[data-gl="check"] { --gl: var(--gl-check); }
[data-gl="clock"] { --gl: var(--gl-clock); }
[data-gl="alert"] { --gl: var(--gl-alert); }
[data-gl="dot"] { --gl: var(--gl-dot); }
[data-gl="ellipsis"] { --gl: var(--gl-ellipsis); }
[data-gl="sparkle"] { --gl: var(--gl-sparkle); }
[data-gl="dep"] { --gl: var(--gl-dep); }
[data-gl="arr"] { --gl: var(--gl-arr); }
[data-gl="pin"] { --gl: var(--gl-pin); }
[data-gl="ticket"] { --gl: var(--gl-ticket); }
[data-gl="train"] { --gl: var(--gl-train); }
[data-gl="star"] { --gl: var(--gl-star); }
[data-gl="swap"] { --gl: var(--gl-swap); }
[data-gl="trash"] { --gl: var(--gl-trash); }
[data-gl="user"] { --gl: var(--gl-user); }
[data-gl="users"] { --gl: var(--gl-users); }
[data-gl="share"] { --gl: var(--gl-share); }
[data-gl="bell"] { --gl: var(--gl-bell); }
[data-gl="cloud"] { --gl: var(--gl-cloud); }
[data-gl="download"] { --gl: var(--gl-download); }
[data-gl="chat"] { --gl: var(--gl-chat); }
[data-gl="speaker"] { --gl: var(--gl-speaker); }
[data-gl="eye"] { --gl: var(--gl-eye); }
[data-gl="tube"] { --gl: var(--gl-tube); }
[data-gl="walk"] { --gl: var(--gl-walk); }
[data-gl="bus"] { --gl: var(--gl-bus); }
[data-gl="taxi"] { --gl: var(--gl-taxi); }
[data-gl="route"] { --gl: var(--gl-route); }
[data-gl="hourglass"] { --gl: var(--gl-hourglass); }
[data-gl="lock"] { --gl: var(--gl-lock); }
[data-gl="unlock"] { --gl: var(--gl-unlock); }
[data-gl="refresh"] { --gl: var(--gl-refresh); }
[data-gl="help"] { --gl: var(--gl-help); }
[data-gl="eyeoff"] { --gl: var(--gl-eyeoff); }
[data-gl="coach"] { --gl: var(--gl-coach); }
[data-gl="calendar"] { --gl: var(--gl-calendar); }
[data-gl="link"] { --gl: var(--gl-link); }
[data-gl="pound"] { --gl: var(--gl-pound); }
.pill.good::before { --gl: var(--gl-check); }
.pill.warn::before { --gl: var(--gl-clock); }
.pill.bad::before { --gl: var(--gl-alert); }
.pill.live::before { --gl: var(--gl-dot); }
.pill.soon::before { --gl: var(--gl-clock); }
.badge::before { --gl: var(--gl-check); }
.badge.unconfirmed::before { --gl: var(--gl-clock); }
.badge.awaiting::before { --gl: var(--gl-ellipsis); }
.badge.likely::before { --gl: var(--gl-sparkle); }
.badge.disrupted::before { --gl: var(--gl-alert); }
#shareBadge::before { --gl: var(--gl-share); }
.hero-times > div:first-child > .hero-label::before { --gl: var(--gl-dep); }
.hero-times > div:last-child > .hero-label::before { --gl: var(--gl-arr); }
.hero-at:not(:empty)::before { --gl: var(--gl-pin); }
.arrival-stats > div:nth-child(1) .data-label::before { --gl: var(--gl-route); }
.arrival-stats > div:nth-child(2) .data-label::before { --gl: var(--gl-clock); }
.arrival-stats > div:nth-child(3) .data-label::before { --gl: var(--gl-hourglass); }
#profileCard .alerts-title::before { --gl: var(--gl-user); }
#sharesCard .alerts-title::before { --gl: var(--gl-share); }
#followsCard .alerts-title::before { --gl: var(--gl-eye); }
#alertsCard .alerts-title::before { --gl: var(--gl-bell); }
#syncCard .alerts-title::before { --gl: var(--gl-cloud); }
#dataCard .alerts-title::before { --gl: var(--gl-download); }
#feedbackCard .alerts-title::before { --gl: var(--gl-chat); }
#followingTitle::before { --gl: var(--gl-eye); }
#upcomingTitle::before { --gl: var(--gl-calendar); }
#pastTitle::before { --gl: var(--gl-check); }
#stationsTitle::before { --gl: var(--gl-pin); }
#topRoutesTitle::before { --gl: var(--gl-route); }
#operatorsTitle::before { --gl: var(--gl-train); }
#friendsLogbookTitle::before { --gl: var(--gl-users); }
#pickupHearBtn::before { --gl: var(--gl-speaker); }
#pickupSimpleBtn::before { --gl: var(--gl-eye); }
#shareBtn::before { --gl: var(--gl-share); }
#copyShareLinkBtn::before { --gl: var(--gl-link); }
#exportBtn::before { --gl: var(--gl-download); }
#feedbackBtn::before { --gl: var(--gl-chat); }
#alertsOnBtn::before { --gl: var(--gl-bell); }
#unfollowBtn::before { --gl: var(--gl-eyeoff); }
#legOutBtn::before { --gl: var(--gl-dep); }
#legRetBtn::before { --gl: var(--gl-arr); }
.arrival-verdict.good strong::before { --gl: var(--gl-check); }
.arrival-verdict.claim strong::before { --gl: var(--gl-pound); }
#addOwnBtn::before { --gl: var(--gl-ticket); }
#addFriendBtn::before { --gl: var(--gl-users); }
.credit::before { --gl: var(--gl-train); }
#footRight:not(:empty)::before { --gl: var(--gl-refresh); }
.next-remove::before { --gl: var(--gl-trash); }
#platformChange .change-label::before { --gl: var(--gl-alert); }

/* --- placing the glyphs -------------------------------------------------- */
.pill.good, .pill.warn, .pill.bad, .pill.live, .pill.soon { display: inline-flex; align-items: center; gap: var(--gl-gap); }
.pill::before { --gl-size: 12px; }
.badge { display: inline-flex; align-items: center; gap: 5px; }
.badge::before { --gl-size: 12px; }
.hero-label::before, .hero-at::before { --gl-size: 12px; opacity: 0.9; }
.arrival-stats .data-label { display: inline-flex; align-items: center; gap: 4px; }
.arrival-verdict strong { display: flex; align-items: center; gap: 6px; }
.arrival-verdict strong::before { --gl-size: 18px; }
.alerts-title { display: flex; align-items: center; gap: 8px; }
.alerts-title::before { --gl-size: 18px; color: var(--accent-text); }
.cta.secondary.inline, .text-btn, .leg-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; }
.cta[data-gl], #shareBtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.cta::before, .text-btn::before, .leg-btn::before { --gl-size: 16px; }
.leg-btn::before { --gl-size: 14px; }
#followingTitle, #upcomingTitle, #pastTitle, #stationsTitle, #topRoutesTitle, #operatorsTitle, #friendsLogbookTitle {
  flex-direction: row; align-items: center; gap: 6px;
}
#followingTitle::before, #upcomingTitle::before, #pastTitle::before, #stationsTitle::before,
#topRoutesTitle::before, #operatorsTitle::before, #friendsLogbookTitle::before { --gl-size: 14px; }
.credit::before { --gl-size: 12px; margin-right: 5px; vertical-align: -2px; }
#footRight::before, #footLeft::before { --gl-size: 11px; margin-right: 3px; }
#footLeft[data-gl="dot"] { color: var(--status-ontime); }

/* The words stay for screen readers when the glyph says it. */
.sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Chips take the glyph after the text, ahead of it by order, as ::before is the tick. */
.chip[data-gl] { display: inline-flex; align-items: center; gap: 6px; }
.chip[data-gl]::after {
  content: ""; order: -1; flex: none; width: 16px; height: 16px; background: currentColor;
  -webkit-mask: var(--gl) center / contain no-repeat; mask: var(--gl) center / contain no-repeat;
}
/* Ways of getting between stations: the picture first, the word once it's picked. */
#connectChips .chip { font-size: 0; gap: 0; padding: var(--space-sm) var(--space-md); min-height: 44px; min-width: 44px; justify-content: center; }
#connectChips .chip::after { width: 20px; height: 20px; }
#connectChips .chip.active { font-size: 13px; gap: 6px; }

/* Where a train row's facts are small marks, not a sentence. */
.row-flags { display: flex; flex-wrap: wrap; gap: 2px 10px; margin-top: 3px; font-size: 11px; color: var(--ink-muted); }
.flag { display: inline-flex; align-items: center; gap: 3px; }
.flag::before { --gl-size: 13px; margin-right: 0; vertical-align: 0; }
.flag.warn { color: var(--status-late); }
.flag.mine { color: var(--accent-text); }

/* The leading trip's card: the day, which way, and the ticket, each its own mark. */
.next-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 10px; }
.next-sub > span { display: inline-flex; align-items: center; gap: 3px; }
.next-sub > span[data-gl]::before { --gl-size: 12px; margin-right: 0; vertical-align: 0; }

/* Remove a trip: a bin, a proper tap target, still named for a screen reader. */
.next-remove { display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; margin-right: var(--space-lg); padding: 0; font-size: 0; }
.next-remove::before { --gl-size: 20px; margin: 0; vertical-align: 0; }

/* Platform changed: the two numbers, large, beside the label. */
.platform-change { flex-direction: row; justify-content: center; gap: var(--space-md); }
.pc-nums { font-family: var(--font-display); font-size: 28px; line-height: 1; color: var(--on-signal); }
.pc-station { font-size: 12px; font-weight: 600; color: var(--on-signal); }
.change-label::before { --gl-size: 14px; color: var(--on-signal); }

/* The two ways to add: a picture each, a line under. */
#addOwnBtn, #addFriendBtn { display: grid; grid-template-columns: 36px 1fr; column-gap: var(--space-md); align-items: center; }
#addOwnBtn::before, #addFriendBtn::before { --gl-size: 28px; grid-row: 1 / span 2; color: var(--accent-text); margin: 0; vertical-align: 0; }
#addOwnBtn .choice-sub, #addFriendBtn .choice-sub { grid-column: 2; }

/* The swap button's arrows. */
.swap-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; display: block; margin: auto; }
.change-detail { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.field-label[data-gl], .data-label[data-gl] { display: inline-flex; align-items: center; gap: 5px; }
.field-label[data-gl]::before, .data-label[data-gl]::before { --gl-size: 13px; margin-right: 0; vertical-align: 0; }
legend.field-label[data-gl] { display: flex; }

/* --- buttons, modernised -------------------------------------------------
   Pill-shaped, a touch taller, a soft top light and a warm glow under the
   primary; the secondary is the same shape in glass. The press scale and dimmer glow still show while pressed. */
.cta {
  border-radius: var(--radius-pill);
  min-height: 54px;
  letter-spacing: 0.2px;
  background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 86%, var(--white)) 0%, var(--accent) 70%);
  box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white) 50%, transparent),
              0 8px 22px color-mix(in srgb, var(--accent) 26%, transparent);
  transition: opacity var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out),
              box-shadow var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out);
}
.cta:disabled { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white) 30%, transparent); }
.cta:active:not(:disabled) { box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white) 30%, transparent), 0 3px 10px color-mix(in srgb, var(--accent) 22%, transparent); }
@media (hover: hover) and (pointer: fine) {
  .cta:hover:not(:disabled):not(:active):not(.secondary) { transform: translateY(-1px); box-shadow: inset 0 1px 0 color-mix(in srgb, var(--white) 55%, transparent), 0 12px 28px color-mix(in srgb, var(--accent) 34%, transparent); }
}
.cta.secondary {
  background: color-mix(in srgb, var(--surface-raised) 86%, var(--lavender));
  box-shadow: inset 0 1px 0 var(--glass-line);
}
.guide .cta.secondary, .nudge .cta.secondary { background: color-mix(in srgb, var(--lavender) 30%, var(--surface)); }
.cta.secondary.inline { min-height: 44px; padding: var(--space-md) var(--space-xl); }

/* The line's travelled yellow runs behind the stop dots, not over them. */
.rl-done { z-index: 0; }
.rl-stop, .rl-code { z-index: 1; }

/* Windows high contrast: a mask painted as a background would be forced to the page colour and vanish. */
@media (forced-colors: active) {
  .pill::before, .badge::before, [data-gl]::before, .chip[data-gl]::after, .alerts-title::before,
  .hero-label::before, .hero-at::before, .next-remove::before, .credit::before, .flag::before {
    background: CanvasText; forced-color-adjust: none;
  }
  #connectChips .chip { font-size: 13px; gap: 6px; }
  .next-remove { font-size: 13px; width: auto; padding: 0 var(--space-md); }
}
