/* Semantic design tokens: content stays solid; chrome uses material. */
:root {
  /* Shared geometry and elevation preserve the existing visual dimensions. */
  --radius-detail: 3px;
  --radius-tiny: 4px;
  --radius-marker: 7px;
  --radius-compact: 8px;
  --radius-option: 11px;
  --radius-row: 12px;
  --radius-control-tight: 13px;
  --radius-group: 16px;
  --radius-inset: 18px;
  --radius-vehicle: 19px;
  --radius-map: 22px;
  --radius-surface: 24px;
  --radius-sheet: 26px;
  --radius-glass: 28px;
  --radius-hero: 30px;
  --radius-round: 50%;
  --shadow-hairline: 0 0 0 1px var(--separator);
  --shadow-focus-wide: 0 0 0 5px var(--blue-soft);
  --shadow-focus: 0 0 0 4px var(--blue-soft);
  --shadow-arrival-marker: 0 2px 5px rgba(0, 0, 0, 0.12);
  --shadow-live-ring: 0 0 0 4px
    color-mix(in srgb, var(--green) 14%, transparent);
  --shadow-next-stop: 0 2px 16px #00000008;
  --shadow-vehicle: 0 1px 5px #0002;
  --shadow-navigation: 0 -3px 18px rgba(0, 0, 0, 0.08);
  --shadow-toggle: 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow-sheet: 0 24px 80px rgba(0, 0, 0, 0.28);
  --shadow-tab-light: 0 3px 14px rgba(0, 0, 0, 0.07);
  --shadow-tab-dark: 0 3px 14px rgba(0, 0, 0, 0.16);
  --shadow-toast: 0 15px 40px rgba(0, 0, 0, 0.14);
  --shadow-boundary: inset 0 0 0 1px var(--purple);
  --shadow-station-ring: 0 0 0 5px
    color-mix(in srgb, var(--green) 18%, transparent);
  --color-backdrop-rgb: 0, 0, 0;
  --material-backdrop: rgba(var(--color-backdrop-rgb), 0.32);
  --separator-tab-light: rgba(60, 60, 67, 0.14);
  --separator-tab-dark: rgba(255, 255, 255, 0.14);
  color-scheme: light dark;
  --bg: #f2f2f7;
  --surface-primary: #ffffff;
  --surface-secondary: #f7f7fa;
  --text: #111114;
  --muted: #68686d;
  --separator: rgba(60, 60, 67, 0.18);
  --color-accent: #0a84ff;
  --color-link: #0064d8;
  --color-subway: #3e6e1d;
  --color-kintetsu: #c44727;
  --color-citybus: #9a4c00;
  --color-kyotobus: #1964b6;
  --color-through: #7751a8;
  --color-ats: #5856d6;
  --color-ats-soft: color-mix(in srgb, var(--color-ats) 14%, transparent);
  /* Settings icon tiles (iOS system colours) */
  --tile-glyph: #fff;
  --tile-green: #34c759;
  --tile-teal: #30b0c7;
  --tile-red: #ff3b30;
  --tile-indigo: #5856d6;
  --tile-blue: #007aff;
  --tile-orange: #ff9500;
  --tile-pink: #ff2d55;
  --tile-purple: #af52de;
  --tile-gray: #8e8e93;
  --shadow-tile: inset 0 0 0 0.5px rgba(0, 0, 0, 0.06);
  /* Route plates: city loop (循環) orange, other city routes blue, Kyoto
     Bus route colours, Karasuma green, Kintetsu red. White text on each. */
  --line-citybus-loop: #b85000;
  --line-citybus: #0b5cb5;
  --line-kyotobus: #c6492a;
  --line-kyotobus-express: #c4231d;
  --line-kyotobus-temp: #127a52;
  --line-subway: #138a48;
  --line-kintetsu: #c8102e;
  --line-through: #6c4aa0;
  --color-on-line: #fff;
  --shadow-selected-ring: inset 0 0 0 1.5px color-mix(in srgb, var(--color-accent) 45%, transparent);
  --color-walk: #6e6e73;
  --color-success: #208345;
  --color-warning: #a35b00;
  --color-danger: #c63032;
  --color-on-accent: #fff;
  /* Accent fill that keeps white text at 4.5:1 or better. */
  --color-accent-strong: #0062cc;
  /* Secondary text that stays legible on grey fills. */
  --label-on-fill: #5c5c61;
  --color-search-action: #e66e00;
  --color-place-label: #0f6e34;
  --surface-place-entry: #ececee;
  --surface-station-row: #f3f3f5;
  --color-rank-early: #bd5600;
  --color-rank-easy: #006f9f;
  --color-rank-cheap: #866500;
  --color-rank-walk: #2c7a3c;
  --color-on-transport: #fff;
  --color-destination: #111114;
  --surface-destination: #f5f5f7;
  --map-neutral: #e9eee7;
  --map-label: #1a1a1a;
  --map-control: rgba(255, 255, 255, 0.9);
  --material-navigation: rgba(250, 250, 252, 0.86);
  /* iOS tertiarySystemFill / systemFill for search fields and segments. */
  --fill-tertiary: rgba(118, 118, 128, 0.12);
  --fill-secondary: rgba(118, 118, 128, 0.16);
  --surface-segment-selected: #ffffff;
  /* Menus, action sheets and the onboard displays. */
  --material-menu: rgba(248, 248, 250, 0.82);
  --shadow-menu: 0 12px 40px rgba(0, 0, 0, 0.18);
  --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.22);
  --lcd-background: #0b0e13;
  --lcd-panel: #151a21;
  --lcd-text: #f6f7f9;
  --lcd-dim: #8c939e;
  --lcd-next: #ffb21f;
  --led-amber: #ffa21a;
  --led-glow: 0 0 6px rgba(255, 162, 26, 0.55);
  --lamp-red: #ff3b30;
  --lamp-glow: 0 0 14px rgba(255, 59, 48, 0.75);
  --lcd-rule: rgba(255, 255, 255, 0.12);
  --panel: var(--surface-primary);
  --panel-2: var(--surface-secondary);
  --blue: var(--color-link);
  --blue-soft: color-mix(in srgb, var(--color-accent) 12%, transparent);
  --green: var(--color-success);
  --orange: var(--color-warning);
  --red: var(--color-danger);
  --purple: var(--color-through);
  --transport-color: var(--color-walk);
  --shadow: 0 4px 18px rgba(0, 0, 0, 0.05);
  --radius: 20px;
  --radius-small: 10px;
  --radius-control: 14px;
  --radius-capsule: 999px;
  --surface-background: var(--bg);
  --surface-elevated: var(--surface-primary);
  --text-primary: var(--text);
  --text-secondary: var(--muted);
  --text-tertiary: var(--muted);
  --accent: var(--color-accent);
  --subway: var(--color-subway);
  --kintetsu: var(--color-kintetsu);
  --citybus: var(--color-citybus);
  --kyotobus: var(--color-kyotobus);
  --walk: var(--color-walk);
  --live: var(--color-success);
  --prediction: var(--color-warning);
  --schedule: var(--muted);
  --delay: var(--color-danger);
  --warning: var(--color-warning);
  --danger: var(--color-danger);
  --glass-navigation: var(--material-navigation);
  --glass-toolbar: var(--material-navigation);
  --motion-fast: 160ms;
  --motion-standard: 220ms;
  --motion-navigation: 320ms;
  --motion-spring: 260ms;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --type-title: 2.125rem;
  --type-hero: 2rem;
  --type-arrival: 1.5rem;
  --type-body: 1.0625rem;
  --type-secondary: 0.9375rem;
  --type-caption: 0.8125rem;
  font-family:
    -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #000;
    --surface-primary: #1c1c1e;
    --surface-secondary: #2c2c2e;
    --text: #f5f5f7;
    --color-search-action: #ff9b42;
    --color-place-label: #4dc77c;
    --surface-place-entry: #2c2c2e;
    --surface-station-row: #252527;
    --color-rank-early: #ffae68;
    --color-rank-easy: #78cfff;
    --color-rank-cheap: #f5d16b;
    --color-rank-walk: #7fd38a;
    --muted: #98989d;
    --separator: rgba(174, 174, 180, 0.3);
    --color-link: #69b1ff;
    --label-on-fill: #aeaeb2;
    --color-on-transport: #111114;
    --color-destination: var(--text);
    --surface-destination: var(--surface-secondary);
    --color-subway: #9dcf64;
    --color-kintetsu: #ff9c7c;
    --color-citybus: #ffb464;
    --color-kyotobus: #82bbff;
    --color-through: #c2a2f0;
    --color-ats: #4b49c9;
    --tile-green: #30d158;
    --tile-teal: #40c8e0;
    --tile-red: #ff453a;
    --tile-indigo: #5e5ce6;
    --tile-blue: #0a84ff;
    --tile-orange: #ff9f0a;
    --tile-pink: #ff375f;
    --tile-purple: #bf5af2;
    --tile-gray: #8e8e93;
    --shadow-tile: inset 0 0 0 0.5px rgba(255, 255, 255, 0.08);
    --line-citybus-loop: #b85000;
    --line-citybus: #1a6fcf;
    --line-kyotobus: #d2573a;
    --line-kyotobus-express: #d23a2f;
    --line-kyotobus-temp: #127a52;
    --line-subway: #1c9a55;
    --line-kintetsu: #d8283f;
    --line-through: #7c5bb3;
    --color-walk: #98989d;
    --color-success: #72d391;
    --color-warning: #ffc169;
    --color-danger: #ff8585;
    --material-navigation: rgba(28, 28, 30, 0.88);
    --fill-tertiary: rgba(118, 118, 128, 0.24);
    --fill-secondary: rgba(118, 118, 128, 0.32);
    --surface-segment-selected: #636366;
    --material-menu: rgba(40, 40, 44, 0.84);
    --shadow-menu: 0 12px 40px rgba(0, 0, 0, 0.5);
    --shadow-lift: 0 18px 50px rgba(0, 0, 0, 0.6);
    --shadow: none;
  }
}
@media (prefers-contrast: more) {
  :root {
    --muted: #45454a;
    --separator: #737378;
    --material-navigation: var(--surface-primary);
  }
}
@media (prefers-contrast: more) and (prefers-color-scheme: dark) {
  :root {
    --muted: #d8d8de;
    --separator: #aaaab0;
  }
}
html[data-high-contrast="true"] {
  --muted: var(--text);
  --separator: currentColor;
  --material-navigation: var(--surface-primary);
}
html[data-reduce-motion="true"] *,
html[data-reduce-motion="true"] *::before,
html[data-reduce-motion="true"] *::after {
  animation-duration: 0.01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
}
[data-operator="subway"],
.system-symbol.subway,
.mode-symbol.subway {
  --transport-color: var(--color-subway);
}
[data-operator="kintetsu"],
.system-symbol.rail,
.mode-symbol.rail {
  --transport-color: var(--color-kintetsu);
}
[data-operator="citybus"],
.system-symbol.bus,
.mode-symbol.bus {
  --transport-color: var(--color-citybus);
}
[data-operator="kyotobus"],
.mode-symbol[data-operator="kyotobus"] {
  --transport-color: var(--color-kyotobus);
}
[data-operator="through"] {
  --transport-color: var(--color-through);
}
[data-line] {
  --line-color: var(--line-citybus);
}
[data-line="citybus-loop"] {
  --line-color: var(--line-citybus-loop);
}
[data-line="kyotobus"] {
  --line-color: var(--line-kyotobus);
}
[data-line="kyotobus-express"] {
  --line-color: var(--line-kyotobus-express);
}
[data-line="kyotobus-temp"] {
  --line-color: var(--line-kyotobus-temp);
}
[data-line="subway"] {
  --line-color: var(--line-subway);
}
[data-line="kintetsu"] {
  --line-color: var(--line-kintetsu);
}
[data-line="through"] {
  --line-color: var(--line-through);
}
/* Route plate: a solid, rounded number plate like the bus destination sign. */
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex: none;
  min-width: 2.6em;
  min-height: 1.75em;
  padding: 1px 7px;
  border-radius: var(--radius-tiny);
  background: var(--line-color);
  color: var(--color-on-line);
  font-size: 0.9375rem;
  font-weight: 750;
  line-height: 1.15;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.line-badge.small {
  min-width: 2.3em;
  min-height: 1.5em;
  padding: 0 5px;
  font-size: 0.8125rem;
}
.line-badge.large {
  min-width: 2.4em;
  min-height: 1.9em;
  padding: 2px 9px;
  font-size: 1.125rem;
  border-radius: var(--radius-marker);
}
/* Rail: line symbol in a ring plus the line name, on a tinted capsule. */
.line-badge.rail {
  min-width: 0;
  padding: 1px 9px 1px 3px;
  border-radius: var(--radius-capsule);
  background: color-mix(in srgb, var(--line-color) 14%, var(--surface-primary));
  color: var(--text);
  font-weight: 650;
}
.line-badge.rail > i {
  display: grid;
  place-items: center;
  width: 1.35em;
  height: 1.35em;
  border-radius: var(--radius-round);
  background: var(--line-color);
  color: var(--color-on-line);
  font-style: normal;
  font-size: 0.8em;
  font-weight: 800;
}
.line-badge.rail:not(:has(> span:not(.sr-only))) {
  padding: 1px;
}
.transport-badge,
.transport-icon {
  color: var(--transport-color);
  background: color-mix(
    in srgb,
    var(--transport-color) 12%,
    var(--surface-primary)
  );
}
.transport-icon {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-row);
  display: grid;
  place-items: center;
  flex: none;
}
.transport-icon svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
* {
  box-sizing: border-box;
}
html {
  background: var(--bg);
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
body {
  font-size: var(--type-body);
}
button,
input,
select {
  font: inherit;
  color: inherit;
}
select {
  appearance: none;
  min-height: 44px;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) center,
    calc(100% - 12px) center;
  background-size: 5px 5px;
  background-repeat: no-repeat;
  padding-inline-end: 32px;
}
button {
  cursor: pointer;
}
button:disabled {
  opacity: 0.42;
  cursor: default;
}
a {
  color: var(--blue);
}
[hidden] {
  display: none !important;
}
.app-shell {
  min-height: 100vh;
  padding-bottom: calc(96px + var(--safe-bottom));
}
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top, 0px)) 20px 12px;
  background: var(--material-navigation);
  backdrop-filter: saturate(180%) blur(24px);
  -webkit-backdrop-filter: saturate(180%) blur(24px);
}
.topbar-copy {
  min-width: 0;
}
.topbar .eyebrow {
  margin: 0 0 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: var(--muted);
}
.topbar h1 {
  margin: 0;
  font-size: 2.125rem;
  line-height: 1.04;
  letter-spacing: -0.035em;
}
.location-pill {
  border: 0;
  border-radius: var(--radius-capsule);
  background: var(--panel);
  box-shadow: var(--shadow-hairline);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 11px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 700;
}
.location-pill.active {
  color: var(--blue);
  background: var(--blue-soft);
}
.location-pill svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}
main {
  max-width: 760px;
  margin: 0 auto;
  padding: 2px 14px 28px;
}
.view {
  animation: fade-in 0.18s ease;
}
@keyframes fade-in {
  from {
    opacity: 0.35;
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-sheet);
  padding: 24px 22px;
  background: var(--panel);
  box-shadow: var(--shadow);
  margin: 4px 0 18px;
}
.hero-card::after {
  content: "";
  position: absolute;
  right: -50px;
  top: -70px;
  width: 190px;
  height: 190px;
  border-radius: var(--radius-round);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--blue) 13%, transparent),
    transparent 70%
  );
  pointer-events: none;
}
.hero-card.warning::after {
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--orange) 18%, transparent),
    transparent 70%
  );
}
.hero-card.detecting::after {
  animation: pulse-halo 1.6s ease-in-out infinite;
}
@keyframes pulse-halo {
  50% {
    transform: scale(1.16);
    opacity: 0.55;
  }
}
.hero-card h2 {
  position: relative;
  z-index: 1;
  font-size: 1.875rem;
  line-height: 1.08;
  letter-spacing: -0.035em;
  margin: 6px 0 10px;
}
.hero-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.45;
  max-width: 520px;
}
.hero-eyebrow {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.8125rem;
  font-weight: 750;
  color: var(--muted);
}
.pulse-dot,
.live-dot {
  width: 8px;
  height: 8px;
  border-radius: var(--radius-round);
  background: var(--blue);
  box-shadow: var(--shadow-focus-wide);
}
.pulse-dot {
  animation: pulse 1.4s ease-in-out infinite;
}
@keyframes pulse {
  50% {
    opacity: 0.3;
    transform: scale(0.82);
  }
}
.live-dot {
  background: var(--green);
  box-shadow: var(--shadow-station-ring);
}
.primary-action:active,
.secondary-action:active {
  transform: scale(0.985);
}
.primary-action,
.secondary-action {
  border: 0;
  border-radius: var(--radius-group);
  padding: 13px 17px;
  font-weight: 750;
  margin-top: 18px;
}
.primary-action {
  background: var(--color-accent);
  color: var(--color-on-accent);
  font-size: 1.1875rem;
}
.secondary-action {
  background: var(--panel-2);
  color: var(--blue);
}
.thin-progress {
  height: 3px;
  background: var(--separator);
  border-radius: var(--radius-capsule);
  overflow: hidden;
  margin-top: 18px;
}
.thin-progress i {
  display: block;
  width: 34%;
  height: 100%;
  background: var(--blue);
  border-radius: inherit;
  animation: load 1.25s infinite ease-in-out;
}
@keyframes load {
  from {
    transform: translateX(-120%);
  }
  to {
    transform: translateX(390%);
  }
}

/* Icon system (see icons in vnext-state.js). Outline by default; solid
   details stay solid; selected states fill the main shape and knock the
   inner detail out in the surrounding background colour. */
svg[viewBox="0 0 24 24"] {
  stroke-linecap: round;
  stroke-linejoin: round;
}
svg[viewBox="0 0 24 24"] :is(.solid, .knock-dot, .knock-dots circle) {
  fill: currentColor;
  stroke: none;
}
:is(.tab-button.active, .icon-filled, [aria-pressed="true"]) > svg .fillable {
  fill: currentColor;
}
:is(.tab-button.active, .icon-filled, [aria-pressed="true"]) > svg .knock {
  stroke: var(--knock, var(--surface-primary));
}
:is(.tab-button.active, .icon-filled, [aria-pressed="true"]) > svg :is(.knock-dot, .knock-dots circle) {
  fill: var(--knock, var(--surface-primary));
}
.tab-button.active {
  --knock: color-mix(in srgb, var(--color-accent) 12%, var(--material-navigation));
}
.tab-button svg {
  stroke-width: 1.75;
}
