:root {
  --ink: #102a43;
  --ink-soft: #486581;
  --muted: #829ab1;
  --line: #d9e2ec;
  --surface: #ffffff;
  --canvas: #edf4f5;
  --mint: #2bc48a;
  --mint-dark: #12805b;
  --amber: #f5a524;
  --red: #e55353;
  --shadow: 0 18px 45px rgba(16, 42, 67, 0.1);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f6f9fb;
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: #f6f9fb; }
button, input, select { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 32px; background: var(--surface); border-bottom: 1px solid var(--line); }
.brand-lockup, .topbar-actions, .section-heading, .results-heading, .map-toolbar, .map-toolbar-actions, .trip-banner, .battery-control, .toggle-row { display: flex; align-items: center; }
.brand-lockup { gap: 12px; }
.brand-mark { width: 40px; height: 40px; display: grid; place-items: center; color: #fff; background: var(--ink); border-radius: 13px; font-size: 21px; box-shadow: 0 6px 15px rgba(16, 42, 67, .2); }
.brand-name { font-size: 20px; font-weight: 800; letter-spacing: -.04em; }
.brand-tagline { color: var(--muted); font-size: 11px; margin-top: 1px; }
.topbar-actions { gap: 16px; }
.beta-pill { color: var(--mint-dark); background: #e8faf3; border: 1px solid #c5f0df; border-radius: 999px; padding: 7px 11px; font-size: 12px; font-weight: 700; }
.status-dot { width: 7px; height: 7px; display: inline-block; margin-right: 6px; border-radius: 50%; background: var(--mint); }
.status-dot.amber { background: var(--amber); }
.icon-button { border: 0; color: var(--ink-soft); background: transparent; width: 32px; height: 32px; border-radius: 10px; font-size: 19px; }
.icon-button:hover { background: #eef4f7; }

.workspace { display: grid; grid-template-columns: 410px minmax(0, 1fr); min-height: calc(100vh - 76px); }
.sidebar { padding: 30px 26px 22px; overflow: auto; background: var(--surface); border-right: 1px solid var(--line); }
.sidebar-intro { margin-bottom: 22px; }
.eyebrow { margin: 0 0 7px; color: var(--mint-dark); font-size: 10px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; }
h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: 29px; line-height: 1.08; letter-spacing: -.045em; }
h2 { margin-bottom: 0; font-size: 16px; letter-spacing: -.02em; }
.muted { color: var(--ink-soft); line-height: 1.5; }
.small { font-size: 12px; }
.sidebar-intro .muted { margin-bottom: 0; font-size: 13px; }
.search-box { display: flex; align-items: center; gap: 10px; padding: 0 14px; margin-bottom: 17px; color: var(--muted); border: 1px solid var(--line); border-radius: 12px; background: #fbfdfe; }
.search-box span { font-size: 24px; line-height: 1; transform: translateY(-1px); }
.search-box input { width: 100%; height: 45px; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 13px; }
.search-box:focus-within { border-color: #83dec0; box-shadow: 0 0 0 3px #e3f8f1; }
.control-card { padding: 18px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 16px; background: #fbfdfe; }
.section-heading { justify-content: space-between; margin-bottom: 18px; }
.text-button { padding: 0; border: 0; color: var(--mint-dark); background: transparent; font-size: 12px; font-weight: 800; }
.text-button:hover { color: var(--ink); }
.battery-control { gap: 12px; margin-bottom: 13px; }
.battery-icon { width: 34px; height: 19px; padding: 3px; position: relative; border: 2px solid var(--ink); border-radius: 5px; }
.battery-icon::after { content: ""; position: absolute; right: -5px; top: 5px; width: 3px; height: 6px; background: var(--ink); border-radius: 0 2px 2px 0; }
.battery-icon span { display: block; height: 100%; width: 18%; border-radius: 2px; background: var(--mint); transition: width .2s ease; }
.battery-copy { font-size: 14px; }
.battery-copy strong { font-size: 21px; letter-spacing: -.04em; }
.range-slider { width: 100%; margin: 4px 0 18px; accent-color: var(--mint); }
.field-label { display: block; margin-bottom: 7px; color: var(--ink-soft); font-size: 11px; font-weight: 800; }
.select-control { width: 100%; height: 39px; padding: 0 10px; color: var(--ink); border: 1px solid var(--line); border-radius: 9px; background: #fff; outline: none; font-size: 12px; }
.toggle-row { justify-content: space-between; gap: 12px; margin-top: 17px; }
.toggle-row strong, .toggle-row small { display: block; }
.toggle-row strong { font-size: 12px; }
.toggle-row small { margin-top: 3px; color: var(--muted); font-size: 11px; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle { width: 38px; height: 22px; position: relative; flex: 0 0 auto; border-radius: 99px; background: #bcccdc; transition: background .2s; }
.toggle::after { content: ""; width: 16px; height: 16px; position: absolute; left: 3px; top: 3px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(16,42,67,.22); transition: transform .2s; }
.toggle-row input:checked + .toggle { background: var(--mint); }
.toggle-row input:checked + .toggle::after { transform: translateX(16px); }
.results-heading { justify-content: space-between; margin-bottom: 12px; }
.location-button { padding: 7px 9px; color: var(--ink-soft); border: 1px solid var(--line); border-radius: 8px; background: #fff; font-size: 11px; font-weight: 700; }
.location-button:hover { border-color: #8bdabe; color: var(--mint-dark); }
.charger-list { display: grid; gap: 10px; }
.charger-card { padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; transition: border-color .2s, box-shadow .2s, transform .2s; }
.charger-card:hover, .charger-card.active { border-color: #83dec0; box-shadow: 0 8px 22px rgba(16, 42, 67, .08); transform: translateY(-1px); }
.card-topline, .card-meta, .card-bottomline { display: flex; align-items: center; justify-content: space-between; gap: 9px; }
.operator { color: var(--ink-soft); font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; }
.availability { display: inline-flex; align-items: center; gap: 5px; font-size: 10px; font-weight: 800; }
.availability .status-dot { margin: 0; }
.available { color: var(--mint-dark); }
.busy { color: #ad6b00; }
.unknown { color: var(--muted); }
.charger-card h3 { margin: 8px 0 5px; font-size: 14px; letter-spacing: -.02em; }
.charger-address { margin-bottom: 12px; color: var(--ink-soft); font-size: 11px; }
.card-meta { justify-content: flex-start; flex-wrap: wrap; color: var(--ink-soft); font-size: 10px; }
.meta-chip { padding: 5px 7px; border-radius: 6px; background: #f1f5f8; }
.card-bottomline { margin-top: 12px; color: var(--muted); font-size: 10px; }
.card-action { padding: 0; border: 0; color: var(--mint-dark); background: transparent; font-size: 11px; font-weight: 800; }
.emergency-card { display: grid; grid-template-columns: auto 1fr; gap: 11px; padding: 15px; margin-top: 22px; border: 1px solid #ffd6d6; border-radius: 14px; background: #fff7f7; }
.emergency-icon { width: 26px; height: 26px; display: grid; place-items: center; color: #fff; border-radius: 50%; background: var(--red); font-weight: 900; }
.emergency-card strong { font-size: 12px; }
.emergency-card p { margin: 4px 0 12px; color: #8d4b4b; font-size: 11px; line-height: 1.35; }
.emergency-button { grid-column: 1 / -1; height: 34px; color: #fff; border: 0; border-radius: 8px; background: var(--red); font-size: 12px; font-weight: 800; }
.emergency-button:hover { background: #c93d3d; }
.data-note { margin: 17px 2px 0; color: var(--muted); font-size: 10px; line-height: 1.5; }

.map-workspace { min-width: 0; padding: 26px 30px 30px; background: #f6f9fb; }
.map-toolbar { justify-content: space-between; gap: 20px; margin-bottom: 18px; }
.map-toolbar-actions { gap: 9px; }
.outline-button, .primary-button { height: 38px; padding: 0 13px; border-radius: 9px; font-size: 12px; font-weight: 800; }
.outline-button { color: var(--ink-soft); border: 1px solid var(--line); background: #fff; }
.primary-button { color: #fff; border: 1px solid var(--ink); background: var(--ink); box-shadow: 0 6px 16px rgba(16,42,67,.18); }
.outline-button:hover { border-color: #9bb4c5; }
.primary-button:hover { background: #1b405f; }
.map-canvas { height: calc(100vh - 226px); min-height: 530px; position: relative; overflow: hidden; border: 1px solid #cedce0; border-radius: 23px; background: #dcebed; box-shadow: var(--shadow); }
.real-map { width: 100%; height: 100%; position: relative; overflow: hidden; z-index: 1; background: #dcebed; }
.map-tiles, .map-markers { position: absolute; inset: 0; }
.map-tiles { z-index: 1; }
.map-tile { width: 256px; height: 256px; position: absolute; max-width: none; user-select: none; }
.map-markers { z-index: 2; pointer-events: none; }
.custom-map-marker { width: 32px; height: 32px; position: absolute; display: grid; place-items: center; margin: -31px 0 0 -16px; color: #fff; border: 3px solid #fff; border-radius: 50% 50% 50% 4px; background: var(--mint); box-shadow: 0 5px 14px rgba(16,42,67,.28); transform: rotate(-45deg); pointer-events: auto; }
.custom-map-marker span { transform: rotate(45deg); font-size: 14px; }
.custom-map-marker.busy { background: var(--amber); }
.custom-map-marker.unknown { background: #829ab1; }
.custom-map-marker.active { box-shadow: 0 0 0 5px rgba(43,196,138,.22), 0 7px 16px rgba(16,42,67,.25); }
.custom-user-marker { width: 22px; height: 22px; position: absolute; margin: -11px 0 0 -11px; border: 3px solid #fff; border-radius: 50%; background: #3867f2; box-shadow: 0 0 0 7px rgba(56,103,242,.2); }
.custom-user-marker span { width: 6px; height: 6px; display: block; margin: 5px auto; border-radius: 50%; background: #fff; }
.map-controls { position: absolute; top: 14px; right: 14px; display: grid; overflow: hidden; border: 1px solid #cdd8df; border-radius: 8px; background: #fff; box-shadow: 0 4px 12px rgba(16,42,67,.14); z-index: 3; }
.map-controls button { width: 32px; height: 31px; color: var(--ink); border: 0; border-bottom: 1px solid var(--line); background: #fff; font-size: 20px; line-height: 1; }
.map-controls button:last-child { border-bottom: 0; }
.map-controls button:hover { background: #f1f6f8; }
.map-attribution { position: absolute; right: 7px; bottom: 4px; padding: 2px 4px; color: #607586; background: rgba(255,255,255,.78); font-size: 9px; z-index: 3; }
.map-attribution a { color: #486581; }
.map-route { position: absolute; height: 4px; border-radius: 99px; background: rgba(255,255,255,.96); box-shadow: 0 0 0 1px rgba(141, 184, 190, .3); transform-origin: left center; }
.route-one { left: 13%; top: 68%; width: 70%; transform: rotate(-24deg); }
.route-two { left: 21%; top: 23%; width: 75%; transform: rotate(21deg); }
.route-three { left: 8%; top: 49%; width: 72%; transform: rotate(58deg); }
.map-label { position: absolute; color: rgba(16,42,67,.45); font-size: 13px; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.label-caba { right: 30%; top: 42%; color: rgba(16,42,67,.65); font-size: 18px; }
.label-norte { left: 56%; top: 15%; }
.label-oeste { left: 17%; top: 34%; }
.label-sur { left: 24%; bottom: 13%; }
.map-road { position: absolute; padding: 3px 6px; color: rgba(16,42,67,.44); border-radius: 4px; background: rgba(255,255,255,.58); font-size: 9px; font-weight: 700; }
.road-panamericana { left: 49%; top: 23%; transform: rotate(22deg); }
.road-general-paz { right: 35%; top: 51%; transform: rotate(-24deg); }
.charger-marker { width: 32px; height: 32px; position: absolute; display: grid; place-items: center; color: #fff; border: 3px solid #fff; border-radius: 50% 50% 50% 4px; background: var(--mint); box-shadow: 0 5px 14px rgba(16,42,67,.24); transform: rotate(-45deg); transition: transform .2s, background .2s; z-index: 3; }
.charger-marker span { transform: rotate(45deg); font-size: 14px; }
.charger-marker:hover, .charger-marker.active { transform: rotate(-45deg) scale(1.17); }
.charger-marker.busy { background: var(--amber); }
.charger-marker.unknown { background: #829ab1; }
.charger-marker.active { box-shadow: 0 0 0 5px rgba(43,196,138,.2), 0 7px 16px rgba(16,42,67,.24); }
.user-marker { width: 22px; height: 22px; position: absolute; z-index: 4; border: 3px solid #fff; border-radius: 50%; background: #3867f2; box-shadow: 0 0 0 7px rgba(56,103,242,.2); }
.user-marker span { width: 6px; height: 6px; display: block; margin: 5px auto; border-radius: 50%; background: #fff; }
.hidden { display: none !important; }
.map-legend { position: absolute; left: 18px; bottom: 18px; display: flex; gap: 13px; padding: 9px 11px; border: 1px solid rgba(255,255,255,.8); border-radius: 9px; background: rgba(255,255,255,.92); color: var(--ink-soft); font-size: 10px; font-weight: 700; z-index: 4; }
.legend-dot { width: 7px; height: 7px; display: inline-block; margin-right: 3px; border-radius: 50%; }
.legend-dot.green { background: var(--mint); }
.legend-dot.orange { background: var(--amber); }
.legend-dot.gray { background: #829ab1; }
.map-disclaimer { position: absolute; right: 15px; bottom: 13px; color: rgba(16,42,67,.44); font-size: 9px; z-index: 4; }
.trip-banner { gap: 12px; padding: 14px 17px; margin-top: 16px; border: 1px solid #ccebe1; border-radius: 14px; background: #edfbf7; }
.trip-icon { width: 31px; height: 31px; display: grid; place-items: center; color: var(--mint-dark); border-radius: 9px; background: #d0f6e8; font-size: 20px; }
.trip-copy { flex: 1; }
.trip-copy strong, .trip-copy span { display: block; }
.trip-copy strong { font-size: 12px; }
.trip-copy span { margin-top: 3px; color: var(--ink-soft); font-size: 11px; }

.modal-backdrop { position: fixed; inset: 0; display: grid; place-items: center; padding: 20px; background: rgba(16,42,67,.37); z-index: 10; }
.detail-modal { width: min(460px, 100%); position: relative; padding: 25px; border-radius: 19px; background: #fff; box-shadow: 0 25px 70px rgba(16,42,67,.25); }
.modal-close { width: 30px; height: 30px; position: absolute; top: 15px; right: 15px; border: 0; border-radius: 8px; color: var(--ink-soft); background: #f2f6f8; font-size: 20px; line-height: 1; }
.detail-kicker { color: var(--mint-dark); font-size: 10px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.detail-modal h2 { margin: 7px 38px 6px 0; font-size: 23px; letter-spacing: -.04em; }
.detail-address { margin-bottom: 17px; color: var(--ink-soft); font-size: 12px; }
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 17px; }
.detail-stat { padding: 11px; border-radius: 10px; background: #f5f8fa; }
.detail-stat span, .detail-stat strong { display: block; }
.detail-stat span { margin-bottom: 4px; color: var(--muted); font-size: 10px; }
.detail-stat strong { font-size: 13px; }
.detail-source { padding: 10px; margin-bottom: 17px; border-left: 3px solid var(--mint); color: var(--ink-soft); background: #f2fbf7; font-size: 11px; line-height: 1.45; }
.detail-actions { display: flex; gap: 9px; }
.detail-actions button { flex: 1; height: 40px; border-radius: 9px; font-size: 12px; font-weight: 800; }
.detail-actions .navigate { color: #fff; border: 0; background: var(--ink); }
.detail-actions .report { color: var(--mint-dark); border: 1px solid #a9e9d2; background: #f2fcf8; }
.detail-actions .report:hover { background: #e2f9f0; }
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 20; padding: 11px 15px; color: #fff; border-radius: 9px; background: var(--ink); box-shadow: var(--shadow); font-size: 12px; opacity: 0; transform: translate(-50%, 15px); pointer-events: none; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 980px) {
  .workspace { grid-template-columns: 360px minmax(0, 1fr); }
  .sidebar { padding-left: 18px; padding-right: 18px; }
  .map-workspace { padding: 20px; }
  .map-canvas { min-height: 500px; }
}

@media (max-width: 760px) {
  .topbar { height: 67px; padding: 0 16px; }
  .brand-mark { width: 35px; height: 35px; font-size: 18px; }
  .brand-name { font-size: 18px; }
  .beta-pill { padding: 6px 8px; font-size: 10px; }
  .workspace { display: block; }
  .sidebar { overflow: visible; border-right: 0; }
  .map-workspace { padding: 0 16px 28px; }
  .map-toolbar { padding-top: 4px; }
  .map-toolbar h2 { font-size: 14px; }
  .map-toolbar-actions .outline-button { display: none; }
  .map-canvas { height: 56vh; min-height: 390px; border-radius: 18px; }
  .map-legend { left: 10px; bottom: 10px; gap: 8px; font-size: 9px; }
  .map-disclaimer { display: none; }
  .trip-banner { margin-bottom: 4px; }
}
