:root {
  color-scheme: light;
  --bg: #f4f7f7;
  --surface: #ffffff;
  --surface-subtle: #f9fbfb;
  --surface-warm: #fffaf0;
  --surface-field: #ffffff;
  --surface-code: rgba(15, 118, 110, 0.1);
  --ink: #17202a;
  --muted: #60717d;
  --line: #d7e0e3;
  --line-strong: #b9c7cc;
  --accent: #0f766e;
  --accent-strong: #0b5f59;
  --blue: #1d4ed8;
  --ok: #15803d;
  --warn: #b45309;
  --danger: #be123c;
  --radius: 8px;
  --shadow: 0 18px 42px rgba(23, 32, 42, 0.08);
  --body-gradient-start: rgba(15, 118, 110, 0.06);
  --body-gradient-end: rgba(244, 247, 247, 0);
  --topbar-bg: rgba(255, 255, 255, 0.92);
  --brand-mark-bg: var(--ink);
  --brand-mark-ink: #ffffff;
  --primary-ink: #ffffff;
  --segmented-bg: #eef5f4;
  --textarea-bg: #fbfcfc;
  --textarea-ink: #1f2933;
  --focus-ring: rgba(15, 118, 110, 0.22);
  --accent-soft: rgba(15, 118, 110, 0.1);
  --accent-softer: rgba(15, 118, 110, 0.08);
  --ok-soft: rgba(21, 128, 61, 0.08);
  --ok-border: rgba(21, 128, 61, 0.28);
  --warn-soft: rgba(180, 83, 9, 0.08);
  --warn-border: rgba(180, 83, 9, 0.28);
  --danger-soft: rgba(190, 18, 60, 0.18);
  --danger-border: rgba(190, 18, 60, 0.26);
  --hover-shadow: 0 10px 24px rgba(15, 118, 110, 0.12);
  --active-shadow: 0 12px 24px rgba(15, 118, 110, 0.1);
  --control-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  --menu-shadow: 0 18px 34px rgba(23, 32, 42, 0.16);
  --recommendation-bg: #102426;
  --recommendation-ink: #ffffff;
  --recommendation-muted: rgba(255, 255, 255, 0.72);
  --recommendation-soft: rgba(255, 255, 255, 0.12);
  --recommendation-softer: rgba(255, 255, 255, 0.08);
  --recommendation-empty-bg: rgba(255, 255, 255, 0.86);
  --error-bg: #fff1f4;
  --error-copy: #7f1d1d;
  --no-vehicle-bg: #fffaf0;
  --no-vehicle-copy: #7c2d12;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0f1718;
  --surface: #162326;
  --surface-subtle: #1a2a2d;
  --surface-warm: #2d2819;
  --surface-field: #101b1d;
  --surface-code: rgba(45, 212, 191, 0.14);
  --ink: #edf7f5;
  --muted: #9badad;
  --line: #294246;
  --line-strong: #3b5b61;
  --accent: #2dd4bf;
  --accent-strong: #5eead4;
  --blue: #8fb6ff;
  --ok: #74d891;
  --warn: #facc15;
  --danger: #fb7185;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.32);
  --body-gradient-start: rgba(45, 212, 191, 0.12);
  --body-gradient-end: rgba(15, 23, 24, 0);
  --topbar-bg: rgba(13, 23, 25, 0.92);
  --brand-mark-bg: #d7fffa;
  --brand-mark-ink: #0e1a1c;
  --primary-ink: #061816;
  --segmented-bg: #102024;
  --textarea-bg: #101b1d;
  --textarea-ink: #edf7f5;
  --focus-ring: rgba(45, 212, 191, 0.3);
  --accent-soft: rgba(45, 212, 191, 0.16);
  --accent-softer: rgba(45, 212, 191, 0.12);
  --ok-soft: rgba(116, 216, 145, 0.14);
  --ok-border: rgba(116, 216, 145, 0.34);
  --warn-soft: rgba(250, 204, 21, 0.14);
  --warn-border: rgba(250, 204, 21, 0.34);
  --danger-soft: rgba(251, 113, 133, 0.16);
  --danger-border: rgba(251, 113, 133, 0.34);
  --hover-shadow: 0 10px 24px rgba(45, 212, 191, 0.12);
  --active-shadow: 0 12px 24px rgba(45, 212, 191, 0.12);
  --control-shadow: 0 1px 4px rgba(0, 0, 0, 0.32);
  --menu-shadow: 0 18px 34px rgba(0, 0, 0, 0.42);
  --recommendation-bg: #0b2729;
  --recommendation-ink: #eefdfb;
  --recommendation-muted: rgba(238, 253, 251, 0.74);
  --recommendation-soft: rgba(238, 253, 251, 0.14);
  --recommendation-softer: rgba(238, 253, 251, 0.09);
  --recommendation-empty-bg: rgba(22, 35, 38, 0.86);
  --error-bg: #351722;
  --error-copy: #fecdd3;
  --no-vehicle-bg: #322716;
  --no-vehicle-copy: #fde68a;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, var(--body-gradient-start), var(--body-gradient-end) 260px),
    var(--bg);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

.app-shell {
  min-height: 100svh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 64px;
  padding: 12px 24px;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: inherit;
  text-decoration: none;
}

.topbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.theme-toggle {
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: var(--accent-strong);
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--brand-mark-bg);
  color: var(--brand-mark-ink);
  font-size: 13px;
  font-weight: 800;
}

.brand strong,
.brand small {
  display: block;
  line-height: 1.1;
}

.brand strong {
  font-size: 15px;
}

.brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.workspace {
  width: min(1400px, calc(100% - 32px));
  margin: 0 auto;
  padding: 26px 0 44px;
  display: grid;
  grid-template-columns: minmax(360px, 0.85fr) minmax(420px, 1fr);
  gap: 24px;
  align-items: start;
}

.planner-column,
.results-column {
  min-width: 0;
  display: grid;
  gap: 16px;
}

.results-column {
  position: sticky;
  top: 88px;
}

body.empty-route-library .workspace {
  grid-template-columns: minmax(360px, 920px);
  justify-content: center;
}

body.empty-route-library .planner-column,
body.empty-route-library .results-column {
  display: none;
}

body.empty-route-library .empty-route-onboarding {
  display: grid;
}

body.empty-route-onboarding-awaiting-scroll .empty-route-onboarding {
  grid-column: 1 / -1;
  display: grid;
  width: min(100%, 920px);
  justify-self: center;
}

.section-label {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
  text-transform: uppercase;
}

.planner-head {
  display: grid;
  gap: 12px;
  padding: 6px 0 2px;
  scroll-margin-top: 96px;
}

.planner-head > span {
  display: grid;
  gap: 8px;
}

.planner-head small {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.journey-search-panel {
  position: relative;
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-top: 3px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  animation: panel-in 360ms ease both;
}

.journey-search-form {
  display: grid;
  gap: 14px;
}

.journey-place-fields {
  position: relative;
  display: grid;
  gap: 1px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--line);
}

.journey-place-field {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 2px 10px;
  min-width: 0;
  padding: 14px 48px 13px 14px;
  background: var(--surface-field);
}

.journey-place-field:first-child {
  border-radius: 7px 7px 0 0;
}

.journey-place-field:last-child {
  border-radius: 0 0 7px 7px;
}

.journey-point-marker {
  grid-row: 1 / 4;
  align-self: center;
  width: 11px;
  height: 11px;
  margin-left: 2px;
  border: 3px solid var(--accent);
  border-radius: 50%;
  background: var(--surface-field);
}

.journey-point-marker.destination {
  border-radius: 2px;
  border-color: var(--ink);
}

.journey-place-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
}

.journey-place-field input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 17px;
  font-weight: 760;
}

.journey-place-field input::placeholder {
  color: var(--line-strong);
  font-weight: 620;
}

.journey-place-field:focus-within {
  z-index: 3;
  box-shadow: inset 3px 0 0 var(--accent);
}

.journey-field-hint {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-swap-button {
  position: absolute;
  z-index: 4;
  top: 50%;
  right: 13px;
  width: 36px;
  min-height: 36px;
  padding: 0;
  border-color: var(--line-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--control-shadow);
  transform: translateY(-50%);
}

.journey-swap-button:hover {
  border-color: var(--accent);
  transform: translateY(-50%) rotate(180deg);
}

.journey-place-results {
  position: absolute;
  z-index: 12;
  top: calc(100% - 4px);
  left: 42px;
  right: 12px;
  max-height: 280px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--menu-shadow);
}

.journey-place-results[hidden] {
  display: none;
}

.journey-place-option {
  display: grid;
  gap: 3px;
  width: 100%;
  min-height: 54px;
  padding: 9px 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.journey-place-option:hover,
.journey-place-option[data-active="true"] {
  background: var(--accent-softer);
}

.journey-place-option span {
  font-size: 14px;
  font-weight: 780;
}

.journey-place-option small,
.journey-place-empty,
.journey-place-error {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.journey-place-empty,
.journey-place-error {
  padding: 12px;
}

.journey-place-error {
  color: var(--danger);
}

.journey-search-button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 50px;
  padding: 0 17px;
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary-ink);
  font-size: 14px;
  font-weight: 850;
}

.journey-search-button:hover:not(:disabled) {
  background: var(--accent-strong);
}

.journey-search-button:disabled {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 1;
}

.journey-search-status {
  min-height: 18px;
  font-size: 12px;
  font-weight: 720;
}

.journey-search-status:empty {
  display: none;
}

.journey-search-status.ok {
  color: var(--ok);
}

.journey-search-status.warn {
  color: var(--warn);
}

.journey-search-status.error {
  color: var(--danger);
}

.journey-route-results {
  display: grid;
  gap: 10px;
  padding-top: 2px;
  border-top: 1px solid var(--line);
  animation: panel-in 280ms ease both;
}

.journey-route-results[hidden] {
  display: none;
}

.journey-route-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.journey-route-list {
  display: grid;
  gap: 8px;
}

.journey-route-option {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.journey-route-option:hover {
  border-color: var(--line-strong);
  transform: translateY(-1px);
}

.journey-route-option.selected {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: inset 3px 0 0 var(--accent);
}

.journey-route-select {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 68px;
  padding: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.journey-route-rank {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.journey-route-summary,
.journey-route-heading {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.journey-route-heading {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 8px;
}

.journey-route-heading strong {
  font-size: 20px;
  line-height: 1;
}

.journey-route-heading span,
.journey-route-meta {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-route-action {
  color: var(--accent-strong);
  font-size: 11px;
  font-weight: 850;
  white-space: nowrap;
}

.journey-route-steps {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0 12px 10px 50px;
  list-style: none;
}

.journey-route-step {
  position: relative;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  color: var(--ink);
}

.journey-route-step::before {
  content: "";
  position: absolute;
  top: -50%;
  bottom: 50%;
  left: 5px;
  width: 1px;
  background: var(--line-strong);
}

.journey-route-step:first-child::before {
  display: none;
}

.journey-step-dot {
  position: relative;
  z-index: 1;
  width: 11px;
  height: 11px;
  border: 3px solid var(--surface-subtle);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.journey-route-step.walk .journey-step-dot {
  width: 8px;
  height: 8px;
  margin-left: 1px;
  border: 0;
  background: var(--line-strong);
  box-shadow: none;
}

.journey-route-step > span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.journey-route-step b,
.journey-route-step em {
  font-size: 11px;
  font-style: normal;
}

.journey-route-step small {
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journey-route-step em {
  color: var(--muted);
}

.journey-route-warning {
  margin: 0 12px 12px 50px;
  color: var(--warn);
  font-size: 11px;
}

.journey-route-loading,
.journey-route-empty {
  display: grid;
  gap: 8px;
  min-height: 104px;
  place-content: center;
  justify-items: center;
  padding: 18px;
  text-align: center;
}

.journey-route-loading span {
  width: 24px;
  height: 24px;
  border: 3px solid var(--line);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: journey-spin 800ms linear infinite;
}

.journey-route-empty.error b {
  color: var(--danger);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  max-width: 720px;
  font-size: 38px;
  line-height: 1.08;
}

h2 {
  font-size: 18px;
  line-height: 1.2;
}

h3 {
  font-size: 15px;
}

p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.empty-route-onboarding {
  display: none;
  gap: 26px;
  min-height: calc(100svh - 150px);
  align-content: center;
  padding: 48px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--surface) 92%, var(--accent) 8%), var(--surface-subtle)),
    var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
  scroll-margin-top: 20px;
}

.onboarding-stage-copy {
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
  animation: onboarding-title-arrive 900ms linear both;
}

.onboarding-stage-copy > span {
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  text-transform: uppercase;
}

.onboarding-stage-copy h2 {
  max-width: 620px;
  font-size: 56px;
  line-height: 1.04;
  word-break: keep-all;
}

.onboarding-headline-keep {
  white-space: nowrap;
}

.onboarding-stage-copy p {
  max-width: 520px;
  font-size: 15px;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.onboarding-transit-demo {
  display: grid;
  gap: 16px;
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  animation: onboarding-demo-arrive 780ms 900ms linear both;
}

.onboarding-route-compare {
  display: grid;
  gap: 12px;
}

.onboarding-stop-labels {
  position: relative;
  display: block;
  min-height: 18px;
  margin-left: 42px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.onboarding-stop-labels span {
  position: absolute;
  top: 0;
  white-space: nowrap;
  transform: translateX(-50%);
}

.onboarding-stop-labels span:first-child {
  left: 2%;
  text-align: left;
  transform: translateX(-10%);
}

.onboarding-stop-labels span:nth-child(2) {
  left: 34%;
}

.onboarding-stop-labels span:nth-child(3) {
  left: 68%;
}

.onboarding-stop-labels span:last-child {
  left: 98%;
  text-align: right;
  transform: translateX(-90%);
}

.onboarding-trip-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  opacity: 0;
  transform: translateY(10px);
  animation: onboarding-card-rise 520ms linear both;
}

.onboarding-trip-row.route-a {
  animation-delay: 1300ms;
}

.onboarding-trip-row.route-b {
  animation-delay: 1300ms;
}

.onboarding-trip-label {
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--surface);
  font-size: 13px;
  font-weight: 900;
}

.onboarding-trip-row.route-b .onboarding-trip-label {
  background: var(--accent);
}

.onboarding-route-line {
  position: relative;
  min-height: 68px;
}

.onboarding-rail {
  position: absolute;
  left: 2%;
  right: 2%;
  top: 26px;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--blue), var(--accent), var(--ok));
  transform-origin: left center;
  animation: onboarding-route-draw 1500ms linear both;
}

.onboarding-trip-row.route-a .onboarding-rail {
  animation-delay: 1550ms;
}

.onboarding-trip-row.route-b .onboarding-rail {
  animation-delay: 1550ms;
}

.onboarding-station {
  position: absolute;
  top: 15px;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--accent);
  box-shadow: var(--control-shadow);
  opacity: 0;
  transform: scale(0.7);
  animation: onboarding-station-pop 520ms linear both;
}

.onboarding-station.start {
  left: calc(2% - 12px);
}

.onboarding-station.transfer-one {
  left: calc(34% - 12px);
  background: var(--blue);
}

.onboarding-station.transfer-two {
  left: calc(68% - 12px);
  background: var(--accent);
}

.onboarding-station.end {
  right: calc(2% - 12px);
  background: var(--ok);
}

.onboarding-node-time {
  position: absolute;
  top: 43px;
  min-width: 42px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  text-align: center;
  opacity: 0;
  transform: translate(-50%, 8px);
  animation: onboarding-card-rise 420ms linear both;
}

.onboarding-node-time.start {
  left: 2%;
  text-align: left;
  transform: translate(-10%, 8px);
}

.onboarding-node-time.transfer-one {
  left: 34%;
}

.onboarding-node-time.transfer-two {
  left: 68%;
}

.onboarding-node-time.end {
  right: 2%;
  left: auto;
  text-align: right;
  transform: translate(0, 8px);
}

.onboarding-trip-row.route-a .onboarding-station.start {
  animation-delay: 1933ms;
}

.onboarding-trip-row.route-a .onboarding-station.transfer-one {
  animation-delay: 2800ms;
}

.onboarding-trip-row.route-a .onboarding-station.transfer-two {
  animation-delay: 4467ms;
}

.onboarding-trip-row.route-a .onboarding-station.end {
  animation-delay: 6133ms;
}

.onboarding-trip-row.route-a .onboarding-node-time.start {
  animation-delay: 2083ms;
}

.onboarding-trip-row.route-a .onboarding-node-time.transfer-one {
  animation-delay: 2950ms;
}

.onboarding-trip-row.route-a .onboarding-node-time.transfer-two {
  animation-delay: 4617ms;
}

.onboarding-trip-row.route-a .onboarding-node-time.end {
  animation-delay: 6283ms;
}

.onboarding-trip-row.route-b .onboarding-station.start {
  animation-delay: 2933ms;
}

.onboarding-trip-row.route-b .onboarding-station.transfer-one {
  animation-delay: 3667ms;
}

.onboarding-trip-row.route-b .onboarding-station.transfer-two {
  animation-delay: 4600ms;
}

.onboarding-trip-row.route-b .onboarding-station.end {
  animation-delay: 6267ms;
}

.onboarding-trip-row.route-b .onboarding-node-time.start {
  animation-delay: 3083ms;
}

.onboarding-trip-row.route-b .onboarding-node-time.transfer-one {
  animation-delay: 3817ms;
}

.onboarding-trip-row.route-b .onboarding-node-time.transfer-two {
  animation-delay: 4750ms;
}

.onboarding-trip-row.route-b .onboarding-node-time.end {
  animation-delay: 6417ms;
}

.onboarding-vehicle {
  position: absolute;
  left: 2%;
  top: -2px;
  z-index: 1;
  display: grid;
  max-width: 88px;
  min-width: 72px;
  padding: 7px 10px;
  place-items: center;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: 12px;
  font-weight: 850;
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  overflow: hidden;
  transform: translateX(var(--onboarding-vehicle-translate-x, -50%));
}

.onboarding-trip-row.route-b .onboarding-vehicle {
  background: var(--accent-strong);
}

.onboarding-takeaway {
  margin: 0;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--ok-border);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--ok-soft) 72%, var(--surface));
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
  opacity: 0;
  transform: translateY(12px);
  animation: onboarding-card-rise 620ms 6750ms linear both;
}

.onboarding-takeaway span {
  display: block;
  word-break: keep-all;
}

.onboarding-emphasis {
  position: relative;
  display: inline-block;
  margin-inline: 3px;
  color: var(--danger);
  font-weight: 950;
  isolation: isolate;
}

.onboarding-emphasis::before {
  content: "";
  position: absolute;
  inset: -4px -8px -3px;
  border: 2px solid var(--danger-border);
  border-radius: 999px;
  background: var(--danger-soft);
  transform: rotate(-2deg);
  z-index: -1;
}

.onboarding-input-cue {
  display: grid;
  grid-template-columns: minmax(18px, 1fr) auto minmax(18px, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  animation: onboarding-card-rise 620ms 7400ms ease-out both;
}

.onboarding-cue-line {
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, transparent, var(--accent));
}

.onboarding-cue-line + span + .onboarding-cue-line,
.onboarding-input-cue::after {
  height: 1px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), transparent);
}

.onboarding-input-cue::after {
  content: "";
}

.onboarding-input-cue > span:last-child {
  min-width: 0;
}

.onboarding-next {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  opacity: 0;
  animation: onboarding-card-rise 560ms 7200ms linear both;
}

.usage-example,
.route-builder-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.usage-example summary,
.route-builder-panel summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: 12px 16px;
  color: var(--ink);
  cursor: pointer;
}

.usage-example summary::-webkit-details-marker,
.route-builder-panel summary::-webkit-details-marker {
  display: none;
}

.usage-example summary h1,
.usage-example summary small,
.route-builder-panel summary b,
.route-builder-panel summary small {
  display: block;
}

.usage-example summary h1,
.route-builder-panel summary b {
  max-width: none;
  font-size: 18px;
  line-height: 1.2;
}

.usage-example summary small,
.route-builder-panel summary small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.usage-example summary::after,
.route-builder-panel summary::after {
  content: '펼치기';
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
  white-space: nowrap;
}

.usage-example[open] summary,
.route-builder-panel[open] summary {
  border-bottom: 1px solid var(--line);
}

.usage-example[open] summary::after {
  content: '접기';
}

.route-builder-panel summary::after {
  content: '열기';
}

.route-builder-panel[open] summary::after {
  content: '닫기';
}

.usage-example-body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.example-candidates {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.example-option {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.example-option.better {
  border-color: var(--ok-border);
  background: var(--ok-soft);
}

.example-option strong {
  font-size: 15px;
  line-height: 1.2;
}

.example-option dl {
  display: grid;
  gap: 7px;
  margin: 0;
}

.example-option dl div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.example-option dt,
.example-option dd {
  margin: 0;
  font-size: 13px;
  line-height: 1.3;
}

.example-option dt {
  color: var(--muted);
  font-weight: 750;
}

.example-option dd {
  color: var(--ink);
  font-weight: 850;
  text-align: right;
}

.example-takeaway {
  color: var(--accent-strong);
  font-weight: 750;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: var(--surface-code);
  color: var(--accent-strong);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.92em;
}

button {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 750;
  transition:
    transform 160ms ease,
    border-color 160ms ease,
    background 160ms ease,
    box-shadow 160ms ease;
}

button:hover {
  border-color: var(--accent);
  box-shadow: var(--hover-shadow);
  transform: translateY(-1px);
}

button:focus-visible,
textarea:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

button:disabled {
  cursor: wait;
  opacity: 0.62;
  transform: none;
}

.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--primary-ink);
}

.primary:hover {
  background: var(--accent-strong);
  color: var(--primary-ink);
}

.input-shell,
.saved-routes-panel,
.editor-shell,
.resolver-panel,
.candidate-panel,
.timeline-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

.input-toolbar,
.editor-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex: 0 0 auto;
  flex-wrap: wrap;
}

.route-builder-toolbar {
  justify-content: flex-end;
  padding-bottom: 8px;
}

.segmented-control {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--segmented-bg);
  flex: 0 0 auto;
}

.segmented-control button {
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.segmented-control button[aria-pressed="true"] {
  background: var(--surface);
  color: var(--accent-strong);
  box-shadow: var(--control-shadow);
}

.action-button {
  flex: 0 0 auto;
  padding: 0 14px;
  min-width: 80px;
}

.secondary {
  background: var(--surface);
  color: var(--accent-strong);
}

.route-builder {
  display: grid;
  gap: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.route-builder-panel {
  display: grid;
  gap: 0;
}

.saved-routes-panel {
  display: grid;
  gap: 0;
}

.saved-routes-panel[hidden] {
  display: none;
}

.builder-destination-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.builder-destination-field span,
.builder-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.builder-destination-field input,
.builder-field input,
.builder-field select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface-field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.builder-station-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.builder-station-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  min-width: 0;
}

.route-builder-legs {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.route-builder-footer {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding: 0 16px 16px;
}

.builder-leg-row {
  display: grid;
  grid-template-columns: 32px minmax(84px, 0.7fr) minmax(104px, 0.75fr) minmax(190px, 2fr) auto;
  gap: 8px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.builder-leg-index {
  display: grid;
  width: 28px;
  height: 40px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.builder-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  position: relative;
}

.builder-field.compact {
  min-width: 68px;
}

.builder-remove-button {
  min-width: 56px;
  padding: 0 10px;
}

.builder-advanced {
  grid-column: 2 / -1;
  min-width: 0;
}

.builder-advanced summary {
  width: fit-content;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-field);
  color: var(--accent-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.builder-advanced-fields {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.saved-route-controls {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 0 16px 14px;
}

.saved-route-controls[hidden] {
  display: none;
}

.saved-route-controls label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.saved-route-controls select {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 10px;
  background: var(--surface-field);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
}

.link-import-status {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.link-import-status.ok {
  color: var(--ok);
  font-weight: 750;
}

.link-import-status.warn {
  color: var(--warn);
  font-weight: 750;
}

.readiness-pill {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.readiness-pill.ok {
  border-color: var(--ok-border);
  background: var(--ok-soft);
  color: var(--ok);
}

.readiness-pill.warn {
  border-color: var(--warn-border);
  background: var(--warn-soft);
  color: var(--warn);
}

textarea {
  display: block;
  width: 100%;
  min-height: 470px;
  resize: vertical;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  padding: 14px 16px 18px;
  background: var(--textarea-bg);
  color: var(--textarea-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 13px;
  line-height: 1.52;
}

.route-paste {
  min-height: 220px;
  font-family: inherit;
  font-size: 14px;
}

.route-paste[hidden] {
  display: none;
}

.route-preview {
  display: grid;
  gap: 12px;
  min-height: 82px;
  padding: 14px 16px 16px;
  border-top: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  background: var(--surface-subtle);
}

.route-preview.empty {
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.route-preview.needs-review {
  background: var(--surface-warm);
}

.preview-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.preview-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.preview-head b {
  font-size: 13px;
}

.route-leg-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
}

.route-leg-pill {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}

.route-leg-pill > span {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 12px;
  font-weight: 850;
}

.route-leg-pill div {
  min-width: 0;
}

.route-leg-pill b,
.route-leg-pill small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.route-leg-pill b {
  font-size: 13px;
}

.route-leg-pill small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.field-note {
  padding: 0 2px;
}

.bus-stop-list {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.bus-stop-row {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
}

.bus-stop-row header,
.bus-stop-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bus-stop-row header {
  justify-content: space-between;
}

.bus-stop-row h3 {
  overflow-wrap: anywhere;
}

.bus-stop-row input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0 11px;
  background: var(--surface-field);
  color: var(--ink);
  font: inherit;
}

.bus-stop-results {
  display: grid;
  gap: 6px;
}

.subway-station-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 30;
  display: grid;
  gap: 6px;
  max-height: 240px;
  overflow-y: auto;
  padding: 6px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--menu-shadow);
}

.subway-station-results[hidden],
.subway-station-results:empty {
  display: none;
}

.bus-stop-option,
.subway-station-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 42px;
  padding: 8px 10px;
  text-align: left;
}

.bus-stop-option.active {
  border-color: var(--accent);
  background: var(--accent-softer);
}

.subway-station-option[data-active="true"] {
  border-color: var(--accent);
  background: var(--accent-softer);
}

.bus-stop-option small,
.subway-station-option small,
.selected-stop {
  color: var(--muted);
  font-size: 12px;
}

.decision-header,
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.decision-header {
  padding: 2px 0 0;
}

.panel-head {
  padding: 16px 16px 0;
}

.result-meta {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.4;
  text-align: right;
}

.decision-controls {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.objective-control,
.time-format-control {
  display: flex;
  align-items: center;
  gap: 8px;
}

.objective-control span,
.time-format-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.objective-control select,
.time-format-control select {
  min-width: 144px;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-field);
  color: var(--ink);
  padding: 0 34px 0 12px;
  font: inherit;
  font-size: 13px;
  font-weight: 750;
}

.time-format-control select {
  min-width: 118px;
}

.recommendation {
  display: grid;
  gap: 16px;
  padding: 20px;
  border-radius: var(--radius);
  background: var(--recommendation-bg);
  color: var(--recommendation-ink);
  box-shadow: var(--shadow);
  animation: panel-in 240ms ease both;
}

.recommendation.empty {
  min-height: 120px;
  place-items: center;
  border: 1px dashed var(--line);
  background: var(--recommendation-empty-bg);
  color: var(--muted);
  text-align: center;
}

.recommendation.error-state {
  border: 1px solid var(--danger-border);
  background: var(--error-bg);
  color: var(--ink);
  box-shadow: none;
}

.recommendation.no-vehicle-state {
  border: 1px solid var(--warn-border);
  background: var(--no-vehicle-bg);
  color: var(--ink);
  box-shadow: none;
}

.provider-status {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  background: var(--surface);
}

.provider-status.warning,
.provider-status.unavailable {
  border-color: var(--warn-border);
  border-left-color: var(--warn);
  background: var(--surface-warm);
}

.provider-status-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.provider-status-head > div {
  display: grid;
  gap: 2px;
}

.provider-status-head span,
.provider-status li small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.provider-status-head strong {
  font-size: 14px;
}

.provider-status-head p {
  max-width: 380px;
  margin: 0;
  color: var(--warn);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
}

.provider-status ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.provider-status li {
  display: grid;
  grid-template-columns: minmax(100px, 1fr) minmax(120px, auto) auto;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}

.provider-status li em {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
}

.error-copy {
  display: grid;
  gap: 8px;
}

.no-vehicle-copy {
  display: grid;
  gap: 8px;
}

.error-title {
  color: var(--danger);
  font-size: 12px;
  font-weight: 800;
}

.no-vehicle-title {
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.error-copy strong {
  color: var(--danger);
  font-size: 18px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.no-vehicle-copy strong {
  color: var(--no-vehicle-copy);
  font-size: 18px;
  line-height: 1.35;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.error-detail {
  color: var(--error-copy);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.no-vehicle-detail {
  color: var(--no-vehicle-copy);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.error-action {
  color: var(--muted);
}

.no-vehicle-action {
  color: var(--muted);
}

.decision-copy {
  display: grid;
  gap: 8px;
}

.selection-label {
  color: var(--recommendation-muted);
  font-size: 12px;
  font-weight: 800;
}

.departure-lock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.departure-lock strong {
  font-size: 30px;
  line-height: 1.05;
}

.departure-lock span {
  color: var(--recommendation-muted);
  font-size: 14px;
}

.risk-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 5px 9px;
  border-radius: 999px;
  background: var(--recommendation-soft);
  color: var(--recommendation-ink);
  font-size: 12px;
  font-weight: 800;
}

.risk-badge.risk-tight {
  background: var(--danger-soft);
}

.risk-badge.risk-normal {
  background: var(--warn-soft);
}

.risk-badge.risk-roomy {
  background: var(--ok-soft);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.metric {
  display: grid;
  gap: 4px;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--recommendation-soft);
  border-radius: var(--radius);
  background: var(--recommendation-softer);
}

.metric span {
  color: var(--recommendation-muted);
  font-size: 12px;
}

.metric b {
  color: var(--recommendation-ink);
  font-size: 18px;
}

.wait-breakdown {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.wait-breakdown li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--recommendation-soft);
  border-radius: var(--radius);
  background: var(--recommendation-softer);
}

.wait-breakdown b {
  color: var(--recommendation-ink);
  font-size: 12px;
}

.wait-breakdown span {
  color: var(--recommendation-muted);
  font-size: 12px;
}

.candidate-list {
  display: grid;
  grid-auto-rows: max-content;
  align-content: start;
  gap: 8px;
  padding: 16px;
}

.route-card {
  width: 100%;
  height: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 82px;
  padding: 13px 14px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-subtle);
  animation: item-in 220ms ease both;
}

.route-card.active {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow:
    inset 3px 0 0 var(--accent),
    var(--active-shadow);
}

.candidate-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.candidate-kpis {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, auto));
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
}

.candidate-topline b {
  font-size: 15px;
}

.candidate-topline span,
.candidate-kpis span {
  color: var(--muted);
  font-size: 12px;
}

.candidate-route-steps {
  display: grid;
  min-width: 0;
  padding: 3px 0;
}

.candidate-route-step {
  position: relative;
  display: grid;
  grid-template-columns: 14px minmax(0, 1fr) max-content;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 32px;
  padding: 4px 0;
  color: var(--ink);
  line-height: 1.35;
}

.candidate-route-step::before {
  content: "";
  position: absolute;
  z-index: 0;
  top: 0;
  bottom: 0;
  left: 6px;
  width: 2px;
  background: var(--line-strong);
}

.candidate-route-step:first-child::before {
  top: 50%;
}

.candidate-route-step:last-child::before {
  bottom: 50%;
}

.candidate-step-marker {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  border: 3px solid var(--surface-subtle);
  border-radius: 50%;
  background: var(--line-strong);
  box-shadow: 0 0 0 1px var(--line-strong);
}

.route-card.active .candidate-step-marker {
  border-color: var(--surface);
}

.candidate-route-step.destination .candidate-step-marker {
  background: var(--accent);
  box-shadow: 0 0 0 1px var(--accent);
}

.candidate-step-copy {
  min-width: 0;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 2px 7px;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.candidate-step-copy b {
  color: var(--ink);
  font-size: 13px;
}

.candidate-step-copy span {
  color: var(--muted);
  font-size: 13px;
}

.candidate-route-step time {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  font-weight: 850;
  white-space: nowrap;
}

.route-card.active .candidate-route-step time,
.candidate-route-step.destination time {
  color: var(--accent-strong);
}

.timeline-source {
  margin: 3px 0 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.timeline {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.timeline.empty {
  min-height: 104px;
  place-items: center;
  color: var(--muted);
  text-align: center;
}

.timeline-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
}

.timeline-time {
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 850;
}

.timeline-body {
  display: grid;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.timeline-item:last-child .timeline-body {
  border-bottom: 0;
  padding-bottom: 0;
}

.timeline-body h3 {
  overflow-wrap: anywhere;
}

.timeline-body dl {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.timeline-breakdown {
  grid-template-columns: repeat(auto-fit, minmax(86px, 1fr));
}

.timeline-body div {
  min-width: 0;
}

.timeline-body dt {
  color: var(--muted);
  font-size: 11px;
}

.timeline-body dd {
  margin: 3px 0 0;
  color: var(--ink);
  font-size: 13px;
  font-weight: 760;
}

.error {
  border: 1px solid rgba(190, 18, 60, 0.24);
  border-radius: var(--radius);
  padding: 14px;
  background: rgba(190, 18, 60, 0.08);
  color: var(--danger);
  white-space: pre-wrap;
}

@keyframes onboarding-title-arrive {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes onboarding-demo-arrive {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes onboarding-route-draw {
  from {
    transform: scaleX(0);
  }
  to {
    transform: scaleX(1);
  }
}

@keyframes onboarding-station-pop {
  from {
    opacity: 0;
    transform: scale(0.7);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes onboarding-card-rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes route-input-reveal {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes panel-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes item-in {
  from {
    opacity: 0;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes journey-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1240px) {
  .workspace {
    grid-template-columns: 1fr;
  }

  .results-column {
    position: static;
  }

  h1 {
    font-size: 34px;
  }

  .onboarding-stage-copy h2 {
    font-size: 46px;
  }

  textarea {
    min-height: 360px;
  }
}

@media (max-width: 640px) {
  .topbar {
    position: static;
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 16px;
  }

  .topbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .theme-toggle {
    width: 100%;
  }

  .workspace {
    width: min(100% - 20px, 1440px);
    padding-top: 18px;
  }

  .metric-grid,
  .example-candidates,
  .timeline-body dl {
    grid-template-columns: 1fr;
  }

  .journey-search-panel {
    padding: 14px;
  }

  .journey-place-field {
    padding-right: 44px;
  }

  .journey-route-select {
    grid-template-columns: 28px minmax(0, 1fr);
  }

  .journey-route-action {
    grid-column: 2;
  }

  .journey-route-steps {
    padding-left: 48px;
  }

  .journey-route-heading {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .empty-route-onboarding {
    min-height: calc(100svh - 120px);
    padding: 24px 16px;
  }

  .onboarding-stage-copy h2 {
    font-size: 34px;
  }

  .onboarding-stage-copy p {
    font-size: 14px;
  }

  .onboarding-transit-demo {
    padding: 16px;
  }

  .onboarding-next {
    align-items: stretch;
    flex-direction: column;
  }

  .onboarding-input-cue {
    grid-template-columns: 1fr;
  }

  .onboarding-cue-line,
  .onboarding-input-cue::after {
    display: none;
  }

  .input-toolbar,
  .editor-toolbar,
  .toolbar-actions,
  .saved-route-controls,
  .route-builder-footer,
  .bus-stop-row header,
  .bus-stop-search,
  .decision-header,
  .panel-head,
  .candidate-topline {
    align-items: stretch;
    flex-direction: column;
  }

  .decision-controls,
  .objective-control,
  .time-format-control {
    width: 100%;
    justify-items: stretch;
    align-items: stretch;
  }

  .objective-control,
  .time-format-control {
    display: grid;
    grid-template-columns: 1fr;
  }

  .objective-control select,
  .time-format-control select {
    width: 100%;
  }

  .result-meta {
    text-align: left;
  }

  .provider-status-head {
    flex-direction: column;
  }

  .provider-status li {
    grid-template-columns: 1fr auto;
  }

  .provider-status li small {
    grid-column: 2;
  }

  .onboarding-node-time.end {
    display: none;
  }

  .action-button {
    width: 100%;
  }

  .route-builder-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .route-builder-toolbar .toolbar-actions {
    width: 100%;
  }

  .segmented-control {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .segmented-control button {
    width: 100%;
    padding: 0 8px;
  }

  .readiness-pill {
    justify-content: center;
    width: 100%;
  }

  .saved-route-controls {
    grid-template-columns: 1fr;
  }

  .route-builder-footer,
  .builder-station-search {
    grid-template-columns: 1fr;
  }

  .builder-leg-row {
    grid-template-columns: 1fr;
  }

  .builder-leg-index {
    width: 100%;
  }

  .builder-advanced,
  .builder-advanced-fields {
    grid-column: auto;
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 30px;
  }

  .departure-lock strong {
    font-size: 25px;
  }

  .timeline-item {
    grid-template-columns: 1fr;
  }

  .candidate-kpis {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .candidate-kpis span {
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}

/* Android and opt-in web: one task per page, no document reload. */
.page-navigation { max-width: 760px; margin: 0 auto; padding: 12px 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.page-navigation[hidden] { display: none; }
.page-navigation button { min-height: 44px; }
#pageProgress { font-weight: 700; font-size: 14px; }
.page-flow .workspace { display: block; max-width: 760px; padding-bottom: max(24px, env(safe-area-inset-bottom)); }
.page-flow #emptyRouteOnboarding { display: none !important; }
.page-flow .planner-column, .page-flow .results-column { min-width: 0; animation: page-arrive 140ms ease-out; }
.page-flow[data-page="0"] .results-column,
.page-flow[data-page="0"] #journeyRouteResults,
.page-flow[data-page="1"] .results-column,
.page-flow[data-page="1"] .planner-column > :not(#journeySearchPanel),
.page-flow[data-page="1"] #journeySearchForm,
.page-flow[data-page="2"] .planner-column { display: none !important; }
.page-flow[data-page="1"] .planner-column { display: block !important; }
.page-flow .topbar { padding-top: max(16px, env(safe-area-inset-top)); }
@keyframes page-arrive { from { opacity: .65; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .page-flow * { animation: none !important; scroll-behavior: auto !important; } }
.page-advanced { margin-top: 16px; }
.page-advanced > summary { padding: 16px; min-height: 44px; cursor: pointer; font-weight: 600; }
.page-flow .page-navigation { position: sticky; top: 0; z-index: 20; background: var(--bg, #f4f7f7); }
.page-flow[data-page="0"] #journeySearchStatus { display: none; }
@media (max-width: 640px) {
  .page-flow .topbar { flex-direction: row; gap: 8px; }
  .page-flow .topbar-actions { width: auto; }
  .page-flow .theme-toggle { width: auto; min-height: 44px; }
  .page-flow .brand small { display: none; }
}
.page-flow .journey-search-panel, .page-flow .journey-route-option { animation: none; }
