@charset "UTF-8";

:root {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  font-synthesis: none;
  color: #191c20;
  --ink: #191c20;
  --muted: #687079;
  --line: #e4e7eb;
  --blue: #2868e8;
  --green: #198653;
  --mint: #edf7f0;
  --canvas: #eef1f3;
  --panel-width: 380px;
  --panel-gap: 20px;
  --map-center: calc(50% + 170px);
  --card-shadow: 0 8px 32px #1b24321a, 0 1px 4px #1b24320a;
}
* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; }
body { margin: 0; overflow: hidden; background: var(--canvas); line-height: 1.5; }
button, input, select { font: inherit; color: inherit; }
button, a, input, select { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button:disabled { opacity: .48; cursor: not-allowed; }
a { color: inherit; text-underline-offset: 3px; }
button:focus-visible, a:focus-visible, input:focus-visible, select:focus-visible,
summary:focus-visible, [tabindex]:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }
[hidden] { display: none !important; }
button svg, .mobile-nav svg, .planner-footer svg, .brand svg, .empty-trip svg {
  width: 21px; height: 21px; flex-shrink: 0; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round;
}
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: fixed; top: -90px; left: 16px; z-index: 5000;
  background: #fff; padding: 14px; border: 2px solid var(--blue); border-radius: 10px;
}
.skip-link:focus { top: 12px; }
h1, h2, h3, p { overflow-wrap: break-word; }
h1 { margin: 0 0 5px; font-size: 25px; line-height: 1.22; letter-spacing: -.8px; font-weight: 720; }
h2 { margin: 0; font-weight: 700; letter-spacing: -.35px; }
.eyebrow { margin: 0 0 6px; font-size: 11px; font-weight: 750; letter-spacing: 1.4px; color: var(--muted); }
.icon-button {
  display: inline-flex; align-items: center; justify-content: center;
  width: 44px; height: 44px; flex: 0 0 44px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: #fff; color: var(--ink);
}
.icon-button:hover:not(:disabled) { background: #f4f5f6; }
.text-button {
  display: inline-flex; align-items: center; justify-content: flex-start; gap: 7px;
  min-height: 44px; border: 0; background: none; padding: 7px 0;
  color: var(--blue); font-size: 14px; font-weight: 650; text-align: left;
}

/* The map is the permanent canvas; the planner is one independently scrolling card. */
.journey-workspace { width: 100%; height: 100%; }
.map-panel { position: fixed; inset: 0; z-index: 0; display: block; min-width: 0; }
.map-wrap { position: absolute; inset: 0; overflow: hidden; background: #e8edef; }
#journey-map { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; background: #e8edef; }
#journey-map.picking { cursor: crosshair; }
.planner-shell {
  position: fixed; top: var(--panel-gap); left: var(--panel-gap); z-index: 1000;
  width: var(--panel-width); max-height: calc(100dvh - 40px); display: flex; flex-direction: column;
  min-height: 0; background: #fff; border: 1px solid #e3e6e9;
  border-radius: 18px; box-shadow: var(--card-shadow);
}
.site-header {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex: 0 0 auto; min-height: 68px; padding: 9px 15px 9px 19px;
}
.brand { display: inline-flex; align-items: center; gap: 3px; text-decoration: none; font-size: 27px; font-weight: 780; letter-spacing: -1.2px; white-space: nowrap; }
.brand svg { width: 27px; height: 30px; color: var(--green); stroke-width: 1.9; }
.brand-dot { color: var(--green); }
.header-actions { display: flex; gap: 3px; align-items: center; }
.header-actions .icon-button { border-color: transparent; background: transparent; color: #525a64; }
.header-actions .icon-button:hover { background: #f2f4f5; }
.sheet-toggle { display: none; }
.planner-content { display: flex; flex-direction: column; min-height: 0; overflow: hidden; border-radius: 0 0 18px 18px; }
.shell-tabs { display: flex; flex: 0 0 auto; gap: 4px; margin: 0 18px; padding: 0 0 7px; border-bottom: 1px solid var(--line); }
.shell-tabs button { flex: 1; min-height: 44px; border: 0; border-radius: 9px; background: transparent; color: #737981; font-size: 14px; font-weight: 650; }
.shell-tabs button.active { background: #f0f2f4; color: var(--ink); }
.shell-tabs button:hover:not(.active) { background: #f8f9fa; }
.shell-scroll { flex: 1 1 auto; min-height: 0; overflow: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #cdd2d7 transparent; }
.planner-panel, .trip-panel { display: none; min-width: 0; padding: 19px 19px 17px; }
.planner-panel.mobile-active, .trip-panel.mobile-active { display: block; }
.panel-heading { margin-bottom: 17px; }
.intro { margin: 0; font-size: 13px; color: var(--muted); }
/* The route action stays outside the scrolling form at every viewport height. */
.planner-actions { flex: 0 0 auto; display: flex; flex-direction: column; gap: 7px; padding: 12px 19px 11px; border-top: 1px solid var(--line); background: #fff; box-shadow: 0 -4px 12px #172b4305; }
.planner-actions .primary-button { flex-shrink: 0; }
.planner-actions .form-status { margin: 0; font-size: 12px; line-height: 1.5; }
.planner-actions .form-status:empty { display: none; }
.planner-actions .form-status.error { padding: 7px 9px; font-size: 12px; }
.planner-footer { flex: 0 0 auto; display: flex; align-items: center; justify-content: space-between; gap: 9px; min-height: 49px; padding: 4px 19px; border-top: 1px solid var(--line); }
.planner-footer a { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; font-size: 12px; font-weight: 650; text-decoration: none; }
.planner-footer a:hover { color: var(--blue); }
.planner-footer svg { width: 16px; height: 16px; color: var(--green); }
.planner-footer > span { color: #767e87; font-size: 11px; white-space: nowrap; }

/* Compact vehicle and route inputs. */
.vehicle-summary { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 67px; padding: 11px 12px; margin-bottom: 15px; border: 1px solid var(--line); border-radius: 12px; background: #f7f8f9; text-align: left; }
.vehicle-summary:hover { border-color: #bdc5d0; background: #f2f4f6; }
.vehicle-summary .vehicle-icon { width: 30px; height: 30px; color: #414a55; stroke-width: 1.5; fill: none; }
.vehicle-summary-text { display: block; min-width: 0; flex: 1; }
.vehicle-summary-text strong { display: block; font-size: 14px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.vehicle-summary-text small { display: block; font-size: 12px; color: var(--muted); line-height: 1.45; margin-top: 3px; overflow-wrap: anywhere; }
.vehicle-summary .vehicle-chevron { width: 16px; height: 16px; color: #7b828a; }
.route-endpoints { position: relative; padding-right: 0; border: 1px solid #dfe3e8; border-radius: 12px; background: #fff; }
.point-field { min-width: 0; }
.point-field + .point-field { border-top: 1px solid var(--line); }
.place-button { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 64px; border: 0; border-radius: 11px; padding: 11px 44px 11px 12px; background: transparent; text-align: left; }
.place-button:hover { background: #f6f8fb; }
.point-letter { display: inline-flex; align-items: center; justify-content: center; width: 23px; height: 23px; flex-shrink: 0; border-radius: 50%; font-size: 11px; font-weight: 750; color: #fff; }
.start-letter { background: var(--blue); }
.end-letter { background: #242b35; }
.place-text { flex: 1; min-width: 0; }
.place-text strong { display: block; font-size: 14px; font-weight: 600; line-height: 1.45; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-text small { display: block; margin-top: 2px; font-size: 12px; line-height: 1.5; color: #747d87; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.place-map-icon { color: #697788; flex-shrink: 0; }
.swap-button { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; padding: 0; background: #fff; border: 1px solid var(--line); border-radius: 50%; color: #525d6a; box-shadow: 0 2px 5px #26324408; }
.swap-button:hover { background: #f0f3f7; }
.swap-button svg { width: 18px; height: 18px; }
.field-heading { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.field-heading label { font-size: 14px; font-weight: 650; }
.location-actions { margin: 6px 0 17px; }
.locate-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #374e72; font-size: 13px; font-weight: 600; }
.location-actions .locate-button { padding: 8px 2px; border-color: transparent; background: transparent; }
.location-actions .locate-button svg { width: 17px; height: 17px; }
.locate-button:hover:not(:disabled) { color: var(--blue); }
.locate-button[aria-busy=true] { color: #816125; background: #fff7e8; }
.location-status { margin: 2px 0 0; font-size: 13px; line-height: 1.55; color: #626c78; overflow-wrap: anywhere; }
.location-status:empty { display: none; }
.divider { height: 1px; background: var(--line); margin: 20px 0; }
.stops-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.stops-heading h2 { font-size: 14px; letter-spacing: -.1px; }
.count-chip { padding: 3px 7px; border-radius: 6px; background: #f1f3f5; color: #69737e; font-size: 11px; font-weight: 600; white-space: nowrap; }
.empty-stops { margin: 9px 0 10px; color: #78818b; font-size: 12px; }
.via-list { display: grid; gap: 8px; list-style: none; padding: 0; margin: 12px 0; }
.via-list:empty { display: none; }
.via-item { border: 1px solid #dce9e1; border-radius: 10px; background: #f7faf8; padding: 10px 10px 4px; }
.via-top { display: flex; align-items: flex-start; gap: 9px; }
.via-number { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; border-radius: 50%; background: #e0f0e7; color: var(--green); font-size: 11px; font-weight: 750; }
.via-name { flex: 1; min-width: 0; font-size: 13px; line-height: 1.5; font-weight: 650; overflow-wrap: anywhere; }
.via-spec { margin: 5px 0 1px 31px; color: #697b6f; font-size: 12px; line-height: 1.55; }
.via-actions { display: flex; align-items: center; justify-content: flex-end; gap: 4px; }
.via-actions button { min-width: 44px; min-height: 44px; padding: 7px; border: 0; border-radius: 7px; color: #4d6657; background: transparent; font-size: 14px; }
.via-actions button:hover:not(:disabled) { background: #e9f1ec; }
.via-actions .remove-stop { margin-right: auto; font-size: 12px; color: #8d6560; }
.add-stop { display: flex; align-items: center; justify-content: center; gap: 7px; width: 100%; min-height: 44px; padding: 10px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: #46515e; font-size: 13px; font-weight: 650; }
.add-stop:hover { background: #f5f7f9; }
.add-stop svg { width: 17px; height: 17px; }
.catalog-label { margin: 10px 0 14px; font-size: 11px; color: #7c838d; line-height: 1.6; }
.catalog-warning { padding: 10px 12px; margin: 9px 0 13px; border: 1px solid #efdcb5; border-radius: 9px; background: #fff8e9; color: #816631; font-size: 13px; line-height: 1.6; }
.primary-button { display: flex; align-items: center; justify-content: center; gap: 9px; width: 100%; min-height: 49px; padding: 12px 16px; border: 0; border-radius: 28px; background: #1b1e23; color: #fff; font-size: 14px; font-weight: 700; box-shadow: 0 2px 4px #1118270a; }
.primary-button:hover:not(:disabled) { background: #333941; }
.primary-button:disabled { opacity: .48; }
.form-status { margin: 10px 0 0; font-size: 12px; line-height: 1.6; color: #6b7480; }
.form-status.error { padding: 10px 12px; border-radius: 9px; background: #fff1eb; color: #984e31; }
.form-status.busy { color: var(--blue); }
.planner-footnote { margin: 9px 0 0; font-size: 12px; line-height: 1.6; color: #747c86; }
.privacy-note { margin: 7px 0 0; font-size: 11px; line-height: 1.6; color: #858d95; }

/* Floating controls and map point confirmation. */
.map-controls { position: absolute; z-index: 900; top: 20px; right: 20px; display: flex; flex-direction: column; align-items: flex-end; gap: 9px; }
.map-controls .icon-button { width: 46px; height: 46px; flex-basis: 46px; padding: 0; border-radius: 50%; box-shadow: 0 2px 9px #172b431f; border-color: #e2e6e9; }
.map-controls .icon-button svg { width: 21px; height: 21px; }
#toggle-stations[aria-pressed=true] { color: var(--green); }
#toggle-stations[aria-pressed=false] { color: #8b939e; background: #f8f9fa; }
.zoom-controls { display: flex; flex-direction: column; gap: 1px; margin-top: 3px; border: 1px solid #e2e6e9; border-radius: 23px; overflow: hidden; background: var(--line); box-shadow: 0 2px 9px #172b431f; }
.zoom-controls .icon-button { border: 0; box-shadow: none; border-radius: 0; width: 44px; height: 44px; flex-basis: 44px; }
.map-pick-toolbar { position: absolute; top: 20px; left: var(--map-center); transform: translateX(-50%); z-index: 850; display: flex; gap: 4px; width: 270px; max-width: calc(100vw - 520px); padding: 5px; border: 1px solid #e5e8eb; border-radius: 15px; background: #fff; box-shadow: 0 3px 16px #1b243214; }
.map-target { display: flex; flex: 1; align-items: center; justify-content: center; gap: 7px; min-width: 0; min-height: 44px; padding: 7px 9px; border: 0; border-radius: 10px; background: #fff; color: #5c6571; font-size: 13px; font-weight: 600; }
.map-target:hover { background: #f3f6fb; }
.map-target[aria-pressed=true] { background: #eaf0ff; color: #235cca; }
.mini-letter { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex-shrink: 0; border-radius: 50%; background: var(--blue); color: #fff; font-size: 10px; font-weight: 750; }
.end-mini { background: #29313b; }
.map-instruction { position: absolute; z-index: 800; left: var(--map-center); bottom: 60px; transform: translateX(-50%); width: max-content; max-width: min(490px, calc(100vw - 460px)); padding: 11px 15px; border: 1px solid #e4e8ee; border-radius: 13px; background: #fffffff5; box-shadow: 0 3px 16px #1b243214; color: #566271; font-size: 13px; text-align: center; line-height: 1.55; pointer-events: none; }
.map-instruction.picking { color: #244b8d; background: #f8fafff5; border-color: #c8d8f4; }
.map-selection { position: absolute; z-index: 950; left: var(--map-center); bottom: 78px; transform: translateX(-50%); width: 430px; max-width: calc(100vw - 460px); max-height: calc(100dvh - 185px); overflow: auto; overscroll-behavior: contain; padding: 17px; border: 1px solid #dde3eb; border-radius: 16px; background: #fff; box-shadow: 0 7px 30px #172b4324; }
.map-selection strong { display: block; font-size: 15px; line-height: 1.45; }
.map-selection p { margin: 6px 0; color: #657181; font-size: 13px; line-height: 1.55; }
.map-selection .map-selection-help { margin: 6px 0 13px; color: #7a838f; font-size: 12px; }
.map-selection-actions { display: flex; gap: 8px; }
.map-selection-actions button { min-height: 46px; padding: 10px 15px; border: 1px solid var(--line); border-radius: 25px; background: #fff; color: #5c6571; font-size: 13px; font-weight: 650; }
.map-selection-actions button:first-child { flex: 1; border-color: #1b1e23; background: #1b1e23; color: #fff; }
.map-selection-actions button:first-child:hover { background: #333941; }
.map-wrap:has(.map-selection:not([hidden])) .map-instruction,
.map-wrap:has(.map-selection:not([hidden])) .map-calculate { display: none; }
.map-calculate { position: absolute; z-index: 850; bottom: 137px; left: var(--map-center); transform: translateX(-50%); min-height: 48px; padding: 12px 24px; border: 0; border-radius: 27px; background: #1b1e23; color: #fff; font-size: 14px; font-weight: 700; white-space: nowrap; box-shadow: 0 4px 16px #172b4329; }
.map-calculate:hover:not(:disabled) { background: #333941; }
.map-location-status, .map-route-status { position: absolute; z-index: 910; top: 87px; left: var(--map-center); transform: translateX(-50%); width: 370px; max-width: calc(100vw - 470px); padding: 11px 14px; margin: 0; border: 1px solid #d5e0f2; border-radius: 12px; background: #f8faff; box-shadow: 0 2px 12px #172b4314; font-size: 13px; }
.map-error { position: absolute; z-index: 960; top: 87px; left: var(--map-center); transform: translateX(-50%); width: 400px; max-width: calc(100vw - 470px); padding: 13px 15px; border: 1px solid #ebd4aa; border-radius: 12px; background: #fff6e4; color: #88642d; font-size: 14px; }
.map-catalog-chip { position: absolute; z-index: 800; bottom: 33px; right: 20px; display: flex; align-items: center; gap: 7px; max-width: 310px; padding: 6px 10px; border: 1px solid #e4e9e6; border-radius: 20px; background: #fffffff2; box-shadow: 0 1px 6px #1b24320a; color: #65716a; font-size: 11px; line-height: 1.5; }
.catalog-dot { flex: 0 0 7px; width: 7px; height: 7px; border-radius: 50%; background: #21a767; }
.map-credit { position: absolute; z-index: 800; left: calc(var(--panel-width) + 40px); bottom: 6px; max-width: calc(100vw - 520px); margin: 0; padding: 2px 5px; border-radius: 4px; background: #ffffffe8; color: #687381; font-size: 10px; line-height: 1.6; }
.map-credit a { text-decoration: none; }
.map-credit a:hover { text-decoration: underline; }

/* Route overview and its ordered stops share the planner card. */
.trip-heading { display: flex; align-items: center; gap: 10px; }
.trip-heading .icon-button { margin-left: -5px; border-color: transparent; }
.trip-heading .eyebrow { margin: 0 0 2px; font-size: 10px; }
.trip-heading h2 { font-size: 23px; line-height: 1.25; letter-spacing: -.6px; }
#trip-description { margin: 13px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
.empty-trip { padding: 38px 13px 27px; text-align: center; }
.empty-trip svg { width: 54px; height: 54px; margin-bottom: 18px; stroke-width: 1.1; color: #adb7c4; }
.empty-trip strong { display: block; font-size: 15px; font-weight: 650; color: #586270; }
.empty-trip p { margin: 9px 0 0; color: #7a8490; font-size: 13px; line-height: 1.7; }
.trip-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: 22px 0 14px; }
.trip-stats span { display: block; margin-bottom: 4px; color: #7b8490; font-size: 12px; }
.trip-stats strong { display: block; font-size: 26px; font-weight: 720; line-height: 1.25; letter-spacing: -.9px; }
.summary-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: #6a7481; font-size: 12px; }
.route-type-badge { padding: 3px 8px; border-radius: 6px; background: #eef2fa; color: #5272a5; font-size: 11px; }
.time-note { padding: 0 0 17px; margin: 10px 0 20px; border-bottom: 1px solid var(--line); font-size: 12px; line-height: 1.6; color: #78828d; }
.trip-timeline { list-style: none; margin: 0; padding: 0; }
.timeline-item { position: relative; display: flex; gap: 12px; padding-bottom: 23px; }
.timeline-item:not(:last-child)::before { content: ""; position: absolute; top: 25px; bottom: -2px; left: 11px; width: 2px; background: #dbe4f6; }
.timeline-dot { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex: 0 0 24px; width: 24px; height: 24px; margin-top: 1px; border: 1px solid #cad8f6; border-radius: 50%; background: #edf2fd; color: #3366c7; font-size: 11px; font-weight: 750; }
.timeline-dot.end { border-color: #d4dbe3; background: #eef1f5; color: #414f60; }
.timeline-text { min-width: 0; }
.timeline-text strong { display: block; font-size: 14px; line-height: 1.45; overflow-wrap: anywhere; }
.timeline-text small { display: block; margin-top: 4px; color: #7a8490; font-size: 12px; line-height: 1.6; }
.leg-summary { display: block; margin-top: 7px; color: #5d77a1; font-size: 12px; }
.result-footer { padding-top: 10px; margin-top: 3px; border-top: 1px solid var(--line); }
.result-footer .text-button { font-size: 13px; }
.result-footer .text-button svg { width: 17px; height: 17px; }
.result-footer p { margin: 0; color: #7c8590; font-size: 12px; line-height: 1.65; }
.route-source { margin: 13px 0 0; color: #87909a; font-size: 11px; line-height: 1.6; }
.snap-warning { padding: 12px; margin: 0 0 18px; border: 1px solid #ebd8b2; border-radius: 10px; background: #fff8e9; color: #83632b; font-size: 13px; line-height: 1.65; }
.nearby-stations { padding-top: 22px; margin-top: 22px; border-top: 1px solid var(--line); }
.nearby-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.nearby-heading .eyebrow { margin-bottom: 4px; font-size: 10px; }
.nearby-heading h2 { font-size: 17px; line-height: 1.3; }
.nearby-heading > span { max-width: 95px; color: #6d7f71; font-size: 11px; text-align: right; }
.nearby-count { margin: 12px 0; color: #6c7b70; font-size: 13px; }
.nearby-list { display: grid; gap: 8px; }
.candidate-card { display: flex; align-items: center; gap: 10px; padding: 11px; border: 1px solid #e0e8e3; border-radius: 11px; background: #fff; }
.candidate-text { min-width: 0; flex: 1; }
.candidate-text strong { display: block; font-size: 13px; line-height: 1.5; overflow-wrap: anywhere; }
.candidate-text > span, .candidate-text small { display: block; margin-top: 3px; color: #77847b; font-size: 11px; line-height: 1.6; }
.candidate-add { min-width: 44px; min-height: 44px; padding: 9px 10px; border: 1px solid #d1e2d7; border-radius: 9px; background: #f2f8f4; color: var(--green); font-size: 12px; font-weight: 650; white-space: nowrap; }
.candidate-add:hover:not(:disabled) { background: #e5f2e9; }
.nearby-more { width: 100%; min-height: 44px; margin-top: 11px; padding: 10px; border: 1px solid var(--line); border-radius: 9px; background: #fff; color: #627366; font-size: 13px; }
.nearby-note { margin: 13px 0 0; color: #7e8a82; font-size: 11px; line-height: 1.7; }

/* Leaflet controls, accessible markers, and station details. */
.leaflet-container { font: inherit; font-size: 13px; }
.leaflet-control-attribution { padding: 3px 6px !important; border-radius: 5px 0 0 0; background: #fffffff2 !important; color: #65707c !important; font-size: 10px !important; }
.leaflet-control-attribution a { color: #536a86 !important; }
.leaflet-control-zoom { overflow: hidden; border: 1px solid var(--line) !important; border-radius: 22px !important; box-shadow: 0 2px 10px #172b431f !important; }
.leaflet-control-zoom a { width: 44px !important; height: 44px !important; line-height: 44px !important; color: #2d3746 !important; }
.leaflet-popup-content-wrapper { border-radius: 14px; box-shadow: 0 5px 25px #172b4324; }
.leaflet-popup-content { margin: 17px; font-size: 13px; line-height: 1.6; }
.leaflet-container a.leaflet-popup-close-button { width: 44px; height: 44px; padding-top: 7px; font-size: 23px; color: #747e8a; }
.journey-marker { display: grid; place-items: center; background: transparent; border: 0; }
.journey-marker > span { display: flex; align-items: center; justify-content: center; width: 31px; height: 31px; border: 3px solid #fff; border-radius: 50%; background: var(--blue); color: #fff; box-shadow: 0 2px 9px #153d7245; font-size: 12px; font-weight: 750; }
.journey-marker.end > span { background: #29313c; }
.journey-marker.via > span { border-color: var(--green); background: #fff; color: var(--green); box-shadow: 0 0 0 3px #fff, 0 2px 9px #193d3626; }
.journey-marker.pending > span { width: 36px; height: 36px; border: 3px solid var(--blue); background: #fff; color: var(--blue); box-shadow: 0 0 0 5px #ffffffd9, 0 3px 12px #153d7245; }
.marker-popup { max-width: 245px; font-size: 14px; line-height: 1.6; }
.marker-popup small { display: block; margin-top: 5px; color: #7b8590; font-size: 12px; }
.free-point-actions { display: grid; gap: 8px; min-width: 190px; }
.free-point-actions strong { color: var(--ink); font-size: 15px; }
.free-point-actions small { color: #778290; font-size: 12px; }
.free-point-actions button { min-height: 44px; padding: 10px 12px; border: 1px solid #ccd9f0; border-radius: 9px; background: #edf3ff; color: #2e63c5; font-size: 13px; font-weight: 650; }
.free-point-actions button:last-child { border-color: #d7dde5; background: #f1f4f7; color: #44556c; }
.free-point-actions button:hover { filter: brightness(.97); }
.catalog-marker { display: grid; place-items: center; border: 1px solid #c9dfd1; border-radius: 50%; background: #fff; color: #198653; box-shadow: 0 1px 5px #174d3045; }
.catalog-marker svg { display: block; width: 17px; height: 17px; }
.catalog-cluster { display: grid; place-items: center; border: 3px solid #fff; border-radius: 50%; background: #e6f4eb; color: #167946; box-shadow: 0 1px 7px #174d303d; font-size: 12px; font-weight: 750; }
.catalog-cluster span, .catalog-cluster-count { display: block; line-height: 1; }
.catalog-marker:focus-visible, .catalog-cluster:focus-visible { outline: 3px solid var(--blue); outline-offset: 4px; }
.catalog-popup { min-width: 185px; color: var(--ink); }
.catalog-popup p { margin: 6px 0; }
.catalog-popup-brand { color: var(--green); font-size: 11px; font-weight: 700; }
.catalog-popup-title { display: block; padding-right: 24px; font-size: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.catalog-popup-address { color: #727e8a; font-size: 12px; }
.catalog-popup-meta { color: #557361; font-size: 12px; font-weight: 650; }
.catalog-popup-availability { color: #87908b; font-size: 11px; }
.catalog-popup-add { width: 100%; min-height: 44px; padding: 10px 12px; margin-top: 6px; border: 1px solid #d2e3d7; border-radius: 9px; background: #edf7f0; color: var(--green); font-size: 13px; font-weight: 650; }
.catalog-popup-add:hover { background: #dff0e5; }
.catalog-popup-list { display: grid; gap: 13px; margin: 13px 0; }
.catalog-popup-list > .catalog-popup { padding-bottom: 13px; border-bottom: 1px solid var(--line); }
.catalog-popup-pages { display: flex; align-items: center; justify-content: space-between; gap: 7px; }
.catalog-popup-pages button { min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 12px; }
.catalog-popup-count { color: #73808b; font-size: 11px; white-space: nowrap; }
.candidate-popup strong { display: block; font-size: 14px; }
.candidate-popup p { color: #6a7d70; font-size: 12px; }
.candidate-popup .candidate-add { width: 100%; }

/* Settings drawer and dialogs retain the existing vehicle/energy controls. */
.dialog { width: min(540px, calc(100vw - 32px)); max-height: calc(100dvh - 40px); margin: auto; padding: 30px; overflow: auto; overscroll-behavior: contain; border: 0; border-radius: 20px; color: var(--ink); background: #fff; box-shadow: 0 18px 70px #172b4333; }
.dialog::backdrop { background: #17202d70; backdrop-filter: blur(2px); }
.close-dialog { position: absolute; top: 12px; right: 12px; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #f2f4f6; color: #5e6874; font-size: 27px; font-weight: 300; line-height: 1; }
.close-dialog:hover { background: #e7ebef; }
.dialog h2 { margin: 0 30px 13px 0; font-size: 25px; letter-spacing: -.6px; line-height: 1.25; }
.dialog p { color: var(--muted); font-size: 14px; line-height: 1.7; }
.dialog .eyebrow { margin: 5px 0 9px; color: #7a8592; font-size: 11px; }
.settings-dialog { position: fixed; inset: 0 0 0 auto; width: 440px; max-width: 100vw; height: 100dvh; max-height: 100dvh; margin: 0; padding: 35px 27px 27px; border-radius: 20px 0 0 20px; }
.settings-dialog .settings-intro { margin: 0 0 27px; font-size: 14px; }
.settings-dialog #settings-done { margin-top: 18px; }
.picker-description { margin: 0 0 18px !important; font-size: 14px !important; }
.picker-search { display: flex; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid #dce2ea; border-radius: 11px; background: #f7f9fb; }
.picker-search svg { width: 20px; height: 20px; flex-shrink: 0; fill: none; stroke: #8190a1; stroke-width: 1.7; }
.picker-search input { min-width: 0; width: 100%; min-height: 49px; padding: 13px 0; border: 0; outline: none; background: none; font-size: 16px; }
.picker-search:focus-within { border-color: var(--blue); box-shadow: 0 0 0 2px #2868e81a; }
.picker-status { margin: 12px 0 8px !important; color: #7b8794 !important; font-size: 12px !important; }
.picker-results { display: grid; gap: 8px; }
.station-option { display: block; width: 100%; min-height: 76px; padding: 12px 13px; border: 1px solid var(--line); border-radius: 11px; background: #fff; text-align: left; }
.station-option:hover { border-color: #b7c9ea; background: #f5f8fd; }
.station-option strong { display: block; font-size: 14px; font-weight: 650; line-height: 1.5; }
.station-option small { display: block; margin-top: 3px; color: #7c8795; font-size: 12px; line-height: 1.5; }
.station-option .option-spec { margin-top: 6px; color: #5c7d68; font-size: 12px; }
.picker-location-options { display: grid; gap: 9px; margin: 0 0 23px; }
.picker-map-button { display: block; width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #d4ddea; border-radius: 11px; background: #edf3fe; color: #285fbc; font-size: 14px; font-weight: 650; }
.picker-location-options .picker-map-button { border-color: #1b1e23; background: #1b1e23; color: #fff; }
.picker-station-heading { margin: 18px 0 10px; font-size: 13px; font-weight: 650; color: #626e7e; }
.picker-source { margin: 13px 0 0 !important; color: #87929e !important; font-size: 12px !important; line-height: 1.6; }
.data-facts { margin: 23px 0; }
.data-facts > div { display: flex; justify-content: space-between; gap: 18px; padding: 11px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.data-facts dt { flex: 1; color: #7a8694; }
.data-facts dd { flex: 1.2; margin: 0; text-align: right; font-weight: 600; }
.dialog .about-small { font-size: 13px; }
.source-links { display: flex; flex-wrap: wrap; gap: 13px; margin-top: 21px; color: var(--blue); font-size: 13px; }
.source-links a { display: inline-flex; align-items: center; min-height: 44px; }
#vehicle-profile.yv-vehicle { margin-bottom: 23px; padding-bottom: 23px; border-color: var(--line); color: var(--ink); }
#vehicle-profile .yv-vehicle-badge { background: #f0f3f6; color: #637080; }
#vehicle-profile .yv-vehicle-select { min-height: 48px; padding-left: 12px; border-color: #d5dce5; border-radius: 10px; color: var(--ink); font-size: 15px; }
#vehicle-profile .yv-vehicle-select:focus-visible, #vehicle-profile summary:focus-visible, #vehicle-profile a:focus-visible { outline-color: var(--blue); }
#vehicle-profile .yv-vehicle-status, #vehicle-profile .yv-vehicle-hint { color: #707c8b; font-size: 13px; }
#vehicle-profile .yv-vehicle-status-error { color: #946326; }
#vehicle-profile .yv-vehicle-name strong { font-size: 15px; }
#vehicle-profile .yv-vehicle-name span { color: #6b7888; }
#vehicle-profile .yv-vehicle-details > summary { display: list-item; min-height: 44px; padding: 12px 0; color: #426da8; font-size: 13px; }
#vehicle-profile .yv-vehicle-details > summary::marker { color: #426da8; }
#vehicle-profile .yv-vehicle-details-body { border-color: #e1e6ed; background: #f7f9fb; border-radius: 10px; }
#vehicle-profile .yv-vehicle-spec dt, #vehicle-profile .yv-vehicle-note, #vehicle-profile .yv-vehicle-date { color: #718092; }
#vehicle-profile .yv-vehicle-spec dd { color: #34465c; }
#vehicle-profile .yv-vehicle-date { border-color: #dfe6ef; }
#vehicle-profile .yv-vehicle-sources a { padding: 8px 0; color: #3a6eb7; }
.energy-settings { margin-bottom: 18px; padding: 14px; border-color: #dfe5ed; border-radius: 12px; background: #f9fafc; }
.energy-settings summary { min-height: 44px; color: #394d67; font-size: 14px; }
.energy-settings summary > span { color: #8791a0; font-size: 11px; }
.dialog .energy-explainer, .dialog .energy-input-note { color: #778395; font-size: 13px; }
.energy-toggle { min-height: 44px; color: #435873; font-size: 13px; }
.energy-toggle input { accent-color: var(--blue); width: 19px; height: 19px; }
.energy-settings fieldset label { color: #566880; font-size: 13px; }
.energy-settings fieldset label > span { color: #8894a4; }
.energy-settings fieldset input { min-height: 46px; border-color: #d7dfe9; border-radius: 9px; font-size: 15px; }
.energy-settings fieldset input::placeholder { color: #96a1b0; font-size: 12px; }
.energy-result { margin-top: 21px; padding-top: 18px; border-color: var(--line); }
.energy-eyebrow { color: #637d9e; font-size: 10px; }
.energy-result h3 { font-size: 18px; }
.energy-verdict { background: #edf6f0; color: #477055; font-size: 13px; }
.energy-verdict.missed, .energy-alert { background: #fff4e7; color: #91662e; font-size: 13px; }
.energy-stats span { color: #7a899a; font-size: 12px; }
.energy-stats strong { font-size: 24px; }
.energy-added, .energy-scope { color: #7e8a99; font-size: 12px; }
.energy-legs strong { font-size: 13px; }
.energy-legs span, .energy-legs small { font-size: 12px; }
.energy-scope { border-color: var(--line); }
.mobile-nav { display: none; }
.noscript { position: fixed; z-index: 5000; bottom: 20px; left: 20px; right: 20px; padding: 18px; border: 1px solid #ddca95; border-radius: 10px; background: #fff4df; }

@media (min-width: 761px) and (max-height: 700px) {
  .site-header { min-height: 60px; padding-top: 5px; padding-bottom: 5px; }
  .panel-heading { margin-bottom: 13px; }
  .panel-heading h1 { font-size: 23px; }
  .planner-panel, .trip-panel { padding-top: 15px; }
  .intro { font-size: 12px; }
  .planner-footer { min-height: 45px; }
}
@media (min-width: 761px) and (max-width: 1100px) {
  .map-catalog-chip { display: none; }
  .map-credit { max-width: calc(100vw - 440px); bottom: 23px; }
  .map-target { gap: 5px; padding-right: 6px; padding-left: 6px; font-size: 12px; }
}

/* The same planner becomes a bottom sheet without ever unmounting the map. */
@media (max-width: 760px) {
  :root {
    --sheet-height: 48dvh;
    --sheet-bottom: calc(72px + env(safe-area-inset-bottom));
    --map-center: 50%;
  }
  body[data-panel="plan"] { --sheet-height: max(54dvh, min(400px, 62dvh)); }
  body.sheet-expanded { --sheet-height: 76dvh; }
  body.map-focused { --sheet-height: 56px; }
  .planner-shell {
    top: auto; left: 10px; right: 10px; bottom: var(--sheet-bottom);
    width: auto; height: var(--sheet-height); max-height: 76dvh;
    border-radius: 23px; border-color: #dfe4e8;
    box-shadow: 0 -3px 24px #172b4317, 0 3px 13px #172b4312;
  }
  .site-header {
    position: fixed; top: calc(12px + env(safe-area-inset-top)); left: 12px; right: 73px;
    min-height: 46px; height: 46px; padding: 0 7px 0 11px; gap: 4px;
    border: 1px solid #e3e7eb; border-radius: 14px; background: #fffffff7;
    box-shadow: 0 2px 10px #172b4319;
  }
  .brand { font-size: 24px; letter-spacing: -1.1px; gap: 1px; }
  .brand svg { width: 23px; height: 27px; }
  .header-actions { gap: 0; }
  .header-actions .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .header-actions .icon-button svg { width: 19px; height: 19px; }
  .sheet-toggle { display: flex; align-items: center; justify-content: center; flex: 0 0 36px; width: 100%; min-height: 44px; margin: 0; padding: 0; border: 0; border-radius: 23px 23px 0 0; touch-action: none; user-select: none; background: transparent; }
  .sheet-handle { display: block; width: 39px; height: 4px; border-radius: 5px; background: #cdd3d9; }
  .sheet-toggle:hover .sheet-handle { background: #aeb8c4; }
  .sheet-toggle:focus-visible { outline-offset: -5px; }
  .planner-content { flex: 1; border-radius: 0 0 23px 23px; }
  .shell-tabs { margin: 0 16px; padding-bottom: 7px; }
  .shell-tabs button { min-height: 44px; font-size: 13px; }
  .planner-panel, .trip-panel { padding: 13px 16px 20px; }
  .panel-heading { display: none; }
  .vehicle-summary { min-height: 55px; margin-bottom: 10px; padding: 7px 11px; }
  .vehicle-summary .vehicle-icon { width: 27px; height: 27px; }
  .vehicle-summary-text strong { font-size: 14px; }
  .vehicle-summary-text small { font-size: 12px; }
  .place-button { min-height: 58px; padding-top: 7px; padding-bottom: 7px; }
  .place-text strong { font-size: 14px; }
  .place-text small { font-size: 12px; }
  .location-actions { margin-bottom: 13px; }
  .location-actions .locate-button { font-size: 13px; }
  .planner-actions { gap: 6px; padding: 9px 16px 10px; }
  .planner-actions .primary-button { min-height: 46px; padding-top: 10px; padding-bottom: 10px; }
  .planner-actions .form-status { font-size: 11px; line-height: 1.5; }
  .planner-footer { display: none; }
  .primary-button { min-height: 49px; font-size: 15px; }
  .form-status { font-size: 13px; }
  .planner-footnote { font-size: 12px; }
  .map-focused .planner-content { display: none; }
  .map-focused .sheet-toggle { flex: 1; min-height: 54px; border-radius: 23px; }
  .map-focused .sheet-handle { width: 43px; height: 5px; background: #b3bdc8; }
  .map-controls { top: calc(12px + env(safe-area-inset-top)); right: 12px; gap: 8px; }
  .map-controls .icon-button { width: 44px; height: 44px; flex-basis: 44px; }
  .zoom-controls { margin-top: 2px; }
  .zoom-controls .icon-button { width: 44px; }
  .map-pick-toolbar { top: calc(72px + env(safe-area-inset-top)); left: 12px; right: 73px; width: auto; max-width: 320px; padding: 4px; transform: none; gap: 3px; border-radius: 13px; }
  .map-target { min-height: 44px; gap: 6px; padding: 8px 6px; font-size: 12px; }
  .map-instruction { display: none; top: calc(70px + env(safe-area-inset-top)); bottom: auto; left: 12px; right: 73px; width: auto; max-width: 320px; padding: 9px 12px; border-radius: 11px; transform: none; font-size: 12px; line-height: 1.5; text-align: left; }
  .map-focused .map-instruction { display: block; }
  .map-focused .map-pick-toolbar { top: calc(160px + env(safe-area-inset-top)); }
  .map-wrap:has(.map-selection:not([hidden])) .map-instruction { display: none; }
  .map-focused .map-wrap:has(.map-selection:not([hidden])) .map-pick-toolbar { top: calc(72px + env(safe-area-inset-top)); }
  .sheet-expanded:not(.map-focused) .map-pick-toolbar { display: none; }
  .sheet-expanded:not(.map-focused) .map-controls > :not(#toggle-stations) { display: none; }
  .map-selection { bottom: calc(158px + env(safe-area-inset-bottom)); left: 12px; right: 12px; width: auto; max-width: none; max-height: calc(100dvh - 320px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 14px; border-radius: 17px; transform: none; }
  .map-selection strong { font-size: 14px; }
  .map-selection p { font-size: 12px; }
  .map-selection .map-selection-help { font-size: 12px; }
  .map-selection-actions button { min-height: 46px; padding: 10px 12px; font-size: 13px; }
  .map-calculate { bottom: calc(164px + env(safe-area-inset-bottom)); max-width: calc(100vw - 40px); min-height: 49px; }
  .map-location-status, .map-route-status { top: calc(132px + env(safe-area-inset-top)); left: 12px; right: 73px; width: auto; max-width: 320px; transform: none; font-size: 12px; }
  .map-focused .map-location-status, .map-focused .map-route-status { top: calc(221px + env(safe-area-inset-top)); }
  .map-error { top: calc(132px + env(safe-area-inset-top)); left: 12px; right: 73px; width: auto; max-width: 320px; padding: 10px 12px; transform: none; font-size: 12px; }
  .map-focused .map-error { top: calc(221px + env(safe-area-inset-top)); }
  .map-catalog-chip { display: none; }
  .map-credit { left: auto; right: 12px; bottom: calc(var(--sheet-height) + var(--sheet-bottom) + 25px); max-width: calc(100vw - 24px); padding: 1px 5px; font-size: 9px; text-align: right; }
  .leaflet-bottom.leaflet-right { right: 12px; bottom: calc(var(--sheet-height) + var(--sheet-bottom) + 5px); }
  .leaflet-control-attribution { border-radius: 5px; font-size: 9px !important; }
  .trip-heading h2 { font-size: 22px; }
  .trip-heading .eyebrow { font-size: 10px; }
  .trip-stats { padding-top: 18px; }
  .trip-stats strong { font-size: 26px; }
  .empty-trip { padding: 24px 12px; }
  .empty-trip svg { width: 45px; height: 45px; margin-bottom: 10px; }
  .candidate-card { padding: 10px; }
  .candidate-add { font-size: 12px; }
  .mobile-nav { position: fixed; z-index: 1100; bottom: 0; left: 0; right: 0; display: flex; align-items: center; justify-content: space-around; height: calc(64px + env(safe-area-inset-bottom)); padding: 3px 8px calc(3px + env(safe-area-inset-bottom)); border-top: 1px solid #e2e7ed; background: #fffffff7; backdrop-filter: blur(10px); box-shadow: 0 -1px 8px #172b4305; }
  .mobile-nav button, .mobile-nav a { display: flex; flex: 1; flex-direction: column; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 54px; padding: 5px 3px; border: 0; border-radius: 11px; background: transparent; color: #939ca7; text-decoration: none; font-size: 11px; font-weight: 600; }
  .mobile-nav .active { color: var(--ink); }
  .mobile-nav .active svg { stroke-width: 2.1; }
  .mobile-nav svg { width: 21px; height: 21px; }
  .dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 32px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); padding: 28px 21px 24px; border-radius: 19px; }
  .dialog h2 { font-size: 24px; }
  .settings-dialog { inset: auto 0 0; width: 100%; max-width: none; height: auto; max-height: calc(90dvh - env(safe-area-inset-top)); margin: 0; padding: 32px 23px calc(25px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; }
  .settings-dialog .settings-intro { margin-bottom: 24px; }
  #vehicle-profile .yv-vehicle-select, .energy-settings fieldset input { font-size: 16px; }
  .data-facts > div { gap: 14px; font-size: 12px; }
  .station-option strong { font-size: 14px; }
  .station-option small { font-size: 12px; }
  .noscript { bottom: calc(84px + env(safe-area-inset-bottom)); left: 12px; right: 12px; font-size: 14px; }
}
@media (max-width: 360px) {
  .site-header { padding-left: 8px; padding-right: 3px; }
  .brand { font-size: 21px; }
  .brand svg { width: 21px; }
  .header-actions .icon-button { width: 44px; flex-basis: 44px; }
  .planner-panel, .trip-panel { padding-left: 13px; padding-right: 13px; }
  .map-target { gap: 4px; font-size: 11px; }
  .trip-stats strong { font-size: 23px; }
}
@media (max-width: 760px) and (max-height: 640px) {
  .zoom-controls { display: none; }
  body[data-panel="plan"]:not(.map-focused) .map-pick-toolbar { display: none; }
  .map-instruction { font-size: 11px; padding-top: 7px; padding-bottom: 7px; }
  .map-focused .map-pick-toolbar { top: calc(150px + env(safe-area-inset-top)); }
  .map-selection { max-height: calc(100dvh - 285px); padding: 11px; }
  .map-selection .map-selection-help { display: none; }
  .map-selection p { margin: 5px 0 8px; }
  .map-focused .sheet-toggle { min-height: 54px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
