:root {
  color-scheme: light;
  --app-height: 100dvh;
  --vv-top: 0px;
  --bg: #eef1f3;
  --bg-2: #e4e8eb;
  --surface: #ffffff;
  --surface-2: #f7f8f9;
  --input: #ffffff;
  --border: #cfd6dc;
  --text: #1c1f26;
  --text-2: #2a2f3a;
  --muted: #5f6674;
  --muted-2: #6e7584;
  --accent: #78B038;
  --accent-2: #4F8A1C;
  --accent-text: #3F6B16;
  --on-accent: #102008;
  --overlay: rgba(18, 20, 23, 0.4);
  --shadow: 0 14px 36px rgba(18, 24, 28, 0.1);
  --sidebar-bg: linear-gradient(180deg, #f6f9f2 0%, #eef3e8 100%);
  --sidebar-border: rgba(120, 176, 56, 0.28);
  --chip-bg: rgba(28, 31, 38, 0.04);
  --chip-border: rgba(28, 31, 38, 0.08);
  --map-empty-bg: rgba(247, 249, 248, 0.94);
  --mobile-nav-bg: linear-gradient(180deg, rgba(247, 249, 248, 0.92) 0%, #eef3f0 35%);
  --map-filter: none;
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234F8A1C' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

html.dark {
  color-scheme: dark;
  --bg: #121417;
  --bg-2: #171b20;
  --surface: #1c2228;
  --surface-2: #22282f;
  --input: #15191e;
  --border: #2c343c;
  --text: #f4f4f5;
  --text-2: #e4e4e7;
  --muted: #a1a8b8;
  --muted-2: #8b93a7;
  --accent: #85C43E;
  --accent-2: #5A8A28;
  --accent-text: #A8D96A;
  --on-accent: #102008;
  --overlay: rgba(0, 0, 0, 0.55);
  --shadow: 0 14px 36px rgba(0, 0, 0, 0.45);
  --sidebar-bg: linear-gradient(180deg, #1c2228 0%, #121417 100%);
  --sidebar-border: rgba(120, 176, 56, 0.28);
  --chip-bg: rgba(255, 255, 255, 0.03);
  --chip-border: rgba(255, 255, 255, 0.05);
  --map-empty-bg: rgba(18, 20, 23, 0.82);
  --mobile-nav-bg: linear-gradient(180deg, rgba(18, 20, 23, 0.72) 0%, #121417 35%);
  --map-filter: brightness(0.78) saturate(0.92) contrast(1.05);
  --select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2385C43E' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
}

* {
  box-sizing: border-box;
  -webkit-tap-highlight-color: transparent;
}

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

html,
body {
  margin: 0;
  min-height: 100%;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  overscroll-behavior: none;
}

html:has(.app-body),
body.app-body {
  height: 100%;
  height: 100dvh;
  overflow: hidden;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(480px, 560px) minmax(0, 1fr);
  height: 100%;
  min-height: 0;
  min-height: var(--app-height);
}

.sidebar {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  min-height: 0;
  padding: 1.15rem 1.35rem 2rem;
  padding-top: max(1.15rem, env(safe-area-inset-top));
  padding-bottom: max(2rem, env(safe-area-inset-bottom));
  padding-left: max(1.35rem, env(safe-area-inset-left));
  background: var(--sidebar-bg);
  border-right: 1px solid var(--sidebar-border);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.sidebar-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.brand {
  display: flex;
  gap: 0.75rem;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
}

.brand-logo {
  display: block;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
}

.brand h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1;
}

.header-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.stats-link {
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.35rem 0.45rem;
}

.lang-switch {
  display: inline-flex;
  flex-wrap: wrap;
  max-width: 100%;
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  background: var(--input);
}

.lang-switch button {
  border: 0;
  background: transparent;
  color: var(--text-2);
  padding: 0.35rem 0.42rem;
  font-size: 0.64rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  cursor: pointer;
}

.lang-switch button.active {
  background: var(--accent);
  color: var(--on-accent);
}

.theme-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--input);
  color: var(--text);
  cursor: pointer;
  flex-shrink: 0;
}

.theme-toggle svg {
  width: 14px;
  height: 14px;
}

html.dark .theme-toggle .icon-moon,
html:not(.dark) .theme-toggle .icon-sun {
  display: none;
}

.destination-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.stop-row {
  display: flex;
  align-items: flex-end;
  gap: 0.45rem;
}

.stop-row label {
  flex: 1;
  margin: 0;
}

.remove-dest {
  flex-shrink: 0;
  width: 44px;
  height: 48px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--text-2);
  border-radius: 10px;
  font-size: 1.1rem;
  line-height: 1;
}

.add-dest-btn {
  width: 100%;
}

.check-row {
  flex-direction: row !important;
  align-items: center;
  gap: 0.7rem !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  font-size: 0.95rem !important;
  font-weight: 500 !important;
  color: var(--text-2) !important;
  min-height: 48px;
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  min-width: 22px;
  min-height: 22px;
  margin: 0;
  padding: 0;
  border: 2px solid var(--accent-2);
  border-radius: 6px;
  background-color: var(--input);
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px 12px;
  flex-shrink: 0;
  pointer-events: auto;
  cursor: pointer;
}

.check-row input[type="checkbox"]:checked {
  border-color: var(--accent);
  background-color: var(--accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='none' stroke='%23102008' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M2.2 6.2 4.8 8.8 9.8 3.2'/%3E%3C/svg%3E");
}

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

.check-row.is-disabled,
.check-row:has(input:disabled) {
  opacity: 0.45;
  cursor: not-allowed;
}

.check-row input[type="checkbox"]:disabled {
  cursor: not-allowed;
}

.field-hint {
  margin: -0.35rem 0 0;
  font-size: 0.78rem;
  color: var(--muted-2);
  line-height: 1.35;
}

.budget-field.hidden,
#hotels-block.hidden,
#official-routes-block.hidden,
#trip-summary-block.hidden,
#days-block.hidden {
  display: none !important;
}

.planner-form,
.results {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.planner-form label {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.planner-form input[type="text"],
.planner-form select {
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text);
  border-radius: 10px;
  padding: 0.85rem 0.8rem;
  font-size: 16px;
  font-family: inherit;
  min-height: 48px;
  appearance: none;
  -webkit-appearance: none;
}

.planner-form select {
  background-color: var(--input);
  background-image: var(--select-chevron);
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  padding-right: 2.4rem;
}

.planner-form input[type="text"]:focus,
.planner-form select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.address-wrap {
  position: relative;
}

.address-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 4px);
  z-index: 30;
  margin: 0;
  padding: 0.25rem 0;
  list-style: none;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  max-height: 240px;
  overflow-y: auto;
  box-shadow: var(--shadow);
}

.address-suggest li {
  padding: 0.7rem 0.85rem;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  color: var(--text-2);
  line-height: 1.3;
}

.address-suggest li.active,
.address-suggest li:hover {
  background: color-mix(in srgb, var(--accent) 16%, var(--surface-2));
}

.address-suggest li.muted {
  color: var(--muted-2);
  cursor: default;
}

.address-wrap.is-valid input[type="text"] {
  border-color: var(--accent-2);
}

.primary-btn,
.ghost-btn,
.icon-btn,
.lang-switch button {
  font-family: inherit;
  cursor: pointer;
  touch-action: manipulation;
}

.primary-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.4rem;
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 0.95rem 1rem;
  min-height: 48px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 700;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.primary-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.primary-btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.ghost-btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  border: 1px solid var(--border);
  background: var(--input);
  color: var(--text-2);
  border-radius: 12px;
  padding: 0.85rem 1rem;
  min-height: 48px;
  text-decoration: none;
}

.ghost-btn:hover {
  border-color: var(--accent);
  color: var(--accent-text);
}

.icon-btn {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-2);
  border-radius: 8px;
  width: 44px;
  height: 44px;
}

.results h3 {
  margin: 0 0 0.45rem;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent-text);
}

.route-title {
  margin: 0.4rem 0 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.7rem;
  line-height: 1.05;
}

.route-summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.route-distance {
  margin: 0;
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.95rem;
}

.trip-summary {
  margin: 0;
  color: var(--text-2);
  font-size: 0.95rem;
  line-height: 1.5;
}

.day-cards {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.day-card {
  padding: 0.8rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.day-card header {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  margin-bottom: 0.4rem;
}

.day-card header small {
  color: var(--muted-2);
  font-size: 0.8rem;
}

.day-card p {
  margin: 0 0 0.45rem;
  color: var(--text-2);
  font-size: 0.92rem;
  line-height: 1.45;
}

.day-card ul {
  margin: 0;
  padding-left: 1.15rem;
  color: var(--muted);
  font-size: 0.88rem;
}

.day-card li + li {
  margin-top: 0.2rem;
}

.hotel-link {
  color: var(--accent-text);
  font-weight: 600;
  font-size: 0.88rem;
  margin-top: 0.4rem;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.action-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.55rem;
}

.soft-list,
.card-list,
.history-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
}

.soft-list.bullets li,
.soft-list li {
  padding: 0.45rem 0.55rem;
  background: var(--chip-bg);
  border: 1px solid var(--chip-border);
  border-radius: 10px;
  font-size: 0.9rem;
}

.card-list li {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  padding: 0.7rem;
  border-radius: 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
}

.card-list strong {
  display: block;
  margin-bottom: 0.2rem;
}

.card-meta {
  display: block;
  margin-bottom: 0.25rem;
  color: var(--accent-text);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.official-route {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.route-num {
  flex: 0 0 auto;
  min-width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: var(--on-accent);
  font-weight: 800;
  font-size: 0.95rem;
}

.official-route a {
  color: var(--accent-text);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.map-pane {
  position: relative;
  min-height: 0;
}

.show-map-btn {
  display: none;
}

.mobile-nav {
  display: none;
}

#map {
  width: 100%;
  height: 100%;
  background: var(--bg-2);
}

.leaflet-tile-pane {
  filter: var(--map-filter);
}

.leaflet-container {
  background: var(--bg-2);
  font-family: "IBM Plex Sans", sans-serif;
}

.leaflet-popup-content-wrapper,
.leaflet-popup-tip {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.map-toolbar {
  position: absolute;
  z-index: 500;
  top: max(0.75rem, env(safe-area-inset-top));
  right: max(0.75rem, env(safe-area-inset-right));
  left: max(0.75rem, env(safe-area-inset-left));
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  justify-content: flex-end;
  pointer-events: none;
}

.map-toolbar > * {
  pointer-events: auto;
}

.map-toolbar .ghost-btn {
  width: auto;
  padding: 0.55rem 0.9rem;
  backdrop-filter: blur(8px);
}

.locate-control a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: var(--text);
  background: var(--surface);
  line-height: 1;
}

.locate-control a.is-locating {
  opacity: 0.55;
}

html.dark .locate-control a {
  background: var(--surface-2);
}

.save-status {
  color: var(--muted);
  font-size: 0.8rem;
}

.map-empty {
  position: absolute;
  z-index: 400;
  left: 50%;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  max-width: min(36rem, calc(100% - 1.5rem));
  margin: 0;
  padding: 0.7rem 1rem;
  border-radius: 16px;
  background: var(--map-empty-bg);
  border: 1px solid var(--sidebar-border);
  color: var(--text-2);
  text-align: center;
  font-size: 0.88rem;
}

.map-empty.hidden,
.hidden {
  display: none !important;
}

.pin {
  width: 28px;
  height: 28px;
}

.pin span {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50% 50% 50% 0;
  transform: rotate(-45deg);
  color: #0b0e14;
  font-size: 0.7rem;
  font-weight: 700;
  border: 2px solid #f8fafc;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.pin span b {
  transform: rotate(45deg);
  font-size: 0.62rem;
  letter-spacing: 0.02em;
}

.pin.origin span {
  background: #85C43E;
}

.pin.destination span {
  background: #ef4444;
}

.pin.waypoint span {
  background: #78B038;
}

.pin.attraction span {
  background: #38bdf8;
}

.pin.hotel span {
  background: #c084fc;
}

[hidden] {
  display: none !important;
}

#close-sidebar {
  display: none !important;
}

.drawer {
  display: none !important;
  position: fixed;
  inset: 0;
  z-index: 800;
}

.drawer.is-open {
  display: block !important;
}

.drawer-backdrop {
  position: absolute;
  inset: 0;
  background: var(--overlay);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(420px, 100%);
  height: 100%;
  background: var(--surface);
  border-left: 1px solid var(--sidebar-border);
  padding: 1.2rem;
  padding-top: max(1.2rem, env(safe-area-inset-top));
  padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.drawer-panel h2 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.8rem;
}

.drawer-copy {
  color: var(--muted);
  font-size: 0.9rem;
}

.history-item {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--input);
  color: inherit;
  border-radius: 12px;
  padding: 0.85rem;
  cursor: pointer;
}

.history-item:hover {
  border-color: var(--accent);
}

.history-item small {
  display: block;
  color: var(--muted);
  margin-top: 0.3rem;
}

.history-page-copy {
  margin: 0 0 1rem;
  color: var(--text-2);
  line-height: 1.5;
}

.history-page-empty {
  margin: 0;
  color: var(--muted);
}

.history-page-list {
  display: grid;
  gap: 0.75rem;
}

.history-card {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  justify-content: space-between;
  align-items: flex-start;
  padding: 0.95rem 1rem;
  border: 1px solid var(--border);
  border-radius: 14px;
  background: var(--surface);
}

.history-card strong {
  display: block;
}

.history-card small {
  display: block;
  color: var(--muted);
  margin-top: 0.3rem;
}

.history-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.history-card-actions .ghost-btn,
.history-card-actions .danger-btn {
  width: auto;
  min-width: 8rem;
  min-height: 42px;
  text-decoration: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(1.4rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  z-index: 900;
  background: var(--accent);
  color: var(--on-accent);
  padding: 0.7rem 1rem;
  border-radius: 999px;
  font-weight: 600;
  max-width: calc(100% - 2rem);
}

@media (max-width: 900px) {
  html:has(.app-body),
  body.app-body {
    overflow: hidden;
    height: 100%;
    overscroll-behavior: none;
  }

  .sidebar-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    align-items: center;
    gap: 0.5rem 0.55rem;
  }

  .brand {
    min-width: 0;
    grid-column: 1;
    grid-row: 1;
  }

  .brand h1 {
    line-height: 1.05;
  }

  .brand-wrap {
    display: block;
  }

  .header-actions {
    display: contents;
  }

  .lang-switch {
    grid-column: 2;
    grid-row: 1;
  }

  .sidebar-header .theme-toggle {
    grid-column: 3;
    grid-row: 1;
  }

  .account-menu {
    grid-column: 2 / -1;
    grid-row: 2;
    justify-self: end;
    max-width: 100%;
  }

  .account-menu-btn {
    max-width: 100%;
  }

  .app-shell {
    display: flex;
    flex-direction: column;
    grid-template-columns: none;
    grid-template-rows: none;
    overflow: hidden;
    position: fixed;
    top: var(--vv-top);
    left: 0;
    right: 0;
    height: var(--app-height);
    min-height: 0;
  }

  .sidebar {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 1 1 auto;
    min-height: 0;
    height: auto;
    transform: none;
    z-index: 2;
    border-right: 0;
    padding-bottom: calc(4.75rem + env(safe-area-inset-bottom));
  }

  .mobile-nav {
    display: flex;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 40;
    padding: 0.7rem 1rem;
    padding-bottom: max(0.7rem, env(safe-area-inset-bottom));
    background: var(--mobile-nav-bg);
    border-top: 1px solid var(--sidebar-border);
  }

  html.keyboard-open .mobile-nav {
    display: none;
  }

  html.keyboard-open .sidebar {
    padding-bottom: max(1rem, env(safe-area-inset-bottom));
  }

  .mobile-nav .ghost-btn {
    width: 100%;
  }

  .map-pane {
    display: none;
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
    border-top: 1px solid var(--sidebar-border);
  }

  .app-shell.has-route:not(.map-mode) .map-pane {
    display: none;
  }

  .app-shell.has-route:not(.map-mode) .map-empty {
    display: none;
  }

  .app-shell.has-route:not(.map-mode) #open-sidebar {
    display: none;
  }

  .app-shell.map-mode .sidebar,
  .app-shell.map-mode .mobile-nav {
    display: none;
  }

  .app-shell.map-mode .map-pane {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    width: 100%;
    height: var(--app-height);
    min-height: var(--app-height);
    max-height: none;
  }

  .app-shell.map-mode #map {
    flex: 1 1 auto;
    width: 100%;
    height: auto;
    min-height: 0;
  }

  .show-map-btn {
    display: inline-flex;
  }

  .map-toolbar .ghost-btn {
    min-height: 44px;
    padding: 0.55rem 0.85rem;
  }

  .leaflet-control-zoom {
    margin-bottom: max(12px, env(safe-area-inset-bottom)) !important;
    margin-left: max(12px, env(safe-area-inset-left)) !important;
  }

  .locate-control {
    margin-left: max(12px, env(safe-area-inset-left)) !important;
  }

  .drawer-panel {
    width: 100%;
  }
}

@media (min-width: 901px) {
  .show-map-btn {
    display: none !important;
  }
}

.stats-body {
  margin: 0;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.stats-page {
  max-width: 52rem;
  margin: 0 auto;
  padding: 1.2rem 1rem 2.5rem;
  padding-top: max(1.2rem, env(safe-area-inset-top));
}

.stats-header {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
  flex-wrap: wrap;
}

.stats-kicker {
  margin: 0 0 0.25rem;
  color: var(--accent-2);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 700;
}

.stats-header h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 2rem;
}

.stats-home {
  width: auto;
  min-height: 40px;
  padding: 0.45rem 0.8rem;
  text-decoration: none;
}

.stats-copy,
.stats-error {
  color: var(--muted);
  line-height: 1.45;
}

.stats-error {
  color: #fca5a5;
}

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.7rem;
  margin: 1.2rem 0 1.6rem;
}

.stats-card {
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: 12px;
  padding: 0.85rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.stats-card span {
  color: var(--muted-2);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.stats-card strong {
  font-family: "Outfit", sans-serif;
  font-size: 1.8rem;
}

.stats-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.2rem;
  margin-bottom: 1.6rem;
}

.stats-split h2,
.stats-page h2 {
  margin: 0 0 0.5rem;
  color: var(--accent-text);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stats-split li,
#recent-list li {
  display: flex;
  justify-content: space-between;
  gap: 0.8rem;
  align-items: baseline;
}

#recent-list li {
  flex-direction: column;
}

.stats-split .muted,
#recent-list .muted {
  color: var(--muted-2);
}

@media (max-width: 700px) {
  .stats-split {
    grid-template-columns: 1fr;
  }
}

.account-menu {
  position: relative;
}

.account-menu-btn {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 11rem;
  min-height: 40px;
  padding: 0.35rem 0.7rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
}

.account-menu-btn span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-menu-btn::after {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  flex: 0 0 auto;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg) translateY(-1px);
  opacity: 0.7;
}

.account-menu-list {
  position: fixed;
  z-index: 80;
  min-width: 11.5rem;
  padding: 0.35rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  box-shadow: var(--shadow);
  display: grid;
}

.account-menu-list[hidden] {
  display: none;
}

.account-menu-list a {
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.55rem 0.7rem;
  border-radius: 8px;
}

.account-menu-list a:hover,
.account-menu-list a:focus-visible {
  background: var(--chip-bg);
}

.account-dl {
  display: grid;
  gap: 0.85rem;
  margin: 1.1rem 0 0;
}

.account-dl div {
  display: grid;
  gap: 0.2rem;
}

.account-dl dt {
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.account-dl dd {
  margin: 0;
  color: var(--text-2);
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.account-avatar {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--chip-bg);
}

.account-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.2rem;
}

.account-actions .primary-btn,
.account-actions .ghost-btn {
  width: auto;
  min-width: 10rem;
  text-decoration: none;
}

.account-section {
  margin-top: 1.6rem;
}

.account-section h2 {
  margin: 0 0 0.7rem;
  color: var(--accent-text);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.account-toggle {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
  cursor: pointer;
}

.account-toggle input {
  margin-top: 0.2rem;
  inline-size: 1.05rem;
  block-size: 1.05rem;
  accent-color: var(--accent);
}

.account-toggle span {
  display: grid;
  gap: 0.2rem;
}

.account-toggle strong {
  font-weight: 600;
}

.account-toggle small {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.4;
}

.auth-body {
  min-height: 100dvh;
  height: auto;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: grid;
  place-items: start center;
  padding: 1.2rem;
  padding-top: max(1.2rem, env(safe-area-inset-top));
  padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.auth-card {
  width: min(28rem, 100%);
  margin-block: auto;
  display: grid;
  gap: 0.9rem;
  padding: 1.4rem 1.3rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-header {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.auth-brand {
  flex: 1 1 auto;
  min-width: 0;
}

.auth-header h1 {
  margin: 0;
  font-family: "Outfit", sans-serif;
  font-size: 1.7rem;
}

.auth-header .lang-switch {
  margin-left: auto;
}

.auth-theme-toggle {
  position: fixed;
  top: max(0.85rem, env(safe-area-inset-top));
  right: max(0.85rem, env(safe-area-inset-right));
  z-index: 20;
  width: 36px;
  height: 36px;
  border-radius: 10px;
}

.auth-copy,
.auth-meta {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.auth-meta {
  font-size: 0.82rem;
}

.oauth-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  min-height: 46px;
  padding: 0.6rem 0.9rem;
  border-radius: 12px;
  border: 1px solid var(--border);
  text-decoration: none;
  font-weight: 600;
}

.oauth-google {
  background: #fff;
  color: #1f1f1f;
}

.oauth-github {
  background: #161b22;
  color: #f0f6fc;
}

.mfa-form {
  display: grid;
  gap: 0.75rem;
}

.mfa-form input {
  width: 100%;
  min-height: 46px;
  padding: 0.6rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  letter-spacing: 0.12em;
  font-size: 1.05rem;
}

.qr-box {
  display: grid;
  place-items: center;
  padding: 0.8rem;
  border-radius: 14px;
  background: #fff;
}

.qr-box svg {
  width: 180px;
  height: 180px;
}

.mfa-secret {
  margin: 0;
  text-align: center;
  word-break: break-all;
  color: var(--muted);
}

.backup-codes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.backup-codes code {
  display: block;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  background: var(--input);
  text-align: center;
}

.invite-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.7rem;
  margin: 0;
}

.invite-form input,
.invite-form select {
  flex: 1 1 16rem;
  min-height: 48px;
  padding: 0.55rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}

.invite-lang {
  display: grid;
  gap: 0.3rem;
  flex: 1 1 16rem;
  color: var(--text-2);
  font-size: 0.85rem;
}

.invite-form .primary-btn {
  width: auto;
  min-width: 10rem;
  min-height: 48px;
  flex: 0 0 auto;
}

.invite-status {
  min-height: 0;
  margin: 0.25rem 0 0;
  font-size: 0.78rem;
  color: var(--muted-2);
  line-height: 1.35;
}

.admin-page section + section {
  margin-top: 1.15rem;
}

@media (min-width: 901px) {
  .invite-form {
    width: 100%;
  }

  .invite-form input[type="email"] {
    flex: 1 1 auto;
    width: auto;
    min-width: 14rem;
    max-width: none;
  }

  .invite-lang {
    flex: 0 0 11.5rem;
  }

  .invite-form select {
    flex: none;
    width: 100%;
  }
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.6rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  vertical-align: top;
  padding: 0.65rem 0.5rem;
  border-bottom: 1px solid var(--border);
}

.admin-table small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
}

.danger-btn {
  min-height: 36px;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgba(248, 113, 113, 0.4);
  border-radius: 8px;
  background: transparent;
  color: #fca5a5;
  cursor: pointer;
}

.danger-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.legal-page {
  max-width: 40rem;
}

.legal-page h1 {
  margin-bottom: 0.35rem;
}

.legal-updated {
  color: var(--muted);
  font-size: 0.85rem;
  margin: 0 0 1.2rem;
}

.legal-page h2 {
  margin: 1.4rem 0 0.45rem;
  color: var(--accent-text);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.legal-page p,
.legal-page li {
  color: var(--text-2);
  line-height: 1.55;
}

.legal-page ul {
  padding-left: 1.15rem;
}

.legal-nav {
  margin-top: 2rem;
}

.legal-nav a {
  color: var(--accent-text);
}

.legal-contact {
  position: relative;
  display: grid;
  gap: 0.7rem;
  margin-top: 1.6rem;
  padding-top: 0.2rem;
}

.legal-contact h2 {
  margin-top: 0;
}

.legal-contact label {
  display: grid;
  gap: 0.3rem;
  color: var(--text-2);
  font-size: 0.9rem;
}

.legal-contact input,
.legal-contact select,
.legal-contact textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--input);
  color: var(--text);
  font: inherit;
}

.legal-contact textarea {
  min-height: 8rem;
  resize: vertical;
}

.legal-contact .primary-btn {
  width: auto;
  justify-self: start;
  padding-inline: 1.2rem;
}

.legal-hp {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.legal-contact-status {
  margin: 0;
}

.legal-contact-status[data-state="ok"] {
  color: var(--accent-text);
}

.legal-contact-status[data-state="err"] {
  color: #fca5a5;
}

.home-body {
  min-height: 100dvh;
  height: auto;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 1.2rem;
  padding-top: max(1.2rem, env(safe-area-inset-top));
  padding-bottom: max(1.2rem, env(safe-area-inset-bottom));
  background: var(--bg);
  color: var(--text);
  font-family: "IBM Plex Sans", system-ui, sans-serif;
}

.home-card {
  width: min(40rem, 100%);
  display: grid;
  gap: 0.95rem;
  margin-block: auto;
  padding: 1.5rem 1.4rem 1.6rem;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.home-kicker {
  margin: 0 0 0.15rem;
  color: var(--accent-text);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.home-lead,
.home-card p,
.home-features li {
  margin: 0;
  color: var(--text-2);
  line-height: 1.55;
}

.home-features {
  margin: 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.4rem;
}

.home-invite {
  color: var(--muted);
}

.home-actions {
  display: flex;
  gap: 0.65rem;
}

.home-actions .primary-btn {
  text-decoration: none;
}

@media (max-width: 720px) {
  .home-actions {
    position: sticky;
    bottom: -1px;
    z-index: 5;
    margin: 0 -0.2rem;
    padding: 0.7rem 0.2rem 0.15rem;
    background: linear-gradient(180deg, transparent, var(--surface) 42%);
  }
}

.home-legal {
  margin-top: 0.35rem;
}

.bike-type-picker {
  border: 0;
  margin: 0;
  padding: 0;
  min-width: 0;
}

.bike-type-picker legend {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.45rem;
}

.bike-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.5rem;
}

.bike-type-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.7rem 0.4rem 0.65rem;
  border: 1px solid var(--chip-border);
  border-radius: 12px;
  background: var(--chip-bg);
  cursor: pointer;
  color: var(--text-2);
  font-size: 0.78rem;
  font-weight: 600;
}

.bike-type-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.bike-type-card svg {
  width: 28px;
  height: 28px;
  color: var(--accent-2);
}

.bike-type-card:has(input:checked) {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--surface));
  color: var(--text);
}

.bike-type-card:has(input:checked) svg {
  color: var(--accent);
}

.bike-type-card span {
  text-align: center;
  line-height: 1.2;
}
