:root {
  color-scheme: light dark;
  --ink: #050505;
  --muted: rgba(5, 5, 5, 0.58);
  --line: rgba(5, 5, 5, 0.1);
  --panel: #f8f8f6;
  --paper: #e8e8e6;
  --card: #ffffff;
  --field: #f4f4f2;
  --soft: #ececea;
  --dry: #38d66b;
  --maybe: #38d66b;
  --wet: #164bff;
  --hot: #ff2f2f;
  --warm: #ff9d00;
  --road: #050505;
  --shadow: rgba(0, 0, 0, 0.08);
  --radius-panel: 18px;
  --radius-card: 16px;
  --radius-float: 14px;
  --radius-control: 11px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #e6e6e3;
    --muted: rgba(230, 230, 227, 0.58);
    --line: rgba(255, 255, 255, 0.12);
    --panel: #111111;
    --paper: #050505;
    --card: #181818;
    --field: #222222;
    --soft: #2a2a2a;
    --road: #e6e6e3;
    --shadow: rgba(0, 0, 0, 0.34);
  }

  :root:not([data-theme]) .route-toggle input:checked + span {
    color: #050505;
  }

  :root:not([data-theme]) button:not(.theme-toggle) {
    color: #050505;
    background: #e6e6e3;
  }
}

:root[data-theme="light"] {
  --ink: #050505;
  --muted: rgba(5, 5, 5, 0.58);
  --line: rgba(5, 5, 5, 0.1);
  --panel: #f8f8f6;
  --paper: #e8e8e6;
  --card: #ffffff;
  --field: #f4f4f2;
  --soft: #ececea;
  --road: #050505;
  --shadow: rgba(0, 0, 0, 0.08);
}

:root[data-theme="dark"] {
  --ink: #e6e6e3;
  --muted: rgba(230, 230, 227, 0.58);
  --line: rgba(255, 255, 255, 0.12);
  --panel: #111111;
  --paper: #050505;
  --card: #181818;
  --field: #222222;
  --soft: #2a2a2a;
  --road: #e6e6e3;
  --shadow: rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background: var(--paper);
}

button,
input {
  font: inherit;
}

.ride-app {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  padding: 24px;
}

.control-panel {
  position: relative;
  z-index: 500;
  width: min(440px, calc(100vw - 48px));
  min-height: calc(100vh - 48px);
  max-height: calc(100vh - 48px);
  display: flex;
  flex-direction: column;
  padding: 24px;
  overflow-y: auto;
  background: color-mix(in srgb, var(--panel) 88%, transparent);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow:
    0 18px 42px rgba(0, 0, 0, 0.1),
    0 2px 10px rgba(0, 0, 0, 0.05),
    inset 0 1px 0 rgba(255, 255, 255, 0.52);
  backdrop-filter: blur(18px) saturate(1.2);
  -webkit-backdrop-filter: blur(18px) saturate(1.2);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .control-panel {
    box-shadow:
      0 24px 70px rgba(0, 0, 0, 0.38),
      inset 0 1px 0 rgba(255, 255, 255, 0.08);
  }
}

:root[data-theme="dark"] .control-panel {
  box-shadow:
    0 24px 70px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.logo-mark {
  width: 86px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: auto auto 0;
  padding: 0;
  border-radius: var(--radius-control);
  background: transparent;
  overflow: hidden;
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: invert(1);
}

.top-logo {
  width: min(292px, 100%);
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 8px;
  pointer-events: none;
}

.top-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 6px 18px rgba(255, 255, 255, 0.42));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .logo-mark img {
    filter: none;
  }

  :root:not([data-theme]) .top-logo img,
  :root:not([data-theme]) .mobile-map-brand-copy img {
    filter: invert(1) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.38));
  }
}

:root[data-theme="dark"] .logo-mark img {
  filter: none;
}

:root[data-theme="dark"] .top-logo img,
:root[data-theme="dark"] .mobile-map-brand-copy img {
  filter: invert(1) drop-shadow(0 8px 20px rgba(0, 0, 0, 0.38));
}

:root[data-theme="light"] .logo-mark img {
  filter: invert(1);
}

:root[data-theme="light"] .top-logo img,
:root[data-theme="light"] .mobile-map-brand-copy img {
  filter: drop-shadow(0 6px 18px rgba(255, 255, 255, 0.42));
}

.brand-row,
.section-title,
.map-legend,
.form-grid,
.route-choice {
  display: flex;
  align-items: center;
}

.brand-row,
.section-title {
  justify-content: space-between;
  gap: 14px;
}

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

.brand-controls {
  flex: 0 0 auto;
  align-self: flex-start;
  display: flex;
  align-items: center;
  gap: 8px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  max-width: none;
  font-size: clamp(1.1rem, 1.8vw, 1.38rem);
  line-height: 1.12;
  letter-spacing: 0;
  color: var(--ink);
  white-space: nowrap;
}

h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.96rem;
  font-weight: 850;
  line-height: 1.2;
}

.theme-toggle {
  flex: 0 0 auto;
  align-self: flex-start;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--card);
  font-size: 0.76rem;
  font-weight: 850;
  box-shadow: none;
}

.theme-toggle::before,
.mobile-theme-toggle::before {
  content: "";
  width: 14px;
  height: 14px;
  display: block;
  box-sizing: border-box;
}

.theme-toggle[data-mode="auto"]::before,
.mobile-theme-toggle[data-mode="auto"]::before {
  border: 1.5px solid currentColor;
  border-radius: 50%;
  background: linear-gradient(90deg, currentColor 0 50%, transparent 50% 100%);
}

.theme-toggle[data-mode="light"]::before,
.mobile-theme-toggle[data-mode="light"]::before {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow:
    0 -6px 0 -2px currentColor,
    0 6px 0 -2px currentColor,
    6px 0 0 -2px currentColor,
    -6px 0 0 -2px currentColor,
    4px 4px 0 -2px currentColor,
    -4px -4px 0 -2px currentColor,
    4px -4px 0 -2px currentColor,
    -4px 4px 0 -2px currentColor;
}

.theme-toggle[data-mode="dark"]::before,
.mobile-theme-toggle[data-mode="dark"]::before {
  width: 15px;
  height: 15px;
  border: 0;
  border-radius: 50%;
  background: currentColor;
  box-shadow: none;
  -webkit-mask: radial-gradient(circle at 68% 31%, transparent 0 42%, #000 44% 100%);
  mask: radial-gradient(circle at 68% 31%, transparent 0 42%, #000 44% 100%);
  transform: rotate(-8deg);
}

.sheet-handle,
.mobile-theme-toggle {
  display: none;
}

.panel-scroll {
  display: contents;
}

.mobile-map-toolbar {
  display: contents;
}

.route-form {
  display: grid;
  gap: 14px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
  letter-spacing: 0;
}

input {
  width: 100%;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--card);
  outline: none;
}

input {
  height: 52px;
  padding: 0 14px;
  font-size: 1.03rem;
  font-weight: 760;
}

input:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 12%, transparent);
}

.input-action {
  position: relative;
  display: block;
}

.input-action input {
  padding-right: 54px;
}

.locate-button,
.map-locate-button {
  position: absolute;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--ink);
  background: var(--field);
  box-shadow: none;
}

.locate-button {
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
}

.locate-button span,
.map-locate-button span {
  width: 17px;
  height: 17px;
  display: block;
  position: relative;
  transform: rotate(45deg);
}

.locate-button span::before,
.map-locate-button span::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 4px 4px 4px 1px;
  background: currentColor;
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}

.locate-button:disabled,
.map-locate-button:disabled {
  cursor: progress;
  opacity: 0.62;
}

.address-stack {
  display: grid;
  gap: 14px;
}

.address-field {
  position: relative;
}

.place-suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 7px);
  z-index: 900;
  display: none;
  gap: 8px;
  max-height: 280px;
  overflow-y: auto;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-float);
  background: var(--card);
  box-shadow: 0 18px 44px var(--shadow);
}

.place-suggestions.is-open {
  display: grid;
}

.place-option,
.suggestion-empty {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--muted);
  background: var(--soft);
  box-shadow: none;
}

.place-option {
  height: auto;
  display: grid;
  gap: 3px;
  text-align: left;
  cursor: pointer;
}

.place-option strong,
.place-option span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-option strong {
  color: var(--ink);
  font-size: 0.92rem;
}

.place-option span,
.suggestion-empty {
  font-size: 0.78rem;
}

.place-option.preferred {
  background: var(--card);
}

.place-option.selected,
.place-option:focus-visible {
  outline: 0;
  border-color: var(--ink);
  background: var(--card);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ink) 12%, transparent);
}

.route-choice {
  display: block;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.route-choice legend {
  margin-bottom: 8px;
  padding: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 750;
}

.route-toggle {
  position: relative;
  isolation: isolate;
  width: 100%;
  height: 44px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 3px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}

.route-toggle::before {
  content: "";
  position: absolute;
  top: 3px;
  bottom: 3px;
  left: 3px;
  z-index: -1;
  width: calc(50% - 3px);
  border-radius: 9px;
  background: var(--road);
  transform: translateX(0);
  transition: transform 180ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.route-toggle:has(input[value="highway"]:checked)::before {
  transform: translateX(100%);
}

.route-toggle label {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  cursor: pointer;
}

.route-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.route-toggle span {
  width: 100%;
  height: 100%;
  display: grid;
  place-items: center;
  color: var(--muted);
  background: transparent;
  font-size: 0.82rem;
  font-weight: 820;
  transition: color 160ms ease;
}

.route-toggle input:checked + span {
  color: #fff;
}

:root[data-theme="dark"] .route-toggle input:checked + span {
  color: #050505;
}

.form-grid {
  align-items: start;
  gap: 14px;
}

.form-grid label {
  flex: 1 1 0;
  min-width: 0;
  gap: 6px;
  font-size: 0.7rem;
}

.form-grid input {
  height: 44px;
  padding: 0 10px;
  font-size: 0.9rem;
  font-weight: 760;
  min-width: 0;
}

button {
  height: 54px;
  border: 0;
  border-radius: 12px;
  color: #fff;
  background: #050505;
  font-weight: 850;
  cursor: pointer;
  box-shadow: none;
}

:root[data-theme="dark"] button:not(.theme-toggle) {
  color: #050505;
  background: #e6e6e3;
}

:root[data-theme="dark"] .locate-button,
:root[data-theme="dark"] .map-locate-button,
:root:not([data-theme]) .locate-button,
:root:not([data-theme]) .map-locate-button {
  color: var(--ink);
  background: var(--field);
}

.place-suggestions .place-option,
.place-suggestions .suggestion-empty {
  height: auto;
  border: 1px solid var(--line);
  color: var(--muted);
  background: var(--soft);
  box-shadow: none;
}

.place-suggestions .place-option.preferred,
.place-suggestions .place-option.selected,
.place-suggestions .place-option:focus-visible {
  background: var(--card);
}

.place-suggestions .place-option strong {
  color: var(--ink);
}

.place-suggestions .place-option span {
  color: var(--muted);
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .place-suggestions .place-option,
  :root:not([data-theme]) .place-suggestions .suggestion-empty {
    color: var(--muted);
    background: var(--soft);
  }

  :root:not([data-theme]) .place-suggestions .place-option strong {
    color: var(--ink);
  }
}

:root[data-theme="dark"] .place-suggestions .place-option,
:root[data-theme="dark"] .place-suggestions .suggestion-empty {
  color: var(--muted);
  background: var(--soft);
  border-color: var(--line);
}

:root[data-theme="dark"] .place-suggestions .place-option.preferred,
:root[data-theme="dark"] .place-suggestions .place-option.selected,
:root[data-theme="dark"] .place-suggestions .place-option:focus-visible {
  background: var(--card);
}

:root[data-theme="dark"] .place-suggestions .place-option strong {
  color: var(--ink);
}

:root[data-theme="dark"] .place-suggestions .place-option span {
  color: var(--muted);
}

button:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--ink) 14%, transparent);
}

.summary-card,
.advice-section,
.timeline-section {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: none;
}

.section-title span {
  color: var(--muted);
  font-size: 0.86rem;
}

.advice-section .section-title {
  justify-content: flex-start;
}

.section-icon {
  width: 18px;
  height: 18px;
  display: block;
  flex: 0 0 auto;
  object-fit: contain;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .section-icon {
    filter: invert(1);
  }
}

:root[data-theme="dark"] .section-icon {
  filter: invert(1);
}

.advice-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.advice-list span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 7px 9px;
  border-radius: 999px;
  color: var(--ink);
  background: var(--field);
  font-size: 0.78rem;
  font-weight: 760;
  line-height: 1.2;
}

.advice-list b {
  color: var(--muted);
  font-size: 0.72rem;
}

.summary-card strong {
  display: block;
  margin: 10px 0;
  font-size: 1.65rem;
  line-height: 1;
}

.summary-card p {
  color: var(--muted);
  line-height: 1.55;
}

.summary-card .avoid-summary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink);
  font-weight: 760;
}

.rain-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.rain-item {
  display: grid;
  grid-template-columns: 10px 1fr;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--field);
}

.rain-item::before {
  content: "";
  width: 10px;
  border-radius: 999px;
  background: var(--dry);
}

.rain-item.rainy::before {
  background: var(--wet);
}

.rain-item.hot::before {
  background: var(--hot);
}

.rain-item.warm::before {
  background: var(--warm);
}

.rain-item.cloudy::before {
  background: var(--dry);
}

.rain-item.clear::before {
  background: #ffbd2e;
}

.rain-item strong,
.rain-item span {
  display: block;
}

.rain-item strong {
  line-height: 1.35;
}

.rain-item strong .place-name {
  display: inline;
  color: var(--ink);
  font-weight: 900;
}

.rain-item strong .weather-word {
  display: inline;
  margin: 0;
  color: var(--ink);
  font-size: inherit;
  font-weight: 900;
}

.rain-item span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.empty-state {
  color: var(--muted);
  line-height: 1.55;
}

.map-area {
  position: absolute;
  inset: 0;
  z-index: 1;
  min-width: 0;
  overflow: hidden;
  border: 0;
  border-radius: 0;
  background: var(--panel);
  box-shadow: none;
}

.mobile-map-brand {
  display: none;
}

.mobile-panel-title {
  display: none;
}

.export-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-control);
  color: var(--ink);
  background: var(--card);
  box-shadow: none;
}

.export-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.export-button:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.export-button:not(:disabled):active {
  transform: translateY(1px);
}

.export-status {
  position: absolute;
  top: 78px;
  left: 50%;
  z-index: 540;
  max-width: min(360px, calc(100% - 24px));
  padding: 8px 12px;
  border-radius: 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  box-shadow: 0 10px 24px var(--shadow);
  font-size: 0.75rem;
  font-weight: 760;
  opacity: 0;
  transform: translate(-50%, -5px);
  transition: opacity 160ms ease, transform 160ms ease;
  pointer-events: none;
}

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

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) button.export-button {
    color: var(--ink);
    background: var(--card);
  }
}

:root[data-theme="dark"] button.export-button {
  color: var(--ink);
  background: var(--card);
}

#map {
  position: absolute;
  inset: 0;
  overflow: hidden;
  border-radius: 0;
  background: #dfe8e3;
}

.map-controls {
  position: absolute;
  right: 30px;
  top: 50%;
  z-index: 470;
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  transform: translateY(-50%);
}

.zoom-slider {
  width: 28px;
  height: 132px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  appearance: none;
  -webkit-appearance: none;
  writing-mode: vertical-lr;
  direction: rtl;
}

.zoom-slider::-webkit-slider-runnable-track {
  width: 4px;
  height: 132px;
  border-radius: 0;
  background: color-mix(in srgb, var(--ink) 28%, transparent);
}

.zoom-slider::-webkit-slider-thumb {
  width: 18px;
  height: 18px;
  margin-left: -7px;
  border: 2px solid var(--card);
  border-radius: 3px;
  background: var(--road);
  box-shadow: 0 4px 10px var(--shadow);
  appearance: none;
  -webkit-appearance: none;
}

.zoom-slider::-moz-range-track {
  width: 4px;
  height: 132px;
  border-radius: 0;
  background: color-mix(in srgb, var(--ink) 28%, transparent);
}

.zoom-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid var(--card);
  border-radius: 3px;
  background: var(--road);
  box-shadow: 0 4px 10px var(--shadow);
}

.zoom-slider:focus {
  box-shadow: none;
}

.zoom-slider:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 4px;
}

.map-locate-button {
  position: static;
  color: var(--ink);
  background: var(--field);
}

.map-legend {
  position: absolute;
  right: 30px;
  bottom: 30px;
  z-index: 450;
  gap: 8px;
  flex-wrap: wrap;
  max-width: min(360px, calc(100% - 72px));
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: color-mix(in srgb, var(--card) 86%, transparent);
  box-shadow: 0 16px 38px var(--shadow);
  backdrop-filter: blur(16px) saturate(1.2);
  -webkit-backdrop-filter: blur(16px) saturate(1.2);
}

.map-legend::before {
  content: none;
}

.map-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--ink);
  background: color-mix(in srgb, var(--field) 76%, transparent);
  font-size: 0.78rem;
  font-weight: 750;
  white-space: nowrap;
}

.map-legend i {
  width: 18px;
  height: 6px;
  border-radius: 999px;
}

.map-legend .hot {
  background: #ff2f2f;
  box-shadow: 0 0 12px rgba(255, 47, 47, 0.54);
}

.map-legend .warm {
  background: #ff9d00;
  box-shadow: 0 0 12px rgba(255, 157, 0, 0.52);
}

.map-legend .cloudy {
  background: #38d66b;
  box-shadow: 0 0 12px rgba(56, 214, 107, 0.5);
}

.map-legend .wet {
  background: #164bff;
  box-shadow: 0 0 12px rgba(22, 75, 255, 0.58);
}

.leaflet-popup-content {
  color: var(--ink);
  line-height: 1.45;
}

.leaflet-overlay-pane path.route-neon-glow {
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.5)) drop-shadow(0 0 16px rgba(84, 223, 255, 0.24));
}

.leaflet-overlay-pane path.route-neon-flow {
  filter: drop-shadow(0 0 7px rgba(255, 255, 255, 0.48)) drop-shadow(0 0 14px rgba(84, 223, 255, 0.32));
}

.map-point-marker {
  position: relative;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 50% 50% 50% 8px;
  color: #ffffff;
  background: rgba(5, 5, 5, 0.94);
  box-shadow:
    0 9px 20px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  transform: rotate(-45deg);
}

.map-point-marker::before {
  content: none;
}

.map-point-marker::after {
  content: none;
}

.map-point-marker span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  position: relative;
  z-index: 1;
  color: #ffffff;
  font-family: Inter, ui-sans-serif, system-ui, sans-serif;
  font-size: 15px;
  font-style: italic;
  font-weight: 950;
  line-height: 1;
  transform: rotate(45deg) translateY(-1px);
}

.map-point-marker.end span {
  font-family: "Apple Color Emoji", "Segoe UI Emoji", sans-serif;
  font-size: 17px;
  font-style: normal;
  transform: rotate(45deg) translateY(-1px);
}

.weather-badge {
  position: relative;
  overflow: hidden;
  min-width: 62px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 9px;
  border: 0;
  border-radius: 999px;
  color: var(--ink);
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0.36));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.72),
    inset 0 -1px 0 rgba(255, 255, 255, 0.24),
    0 14px 34px rgba(0, 0, 0, 0.14);
  backdrop-filter: blur(22px) saturate(1.55);
  -webkit-backdrop-filter: blur(22px) saturate(1.55);
  font-size: 0.78rem;
  font-weight: 850;
  white-space: nowrap;
}

.weather-badge::before {
  content: "";
  position: absolute;
  left: 8px;
  right: 8px;
  top: 4px;
  height: 42%;
  border-radius: inherit;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.64), rgba(255, 255, 255, 0));
  opacity: 0.9;
  pointer-events: none;
}

.weather-badge span,
.weather-badge strong {
  position: relative;
  z-index: 1;
}

.weather-badge span {
  font-size: 0.95rem;
  line-height: 1;
}

.weather-badge strong {
  font-size: 0.72rem;
}

.weather-badge.clear {
  background: linear-gradient(145deg, rgba(226, 255, 239, 0.74), rgba(218, 255, 236, 0.34));
}

.weather-badge.hot {
  background: linear-gradient(145deg, rgba(255, 118, 118, 0.72), rgba(255, 47, 47, 0.34));
}

.weather-badge.warm {
  background: linear-gradient(145deg, rgba(255, 214, 128, 0.76), rgba(255, 157, 0, 0.36));
}

.weather-badge.partly,
.weather-badge.cloudy {
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.72), rgba(238, 242, 245, 0.34));
}

.weather-badge.light {
  background: linear-gradient(145deg, rgba(255, 239, 178, 0.74), rgba(255, 224, 139, 0.34));
}

.weather-badge.moderate {
  background: linear-gradient(145deg, rgba(255, 211, 168, 0.76), rgba(255, 184, 122, 0.36));
}

.weather-badge.heavy {
  background: linear-gradient(145deg, rgba(255, 171, 171, 0.78), rgba(255, 120, 120, 0.38));
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .weather-badge {
    color: #f0f0ed;
    background: linear-gradient(145deg, rgba(44, 44, 44, 0.62), rgba(10, 10, 10, 0.4));
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.18),
      inset 0 -1px 0 rgba(255, 255, 255, 0.06),
      0 12px 32px rgba(0, 0, 0, 0.32);
  }

  :root:not([data-theme]) .weather-badge::before {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
  }

  :root:not([data-theme]) .weather-badge.clear {
    background: linear-gradient(145deg, rgba(35, 93, 59, 0.6), rgba(12, 35, 24, 0.42));
  }

  :root:not([data-theme]) .weather-badge.hot {
    background: linear-gradient(145deg, rgba(132, 42, 42, 0.66), rgba(62, 14, 14, 0.46));
  }

  :root:not([data-theme]) .weather-badge.warm {
    background: linear-gradient(145deg, rgba(126, 84, 24, 0.64), rgba(54, 35, 10, 0.44));
  }

  :root:not([data-theme]) .weather-badge.light {
    background: linear-gradient(145deg, rgba(113, 88, 34, 0.62), rgba(45, 35, 14, 0.44));
  }

  :root:not([data-theme]) .weather-badge.moderate {
    background: linear-gradient(145deg, rgba(118, 66, 35, 0.64), rgba(50, 27, 16, 0.46));
  }

  :root:not([data-theme]) .weather-badge.heavy {
    background: linear-gradient(145deg, rgba(121, 42, 42, 0.66), rgba(52, 15, 15, 0.48));
  }
}

:root[data-theme="dark"] .weather-badge {
  color: #f0f0ed;
  background: linear-gradient(145deg, rgba(44, 44, 44, 0.62), rgba(10, 10, 10, 0.4));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 12px 32px rgba(0, 0, 0, 0.32);
}

:root[data-theme="dark"] .weather-badge::before {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.2), rgba(255, 255, 255, 0));
}

:root[data-theme="dark"] .weather-badge.clear {
  background: linear-gradient(145deg, rgba(35, 93, 59, 0.6), rgba(12, 35, 24, 0.42));
}

:root[data-theme="dark"] .weather-badge.hot {
  background: linear-gradient(145deg, rgba(132, 42, 42, 0.66), rgba(62, 14, 14, 0.46));
}

:root[data-theme="dark"] .weather-badge.warm {
  background: linear-gradient(145deg, rgba(126, 84, 24, 0.64), rgba(54, 35, 10, 0.44));
}

:root[data-theme="dark"] .weather-badge.light {
  background: linear-gradient(145deg, rgba(113, 88, 34, 0.62), rgba(45, 35, 14, 0.44));
}

:root[data-theme="dark"] .weather-badge.moderate {
  background: linear-gradient(145deg, rgba(118, 66, 35, 0.64), rgba(50, 27, 16, 0.46));
}

:root[data-theme="dark"] .weather-badge.heavy {
  background: linear-gradient(145deg, rgba(121, 42, 42, 0.66), rgba(52, 15, 15, 0.48));
}

@media (max-width: 860px) {
  body {
    overflow: hidden;
  }

  .ride-app {
    --mobile-sheet-height: 40dvh;
    position: relative;
    height: 100dvh;
    min-height: 0;
    padding: 10px;
  }

  .control-panel {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 8px;
    z-index: 520;
    width: auto;
    height: var(--mobile-sheet-height);
    max-height: 78dvh;
    min-height: 0;
    padding: 0;
    overflow: hidden;
  border-radius: var(--radius-card);
    box-shadow:
      0 18px 42px rgba(0, 0, 0, 0.1),
      0 2px 10px rgba(0, 0, 0, 0.05),
      inset 0 1px 0 rgba(255, 255, 255, 0.52);
  }

  .panel-scroll {
    min-height: 0;
    display: block;
    flex: 1 1 auto;
    overflow-y: auto;
    padding: 0 18px 18px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .panel-scroll::-webkit-scrollbar {
    display: none;
  }

  .control-panel.is-snapping {
    transition: height 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
  }

  .control-panel.is-dragging {
    scroll-behavior: auto;
    user-select: none;
  }

  .sheet-handle {
    position: relative;
    top: auto;
    z-index: 20;
    width: 96px;
    height: 32px;
    flex: 0 0 32px;
    display: grid;
    place-items: center;
    margin: 0 auto;
    padding: 0;
    border: 0;
    border-radius: 0;
    color: var(--ink);
    background: transparent;
    box-shadow: none;
    touch-action: none;
    cursor: ns-resize;
  }

  .sheet-handle::before {
    content: "";
    width: 38px;
    height: 4px;
    border-radius: 999px;
    background: color-mix(in srgb, var(--ink) 28%, transparent);
  }

  .control-panel .brand-row {
    display: none;
  }

  .mobile-panel-title {
    display: block;
    margin: 0 0 4px;
    color: var(--ink);
    font-size: 1.08rem;
    font-weight: 900;
    line-height: 1.12;
  }

  h1 {
    font-size: 0.92rem;
    line-height: 1.15;
  }

  .route-form {
    gap: 10px;
    margin-top: 0;
    padding-top: 0;
    border-top: 0;
  }

  .address-stack {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 8px;
  }

  .address-field {
    min-width: 0;
  }

  .address-field:first-child .place-suggestions,
  .address-field:nth-child(2) .place-suggestions {
    width: calc(200% + 8px);
  }

  .address-field:first-child .place-suggestions {
    right: auto;
  }

  .address-field:nth-child(2) .place-suggestions {
    right: 0;
    left: auto;
  }

  .address-field input {
    min-width: 0;
    padding-right: 10px;
    padding-left: 10px;
    font-size: 0.84rem;
  }

  .address-field .input-action input {
    padding-right: 42px;
  }

  .address-field .locate-button {
    right: 5px;
    width: 32px;
    height: 32px;
  }

  input {
    height: 46px;
    font-size: 0.94rem;
  }

  .route-choice {
    padding: 0;
  }

  .route-toggle {
    height: 42px;
  }

  .form-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(84px, 0.55fr);
    gap: 10px;
  }

  .form-grid input {
    height: 42px;
    font-size: 0.8rem;
  }

  .route-form > button[type="submit"] {
    height: 48px;
  }

  .summary-card,
  .advice-section,
  .timeline-section {
    margin-top: 10px;
    padding: 14px;
    border-radius: var(--radius-float);
  }

  .summary-card strong {
    margin: 8px 0;
    font-size: 1.28rem;
  }

  .summary-card p,
  .rain-item span {
    font-size: 0.82rem;
  }

  .control-panel .logo-mark {
    display: none;
  }

  .control-panel .logo-mark {
    margin-top: 22px;
    margin-bottom: 0;
  }

  .map-area {
    position: absolute;
    inset: 0;
    min-height: 0;
  }

  #map {
    position: absolute;
    inset: 0;
  }

  .mobile-map-brand {
    position: absolute;
    top: 8px;
    left: 6px;
    right: 6px;
    z-index: 535;
    height: 52px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 4px 4px 4px 20px;
    border: 1px solid var(--line);
    border-radius: var(--radius-float);
    color: var(--ink);
    background: color-mix(in srgb, var(--card) 86%, transparent);
    box-shadow:
      0 10px 26px var(--shadow),
      inset 0 1px 0 rgba(255, 255, 255, 0.34);
    backdrop-filter: blur(16px) saturate(1.24);
    -webkit-backdrop-filter: blur(16px) saturate(1.24);
  }

  .mobile-map-brand-copy {
    min-width: 0;
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .mobile-map-brand-copy img {
    width: 132px;
    height: 32px;
    display: block;
    flex: 0 0 auto;
    object-fit: contain;
  }

  .mobile-export-button {
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    background: color-mix(in srgb, var(--field) 82%, transparent);
    box-shadow: none;
  }

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

  .export-status {
    top: 68px;
    font-size: 0.7rem;
  }

  .mobile-map-toolbar {
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: calc(var(--mobile-sheet-height) + 18px);
    z-index: 535;
    width: auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    transform: none;
  }

  .map-legend {
    position: static;
    width: auto;
    max-width: none;
    min-height: 40px;
    justify-content: space-between;
    gap: 2px;
    flex-wrap: nowrap;
    padding: 4px 9px 4px 14px;
    border: 1px solid var(--line);
    border-radius: var(--radius-float);
    background: color-mix(in srgb, var(--card) 86%, transparent);
    box-shadow:
      0 10px 26px var(--shadow),
      inset 0 1px 0 rgba(255, 255, 255, 0.32);
  }

  .theme-toggle {
    display: none;
  }

  .mobile-theme-toggle {
    position: static;
    width: 38px;
    height: 38px;
    flex: 0 0 38px;
    display: grid;
    place-items: center;
    padding: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-control);
    color: var(--ink);
    background: color-mix(in srgb, var(--field) 82%, transparent);
    font-size: 0.66rem;
    font-weight: 850;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .map-controls {
    display: none;
  }

  .zoom-slider {
    display: none;
  }

  .map-locate-button {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: color-mix(in srgb, var(--card) 88%, transparent);
    box-shadow:
      0 10px 26px rgba(0, 0, 0, 0.1),
      inset 0 1px 0 rgba(255, 255, 255, 0.46);
    backdrop-filter: blur(16px) saturate(1.25);
    -webkit-backdrop-filter: blur(16px) saturate(1.25);
  }

  :root[data-theme="dark"] button.mobile-theme-toggle,
  :root[data-theme="dark"] button.map-locate-button {
    color: var(--ink) !important;
    background: color-mix(in srgb, var(--card) 86%, transparent) !important;
  }

  :root[data-theme="dark"] button.sheet-handle {
    color: var(--ink) !important;
    background: transparent !important;
  }

  @media (prefers-color-scheme: dark) {
    :root:not([data-theme]) button.mobile-theme-toggle,
    :root:not([data-theme]) button.map-locate-button {
      color: var(--ink) !important;
      background: color-mix(in srgb, var(--card) 86%, transparent) !important;
    }

    :root:not([data-theme]) button.sheet-handle {
      color: var(--ink) !important;
      background: transparent !important;
    }
  }

  .map-legend span {
    gap: 3px;
    min-height: 30px;
    padding: 0 2px;
    background: transparent;
    font-size: 0.64rem;
  }

  .map-legend i {
    width: 10px;
    height: 5px;
  }
}

@media (max-width: 520px) {
  .panel-scroll {
    padding-right: 16px;
    padding-left: 16px;
  }

  .control-panel .brand-row,
  .form-grid {
    display: flex;
  }

  .control-panel .brand-row {
    display: none;
  }

  .form-grid {
    display: grid;
  }

  .live-pill {
    display: inline-block;
    margin-top: 12px;
  }

  .form-grid label + label {
    margin-top: 0;
  }

  .route-toggle label + label {
    margin-top: 0;
  }

  .mobile-map-toolbar {
    width: auto;
    grid-template-columns: minmax(0, 1fr);
  }

  .map-legend span {
    font-size: 0.62rem;
  }

  .map-legend i {
    width: 9px;
    height: 5px;
  }
}
