/* ============================================================
   Fonts (self-hosted, variable)
   ============================================================ */
@font-face {
  font-family: "Fraunces";
  src: url("fonts/fraunces.woff2") format("woff2");
  font-weight: 100 900;
  font-display: swap;
}
@font-face {
  font-family: "Plus Jakarta Sans";
  src: url("fonts/jakarta.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}
/* Handwriting for the pencil note. Latin subset, loaded only where the note shows. */
@font-face {
  font-family: "Caveat";
  src: url("fonts/caveat.woff2") format("woff2");
  font-display: swap;
}

/* ============================================================
   Tokens
   ============================================================ */
:root {
  color-scheme: light dark;

  --paper: #faf7f2;
  --card: #ffffff;
  --ink: #2a2d3a;
  --ink-soft: #555a68;
  --muted: #676a79; /* 4.5:1 or better on every light background, the blue flight one included */
  --hair: #eceae4;

  --mint-tint: #d8efe2;
  --mint-bg: #edf7f1;
  --mint: #3e8a66;
  --mint-deep: #1f5a40;
  --mint-line: #86c9a6;

  --blue-tint: #dceaf8;
  --blue-bg: #edf3fb;
  --blue: #3f6fa8;
  --blue-deep: #1f3f66;
  --blue-line: #9dbbe0;

  --apricot-tint: #fce7d6;
  --apricot-ink: #8a4a1c;
  --late: #a5561f;
  --rose-tint: #f8dfe3;
  --rose-ink: #8c2f42;
  --lav-tint: #ece8f7;
  --lav-ink: #4a3f7a;
  --early: #2f7a55;

  --shadow: 0 1px 2px rgba(42, 45, 58, 0.04), 0 8px 24px rgba(42, 45, 58, 0.06);
  --radius-xl: 30px;
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --font-body: "Plus Jakarta Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;

  --spring: linear(0, 0.009, 0.035 2.1%, 0.141, 0.281 6.7%, 0.723 12.9%, 0.938 16.7%, 1.017, 1.077, 1.121,
      1.149 24.3%, 1.159, 1.163, 1.161, 1.154 29.9%, 1.129 32.8%, 1.051 39.6%, 1.017 43.1%, 0.991,
      0.977 51%, 0.974 53.8%, 0.975 57.1%, 0.997 69.8%, 1.003 76.9%, 1.004 83.8%, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);

  /* world defaults (overridden per mode) */
  --world: var(--paper);
  --tint: var(--mint-tint);
  --accent: var(--mint);
  --deep: var(--mint-deep);
  --line: var(--mint-line);
}

:root[data-theme="dark"] {
  color-scheme: dark;
    --paper: #16181d;
    --card: #1f222a;
    --ink: #ece9e3;
    --ink-soft: #c3c1bb;
    --muted: #a09fa6;
    --hair: #2b2e37;
    --mint-tint: #1f3a2e;
    --mint-bg: #141d19;
    --mint: #7ccaa2;
    --mint-deep: #b8e6cc;
    --mint-line: #3f8a66;
    --blue-tint: #1d2d44;
    --blue-bg: #131a24;
    --blue: #8db6e6;
    --blue-deep: #c8dcf5;
    --blue-line: #3f6fa8;
    --apricot-tint: #3d2a1c;
    --apricot-ink: #f3c39c;
    --late: #f0a870;
    --rose-tint: #3d2229;
    --rose-ink: #f2b3c0;
    --lav-tint: #2a2640;
    --lav-ink: #cdc5f2;
    --early: #7ccaa2;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    color-scheme: dark;
      --paper: #16181d;
      --card: #1f222a;
      --ink: #ece9e3;
      --ink-soft: #c3c1bb;
      --muted: #a09fa6;
      --hair: #2b2e37;
      --mint-tint: #1f3a2e;
      --mint-bg: #141d19;
      --mint: #7ccaa2;
      --mint-deep: #b8e6cc;
      --mint-line: #3f8a66;
      --blue-tint: #1d2d44;
      --blue-bg: #131a24;
      --blue: #8db6e6;
      --blue-deep: #c8dcf5;
      --blue-line: #3f6fa8;
      --apricot-tint: #3d2a1c;
      --apricot-ink: #f3c39c;
      --late: #f0a870;
      --rose-tint: #3d2229;
      --rose-ink: #f2b3c0;
      --lav-tint: #2a2640;
      --lav-ink: #cdc5f2;
      --early: #7ccaa2;
      --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
  }
}
:root[data-theme="light"] {
  color-scheme: light;
}

body[data-mode="train"] {
  --world: var(--mint-bg);
  --tint: var(--mint-tint);
  --accent: var(--mint);
  --deep: var(--mint-deep);
  --line: var(--mint-line);
}
body[data-mode="flight"] {
  --world: var(--blue-bg);
  --tint: var(--blue-tint);
  --accent: var(--blue);
  --deep: var(--blue-deep);
  --line: var(--blue-line);
}

/* ============================================================
   Base
   ============================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: calc(env(safe-area-inset-top, 0px) + 16px);
}
body {
  margin: 0;
  min-height: 100dvh;
  background: var(--world);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  transition: background-color 0.5s var(--ease-out);
  padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px)
    env(safe-area-inset-left, 0px);
}
/* paper grain, barely there */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.35;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 0 0.5 0 0 0 .05 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
main {
  position: relative;
  z-index: 1;
}
h1,
h2,
h3,
p {
  margin: 0;
}
button,
input {
  font: inherit;
  color: inherit;
}
a {
  color: inherit;
}
.tn {
  font-variant-numeric: tabular-nums;
}
.display {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "WONK" 0, "opsz" 72;
  font-weight: 450;
  letter-spacing: -0.01em;
  line-height: 1.08;
}
/* A displayed time: AM/PM set small, "+1" for a later day (see timeNode in util.js). */
.tm {
  white-space: nowrap;
}
.tm .ampm {
  font-family: var(--font-body);
  font-size: max(10.5px, 0.42em);
  font-weight: 700;
  letter-spacing: 0.02em;
  font-variation-settings: normal;
  color: inherit;
}
.tm .plus,
sup.plus {
  font-family: var(--font-body);
  font-size: max(10.5px, 0.36em);
  font-weight: 800;
  font-variation-settings: normal;
  color: var(--deep);
  margin-left: 2px;
  vertical-align: super;
  line-height: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}
.skip {
  position: absolute;
  left: 12px;
  top: -60px;
  background: var(--card);
  padding: 10px 14px;
  border-radius: 12px;
  z-index: 50;
}
.skip:focus {
  top: 12px;
}

.view {
  max-width: 460px;
  margin: 0 auto;
  padding: 20px 18px 48px;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.view[hidden] {
  display: none;
}

/* ============================================================
   Shared components
   ============================================================ */
.card {
  background: var(--card);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 20px;
}
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
}
.topbar-title {
  flex: 1;
  min-width: 0;
  text-align: center;
}
.topbar-title strong {
  display: block;
  font-size: 16px;
  font-weight: 800;
  color: var(--deep);
}
.topbar-title span {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.icon-btn {
  flex: none;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  background: var(--card);
  box-shadow: var(--shadow);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: var(--deep);
  text-decoration: none;
  transition: transform 0.35s var(--spring);
}
.icon-btn:active {
  transform: scale(0.92);
}
.icon-btn svg {
  width: 20px;
  height: 20px;
}
.icon-btn.spinning svg {
  animation: spin 0.9s linear infinite;
}
.spacer {
  width: 46px;
  flex: none;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  padding: 4px 11px;
  border-radius: 999px;
  white-space: nowrap;
  line-height: 1.4;
}
.chip.ok,
.chip.early {
  background: var(--mint-tint);
  color: var(--mint-deep);
}
.chip.late {
  background: var(--apricot-tint);
  color: var(--apricot-ink);
}
.chip.bad {
  background: var(--rose-tint);
  color: var(--rose-ink);
}
.chip.info {
  background: var(--lav-tint);
  color: var(--lav-ink);
}
.chip.accent {
  background: var(--deep);
  color: var(--card);
}
.chip.quiet {
  background: var(--hair);
  color: var(--muted);
  font-weight: 600;
}

.cta {
  min-height: 60px;
  border: 0;
  border-radius: 20px;
  background: var(--deep);
  color: var(--world);
  font-size: 17px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.4s var(--spring), filter 0.2s;
}
.cta:active {
  transform: scale(0.97);
}
.cta svg {
  width: 20px;
  height: 20px;
}
.cta.secondary {
  background: var(--card);
  color: var(--deep);
  box-shadow: var(--shadow);
}
.link-quiet {
  background: none;
  border: 0;
  min-height: 44px;
  padding: 0 10px;
  font-size: 12.5px;
  color: var(--muted);
  text-decoration: underline;
  text-decoration-color: color-mix(in srgb, var(--muted) 40%, transparent);
  text-underline-offset: 3px;
  cursor: pointer;
}

.banner {
  border-radius: var(--radius-md);
  padding: 12px 16px;
  font-size: 14px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.banner.info {
  background: var(--lav-tint);
  color: var(--lav-ink);
}
.banner svg {
  width: 18px;
  height: 18px;
  flex: none;
  margin-top: 2px;
}

/* ============================================================
   Home
   ============================================================ */
.home-head {
  padding: 36px 4px 12px;
}
.greet {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
}
.home-head h1 {
  font-size: clamp(36px, 10vw, 46px);
  margin-top: 6px;
}
.mode-cards {
  display: grid;
  gap: 16px;
}
@media (min-width: 720px) {
  #view-home {
    max-width: 820px;
  }
  .mode-cards {
    grid-template-columns: 1fr 1fr;
  }
}
.mode-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 264px;
  padding: 24px;
  border-radius: var(--radius-xl);
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.45s var(--spring), box-shadow 0.3s;
  box-shadow: var(--shadow);
}
.mode-card:active {
  transform: scale(0.97);
}
.mode-card.train {
  background: var(--mint-tint);
  color: var(--mint-deep);
}
.mode-card.flight {
  background: var(--blue-tint);
  color: var(--blue-deep);
}
.mode-art {
  height: 112px;
}
.mode-art svg {
  height: 100%;
  width: auto;
  overflow: visible;
}
.mode-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}
.mode-name {
  display: block;
  font-size: 34px;
  line-height: 1;
}
.mode-hint {
  display: block;
  margin-top: 8px;
  font-size: 14.5px;
  opacity: 0.85;
  max-width: 26ch;
}
.mode-go {
  flex: none;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
}
.mode-go svg {
  width: 22px;
  height: 22px;
}
.home-foot {
  margin-top: auto;
  text-align: center;
}

/* idle illustration motion */
.art-cloud {
  animation: drift 9s ease-in-out infinite alternate;
}
.art-cloud.two {
  animation-duration: 12s;
  animation-delay: -4s;
}
.art-plane {
  animation: bob 5s ease-in-out infinite;
  transform-origin: center;
  transform-box: fill-box;
}
.art-light {
  animation: glow 3.2s ease-in-out infinite;
}
.art-light.r {
  animation-delay: 0.4s;
}

/* ============================================================
   Search
   ============================================================ */
.search-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  flex: 1;
}
.search-form h1 {
  font-size: 36px;
  color: var(--deep);
  margin: 10px 0 6px;
}
.field-label,
.fieldset-legend {
  font-size: 14px;
  font-weight: 700;
  color: var(--deep);
  padding: 0;
}
.q-input {
  width: 100%;
  height: 76px;
  border-radius: 22px;
  border: 2px solid color-mix(in srgb, var(--accent) 45%, transparent);
  background: var(--card);
  padding: 0 22px;
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.q-input::placeholder {
  color: color-mix(in srgb, var(--muted) 50%, transparent);
  letter-spacing: 0.08em;
}
.q-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--accent) 18%, transparent);
}
.q-input[aria-invalid="true"] {
  border-color: var(--late);
}
.field-hint {
  font-size: 13.5px;
  color: var(--muted);
}
.field-error {
  font-size: 14px;
  font-weight: 600;
  color: var(--late);
}
.date-set {
  border: 0;
  margin: 8px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.date-readout {
  display: flex;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  font-size: 15px;
  font-weight: 700;
}
.search-form .cta {
  margin-top: auto;
}

/* ---------- flip date picker ---------- */
.flips {
  display: grid;
  grid-template-columns: 84px 112px minmax(0, 1fr);
  gap: 10px;
  margin-top: 8px;
}
.flip-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.nudge {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  display: grid;
  place-items: center;
}
.nudge:hover:not(:disabled) {
  background: var(--card);
}
.nudge:disabled {
  opacity: 0.25;
  cursor: default;
}
.nudge svg {
  width: 22px;
  height: 22px;
}
.flip {
  position: relative;
  width: 100%;
  height: 96px;
  border-radius: 18px;
  perspective: 420px;
  cursor: ns-resize;
  touch-action: none;
  user-select: none;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 40%, transparent), 0 10px 22px rgba(42, 45, 58, 0.08);
}
.flip-half,
.flip-flap {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  backface-visibility: hidden;
}
.flip-half.top,
.flip-flap.top {
  top: 0;
  border-radius: 18px 18px 0 0;
  background: var(--card);
}
.flip-half.bottom,
.flip-flap.bottom {
  bottom: 0;
  border-radius: 0 0 18px 18px;
  background: color-mix(in srgb, var(--card) 92%, var(--tint));
}
.flip-half span,
.flip-flap span {
  position: absolute;
  left: 0;
  right: 0;
  height: 200%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "opsz" 72;
  font-size: 44px;
  font-weight: 400;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.flip-half.top span,
.flip-flap.top span {
  top: 0;
}
.flip-half.bottom span,
.flip-flap.bottom span {
  bottom: 0;
}
.flip::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1.5px;
  background: color-mix(in srgb, var(--line) 35%, var(--hair));
  z-index: 3;
}
.flip-pin {
  position: absolute;
  top: 50%;
  width: 5px;
  height: 12px;
  margin-top: -6px;
  border-radius: 3px;
  background: color-mix(in srgb, var(--line) 35%, var(--hair));
  z-index: 4;
}
.flip-pin.l {
  left: -2px;
}
.flip-pin.r {
  right: -2px;
}
.flip-flap {
  display: none;
  z-index: 2;
}
.flip.flipping .flip-flap {
  display: block;
}
.flip.flipping .flip-flap.top {
  transform-origin: 50% 100%;
  animation: flapTop 0.2s ease-in forwards;
}
.flip.flipping .flip-flap.bottom {
  transform-origin: 50% 0%;
  transform: rotateX(90deg);
  animation: flapBottom 0.26s var(--ease-out) 0.18s forwards;
}
.flip.bump {
  animation: bump 0.35s var(--ease-out);
}
.flip-label {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--accent);
}

/* ============================================================
   Status: shared
   ============================================================ */
.hero-card {
  padding: 20px 20px 18px;
}
.hero-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.eyebrow-pin {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--accent);
}
.eyebrow-pin svg {
  width: 16px;
  height: 16px;
}
.pill-btn {
  border: 0;
  background: var(--world);
  color: var(--deep);
  font-size: 12.5px;
  font-weight: 700;
  padding: 0 14px;
  min-height: 36px;
  border-radius: 999px;
  cursor: pointer;
}
.hero-place {
  font-size: 28px;
  margin-top: 10px;
}
.hero-time-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-top: 2px;
}
.hero-time {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 380;
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
}
.hero-when {
  text-align: right;
  padding-bottom: 6px;
}
.hero-when span {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
}
.hero-when strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
}
.hero-chips {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.ribbon {
  position: relative;
  margin-top: 22px;
  height: 16px;
}
.ribbon-track,
.ribbon-fill {
  position: absolute;
  left: 0;
  top: 50%;
  height: 3px;
  margin-top: -1.5px;
  border-radius: 2px;
}
.ribbon-track {
  right: 0;
  background: var(--hair);
}
.ribbon-fill {
  background: var(--line);
  transform-origin: left;
  animation: grow 1.1s var(--ease-out) both;
}
.ribbon-dots {
  position: absolute;
  inset: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.ribbon-dots i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--hair);
  position: relative;
}
.ribbon-dots i.p {
  background: var(--line);
  border-color: var(--line);
}
.ribbon-dots i.c {
  width: 14px;
  height: 14px;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--tint);
}
.ribbon-dots i.m {
  width: 12px;
  height: 12px;
  background: var(--deep);
  border-color: var(--deep);
}
.ribbon-legend {
  display: flex;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 12.5px;
  color: var(--muted);
}
.ribbon-legend strong {
  color: var(--ink);
  font-weight: 700;
}

.now-card {
  background: var(--deep);
  color: var(--world);
  border-radius: var(--radius-md);
  padding: 16px 18px;
}
.now-card .now-lead {
  font-size: 13px;
  font-weight: 700;
  opacity: 0.75;
}
.now-card .now-text {
  font-size: 16.5px;
  line-height: 1.45;
  margin-top: 4px;
}
.now-card .now-text b {
  font-weight: 700;
}
.now-fresh {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
  font-size: 12.5px;
  opacity: 0.8;
}
.now-fresh i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint-line);
  animation: breathe 2.4s ease-in-out infinite;
}
.now-fresh.stale i {
  background: #cfc6f2;
  animation: none;
}

.map-card {
  padding: 0;
  overflow: hidden;
  position: relative;
}
.map-box {
  height: 300px;
  background: color-mix(in srgb, var(--tint) 60%, var(--card));
}
.map-box.tall {
  height: 340px;
}
.map-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  background: var(--card);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--deep);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow);
}
.map-badge i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #3fa46f;
  animation: breathe 2s ease-in-out infinite;
}
.map-badge.estimated i {
  background: #b3a9e6;
  animation: none;
}
.map-note {
  font-size: 12.5px;
  color: var(--muted);
  padding: 10px 16px 14px;
}
.map-marker {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--deep);
  border: 3px solid var(--card);
  box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 50%, transparent);
  animation: ring 2.2s ease-out infinite;
}
.map-plane {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--tint) 85%, transparent);
}
.map-plane svg {
  width: 22px;
  height: 22px;
  color: var(--deep);
}
.maplibregl-ctrl-attrib {
  font-size: 10.5px;
}

.section-title {
  font-size: 22px;
  margin: 10px 4px 0;
  color: var(--deep);
}

/* ---------- timeline ---------- */
.timeline {
  padding: 10px 4px 8px;
}
.tl-head {
  display: flex;
  gap: 10px;
  padding: 4px 14px 10px 44px;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  border-bottom: 1px solid var(--hair);
  margin-bottom: 4px;
}
.tl-head span:first-child {
  flex: 1;
}
.tl-head span:not(:first-child) {
  width: 50px;
  text-align: right;
}
.tl-row {
  --i: 0;
  display: flex;
  gap: 10px;
  width: 100%;
  min-height: 78px;
  padding: 0 14px 0 8px;
  border: 0;
  border-radius: 16px;
  background: none;
  text-align: left;
  cursor: pointer;
  animation: rowIn 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}
.tl-row:hover {
  background: color-mix(in srgb, var(--tint) 35%, transparent);
}
.tl-row.current {
  background: color-mix(in srgb, var(--tint) 55%, transparent);
}
.tl-row.mine .tl-name::after {
  content: "";
}
.tl-rail {
  position: relative;
  width: 22px;
  flex: none;
}
.tl-rail .seg {
  position: absolute;
  left: 9px;
  width: 4px;
  border-radius: 2px;
}
.tl-rail .seg.up {
  top: 0;
  height: 25px;
}
.tl-rail .seg.down {
  top: 25px;
  bottom: 0;
}
.seg.done {
  background: var(--line);
  transform-origin: top;
  animation: draw 0.5s var(--ease-out) both;
  animation-delay: calc(var(--i) * 45ms + 120ms);
}
.seg.ahead {
  width: 0;
  border-left: 4px dotted color-mix(in srgb, var(--line) 55%, var(--hair));
}
.seg.none {
  display: none;
}
.tl-dot {
  position: absolute;
  left: 3px;
  top: 17px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  box-sizing: border-box;
  background: var(--card);
  border: 3px solid color-mix(in srgb, var(--line) 70%, var(--hair));
}
.passed .tl-dot {
  background: var(--line);
  border-color: var(--line);
}
.current .tl-dot {
  background: var(--accent);
  border-color: var(--accent);
  animation: ring 2.2s ease-out infinite;
}
.mine .tl-dot {
  background: var(--deep);
  border-color: var(--deep);
  box-shadow: 0 0 0 4px var(--tint);
}
.tl-info {
  flex: 1;
  min-width: 0;
  padding: 12px 0 14px;
}
.tl-name {
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.3;
}
.passed .tl-name {
  color: var(--ink-soft);
  font-weight: 600;
}
.tl-code {
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
  margin-left: 6px;
  letter-spacing: 0.04em;
}
.tl-meta {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 2px;
}
.tl-info .chip {
  margin-top: 7px;
  font-size: 11.5px;
  padding: 3px 10px;
}
.tl-time {
  min-width: 50px;
  flex: none;
  white-space: nowrap;
  text-align: right;
  padding-top: 12px;
  font-variant-numeric: tabular-nums;
  display: flex;
  flex-direction: column;
}
.tl-time small {
  font-size: 12px;
  color: var(--muted);
  min-height: 17px;
}
.tl-time b {
  font-size: 15.5px;
  font-weight: 800;
}
.tl-time .ampm {
  font-size: 9.5px;
}
.tl-time .plus {
  font-size: 9.5px;
  margin-left: 1px;
}
/* Small phones: a little more room for station names beside two time columns. */
@media (max-width: 359px) {
  .tl-row {
    gap: 6px;
    padding-right: 8px;
  }
  .tl-time b {
    font-size: 14.5px;
  }
  .tl-time small {
    font-size: 11px;
  }
  .tl-name {
    font-size: 14.5px;
  }
}
.tl-code {
  display: inline-block; /* a station code never splits across lines */
}
.t-early {
  color: var(--early);
}
.t-late {
  color: var(--late);
}
.t-none {
  color: color-mix(in srgb, var(--muted) 45%, transparent);
}
.tl-fold,
.tl-day,
.tl-here {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 0 14px 0 8px;
  min-height: 54px;
}
.tl-fold button {
  flex: 1;
  border: 0;
  background: color-mix(in srgb, var(--tint) 40%, var(--card));
  border-radius: 16px;
  padding: 10px 14px;
  text-align: left;
  cursor: pointer;
  margin: 6px 0;
}
.tl-fold strong {
  display: block;
  font-size: 13.5px;
  color: var(--deep);
}
.tl-fold button span {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}
.tl-fold .tl-rail,
.tl-day .tl-rail,
.tl-here .tl-rail {
  align-self: stretch;
}
.tl-day .chip {
  margin: 8px 0;
}
.tl-here {
  font-size: 13px;
  font-weight: 700;
  color: var(--deep);
}
.tl-here .tl-dot {
  top: calc(50% - 8px);
  background: var(--accent);
  border-color: var(--accent);
  animation: ring 2.2s ease-out infinite;
}

/* ---------- good to know ---------- */
.gtk {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gtk-item {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}
.gtk-icon {
  flex: none;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: var(--lav-tint);
  color: var(--lav-ink);
}
.gtk-icon.warm {
  background: var(--apricot-tint);
  color: var(--apricot-ink);
}
.gtk-icon.cool {
  background: var(--tint);
  color: var(--deep);
}
.gtk-icon svg {
  width: 26px;
  height: 26px;
}
.gtk-item strong {
  display: block;
  font-size: 15px;
}
.gtk-item div > span {
  display: block;
  font-size: 13.5px;
  color: var(--muted);
  margin-top: 2px;
}
.coach-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 2px 8px;
  scrollbar-width: none;
}
.coach-strip i {
  flex: none;
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 9px;
  border-radius: 9px;
  background: var(--world);
  color: var(--deep);
}

/* ---------- flight specific ---------- */
.phase-banner {
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  background: var(--tint);
  color: var(--deep);
}
.phase-banner.good {
  background: var(--mint-tint);
  color: var(--mint-deep);
}
.phase-banner.warn {
  background: var(--apricot-tint);
  color: var(--apricot-ink);
}
.phase-banner.bad {
  background: var(--rose-tint);
  color: var(--rose-ink);
}
.phase-banner .lead {
  font-size: 13.5px;
  font-weight: 700;
  opacity: 0.85;
}
.phase-banner .big {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-weight: 380;
  font-size: 52px;
  line-height: 1.05;
  font-variant-numeric: tabular-nums;
}
.phase-banner .sub {
  font-size: 14.5px;
  font-weight: 600;
  margin-top: 6px;
}
.progress {
  height: 8px;
  border-radius: 4px;
  background: var(--card);
  margin-top: 16px;
  overflow: hidden;
}
.progress i {
  display: block;
  height: 100%;
  background: currentColor;
  border-radius: 4px;
  transform-origin: left;
  animation: grow 1s var(--ease-out) both;
}
.progress-legend {
  display: flex;
  justify-content: space-between;
  font-size: 12.5px;
  margin-top: 6px;
  opacity: 0.9;
}
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.stat {
  padding: 14px 12px;
  border-radius: 20px;
}
.stat span {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}
.stat strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
.leg {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 10px;
}
.leg-place {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
}
.leg-time {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}
.leg-time s {
  font-size: 14px;
  font-weight: 500;
  color: var(--muted);
  margin-left: 6px;
}
.leg-note {
  font-size: 13px;
  font-weight: 600;
  margin-top: 2px;
}
.leg-chips {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
}
.gate-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--tint);
  color: var(--deep);
  font-size: 15px;
  font-weight: 800;
  padding: 7px 12px;
  border-radius: 12px;
}
.gate-chip svg {
  width: 16px;
  height: 16px;
}
.gate-chip small {
  font-size: 11px;
  font-weight: 700;
  opacity: 0.75;
}
.leg-mid {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 16px 0;
  font-size: 12.5px;
  color: var(--muted);
}
.leg-mid i {
  flex: 1;
  border-top: 1.5px dashed color-mix(in srgb, var(--line) 60%, var(--hair));
}
.belt-hero {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: var(--accent);
  color: var(--card);
}
.belt-hero .belt-num {
  flex: none;
  width: 104px;
  height: 104px;
  border-radius: 26px;
  background: var(--card);
  color: var(--deep);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "opsz" 144;
  font-size: 60px;
  font-weight: 400;
}
.belt-hero strong {
  display: block;
  font-size: 20px;
  line-height: 1.25;
}
.belt-hero span {
  display: block;
  font-size: 13px;
  opacity: 0.85;
  margin-bottom: 4px;
}

/* ---------- loading, errors, misc ---------- */
.skel {
  border-radius: 12px;
  background: linear-gradient(90deg, var(--tint) 25%, color-mix(in srgb, var(--tint) 45%, var(--card)) 50%, var(--tint) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skel-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.slow-note {
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 16px 18px;
}
.slow-note svg {
  width: 36px;
  height: 36px;
  flex: none;
}
.slow-note .arc {
  transform-origin: 18px 18px;
  animation: spin 1s linear infinite;
}
.empty {
  text-align: center;
  padding: 40px 10px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
}
.empty svg {
  width: 180px;
  height: auto;
}
.empty h2 {
  font-size: 30px;
  color: var(--deep);
}
.empty p {
  color: var(--ink-soft);
  max-width: 34ch;
}
.actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
}
.legend-note {
  font-size: 12.5px;
  color: var(--muted);
  padding: 0 6px;
  line-height: 1.5;
}
.jump {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 22px);
  transform: translate(-50%, 140%);
  opacity: 0;
  z-index: 20;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
  font-weight: 700;
  padding: 0 20px;
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: transform 0.5s var(--spring), opacity 0.25s;
}
.jump.show {
  transform: translate(-50%, 0);
  opacity: 1;
}
.jump i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--mint-line);
}
.toast {
  position: fixed;
  left: 50%;
  top: calc(env(safe-area-inset-top, 0px) + 14px);
  transform: translate(-50%, calc(-100% - 40px));
  visibility: hidden;
  z-index: 40;
  background: var(--ink);
  color: var(--paper);
  padding: 10px 16px;
  border-radius: 14px;
  font-size: 14px;
  font-weight: 600;
  transition: transform 0.5s var(--spring);
}
.toast.show {
  transform: translate(-50%, 0);
  visibility: visible;
}

/* odometer-style change on refresh */
.tick {
  display: inline-block;
  animation: tick 0.55s var(--spring);
}

/* ---------- sources sheet ---------- */
.sheet {
  border: 0;
  padding: 0;
  margin: auto 0 0;
  width: 100%;
  max-width: 100%;
  max-height: 88dvh;
  border-radius: 30px 30px 0 0;
  background: var(--card);
  color: var(--ink);
}
@media (min-width: 720px) {
  .sheet {
    margin: auto;
    max-width: 460px;
    border-radius: 30px;
  }
}
.sheet::backdrop {
  background: rgba(20, 22, 28, 0.4);
}
.sheet[open] {
  animation: sheetIn 0.55s var(--spring);
}
.sheet-inner {
  padding: 12px 22px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sheet-grab {
  align-self: center;
  width: 40px;
  height: 5px;
  border-radius: 3px;
  background: var(--hair);
  margin-bottom: 10px;
}
.sheet-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.sheet-head h2 {
  font-size: 26px;
}
.sheet-head .icon-btn {
  box-shadow: none;
  background: var(--hair);
  color: var(--ink);
}
.src-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px solid var(--hair);
  font-size: 13.5px;
}
.src-row span:first-child {
  color: var(--muted);
}
.src-row span:last-child {
  font-weight: 600;
  text-align: right;
}
.sheet p {
  font-size: 12.5px;
  color: var(--muted);
  line-height: 1.55;
  margin-top: 12px;
}
.sheet a {
  color: var(--deep);
}

/* ============================================================
   View transitions (card grows into the search screen)
   ============================================================ */
::view-transition-old(root),
::view-transition-new(root) {
  animation-duration: 0.35s;
  animation-timing-function: var(--ease-out);
}
::view-transition-group(mode-surface) {
  animation-duration: 0.55s;
  animation-timing-function: var(--spring);
}
::view-transition-old(mode-surface),
::view-transition-new(mode-surface) {
  height: 100%;
  animation-duration: 0.3s;
}

/* ============================================================
   Keyframes
   ============================================================ */
@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}
@keyframes shimmer {
  to {
    background-position: -200% 0;
  }
}
@keyframes grow {
  from {
    transform: scaleX(0);
  }
}
@keyframes draw {
  from {
    transform: scaleY(0);
  }
}
@keyframes rowIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes ring {
  0% {
    box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent);
  }
  70% {
    box-shadow: 0 0 0 12px color-mix(in srgb, var(--accent) 0%, transparent);
  }
  100% {
    box-shadow: 0 0 0 0 transparent;
  }
}
@keyframes breathe {
  50% {
    opacity: 0.35;
  }
}
@keyframes flapTop {
  to {
    transform: rotateX(-90deg);
  }
}
@keyframes flapBottom {
  to {
    transform: rotateX(0deg);
  }
}
@keyframes bump {
  30% {
    transform: translateY(-4px);
  }
  60% {
    transform: translateY(2px);
  }
}
@keyframes tick {
  from {
    transform: translateY(55%);
    opacity: 0;
  }
}
@keyframes sheetIn {
  from {
    transform: translateY(40px);
    opacity: 0;
  }
}
@keyframes drift {
  to {
    transform: translateX(10px);
  }
}
@keyframes bob {
  50% {
    transform: translate(3px, -4px) rotate(-2deg);
  }
}
@keyframes glow {
  50% {
    opacity: 0.45;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    animation-delay: 0ms !important;
    transition-duration: 0.001ms !important;
  }
  ::view-transition-group(*),
  ::view-transition-old(*),
  ::view-transition-new(*) {
    animation: none !important;
  }
}

.status-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding-bottom: 64px;
}
.status-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.flight-head {
  padding: 4px 4px 0;
}

[data-focus]:focus {
  outline: none;
}
.gtk-item.coach-card {
  flex-wrap: wrap;
}
.gtk-item.coach-card > div:not(.coach-strip) {
  flex: 1;
  min-width: 0;
}
.gtk-item.coach-card .coach-strip {
  flex-basis: 100%;
  margin-top: 4px;
}
.maplibregl-ctrl-attrib,
.maplibregl-ctrl-attrib.maplibregl-compact {
  background: color-mix(in srgb, var(--card) 88%, transparent) !important;
  color: var(--muted);
}
.maplibregl-ctrl-attrib a {
  color: var(--muted);
}
.maplibregl-ctrl-attrib-button {
  background-color: color-mix(in srgb, var(--card) 88%, transparent) !important;
}
.leg-note.neutral {
  color: var(--muted);
}
.tl-fold .tl-dot,
.tl-day .tl-dot {
  display: none;
}

/* ============================================================
   Loader: a small journey that fills while data loads
   ============================================================ */
.loader {
  --p: 0;
  padding: 26px 22px 22px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.loader-title {
  font-size: 26px;
  color: var(--deep);
}
.loader-line {
  font-size: 15px;
  color: var(--ink-soft);
  min-height: 1.5em;
  animation: rowIn 0.4s var(--ease-out);
}
.loader-track {
  position: relative;
  height: 40px;
  margin: 22px 26px 8px 4px;
}
.loader-rail,
.loader-fill {
  position: absolute;
  left: 0;
  bottom: 9px;
  height: 4px;
  border-radius: 2px;
}
.loader-rail {
  right: 0;
  background: repeating-linear-gradient(90deg, color-mix(in srgb, var(--line) 45%, var(--hair)) 0 6px, transparent 6px 11px);
}
.loader-track.train .loader-rail {
  height: 8px;
  bottom: 7px;
  background: linear-gradient(var(--hair), var(--hair)) 0 0 / 100% 2px no-repeat,
    linear-gradient(var(--hair), var(--hair)) 0 100% / 100% 2px no-repeat,
    repeating-linear-gradient(90deg, var(--hair) 0 3px, transparent 3px 12px);
}
.loader-fill {
  width: calc(var(--p) * 100%);
  background: var(--accent);
}
.loader-vehicle {
  position: absolute;
  bottom: 10px;
  left: calc(var(--p) * 100%);
  transform: translateX(-70%);
  color: var(--deep);
  display: block;
}
.loader-vehicle.train svg {
  width: 50px;
  height: 25px;
  display: block;
  animation: chug 0.5s ease-in-out infinite alternate;
}
.loader-vehicle.flight {
  bottom: 2px;
}
.loader-vehicle.flight svg {
  width: 30px;
  height: 30px;
  transform: rotate(90deg);
  display: block;
  animation: glide 2.4s ease-in-out infinite;
}
.loader .lamp {
  animation: glow 1.2s ease-in-out infinite;
}
.loader-foot {
  font-size: 12.5px;
  color: var(--muted);
}
.loader.slow .loader-title {
  color: var(--late);
}
.loader.arriving .loader-line {
  opacity: 0.4;
  transition: opacity 0.3s;
}
.loader + .skel-card,
.loader ~ .skel-card {
  opacity: 0.55;
}
@keyframes chug {
  to {
    transform: translateY(-1.5px);
  }
}
@keyframes glide {
  50% {
    transform: rotate(90deg) translateX(-3px);
  }
}

/* ============================================================
   Appearance switch
   ============================================================ */
.home-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}
.home-top .menu-btn {
  margin-top: 30px;
}
.topbar .menu-btn {
  margin-left: auto;
}

/* Settings menu: a panel that grows out of the button at the top right */
.menu {
  position: fixed;
  inset: var(--menu-top, 72px) var(--menu-right, 16px) auto auto;
  margin: 0;
  width: min(340px, calc(100vw - 24px));
  max-height: calc(100dvh - var(--menu-top, 72px) - 12px);
  overflow: auto;
  border: 0;
  padding: 0;
  border-radius: var(--radius-lg);
  background: var(--card);
  color: var(--ink);
  box-shadow: 0 2px 6px rgba(20, 22, 28, 0.08), 0 24px 60px rgba(20, 22, 28, 0.22);
  transform-origin: top right;
}
.menu[open] {
  animation: menuIn 0.34s var(--spring);
}
.menu::backdrop {
  background: rgba(20, 22, 28, 0.18);
}
@keyframes menuIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.92);
  }
}
.menu-inner {
  padding: 14px 18px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.menu-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.menu-head h2 {
  font-size: 23px;
}
.menu-head .icon-btn {
  width: 38px;
  height: 38px;
  box-shadow: none;
  background: var(--hair);
  color: var(--ink);
}
.menu-links {
  margin-top: 12px;
  border-top: 1px solid var(--hair);
  padding-top: 6px;
}
.menu-link {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 48px;
  padding: 0 4px;
  border: 0;
  border-radius: 12px;
  background: none;
  font: inherit;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}
.menu-link:hover {
  background: color-mix(in srgb, var(--tint) 45%, transparent);
}
.menu-link svg {
  width: 19px;
  height: 19px;
  color: var(--muted);
}
.menu-link .menu-go {
  margin-left: auto;
  display: inline-flex;
}
.menu-link .menu-go svg {
  width: 16px;
  height: 16px;
}
.menu-note {
  font-size: 12px;
  color: var(--muted);
  margin-top: 4px;
}
@media (prefers-reduced-motion: reduce) {
  .menu[open] {
    animation: none;
  }
}
.segmented {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  border-radius: 16px;
  background: var(--hair);
  margin: 6px 0 4px;
}
.segmented button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: background 0.25s, color 0.25s;
}
.segmented button svg {
  width: 16px;
  height: 16px;
}
.segmented.two {
  grid-template-columns: repeat(2, 1fr);
}
.segmented button small {
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.03em;
  margin-left: -3px;
}
.segmented button[aria-checked="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
.sheet-label {
  font-size: 13px;
  font-weight: 700;
  color: var(--muted);
  margin-top: 10px;
}

/* ============================================================
   Picking your stop
   ============================================================ */
.stop-hint {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 13px;
  color: var(--muted);
}
.stop-hint svg {
  width: 17px;
  height: 17px;
  flex: none;
  color: var(--accent);
}
.tl-hint {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 12px 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint) 45%, var(--card));
  font-size: 13px;
  font-weight: 600;
  color: var(--deep);
}
.tl-hint svg {
  width: 18px;
  height: 18px;
  flex: none;
}
.timeline.picking .tl-hint {
  animation: nudgeHint 0.9s var(--spring) 2;
}
.timeline.picking .tl-row:not(.mine) {
  box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--accent) 35%, transparent);
  transition: box-shadow 0.3s;
}
@keyframes nudgeHint {
  40% {
    transform: scale(1.03);
  }
}

/* ============================================================
   Fact tiles (flights)
   ============================================================ */
.facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}
.fact {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  border-radius: 20px;
  min-height: 118px;
}
.fact-icon {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--deep);
}
.fact-icon.lav {
  background: var(--lav-tint);
  color: var(--lav-ink);
}
.fact-icon.warm {
  background: var(--apricot-tint);
  color: var(--apricot-ink);
}
.fact-icon svg {
  width: 24px;
  height: 24px;
}
.fact span {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}
.fact strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}
.fact small {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: -4px;
}
.fact.wide {
  grid-column: 1 / -1;
  flex-direction: row;
  align-items: center;
  gap: 14px;
  min-height: 0;
}
.fact.wide > div {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

/* ============================================================
   Errors and refresh problems
   ============================================================ */
.empty .err-icon {
  width: 84px;
  height: 84px;
  border-radius: 26px;
  display: grid;
  place-items: center;
  background: var(--tint);
  color: var(--deep);
}
.empty .err-icon svg {
  width: 44px;
  height: 44px;
}
.retry-note {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--muted);
}
.retry-ring {
  --k: 1;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: conic-gradient(var(--accent) calc(var(--k) * 360deg), var(--hair) 0);
  transition: background 1s linear;
}
.refresh-banner {
  background: var(--apricot-tint);
  color: var(--apricot-ink);
}

/* ============================================================
   Signature
   ============================================================ */
.credit {
  text-align: center;
  padding: 18px 10px 8px;
  margin-top: 6px;
  border-top: 1px dashed var(--hair);
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.credit-meta {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.credit-by {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 36;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink-soft);
  max-width: 32ch;
}
.credit-by a {
  color: var(--deep);
  font-weight: 700;
  text-decoration: none;
}
.credit-by svg {
  width: 15px;
  height: 15px;
  color: #e07a8b;
  vertical-align: -2px;
}
.credit-links {
  display: flex;
  gap: 14px;
  font-size: 12.5px;
  font-weight: 600;
}
.credit-links a {
  color: var(--muted);
  text-decoration: none;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
}
.credit-links a:hover {
  color: var(--accent);
}
.data-credit {
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  padding: 0 10px;
}
.data-credit a {
  color: inherit;
}
.credit-by svg path {
  fill: currentColor;
}
.home-foot {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fact.stretch {
  grid-column: 1 / -1;
  min-height: 0;
}
.fact.stretch {
  display: grid;
  grid-template-columns: 40px 1fr;
  column-gap: 14px;
  row-gap: 2px;
  align-items: center;
}
.fact.stretch .fact-icon {
  grid-row: 1 / span 3;
}

/* ============================================================
   Share preview
   ============================================================ */
.share-img {
  display: block;
  width: 100%;
  max-width: 340px;
  margin: 6px auto 14px;
  border-radius: 22px;
  box-shadow: var(--shadow);
  background: var(--hair);
  aspect-ratio: 4 / 5;
  object-fit: cover;
}
.share-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.share-actions .cta {
  min-height: 52px;
  font-size: 15.5px;
}

/* ============================================================
   Support
   ============================================================ */
.support-btn {
  grid-column: 1 / -1;
  margin-top: 10px;
  min-height: 48px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--apricot-tint);
  color: var(--apricot-ink);
  font-size: 15px;
  font-weight: 800;
  text-decoration: none;
  transition: transform 0.35s var(--spring);
}
.support-btn:active {
  transform: scale(0.97);
}
.support-btn svg {
  width: 20px;
  height: 20px;
}
/* Bubbles (chai, add to home screen): a round button that opens a small panel.
   Floating on desktop (chai on the right, install on the left), inline above the signature on phones. */
.bubble {
  display: flex; flex-direction: column; align-items: flex-end; gap: 12px;
  --glow-soft: rgba(138, 74, 28, 0.18); --glow-ring: rgba(176, 106, 52, 0.4);
}
.bubble.install { --glow-soft: rgba(31, 90, 64, 0.18); --glow-ring: rgba(62, 138, 102, 0.4); }
.bubble-float {
  position: fixed; bottom: calc(22px + env(safe-area-inset-bottom, 0px)); z-index: 30; display: none;
  pointer-events: none; /* only the button and an open panel take taps, not the empty space around them */
}
.chai.bubble-float { right: 22px; }
.install.bubble-float { left: 22px; align-items: flex-start; }
.bubble-float .bubble-btn { pointer-events: auto; }
/* Phones: two equal columns, each a pencil note curving down onto its button; panels open full width below */
.bubbles {
  display: grid; grid-template-columns: 1fr 1fr; column-gap: 20px; justify-items: center; align-items: end;
  width: 100%; max-width: 340px; margin: 4px auto 10px;
}
.bubbles > .bubble { display: contents; }
.bubbles .chai > * { grid-column: 1; }
.bubbles .install > * { grid-column: 2; }
.bubbles .bubble-note { grid-row: 1; }
.bubbles .bubble-btn { grid-row: 2; }
.bubbles .bubble > .bubble-panel { grid-row: 3; grid-column: 1 / -1; justify-self: stretch; }
:root:not([data-install]) .bubbles { grid-template-columns: 1fr; max-width: 380px; }
@media (min-width: 720px) {
  .bubble-float { display: flex; }
  .bubbles { display: none; }
}
/* Only offered where this browser can add it, and never once it's added */
:root:not([data-install]) .install { display: none; }
@media (display-mode: standalone) {
  .install { display: none; }
  .bubbles { grid-template-columns: 1fr; max-width: 380px; }
}
.bubble-btn {
  width: 56px; height: 56px; border: 0; border-radius: 50%;
  background: var(--apricot-tint); color: var(--apricot-ink);
  display: grid; place-items: center; cursor: pointer;
  animation: bubbleGlow 3.2s ease-in-out infinite;
  transition: transform 0.4s var(--spring);
}
.install .bubble-btn { background: var(--mint-tint); color: var(--mint-deep); animation-delay: 1.6s; }
.bubble-btn:hover { transform: scale(1.06); }
.bubble-btn:active { transform: scale(0.94); }
.bubble-btn svg { width: 28px; height: 28px; }
.bubble.open .bubble-btn { animation: none; box-shadow: 0 6px 18px var(--glow-soft); }
.bubble-panel {
  position: relative; width: 300px; padding: 18px 18px 16px; border-radius: 22px;
  background: var(--card); box-shadow: var(--shadow), 0 20px 40px rgba(42, 45, 58, 0.14);
  text-align: left; transform-origin: bottom right;
  opacity: 0; transform: translateY(10px) scale(0.9); visibility: hidden; pointer-events: none;
  transition: opacity 0.3s var(--ease-out), transform 0.45s var(--spring), visibility 0s 0.45s;
}
.install .bubble-panel { transform-origin: bottom left; }
.bubble.open .bubble-panel {
  opacity: 1; transform: none; visibility: visible; pointer-events: auto;
  transition: opacity 0.3s var(--ease-out), transform 0.55s var(--spring), visibility 0s;
}
.bubble.fading .bubble-panel { transition: opacity 1.4s ease, transform 1.4s ease, visibility 0s 1.4s; }
.bubbles .bubble-panel { display: none; width: auto; margin-top: 14px; transform-origin: top center; }
.bubbles .bubble.open .bubble-panel { display: block; animation: sheetIn 0.5s var(--spring); }
.bubble-panel strong { display: block; font-size: 15px; font-weight: 800; padding-right: 32px; }
.bubble-panel p { font-size: 13.5px; line-height: 1.5; color: var(--muted); margin-top: 4px; }
.bubble-close {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border: 0; border-radius: 50%;
  background: var(--hair); color: var(--muted); display: grid; place-items: center; cursor: pointer;
}
.bubble-close svg { width: 14px; height: 14px; }
@keyframes bubbleGlow {
  0%, 100% { box-shadow: 0 6px 18px var(--glow-soft), 0 0 0 0 var(--glow-ring); }
  60% { box-shadow: 0 6px 18px var(--glow-soft), 0 0 0 14px transparent; }
}

/* Add to home screen: the panel's steps and button */
.install .support-btn {
  width: 100%; border: 0; cursor: pointer; font: inherit; font-size: 15px; font-weight: 800;
  background: var(--mint-tint); color: var(--mint-deep);
}
.install-steps {
  list-style: none; margin: 12px 0 2px; padding: 0; counter-reset: step;
  display: grid; gap: 8px; font-size: 13.5px; line-height: 1.45; color: var(--ink-soft);
}
.install-steps li { counter-increment: step; display: flex; gap: 10px; align-items: flex-start; }
.install-steps li::before {
  content: counter(step); flex: none; width: 22px; height: 22px; border-radius: 50%;
  display: grid; place-items: center; background: var(--mint-tint); color: var(--mint-deep);
  font-size: 12px; font-weight: 800;
}
.install-steps b { color: var(--ink); font-weight: 800; }
.install-steps svg { width: 16px; height: 16px; vertical-align: -3px; color: var(--ink); }

/* Pencil notes pointing at the buttons, in each button's own ink */
.chai { --note: var(--apricot-ink); }
.install { --note: var(--mint-deep); }
.bubble-note {
  display: flex; flex-direction: column; align-items: center;
  font-family: "Caveat", "Segoe Print", "Bradley Hand", cursive; font-size: 19px; line-height: 0.95;
  color: var(--note); opacity: 0.9; text-align: center;
  pointer-events: none; user-select: none;
}
.bubble-note svg { flex: none; stroke-width: 2.2; stroke-dasharray: 1; animation: scribble 0.9s 0.4s ease-out both; }
.bubble-note span { animation: fadeIn 0.6s 0.9s ease-out both; }
/* phones: note above, arrow curving down onto the button */
.bubbles .bubble-note { max-width: 9em; margin-bottom: 2px; }
.bubbles .bubble-note span { order: -1; }
.bubbles .chai .bubble-note span { transform: rotate(-5deg); }
.bubbles .install .bubble-note span { transform: rotate(3deg); }
.bubble-note svg:first-child { display: none; width: 26px; height: 15px; }
.bubble-note svg:nth-child(2) { width: 18px; height: 21px; margin: 2px 0 0 14px; }
.bubbles .install .bubble-note svg:nth-child(2) { transform: scaleX(-1); margin: 2px 14px 0 0; }
/* desktop corners: note beside the button, arrow pointing at it */
.bubble-float .bubble-note {
  position: absolute; bottom: 18px; flex-direction: row; gap: 3px; white-space: nowrap;
  transform: rotate(-4deg); transition: opacity 0.3s var(--ease-out);
}
.bubble-float .bubble-note svg:first-child { display: block; }
.bubble-float .bubble-note svg:nth-child(2) { display: none; }
.install.bubble-float .bubble-note { left: 66px; }
.chai.bubble-float .bubble-note { right: 66px; flex-direction: row-reverse; transform: rotate(4deg); }
.chai.bubble-float .bubble-note svg:first-child { transform: scaleX(-1); }
.bubble-float.open .bubble-note { opacity: 0; }
@keyframes scribble {
  from { stroke-dashoffset: 1; }
  to { stroke-dashoffset: 0; }
}
@keyframes fadeIn {
  from { opacity: 0; }
}
@media (max-width: 340px) {
  .bubbles { column-gap: 12px; }
  .bubbles .bubble-note { font-size: 17px; }
}

/* Picture guides for Apple devices: two drawings with numbered captions */
.install.bubble-float .bubble-panel { width: 330px; }
.guide {
  list-style: none; margin: 12px 0 2px; padding: 0; counter-reset: step;
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}
.guide li { counter-increment: step; display: grid; gap: 8px; align-content: start; }
.guide-art { display: block; border-radius: 14px; background: var(--mint-bg); padding: 6px 4px 2px; }
.guide-art svg { display: block; width: 100%; height: auto; }
.guide-cap { display: block; font-size: 12.5px; line-height: 1.4; color: var(--ink-soft); }
.guide-cap::before {
  content: counter(step); display: inline-grid; place-items: center; width: 18px; height: 18px; margin-right: 6px;
  border-radius: 50%; background: var(--mint-tint); color: var(--mint-deep); font-size: 11px; font-weight: 800; vertical-align: 1px;
}
.guide-cap b { color: var(--ink); font-weight: 800; }
.guide .d { fill: var(--card); stroke: var(--muted); stroke-opacity: 0.45; stroke-width: 1.2; }
.guide .s { fill: var(--hair); }
.guide .i { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.guide .t { fill: var(--ink); font: 700 7px var(--font-body); }
.guide .t.sm { font-size: 6px; }
.guide .hl { fill: var(--mint-tint); }
.guide .m {
  fill: none; stroke: var(--mint-deep); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; animation: scribble 0.8s 0.25s ease-out both;
}
.guide li + li .m { animation-delay: 0.9s; }
.guide .p { fill: var(--mint); opacity: 0; transform-box: fill-box; transform-origin: center; animation: tapPulse 1.4s 1.1s ease-out 2; }
.guide li + li .p { animation-delay: 1.8s; }
@keyframes tapPulse {
  0% { opacity: 0.35; transform: scale(0.5); }
  100% { opacity: 0; transform: scale(1.8); }
}
.install-safari p { margin-top: 10px; }

/* ============================================================
   Route finder: find a train by its stations
   ============================================================ */

/* Train number or From and to: a pill slides under the chosen side */
.by-toggle {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 18px;
  background: color-mix(in srgb, var(--tint) 75%, var(--card));
  margin-bottom: 2px;
}
.by-toggle[hidden] {
  display: none;
}
.by-toggle::before {
  content: "";
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 14px;
  background: var(--card);
  box-shadow: var(--shadow);
  transition: transform 0.5s var(--spring);
}
.by-toggle[data-by="route"]::before {
  transform: translateX(100%);
}
.by-toggle button {
  position: relative;
  z-index: 1;
  min-height: 46px;
  border: 0;
  background: none;
  border-radius: 14px;
  font-size: 14.5px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: color 0.25s;
}
.by-toggle button svg {
  width: 17px;
  height: 17px;
}
.by-toggle button[aria-checked="true"] {
  color: var(--deep);
}
.by-panel {
  position: relative;
  z-index: 10; /* station suggestions open over the date cards below */
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.by-panel[hidden] {
  display: none;
}
.panel-in {
  animation: panelIn 0.4s var(--ease-out) both;
}

/* From and To, joined by a dotted line like a ticket */
.journey {
  position: relative;
  background: var(--card);
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 2px solid color-mix(in srgb, var(--accent) 28%, transparent);
  padding: 4px 70px 4px 50px;
  transition: border-color 0.2s, box-shadow 0.2s;
}
.journey:focus-within {
  border-color: var(--accent);
  box-shadow: var(--shadow), 0 0 0 5px color-mix(in srgb, var(--accent) 16%, transparent);
}
.journey::before {
  content: "";
  position: absolute;
  left: 24px;
  top: 42px;
  bottom: 42px;
  border-left: 2px dashed var(--line);
}
.jf {
  position: relative;
  padding: 12px 0 10px;
}
.jf + .jf {
  border-top: 1px solid var(--hair);
}
.jf::before {
  content: "";
  position: absolute;
  left: -32px;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -2px;
  border-radius: 50%;
  border: 3px solid var(--accent);
  background: var(--card);
  transition: background 0.3s, transform 0.4s var(--spring);
}
.jf[data-end="to"]::before {
  background: var(--accent);
}
.jf.picked::before {
  transform: scale(1.12);
}
.jf-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.jf-box {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
}
.jf-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: none;
  outline: none;
  padding: 2px 0;
  font-size: 21px;
  font-weight: 700;
  color: var(--deep);
  text-overflow: ellipsis;
}
.jf-input::placeholder {
  font-size: 17px;
  font-weight: 600;
  color: color-mix(in srgb, var(--muted) 60%, transparent);
}
.jf-input:focus-visible {
  outline: none;
}
.jf-input[aria-invalid="true"] {
  color: var(--late);
}
.jf-code {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.06em;
  padding: 3px 8px;
  border-radius: 8px;
  background: var(--tint);
  color: var(--deep);
}
.jf-code.pop {
  animation: codePop 0.45s var(--spring);
}
.jf-swap {
  position: absolute;
  right: 14px;
  top: 50%;
  width: 46px;
  height: 46px;
  margin-top: -23px;
  border-radius: 50%;
  border: 0;
  background: var(--tint);
  color: var(--deep);
  display: grid;
  place-items: center;
  cursor: pointer;
  transform: rotate(var(--spin, 0deg));
  transition: transform 0.55s var(--spring), background 0.2s;
}
.jf-swap:hover {
  background: color-mix(in srgb, var(--accent) 22%, var(--card));
}
.jf-swap:active {
  scale: 0.92;
}
.jf-swap svg {
  width: 21px;
  height: 21px;
}
/* the two stations trade places */
.journey.swapping .jf[data-end="from"] .jf-box {
  animation: swapDown 0.45s var(--ease-out);
}
.journey.swapping .jf[data-end="to"] .jf-box {
  animation: swapUp 0.45s var(--ease-out);
}

/* Suggestions under a station field */
.st-list {
  position: absolute;
  left: -52px;
  right: -72px;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--card);
  border-radius: 20px;
  box-shadow: var(--shadow), 0 18px 44px rgba(42, 45, 58, 0.18);
  max-height: min(340px, 52vh);
  overflow: auto;
  overscroll-behavior: contain;
  transform-origin: top center;
  animation: listIn 0.22s var(--ease-out);
}
.st-list[hidden] {
  display: none;
}
.jf.open {
  z-index: 31;
}
.st-head {
  padding: 8px 12px 4px;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}
.st-opt {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 8px 12px;
  border-radius: 14px;
  cursor: pointer;
  animation: rowIn 0.3s var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 6) * 22ms);
}
.st-opt:hover {
  background: color-mix(in srgb, var(--tint) 55%, transparent);
}
.st-opt[aria-selected="true"] {
  background: var(--tint);
}
.st-main {
  flex: 1;
  min-width: 0;
}
.st-name {
  display: block;
  font-weight: 700;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.st-name mark {
  background: color-mix(in srgb, var(--accent) 24%, transparent);
  color: inherit;
  border-radius: 4px;
  padding: 0 1px;
}
.st-sub {
  display: block;
  font-size: 12.5px;
  color: var(--muted);
}
.st-code {
  flex: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: var(--deep);
  padding: 2px 7px;
  border: 1.5px solid var(--hair);
  border-radius: 8px;
}
.st-empty {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 12px;
  font-size: 14px;
  color: var(--muted);
}
.st-spin {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2.5px solid var(--tint);
  border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

/* Leaving after: a time, or a quick pick */
.time-set {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}
.time-set[hidden] {
  display: none;
}
.time-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.time-input {
  min-width: 118px;
  height: 48px;
  border-radius: 14px;
  border: 2px solid color-mix(in srgb, var(--accent) 35%, transparent);
  background: var(--card);
  padding: 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  color-scheme: inherit;
}
.time-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
}
.time-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 4px 2px 6px;
  margin: -4px -2px -6px;
}
.time-chips::-webkit-scrollbar {
  display: none;
}
.time-chip {
  flex: none;
  min-height: 40px;
  padding: 0 15px;
  border: 0;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink-soft);
  cursor: pointer;
  transition: background 0.2s, color 0.2s, transform 0.35s var(--spring);
}
.time-chip:active {
  transform: scale(0.94);
}
.time-chip[aria-pressed="true"] {
  background: var(--deep);
  color: var(--card);
}

/* ---------- results ---------- */
.route-card {
  padding: 18px 18px 14px;
}
.rc-ends {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  align-items: end;
  gap: 6px;
}
.rc-end strong {
  display: block;
  font-size: 22px;
  line-height: 1.12;
  color: var(--deep);
  overflow-wrap: break-word;
}
.rc-ends.long strong {
  font-size: 19px;
}
.rc-ends.xlong strong {
  font-size: 17px;
}
.rc-end.to {
  text-align: right;
}
.rc-code {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 2px;
}
.rc-mid {
  position: relative;
  height: 20px;
  align-self: center;
}
.rc-mid i {
  position: absolute;
  left: 0;
  right: 0;
  top: 9px;
  border-top: 2px dashed var(--line);
}
.rc-mid b {
  position: absolute;
  top: 4px;
  left: 0;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent);
  left: calc(50% - 6px); /* parked in the middle once results are in */
}
.rc-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--hair);
}
.rc-when {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  min-width: 0;
}
.rc-when strong {
  font-size: 15px;
  color: var(--ink);
  white-space: nowrap;
}
.rc-when span {
  font-size: 12.5px;
  color: var(--muted);
}
.day-step {
  flex: none;
  min-height: 42px;
  min-width: 64px;
  padding: 0 10px;
  border: 0;
  border-radius: 14px;
  background: var(--tint);
  color: var(--deep);
  font-size: 13.5px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  cursor: pointer;
  transition: transform 0.35s var(--spring), opacity 0.2s;
}
.day-step:active:not(:disabled) {
  transform: scale(0.94);
}
.day-step:disabled {
  opacity: 0.35;
  cursor: default;
}
.day-step svg {
  width: 15px;
  height: 15px;
}
/* Small phones: arrows only, so the date stays on one line (the label still names the day). */
@media (max-width: 359px) {
  .day-step {
    min-width: 44px;
    padding: 0;
  }
  .day-step span {
    display: none;
  }
}
.rc-count {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px;
  padding: 2px 4px 0;
  font-size: 14px;
  color: var(--ink-soft);
}
.rc-count strong {
  color: var(--deep);
}
.rc-count span {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--muted);
}

.train-list,
.other-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.tcard {
  position: relative;
  display: block;
  padding: 16px 16px 12px;
  border-radius: var(--radius-lg);
  background: var(--card);
  box-shadow: var(--shadow);
  color: inherit;
  text-decoration: none;
  animation: rowIn 0.45s var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 8) * 45ms);
  transition: transform 0.35s var(--spring), box-shadow 0.25s;
}
.tcard.linked:hover {
  box-shadow: var(--shadow), 0 12px 30px rgba(42, 45, 58, 0.09);
}
.tcard.linked:has(.tc-link:active) {
  transform: scale(0.985);
}
.tcard.settled {
  animation: none; /* redrawn in place (seats opened): don't replay the entrance */
}
/* The whole card opens live status; this empty link is stretched over it. */
.tc-link::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  z-index: 1;
}
.tc-link:focus-visible {
  outline: none;
}
.tc-link:focus-visible::after {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.tc-body {
  display: block;
}
.tcard.muted {
  background: color-mix(in srgb, var(--card) 55%, transparent);
  box-shadow: none;
  border: 1.5px dashed var(--hair);
}
.tcard.skel-card {
  gap: 12px;
}
.tc-flags {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
}
.tc-times {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
}
.tc-t {
  font-family: var(--font-display);
  font-variation-settings: "SOFT" 100, "opsz" 72;
  font-size: 30px;
  line-height: 1;
  color: var(--deep);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.tc-t .plus {
  vertical-align: 12px;
}
.tc-line {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--muted);
  white-space: nowrap;
}
.tc-line i {
  flex: 1;
  height: 0;
  border-top: 2px dashed var(--line);
}
.tc-codes {
  display: flex;
  justify-content: space-between;
  margin-top: 4px;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.07em;
  color: var(--muted);
}
.tc-name {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 10px;
  font-weight: 700;
  line-height: 1.35;
  color: var(--ink);
}
.tc-no {
  flex: none;
  font-size: 13px;
  font-weight: 800;
  color: var(--muted);
}
.tc-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}
.tc-tags:empty {
  display: none;
}
.tc-days {
  display: inline-flex;
  gap: 3px;
}
.tc-days b {
  width: 20px;
  height: 20px;
  border-radius: 6px;
  display: grid;
  place-items: center;
  font-size: 10.5px;
  font-weight: 800;
  color: color-mix(in srgb, var(--muted) 55%, transparent);
  background: var(--hair);
}
.tc-days b.on {
  background: var(--tint);
  color: var(--deep);
}
.tc-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px dashed var(--hair);
  font-size: 13.5px;
  font-weight: 700;
}
.tc-go {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--deep);
}
.tc-go svg {
  width: 17px;
  height: 17px;
  transition: transform 0.35s var(--spring);
}
.tcard.linked:hover .tc-go svg {
  transform: translateX(3px);
}
.tc-later {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
}
.tc-later svg {
  width: 16px;
  height: 16px;
}
.live-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  animation: ring 2s ease-out infinite;
}
.fold-btn {
  width: 100%;
  min-height: 52px;
  border: 1.5px dashed color-mix(in srgb, var(--accent) 40%, transparent);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tint) 45%, transparent);
  color: var(--deep);
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
}
.fold-btn svg {
  width: 17px;
  height: 17px;
}
.ocard {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 12px 12px 16px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--card) 60%, transparent);
  border: 1.5px dashed var(--hair);
  animation: rowIn 0.45s var(--ease-out) both;
  animation-delay: calc(min(var(--i, 0), 8) * 45ms + 120ms);
}
.oc-main {
  flex: 1;
  min-width: 0;
}
.ocard .tc-name {
  margin-top: 0;
  font-size: 15px;
}
.oc-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--ink-soft);
}
.oc-next {
  flex: none;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: var(--tint);
  color: var(--deep);
  font-size: 13px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
}
.oc-next svg {
  width: 15px;
  height: 15px;
}
.empty.compact {
  padding-top: 18px;
}
.empty.compact svg {
  width: 150px;
}
.empty.compact .cta {
  margin-top: 6px;
  padding: 0 24px;
}
.foot-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 100%;
}

@keyframes panelIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}
@keyframes listIn {
  from {
    opacity: 0;
    transform: translateY(-6px) scaleY(0.96);
  }
}
@keyframes codePop {
  0% {
    transform: scale(0.6);
    opacity: 0;
  }
}
@keyframes swapDown {
  0% {
    transform: translateY(-34px);
    opacity: 0.2;
  }
}
@keyframes swapUp {
  0% {
    transform: translateY(34px);
    opacity: 0.2;
  }
}
@keyframes ride {
  0% {
    left: 0;
    opacity: 0;
  }
  15% {
    opacity: 1;
  }
  85% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 12px);
    opacity: 0;
  }
}
.oc-meta sup.plus {
  font-size: 10.5px;
  font-weight: 800;
  color: var(--late);
  margin-left: 2px;
}
.fold-btn.quiet {
  border-color: var(--hair);
  background: transparent;
  color: var(--ink-soft);
}

/* ============================================================
   Seats: live availability inside a train card
   ============================================================ */
.tc-seats {
  position: relative;
  z-index: 2; /* above the card's stretched link */
  margin-top: 12px;
}
.seat-row {
  display: flex;
  align-items: center;
  gap: 10px;
}
.seat-label {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.seat-classes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.seat-cls {
  min-width: 44px;
  min-height: 36px;
  padding: 0 11px;
  border: 1.5px solid var(--hair);
  border-radius: 12px;
  background: var(--card);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s, color 0.2s, transform 0.35s var(--spring);
}
.seat-cls:hover {
  border-color: var(--line);
}
.seat-cls:active {
  transform: scale(0.94);
}
.seat-cls.on {
  background: var(--deep);
  border-color: var(--deep);
  color: var(--card);
}
.seat-panel {
  margin-top: 10px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--tint) 45%, var(--card));
  animation: seatOpen 0.35s var(--ease-out) both;
  transform-origin: top center;
}
.seat-panel[hidden] {
  display: none;
}
@keyframes seatOpen {
  from {
    opacity: 0;
    transform: translateY(-6px) scale(0.98);
  }
}
.seat-loading {
  display: grid;
  gap: 8px;
}
.seat-loading .skel {
  display: block;
}
.seat-body,
.seat-error {
  display: grid;
  gap: 10px;
  animation: seatFade 0.3s var(--ease-out) both;
}
@keyframes seatFade {
  from {
    opacity: 0;
  }
}
.seat-error p {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.seat-error .pill-btn {
  justify-self: start;
}
.seat-now {
  --s-bg: var(--hair);
  --s-ink: var(--muted);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--card);
}
.seat-now.available {
  --s-bg: var(--mint-tint);
  --s-ink: var(--early);
}
.seat-now.rac {
  --s-bg: var(--apricot-tint);
  --s-ink: var(--apricot-ink);
}
.seat-now.waitlist {
  --s-bg: var(--rose-tint);
  --s-ink: var(--rose-ink);
}
.seat-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--s-ink);
  box-shadow: 0 0 0 5px var(--s-bg);
  margin: 0 3px;
}
.seat-what strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--s-ink);
  line-height: 1.2;
}
.seat-now:not(.available):not(.rac):not(.waitlist) .seat-what strong {
  color: var(--ink-soft);
}
.seat-what span {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  margin-top: 1px;
}
.seat-fare {
  text-align: right;
}
.seat-fare strong {
  display: block;
  font-size: 17px;
  font-weight: 800;
  color: var(--ink);
}
.seat-fare span {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
}
.seat-chance {
  --c: var(--rose-ink);
  display: grid;
  gap: 5px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ink-soft);
}
.seat-chance.mid {
  --c: var(--apricot-ink);
}
.seat-chance.high {
  --c: var(--early);
}
.seat-chance i {
  position: relative;
  display: block;
  height: 6px;
  border-radius: 99px;
  background: var(--hair);
  overflow: hidden;
}
.seat-chance i::after {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--p);
  border-radius: inherit;
  background: var(--c);
  animation: seatGrow 0.8s var(--ease-out) 0.1s both;
}
@keyframes seatGrow {
  from {
    width: 0;
  }
}
.seat-hint {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-soft);
}
.seat-next-label {
  display: block;
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 6px;
}
.seat-next ol {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.seat-next li {
  --s-ink: var(--muted);
  padding: 7px 8px;
  border-radius: 11px;
  background: var(--card);
  border-left: 3px solid var(--s-ink);
}
.seat-next li.available {
  --s-ink: var(--early);
}
.seat-next li.rac {
  --s-ink: var(--apricot-ink);
}
.seat-next li.waitlist {
  --s-ink: var(--rose-ink);
}
.seat-next b {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: var(--muted);
}
.seat-next span {
  display: block;
  font-size: 13px;
  font-weight: 800;
  color: var(--s-ink);
}
.seat-src {
  font-size: 11.5px;
  font-weight: 600;
  color: var(--muted);
}
.seat-src a {
  color: var(--deep);
  font-weight: 800;
}
.seat-quota {
  display: inline-grid;
  grid-template-columns: 1fr 1fr;
  justify-self: start;
  gap: 3px;
  padding: 3px;
  border-radius: 12px;
  background: var(--hair);
}
.seat-quota button {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ink-soft);
  cursor: pointer;
}
.seat-quota button[aria-checked="true"] {
  background: var(--card);
  color: var(--ink);
  box-shadow: var(--shadow);
}
@media (prefers-reduced-motion: reduce) {
  .seat-panel,
  .seat-body,
  .seat-error,
  .seat-chance i::after {
    animation: none;
  }
}
/* Small phones: keep the journey line readable between two 12-hour times, and stack the fare. */
@media (max-width: 359px) {
  .tc-times {
    gap: 8px;
  }
  .tc-t {
    font-size: 25px;
  }
  .seat-now {
    grid-template-columns: auto minmax(0, 1fr);
  }
  .seat-fare {
    grid-column: 2;
    text-align: left;
  }
  .seat-fare strong,
  .seat-fare span {
    display: inline;
  }
  .seat-fare span {
    margin-left: 6px;
  }
}

/* ============================================================
   Flight results
   ============================================================ */
.tc-line.fly i {
  border-top-style: dotted;
  border-top-width: 3px;
}
.rc-mid.fly i {
  border-top-style: dotted;
  border-top-width: 3px;
}
.tc-t.was .tm {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  text-decoration-color: color-mix(in srgb, var(--late) 70%, transparent);
}
.fc-now {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 13px;
  font-weight: 800;
  color: var(--late);
}
.fc-now svg {
  width: 15px;
  height: 15px;
}
.fc-meta {
  display: block;
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.fcard.cancelled .tc-t,
.fcard.cancelled .tc-codes {
  color: var(--muted);
}
.fcard.cancelled .tc-t .tm {
  text-decoration: line-through;
}

/* The highlighted suggestion sits on a tinted background: keep its second line readable. */
.st-opt[aria-selected="true"] .st-sub {
  color: var(--ink-soft);
}

/* The rider on the route card travels only while results load. */
.route-card.loading .rc-mid b {
  animation: ride 2.6s var(--ease-out) infinite;
}
/* Flights: a small plane instead of a dot */
.rc-mid.fly b {
  top: 0;
  width: 20px;
  height: 20px;
  left: calc(50% - 10px);
  background: none;
  box-shadow: none;
  color: var(--accent);
}
.route-card.loading .rc-mid.fly b {
  animation-name: fly;
}
.rc-mid.fly b svg {
  display: block;
  width: 20px;
  height: 20px;
  transform: rotate(90deg);
}
@keyframes fly {
  0% {
    left: 0;
    opacity: 0;
    transform: translateY(3px);
  }
  15% {
    opacity: 1;
  }
  50% {
    transform: translateY(-2px);
  }
  85% {
    opacity: 1;
  }
  100% {
    left: calc(100% - 20px);
    opacity: 0;
    transform: translateY(3px);
  }
}
@media (prefers-reduced-motion: reduce) {
  .route-card.loading .rc-mid b {
    animation: none;
  }
}

/* Trains using a station near the one asked for */
.section-sub {
  font-size: 13px;
  line-height: 1.45;
  color: var(--muted);
  margin: 2px 2px 14px;
}
/* Placeholder bars take the sizes they're given while results load */
.skel-card .skel {
  display: block;
}
.tc-codes .near {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--apricot-tint);
  color: var(--apricot-ink);
}
.tc-near {
  display: grid;
  gap: 3px;
  margin-top: 8px;
}
.tc-near span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--apricot-ink);
}
.tc-near svg {
  flex: none;
  width: 15px;
  height: 15px;
}

/* ============================================================
   Live island
   ============================================================ */
.island {
  --isl-bg: #0b0c0f;
  --isl-ink: #f5f3ef;
  --isl-soft: #9a9fab;
  --isl-accent: #8fd3ad;
  --isl-ease: cubic-bezier(0.32, 0.72, 0, 1);
  position: fixed;
  z-index: 40;
  top: max(10px, env(safe-area-inset-top, 0px));
  left: 50%;
  display: flex;
  align-items: flex-start;
  gap: 4px;
  width: max-content;
  max-width: min(440px, calc(100vw - 20px));
  padding: 10px;
  border-radius: 32px;
  background: var(--isl-bg);
  color: var(--isl-ink);
  overflow: hidden;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    0 0 0 0.5px rgba(255, 255, 255, 0.06),
    0 4px 12px rgba(5, 6, 8, 0.18),
    0 18px 40px -12px rgba(5, 6, 8, 0.5);
  /* hidden: a small pill tucked up at the top, ready to grow */
  transform: translate(-50%, -10px) scale(0.42, 0.6);
  transform-origin: 50% 0;
  opacity: 0;
  pointer-events: none;
  transition:
    transform 0.55s var(--isl-ease),
    opacity 0.22s ease;
}
.island[data-mode="flight"] {
  --isl-accent: #b3d4f7;
}
.island.show {
  transform: translate(-50%, 0) scale(1);
  opacity: 1;
  pointer-events: auto;
}
/* the content arrives a beat after the capsule, like the real thing */
.island > * {
  opacity: 0;
  transition: opacity 0.25s ease;
}
.island.show > * {
  opacity: 1;
  transition: opacity 0.35s ease 0.14s;
}
.isl-open {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-width: 0;
  padding: 0 4px 0 0;
  border: 0;
  border-radius: 24px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: transform 0.3s var(--isl-ease);
}
.isl-open:active {
  transform: scale(0.975);
}
.isl-icon {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.07);
  color: var(--isl-accent);
}
.isl-ring {
  position: absolute;
  inset: 0;
  width: 44px;
  height: 44px;
  transform: rotate(-90deg);
  opacity: 0;
  transition: opacity 0.3s;
}
.isl-ring.on {
  opacity: 1;
}
.isl-ring circle {
  fill: none;
  stroke-width: 2.4;
}
.isl-ring-track {
  stroke: rgba(255, 255, 255, 0.1);
}
.isl-ring-bar {
  stroke: var(--isl-accent);
  stroke-linecap: round;
  transition: stroke-dashoffset 0.9s var(--isl-ease);
}
.isl-glyph {
  position: relative;
  display: grid;
  place-items: center;
}
.isl-glyph svg {
  width: 20px;
  height: 20px;
}
.island[data-mode="flight"] .isl-glyph svg {
  width: 18px;
  height: 18px;
  transform: rotate(45deg);
}
/* a soft live pulse while the train runs or the plane flies */
.isl-live {
  position: absolute;
  top: 1px;
  right: 1px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--isl-accent);
  box-shadow: 0 0 0 2px var(--isl-bg);
  opacity: 0;
}
.island.live .isl-live {
  opacity: 1;
  animation: islLive 2.2s ease-in-out infinite;
}
@keyframes islLive {
  0%,
  100% {
    box-shadow: 0 0 0 2px var(--isl-bg), 0 0 0 2px color-mix(in srgb, var(--isl-accent) 50%, transparent);
  }
  50% {
    box-shadow: 0 0 0 2px var(--isl-bg), 0 0 0 7px color-mix(in srgb, var(--isl-accent) 0%, transparent);
  }
}
.isl-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.isl-icon {
  flex: none;
}
.isl-chip {
  flex: none;
}
.isl-text {
  display: grid;
  gap: 1px;
  flex: 1 1 auto;
  min-width: 0;
  line-height: 1.25;
}
.isl-top {
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: 0.01em;
  color: var(--isl-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.isl-age {
  color: #e6b98f;
}
.isl-main {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-variant-numeric: tabular-nums;
}
.isl-main b {
  color: var(--isl-accent);
  font-weight: 750;
}
.isl-when {
  font-weight: 550;
  color: var(--isl-soft);
}
.isl-main .tm .plus {
  color: var(--isl-accent);
}
.isl-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 11px 6px 9px;
  border-radius: 99px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.07);
  color: var(--isl-ink);
}
.isl-chip[hidden] {
  display: none;
}
.isl-chip i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}
.isl-chip.ok,
.isl-chip.early {
  color: #9ee0bb;
  background: rgba(143, 211, 173, 0.12);
}
.isl-chip.late {
  color: #f4bf93;
  background: rgba(240, 168, 112, 0.13);
}
.isl-chip.bad {
  color: #f5b9c5;
  background: rgba(242, 179, 192, 0.13);
}
.isl-chip.accent,
.isl-chip.info {
  color: #c7ddf7;
  background: rgba(179, 212, 247, 0.12);
}
/* a second row of small capsules, only when there's more to say */
.isl-detail {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0 0 56px;
}
.isl-detail[hidden] {
  display: none;
}
.isl-detail span {
  padding: 4px 10px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 650;
  color: #c9ccd4;
  white-space: nowrap;
}
/* pin: keeps the island on every screen, and after closing the app */
.isl-pin {
  flex: none;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin: 4px 0 0 4px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--isl-soft);
  cursor: pointer;
  transition:
    background 0.25s,
    color 0.25s,
    transform 0.4s var(--isl-ease);
}
.isl-pin:hover {
  background: rgba(255, 255, 255, 0.07);
}
.isl-pin svg {
  width: 17px;
  height: 17px;
}
.isl-pin[aria-pressed="true"] {
  background: color-mix(in srgb, var(--isl-accent) 18%, transparent);
  color: var(--isl-accent);
  transform: rotate(-20deg);
}
.isl-pin:active {
  transform: scale(0.88);
}
.isl-open:focus-visible,
.isl-pin:focus-visible {
  outline: 2px solid var(--isl-accent);
  outline-offset: 2px;
}
/* pages make room for a pinned island instead of sliding under it */
body.island-pinned .view {
  padding-top: calc(20px + var(--island-space, 0px));
  transition: padding-top 0.45s var(--ease-out);
}
.pin-btn[aria-pressed="true"] {
  background: var(--deep);
  color: var(--card);
}
@media (max-width: 359px) {
  .isl-detail {
    margin-left: 0;
  }
}
@media (prefers-reduced-motion: reduce) {
  .island,
  .island > *,
  .isl-ring-bar {
    transition: opacity 0.2s;
  }
  .island {
    transform: translate(-50%, 0);
  }
  .island.live .isl-live {
    animation: none;
  }
}

/* How often a status screen checks, with a kind "Why?" */
.fresh {
  margin: -4px 4px 0;
}
.fresh-note {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 7px;
  line-height: 1.5;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--muted);
}
.fresh-note svg {
  width: 14px;
  height: 14px;
  margin-top: 2.5px;
}
.fresh-why {
  display: inline-block;
  margin-left: 2px;
  border: 0;
  padding: 2px 9px;
  border-radius: 99px;
  background: var(--hair);
  color: var(--ink-soft);
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}
.fresh-why[aria-expanded="true"] {
  background: var(--tint);
  color: var(--deep);
}
.fresh-more {
  margin-top: 8px;
  padding: 10px 12px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--tint) 45%, var(--card));
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-soft);
  animation: seatFade 0.3s var(--ease-out) both;
}

/* ============================================================
   Finish: calmer motion, quieter depth, crisper type
   One layer on top of everything above, so the whole app moves and sits the same way.
   ============================================================ */
:root {
  /* A spring that settles instead of bouncing (a touch of overshoot, not 16%) */
  --spring: linear(0, 0.006, 0.025 2.8%, 0.101 6.1%, 0.539 18.9%, 0.721 25.3%, 0.849 31.5%, 0.937 38.1%, 0.968 41.8%, 0.991 45.7%, 1.006 50.1%, 1.015 55%, 1.017 63.9%, 1.01 76%, 1.003 86.4%, 1);
  --ease-out: cubic-bezier(0.32, 0.72, 0, 1);
  /* depth from a hairline edge and soft layered light, not one heavy blur */
  --shadow: 0 0 0 1px rgba(42, 45, 58, 0.045), 0 1px 2px rgba(42, 45, 58, 0.04), 0 6px 16px -6px rgba(42, 45, 58, 0.07), 0 20px 40px -18px rgba(42, 45, 58, 0.1);
  --shadow-lift: 0 0 0 1px rgba(42, 45, 58, 0.05), 0 2px 4px rgba(42, 45, 58, 0.05), 0 12px 28px -8px rgba(42, 45, 58, 0.12), 0 32px 60px -24px rgba(42, 45, 58, 0.16);
}
:root[data-theme="dark"] {
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -10px rgba(0, 0, 0, 0.45);
  --shadow-lift: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
}
@media (prefers-color-scheme: dark) {
  :root[data-theme="auto"] {
    --shadow: 0 0 0 1px rgba(255, 255, 255, 0.05), 0 1px 2px rgba(0, 0, 0, 0.3), 0 10px 28px -10px rgba(0, 0, 0, 0.45);
    --shadow-lift: 0 0 0 1px rgba(255, 255, 255, 0.07), 0 2px 4px rgba(0, 0, 0, 0.35), 0 18px 40px -12px rgba(0, 0, 0, 0.55);
  }
}

/* Type: balanced headings, no lonely last words, steadier numbers */
h1,
h2,
.display {
  text-wrap: balance;
  letter-spacing: -0.015em;
}
p,
.tc-name,
.seat-hint {
  text-wrap: pretty;
}
::selection {
  background: color-mix(in srgb, var(--accent) 28%, transparent);
}

/* Cards lift a little under a pointer and settle under a finger */
@media (hover: hover) {
  .tcard.linked,
  .mode-card {
    transition: transform 0.45s var(--ease-out), box-shadow 0.45s var(--ease-out);
  }
  .tcard.linked:hover,
  .mode-card:hover {
    box-shadow: var(--shadow-lift);
    transform: translateY(-2px);
  }
}
.mode-card:active,
.tcard.linked:has(.tc-link:active) {
  transform: scale(0.985);
  transition-duration: 0.2s;
}

/* The main button: a soft sheen and an inner edge of light */
.cta:not(.secondary) {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0) 55%),
    var(--deep);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.14),
    0 1px 2px rgba(20, 22, 28, 0.12),
    0 10px 24px -10px color-mix(in srgb, var(--deep) 70%, transparent);
}
.cta:active {
  transform: scale(0.975);
}

/* Round buttons: a hairline edge instead of a heavy shadow */
.icon-btn {
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--ink) 6%, transparent), 0 2px 8px -2px rgba(20, 22, 28, 0.08);
  transition: transform 0.3s var(--ease-out), background 0.25s, box-shadow 0.25s;
}
.icon-btn:active {
  transform: scale(0.9);
}

/* Toasts: the same glassy capsule as the island */
.toast {
  background: rgba(14, 15, 19, 0.88);
  color: #f5f3ef;
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  backdrop-filter: blur(16px) saturate(1.4);
  border-radius: 999px;
  padding: 11px 18px;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 30px -10px rgba(5, 6, 8, 0.45);
  transition: transform 0.5s var(--ease-out), visibility 0.5s;
}

/* Chips and the segmented controls sit a touch more precisely */
.chip {
  letter-spacing: 0.005em;
}
.segmented button {
  transition: background 0.3s var(--ease-out), color 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
}

/* Loading placeholders breathe instead of flashing */
.skel {
  animation-duration: 1.8s;
  animation-timing-function: var(--ease-out);
}

/* Sheets and the settings menu: softer backdrops */
.sheet::backdrop,
.menu::backdrop {
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

/* iPhone browsers: Open in Safari, and Copy link */
.install-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}
.install .install-actions .support-btn {
  margin-top: 8px;
}
.install .support-btn.quiet {
  background: transparent;
  box-shadow: inset 0 0 0 1.5px var(--mint-tint);
  color: var(--mint-deep);
}
.install-alt {
  margin-top: 10px;
  font-size: 12.5px;
  color: var(--muted);
}
