/* Shanghai Metro · offline fare finder
   A small, deliberately quiet interface. */

/* A small subset of Noto Sans CJK SC is bundled only as a fallback for
   devices without a Chinese system font. Latin text keeps the system stack. */
@font-face {
  font-family: "Metro CJK";
  src: url("./assets/noto-sans-sc-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-9FFF, U+3000-303F, U+FF00-FFEF;
}
@font-face {
  font-family: "Metro CJK";
  src: url("./assets/noto-sans-sc-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+2E80-9FFF, U+3000-303F, U+FF00-FFEF;
}



:root {
  --bg: #f7f5f0;
  --surface: #fffdf9;
  --ink: #161513;
  --muted: #716b61;
  --faint: #a39a8c;
  --line: #e5dfd3;
  --red: #e3002b;
  --red-dark: #b80022;
  --green: #3c8c5c;
  --shadow: 0 28px 70px rgba(39, 31, 18, 0.08);
  --radius: 26px;
  --max: 1120px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", "SF Pro Text", -apple-system, BlinkMacSystemFont, "Segoe UI",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC",
    "Metro CJK", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open { overflow: hidden; }

button, input { font: inherit; }
button { cursor: pointer; }
a { color: inherit; }

::selection { background: var(--red); color: #fff; }

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: -60px;
  z-index: 200;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-size: 12px;
  padding: 10px 14px;
  border-radius: 8px;
  transition: top 0.2s var(--ease);
}
.skip-link:focus { top: 16px; }

/* A 19-segment line ribbon, like the edge of a network map. */
.line-strip {
  display: flex;
  height: 5px;
  width: 100%;
  overflow: hidden;
}
.line-strip span {
  flex: 1 1 0;
  min-width: 2px;
  transition: flex-grow 0.25s var(--ease);
}
.line-strip span:hover { flex-grow: 2.2; }

/* ---------- top bar ---------- */

.topbar {
  position: relative;
  z-index: 20;
  max-width: var(--max);
  margin: 0 auto;
  padding: 22px 28px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: var(--red);
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.08em;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, 0.12);
}

.brand-text { display: flex; flex-direction: column; line-height: 1.08; }
.brand-text strong { font-size: 14px; letter-spacing: 0.03em; }
.brand-text span {
  font-size: 9px;
  letter-spacing: 0.18em;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 2px;
}

.top-actions { display: flex; align-items: center; gap: 8px; }

.ghost, .icon-btn {
  height: 38px;
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.45);
  color: var(--ink);
  border-radius: 999px;
  padding: 0 15px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease), transform 0.2s var(--ease);
}
.ghost:hover, .icon-btn:hover { background: #fff; border-color: var(--ink); }
.ghost:active, .icon-btn:active { transform: scale(0.97); }

.icon-btn {
  width: 38px;
  padding: 0;
  font-size: 14px;
  font-weight: 500;
}

.install-btn { background: var(--ink); color: #fff; border-color: var(--ink); }
.install-btn:hover { background: var(--red); border-color: var(--red); }

/* ---------- hero ---------- */

.hero {
  position: relative;
  max-width: var(--max);
  margin: 0 auto;
  padding: 72px 28px 118px;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 10px 0 0;
  background-image: radial-gradient(circle at 1px 1px, rgba(22, 21, 19, 0.11) 1px, transparent 0);
  background-size: 22px 22px;
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 82%, transparent 100%);
  mask-image: linear-gradient(90deg, transparent 0%, #000 55%, #000 82%, transparent 100%);
  opacity: 0.55;
  pointer-events: none;
}

.hero > * { position: relative; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin: 0;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  color: var(--muted);
}

.live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 0 4px rgba(227, 0, 43, 0.1);
}

.hero h1 {
  margin: 22px 0 26px;
  font-size: clamp(52px, 8.6vw, 96px);
  line-height: 0.93;
  letter-spacing: -0.065em;
  font-weight: 800;
}
.hero h1 em { font-style: normal; color: var(--red); }

.lede {
  margin: 0;
  max-width: 470px;
  font-size: 14px;
  line-height: 1.8;
  color: var(--muted);
}
.lede span { display: block; }
.lede-br { display: none; }

.hero-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 30px; }

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 253, 249, 0.55);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.pill-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
}

/* ---------- planner ---------- */

.planner {
  position: relative;
  z-index: 10;
  width: calc(100% - 56px);
  max-width: 960px;
  margin: -66px auto 0;
  padding: 26px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}

.field { position: relative; min-width: 0; }

.field > label {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin: 0 0 8px 2px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--muted);
}
.field > label small {
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  color: var(--faint);
}

.combo {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 58px;
  padding: 0 11px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 15px;
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.combo:focus-within {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(22, 21, 19, 0.055);
}

.combo-badge {
  flex: none;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 800;
  color: var(--faint);
  background: #f2eee6;
  transition: background 0.2s var(--ease), color 0.2s var(--ease);
}
.combo-badge.has-line { color: #fff; }

.combo input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.015em;
}
.combo input::placeholder { color: #b7afa2; font-weight: 500; letter-spacing: 0; }

.clear-btn {
  flex: none;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f0ece4;
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  display: grid;
  place-items: center;
}
.clear-btn:hover { background: #e7e1d6; color: var(--ink); }

.menu {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  z-index: 50;
  max-height: 330px;
  overflow: auto;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: 0 26px 60px rgba(39, 31, 18, 0.16);
  overscroll-behavior: contain;
}
.menu[hidden] { display: none; }
.menu-empty {
  padding: 18px 14px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
}

.option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 11px;
  border-radius: 10px;
  cursor: pointer;
  user-select: none;
}
.option:hover, .option.active, .option[aria-selected="true"] { background: #f5f1e9; }

.option-main { flex: 1; min-width: 0; }
.option-name {
  display: block;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.option-sub {
  display: block;
  margin-top: 1px;
  font-size: 10px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.option-lines { display: flex; gap: 3px; flex: none; }
.line-pip {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--c);
}

.swap-btn {
  width: 42px;
  height: 42px;
  margin-bottom: 8px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--ink);
  display: grid;
  place-items: center;
  transition: transform 0.35s var(--ease), border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.swap-btn:hover { border-color: var(--ink); background: var(--bg); transform: rotate(180deg); }
.swap-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.planner-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.rule-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-size: 11px;
  color: var(--muted);
}
.rule-yen {
  flex: none;
  width: 21px;
  height: 21px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--ink);
}

.find-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  transition: background 0.2s var(--ease), transform 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
.find-btn:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 24px rgba(227, 0, 43, 0.2);
}
.find-btn:active { transform: translateY(0); }
.find-arrow { font-size: 17px; line-height: 1; font-weight: 400; }

.form-error {
  margin: 14px 2px 0;
  color: var(--red);
  font-size: 12px;
  font-weight: 500;
}

/* ---------- result ---------- */

.result {
  width: calc(100% - 56px);
  max-width: 960px;
  margin: 20px auto 0;
  padding: 30px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: rise 0.42s var(--ease);
}
.result[hidden] { display: none; }

.result-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px;
  align-items: end;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.od-line {
  margin: 0 0 10px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.od-line { overflow-wrap: anywhere; }
.od-line .od-sec { font-size: 10px; font-weight: 400; color: var(--muted); margin-left: 5px; }
.od-line .od-arrow { color: var(--faint); font-weight: 400; margin: 0 6px; }

.result-label {
  margin: 0 0 6px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.fare { display: flex; align-items: baseline; gap: 4px; line-height: 0.95; }
.fare .currency { font-size: 27px; font-weight: 600; color: var(--red); letter-spacing: -0.03em; }
.fare #fareValue {
  font-size: clamp(64px, 10vw, 82px);
  font-weight: 800;
  letter-spacing: -0.075em;
  color: var(--red);
  font-variant-numeric: tabular-nums;
}
.fare .cny { margin-left: 5px; font-size: 13px; color: var(--muted); }

.fare-note { margin: 10px 0 0; font-size: 10px; color: var(--muted); letter-spacing: 0.02em; }

.stats { display: flex; }
.stat {
  min-width: 82px;
  padding: 0 18px;
  border-left: 1px solid var(--line);
  text-align: right;
}
.stat:first-child { border-left: 0; }
.stat span {
  display: block;
  font-size: 25px;
  font-weight: 700;
  letter-spacing: -0.04em;
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.stat small { font-size: 9px; letter-spacing: 0.08em; color: var(--muted); }

.route { position: relative; padding: 20px 0 10px; }
.route.is-single::before { display: none; }
.route::before {
  content: "";
  position: absolute;
  left: 19px;
  top: 30px;
  bottom: 30px;
  width: 2px;
  background: var(--line);
  border-radius: 2px;
}

.leg {
  position: relative;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 15px;
  padding: 9px 0;
}

.leg-badge {
  position: relative;
  z-index: 1;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: -0.02em;
  box-shadow: 0 0 0 4px var(--surface);
}

.leg-body { min-width: 0; padding-top: 1px; }
.leg-head { display: flex; align-items: center; gap: 9px; }
.leg-line { font-size: 11px; font-weight: 700; letter-spacing: 0.03em; }
.leg-count {
  font-size: 9px;
  color: var(--muted);
  letter-spacing: 0.07em;
  padding: 2px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
}

.leg-route {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 4px;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.35;
}
.leg-route .arrow { color: var(--faint); font-weight: 400; font-size: 13px; }
.leg-route .st { display: inline-flex; flex-direction: column; line-height: 1.18; max-width: 100%; overflow-wrap: anywhere; }
.leg-route .station-en { margin-top: 2px; font-size: 9px; color: var(--muted); font-weight: 400; letter-spacing: 0; line-height: 1.2; }

.transfer-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 55px;
  padding: 4px 0 8px;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.03em;
}
.transfer-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  border: 2px solid var(--line);
  background: var(--surface);
  box-sizing: content-box;
}
.transfer-row b { font-weight: 600; color: var(--ink); }

.stops-details { margin-top: 7px; }
.stops-details summary {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  list-style: none;
  cursor: pointer;
  font-size: 10px;
  color: var(--muted);
  letter-spacing: 0.03em;
  user-select: none;
}
.stops-details summary::-webkit-details-marker { display: none; }
.stops-details summary::before {
  content: "+";
  font-size: 12px;
  line-height: 1;
  color: var(--faint);
  transition: transform 0.2s var(--ease);
}
.stops-details[open] summary::before { transform: rotate(45deg); }

.stops-list {
  display: grid;
  gap: 5px;
  margin: 10px 0 2px;
  padding: 2px 0 2px 16px;
  border-left: 1px solid var(--line);
  list-style: none;
}
.stops-list li {
  position: relative;
  font-size: 11px;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.stops-list li::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 6px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--line);
}
.stops-list li.is-start, .stops-list li.is-end { color: var(--ink); }
.stops-list .station-en { margin-left: 6px; font-size: 9px; color: var(--faint); }
.station-en { font-size: 9px; font-weight: 400; color: var(--muted); }

.result-foot {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.breakdown { margin: 0; font-size: 11px; color: var(--muted); }
.breakdown b { color: var(--ink); font-weight: 600; }
.disclaimer {
  margin: 0;
  max-width: 410px;
  font-size: 9px;
  line-height: 1.6;
  color: var(--faint);
  text-align: right;
}

/* ---------- popular + notes ---------- */

.popular {
  max-width: 960px;
  margin: 40px auto 0;
  padding: 0 28px;
}
.popular h2 {
  margin: 0 0 12px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.chips { display: flex; flex-wrap: wrap; gap: 7px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-size: 11px;
  font-weight: 500;
  transition: background 0.2s var(--ease), border-color 0.2s var(--ease);
}
.chip:hover { background: #fff; border-color: var(--ink); }
.chip .chip-arrow { color: var(--faint); font-size: 12px; }

.notes {
  max-width: 960px;
  margin: 54px auto 0;
  padding: 0 28px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.note { padding: 24px 26px 26px 0; }
.note + .note { padding-left: 26px; border-left: 1px solid var(--line); }
.note-num { font-size: 9px; font-weight: 700; letter-spacing: 0.12em; color: var(--red); }
.note h3 { margin: 9px 0 7px; font-size: 12px; letter-spacing: 0.01em; }
.note p { margin: 0; font-size: 10px; line-height: 1.7; color: var(--muted); }

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

.site-footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 26px 28px 42px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}
.foot-brand { margin: 0; font-size: 11px; font-weight: 700; letter-spacing: 0.01em; }
.foot-brand span { color: var(--muted); font-weight: 400; margin-left: 5px; }
.foot-data { margin: 6px 0 0; font-size: 9px; color: var(--faint); }
.foot-side { display: flex; align-items: center; gap: 16px; }

.offline-state {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 9px;
  letter-spacing: 0.05em;
  color: var(--muted);
}
.state-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 3px rgba(60, 140, 92, 0.12);
}
body.is-offline .state-dot { background: #b7791f; box-shadow: 0 0 0 3px rgba(183, 121, 31, 0.14); }

.text-btn {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 9px;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.text-btn:hover { color: var(--ink); }

/* ---------- about sheet ---------- */

.modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(22, 21, 19, 0.42);
  -webkit-backdrop-filter: blur(5px);
  backdrop-filter: blur(5px);
  animation: fade 0.25s var(--ease);
}

.sheet {
  position: relative;
  width: min(640px, 100%);
  max-height: min(86vh, 760px);
  overflow: auto;
  padding: 34px;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.28);
  animation: rise 0.28s var(--ease);
  overscroll-behavior: contain;
}

.sheet-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  font-size: 18px;
  line-height: 1;
}
.sheet-close:hover { background: var(--bg); color: var(--ink); }

.sheet-eyebrow {
  margin: 0 0 8px;
  font-size: 8px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: var(--faint);
}
.sheet h2 { margin: 0 0 16px; font-size: 27px; letter-spacing: -0.04em; }
.about-note {
  margin: 14px 0 0;
  padding: 11px 13px;
  background: #f5f1e9;
  border-left: 3px solid var(--red);
  border-radius: 0 9px 9px 0;
  color: var(--ink) !important;
  font-size: 10px !important;
}
.about-note strong { color: var(--red); }

.sheet-body h3 {
  margin: 24px 0 6px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}
.sheet-body p, .sheet-body li {
  margin: 0 0 6px;
  font-size: 11px;
  line-height: 1.75;
  color: #4d4a44;
}
.sheet-body ul { margin: 4px 0 0; padding-left: 17px; }
.sheet-body a { color: var(--red); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.sheet-body code {
  padding: 1px 5px;
  border-radius: 5px;
  background: #f1ece2;
  font-size: 10px;
}
.meta-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; margin: 14px 0 4px; }
.meta-cell { padding: 11px 12px; border: 1px solid var(--line); border-radius: 12px; }
.meta-cell b { display: block; font-size: 19px; letter-spacing: -0.04em; }
.meta-cell span { display: block; margin-top: 2px; font-size: 9px; color: var(--muted); }

/* ---------- motion ---------- */

@keyframes rise {
  from { opacity: 0; transform: translateY(9px); }
  to { opacity: 1; transform: none; }
}
@keyframes fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ---------- responsive ---------- */

@media (max-width: 820px) {
  .hero { padding: 56px 22px 108px; }
  .hero::before { opacity: 0.4; }
  .planner, .result { width: calc(100% - 32px); padding: 20px; }
  .planner { margin-top: -58px; }
  .result-top { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .stats {
    padding-top: 16px;
    border-top: 1px solid var(--line);
    justify-content: space-between;
  }
  .stat { flex: 1; min-width: 0; padding: 0 12px; text-align: left; }
  .stat:first-child { padding-left: 0; }
  .stat:last-child { padding-right: 0; text-align: right; }
  .notes { grid-template-columns: 1fr; }
  .note, .note + .note { padding: 20px 0; border-left: 0; }
  .note + .note { border-top: 1px solid var(--line); }
  .disclaimer { text-align: left; }
}

@media (max-width: 640px) {
  .fields { grid-template-columns: minmax(0, 1fr); gap: 14px; }
  .swap-btn { margin: -1px auto; transform: rotate(90deg); }
  .swap-btn:hover { transform: rotate(270deg); }
}

@media (max-width: 560px) {
  .topbar { padding: 18px 18px 0; }
  .brand-text span { display: none; }
  .hero { padding: 46px 18px 100px; }
  .hero h1 { font-size: clamp(46px, 14vw, 64px); }
  .lede { font-size: 13px; }
  .planner, .result { width: calc(100% - 24px); padding: 16px; border-radius: 20px; }
  .planner { margin-top: -52px; }
  .planner-foot { flex-direction: column; align-items: stretch; gap: 12px; }
  .find-btn { width: 100%; }
  .result { padding: 20px 16px; }
  .fare #fareValue { font-size: 66px; }
  .stat span { font-size: 22px; }
  .leg-route { font-size: 15px; }
  .popular, .notes { padding-left: 18px; padding-right: 18px; }
  .site-footer { padding: 22px 18px 34px; }
  .sheet { padding: 26px 20px; }
  .meta-grid { grid-template-columns: 1fr 1fr; }
}
