:root {
  color-scheme: light;
  --bg: #eff5f3;
  --surface: #fff;
  --muted-surface: #f5f8f7;
  --line: #dbe5e2;
  --ink: #152929;
  --muted: #4e6663;
  --accent: #006951;
  --accent-ink: #005340;
  --accent-surface: #dff4e9;
  --primary: #075b49;
  --primary-ink: #fff;
  --nav: rgba(255, 255, 255, .92);
  --map: #dce9e4;
  --warn-bg: #fff4d9;
  --warn-ink: #714509;
  --error-bg: #fff0ed;
  --error-ink: #a12f23;
  --shadow: 0 2px 4px rgba(17, 61, 50, .035), 0 12px 34px rgba(32, 63, 54, .045);
  --round: 23px;
  font-family: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
[data-theme="dark"] {
  color-scheme: dark;
  --bg: #101c1b;
  --surface: #172725;
  --muted-surface: #1e3230;
  --line: #314744;
  --ink: #edf7f3;
  --muted: #b3c9c2;
  --accent: #8be8c2;
  --accent-ink: #9af0cd;
  --accent-surface: #244b3f;
  --primary: #93e7c5;
  --primary-ink: #082c22;
  --nav: rgba(23, 39, 37, .94);
  --map: #263e3b;
  --warn-bg: #473a24;
  --warn-ink: #ffdfa4;
  --error-bg: #502f2b;
  --error-ink: #ffd3cb;
  --shadow: 0 12px 28px rgba(0,0,0,.12);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]):not([data-theme="dark"]) {
    color-scheme: dark;
    --bg: #101c1b; --surface: #172725; --muted-surface: #1e3230; --line: #314744; --ink: #edf7f3;
    --muted: #b3c9c2; --accent: #8be8c2; --accent-ink: #9af0cd; --accent-surface: #244b3f;
    --primary: #93e7c5; --primary-ink: #082c22; --nav: rgba(23, 39, 37, .94); --map: #263e3b;
    --warn-bg: #473a24; --warn-ink: #ffdfa4; --error-bg: #502f2b; --error-ink: #ffd3cb;
    --shadow: 0 12px 28px rgba(0,0,0,.12);
  }
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; color: var(--ink); background: var(--bg); font-size: 1rem; line-height: 1.48; }
button, select, input { font: inherit; color: inherit; }
a { color: var(--accent-ink); }
a, button, input, select { outline-offset: 3px; }
:focus-visible { outline: 2px solid var(--accent); }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .54; }
button, a { touch-action: manipulation; }
svg { display: block; flex: none; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { line-height: 1.13; letter-spacing: -.025em; }
h1 { font-size: clamp(1.85rem, 3vw, 2.22rem); font-weight: 750; }
h2 { font-size: 1.31rem; font-weight: 735; }
h3 { font-size: 1.06rem; }
.muted { color: var(--muted); font-size: .9rem; }
.sr-only, .skip-link:not(:focus) { position: absolute; clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; white-space: nowrap; }
.skip-link:focus { z-index: 1001; position: fixed; left: 12px; top: 12px; background: var(--surface); padding: 8px 14px; border-radius: 8px; }
.topbar { background: var(--nav); border-bottom: 1px solid var(--line); padding-top: env(safe-area-inset-top); }
.topbar-inner { height: 70px; max-width: 1330px; margin: auto; padding: 0 32px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { text-decoration: none; color: var(--ink); font-weight: 775; font-size: 1.27rem; letter-spacing: -.055em; display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand img { border-radius: 12px; }
.brand-country { color: var(--accent); letter-spacing: -.028em; }
.tabs, .top-controls { display: flex; align-items: center; gap: 5px; }
.nav-tab { border: 0; background: transparent; display: inline-flex; align-items: center; gap: 7px; min-height: 44px; padding: 0 14px; border-radius: 12px; font-size: .93rem; font-weight: 630; color: var(--muted); }
.nav-tab svg { width: 19px; height: 19px; }
.nav-tab.current { color: var(--accent-ink); background: var(--accent-surface); }
.nav-tab:hover, .icon-button:hover, .text-button:hover { background: var(--muted-surface); }
.network { display: flex; align-items: center; gap: 7px; margin-right: 10px; color: var(--muted); font-weight: 620; font-size: .82rem; white-space: nowrap; }
.signal { border-radius: 50%; width: 8px; height: 8px; display: block; background: #28a770; }
.network.offline .signal { background: #c4872c; }
.icon-button { border: 1px solid transparent; border-radius: 11px; width: 44px; height: 44px; padding: 0; display: inline-grid; place-items: center; flex: none; background: transparent; }
.icon-button.subtle { background: var(--muted-surface); color: var(--accent-ink); }
.icon-button.subtle:hover { background: var(--accent-surface); }
.icon-button:active, .button:active { transform: translateY(1px); }
.layout { display: grid; grid-template-columns: minmax(300px, 365px) minmax(0, 1fr); gap: 23px; max-width: 1330px; margin: 0 auto; padding: 27px 32px 40px; }
.layout.single { display: block; max-width: 900px; }
.sidebar { display: flex; flex-direction: column; gap: 13px; min-width: 0; }
.workspace { display: flex; flex-direction: column; gap: 17px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--round); box-shadow: var(--shadow); min-width: 0; }
.planner { padding: 24px; }
.planner-head { margin-bottom: 22px; }
.planner-head p { margin-top: 7px; }
.large-icon { width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; color: var(--accent-ink); background: var(--accent-surface); margin-bottom: 13px; }
.large-icon svg { width: 25px; height: 25px; }
.location-box { border: 1px solid var(--line); background: var(--muted-surface); border-radius: 15px; }
.place-row { min-height: 67px; display: grid; grid-template-columns: 23px minmax(0, 1fr) 39px; align-items: center; gap: 9px; padding: 7px 8px 7px 13px; position: relative; }
.place-row + .place-row { border-top: 1px solid var(--line); }
.place-symbol { display: grid; place-items: center; color: var(--accent); width: 22px; height: 22px; }
.place-symbol.start-symbol::before { content: ""; display: block; border-radius: 50%; border: 3px solid var(--accent); width: 11px; height: 11px; }
.place-row > .icon-button { width: 38px; height: 44px; }
.place-row > .icon-button svg { width: 19px; height: 19px; }
.place-input label { color: var(--muted); font-weight: 650; font-size: .875rem; display: block; }
.place-input input { border: none; padding: 1px 0; font-size: 1rem; width: 100%; display: block; background: transparent; text-overflow: ellipsis; min-width: 0; }
.place-input input::placeholder { color: var(--muted); opacity: .92; }
.place-menu { position: absolute; top: calc(100% - 2px); left: 4px; right: 4px; z-index: 540; background: var(--surface); box-shadow: 0 10px 26px #14282338; border: 1px solid var(--line); border-radius: 13px; overflow: auto; max-height: min(360px, 46dvh); padding: 4px; }
.place-option, .location-option { display: flex; align-items: center; text-align: left; width: 100%; min-height: 49px; gap: 10px; padding: 9px 10px; border: 0; background: transparent; border-radius: 10px; text-decoration: none; color: var(--ink); }
.place-option:hover, .location-option:hover { background: var(--muted-surface); }
.place-option > svg, .location-option > svg { width: 19px; height: 19px; color: var(--accent); }
.place-option strong, .location-option strong { display: block; font-weight: 670; }
.place-option small, .location-option small { display: block; color: var(--muted); font-size: .8rem; }
.place-option.search-address { color: var(--accent-ink); font-weight: 700; }
.menu-message { padding: 9px; font-size: .88rem; color: var(--muted); }
.when { margin: 17px 0 10px; }
.segmented { display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border: 1px solid var(--line); border-radius: 12px; background: var(--muted-surface); }
.segmented input { position: absolute; opacity: 0; }
.segmented span { display: grid; place-items: center; min-height: 42px; color: var(--muted); font-weight: 650; border-radius: 9px; cursor: pointer; font-size: .91rem; }
.segmented input:checked + span { color: var(--accent-ink); background: var(--surface); box-shadow: 0 1px 3px #172d2820; }
.segmented input:focus-visible + span { outline: 2px solid var(--accent); }
.date-row { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 8px; margin-top: 10px; }
.input-box { min-width: 0; padding: 6px 10px; border: 1px solid var(--line); background: var(--muted-surface); border-radius: 12px; position: relative; }
.input-box span { display: block; color: var(--muted); font-size: .875rem; font-weight: 650; }
.input-box input { appearance: none; -webkit-appearance: none; background: transparent; border: 0; padding: 0; text-align: left; font-size: .98rem; min-height: 24px; min-width: 0; width: 100%; line-height: 1.3; }
.input-box input::-webkit-date-and-time-value { text-align: left; }
.zone { display: flex; align-items: center; gap: 6px; margin-top: 7px; font-size: .82rem; color: var(--muted); }
.zone svg { width: 15px; height: 15px; }
.travelers { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); padding: 11px 0; gap: 10px; margin-top: 11px; }
.travelers-label { display: flex; align-items: center; gap: 8px; font-weight: 640; }
.travelers-label svg { color: var(--accent); width: 20px; }
.counter { display: flex; align-items: center; gap: 7px; font-variant-numeric: tabular-nums; }
.counter .icon-button { width: 42px; height: 44px; }
.counter output { min-width: 19px; text-align: center; font-weight: 700; }
.counter svg { width: 18px; height: 18px; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 45px; padding: 10px 15px; border: 1px solid transparent; border-radius: 12px; background: var(--surface); text-align: center; color: var(--ink); font-weight: 680; text-decoration: none; line-height: 1.25; }
.button svg { width: 19px; height: 19px; }
.button.primary { color: var(--primary-ink); background: var(--primary); border-color: var(--primary); }
.button.primary:hover { filter: brightness(1.07); }
.button.secondary { color: var(--accent-ink); background: var(--muted-surface); border-color: var(--line); }
.button.secondary:hover { background: var(--accent-surface); }
.search-button, .now-button { width: 100%; }
.search-button { min-height: 49px; }
.now-button { margin-top: 8px; }
.form-feedback { font-size: .89rem; padding: 8px 10px; border-radius: 8px; margin-bottom: 9px; }
.form-feedback.error, .error { color: var(--error-ink); background: var(--error-bg); }
.form-feedback.note, .notice { color: var(--warn-ink); background: var(--warn-bg); }
.side-links { padding-left: 4px; }
.text-button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; border: 0; padding: 7px 8px; border-radius: 9px; color: var(--accent-ink); font-size: .91rem; font-weight: 650; background: transparent; }
.text-button svg { width: 18px; height: 18px; }
.section-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 17px 19px 14px; }
.section-head .muted { margin-top: 4px; }
.map-frame { position: relative; margin: 0 9px 9px; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
#map { height: clamp(285px, 41vh, 520px); width: 100%; background: var(--map); isolation: isolate; font-family: inherit; }
.map-panel.searched #map { height: 245px; }
.map-frame .leaflet-tile-pane { filter: saturate(.78); }
[data-theme="dark"] .map-frame .leaflet-tile-pane { filter: invert(1) hue-rotate(170deg) brightness(.82) saturate(.58); }
.leaflet-container .leaflet-control-attribution { font-size: 11px; }
.leaflet-tooltip.city-label { font-family: inherit; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); background: var(--surface); padding: 4px 8px; font-weight: 650; }
.leaflet-tooltip.city-label::before { display: none; }
.map-fallback { position: absolute; left: 8px; top: 8px; z-index: 500; padding: 5px 8px; border-radius: 6px; background: var(--surface); color: var(--muted); font-size: .78rem; }
.favorites-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 0 10px 12px; gap: 5px 8px; }
.favorite-card { display: flex; min-width: 0; text-align: left; border: 1px solid var(--line); background: var(--muted-surface); border-radius: 13px; align-items: center; }
.favorite-card > .location-option { min-width: 0; gap: 10px; padding: 11px 9px; min-height: 63px; }
.favorite-card button strong, .favorite-card button small { overflow-wrap: anywhere; }
.favorite-card > .icon-button { color: var(--muted); }
.favorite-icon { background: var(--accent-surface); border-radius: 10px; width: 37px; height: 37px; color: var(--accent-ink); flex: none; display: grid; place-items: center; }
.favorite-icon svg { width: 19px; height: 19px; }
.results-head { flex-wrap: wrap; }
.sort { display: inline-flex; position: relative; flex: none; max-width: 100%; }
.sort select { border: 1px solid var(--line); color: var(--ink); background: var(--muted-surface); padding: 9px 35px 9px 10px; border-radius: 10px; appearance: none; min-height: 44px; font-size: .9rem; max-width: 100%; }
.sort > span:last-child { pointer-events: none; color: var(--muted); position: absolute; right: 9px; top: 12px; }
.sort svg { width: 18px; height: 18px; }
.route-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 10px 11px; }
.route-card { background: var(--muted-surface); border: 1px solid var(--line); border-radius: 15px; padding: 13px; display: flex; flex-direction: column; gap: 8px; overflow: hidden; }
.route-card.recommended { border-color: var(--accent); background: color-mix(in srgb, var(--accent-surface) 38%, var(--surface)); }
.route-card > .button { width: 100%; margin-top: auto; }
.route-card.recommended > .button { background: var(--surface); }
.badge { font-size: .8rem; padding: 3px 8px; border-radius: 8px; background: var(--accent-surface); color: var(--accent-ink); font-weight: 720; align-self: start; }
.badge.warning { background: var(--warn-bg); color: var(--warn-ink); }
.line-list { display: flex; align-items: center; flex-wrap: wrap; gap: 5px; color: var(--ink); }
.line-pill { display: inline-flex; gap: 6px; align-items: center; font-size: .81rem; font-weight: 690; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 7px; }
.line-pill svg { width: 17px; height: 17px; color: var(--accent-ink); }
.times { font-size: 1.33rem; font-weight: 750; letter-spacing: -.04em; font-variant-numeric: tabular-nums; }
.times span { font-weight: 450; color: var(--muted); }
.metrics { display: flex; gap: 4px 11px; font-size: .85rem; flex-wrap: wrap; color: var(--muted); }
.metrics span { display: inline-flex; align-items: center; gap: 4px; }
.metrics svg { width: 15px; height: 15px; }
.route-price { font-weight: 710; }
.route-price .muted { font-weight: 550; display: block; }
.route-reason { font-size: .84rem; color: var(--accent-ink); }
.fx-note { padding: 3px 16px 13px; font-size: .81rem; }
.more { margin: 0 10px 10px; }
.notice, .error { padding: 10px 12px; border-radius: 11px; font-size: .88rem; line-height: 1.34; }
#result-warnings .notice { margin: 0 10px 9px; }
.empty { grid-column: 1 / -1; padding: 14px; border-radius: 12px; color: var(--muted); background: var(--muted-surface); }
.empty strong { color: var(--ink); }
.skel { display: grid; gap: 9px; padding: 8px; width: 100%; grid-column: 1 / -1; }
.skel span { width: 100%; height: 21px; border-radius: 7px; background: var(--muted-surface); border: 1px solid var(--line); animation: pulse 1.6s ease-in-out infinite; }
.skel span:last-child { width: 65%; }
@keyframes pulse { 50% { opacity: .5; } }
.alternatives, .nearby, .track-panel { padding: 15px; }
.track-panel > .section-head { padding: 0 0 12px; }
.alt-title, .nearby h2 { margin-bottom: 8px; }
.alt-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 8px; margin-top: 8px; }
.alt-card { display: flex; flex-direction: column; gap: 6px; background: var(--muted-surface); border: 1px solid var(--line); border-radius: 12px; padding: 11px; }
.alt-card .button { margin-top: auto; }
.section-note { margin-top: 8px; color: var(--muted); font-size: .88rem; }
.near-item, .source-item { border-bottom: 1px solid var(--line); padding: 10px 0; font-size: .91rem; }
.near-item:last-child, .source-item:last-child { border-bottom: 0; }
.near-item p, .source-item p { color: var(--muted); font-size: .84rem; }
.near-item > a { display: inline-flex; align-items: center; min-height: 44px; }
.dialog { width: min(670px, calc(100% - 30px)); max-height: calc(100dvh - 30px); padding: 0 16px 17px; border: 1px solid var(--line); border-radius: 19px; background: var(--surface); color: var(--ink); box-shadow: 0 14px 60px #1029234d; }
.dialog::backdrop { background: #061b1b94; }
.dialog.small-dialog { width: min(432px, calc(100% - 22px)); }
.dialog-head { position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; gap: 9px; align-items: center; padding: 14px 0 10px; background: var(--surface); }
.dialog h3, .track-panel h3 { margin-top: 14px; margin-bottom: 6px; }
.dialog p + p { margin-top: 5px; }
.detail-summary { background: var(--muted-surface); border: 1px solid var(--line); padding: 10px 12px; border-radius: 12px; margin: 3px 0 10px; }
.detail-summary p { margin-top: 3px; }
.button-row { display: flex; flex-wrap: wrap; gap: 7px; margin: 9px 0; }
.timeline { display: grid; margin: 15px 0; gap: 9px; }
.step { background: var(--muted-surface); border: 1px solid var(--line); border-radius: 12px; display: grid; grid-template-columns: 35px minmax(0, 1fr); padding: 10px; gap: 9px; }
.step-symbol { color: var(--accent-ink); border-radius: 10px; background: var(--accent-surface); width: 35px; height: 35px; display: grid; place-items: center; }
.step .meta { font-size: .84rem; color: var(--muted); }
.step .stop-line { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px; margin-top: 5px; }
.step .stop-line > span:first-child { font-weight: 720; font-variant-numeric: tabular-nums; }
.step .status { margin: 6px 0; font-size: .85rem; }
.step .step-links { display: flex; flex-wrap: wrap; gap: 8px 13px; align-items: center; margin-top: 3px; font-size: .85rem; }
.step-links a { display: inline-flex; min-height: 44px; align-items: center; }
.step .notice { margin: 7px 0; }
.alert-list { display: grid; gap: 6px; margin-top: 7px; padding: 0; list-style: none; }
.installation { padding-left: 20px; }
.save-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.toast { position: fixed; z-index: 1600; bottom: 21px; left: 50%; transform: translateX(-50%); max-width: calc(100vw - 24px); min-width: 220px; padding: 11px 15px; color: var(--primary-ink); background: var(--primary); border-radius: 12px; box-shadow: var(--shadow); }
.noscript { margin: 10px 20px; }
@media (max-width: 1140px) {
  .route-list { grid-template-columns: 1fr; }
  .layout, .topbar-inner { padding-left: 21px; padding-right: 21px; }
}
@media (max-width: 820px) {
  .favorites-grid { grid-template-columns: 1fr; }
  .layout { gap: 13px; grid-template-columns: minmax(280px, 330px) minmax(0, 1fr); }
  .planner { padding: 18px; }
  .topbar-inner { padding-left: 15px; padding-right: 15px; }
  .nav-tab { padding: 0 8px; }
}
@media (max-width: 680px) {
  .topbar { position: sticky; top: 0; z-index: 600; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  .topbar-inner { height: auto; min-height: 61px; padding: 8px 13px 5px; flex-wrap: wrap; row-gap: 3px; }
  .brand img { height: 36px; width: 36px; border-radius: 10px; }
  .brand { font-size: 1.17rem; }
  .network { margin-right: 0; font-size: .77rem; }
  .tabs { order: 3; flex: 1 0 100%; padding: 3px 0; justify-content: center; gap: 4px; }
  .nav-tab { font-size: .84rem; flex: 1 1 0; justify-content: center; gap: 5px; min-height: 44px; }
  .nav-tab svg { width: 18px; height: 18px; }
  .layout { display: flex; flex-direction: column; padding: 10px 10px calc(82px + env(safe-area-inset-bottom)); gap: 12px; }
  .sidebar, .workspace { gap: 11px; }
  .planner { padding: 17px; }
  .planner-head { margin-bottom: 13px; }
  .planner-head .large-icon { display: none; }
  .planner-head p { margin-top: 4px; }
  .place-row { min-height: 62px; }
  .when { margin-top: 12px; }
  .travelers { margin-top: 7px; padding: 7px 0; }
  .section-head { padding: 14px 13px 10px; }
  #map, .map-panel.searched #map { height: 220px; }
  .map-reset { width: 36px; }
  .map-reset svg { width: 17px; }
  .map-panel.searched { order: 2; }
  .results-panel { order: 0; scroll-margin-top: calc(123px + env(safe-area-inset-top)); }
  .alternatives { order: 1; }
  .favorites-panel { order: 3; }
  .side-links { order: 3; padding: 0; }
  .side-links .text-button { min-height: 39px; }
  .toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
  .dialog { width: calc(100% - 12px); max-height: calc(100dvh - 13px - env(safe-area-inset-bottom)); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; scroll-behavior: auto !important; }
}
