/* Shared by / and /guide/. Quiet and native: the system font, neutral grays, one link blue, and the app's own screens
   doing the talking. Transit line colors appear only where they mean something (a train's line), never as decoration.
   Light by default, dark when the system is (or the visitor picks it, theme.js); the screenshots follow. */
:root {
  --bg: #ffffff;
  --bg-2: #f5f5f7;            /* alternate section band */
  --surface: #ffffff;         /* cards on the band */
  --surface-2: #f5f5f7;       /* cards on white */
  --ink: #1d1d1f;
  --muted: #6e6e73;
  --faint: #86868b;
  --rule: #d2d2d7;
  --hair: rgb(0 0 0 / 0.08);
  --link: #0066cc;
  --button: #1d1d1f;          /* the primary button */
  --on-button: #ffffff;

  /* BART line colors, as in Shared/Models.swift (the simulator and complication pictures use them) */
  --red: #ff0000;
  --orange: #ff9933;
  --yellow: #ffff33;
  --green: #339933;
  --blue: #0099cc;
  --yellow-page: #e5bf00;     /* the Yellow line where it sits on a light page, as in the iPhone app */

  /* Devices are always black, whatever the page */
  --watch: #000000;
  --watch-ink: #ffffff;
  --watch-2: #a1a1a8;
  --watch-3: #66666d;
  --watch-fill: #232326;

  --shadow-card: 0 1px 2px rgb(0 0 0 / 0.04), 0 4px 16px -6px rgb(0 0 0 / 0.08);
  --drop-device: drop-shadow(0 30px 34px rgb(0 0 0 / 0.16)) drop-shadow(0 6px 10px rgb(0 0 0 / 0.08));
  --r-sm: 10px;
  --r-md: 18px;
  --r-lg: 28px;

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --system: var(--font);
  --rounded: ui-rounded, "SF Pro Rounded", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;

  --wrap: 72rem;
  color-scheme: light dark;
}
/* Dark: when the device is, unless the visitor picked light with the header button (theme.js), or when they picked dark.
   The two blocks below hold the same tokens; change both. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0c;
    --bg-2: #161618;
    --surface: #1c1c1e;
    --surface-2: #1c1c1e;
    --ink: #f5f5f7;
    --muted: #a1a1a6;
    --faint: #86868b;
    --rule: #3a3a3c;
    --hair: rgb(255 255 255 / 0.1);
    --link: #2997ff;
    --button: #f5f5f7;
    --on-button: #0b0b0c;
    --yellow-page: #ffd60a;
    --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.06);
    --drop-device: drop-shadow(0 30px 34px rgb(0 0 0 / 0.6)) drop-shadow(0 6px 10px rgb(0 0 0 / 0.4));
  }
}
:root[data-theme="dark"] {
  --bg: #0b0b0c;
  --bg-2: #161618;
  --surface: #1c1c1e;
  --surface-2: #1c1c1e;
  --ink: #f5f5f7;
  --muted: #a1a1a6;
  --faint: #86868b;
  --rule: #3a3a3c;
  --hair: rgb(255 255 255 / 0.1);
  --link: #2997ff;
  --button: #f5f5f7;
  --on-button: #0b0b0c;
  --yellow-page: #ffd60a;
  --shadow-card: 0 0 0 1px rgb(255 255 255 / 0.06);
  --drop-device: drop-shadow(0 30px 34px rgb(0 0 0 / 0.6)) drop-shadow(0 6px 10px rgb(0 0 0 / 0.4));
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 16px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  letter-spacing: -0.01em;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; }
a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 0.18em; }
a:focus-visible, button:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 6px; }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; font-family: var(--font-display); }
p { margin: 0; text-wrap: pretty; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 10; background: var(--button); color: var(--on-button); padding: 10px 16px; border-radius: 10px; font-weight: 600; }
.skip:focus { top: 12px; }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
}

/* Top bar */
.top { padding-block: 14px; display: flex; align-items: center; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand img { width: 30px; height: 30px; border-radius: 7px; }
.brand b { font-family: var(--font-display); font-size: 1.2rem; font-weight: 600; letter-spacing: -0.02em; }
.top nav { display: flex; gap: 22px; margin-left: auto; }
.top nav a { color: var(--muted); font-size: 0.875rem; padding: 6px 0; transition: color 150ms; }
.top nav a:hover, .top nav a[aria-current="page"] { color: var(--ink); text-decoration: none; }
.theme {
  flex: none; display: grid; place-items: center; width: 32px; height: 32px; padding: 0; cursor: pointer;
  border: 0; border-radius: 50%; background: transparent; color: var(--muted); transition: color 150ms, background 150ms;
}
.theme:hover { color: var(--ink); background: var(--bg-2); }
.theme svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme .sun, .theme[aria-pressed="true"] .moon { display: none; }
.theme[aria-pressed="true"] .sun { display: block; }

/* Type */
.eyebrow { font-size: 0.95rem; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; }
.head { display: grid; gap: 14px; max-width: 44rem; margin-bottom: clamp(32px, 5vw, 56px); }
.head h1, .head h2, .feature-text h2 {
  font-weight: 700; font-size: clamp(2rem, 1.35rem + 2.4vw, 3rem); line-height: 1.08; letter-spacing: -0.03em;
}
.head > p:not(.eyebrow) { color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); max-width: 58ch; }

/* Hero */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(40px, 6vw, 88px); align-items: center;
  padding-block: clamp(36px, 6vw, 80px) clamp(56px, 8vw, 112px);
}
.hero > * { min-width: 0; }
.hero-copy { display: grid; gap: 22px; justify-items: start; }
.hero h1 { font-weight: 700; font-size: clamp(2.75rem, 1.6rem + 4.6vw, 5rem); line-height: 1.02; letter-spacing: -0.045em; }
.hero .lede { font-size: clamp(1.15rem, 1.05rem + 0.45vw, 1.375rem); line-height: 1.42; color: var(--muted); max-width: 30ch; letter-spacing: -0.015em; }
.hero .lede strong { color: var(--ink); font-weight: 600; }
.cta { display: flex; gap: 14px 24px; align-items: center; flex-wrap: wrap; margin-top: 6px; }
.badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--button); color: var(--on-button);
  font-weight: 600; font-size: 1rem; padding: 13px 22px; border-radius: 999px;
  transition: transform 150ms, opacity 150ms;
}
.badge:hover { text-decoration: none; opacity: 0.88; }
.badge:active { transform: scale(0.98); }
.cta-link { font-weight: 500; }
.cta-link span { display: inline-block; transition: transform 150ms; }
.cta-link:hover span { transform: translateX(3px); }
.facts { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 0; color: var(--faint); font-size: 0.9rem; }
.facts li + li::before { content: "·"; margin: 0 9px; }
.facts a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

/* The same trip on both devices: real screenshots in Xcode's own device frames (scripts/frame.swift), the iPhone in
   light or dark like the page, the watch in front of the iPhone's empty lower half */
.devices { position: relative; width: 100%; max-width: 27rem; justify-self: center; padding-left: 14%; padding-bottom: 4%; }
.shot { display: block; filter: var(--drop-device); }
.shot img { display: block; width: 100%; height: auto; }
.shot-phone { width: 76%; margin-left: auto; }
.shot-watch { position: absolute; left: 0; bottom: 0; width: 46%; height: auto; }

/* Sections: alternate white and a light gray band instead of rules */
section { padding-block: clamp(64px, 9vw, 120px); }
section.band { background: var(--bg-2); }
section.first { padding-top: clamp(28px, 4vw, 56px); }

/* What it covers: a plain spec list */
.systems { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.systems li {
  display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) minmax(0, 14rem); gap: 8px 32px; align-items: baseline;
  padding: 24px 0; border-bottom: 1px solid var(--rule);
}
.systems h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.02em; display: flex; align-items: center; gap: 12px; }
.systems p { color: var(--muted); max-width: 52ch; }
.systems .src { font-size: 0.95rem; color: var(--faint); }
.systems .src b { color: var(--ink); font-weight: 500; }
.marks { display: inline-flex; gap: 3px; flex: none; }
.marks i { width: 5px; height: 18px; border-radius: 3px; }
.marks svg { width: 20px; height: 20px; stroke: var(--muted); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.note { margin-top: 24px; color: var(--muted); font-size: 0.95rem; max-width: 70ch; }

/* Features: text beside a picture, alternating */
.feature { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.feature + .feature { margin-top: clamp(72px, 10vw, 136px); }
.feature > * { min-width: 0; }
.feature.flip .feature-text { order: 2; }
.feature-text { display: grid; gap: 16px; align-content: start; }
.feature-text > p { color: var(--muted); font-size: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem); max-width: 46ch; }
.feature-text > h3 { margin-top: 8px; font-size: 1.1875rem; font-weight: 600; letter-spacing: -0.015em; }
.feature-text strong { color: var(--ink); font-weight: 600; }
#minutes { align-items: start; }

.reasons { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; background: var(--hair); border-radius: var(--r-md); overflow: hidden; box-shadow: var(--shadow-card); }
.reasons li { background: var(--surface); padding: 20px 22px; display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 4px 14px; }
.reasons svg { grid-row: span 2; width: 22px; height: 22px; margin-top: 2px; stroke: var(--link); fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.reasons h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.reasons p { color: var(--muted); font-size: 0.97rem; }
.reasons .says { font-family: var(--system); font-size: 0.85rem; color: var(--faint); }

.rules { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 18px; }
.rules li { display: grid; gap: 2px; padding-left: 16px; border-left: 2px solid var(--rule); }
.rules h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.rules p { color: var(--muted); font-size: 0.97rem; max-width: 52ch; }

/* Minutes: what Catch shows from each moment on */
.windows { margin: 0; background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 22px 24px 20px; display: grid; gap: 14px; }
.windows .estimate { font-size: 0.95rem; color: var(--muted); }
.windows .estimate b { color: var(--ink); font-weight: 600; }
.ticks { list-style: none; margin: 0; padding: 0; display: grid; }
.ticks li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--hair); }
.ticks li:last-child { border-bottom: 0; }
.ticks span { font-variant-numeric: tabular-nums; color: var(--muted); }
.ticks b { font-family: var(--rounded); font-weight: 600; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.ticks b.gone { color: var(--faint); font-weight: 500; }
.windows .caption { font-size: 0.9rem; color: var(--muted); border-top: 1px solid var(--hair); padding-top: 14px; }

/* Complications: drawn like the real thing, on black */
.faces { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 12px; }
.face {
  grid-column: span 2; margin: 0;
  background: var(--watch); color: var(--watch-ink);
  border-radius: 22px; padding: 18px;
  display: grid; gap: 14px; justify-items: center; align-content: space-between;
  font-family: var(--rounded); min-width: 0;
}
.face.wide { grid-column: span 3; justify-items: stretch; }
.face figcaption { font-family: var(--font); font-size: 0.8rem; color: var(--watch-2); text-align: center; line-height: 1.3; }
.face figcaption b { display: block; color: var(--watch-ink); font-weight: 600; }
.face svg { display: block; width: 100%; max-width: 120px; height: auto; }
.rect { display: grid; gap: 2px; padding: 12px 14px; border-radius: 14px; background: var(--watch-fill); font-family: var(--system); }
.rect .t { display: flex; gap: 6px; align-items: center; font-weight: 600; font-size: 1.05rem; }
.rect .t i { width: 8px; height: 8px; border-radius: 50%; background: var(--yellow); }
.rect .m { font-family: var(--rounded); font-weight: 600; font-size: 1.45rem; display: flex; gap: 10px; align-items: baseline; font-variant-numeric: tabular-nums; }
.rect .m small { font-size: 0.8rem; color: var(--watch-2); font-weight: 500; }
.rect .p { font-size: 0.8rem; color: var(--watch-2); }
.inline { display: grid; justify-items: center; padding-block: 8px; }
.inline .l { font-family: var(--system); font-size: 0.95rem; font-weight: 500; font-variant-numeric: tabular-nums; }
.inline .clock { font-family: var(--rounded); font-weight: 600; font-size: 3.4rem; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }

/* Setup and the guide: numbered steps */
.setup-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); align-items: center; }
.setup-grid > * { min-width: 0; }
.steps { list-style: none; margin: 0; padding: 0; display: grid; gap: 22px; counter-reset: step; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 14px; counter-increment: step; }
.steps li::before {
  content: counter(step);
  font-family: var(--rounded); font-weight: 600; font-size: 1.0625rem; line-height: 1.5; color: var(--faint);
  font-variant-numeric: tabular-nums;
}
.steps b { display: block; font-weight: 600; letter-spacing: -0.015em; }
.steps p, .screen-help p { color: var(--muted); font-size: 1rem; }
.steps p + p { margin-top: 6px; }
.steps strong, .screen-help strong, .settings strong { color: var(--ink); font-weight: 600; }
.phones { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 3vw, 32px); align-items: start; max-width: 34rem; justify-self: center; width: 100%; }
.phone { margin: 0; filter: var(--drop-device); }
.phone img { display: block; width: 100%; height: auto; }
.phones .phone:nth-child(2) { margin-top: 56px; }
.more { margin-top: 28px; font-weight: 500; }

/* Guide page */
.guide { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.guide > * { min-width: 0; }
.guide h3.sub { font-size: 1.4rem; font-weight: 600; letter-spacing: -0.02em; line-height: 1.2; margin-bottom: 18px; }
.steps + h3.sub { margin-top: 48px; }
.example-lede { color: var(--muted); font-size: 1rem; margin: -6px 0 18px; }
.steps + .example-lede { margin: 18px 0 0; }
.key {
  display: inline-grid; place-items: center; min-width: 1.6em; height: 1.6em; padding: 0 0.35em;
  border-radius: 999px; background: var(--watch); color: var(--watch-ink);
  font-family: var(--system); font-size: 0.85em; font-weight: 600; line-height: 1; vertical-align: 0.05em;
}
.key svg { width: 1em; height: 1em; stroke: currentColor; fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.screen-help { background: var(--surface-2); border-radius: var(--r-md); padding: 24px; display: grid; gap: 16px; }
.screen-help h3.sub { margin-bottom: 0; }
.screen-help dl { margin: 0; display: grid; gap: 14px; }
.screen-help dt { font-weight: 600; display: flex; gap: 10px; align-items: center; }
.screen-help dd { margin: 4px 0 0; color: var(--muted); }
.settings-head { margin-top: clamp(56px, 8vw, 96px); }
.settings { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 14px; }
.set-card { background: var(--surface-2); border-radius: var(--r-md); padding: 22px 24px; display: grid; gap: 10px; align-content: start; min-width: 0; }
.set-card h4 { font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--faint); } /* like an iOS list section header */
.set-card dl { margin: 0; display: grid; gap: 12px; }
.set-card dt { font-weight: 600; }
.set-card dd { margin: 2px 0 0; color: var(--muted); font-size: 0.97rem; }
.set-card dd .def { color: var(--ink); }

/* Support and privacy */
.privacy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); gap: clamp(32px, 6vw, 96px); }
.privacy > * { min-width: 0; }
.privacy > .head { align-content: start; margin-bottom: 0; }
.privacy dl { margin: 0; display: grid; gap: 24px; }
.privacy dt { font-weight: 600; letter-spacing: -0.015em; }
.privacy dd { margin: 4px 0 0; color: var(--muted); max-width: 62ch; }
.privacy .stamp { font-size: 0.9rem; color: var(--faint); }
.mail { justify-self: start; margin-top: 6px; font-weight: 600; font-size: 1.0625rem; }

/* Footer */
footer { padding-block: 40px 48px; font-size: 0.8rem; color: var(--faint); border-top: 1px solid var(--hair); }
footer .wrap { display: flex; gap: 16px 40px; justify-content: space-between; flex-wrap: wrap; }
footer p { max-width: 64ch; }
.foot-links { display: grid; gap: 8px; align-content: start; }
.foot-links nav { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.foot-links a { color: var(--muted); }
.foot-links a:hover { color: var(--ink); }

@media (max-width: 860px) {
  .hero { grid-template-columns: minmax(0, 1fr); }
  .devices { max-width: 26rem; }
  .privacy, .feature, .setup-grid, .guide { grid-template-columns: minmax(0, 1fr); }
  .feature.flip .feature-text { order: 0; }
  .systems li { grid-template-columns: minmax(0, 1fr); gap: 6px; padding: 20px 0; }
}
@media (max-width: 640px) {
  .top nav { gap: 16px; }
  .top nav a:not([data-keep]) { display: none; }
}
@media (max-width: 520px) {
  .phones .phone:nth-child(2) { margin-top: 32px; }
  .face { padding: 12px; border-radius: 18px; }
  .face figcaption { font-size: 0.72rem; }
  .faces { gap: 8px; }
}
@media (max-width: 400px) { .top { gap: 10px; } .top nav { gap: 12px; } } /* brand, three links and the button fit 360px */
@media (prefers-reduced-motion: no-preference) {
  .devices .shot { animation: arrive 800ms cubic-bezier(.2, .7, .2, 1) both; }
  .devices .shot-watch { animation-delay: 140ms; }
  @keyframes arrive { from { opacity: 0; transform: translateY(16px); } }
}

/* ------- Watch: the app's main screen, live (the simulator) ------- */
.watch {
  --pad: 14px; /* the box stays as before, so the screen's cqw sizes still hold; the case is drawn over it */
  --w: min(100%, 300px);
  justify-self: center;
  width: var(--w);
  margin-inline: calc((var(--w) - 2 * var(--pad)) * 0.146919 - var(--pad)); /* room for the case, which is wider than the box */
  container-type: inline-size; /* screen sizes below are in % of the watch's width */
  position: relative;
  padding: var(--pad);
  filter: var(--drop-device);
}
.watch::after { /* the case: Apple Watch Ultra from Xcode's device frames, its display cut out over the live screen.
                   In the image (546 × 581) the display is 422 × 514 at 62, 34; these place that hole on .screen. */
  content: ""; position: absolute; z-index: 1; pointer-events: none;
  left: calc(var(--pad) - (100% - 2 * var(--pad)) * 0.146919);
  width: calc((100% - 2 * var(--pad)) * 1.293839);
  top: calc(var(--pad) - (100% - 2 * var(--pad)) * 0.066148);
  height: calc((100% - 2 * var(--pad)) * 1.130350);
  background: url("/img/watch-frame.webp?v=f57fc30b") 0 0 / 100% 100% no-repeat;
}
.screen {
  aspect-ratio: 0.82;
  max-width: 100%;
  background: var(--watch);
  color: var(--watch-ink);
  border-radius: 12%; /* inside the case's own rounded display */
  font-family: var(--system);
  letter-spacing: 0;
  padding: 7cqw 7cqw 6cqw;
  overflow: hidden;
  display: flex; flex-direction: column; gap: 3.2cqw;
  position: relative;
}
.bar { display: flex; align-items: center; justify-content: space-between; }
.bar .btn {
  width: 13cqw; height: 13cqw; border-radius: 50%; background: var(--watch-fill);
  display: grid; place-items: center;
}
.bar .btn svg { width: 6.4cqw; height: 6.4cqw; stroke: var(--watch-ink); fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.bar .time { font-size: 5.6cqw; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar .clock-title { display: grid; justify-items: center; line-height: 1.15; }
.bar .title { font-size: 5.6cqw; font-weight: 500; color: var(--watch-2); }
.bar .title:empty { display: none; }
.route .dest { font-size: 7.1cqw; font-weight: 600; line-height: 1.15; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.route .rev { font-size: 5.4cqw; color: var(--yellow); }
.trains { display: grid; gap: 2.6cqw; margin-top: 2.2cqw; }
.train { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2.6cqw; }
.train .lbar { align-self: stretch; width: 1.5cqw; min-height: 5.4cqw; display: flex; flex-direction: column; gap: 0.8cqw; }
.train .lbar i { flex: 1; border-radius: 1cqw; }
.train .lbar.sched { opacity: 0.5; }
.train .name { min-width: 0; }
.train .to { font-size: 6.2cqw; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.train.lead .to { font-size: 7.3cqw; font-weight: 600; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.train .meta { font-size: 5.4cqw; color: var(--watch-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.train .min { display: flex; align-items: baseline; gap: 0.8cqw; line-height: 1; font-variant-numeric: tabular-nums; }
.train .min b { font-size: 10.5cqw; font-weight: 600; font-family: var(--rounded); }
.train.lead .min b { font-size: 19cqw; }
.train .min span { font-size: 5.4cqw; color: var(--watch-2); }
.trip-foot { margin-top: 3cqw; font-size: 5.4cqw; color: var(--watch-2); line-height: 1.25; }
/* Other ways to work, under the trains */
.ways { display: grid; gap: 1.6cqw; margin-top: 3cqw; }
.ways-arrive { font-size: 5.8cqw; font-weight: 600; }
.ways-head { font-size: 4.6cqw; color: var(--watch-2); }
.way {
  display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 2.4cqw; width: 100%;
  border: 0; border-radius: 4cqw; padding: 2.4cqw 3cqw; background: var(--watch-fill); color: inherit; font: inherit;
  text-align: left; cursor: pointer;
}
.way:hover { background: #333338; }
.way .lbar { align-self: stretch; display: flex; gap: 0.8cqw; min-height: 7cqw; }
.way .lbar i { width: 1.2cqw; border-radius: 1cqw; }
.way-name { min-width: 0; display: grid; }
.way-name b { font-size: 5.6cqw; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.way-name small { font-size: 4.4cqw; color: var(--watch-2); }
.way-at { font-size: 5.6cqw; font-weight: 600; font-family: var(--rounded); font-variant-numeric: tabular-nums; }

/* ------- Simulator ------- */
[hidden] { display: none !important; }
.sim { display: grid; grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr); gap: clamp(32px, 5vw, 72px); align-items: start; }
.sim > * { min-width: 0; }
.sim-side { position: sticky; top: 24px; display: grid; gap: 18px; justify-items: center; }
.sim .screen { padding: 7cqw 6cqw 0; gap: 0; }
.sim .bar { padding: 0 1cqw 2cqw; }
.screen button.btn { border: 0; padding: 0; color: inherit; cursor: pointer; }
.screen button.btn:hover { background: #333338; }
.screen button.btn:disabled { opacity: 0.4; cursor: default; }
.sim-body { flex: 1; min-height: 0; overflow-y: auto; scrollbar-width: none; display: flex; flex-direction: column; gap: 3.2cqw; padding: 0 1cqw 7cqw; }
.sim-body::-webkit-scrollbar { display: none; }
.w-title { font-size: 6.2cqw; font-weight: 600; line-height: 1.15; }
.w-note { font-size: 4.4cqw; color: var(--watch-2); }
.w-status { font-size: 3.9cqw; color: var(--watch-2); text-align: center; } /* centered: the screen's corners clip the sides */
.train .min b.leaving { font-size: 5.4cqw; }
.train.lead .min b.leaving { font-size: 7.3cqw; }
.wf { flex: 1; display: flex; flex-direction: column; gap: 2cqw; padding: 2cqw 1cqw 7cqw; min-height: 0; }
.wf-inline { text-align: center; font-size: 4.6cqw; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; }
.wf-time { flex: 1; display: grid; place-items: center; font-family: var(--rounded); font-weight: 600; font-size: 23cqw; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.wf-row { display: flex; gap: 3cqw; align-items: center; }
.wf-circ { width: 30cqw; flex: none; }
.wf-circ svg { display: block; width: 100%; height: auto; }
.wf-rect { flex: 1; min-width: 0; background: var(--watch-fill); border-radius: 5cqw; padding: 3cqw 3.6cqw; display: grid; gap: 0.6cqw; }
.wf-rect .t { display: flex; gap: 1.6cqw; align-items: center; font-size: 4.4cqw; font-weight: 600; min-width: 0; }
.wf-rect .t span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wf-rect .t i { width: 2.4cqw; height: 2.4cqw; border-radius: 50%; flex: none; }
.wf-rect .m { font-family: var(--rounded); font-weight: 600; font-size: 7cqw; line-height: 1.05; display: flex; gap: 2.4cqw; align-items: baseline; font-variant-numeric: tabular-nums; white-space: nowrap; }
.wf-rect .m small { font-size: 3.6cqw; color: var(--watch-2); font-weight: 500; }
.wf-rect .p { font-size: 3.4cqw; color: var(--watch-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* The simulator's controls: iOS-like segmented controls and grouped cards */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 2px; border-radius: 9px; background: var(--hair); }
.seg button { font: inherit; font-size: 0.875rem; font-weight: 500; border: 0; background: transparent; color: var(--ink); padding: 5px 14px; border-radius: 7px; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 1px 3px rgb(0 0 0 / 0.12); }
:root[data-theme="dark"] .seg button[aria-pressed="true"] { background: #636366; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .seg button[aria-pressed="true"] { background: #636366; } }
.seg button:disabled { opacity: 0.45; cursor: default; }
.sim-hint { font-size: 0.9rem; color: var(--muted); text-align: center; max-width: 30ch; }

.panel { display: grid; gap: 14px; }
.group { background: var(--surface); border-radius: var(--r-md); box-shadow: var(--shadow-card); padding: 22px; display: grid; gap: 16px; }
.group h3 { font-size: 1.0625rem; font-weight: 600; letter-spacing: -0.015em; }
.fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.field { display: grid; gap: 6px; min-width: 0; align-content: start; }
.field > span { font-size: 0.9rem; color: var(--muted); }
.field > .seg { justify-self: start; }
.panel select, .panel input[type="time"] {
  font: inherit; font-size: 1rem; color: var(--ink); background: var(--bg);
  border: 1px solid var(--rule); border-radius: 10px; padding: 8px 10px; width: 100%; min-width: 0;
}
.panel select:focus-visible, .panel input:focus-visible { outline: 2px solid var(--link); outline-offset: 1px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips button {
  font: inherit; font-size: 0.9rem; font-weight: 500; cursor: pointer;
  display: inline-flex; align-items: center; gap: 8px;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg); color: var(--ink);
}
.chips button i { width: 10px; height: 10px; border-radius: 50%; }
.chips button[aria-pressed="false"] { color: var(--muted); text-decoration: line-through; }
.chips button[aria-pressed="false"] i { opacity: 0.35; }
.chips button:disabled { cursor: default; }
.small { font-size: 0.9rem; color: var(--muted); }
.check { display: flex; gap: 10px; align-items: center; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--link); margin: 0; }
.clock-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.clock-now { font-family: var(--rounded); font-weight: 600; font-size: 2rem; line-height: 1; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; min-width: 5.6ch; }
.play { font: inherit; font-weight: 500; font-size: 0.875rem; cursor: pointer; border: 0; border-radius: 999px; padding: 6px 14px; background: var(--hair); color: var(--ink); }
.play:hover { background: var(--rule); }
.panel input[type="range"] { width: 100%; accent-color: var(--link); margin: 0; }
.presets { display: flex; flex-wrap: wrap; gap: 8px; }
.presets button { font: inherit; font-size: 0.85rem; cursor: pointer; border: 0; background: var(--hair); color: var(--ink); border-radius: 8px; padding: 6px 10px; }
.presets button:hover { background: var(--rule); }
.sample-note { font-size: 0.85rem; color: var(--muted); }
.trips { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.trips button {
  font: inherit; text-align: left; cursor: pointer; display: grid; gap: 2px; padding: 12px 14px;
  border: 1px solid var(--rule); border-radius: 12px; background: var(--bg); color: var(--ink); letter-spacing: -0.01em;
}
.trips button b { font-weight: 600; font-size: 0.95rem; }
.trips button span { font-size: 0.85rem; color: var(--muted); }
.trips button:hover { border-color: var(--faint); }
.trips button[aria-pressed="true"] { border-color: var(--link); box-shadow: inset 0 0 0 1px var(--link); }
.trips button:last-child:nth-child(odd) { grid-column: 1 / -1; } /* an odd one out takes the whole row */

/* Narrow screens: the watch becomes a bar pinned to the top while the settings scroll under it,
   so every change is visible as you make it. */
@media (max-width: 860px) {
  .sim { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .sim-side {
    top: env(safe-area-inset-top, 0px);
    z-index: 5;
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: stretch;
    gap: 10px 18px;
    margin-left: calc(-1 * max(20px, env(safe-area-inset-left, 0px)));
    margin-right: calc(-1 * max(20px, env(safe-area-inset-right, 0px)));
    padding-block: 12px;
    padding-left: max(20px, env(safe-area-inset-left, 0px));
    padding-right: max(20px, env(safe-area-inset-right, 0px));
    background: var(--bg-2);
    border-bottom: 1px solid var(--hair);
  }
  .sim-side .watch { grid-row: 1 / span 3; justify-self: start; --w: clamp(176px, 46vw, 240px); --pad: 9px; }
  .sim-side .seg { flex-direction: column; align-self: end; }
  .sim-side .seg button { text-align: left; }
  .sim-side .sim-hint { text-align: left; font-size: 0.8rem; line-height: 1.35; align-self: start; }
  /* A small watch needs bigger type: keep where you're going, why, and the minutes; drop the fine print. */
  .sim-side .bar .time { font-size: 7cqw; }
  .sim-side .bar .title, .sim-side .route .rev { font-size: 6.4cqw; }
  .sim-side .route .dest { font-size: 8.4cqw; }
  .sim-side .w-note { font-size: 5.6cqw; }
  .sim-side .w-title { font-size: 8cqw; }
  .sim-side .train .to { font-size: 7.4cqw; }
  .sim-side .train.lead .to { font-size: 8.4cqw; }
  .sim-side .train .min b { font-size: 12cqw; }
  .sim-side .train.lead .min b { font-size: 20cqw; }
  .sim-side .train .min b.leaving { font-size: 6.4cqw; }
  .sim-side .train .min span { font-size: 5.4cqw; }
  .sim-side .trains { gap: 2cqw; }
  .sim-side .train .meta, .sim-side .trip-foot, .sim-side .w-status { display: none; }
  .sim-side .way-name b, .sim-side .way-at, .sim-side .ways-arrive { font-size: 6.6cqw; }
  .sim-side .way-name small, .sim-side .ways-head { font-size: 5.2cqw; }
  .sim-side .wf-inline { font-size: 5.6cqw; }
  .sim-side .wf-rect .t { font-size: 5.6cqw; }
  .sim-side .wf-rect .m { font-size: 8.4cqw; }
  .sim-side .wf-rect .p { font-size: 4.6cqw; }
  .sim-side .w-nav { font-size: 8cqw; }
  .sim-side .wr { font-size: 6.2cqw; min-height: 15cqw; }
  .sim-side .wr-text small, .sim-side .ws h4, .sim-side .leg-head { font-size: 5cqw; }
  .sim-side .ws-foot { font-size: 4.8cqw; }
  .sim-side .w-dialog p { font-size: 6.6cqw; }
  .sim-side .w-dialog button { font-size: 6cqw; }
}
@media (max-width: 520px) { .trips { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 420px) { .fields { grid-template-columns: minmax(0, 1fr); } }

/* ------- Simulator: legs, and the watch's own Settings (like Catch/SetupView.swift) ------- */
.leg-head { display: flex; align-items: center; gap: 1.2cqw; font-size: 3.9cqw; color: var(--watch-2); margin-top: 1.6cqw; }
.leg-head:first-child { margin-top: 0; }
.leg-head i { width: 2.2cqw; height: 2.2cqw; border-radius: 50%; flex: none; }
.w-settings { gap: 2.2cqw; }
.w-nav { font-size: 6.4cqw; font-weight: 700; line-height: 1.1; margin: 0 0 0.6cqw 1.6cqw; outline: none; }
.ws { display: grid; gap: 1.2cqw; }
.ws h4 { font-size: 3.9cqw; font-weight: 500; color: var(--watch-2); margin: 1.6cqw 0 0 3cqw; font-family: var(--system); }
.wr {
  display: flex; align-items: center; gap: 2.4cqw; width: 100%; min-height: 13cqw; padding: 2.4cqw 4.2cqw;
  border: 0; border-radius: 4.8cqw; background: var(--watch-fill); color: var(--watch-ink);
  font: inherit; font-size: 4.8cqw; line-height: 1.2; text-align: left; cursor: pointer;
}
.wr:hover { background: #2e2e33; }
.wr:focus-visible, .w-dialog button:focus-visible, .w-time:focus-visible { outline: 2px solid #7cc7ea; outline-offset: 1px; }
.wr-text { flex: 1; min-width: 0; display: grid; gap: 0.3cqw; overflow-wrap: anywhere; }
.wr-text small { font-size: 3.9cqw; color: var(--watch-2); }
.wr-dot { width: 3cqw; height: 3cqw; border-radius: 50%; flex: none; }
.wr-check { color: #0a84ff; font-weight: 700; flex: none; }
.wr-plus { font-size: 6cqw; line-height: 1; font-weight: 500; }
.wr:disabled { color: var(--watch-3); cursor: default; }
.wr:disabled:hover { background: var(--watch-fill); }
.wr-lines { display: flex; align-items: center; gap: 1cqw; min-width: 0; }
.wr-lines i { width: 2.2cqw; height: 2.2cqw; border-radius: 50%; flex: none; }
.wr-lines span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-walk { display: inline-flex; align-items: center; gap: 1cqw; }
.ws-walk svg { width: 1.2em; height: 1.2em; fill: currentColor; flex: none; }
.wr.destructive { color: #ff453a; justify-content: center; text-align: center; }
.wr-field { color: var(--watch-3); cursor: default; }
.wr-field:hover { background: var(--watch-fill); }
.sw { position: relative; flex: none; width: 9.6cqw; height: 5.8cqw; border-radius: 99px; background: #48484d; transition: background 150ms; }
.sw::after {
  content: ""; position: absolute; top: 0.5cqw; left: 0.5cqw; width: 4.8cqw; height: 4.8cqw; border-radius: 50%;
  background: #fff; transition: transform 150ms;
}
.wr-toggle[aria-checked="true"] .sw { background: #30d158; }
.wr-toggle[aria-checked="true"] .sw::after { transform: translateX(3.8cqw); }
.ws-foot { font-size: 3.6cqw; line-height: 1.3; color: var(--watch-2); margin: 0.4cqw 3cqw 0; }
.ws-foot.warn { color: #ff9f0a; }
.w-time {
  font: inherit; font-size: 8cqw; font-variant-numeric: tabular-nums; width: 100%; padding: 3cqw 4cqw;
  border: 0; border-radius: 4.8cqw; background: var(--watch-fill); color: var(--watch-ink); color-scheme: dark;
}
.w-dialog {
  position: absolute; inset: 0; z-index: 2; display: grid; align-content: center; gap: 2.4cqw; padding: 10cqw 9cqw;
  background: rgba(0, 0, 0, 0.94); border-radius: inherit; text-align: center;
}
.w-dialog p { font-size: 5.4cqw; font-weight: 600; line-height: 1.2; margin-bottom: 2cqw; }
.w-dialog button {
  font: inherit; font-size: 4.8cqw; min-height: 13cqw; border: 0; border-radius: 99px; cursor: pointer;
  background: var(--watch-fill); color: var(--watch-ink);
}
.w-dialog button.destructive { color: #ff453a; }
