:root {
  color-scheme: light;
  --bg: #fbfcfe;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-solid: #ffffff;
  --surface-muted: #f6f8fb;
  --text: #070b12;
  --muted: #6f7a88;
  --hairline: rgba(16, 24, 40, 0.095);
  --blue: #0875ff;
  --blue-2: #0a84ff;
  --green: #31c26b;
  --purple: #9747ff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
  --blur: blur(20px) saturate(1.3);
}

body.dark {
  color-scheme: dark;
  --bg: #061018;
  --surface: rgba(16, 25, 35, 0.88);
  --surface-solid: #101923;
  --surface-muted: #121d27;
  --text: #f8fbff;
  --muted: #a4afbd;
  --hairline: rgba(255, 255, 255, 0.085);
  --shadow: 0 18px 45px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
  line-height: 1.34;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

svg {
  display: block;
}

.app-shell {
  width: 100%;
  max-width: 430px;
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -20%, rgba(0, 110, 252, 0.12), transparent 35%),
    var(--bg);
}

.main,
.view {
  min-height: 0;
}

.view {
  display: none;
  height: 100dvh;
  overflow: auto;
}

.view.active {
  display: block;
}

.view-map {
  overflow: hidden;
}

.map-wrap {
  position: relative;
  height: 100dvh;
  min-height: 100dvh;
  overflow: hidden;
  background: #eef4f8;
}

body.dark .map-wrap {
  background: #142433;
}

.map,
.fallback-map {
  position: absolute;
  inset: 0;
}

.fallback-map {
  background: #eef3f7;
}

body.dark .fallback-map {
  background: #132433;
}

.fallback-grid {
  position: absolute;
  inset: -40px;
  background-image:
    linear-gradient(26deg, transparent 47%, rgba(139, 151, 163, 0.24) 48%, rgba(139, 151, 163, 0.24) 51%, transparent 52%),
    linear-gradient(97deg, transparent 48%, rgba(139, 151, 163, 0.2) 49%, rgba(139, 151, 163, 0.2) 51%, transparent 52%);
  background-size: 110px 76px, 92px 84px;
}

.water,
.park,
.road {
  position: absolute;
  pointer-events: none;
}

.water {
  background: rgba(189, 220, 255, 0.88);
}

body.dark .water {
  background: rgba(11, 85, 153, 0.95);
}

.water-a {
  left: -12%;
  bottom: -8%;
  width: 92%;
  height: 30%;
  border-radius: 50% 62% 0 0;
  transform: rotate(-19deg);
}

.water-b {
  right: -18%;
  top: 19%;
  width: 26%;
  height: 92%;
  border-radius: 999px;
  transform: rotate(21deg);
}

.park {
  background: rgba(207, 238, 207, 0.72);
  border-radius: 18px;
}

body.dark .park {
  background: rgba(18, 112, 71, 0.74);
}

.park-a {
  left: 2%;
  top: 18%;
  width: 24%;
  height: 12%;
  transform: rotate(-15deg);
}

.park-b {
  right: 18%;
  top: 8%;
  width: 18%;
  height: 9%;
  transform: rotate(18deg);
}

.road {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 0 0 1px rgba(145, 154, 166, 0.42);
}

body.dark .road {
  background: #354654;
  box-shadow: 0 0 0 1px rgba(216, 226, 238, 0.26);
}

.road-a {
  left: -10%;
  top: 42%;
  width: 118%;
  transform: rotate(-18deg);
}

.road-b {
  left: 12%;
  top: 18%;
  width: 82%;
  transform: rotate(44deg);
}

.road-c {
  left: 0;
  bottom: 28%;
  width: 90%;
  transform: rotate(12deg);
}

.floating-search {
  height: 48px;
  display: grid;
  grid-template-columns: 19px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.13);
  backdrop-filter: var(--blur);
  color: var(--muted);
}

body.dark .floating-search {
  background: rgba(16, 25, 35, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.24);
}

.floating-search svg {
  width: 19px;
  height: 19px;
  margin-left: 0;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
}

.floating-search input {
  min-width: 0;
  height: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 13px;
}

.map-search {
  position: absolute;
  top: max(34px, env(safe-area-inset-top));
  left: 17px;
  right: 17px;
  z-index: 5;
}

.search-popover {
  position: absolute;
  top: 60px;
  left: 0;
  right: 0;
  display: grid;
  gap: 8px;
}

.search-popover:empty {
  display: none;
}

.location-button {
  position: absolute;
  right: 24px;
  bottom: calc(78px + 24px + env(safe-area-inset-bottom));
  z-index: 5;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #fff;
  box-shadow: 0 14px 30px rgba(0, 110, 252, 0.32);
  transition: transform 170ms ease, background 170ms ease, color 170ms ease, border 170ms ease;
}

.loc-icon-wrap {
  position: relative;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.loc-state {
  position: absolute;
  inset: 0;
  width: 42px;
  height: 42px;
  display: block;
  object-fit: contain;
  opacity: 0;
  transition: opacity 200ms ease;
}

.location-button.outline {
  background: transparent;
  color: var(--text);
  border: 0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

body.dark .location-button.outline {
  color: #eef3f8;
  background: transparent;
  border-color: transparent;
}

.location-button.outline .notFocusedIconLight,
.location-button.focused .focusedIcon,
.location-button.heading .headingIcon {
  opacity: 1;
}

body.dark .location-button.outline .notFocusedIconLight {
  opacity: 0;
}

body.dark .location-button.outline .notFocusedIconDark {
  opacity: 1;
}

.map-mode-button {
  position: absolute;
  right: 24px;
  bottom: calc(78px + 76px + env(safe-area-inset-bottom));
  z-index: 5;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.13);
  padding: 0;
}

.map-mode-icon {
  width: 42px;
  height: 42px;
  display: none;
  object-fit: contain;
  flex: 0 0 42px;
}

.map-mode-button.is-2d .map-mode-2d-light {
  display: block;
}

.map-mode-button.is-3d .map-mode-3d-light {
  display: block;
}

body.dark .map-mode-button.is-2d .map-mode-2d-light,
body.dark .map-mode-button.is-3d .map-mode-3d-light {
  display: none;
}

body.dark .map-mode-button.is-2d .map-mode-2d-dark,
body.dark .map-mode-button.is-3d .map-mode-3d-dark {
  display: block;
}

.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 0;
  width: 100%;
  max-width: 430px;
  height: calc(78px + env(safe-area-inset-bottom));
  padding: 6px 16px calc(8px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--hairline);
  background: color-mix(in srgb, var(--surface-solid) 86%, transparent);
  backdrop-filter: var(--blur);
  transform: translateX(-50%);
  z-index: 9;
}

.nav-button {
  min-width: 0;
  border: 0;
  background: transparent;
  color: #6d7785;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 4px;
  padding: 4px 2px 2px;
}

.nav-button svg {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  transform: none;
}

.nav-button small {
  font-size: 11px;
  font-weight: 650;
}

.nav-button.active {
  color: var(--blue);
}

.page-view {
  background: var(--bg);
}

.page-content {
  max-width: 430px;
  margin: 0 auto;
  min-height: calc(100dvh - 78px - env(safe-area-inset-bottom));
  padding: max(34px, env(safe-area-inset-top)) 17px calc(104px + env(safe-area-inset-bottom));
}

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

h1 {
  margin-bottom: 18px;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 800;
}

[data-view="nav"] h1 {
  font-weight: 700;
}

h2 {
  margin: 22px 0 8px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
}

#searchEmpty.hidden {
  display: none;
}

#searchEmpty.empty-state {
  position: absolute;
  top: 96px;
  bottom: calc(78px + env(safe-area-inset-bottom));
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 0;
  margin: 0;
  text-align: center;
}

.empty-state img {
  width: 170px;
  height: auto;
  display: block;
}

#searchEmpty .empty-illustration-dark {
  display: none;
}

body.dark #searchEmpty .empty-illustration-dark {
  display: block;
}

body.dark #searchEmpty .empty-illustration-light {
  display: none;
}

.empty-state p {
  margin: 0;
  max-width: 270px;
  font-size: 15px;
  line-height: 1.5;
  color: #aeb9c8;
}

body:not(.dark) .empty-state p {
  color: #6f7a88;
}

.result-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

#searchResults[hidden] {
  display: none !important;
}

.search-result-group {
  display: grid;
  gap: 8px;
}

.search-result-group h2 {
  margin: 12px 2px 0;
}

.search-result-group-list {
  display: grid;
  gap: 10px;
}

.result-list:empty {
  display: none;
}

.result-item,
.departure-item,
.line-chip,
.settings-card,
.stop-detail-panel,
.navigation-card,
.planner-fields {
  border: 1px solid var(--hairline);
  background: var(--surface);
  backdrop-filter: var(--blur);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
}

.result-item,
.departure-item,
.line-chip {
  width: 100%;
  min-height: 62px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-radius: 12px;
  color: var(--text);
  text-align: left;
}

.result-item strong,
.departure-item strong {
  display: block;
}

.search-result-static {
  min-height: 62px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  backdrop-filter: var(--blur);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.07);
  cursor: default;
}

.loading-state {
  justify-content: center;
}

.search-spinner {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid color-mix(in srgb, var(--muted) 28%, transparent);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: search-spin 0.8s linear infinite;
}

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

.meta {
  color: var(--muted);
  font-size: 0.85rem;
}

.badge,
.line-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 12px;
  box-sizing: border-box;
  border-radius: 999px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  line-height: 1;
}

.line-badge.purple {
  background: var(--purple);
}

.line-badge.green {
  background: var(--green);
}

.stop-detail-panel {
  display: none;
  margin-top: 16px;
  padding: 14px;
  border-radius: 16px;
}

.stop-detail-panel.open {
  display: block;
}

.search-back-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 14px 0 10px;
  font: inherit;
  font-size: 14px;
  font-weight: 600;
}

.search-back-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.line-filter {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 0 12px;
}

.date-filter {
  min-height: 44px;
  margin: 12px 0 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--text);
}

.date-filter span {
  font-weight: 600;
}

.date-filter input {
  min-height: 38px;
  border: 1px solid var(--hairline);
  border-radius: 10px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0 10px;
}

.line-chip {
  width: auto;
  min-height: 38px;
  padding: 0 14px;
  white-space: nowrap;
}

.line-chip.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.trip-timeline {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.trip-stop {
  display: grid;
  grid-template-columns: 18px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  color: var(--muted);
}

.trip-stop::before {
  content: "";
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #a7b3c2;
}

.trip-stop.current {
  color: var(--text);
  font-weight: 800;
}

.trip-stop.current::before {
  width: 15px;
  height: 15px;
  background: var(--blue);
  box-shadow: 0 0 0 8px rgba(0, 110, 252, 0.14);
}

.trip-stop.passed {
  opacity: 0.58;
}

.detail-sheet {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 10;
  max-height: min(70vh, 560px);
  overflow: auto;
  transform: translateY(calc(100% + 130px));
  transition: transform 190ms ease;
  border: 1px solid var(--hairline);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
  backdrop-filter: var(--blur);
}

.detail-sheet.open {
  transform: translateY(0);
}

.line-action-sheet {
  z-index: 40;
}

.line-action-sheet .sheet-head {
  grid-template-columns: 1fr auto;
}

.line-action-body {
  display: grid;
  gap: 10px;
}

.line-action-button {
  width: 100%;
  min-height: 66px;
  display: grid;
  gap: 4px;
  padding: 14px 16px;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.line-action-button strong {
  font-size: 15px;
  font-weight: 700;
}

.line-action-button span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.line-action-button.primary {
  border-color: rgba(22, 119, 255, 0.45);
  background: linear-gradient(180deg, #1677ff, #0f66e4);
  color: #fff;
}

.line-action-button.primary span {
  color: rgba(255, 255, 255, 0.78);
}

.sheet-head {
  display: grid;
  grid-template-columns: 72px 1fr auto auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border-bottom: 1px solid var(--hairline);
}

.sheet-head img {
  width: 72px;
  height: 72px;
  object-fit: contain;
  padding: 8px;
  border-radius: 16px;
  background: var(--surface-muted);
}

.sheet-head h2 {
  margin: 7px 0 2px;
  font-size: 1.05rem;
}

.icon-button {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--surface-muted);
  color: var(--text);
}

.icon-button svg {
  width: 21px;
  height: 21px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-button.active {
  background: var(--blue);
  color: #fff;
  border-color: var(--blue);
}

.sheet-body {
  padding: 14px;
}

.kv-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.kv {
  min-height: 58px;
  padding: 10px;
  border-radius: 14px;
  background: var(--surface-muted);
}

.kv span,
.settings-row span {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
}

.kv strong {
  display: block;
  margin-top: 4px;
}

.stop-list {
  display: grid;
  gap: 8px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.stop-list li {
  padding: 10px;
  border-radius: 12px;
  background: var(--surface-muted);
}

.stop-list li span,
.stop-list li small {
  display: block;
}

.stop-list li small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.25;
}

.navigation-card .stop-list {
  gap: 6px;
}

.navigation-card .stop-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 126px;
  align-items: baseline;
  column-gap: 14px;
  min-height: 42px;
}

.navigation-card .stop-list li strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.navigation-card .stop-list li .meta {
  display: block;
  width: 126px;
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}

.route-planner {
  position: relative;
  display: grid;
  grid-template-columns: 40px 1fr;
  gap: 12px;
  align-items: center;
  z-index: 4;
}

.route-dots {
  height: 154px;
  display: grid;
  justify-items: center;
  align-content: space-between;
  color: #8b99aa;
}

.route-dots span,
.route-dots b {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: currentColor;
}

.route-dots i {
  height: 44px;
  border-left: 4px dotted currentColor;
}

.route-dots b {
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
}

.planner-fields {
  border-radius: 14px;
  overflow: hidden;
}

.route-suggestions {
  position: fixed;
  z-index: 80;
  max-height: 248px;
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  backdrop-filter: var(--blur);
}

.route-suggestions.hidden {
  display: none;
}

.route-suggestions button {
  width: 100%;
  min-height: 48px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  text-align: left;
}

.route-suggestions button + button {
  border-top: 1px solid var(--hairline);
}

.route-suggestions strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
  font-weight: 650;
}

.route-suggestions span {
  max-width: 48%;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  white-space: nowrap;
}

.planner-fields label {
  min-height: 58px;
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  align-items: center;
  gap: 12px;
  padding: 0 14px;
}

.planner-fields label + label {
  border-top: 1px solid var(--hairline);
}

.planner-fields span {
  font-weight: 600;
}

select,
.planner-fields input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 400;
  line-height: 1.3;
}

[data-view="nav"] .planner-fields select,
[data-view="nav"] .planner-fields input {
  font-weight: 400;
}

.primary-button {
  width: 100%;
  min-height: 48px;
  margin: 20px 0;
  border: 0;
  border-radius: 12px;
  background: var(--blue);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 14px 28px rgba(0, 110, 252, 0.22);
}

.nav-recent {
  margin: 2px 0 20px;
}

.nav-recent h2 {
  margin-top: 0;
}

.nav-recent-list {
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
}

.nav-recent-item {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 38px 1fr;
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 10px 14px;
  text-align: left;
}

.nav-recent-item + .nav-recent-item {
  border-top: 1px solid var(--hairline);
}

.recent-route-preview {
  border-top: 1px solid var(--hairline);
  border-radius: 0;
  background: var(--surface);
}

.recent-line {
  grid-row: 1 / 3;
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #9747ff;
  color: #fff;
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}

.recent-line.blue {
  background: var(--blue);
}

.recent-line.green {
  background: #2e8b57;
}

.nav-recent-item strong {
  font-size: 13px;
  font-weight: 650;
  line-height: 1.25;
}

.nav-recent-item small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.navigation-card {
  overflow: hidden;
  border-radius: 16px;
}

.page-view.navigation-active {
  overflow: hidden;
}

.page-view.navigation-active .page-content {
  max-width: 430px;
  height: 100dvh;
  min-height: 100dvh;
  padding: 0 0 calc(78px + env(safe-area-inset-bottom));
}

.page-view.navigation-active .page-content > :not(.navigation-card) {
  display: none;
}

.navigation-card.is-active {
  height: calc(100dvh - 78px - env(safe-area-inset-bottom));
  border-radius: 0;
}

.nav-map-preview {
  position: relative;
  height: 210px;
  overflow: hidden;
  background: #eaf1f8;
}

.nav-preview-map {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.nav-preview-map.is-empty {
  background: #eaf1f8;
}

.nav-preview-route-svg {
  position: absolute;
  inset: 28px 18px 54px;
  width: calc(100% - 36px);
  height: calc(100% - 82px);
  z-index: 1;
  pointer-events: none;
}

.nav-preview-route-svg polyline {
  fill: none;
  stroke: var(--blue);
  stroke-width: 7;
  stroke-linecap: round;
  stroke-linejoin: round;
  opacity: 0.88;
}

.nav-preview-route-placeholder {
  position: absolute;
  inset: 34px 24px 64px;
  z-index: 1;
  border: 5px solid rgba(0, 110, 252, 0.55);
  border-radius: 999px;
  pointer-events: none;
}

.navigation-card.is-active .nav-map-preview {
  height: 100%;
}

body.dark .nav-map-preview {
  background: #07131d;
}

.nav-active-topbar {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 2;
  min-height: 52px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  padding: 10px 42px 10px 12px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  backdrop-filter: var(--blur);
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.11);
}

.nav-active-topbar > div {
  min-width: 0;
  text-align: center;
}

.nav-active-topbar strong,
.nav-active-topbar span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-active-topbar strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.nav-active-topbar span {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.nav-instruction-bar {
  position: absolute;
  top: 78px;
  left: 18px;
  right: 18px;
  z-index: 2;
  min-height: 42px;
  display: grid;
  grid-template-columns: 30px minmax(74px, auto) minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  color: var(--text);
  backdrop-filter: var(--blur);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.nav-instruction-bar strong,
.nav-instruction-bar span,
.nav-instruction-bar small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.nav-instruction-main {
  display: flex;
  flex-direction: column;
  gap: 1px;
}

.nav-instruction-main strong {
  font-size: 14px;
  font-weight: 750;
}

.nav-instruction-main small {
  color: var(--muted);
  font-size: 11px;
}

.nav-instruction-road {
  color: var(--text);
  font-size: 12px;
  white-space: normal;
}

.nav-instruction-arrow {
  width: 30px;
  height: 30px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--blue);
  color: #fff;
  font-size: 19px;
  font-weight: 700;
}

.nav-instruction-arrow svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-simulation-panel {
  position: absolute;
  top: 132px;
  left: 18px;
  right: 18px;
  z-index: 2;
  display: grid;
  grid-template-columns: auto minmax(0, auto) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--hairline);
  border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text);
  backdrop-filter: var(--blur);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
}

.nav-sim-toggle,
.nav-sim-speeds button,
.nav-sim-reset {
  min-height: 30px;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface-2) 86%, transparent);
  color: var(--text);
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
}

.nav-sim-toggle {
  padding: 0 12px;
}

.nav-sim-reset {
  padding: 0 10px;
}

.nav-sim-toggle.is-active,
.nav-sim-speeds button.active {
  border-color: rgba(35, 165, 90, 0.5);
  background: rgba(35, 165, 90, 0.18);
  color: var(--text);
}

.nav-sim-speeds {
  display: flex;
  gap: 5px;
}

.nav-sim-speeds button {
  width: 34px;
  padding: 0;
}

.nav-sim-debug {
  min-width: 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-close-button {
  position: absolute;
  top: calc(50% - 14px);
  right: 8px;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #d92d20;
  color: #fff;
  font-size: 19px;
  font-weight: 500;
  line-height: 1;
  box-shadow: 0 8px 18px rgba(217, 45, 32, 0.22);
}

.nav-close-button svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
}

.nav-settings-shell {
  position: absolute;
  right: 12px;
  bottom: 14px;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.navigation-card.is-active .nav-settings-shell {
  right: 24px;
  bottom: 24px;
}

.nav-settings-toggle,
.nav-settings-action {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  border: 1px solid var(--hairline);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.13);
  backdrop-filter: var(--blur);
  font-size: 11px;
  font-weight: 700;
}

.nav-settings-toggle {
  border: 0;
  background: transparent;
  padding: 0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.nav-settings-toggle svg,
.nav-settings-action svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-settings-icon-wrap,
.nav-settings-icon {
  width: 44px;
  height: 44px;
  display: block;
}

.nav-settings-icon-wrap {
  position: relative;
  flex: 0 0 44px;
}

.nav-settings-icon {
  position: absolute;
  inset: 0;
  object-fit: contain;
  opacity: 0;
}

.nav-settings-icon-light {
  opacity: 1;
}

body.dark .nav-settings-icon-light {
  opacity: 0;
}

body.dark .nav-settings-icon-dark {
  opacity: 1;
}

.nav-recenter-button {
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 42px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  padding: 0;
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.14);
}

.nav-recenter-button .loc-icon-wrap {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
}

.nav-recenter-button .loc-state {
  width: 42px;
  height: 42px;
}

.nav-recenter-button.is-free .notFocusedIconLight,
.nav-recenter-button.is-focused .focusedIcon {
  opacity: 1;
}

body.dark .nav-recenter-button.is-free .notFocusedIconLight {
  opacity: 0;
}

body.dark .nav-recenter-button.is-free .notFocusedIconDark {
  opacity: 1;
}

.nav-settings-panel {
  position: relative;
  width: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  padding: 8px 0;
  border: 1px solid var(--hairline);
  border-radius: 999px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: var(--blur);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.nav-settings-action.is-off {
  position: relative;
  color: var(--muted);
}

.nav-settings-action.is-off svg path:last-child {
  opacity: 0.35;
}

.nav-settings-action.is-off::after {
  content: "";
  position: absolute;
  width: 24px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: rotate(-42deg);
}

.nav-action-text {
  line-height: 1;
}

.nav-color-action {
  color: #fff;
  background: var(--bus-primary, var(--nav-bus-color, var(--blue)));
  border-color: rgba(255, 255, 255, 0.28);
}

.nav-color-menu {
  position: absolute;
  right: 64px;
  bottom: 8px;
  width: 168px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.18);
  backdrop-filter: var(--blur);
}

.nav-color-option {
  width: 100%;
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 12px;
  text-align: left;
  font-size: 12px;
  line-height: 1.2;
}

.nav-color-option + .nav-color-option {
  border-top: 1px solid var(--hairline);
}

.nav-color-option span {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 2px solid rgba(255, 255, 255, 0.86);
  border-radius: 50%;
  background: var(--bus-primary, var(--nav-bus-color, var(--blue)));
  box-shadow: 0 0 0 1px rgba(15, 23, 42, 0.18);
}

.nav-map-preview::before {
  display: none;
}

.nav-route-line {
  position: absolute;
  left: 14%;
  right: 12%;
  top: 52%;
  height: 8px;
  border-radius: 999px;
  background: #23a55a;
  transform: rotate(-18deg);
  box-shadow: 0 0 0 6px rgba(35, 165, 90, 0.14);
}

.nav-route-line.is-hidden {
  display: none;
}

.nav-bus-position {
  position: absolute;
  left: 38%;
  top: 42%;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: #fff;
  border: 0;
  box-shadow: none;
  z-index: 2;
  --vehicle-color: var(--bus-primary, var(--nav-bus-color, var(--blue)));
  --bus-window: #070b12;
  --bus-light: #ff4655;
  --bus-outline: rgba(255, 255, 255, 0.92);
  --bus-shadow: rgba(0, 0, 0, 0.28);
}

.nav-bus-position svg {
  width: 56px;
  height: 56px;
  display: block;
}

.nav-bus-position.on-map {
  position: relative;
  left: auto;
  top: auto;
}

.nav-preview-position {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.preview-position-dot {
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 12px rgba(22, 119, 255, 0.18), 0 8px 16px rgba(15, 23, 42, 0.2);
}

.preview-position-dot span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #fff;
}

.line-select-field {
  display: grid;
  gap: 6px;
  margin: 12px 0;
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
}

.line-select-field select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: var(--surface);
  color: var(--text);
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
}

.nav-bus-blue {
  --nav-bus-color: #1677ff;
  --bus-primary: #1677ff;
  --bus-primary-dark: #005cb8;
  --bus-secondary: #0d4fb8;
}

.nav-bus-red {
  --nav-bus-color: #c62828;
  --bus-primary: #c62828;
  --bus-primary-dark: #8d1d1d;
  --bus-secondary: #8d1d1d;
}

.nav-bus-green {
  --nav-bus-color: #2e8b57;
  --bus-primary: #2e8b57;
  --bus-primary-dark: #1d6240;
  --bus-secondary: #1d6240;
}

.nav-bus-orange {
  --nav-bus-color: #d97824;
  --bus-primary: #d97824;
  --bus-primary-dark: #9f5418;
  --bus-secondary: #9f5418;
}

.nav-bus-purple {
  --nav-bus-color: #6e56cf;
  --bus-primary: #6e56cf;
  --bus-primary-dark: #4935a1;
  --bus-secondary: #4935a1;
}

.nav-bus-gray {
  --nav-bus-color: #2f3540;
  --bus-primary: #2f3540;
  --bus-primary-dark: #151a20;
  --bus-secondary: #f3f5f7;
  --bus-outline: rgba(15, 23, 42, 0.84);
}

.nav-bus-avatar {
  overflow: visible;
}

.nav-bus-avatar * {
  stroke: none;
}

.bus-shadow {
  fill: var(--bus-shadow, rgba(0, 0, 0, 0.28));
}

.bus-outline {
  fill: var(--bus-outline, rgba(255, 255, 255, 0.92));
}

.bus-primary {
  fill: var(--bus-primary, var(--nav-bus-color, #1677ff));
}

.bus-secondary,
.bus-roof-unit {
  fill: var(--bus-secondary, color-mix(in srgb, var(--bus-primary, #1677ff) 72%, #07131d));
}

.bus-window,
.bus-window-side {
  fill: var(--bus-window, #070b12);
}

.bus-light {
  fill: var(--bus-light, #ff4655);
}

.bus-outline-line {
  fill: none;
  stroke: rgba(255, 255, 255, 0.42);
  stroke-width: 1.2;
  stroke-linecap: round;
}

.bus-direction-tip {
  fill: rgba(255, 255, 255, 0.86);
}

.nav-settings-action .nav-bus-avatar {
  width: 25px;
  height: 32px;
}

.nav-info {
  padding: 14px;
}

.nav-start-button {
  margin-bottom: 0;
}

.progress-track {
  height: 8px;
  margin: 14px 0;
  overflow: hidden;
  border-radius: 999px;
  background: var(--surface-muted);
}

.progress-fill {
  height: 100%;
  width: 36%;
  background: var(--blue);
}

.safety-note,
.permission-state {
  margin-top: 14px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.settings-card {
  border-radius: 14px;
  overflow: hidden;
}

.settings-row {
  width: 100%;
  min-height: 58px;
  display: flex;
  align-items: center;
  gap: 13px;
  border: 0;
  background: transparent;
  color: var(--text);
  padding: 0 14px;
  text-align: left;
  font-size: 13px;
}

.settings-row + .settings-row,
.distance-setting {
  border-top: 1px solid var(--hairline);
}

.settings-row svg {
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
  color: var(--muted);
}

.inline-select {
  width: auto;
  text-align: right;
  font-size: 12px;
  flex: 0 0 auto;
}

.settings-row strong {
  min-width: 0;
  flex: 1 1 auto;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

[data-view="settings"] h1 {
  font-weight: 700;
}

[data-view="settings"] h2 {
  font-weight: 600;
  line-height: 1.3;
}

.settings-row span {
  flex: 0 0 auto;
  font-size: 12px;
  white-space: nowrap;
}

.settings-row .switch {
  flex: 0 0 auto;
  margin-left: auto;
}

.switch input {
  position: absolute;
  opacity: 0;
}

.switch span {
  width: 45px;
  height: 26px;
  display: block;
  position: relative;
  border-radius: 999px;
  background: #d5dbe3;
}

.switch span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, 0.22);
  transition: transform 160ms ease;
}

.switch input:checked + span {
  background: var(--blue);
}

.switch input:checked + span::after {
  transform: translateX(19px);
}

.distance-setting {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px;
  font-size: 13px;
}

.distance-setting input {
  grid-column: 1 / -1;
  width: 100%;
  accent-color: var(--blue);
}

.range-ticks {
  grid-column: 1 / -1;
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 11px;
}

.vehicle-marker,
.stop-marker,
.me-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  border: 3px solid #fff;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.vehicle-marker {
  width: 22px;
  height: 22px;
  background: #6e56cf;
  border-width: 2px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1;
  padding: 0;
  text-align: center;
}

.vehicle-marker span {
  display: none;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  line-height: 1;
}

.vehicle-marker.show-label {
  width: 34px;
  height: 34px;
}

.vehicle-marker.show-label span {
  display: flex;
}

.vehicle-cluster-marker {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 34px;
  height: 34px;
  padding: 0 9px;
  border: 2px solid rgba(255, 255, 255, 0.88);
  border-radius: 999px;
  background: rgba(18, 28, 39, 0.9);
  color: #fff;
  font-size: 12px;
  font-weight: 650;
  line-height: 1;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.vehicle-marker.operator-qbuzz {
  background: #d97824;
}

.vehicle-marker.operator-arriva {
  background: #55b7e6;
}

.vehicle-marker.operator-rnet {
  background: #c62828;
}

.vehicle-marker.operator-connexxion {
  background: #2e8b57;
}

.vehicle-marker.operator-keolis {
  background: #c62828;
}

.vehicle-marker.operator-ebs {
  background: #f0c419;
  color: #111;
}

.vehicle-marker.operator-gvb {
  background: #0876d8;
}

.vehicle-marker.operator-other {
  background: #6e56cf;
}

.vehicle-marker.train {
  background: #0f57d8;
}

.route-endpoint,
.route-vehicle-position {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.route-endpoint {
  width: 18px;
  height: 18px;
  border: 3px solid #fff;
  background: #23a55a;
}

.route-endpoint.finish {
  background: #111827;
}

.route-vehicle-position {
  width: 22px;
  height: 22px;
  border: 3px solid #fff;
  background: #d97824;
}

.route-vehicle-position.operator-arriva {
  background: #55b7e6;
}

.route-vehicle-position.operator-connexxion {
  background: #2e8b57;
}

.route-vehicle-position.operator-keolis {
  background: #c62828;
}

.route-vehicle-position.operator-ebs {
  background: #f0c419;
}

.route-vehicle-position.operator-gvb {
  background: #0876d8;
}

.stop-marker {
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 6px;
  background: transparent;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.stop-marker.station {
  width: 30px;
  height: 30px;
}

.stop-marker img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  pointer-events: none;
}

.me-marker {
  width: 22px;
  height: 22px;
  background: var(--blue);
  box-shadow: 0 0 0 20px rgba(0, 110, 252, 0.16), 0 8px 18px rgba(0, 110, 252, 0.24);
}

@media (min-width: 820px) {
  .app-shell {
    max-width: 430px;
    margin: 0 auto;
    border-left: 1px solid var(--hairline);
    border-right: 1px solid var(--hairline);
  }

  .detail-sheet {
    left: 50%;
    right: auto;
    width: min(406px, calc(100vw - 24px));
    transform: translate(-50%, calc(100% + 130px));
  }

  .detail-sheet.open {
    transform: translate(-50%, 0);
  }
}

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

  .sheet-head {
    grid-template-columns: 72px 1fr auto auto;
  }

  .sheet-head img {
    width: 72px;
    height: 72px;
  }
}
