:root {
  --paper: #fbf8f1;
  --paper-strong: #fffdf8;
  --ink: #172522;
  --ink-soft: #4f5e58;
  --muted: #7b8881;
  --line: rgba(23, 37, 34, 0.12);
  --line-strong: rgba(23, 37, 34, 0.2);
  --accent: #0b6b5e;
  --accent-strong: #075247;
  --accent-soft: #dcefe8;
  --accent-wash: rgba(220, 239, 232, 0.7);
  --sand: #eadfc8;
  --danger: #a43b31;
  --danger-soft: #f7e7e2;
  --shadow-sm: 0 2px 8px rgba(20, 32, 28, 0.08);
  --shadow-md: 0 12px 38px rgba(20, 32, 28, 0.15), 0 2px 8px rgba(20, 32, 28, 0.08);
  --shadow-lg: 0 28px 80px rgba(15, 30, 25, 0.24), 0 6px 20px rgba(15, 30, 25, 0.1);
  --radius-xl: 26px;
  --radius-lg: 19px;
  --radius-md: 13px;
  --font: "Avenir Next", "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", ui-sans-serif, system-ui, sans-serif;
  --mono: "SFMono-Regular", "Cascadia Code", "Roboto Mono", ui-monospace, monospace;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  overflow: hidden;
  color: var(--ink);
  background: #dfe7e1;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

button,
input,
select {
  font: inherit;
  color: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

a {
  color: var(--accent-strong);
  text-underline-offset: 2px;
}

[hidden] {
  display: none !important;
}

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

.icon-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

svg {
  display: block;
}

.skip-link {
  position: fixed;
  z-index: 200;
  top: 10px;
  left: 16px;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: 10px;
  color: white;
  background: var(--accent-strong);
  box-shadow: var(--shadow-md);
  transition: transform 160ms ease;
}

.skip-link:focus {
  transform: translateY(0);
}

#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(circle at 50% 45%, #dfeae3 0, #c9d9d1 48%, #b9c8c0 100%);
}

#map:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.maplibregl-map {
  font-family: var(--font);
}

.maplibregl-canvas:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.maplibregl-ctrl-bottom-right {
  z-index: 14;
  right: max(6px, env(safe-area-inset-right));
  bottom: max(2px, env(safe-area-inset-bottom));
}

.maplibregl-ctrl-attrib {
  border-radius: 8px 0 0 0;
  background: rgba(251, 248, 241, 0.9) !important;
  box-shadow: none !important;
  color: #49544e;
  font-size: 10px;
  line-height: 1.35;
  backdrop-filter: blur(8px);
}

.maplibregl-ctrl-attrib a {
  color: #3c5048 !important;
}

.maplibregl-ctrl-attrib.maplibregl-compact {
  min-height: 24px;
}

.maplibregl-ctrl-attrib-button {
  background-color: rgba(251, 248, 241, 0.94) !important;
}

.maplibregl-ctrl-scale {
  border-color: var(--ink);
  border-top: 0;
  color: var(--ink);
  background: rgba(251, 248, 241, 0.82);
  font-family: var(--mono);
  font-size: 10px;
}

.maplibregl-user-location-dot,
.maplibregl-user-location-accuracy-circle {
  display: none;
}

/* UI shell */

.ui-shell {
  position: absolute;
  inset: 0;
  z-index: 10;
  pointer-events: none;
}

.left-ui {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  left: max(18px, env(safe-area-inset-left));
  width: min(424px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px - env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  z-index: 20;
}

.search-card,
.info-panel,
.popover,
.drawer,
.about-card {
  pointer-events: auto;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: rgba(251, 248, 241, 0.94);
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(18px) saturate(1.05);
  -webkit-backdrop-filter: blur(18px) saturate(1.05);
}

.search-card {
  flex: 0 0 auto;
  overflow: visible;
  padding: 16px 16px 11px;
  border-radius: var(--radius-xl);
  border-color: rgba(255, 253, 247, 0.8);
}

.brand-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  color: var(--accent);
  background:
    linear-gradient(145deg, rgba(220, 239, 232, 0.96), rgba(247, 250, 242, 0.82));
  border: 1px solid rgba(11, 107, 94, 0.2);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.brand-mark svg {
  width: 29px;
  height: 29px;
}

.brand-copy {
  min-width: 0;
}

.brand-line {
  display: flex;
  align-items: baseline;
  gap: 7px;
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 750;
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.brand-copy p {
  margin: 3px 0 0;
  max-width: 190px;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 540;
  letter-spacing: 0.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.version-tag {
  display: inline-flex;
  align-items: center;
  padding: 2px 5px;
  border: 1px solid rgba(11, 107, 94, 0.18);
  border-radius: 6px;
  color: var(--accent-strong);
  background: var(--accent-soft);
  font-family: var(--mono);
  font-size: 8px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 3px;
  flex: 0 0 auto;
}

.icon-button,
.map-tool-button,
.mini-icon-button,
.field-button {
  display: inline-grid;
  place-items: center;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  border-radius: 10px;
  transition: background 140ms ease, color 140ms ease, transform 140ms ease;
}

.icon-button {
  width: 31px;
  height: 31px;
}

.icon-button svg {
  width: 19px;
  height: 19px;
}

.icon-button:hover,
.mini-icon-button:hover {
  color: var(--ink);
  background: rgba(11, 107, 94, 0.09);
}

.icon-button:focus-visible,
.map-tool-button:focus-visible,
.mini-icon-button:focus-visible,
.field-button:focus-visible,
.primary-button:focus-visible,
.secondary-button:focus-visible,
.text-button:focus-visible,
.mode-button:focus-visible,
.quick-chip:focus-visible,
.suggest-item:focus-visible,
.attribution-list a:focus-visible,
.source-link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.icon-button.compact {
  width: 28px;
  height: 28px;
  border-radius: 8px;
}

.icon-button.compact svg {
  width: 16px;
  height: 16px;
}

.language-wrap {
  position: relative;
  display: flex;
  align-items: center;
  gap: 1px;
  height: 31px;
  padding: 0 2px 0 3px;
  border-radius: 9px;
  color: var(--ink-soft);
}

.language-wrap:hover {
  background: rgba(11, 107, 94, 0.06);
}

.language-wrap svg {
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  pointer-events: none;
}

#lang-select,
#about-lang-select {
  max-width: 74px;
  height: 28px;
  padding: 0 2px;
  border: 0;
  border-radius: 6px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

#lang-select:focus-visible,
#about-lang-select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Search */


.search-meta a {
  color: var(--muted);
  text-decoration: none;
}

.search-meta a:hover {
  color: var(--accent-strong);
  text-decoration: underline;
}

.search-form {
  position: relative;
  margin-top: 14px;
}

.search-field {
  display: flex;
  align-items: center;
  gap: 7px;
  height: 49px;
  padding: 0 7px 0 13px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper-strong);
  box-shadow: 0 1px 0 rgba(20, 32, 28, 0.03), inset 0 0 0 1px rgba(255, 255, 255, 0.5);
  transition: border-color 140ms ease, box-shadow 140ms ease;
}

.search-field:focus-within {
  border-color: rgba(11, 107, 94, 0.62);
  box-shadow: 0 0 0 3px rgba(11, 107, 94, 0.12);
}

.search-icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  color: var(--accent-strong);
}

#search-input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 1px 0;
  color: var(--ink);
  background: transparent;
  font-size: 15px;
  font-weight: 480;
  letter-spacing: -0.01em;
}

#search-input::placeholder {
  color: #87928c;
  opacity: 1;
}

input[type="search"]::-webkit-search-cancel-button {
  display: none;
}

.field-button {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  border-radius: 9px;
}

.field-button svg {
  width: 17px;
  height: 17px;
}

.clear-button {
  color: var(--muted);
}

.clear-button:hover {
  color: var(--ink);
  background: rgba(23, 37, 34, 0.06);
}

.submit-button {
  color: white;
  background: var(--accent);
  border-radius: 11px;
}

.submit-button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.submit-button svg {
  width: 18px;
  height: 18px;
}

.suggest-list {
  z-index: 60;
  margin: 0;
  padding: 5px;
  list-style: none;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--paper-strong);
  box-shadow: 0 18px 40px rgba(20, 32, 28, 0.18);
  overflow: auto;
}

.main-suggest {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  right: 0;
  max-height: min(46vh, 390px);
}

.suggest-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  width: 100%;
  padding: 10px 10px;
  border: 0;
  border-radius: 10px;
  color: var(--ink);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.suggest-item + .suggest-item {
  border-top: 1px solid rgba(23, 37, 34, 0.055);
}

.suggest-item:hover,
.suggest-item.is-active,
.suggest-item[aria-selected="true"] {
  background: var(--accent-soft);
}

.suggest-marker {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(11, 107, 94, 0.09);
}

.suggest-marker svg {
  width: 15px;
  height: 15px;
}

.suggest-copy {
  min-width: 0;
  flex: 1;
}

.suggest-name {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 650;
  line-height: 1.25;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.suggest-meta {
  display: flex;
  gap: 6px;
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.suggest-address {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.suggest-distance {
  flex: 0 0 auto;
  color: var(--ink-soft);
}

.suggest-message {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 10px;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.4;
}

.suggest-message.is-error {
  color: var(--danger);
}

.suggest-footer {
  position: sticky;
  bottom: -5px;
  display: block;
  padding: 7px 10px 5px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.2), var(--paper-strong) 48%);
  font-size: 9.5px;
}

.search-live {
  min-height: 0;
}

.empty-state {
  color: var(--ink-soft);
}

.quick-row {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 11px;
  min-height: 25px;
}

.quick-label {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.quick-list {
  display: flex;
  gap: 6px;
  min-width: 0;
  overflow: auto;
  scrollbar-width: none;
}

.quick-list::-webkit-scrollbar {
  display: none;
}

.quick-chip {
  flex: 0 0 auto;
  height: 25px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.65);
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
  transition: border-color 140ms ease, color 140ms ease, background 140ms ease;
}

.quick-chip:hover {
  border-color: rgba(11, 107, 94, 0.35);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.search-meta {
  display: flex;
  align-items: center;
  gap: 5px;
  margin: 8px 1px 0;
  color: var(--muted);
  font-size: 9.5px;
  letter-spacing: 0.01em;
}

.open-data-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #389d73;
  box-shadow: 0 0 0 2px rgba(56, 157, 115, 0.13);
}

/* Panels */

.info-panel {
  position: relative;
  flex: 0 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 17px;
  border-radius: var(--radius-xl);
  animation: panel-in 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
  pointer-events: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(23, 37, 34, 0.24) transparent;
}

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

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

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 720;
  letter-spacing: -0.025em;
}

.eyebrow {
  margin: 0;
  color: var(--accent-strong);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.place-title {
  margin: 6px 0 4px;
  font-size: 24px;
  font-weight: 740;
  line-height: 1.13;
  letter-spacing: -0.045em;
  overflow-wrap: anywhere;
}

.place-address {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.place-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px 12px;
  margin-top: 9px;
}

.coords {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: -0.02em;
}

.text-button {
  padding: 2px 0;
  border: 0;
  color: var(--accent-strong);
  background: transparent;
  font-size: 10.5px;
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.place-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 39px;
  padding: 0 14px;
  border-radius: 11px;
  font-size: 12.5px;
  font-weight: 650;
  transition: background 140ms ease, border-color 140ms ease, transform 140ms ease;
}

.primary-button {
  border: 1px solid var(--accent);
  color: white;
  background: var(--accent);
}

.primary-button:hover {
  background: var(--accent-strong);
  border-color: var(--accent-strong);
  transform: translateY(-1px);
}

.primary-button svg,
.secondary-button svg {
  width: 17px;
  height: 17px;
}

.secondary-button {
  border: 1px solid var(--line-strong);
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.55);
}

.secondary-button:hover,
.secondary-button[aria-pressed="true"] {
  border-color: rgba(11, 107, 94, 0.35);
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.place-actions .primary-button {
  flex: 1.2;
}

.place-actions .secondary-button {
  flex: 1;
}

.source-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.source-label {
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.35;
}

.source-link {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  color: var(--accent-strong);
  font-size: 9.5px;
  font-weight: 650;
  text-decoration: none;
}

.source-link:hover {
  text-decoration: underline;
}

.source-link svg {
  width: 11px;
  height: 11px;
}

/* Route planner */

.mode-switch {
  display: flex;
  gap: 3px;
  padding: 3px;
  margin-top: 13px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(232, 229, 218, 0.45);
}

.mode-button {
  flex: 1;
  height: 31px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  color: var(--ink-soft);
  background: transparent;
  font-size: 11.5px;
  font-weight: 650;
  transition: background 140ms ease, color 140ms ease, box-shadow 140ms ease;
}

.mode-button:hover {
  color: var(--ink);
}

.mode-button.is-active,
.mode-button[aria-pressed="true"] {
  color: var(--accent-strong);
  background: var(--paper-strong);
  box-shadow: var(--shadow-sm);
}

.route-form {
  margin-top: 12px;
}

.route-fields {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--paper-strong);
  overflow: visible;
}

.route-field-row {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 45px;
  padding: 5px 6px 5px 10px;
}

.route-field-row + .route-field-row {
  border-top: 1px solid var(--line);
}

.route-node {
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  display: inline-grid;
  place-items: center;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  color: var(--accent-strong);
  font-family: var(--mono);
  font-size: 8px;
  font-weight: 700;
  line-height: 1;
}

.node-b {
  border-radius: 5px;
  color: white;
  background: var(--accent);
  border-color: var(--accent);
}

.route-input-wrap {
  position: relative;
  min-width: 0;
  flex: 1;
}

.route-input {
  width: 100%;
  height: 33px;
  padding: 0;
  border: 0;
  outline: 0;
  color: var(--ink);
  background: transparent;
  font-size: 12.5px;
}

.route-input::placeholder {
  color: #89938d;
  opacity: 1;
}

.mini-icon-button {
  width: 29px;
  height: 29px;
  flex: 0 0 29px;
  border-radius: 8px;
}

.mini-icon-button svg {
  width: 16px;
  height: 16px;
}

.route-suggest {
  position: absolute;
  z-index: 70;
  top: calc(100% + 8px);
  left: -31px;
  right: -34px;
  max-height: 230px;
}

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

.route-form-actions #swap-route {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: rgba(255, 253, 248, 0.6);
}

.go-button {
  flex: 1;
}

.route-status {
  margin: 11px 1px 0;
  color: var(--ink-soft);
  font-size: 11.5px;
}

.route-status.is-error {
  color: var(--danger);
}

.route-result {
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.route-summary {
  margin: 0;
  font-size: 15px;
  font-weight: 720;
  letter-spacing: -0.02em;
}

.route-note {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.45;
}

.steps-title {
  margin: 14px 0 7px;
  color: var(--ink-soft);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.route-steps {
  max-height: 250px;
  overflow: auto;
  margin: 0;
  padding: 0;
  list-style: none;
  scrollbar-width: thin;
}

.route-step {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px;
  padding: 8px 1px;
}

.route-step + .route-step {
  border-top: 1px solid rgba(23, 37, 34, 0.07);
}

.step-icon {
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: rgba(255, 253, 248, 0.72);
}

.step-icon svg {
  width: 16px;
  height: 16px;
}

.step-copy {
  min-width: 0;
  padding-top: 3px;
  font-size: 11.5px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.step-meta {
  padding-top: 4px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 9px;
  white-space: nowrap;
}

.steps-note {
  margin: 10px 1px 0;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

.route-attribution {
  margin: 10px 1px 0;
  color: var(--muted);
  font-size: 9px;
}

/* Map controls */

.map-tools {
  position: absolute;
  top: 50%;
  right: max(18px, env(safe-area-inset-right));
  z-index: 18;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 5px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 15px;
  background: rgba(251, 248, 241, 0.9);
  box-shadow: var(--shadow-md);
  backdrop-filter: blur(16px);
  transform: translateY(-50%);
  pointer-events: auto;
}

.map-tool-button {
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.map-tool-button svg {
  width: 19px;
  height: 19px;
}

.map-tool-button:hover {
  color: var(--accent-strong);
  background: var(--accent-soft);
}

.map-tool-button.is-active {
  color: white;
  background: var(--accent);
}

.tool-divider {
  display: block;
  width: 21px;
  height: 1px;
  margin: 1px 0;
  background: var(--line);
}

/* Layers */

.popover {
  position: absolute;
  z-index: 30;
  top: 92px;
  right: max(70px, calc(env(safe-area-inset-right) + 70px));
  width: min(324px, calc(100vw - 28px));
  overflow: hidden;
  padding: 16px;
  border-radius: 20px;
  animation: panel-in 170ms ease;
}

.popover-heading,
.dialog-heading,
.drawer-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.layer-list {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 12px;
}

.layer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 2px;
  cursor: pointer;
}

.layer-row + .layer-row {
  border-top: 1px solid rgba(23, 37, 34, 0.07);
}

.layer-row span {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.layer-row strong {
  font-size: 12.5px;
  font-weight: 650;
}

.layer-row small {
  color: var(--muted);
  font-size: 9.5px;
}

.layer-row input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 34px;
  height: 20px;
  flex: 0 0 34px;
  margin: 0;
  border: 1px solid rgba(23, 37, 34, 0.14);
  border-radius: 99px;
  background: #d7dbd4;
  cursor: pointer;
  transition: background 140ms ease;
  position: relative;
}

.layer-row input[type="checkbox"]::after {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: white;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.18);
  transition: transform 140ms ease;
}

.layer-row input[type="checkbox"]:checked {
  border-color: var(--accent);
  background: var(--accent);
}

.layer-row input[type="checkbox"]:checked::after {
  transform: translateX(14px);
}

.layer-row input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.popover-note {
  margin: 9px 1px 1px;
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.45;
}

/* Account drawer */

.account-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.account-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  margin-top: 14px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(11, 107, 94, 0.07);
}

.account-tab {
  min-height: 36px;
  border: 0;
  border-radius: 9px;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-size: 12.5px;
  font-weight: 650;
  cursor: pointer;
}

.account-tab[aria-selected="true"] {
  color: var(--accent-strong);
  background: var(--surface);
  box-shadow: 0 1px 5px rgba(23, 50, 36, 0.1);
}

.account-tab:focus-visible,
.account-form input:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.account-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 12px;
}

.account-form label {
  margin-top: 5px;
  color: var(--ink-soft);
  font-size: 12px;
  font-weight: 650;
}

.account-form input {
  width: 100%;
  min-height: 39px;
  padding: 8px 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 253, 248, 0.72);
  font: inherit;
  font-size: 14px;
}

.account-form .primary-button,
.account-logout {
  width: 100%;
  margin-top: 9px;
}

.account-note {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.form-error {
  margin: 8px 0 0;
  padding: 8px 10px;
  border: 1px solid rgba(138, 28, 28, 0.3);
  border-radius: 9px;
  color: #8a1c1c;
  background: rgba(253, 236, 236, 0.8);
  font-size: 12px;
}

.account-status {
  margin: 15px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.account-username-line {
  margin: 4px 0 0;
  font-size: 18px;
  color: var(--ink);
  overflow-wrap: anywhere;
}

/* Saved drawer */

.drawer {
  position: absolute;
  top: max(18px, env(safe-area-inset-top));
  right: max(18px, env(safe-area-inset-right));
  z-index: 35;
  width: min(378px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 18px;
  border-radius: var(--radius-xl);
  animation: panel-in 180ms ease;
  pointer-events: auto;
  scrollbar-width: thin;
}

.drawer-heading {
  margin-bottom: 12px;
}

.saved-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.saved-item {
  display: flex;
  align-items: stretch;
  gap: 5px;
  border-top: 1px solid rgba(23, 37, 34, 0.07);
  padding-top: 5px;
}

.saved-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.saved-open {
  flex: 1;
  min-width: 0;
  padding: 8px 9px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  text-align: left;
  transition: background 140ms ease;
}

.saved-open:hover {
  background: var(--accent-soft);
}

.saved-name {
  display: block;
  overflow: hidden;
  font-size: 12.5px;
  font-weight: 650;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.saved-address {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  color: var(--muted);
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.saved-remove {
  align-self: center;
  color: var(--muted);
}

.saved-remove:hover {
  color: var(--danger);
  background: var(--danger-soft);
}

.storage-note {
  margin: 14px 1px 0;
  padding-top: 11px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 9.5px;
  line-height: 1.5;
}

/* About dialog */

.about-overlay {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 14px;
  background: rgba(17, 30, 26, 0.38);
  backdrop-filter: blur(3px);
}

.about-dialog {
  width: min(720px, calc(100vw - 28px));
  max-height: calc(100dvh - 28px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}

.about-card {
  max-height: calc(100dvh - 28px);
  overflow: auto;
  padding: 24px;
  border-radius: 23px;
  background: var(--paper);
  box-shadow: var(--shadow-lg);
  scrollbar-width: thin;
}

.about-card h2 {
  margin: 0;
  font-size: 26px;
  font-weight: 750;
  letter-spacing: -0.045em;
}

.about-card h3 {
  margin: 22px 0 7px;
  font-size: 12px;
  font-weight: 750;
  letter-spacing: 0.02em;
}

.about-card p {
  max-width: 65ch;
  margin: 8px 0;
  color: var(--ink-soft);
  font-size: 12.5px;
  line-height: 1.65;
}

.version-line {
  margin-top: 6px !important;
  color: var(--muted) !important;
  font-family: var(--mono);
  font-size: 10px !important;
}

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

.attribution-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  border-bottom: 1px solid rgba(23, 37, 34, 0.06);
  color: var(--ink-soft);
  font-size: 11px;
}

.attribution-list li:last-child {
  border-bottom: 0;
}

.attribution-list a {
  flex: 0 0 auto;
  color: var(--accent-strong);
  font-size: 10px;
  text-decoration: none;
}

.attribution-list a:hover {
  text-decoration: underline;
}

.fine-print {
  color: var(--muted) !important;
  font-size: 10px !important;
}

.limits-list {
  margin: 0;
  padding-left: 18px;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.6;
}

.limits-list li + li {
  margin-top: 4px;
}

.shortcut-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px 20px;
  margin: 0;
}

.shortcut-list div {
  display: flex;
  align-items: center;
  gap: 6px;
}

.shortcut-list dt {
  min-width: 30px;
  padding: 2px 5px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  color: var(--ink-soft);
  background: rgba(255, 253, 248, 0.75);
  font-family: var(--mono);
  font-size: 9px;
  text-align: center;
}

.shortcut-list dd {
  margin: 0;
  color: var(--muted);
  font-size: 10px;
}

/* Boot, toast, noscript */

.boot {
  position: absolute;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(232, 238, 232, 0.9);
  backdrop-filter: blur(9px);
  transition: opacity 220ms ease;
}

.boot.is-hiding {
  opacity: 0;
  pointer-events: none;
}

.boot-card {
  display: flex;
  align-items: center;
  gap: 13px;
  max-width: 460px;
  padding: 17px 19px;
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 19px;
  background: rgba(251, 248, 241, 0.97);
  box-shadow: var(--shadow-lg);
}

.boot-card strong {
  font-size: 16px;
  font-weight: 750;
  letter-spacing: -0.03em;
}

.boot-card p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11.5px;
  line-height: 1.4;
}

.boot-mark {
  width: 39px;
  height: 39px;
  display: grid;
  place-items: center;
  flex: 0 0 39px;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 12px;
}

.boot-mark svg {
  width: 30px;
  height: 30px;
}

.boot-card .secondary-button {
  margin-left: 8px;
}

.boot.is-error .boot-mark {
  animation: none;
  color: var(--danger);
  background: var(--danger-soft);
}

.boot.is-loading .boot-mark {
  animation: boot-pulse 1.6s ease-in-out infinite;
}

@keyframes boot-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(0.93); opacity: 0.66; }
}

.toast {
  position: fixed;
  z-index: 120;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  max-width: min(520px, calc(100vw - 28px));
  padding: 10px 15px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  color: #fbf8f1;
  background: rgba(23, 37, 34, 0.94);
  box-shadow: var(--shadow-md);
  font-size: 11.5px;
  font-weight: 540;
  line-height: 1.4;
  text-align: center;
  transform: translate(-50%, 8px);
  opacity: 0;
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.toast.is-error {
  background: rgba(117, 42, 34, 0.96);
}

.noscript {
  position: fixed;
  z-index: 150;
  left: 50%;
  top: 20px;
  transform: translateX(-50%);
  margin: 0;
  padding: 12px 16px;
  border-radius: 10px;
  color: var(--danger);
  background: var(--paper);
  box-shadow: var(--shadow-md);
}

/* Responsive */

@media (max-width: 760px) {
  .left-ui {
    top: max(9px, env(safe-area-inset-top));
    left: 9px;
    right: 9px;
    width: auto;
    max-height: none;
  }

  .search-card {
    padding: 11px 12px 9px;
    border-radius: 19px;
  }

  .brand-row {
    align-items: center;
  }

  .brand-mark {
    width: 33px;
    height: 33px;
    flex-basis: 33px;
    border-radius: 11px;
  }

  .brand-mark svg {
    width: 25px;
    height: 25px;
  }

  .brand-copy h1 {
    font-size: 16px;
  }

  .brand-copy p {
    display: none;
  }

  .top-actions {
    gap: 1px;
  }

  .icon-button {
    width: 28px;
    height: 29px;
  }

  .icon-button svg {
    width: 17px;
    height: 17px;
  }

  .language-wrap {
    height: 29px;
    padding-left: 1px;
  }

  .language-wrap svg {
    display: block;
  }

  #lang-select {
    width: auto;
    max-width: 64px;
    padding: 0 1px;
    font-size: 10px;
  }

  .search-form {
    margin-top: 10px;
  }

  .search-field {
    height: 43px;
    border-radius: 13px;
    padding-left: 10px;
  }

  #search-input {
    font-size: 14px;
  }

  .submit-button {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
    border-radius: 9px;
  }

  .main-suggest {
    max-height: min(49vh, 330px);
  }

  .quick-row {
    margin-top: 8px;
    min-height: 23px;
  }

  .quick-label {
    display: none;
  }

  .quick-chip {
    height: 23px;
    font-size: 10px;
  }

  .search-meta {
    display: flex;
    margin-top: 6px;
    font-size: 9px;
  }

  .info-panel {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    z-index: 26;
    max-height: 56dvh;
    padding: 15px;
    border-radius: 21px;
  }

  .drawer {
    top: auto;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 70dvh;
    border-radius: 21px;
  }

  .popover {
    top: auto;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: calc(100vw - 16px);
    border-radius: 21px;
  }

  .map-tools {
    top: 46%;
    right: 9px;
    transform: translateY(-50%);
  }

  .map-tool-button {
    width: 34px;
    height: 34px;
  }

  .place-title {
    font-size: 21px;
  }

  .route-steps {
    max-height: 30dvh;
  }

  .about-dialog {
    width: 100%;
    max-height: calc(100dvh - 28px);
  }

  .about-card {
    max-height: calc(100dvh - 28px);
    padding: 18px;
    border-radius: 19px;
  }

  .about-card h2 {
    font-size: 23px;
  }

  .toast {
    bottom: max(14px, env(safe-area-inset-bottom));
  }

  .boot-card {
    align-items: flex-start;
    padding: 15px;
  }

  .boot-card .secondary-button {
    margin-left: 3px;
    padding: 0 10px;
  }
}

@media (max-width: 380px) {
  .brand-copy h1 {
    font-size: 15px;
  }

  .icon-button {
    width: 26px;
  }

  .search-card {
    padding-left: 10px;
    padding-right: 10px;
  }

  .place-actions .primary-button,
  .place-actions .secondary-button {
    padding: 0 10px;
  }
}

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


/* Map markers created in JS */

.om-selected-marker {
  position: relative;
  width: 34px;
  height: 42px;
  pointer-events: none;
  filter: drop-shadow(0 5px 9px rgba(20, 32, 28, 0.3));
}

.om-selected-marker::before {
  content: "";
  position: absolute;
  left: 4px;
  top: 1px;
  width: 25px;
  height: 25px;
  border: 3px solid #fffdf8;
  border-radius: 50% 50% 50% 0;
  background: var(--accent);
  transform: rotate(-45deg);
}

.om-selected-dot {
  position: absolute;
  left: 12.5px;
  top: 9px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
}

.om-route-marker {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(20, 32, 28, 0.28);
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 750;
  line-height: 1;
  pointer-events: none;
}

.om-node-a {
  border: 2px solid var(--accent);
  color: var(--accent-strong);
  background: #fffdf8;
}

.om-node-b {
  border: 2px solid #fffdf8;
  color: white;
  background: var(--accent);
}

.om-location-marker {
  width: 19px;
  height: 19px;
  border: 3px solid #fffdf8;
  border-radius: 50%;
  background: #2c7be5;
  box-shadow: 0 0 0 6px rgba(44, 123, 229, 0.18), 0 3px 9px rgba(20, 32, 28, 0.25);
  pointer-events: none;
}
