@font-face {
  font-family: "Material Symbols Rounded";
  src: url("/map/fonts/material-symbols.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: block;
}
.icon {
  font-family: "Material Symbols Rounded";
  font-size: 24px;
  font-weight: 400;
  font-style: normal;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  white-space: nowrap;
  font-feature-settings: "liga";
  -webkit-font-smoothing: antialiased;
}
@font-face {
  font-family: "DM Sans";
  src: url("/map/fonts/dm-sans-variable.ttf") format("truetype");
  font-weight: 100 1000;
  font-style: normal;
  font-display: swap;
}

:root {
  color-scheme: light;
  font-family: "DM Sans", system-ui, sans-serif;
  font-size: 14px;
  color: #1d2b42;
  background: #e9eeed;
  --surface: #fff;
  --background: #f5f7f8;
  --muted: #647089;
  --border: #e4e8ed;
  --tint: #edf0ff;
  --chrome: #f0f3f6;
  --accent: #475bd2;
  --action: #5266e9;
  --action-hover: #4054d4;
  --action-text: #fff;
  --map-surface: #e6eae5;
  --focus-ring: #5266e9;
  --header-height: 72px;
  --panel-width: 372px;
  --shadow: 0 12px 48px #182a3b1c, 0 1px 4px #182a3b0d;
  --purple: #7155ba;
  --occupied: #8d5b0c;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  color: #f1f4fa;
  background: #111a28;
  --surface: #192334;
  --background: #101a2a;
  --muted: #a4b0c3;
  --border: #334056;
  --tint: #263351;
  --chrome: #253247;
  --accent: #b2bfff;
  --action: #a9b7ff;
  --action-hover: #c3ccff;
  --action-text: #14213e;
  --map-surface: #192327;
  --focus-ring: #a9b7ff;
  --shadow: 0 16px 56px #070f1e66, 0 1px 4px #070f1e33;
  --purple: #c4b4ed;
  --occupied: #f3cc80;
}

* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
a { color: inherit; }
button, select, input { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
button:disabled, button[aria-disabled="true"] { cursor: wait; opacity: .6; }
:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; clip-path: inset(50%); overflow: hidden; }
h1, h2, p { margin: 0; }
h1 { font-size: 26px; font-weight: 750; letter-spacing: -1.15px; line-height: 1.15; }
h2 { font-size: 18px; font-weight: 730; letter-spacing: -.4px; }
label { display: block; margin: 16px 0 7px; font-size: 12px; font-weight: 650; }
button, select, input {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--surface);
}
button, select { padding: 10px 14px; }
button { transition: border-color .16s, box-shadow .16s; }
button:hover { background: var(--chrome); }
input {
  width: 100%;
  min-width: 0;
  padding: 12px 14px;
  background: var(--background);
}
input::placeholder { color: var(--muted); opacity: 1; }
select { max-width: 100%; }
.primary, .directions {
  background: var(--action);
  color: var(--action-text);
  border-color: var(--action);
  font-weight: 750;
}
.primary:hover, .directions:hover { background: var(--action-hover); }
.text-button { border-color: transparent; background: transparent; padding-inline: 0; color: var(--accent); }
.text-button:hover { background: transparent; text-decoration: underline; }

.topbar {
  height: var(--header-height);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 20px;
  padding: 12px 28px;
  background: var(--surface);
  color: inherit;
  border-bottom: 1px solid var(--border);
  position: relative;
  z-index: 600;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  width: fit-content;
  font-size: 19px;
  font-weight: 750;
  letter-spacing: -.8px;
  text-decoration: none;
  white-space: nowrap;
}
.brand img { border-radius: 12px; }
.brand-accent { color: var(--accent); }
.app-nav { display: flex; align-items: center; gap: 5px; }
.app-nav button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-size: 14px;
  font-weight: 650;
  padding-inline: 17px;
}
.app-nav button:hover { background: var(--chrome); color: inherit; }
.app-nav button[aria-current="page"] { background: var(--tint); color: var(--accent); }
.nav-symbol { font-size: 22px; }
.display-settings { justify-self: end; display: flex; gap: 8px; }
.display-settings select { background: var(--surface); border-color: var(--border); color: inherit; font-size: 13px; min-height: 44px; border-radius: 10px; }

.workspace { position: relative; height: calc(100dvh - var(--header-height)); min-height: 0; overflow: hidden; }
.map-area { position: absolute; inset: 0; z-index: 0; background: var(--map-surface); }
#map { width: 100%; height: 100%; background: var(--map-surface); }
.leaflet-tile-pane { filter: saturate(.2) contrast(.88) brightness(1.06); }
[data-theme="dark"] .leaflet-tile-pane { filter: invert(96%) hue-rotate(180deg) brightness(.95) contrast(.76) saturate(.18); }
.panel {
  position: absolute;
  z-index: 500;
  width: var(--panel-width);
  top: 164px;
  left: 24px;
  bottom: 24px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  overflow: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
  overscroll-behavior: contain;
}
.intro, .detail, .results { padding: 22px; }
.intro h1 { margin-bottom: 16px; max-width: none; font-size: 23px; }
.search-field { position: relative; }
.search-field input { padding-left: 43px; height: 50px; border-color: transparent; }
.search-field input:focus { border-color: var(--focus-ring); }
.search-symbol { position: absolute; left: 14px; top: 13px; color: var(--muted); pointer-events: none; }
.suggestions, .account-list { list-style: none; margin: 0; padding: 0; }
.suggestions:empty { display: none; }
.suggestions { padding-top: 5px; }
.suggestions button { width: 100%; text-align: left; margin-top: 4px; background: var(--background); }
.map-modes { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; margin-top: 18px; background: var(--chrome); border-radius: 14px; }
.map-modes button { background: transparent; border-color: transparent; font-size: 14px; font-weight: 650; min-height: 44px; padding-inline: 6px; }
.map-modes button[aria-pressed="true"] { background: var(--surface); box-shadow: 0 2px 5px #10243612; }
.power-presets { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; margin-top: 15px; }
.power-presets button { min-height: 44px; padding: 8px 4px; font-size: 12px; border-radius: 9px; font-weight: 650; }
.power-presets button[aria-pressed="true"] { color: var(--accent); background: var(--tint); border-color: var(--accent); }
.map-filters { margin-top: 14px; border: 1px solid var(--border); border-radius: 12px; padding: 0 12px; }
.map-filters summary { display: flex; align-items: center; gap: 8px; min-height: 44px; font-size: 14px; font-weight: 650; list-style: none; }
.map-filters summary::-webkit-details-marker { display: none; }
.map-filters summary::after { content: "+"; margin-left: auto; font-size: 18px; color: var(--muted); }
.map-filters[open] summary::after { content: "−"; }
.filter-symbol { font-size: 20px; }
.filter-count, .result-count { display: inline-grid; place-items: center; min-width: 23px; height: 23px; padding: 0 6px; background: var(--chrome); border-radius: 7px; font-size: 11px; font-weight: 750; }
.filter-count { background: var(--tint); color: var(--accent); }
.filter-fields, .battery-fields { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 12px; }
.filter-fields select { width: 100%; font-size: 12px; padding-inline: 10px; }
.check-label { display: flex; align-items: center; gap: 8px; line-height: 1.5; font-size: 13px; font-weight: 550; min-height: 32px; }
.check-label input { width: 16px; min-width: 16px; height: 16px; min-height: 0; margin: 0; accent-color: var(--accent); }
#poi-category { width: 100%; }
#location-status, #status { color: var(--muted); font-size: 12px; line-height: 1.5; }
#location-status { margin-top: 12px; }
.results { border-top: 1px solid var(--border); }
.results-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.results-head h2 { font-size: 16px; flex: 1; }
#status { flex: 0 0 100%; margin-top: 1px; }
#stations { list-style: none; padding: 0; margin: 16px 0 0; }
#stations li + li { margin-top: 10px; }
.station {
  width: 100%;
  padding: 16px;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: start;
  text-align: left;
  border-radius: 15px;
  background: var(--surface);
}
.station:hover { border-color: var(--muted); background: var(--background); box-shadow: 0 3px 12px #12283b09; }
.station[aria-current="true"] { border-color: var(--accent); background: var(--tint); }
.station-symbol { font-family: "Material Symbols Rounded"; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 11px; background: var(--tint); color: var(--accent); font-size: 24px; }
.station-symbol.is-place { color: var(--purple); background: var(--chrome); font-size: 23px; }
.station-title { display: block; font-size: 15px; font-weight: 700; line-height: 1.45; overflow-wrap: anywhere; }
.station-meta { display: block; color: var(--muted); font-size: 13px; margin-top: 5px; line-height: 1.5; }
.station-status { display: inline-flex; align-items: center; gap: 5px; color: var(--muted); font-size: 12px; margin-top: 8px; line-height: 1.4; }
.station-status::before { content: ""; width: 5px; height: 5px; flex-shrink: 0; background: currentColor; border-radius: 50%; }
.station-status.available { color: var(--accent); }
.station-status.occupied { color: var(--occupied); }
.station-power { white-space: nowrap; color: var(--accent); font-size: 13px; font-weight: 800; line-height: 1.5; padding-top: 1px; }
#more { width: 100%; margin-top: 14px; }
.detail { border-top: 1px solid var(--border); background: var(--background); }
.detail-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; }
.detail-head button { font-size: 14px; min-height: 44px; padding: 8px 10px; }
.eyebrow { text-transform: uppercase; color: var(--muted); font-size: 10px; font-weight: 750; letter-spacing: 1px; }
#detail-title { font-size: 23px; line-height: 1.25; overflow-wrap: anywhere; }
.detail-power { color: var(--accent); font-size: 32px; letter-spacing: -1.5px; font-weight: 750; margin-top: 10px; }
.detail dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 14px 16px; font-size: 14px; margin: 20px 0; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; font-weight: 650; overflow-wrap: anywhere; }
#connectors { padding-left: 20px; font-size: 12px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 15px; }
.actions > button, .actions > a { font-size: 14px; }
.directions { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 16px; border-radius: 12px; text-decoration: none; }
.map-toolbar { position: absolute; top: 24px; right: 24px; left: calc(var(--panel-width) + 72px); z-index: 450; display: flex; justify-content: flex-end; align-items: start; gap: 12px; pointer-events: none; }
.map-toolbar > * { pointer-events: auto; box-shadow: var(--shadow); }
.map-legend { display: flex; gap: 16px; flex-wrap: wrap; padding: 13px 17px; background: var(--surface); border: 1px solid var(--border); border-radius: 13px; font-size: 11px; line-height: 18px; }
.map-legend > span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-dot { width: 7px; height: 7px; border-radius: 50%; background: #5077c6; }
.legend-dot.fast { background: #203a66; box-shadow: 0 0 0 2px #d6e2ff; }
.legend-dot.places { background: #8062bc; }
.location-button { display: flex; align-items: center; gap: 7px; white-space: nowrap; padding: 10px 14px; background: var(--surface); font-size: 11px; min-height: 46px; }
.location-button > span:first-child { font-size: 22px; line-height: 1; color: var(--accent); }
#map .leaflet-control-zoom { border: 1px solid var(--border); border-radius: 13px; box-shadow: var(--shadow); overflow: hidden; margin: 80px 20px 0 0; }
#map .leaflet-control-zoom a { width: 40px; height: 40px; line-height: 40px; background: var(--surface); color: inherit; border-color: var(--border); font-weight: 400; }
#map .leaflet-control-attribution { background: var(--surface); color: var(--muted); font: 9px "DM Sans", sans-serif; padding: 5px 9px; border-radius: 8px 0 0; }
#map .leaflet-control-attribution a { color: inherit; }
.charger-pin > span {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  height: 34px; min-width: 66px; padding: 0 9px;
  border: 2px solid white; border-radius: 11px;
  background: #5077c6; color: white; box-shadow: 0 2px 8px #132f3c40;
  font: 750 12px "DM Sans", sans-serif; white-space: nowrap;
}
.charger-pin.fast > span { background: #203a66; border-color: #d6e2ff; }
.charger-pin small { font-size: 9px; font-weight: 500; opacity: .85; }
.charger-pin.place-pin > span { background: #8062bc; min-width: 34px; padding: 0 8px; font-size: 16px; }
.charger-pin.selected > span { box-shadow: 0 0 0 5px #839cff99, 0 5px 16px #122c3b50; transform: scale(1.12); }
.charger-cluster { background: transparent; border: 0; }
.cluster-body { width: 44px; height: 44px; display: grid; place-items: center; border: 5px solid #d7e5ff; border-radius: 50%; background: #345993; color: white; font: 750 15px "DM Sans", sans-serif; box-shadow: 0 3px 12px #142d3b30; }
.place-cluster .cluster-body { background: #7353b1; border-color: #e3d9f6; }
.leaflet-cluster-spider-leg { stroke: var(--muted); }
form > input, form > select { width: 100%; }
form > button { margin-top: 20px; }
#plan-form > .primary { width: 100%; min-height: 48px; }
.message { margin: 14px 0; line-height: 1.6; font-size: 14px; color: var(--muted); }
.message:empty { display: none; }
.battery-fields { margin-top: 2px; }
.plan-options { margin-top: 20px; padding: 14px; border: 1px solid var(--border); border-radius: 14px; }
.plan-options summary { font-size: 12px; font-weight: 700; }
.plan-options select { width: 100%; }
.route-metrics { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0; }
.route-metrics > div { padding: 15px; border-radius: 13px; background: var(--chrome); }
.route-metrics dt { color: var(--muted); font-size: 11px; }
.route-metrics dd { margin: 6px 0 0; font-size: 22px; letter-spacing: -.7px; font-weight: 750; }
.route-stops { display: grid; gap: 12px; padding-left: 25px; font-size: 12px; }
.route-stops li { border-left: 2px solid var(--action); padding: 10px 0 10px 15px; }
.route-stops p { color: var(--muted); margin-top: 6px; line-height: 1.6; }
#plan-result { margin-top: 26px; padding-top: 24px; border-top: 1px solid var(--border); }
#save-route { margin-top: 12px; }
#account-content > h2 { margin-top: 26px; }
.account-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--border); font-size: 12px; }
.account-list button { min-height: 36px; font-size: 11px; }
.app-footer { display: flex; flex-wrap: wrap; gap: 8px 14px; padding: 18px 24px 22px; color: var(--muted); border-top: 1px solid var(--border); font-size: 10px; }
.app-footer a { text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer button { font-size: inherit; min-height: 30px; padding: 5px 8px; }
.sheet-toggle { display: none; }
dialog { color: inherit; width: min(440px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: auto; padding: 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 22px; box-shadow: var(--shadow); }
dialog::backdrop { background: #101d35a6; backdrop-filter: blur(5px); }


.discovery-search { position: absolute; z-index: 510; top: 24px; left: 24px; width: var(--panel-width); }
.discovery-search .search-field { display: flex; gap: 8px; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 15px; box-shadow: var(--shadow); }
.discovery-search input { height: 46px; border: 0; background: transparent; padding-left: 36px; font-size: 15px; }
.discovery-search .search-symbol { top: 20px; left: 18px; }
.discovery-search .filter-launch { flex-shrink: 0; width: 46px; padding: 10px; background: var(--chrome); border: 0; }
.discovery-search .map-modes { margin-top: 10px; box-shadow: var(--shadow); background: var(--surface); border: 1px solid var(--border); }
.discovery-search .map-modes button[aria-pressed="true"] { background: var(--tint); color: var(--accent); box-shadow: none; }
.discovery-search .suggestions { position: absolute; top: 65px; z-index: 2; width: 100%; max-height: 300px; overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); box-shadow: var(--shadow); }
.workspace[data-panel="plan"] .discovery-search,
.workspace[data-panel="account"] .discovery-search,
.workspace[data-detail="open"] .discovery-search { display: none; }
.workspace[data-detail="open"][data-panel="map"] .panel { top: 24px; }
.workspace[data-detail="open"] #map-panel > .intro,
.workspace[data-detail="open"] #map-panel > .results { display: none; }
.detail { background: var(--surface); border: 0; }
.detail .detail-head { flex-direction: row-reverse; }
.back-button { display: inline-flex; align-items: center; gap: 6px; border: 0; background: transparent; color: var(--muted); }
.detail-overview { display: flex; justify-content: space-between; align-items: center; margin: 24px 0 14px; padding: 22px; background: var(--chrome); border-radius: 16px; }
.detail-power { margin-top: 7px; font-size: 38px; letter-spacing: -1.5px; }
.detail-station-icon { font-size: 48px; color: var(--accent); }
.detail-status { color: var(--muted); font-size: 14px; line-height: 1.5; }
.detail-status[data-state="available"] { color: var(--accent); }
.detail-primary { display: grid; grid-template-columns: 1fr; margin-top: 24px; }
.detail-primary .directions { min-height: 48px; }
.detail-tools { padding-top: 16px; border-top: 1px solid var(--border); margin-top: 20px; }
.detail-tools button { display: inline-flex; align-items: center; gap: 6px; background: transparent; border: 0; color: var(--muted); padding-inline: 7px; }
.charger-pin.place-pin > .icon { font-family: "Material Symbols Rounded"; font-size: 20px; }
#status:empty { display: none; }
.workspace[data-panel="plan"] .panel { top: 24px; width: 420px; }
#plan-panel { padding-top: 26px; }
#plan-panel > .eyebrow { margin: 4px 0 10px; }
.plan-input { margin-top: 20px; }
.plan-input > summary { min-height: 44px; padding: 12px 0; font-size: 14px; font-weight: 650; }
.plan-input[open] > summary { color: var(--muted); }
#plan-form label { font-size: 13px; }
#plan-form input, #plan-form select { font-size: 15px; }
.route-metrics { grid-template-columns: 1.25fr 1fr; }
.route-metrics > div { background: var(--background); }
.route-metrics dt { font-size: 12px; }
.route-metrics > div:nth-child(-n+2) dd { font-size: 28px; }
.route-metrics > div:nth-child(n+3) dd { font-size: 19px; }
.route-stops { list-style: none; padding: 0 0 0 24px; margin-top: 26px; gap: 0; font-size: 14px; }
.route-stops li { position: relative; padding: 4px 0 26px 22px; border-left: 2px solid var(--border); }
.route-stops li::before { content: ""; position: absolute; left: -7px; top: 6px; width: 12px; height: 12px; border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); background: var(--accent); border-radius: 50%; }
.route-stops li:last-child { border-left-color: transparent; padding-bottom: 2px; }
.route-stops .eyebrow { display: block; margin-bottom: 6px; font-size: 11px; }
.route-stops strong { display: block; font-size: 15px; }
.route-stops p { font-size: 13px; }
.route-map-note { font-size: 12px; line-height: 1.6; color: var(--muted); padding: 14px 0; }
#plan-result { margin-top: 12px; border-top: 1px solid var(--border); }
#route-directions { display: grid; }
#save-route { width: 100%; }
.workspace[data-panel="account"] { background: var(--background); }
.workspace[data-panel="account"] .map-area { display: none; }
.workspace[data-panel="account"] .panel { inset: 0; width: 100%; border: 0; box-shadow: none; border-radius: 0; background: transparent; }
#account-panel { max-width: 1120px; margin: 42px auto; padding: 0 36px; position: relative; }
#account-panel > .eyebrow { margin-bottom: 12px; }
#account-title { font-size: 36px; margin-bottom: 12px; }
#account-message { font-size: 16px; }
#account-content > .actions { position: absolute; top: 0; right: 36px; margin-top: 0; }
.account-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 36px; }
.account-card { padding: 26px; border: 1px solid var(--border); border-radius: 18px; background: var(--surface); }
.account-card-title { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.account-card-title > .icon { color: var(--accent); background: var(--tint); padding: 10px; border-radius: 12px; }
.account-card h2 { font-size: 20px; }
.trips-card { grid-column: 1 / -1; }
.account-list li { font-size: 15px; padding: 16px 0; }
.account-list button { font-size: 14px; min-height: 44px; }
.vehicle-row { gap: 14px !important; }
.vehicle-row > .icon { color: var(--muted); }
.vehicle-add { margin-top: 20px; }
.vehicle-add > summary { display: flex; align-items: center; gap: 6px; min-height: 44px; list-style: none; font-size: 14px; font-weight: 650; color: var(--accent); }
.vehicle-add > summary::-webkit-details-marker { display: none; }
.vehicle-add select { width: 100%; }
.empty-state { flex-direction: column; align-items: start !important; gap: 14px !important; color: var(--muted); line-height: 1.6; border: 0 !important; }
.empty-state button { color: var(--accent); }
.guest-intro { max-width: 520px; margin-top: 40px; }
.account-hero-icon { display: grid; place-items: center; width: 80px; height: 80px; font-size: 42px; color: var(--accent); background: var(--tint); border-radius: 22px; margin-bottom: 24px; }
.guest-intro h2 { font-size: 28px; margin-bottom: 16px; }
.guest-intro p { font-size: 16px; line-height: 1.7; color: var(--muted); }
#sign-in { margin-top: 24px; min-width: 200px; }
.workspace[data-panel="account"] .app-footer { max-width: 1048px; margin: 0 auto; font-size: 12px; }
#auth-dialog { padding: 30px; }
#auth-dialog h2 { font-size: 23px; }
#auth-dialog label { font-size: 14px; }
#auth-dialog input { min-height: 48px; font-size: 16px; }
#auth-submit { width: 100%; min-height: 48px; margin-top: 24px; }
.auth-secondary { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.auth-secondary button { font-size: 13px; }
#auth-mode { border: 0; color: var(--accent); background: transparent; padding-inline: 0; }
#auth-dialog .message:last-child { margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--border); font-size: 12px; }

@media (max-width: 1050px) {
  .topbar { padding-inline: 20px; gap: 12px; }
  .app-nav button { padding-inline: 12px; }
  .map-legend { display: none; }
}

@media (max-width: 760px), (max-width: 1050px) and (max-height: 520px) {
  :root { --header-height: 64px; --panel-width: 100%; --nav-height: calc(64px + env(safe-area-inset-bottom, 0px)); }
  .topbar { height: var(--header-height); grid-template-columns: minmax(0, 1fr) auto; padding: 8px 16px; gap: 8px; }
  .brand { font-size: 17px; gap: 8px; }
  .brand img { width: 32px; height: 32px; border-radius: 10px; }
  .display-settings { gap: 4px; }
  .display-settings select { min-height: 44px; font-size: 12px; padding: 6px 4px; max-width: 82px; }
  .app-nav { position: fixed; z-index: 800; inset: auto 0 0; height: var(--nav-height); padding: 6px 12px calc(6px + env(safe-area-inset-bottom, 0px)); display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; border-top: 1px solid var(--border); background: var(--surface); }
  .app-nav button { flex-direction: column; gap: 4px; min-height: 50px; padding: 4px; border-radius: 12px; font-size: 12px; }
  .nav-symbol { font-size: 23px; }
  .workspace { height: calc(100dvh - var(--header-height) - var(--nav-height)); }
  .map-area { bottom: 35%; }
  .panel, .workspace[data-panel="plan"] .panel, .workspace[data-detail="open"][data-panel="map"] .panel { top: auto; bottom: 0; left: 0; width: 100%; height: 35%; border: 0; border-top: 1px solid var(--border); border-radius: 20px 20px 0 0; box-shadow: 0 -8px 25px #12283b14; }
  .workspace[data-sheet="expanded"][data-panel] .panel { height: 100%; border-radius: 0; }
  .workspace[data-sheet="expanded"] .map-area { visibility: hidden; }
  .workspace[data-sheet="expanded"] .discovery-search { display: none; }
  .workspace[data-sheet="expanded"] .panel .intro { display: block; }
  .workspace:not([data-sheet="expanded"]) #map-panel > .intro { display: none; }
  .sheet-toggle { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 44px; border: 0; border-radius: 20px 20px 0 0; background: var(--surface); padding: 8px 20px; touch-action: none; color: var(--muted); font-size: 13px; }
  .sheet-chevron { transform: rotate(180deg); }
  .workspace[data-sheet="expanded"] .sheet-chevron { transform: none; }
  .intro, .detail, .results { padding: 16px 20px; }
  .results { padding-top: 8px; border-top: 0; }
  #stations { margin-top: 10px; }
  .station { padding: 14px; gap: 10px; }
  .station-title { font-size: 14px; }
  .station-meta, .station-status { font-size: 12px; }
  .discovery-search { top: 14px; left: 14px; right: 14px; width: auto; }
  .discovery-search .map-modes { max-width: 400px; margin-top: 9px; }
  .discovery-search input { font-size: 15px; }
  .map-toolbar { top: 142px; right: 14px; left: auto; }
  .location-button { width: 44px; height: 44px; padding: 10px; }
  .location-button > span:last-child { display: none; }
  #map .leaflet-control-zoom { margin-top: 196px; margin-right: 14px; }
  #map .leaflet-control-attribution { font-size: 8px; }
  .workspace[data-panel="account"] .panel { top: 0; height: 100%; border-radius: 0; }
  .workspace[data-panel="account"] .sheet-toggle { display: none; }
  #account-panel { margin: 28px auto; padding: 0 20px; }
  #account-title { font-size: 30px; }
  #account-message { font-size: 14px; }
  #account-content > .actions { position: absolute; top: 28px; right: 20px; margin-top: 0; }
  .account-grid { grid-template-columns: 1fr; gap: 16px; margin-top: 24px; }
  .account-card { padding: 18px; }
  .account-card-title { margin-bottom: 12px; }
  .account-card-title > .icon { padding: 8px; }
  .account-list li { padding: 12px 0; }
  .vehicle-add { margin-top: 10px; }
  .account-card h2 { font-size: 18px; }
  .trips-card { grid-column: auto; }
  .guest-intro { margin-top: 32px; }
  .guest-intro h2 { font-size: 24px; }
  .guest-intro p { font-size: 15px; }
  .workspace[data-panel="account"] .app-footer { padding: 20px; }
  #auth-dialog { padding: 24px; }
}

@media (max-width: 360px) {
  .topbar { padding-inline: 12px; gap: 6px; }
  .brand { gap: 6px; font-size: 15px; }
  .brand img { width: 29px; height: 29px; }
  .display-settings select { font-size: 11px; max-width: 72px; }
  .intro, .detail, .results { padding-inline: 16px; }
  .station { grid-template-columns: 30px minmax(0, 1fr) auto; gap: 8px; padding: 12px; }
  .station-symbol { width: 30px; height: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
  .leaflet-zoom-animated, .leaflet-cluster-anim .leaflet-marker-icon { transition: none !important; }
}

.route-point > span {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 3px solid var(--surface);
  border-radius: 50%;
  background: var(--action);
  color: var(--action-text);
  box-shadow: 0 2px 8px #132f3c40;
  font: 750 14px "DM Sans", sans-serif;
}
.workspace[data-panel="plan"] .map-legend { display: none; }

.detail-status small { display: block; font-size: 12px; color: var(--muted); margin-top: 5px; }
#connectors { list-style: none; display: grid; gap: 8px; padding: 0; margin: 18px 0; }
.connector-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 12px; background: var(--background); font-size: 14px; font-weight: 650; }
.connector-card .icon { color: var(--accent); }
#expanded-map-modes:empty { display: none; }
#expanded-map-modes .map-modes { margin: 0 0 18px; }
.station-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
@media (max-width: 760px) and (max-height: 700px) {
  .map-area { bottom: 48%; }
  .workspace:not([data-sheet="expanded"]) .panel { height: 48%; }
  #map .leaflet-control-zoom { margin: 145px 66px 0 0; }
}
@media (max-width: 1050px) and (min-width: 540px) and (max-height: 520px) {
  :root { --header-height: 56px; --nav-height: 56px; }
  .topbar { padding-block: 6px; }
  .app-nav { padding: 4px 8px; }
  .app-nav button { min-height: 44px; gap: 2px; font-size: 11px; }
  .nav-symbol { font-size: 20px; }
  .map-area { left: 292px; bottom: 0; }
  .workspace:not([data-sheet="expanded"]) .panel { top: 12px; bottom: 12px; left: 12px; width: 268px; height: auto; border-radius: 16px; }
  .workspace:not([data-sheet="expanded"]) .results { padding: 8px 12px; }
  .discovery-search { position: fixed; left: 174px; right: 164px; top: 6px; z-index: 700; }
  .discovery-search .search-field { padding: 0; border: 0; box-shadow: none; background: var(--background); }
  .discovery-search .search-symbol { left: 12px; top: 11px; }
  .discovery-search .filter-launch { height: 44px; }
  .discovery-search .map-modes { display: none; }
  .discovery-search .suggestions { top: 48px; }
  .map-toolbar { top: 12px; right: 12px; }
  #map .leaflet-control-zoom { margin: 68px 12px 0 0; }
}
