:root {
  color-scheme: light;
  --navy-950: #071c30;
  --navy-900: #0a243e;
  --navy-800: #103b5f;
  --navy-700: #15537f;
  --blue-100: #eaf3f8;
  --orange: #f68b1f;
  --orange-dark: #d66c08;
  --ink: #163247;
  --muted: #647b8c;
  --line: #d7e1e8;
  --surface: #ffffff;
  --danger: #b42318;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
}

.activation-button { width: 100%; min-height: 48px; }
#activationCode { font-size: 26px; letter-spacing: .14em; text-align: center; }
.activation-hint { color: var(--muted); font-size: 13px; }
#previewDiagnostics[hidden] { display: none !important; }
.preview-diagnostics { border-top: 1px solid var(--line); margin-top: 18px; padding-top: 12px; }
.preview-diagnostics summary { cursor: pointer; color: var(--navy-700); font-size: 12px; font-weight: 800; }
.preview-diagnostics-grid { display: grid; gap: 8px; grid-template-columns: 1fr 1fr; margin: 12px 0 0; }
.preview-diagnostics-grid > div { background: #f3f7fa; border-radius: 9px; min-width: 0; padding: 8px 9px; }
.preview-diagnostics-grid dt { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.preview-diagnostics-grid dd { color: var(--ink); font-size: 12px; font-weight: 700; margin: 2px 0 0; overflow-wrap: anywhere; }
.preview-diagnostics p { color: var(--muted); font-size: 10px; margin: 9px 0 0; }
.technical-access { border-top: 1px solid var(--line); margin-top: 20px; padding-top: 12px; }
.technical-access summary { cursor: pointer; color: var(--muted); font-size: 12px; margin-bottom: 12px; }

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  overflow: hidden;
  background: var(--navy-900);
  color: var(--ink);
  font: 14px/1.35 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-tap-highlight-color: transparent;
}
button, input { font: inherit; }
button { touch-action: manipulation; }
a { color: var(--navy-700); }

.app-shell {
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  height: 100dvh;
  min-height: 100vh;
  width: 100vw;
  background: var(--surface);
}

.topbar {
  align-items: center;
  background: linear-gradient(135deg, var(--navy-950), var(--navy-800));
  color: #fff;
  display: flex;
  justify-content: space-between;
  min-height: calc(62px + var(--safe-top));
  padding: calc(9px + var(--safe-top)) 12px 9px;
  z-index: 1000;
}
.brand-block { align-items: center; display: flex; gap: 10px; min-width: 0; }
.brand-block > div { min-width: 0; }
.brand-block strong { display: block; font-size: 16px; letter-spacing: .1px; white-space: nowrap; }
.brand-block span { color: #c6d8e6; display: block; font-size: 11px; max-width: 56vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-icon { border-radius: 11px; height: 42px; width: 42px; }
.top-actions { align-items: center; display: flex; gap: 7px; }
.icon-button {
  align-items: center;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 11px;
  color: #fff;
  cursor: pointer;
  display: inline-flex;
  font-size: 20px;
  height: 40px;
  justify-content: center;
  min-width: 40px;
  padding: 0 10px;
}
.install-button { font-size: 12px; font-weight: 700; }
.icon-button:active { transform: translateY(1px); }

.toolbar {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 9px 10px;
  scrollbar-width: none;
  z-index: 900;
}
.toolbar::-webkit-scrollbar { display: none; }
.toolbar { flex-wrap: wrap; align-items: center; }
.fuel-choice { display: flex; gap: 6px; flex: 0 0 auto; }
.fuel-choice-button { border: 2px solid var(--line); border-radius: 11px; background: #fff; color: var(--navy-800); padding: 0 16px; min-height: 46px; cursor: pointer; font-weight: 800; }
.fuel-choice-button[aria-pressed="true"] { background: var(--navy-800); border-color: var(--navy-800); color: #fff; }
.fuel-choice-lng[aria-pressed="true"] { background: #6f42c1; border-color: #6f42c1; }
.fuel-choice-button:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.navigation-choices { display: grid; gap: 12px; }
.navigation-choice { background: var(--navy-800); border: 0; color: #fff; border-radius: 12px; padding: 17px; text-align: center; text-decoration: none; font: inherit; font-size: 18px; font-weight: 800; cursor: pointer; }
.navigation-secondary { background: #315b7c; }
.navigation-copy { background: #edf4f8; border: 1px solid #cddce5; color: var(--navy-800); }
.navigation-sygic { background: var(--orange-dark); }
.navigation-dialog { max-width: 440px; }
#navigationStation { font-size: 13px; }
@media (max-width: 700px) {
  .toolbar .search-box { flex-basis: 100%; max-width: none; }
  .fuel-choice { flex-basis: 100%; order: 1; }
  .fuel-choice-button { flex: 1; }
  .toolbar .toolbar-button { flex: 1; }
}
.search-box {
  align-items: center;
  background: #f3f7fa;
  border: 1px solid #d5e0e7;
  border-radius: 12px;
  display: flex;
  flex: 1 0 230px;
  max-width: 520px;
  min-height: 42px;
  padding: 0 10px;
}
.search-box > span { color: var(--muted); font-size: 21px; }
.search-box input { background: transparent; border: 0; color: var(--ink); flex: 1; min-width: 0; outline: 0; padding: 9px; }
.search-box button { background: transparent; border: 0; color: var(--muted); cursor: pointer; font-size: 22px; }
.toolbar-button {
  background: #edf4f8;
  border: 1px solid #cddce5;
  border-radius: 11px;
  color: var(--navy-800);
  cursor: pointer;
  flex: 0 0 auto;
  font-weight: 700;
  min-height: 42px;
  padding: 0 13px;
}
.toolbar-button:active { background: #dceaf2; }

.vehicle-strip {
  align-items: center;
  background: #f6f9fb;
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 10px;
  min-height: 58px;
  padding: 7px 10px;
  z-index: 880;
}
.vehicle-status { align-items: center; display: flex; gap: 9px; min-width: 0; }
.vehicle-status > div { display: grid; min-width: 0; }
.vehicle-icon { font-size: 25px; }
.vehicle-status strong { color: var(--navy-900); font-size: 14px; }
.vehicle-status span:not(.vehicle-icon) { color: var(--ink); font-size: 12px; font-weight: 800; }
.vehicle-status small { color: var(--muted); font-size: 10px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vehicle-status.fuel-low span:not(.vehicle-icon) { color: #a33a16; }
.vehicle-status.fuel-critical span:not(.vehicle-icon) { color: var(--danger); }
.smart-radius { align-items: center; display: flex; gap: 6px; margin-left: auto; }
.smart-radius span { color: var(--muted); font-size: 10px; font-weight: 800; text-transform: uppercase; }
.smart-radius select { background: #fff; border: 1px solid #cddce5; border-radius: 9px; color: var(--navy-800); font: inherit; font-weight: 800; min-height: 36px; padding: 0 7px; }
.vehicle-refresh-button { background: #fff; border: 1px solid #cddce5; border-radius: 10px; color: var(--navy-800); cursor: pointer; font-weight: 800; min-height: 38px; padding: 0 10px; }
.vehicle-refresh-button:disabled { cursor: default; opacity: .55; }
.smart-fuel-button { background: var(--orange); border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-weight: 900; min-height: 38px; padding: 0 12px; }
.smart-fuel-button:disabled { cursor: default; opacity: .55; }
.smart-badges { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.smart-badge { background: #e7f1f7; border-radius: 999px; color: var(--navy-800); font-size: 10px; font-weight: 900; padding: 4px 7px; }
.smart-badge.recommended { background: #fff0dc; color: #8c4c00; }
.smart-badge.margin-warning { background: #fff4e6; color: #9a4f00; }
.smart-badge.warning { background: #fff4e5; color: #8a4a0d; }
.smart-cost { color: var(--muted); font-size: 11px; line-height: 1.35; margin-top: 7px; }
.smart-price-age { color: var(--muted); font-size: 10px; line-height: 1.35; margin-top: 4px; }
.smart-summary { background: #eef6fa; border: 1px solid #d4e5ee; border-radius: 11px; color: var(--ink); font-size: 12px; margin: 10px 0 2px; padding: 10px; }
.smart-warning { background: #fff4e5; border-color: #f1d2a8; color: #7b4b12; }

@media (max-width: 700px) {
  .vehicle-strip { align-items: stretch; flex-wrap: wrap; }
  .vehicle-status { flex: 1 1 180px; }
  .smart-radius { margin-left: 0; }
  .vehicle-refresh-button { flex: 0 1 auto; }
  .smart-fuel-button { flex: 1 1 160px; }
}

.map-wrap { min-height: 0; position: relative; }
#map { height: 100%; width: 100%; z-index: 1; }
.map-loading {
  align-items: center;
  background: rgba(255,255,255,.94);
  display: flex;
  flex-direction: column;
  gap: 12px;
  inset: 0;
  justify-content: center;
  position: absolute;
  z-index: 800;
}
.map-loading[hidden] { display: none; }
.spinner { border: 4px solid #dce8ef; border-radius: 50%; border-top-color: var(--orange); height: 38px; width: 38px; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline-badge { background: #8b320c; border-radius: 999px; color: #fff; font-size: 12px; font-weight: 700; left: 50%; padding: 6px 11px; position: absolute; top: 12px; transform: translateX(-50%); z-index: 700; }

.statusbar {
  align-items: center;
  background: var(--navy-950);
  color: #d5e2eb;
  display: flex;
  font-size: 10px;
  gap: 10px;
  justify-content: space-between;
  min-height: calc(30px + var(--safe-bottom));
  overflow-x: auto;
  padding: 6px 10px calc(6px + var(--safe-bottom));
  white-space: nowrap;
  z-index: 900;
}
.status-pill { color: #ffbd68; font-weight: 700; }

.sheet {
  background: #fff;
  border-radius: 20px 20px 0 0;
  bottom: 0;
  box-shadow: 0 -16px 40px rgba(5,27,45,.24);
  left: 0;
  max-height: min(76dvh, 720px);
  overflow: auto;
  padding: 0 16px calc(18px + var(--safe-bottom));
  position: fixed;
  right: 0;
  transform: translateY(105%);
  transition: transform .22s ease;
  z-index: 1600;
}
.sheet.open { transform: translateY(0); }
.sheet-handle { background: #ced8df; border-radius: 99px; height: 4px; margin: 8px auto 3px; width: 45px; }
.sheet-header { align-items: flex-start; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; padding: 9px 0 13px; }
.sheet-header h2 { font-size: 19px; margin: 0 0 2px; }
.sheet-header p { color: var(--muted); margin: 0; }
.close-button { background: #eef3f6; border: 0; border-radius: 50%; color: var(--ink); cursor: pointer; font-size: 24px; height: 36px; line-height: 1; width: 36px; }
.filter-section { border-bottom: 1px solid var(--line); padding: 15px 0; }
.filter-section h3 { font-size: 13px; margin: 0 0 9px; text-transform: uppercase; letter-spacing: .35px; color: var(--muted); }
.section-row { align-items: center; display: flex; justify-content: space-between; }
.section-row h3 { margin: 0; }
.text-button { background: none; border: 0; color: var(--navy-700); cursor: pointer; font-weight: 700; }
.segmented { background: #edf3f7; border-radius: 12px; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; }
.segmented label { cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { border-radius: 9px; display: block; font-weight: 700; padding: 10px; text-align: center; }
.segmented input:checked + span { background: #fff; color: var(--navy-800); box-shadow: 0 2px 8px rgba(17,52,77,.14); }
.country-filters { display: grid; gap: 8px; grid-template-columns: repeat(2, minmax(0, 1fr)); margin-top: 12px; }
.country-filter { align-items: center; background: #f5f8fa; border: 1px solid #dce5eb; border-radius: 11px; display: flex; gap: 8px; padding: 10px; }
.country-filter input { accent-color: var(--orange); height: 18px; width: 18px; }
.country-filter b { margin-left: auto; color: var(--muted); font-size: 12px; }
.switch-row { align-items: center; display: flex; gap: 10px; font-weight: 600; padding: 14px 0; }
.switch-row input { accent-color: var(--orange); height: 20px; width: 20px; }

.results-sort { background: #edf3f7; border-radius: 11px; display: grid; gap: 3px; grid-template-columns: repeat(3, 1fr); margin-top: 10px; padding: 3px; }
.results-sort button { background: transparent; border: 0; border-radius: 8px; color: var(--muted); cursor: pointer; font-size: 12px; font-weight: 800; min-height: 34px; padding: 6px; }
.results-sort button[aria-pressed="true"] { background: #fff; box-shadow: 0 1px 5px rgba(17,52,77,.14); color: var(--navy-800); }
.results-list { display: grid; gap: 10px; padding-top: 12px; }
.result-card { background: #f7fafc; border: 1px solid #dce5eb; border-radius: 14px; padding: 12px; }
.result-top { display: flex; gap: 10px; justify-content: space-between; }
.result-card h3 { font-size: 15px; margin: 0 0 4px; }
.result-address { color: var(--muted); font-size: 12px; }
.result-distance { color: var(--navy-700); flex: 0 0 auto; font-weight: 800; }
.result-bottom { align-items: end; display: flex; gap: 10px; justify-content: space-between; margin-top: 10px; }
.result-price small { color: var(--muted); display: block; }
.result-price strong { color: var(--navy-800); font-size: 18px; }
.navigate-link { background: var(--orange); border: 0; border-radius: 10px; color: #fff; cursor: pointer; font-weight: 800; min-height: 44px; padding: 9px 12px; text-decoration: none; }
.empty-results { color: var(--muted); padding: 30px 10px; text-align: center; }

.settings-dialog { background: transparent; border: 0; max-width: 520px; padding: 14px; width: 100%; }
.settings-dialog::backdrop { background: rgba(3,17,29,.64); backdrop-filter: blur(2px); }
.dialog-card { background: #fff; border-radius: 19px; box-shadow: 0 24px 80px rgba(0,0,0,.28); padding: 19px; }
.dialog-header { align-items: flex-start; display: flex; justify-content: space-between; margin-bottom: 18px; }
.dialog-header h2 { margin: 0 0 4px; }
.dialog-header p { color: var(--muted); margin: 0; }
[hidden] { display: none !important; }
.field { display: grid; gap: 7px; font-weight: 700; }
.field input { border: 1px solid #cad7df; border-radius: 11px; outline: 0; padding: 12px; }
.field input:focus { border-color: var(--navy-700); box-shadow: 0 0 0 3px #1d6d9f22; }
.dialog-switch { font-weight: 500; }
.dialog-actions { display: flex; gap: 9px; justify-content: flex-end; margin-top: 13px; }
.dialog-actions button { border: 0; border-radius: 11px; cursor: pointer; font-weight: 800; padding: 11px 14px; }
.primary { background: var(--orange); color: #fff; }
.secondary { background: #edf3f6; color: var(--ink); }
.danger { color: var(--danger); }
.dialog-message { border-radius: 10px; margin-top: 10px; padding: 10px; }
.dialog-message.ok { background: #e8f7ed; color: #176b37; }
.dialog-message.error { background: #fff0ee; color: var(--danger); }
.dialog-links { display: flex; font-size: 12px; gap: 14px; margin-top: 16px; }

.toast { background: #0d2b45; border-radius: 12px; bottom: calc(45px + var(--safe-bottom)); box-shadow: 0 10px 30px #0004; color: #fff; left: 50%; max-width: calc(100vw - 30px); padding: 11px 15px; position: fixed; text-align: center; transform: translateX(-50%); z-index: 2500; }

.fuel-marker { background: transparent !important; border: 0 !important; }
.fuel-pin { filter: drop-shadow(0 2px 2px rgba(0,0,0,.36)); height: 42px; position: relative; width: 62px; }
.fuel-pin::after { border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 9px solid var(--navy-800); bottom: 0; content: ''; left: 25px; position: absolute; }
.fuel-pin-label { background: var(--orange); border-radius: 6px 6px 0 0; color: #fff; font: 800 9px/15px Arial,sans-serif; height: 16px; letter-spacing: .4px; text-align: center; }
.fuel-pin-price { background: #fff; border: 2px solid var(--navy-800); border-radius: 0 0 6px 6px; color: var(--navy-900); font: 800 12px/20px Arial,sans-serif; height: 22px; text-align: center; }
.fuel-cluster { background: transparent !important; }
.fuel-cluster > div { align-items: center; background: var(--navy-700); border: 3px solid #fff; border-radius: 50%; box-shadow: 0 3px 8px #0005; color: #fff; display: flex; flex-direction: column; height: 46px; justify-content: center; width: 46px; }
.fuel-cluster span { color: #ffbd68; font-size: 8px; font-weight: 900; }
.fuel-cluster strong { font-size: 15px; }
.user-marker { background: rgba(29,110,159,.2); border: 2px solid #fff; border-radius: 50%; box-shadow: 0 0 0 7px rgba(29,110,159,.22); height: 16px; width: 16px; }
.station-popup { min-width: 245px; }
.station-popup h3 { margin: 0 0 7px; }
.station-popup .address { color: var(--muted); margin-bottom: 9px; }
.popup-prices { display: grid; gap: 7px; grid-template-columns: 1fr; }
.popup-prices div { background: #edf4f8; border-radius: 8px; padding: 7px; }
.popup-prices small { color: var(--muted); display: block; }
.popup-prices strong { color: var(--navy-800); font-size: 15px; }
.popup-meta { font-size: 12px; margin-top: 8px; }
.popup-nav { background: var(--orange); border: 0; border-radius: 8px; color: #fff !important; cursor: pointer; display: block; font-weight: 800; margin-top: 10px; min-height: 44px; padding: 9px; text-align: center; text-decoration: none; width: 100%; }

@media (min-width: 900px) {
  .app-shell { grid-template-rows: auto auto auto 1fr auto; }
  .sheet { border-radius: 16px; bottom: 48px; left: auto; max-height: calc(100dvh - 180px); right: 18px; width: 390px; }
  .filters-sheet, .results-sheet { transform: translateX(115%); }
  .sheet.open { transform: translateX(0); }
  .toolbar { justify-content: center; }
  .statusbar { justify-content: flex-start; gap: 24px; }
}


/* v2: ON/LNG fuel filters and marker variants */
.fuel-filter-grid { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:8px; }
.fuel-filter { align-items:center; background:#f5f8fa; border:1px solid #dce5eb; border-radius:11px; cursor:pointer; display:flex; gap:8px; padding:10px; }
.fuel-filter input { accent-color:var(--orange); height:18px; width:18px; }
.fuel-filter span { align-items:center; display:flex; font-weight:800; gap:7px; }
.fuel-filter i { border-radius:50%; display:inline-block; height:10px; width:10px; }
.fuel-filter-on i { background:#005a8b; }
.fuel-filter-lng i { background:#6f42c1; }
.fuel-filter b { color:var(--muted); font-size:12px; margin-left:auto; }
.filter-hint { color:var(--muted); font-size:12px; margin:8px 0 0; }
.fuel-pin.fuel-on .fuel-pin-label { background:#f68b1f; }
.fuel-pin.fuel-on .fuel-pin-price { border-color:var(--navy-800); }
.fuel-pin.fuel-on::after { border-top-color:var(--navy-800); }
.fuel-pin.fuel-attractive .fuel-pin-label { background:#1b7f4d; }
.fuel-pin.fuel-attractive .fuel-pin-price { border-color:#1b7f4d; color:#145f3a; }
.fuel-pin.fuel-attractive::after { border-top-color:#1b7f4d; }
.attractive-price-note { background:#e9f7ef; border-radius:7px; color:#176b42; font-size:11px; font-weight:800; margin-bottom:8px; padding:6px 8px; }
.fuel-pin.fuel-lng .fuel-pin-label { background:#6f42c1; }
.fuel-pin.fuel-lng .fuel-pin-price { border-color:#6f42c1; color:#4f2a91; }
.fuel-pin.fuel-lng::after { border-top-color:#6f42c1; }
.fuel-pin.fuel-mix .fuel-pin-label { background:linear-gradient(90deg,#005a8b 0 50%,#6f42c1 50% 100%); }
.fuel-pin.fuel-mix .fuel-pin-price { border-color:#315276; }
.fuel-pin.fuel-mix::after { border-top-color:#315276; }
.popup-fuel-block { border-top:1px solid #e2e9ee; margin-top:10px; padding-top:9px; }
.popup-fuel-title { font-size:11px; font-weight:900; letter-spacing:.45px; margin-bottom:6px; text-transform:uppercase; }
.popup-fuel-title.on { color:#005a8b; }
.popup-fuel-title.lng { color:#6f42c1; }
.popup-product-name { color:#536b7c; font-size:11px; font-weight:800; margin:7px 0 4px; }
.result-fuel { color:var(--muted); font-size:11px; font-weight:800; margin-bottom:2px; text-transform:uppercase; }


/* Landscape-first tablet layout: keep the map dominant for drivers. */
@media (orientation: landscape) and (min-width: 701px) and (max-height: 700px) {
  .app-shell {
    grid-template-columns: clamp(248px, 21vw, 290px) minmax(0, 1fr);
    grid-template-rows: auto auto minmax(0, 1fr) auto;
  }

  .topbar {
    grid-column: 1;
    grid-row: 1;
    min-height: calc(48px + var(--safe-top));
    padding: calc(5px + var(--safe-top)) 7px 5px;
  }
  .brand-block { gap: 6px; }
  .brand-icon { display: none; }
  .brand-block strong { font-size: 13px; }
  .brand-block span { display: none; }
  .top-actions { gap: 4px; }
  .icon-button {
    border-radius: 9px;
    font-size: 17px;
    height: 36px;
    min-width: 36px;
    padding: 0 8px;
  }

  .toolbar {
    grid-column: 2;
    grid-row: 1;
    align-items: center;
    flex-wrap: nowrap;
    gap: 5px;
    min-width: 0;
    min-height: calc(48px + var(--safe-top));
    overflow-x: auto;
    overflow-y: hidden;
    padding: calc(5px + var(--safe-top)) 7px 5px;
    scrollbar-width: none;
  }
  .toolbar::-webkit-scrollbar { display: none; }
  .toolbar .search-box {
    flex: 1 1 220px;
    max-width: none;
    min-height: 40px;
    min-width: 140px;
    padding: 0 8px;
  }
  .search-box > span { font-size: 18px; }
  .search-box input { font-size: 12px; padding: 7px; }
  .toolbar-button {
    font-size: 12px;
    min-height: 40px;
    padding: 0 9px;
  }
  .fuel-choice { gap: 4px; }
  .fuel-choice-button {
    font-size: 12px;
    min-height: 40px;
    padding: 0 10px;
  }

  .vehicle-strip {
    grid-column: 1 / -1;
    grid-row: 2;
    gap: 7px;
    min-height: 46px;
    padding: 4px 8px;
  }
  .vehicle-status {
    flex: 1 1 auto;
    gap: 5px;
  }
  .vehicle-icon { font-size: 20px; }
  .vehicle-status > div {
    align-items: baseline;
    column-gap: 8px;
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 0;
  }
  .vehicle-status strong { font-size: 12px; }
  .vehicle-status span:not(.vehicle-icon) { font-size: 10px; }
  .vehicle-status small { font-size: 9px; line-height: 1.2; }
  .smart-radius { margin-left: auto; }
  .smart-radius span { display: none; }
  .smart-radius select {
    min-height: 34px;
    padding: 0 6px;
  }
  .vehicle-refresh-button,
  .smart-fuel-button {
    font-size: 12px;
    min-height: 38px;
    padding: 0 10px;
  }

  .map-wrap {
    grid-column: 1 / -1;
    grid-row: 3;
  }
  .statusbar {
    grid-column: 1 / -1;
    grid-row: 4;
    font-size: 10px;
    gap: 8px;
    min-height: calc(22px + var(--safe-bottom));
    padding: 3px 8px calc(3px + var(--safe-bottom));
  }
}


/* Portrait tablet layout: keep controls touchable while giving the map more height. */
@media (orientation: portrait) and (min-width: 360px) and (max-width: 800px) {
  .topbar {
    min-height: calc(50px + var(--safe-top));
    padding: calc(5px + var(--safe-top)) 8px 5px;
  }
  .brand-block { gap: 7px; }
  .brand-icon { border-radius: 8px; height: 32px; width: 32px; }
  .brand-block strong { font-size: 14px; }
  .brand-block span { display: none; }
  .top-actions { gap: 4px; }
  .icon-button {
    border-radius: 9px;
    font-size: 17px;
    height: 36px;
    min-width: 36px;
    padding: 0 8px;
  }

  .toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 5px;
    overflow: visible;
    padding: 6px 7px;
  }
  .toolbar .search-box {
    grid-column: 1 / -1;
    max-width: none;
    min-height: 40px;
    width: 100%;
  }
  .toolbar .toolbar-button,
  .toolbar .fuel-choice-button {
    font-size: 11px;
    min-height: 38px;
    min-width: 0;
    padding: 0 4px;
    width: 100%;
  }
  .toolbar .toolbar-button { flex: none; }
  .fuel-choice {
    display: contents;
  }

  .vehicle-strip {
    align-items: stretch;
    display: grid;
    grid-template-columns: minmax(78px, .8fr) minmax(100px, 1fr) minmax(142px, 1.35fr);
    grid-template-areas:
      'status status status'
      'radius refresh smart';
    gap: 4px 5px;
    min-height: 0;
    padding: 5px 7px 6px;
  }
  .vehicle-status {
    grid-area: status;
    min-width: 0;
  }
  .vehicle-icon { display: none; }
  .vehicle-status > div {
    align-items: baseline;
    column-gap: 8px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    row-gap: 0;
    width: 100%;
  }
  .vehicle-status strong { font-size: 12px; }
  .vehicle-status span:not(.vehicle-icon) { font-size: 10px; }
  .vehicle-status small { font-size: 9px; line-height: 1.2; }
  .smart-radius {
    grid-area: radius;
    margin-left: 0;
    min-width: 0;
  }
  .smart-radius span { display: none; }
  .smart-radius select {
    min-height: 38px;
    width: 100%;
  }
  .vehicle-refresh-button {
    grid-area: refresh;
    font-size: 11px;
    min-height: 38px;
    min-width: 0;
    padding: 0 5px;
    width: 100%;
  }
  .smart-fuel-button {
    grid-area: smart;
    font-size: 11px;
    min-height: 38px;
    min-width: 0;
    padding: 0 6px;
    width: 100%;
  }

  .statusbar {
    font-size: 9px;
    gap: 8px;
    min-height: calc(24px + var(--safe-bottom));
    padding: 3px 7px calc(3px + var(--safe-bottom));
  }
}


/* Map-first redesign v1.8: selected premium floating-card concept. */
.map-first-shell {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  background: #f8fbfd;
}
.map-first-shell .topbar {
  min-height: calc(50px + var(--safe-top));
  padding: calc(6px + var(--safe-top)) 10px 6px;
}
.map-first-shell .brand-block { gap: 8px; }
.map-first-shell .brand-icon { display: block; border-radius: 9px; height: 32px; width: 32px; }
.map-first-shell .brand-block strong { font-size: 14px; }
.map-first-shell .brand-block span { display: none; }
.map-first-shell .top-actions { gap: 5px; }
.map-first-shell .icon-button {
  border-radius: 10px;
  font-size: 18px;
  height: 36px;
  min-width: 36px;
  padding: 0 8px;
}

.map-first-shell .toolbar {
  align-items: center;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(189,205,216,.8);
  box-shadow: 0 3px 14px rgba(7,28,48,.06);
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding: 6px 8px;
}
.map-first-shell .toolbar .search-box {
  background: #f7fafc;
  border-color: #cfdae2;
  border-radius: 12px;
  flex: 1 1 310px;
  max-width: none;
  min-height: 40px;
  min-width: 190px;
}
.map-first-shell .toolbar-button,
.map-first-shell .fuel-choice-button {
  border-radius: 12px;
  font-size: 12px;
  min-height: 40px;
  padding: 0 13px;
  white-space: nowrap;
}
.map-first-shell .fuel-choice { display: flex; flex-basis: auto; gap: 6px; order: initial; }

.map-first-shell .map-wrap {
  grid-row: 3;
  min-height: 0;
  overflow: hidden;
  position: relative;
}
.map-first-shell .vehicle-strip {
  align-items: center;
  background: rgba(255,255,255,.97);
  border: 1px solid rgba(204,217,226,.95);
  border-radius: 18px;
  bottom: 14px;
  box-shadow: 0 14px 36px rgba(5,27,45,.22);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  left: 50%;
  max-width: 980px;
  min-height: 0;
  padding: 10px 12px;
  position: absolute;
  transform: translateX(-50%);
  width: min(94%, 980px);
  z-index: 650;
}
.map-first-shell .vehicle-strip[hidden] { display: none !important; }
.map-first-shell .vehicle-card-toggle {
  align-items: center;
  background: #f2f6f8;
  border: 0;
  border-radius: 999px;
  color: var(--navy-800);
  cursor: pointer;
  display: flex;
  font-size: 18px;
  height: 40px;
  justify-content: center;
  min-width: 40px;
  position: absolute;
  right: 8px;
  top: 8px;
  z-index: 2;
}
.map-first-shell .vehicle-status { padding-right: 42px; }
.map-first-shell .vehicle-card-collapsed {
  grid-template-columns: minmax(0,1fr);
  max-width: 430px;
  padding-right: 54px;
}
.map-first-shell .vehicle-card-collapsed .vehicle-actions,
.map-first-shell .vehicle-card-collapsed .vehicle-status small,
.map-first-shell .vehicle-card-collapsed .vehicle-fuel-meter,
.map-first-shell .vehicle-card-collapsed .vehicle-icon { display: none; }
.map-first-shell .vehicle-card-collapsed .vehicle-status { grid-template-columns: 1fr; padding-right: 0; }
.map-first-shell .vehicle-card-collapsed .vehicle-status-copy { gap: 0; }
.map-first-shell .vehicle-card-collapsed .vehicle-primary-line { justify-content: space-between; }
.map-first-shell .vehicle-status {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0,1fr);
  min-width: 0;
}
.map-first-shell .vehicle-icon {
  align-items: center;
  background: #f1f6f9;
  border-radius: 12px;
  display: flex;
  font-size: 27px;
  height: 48px;
  justify-content: center;
  width: 56px;
}
.map-first-shell .vehicle-status-copy { display: grid; gap: 3px; min-width: 0; }
.map-first-shell .vehicle-primary-line {
  align-items: baseline;
  display: flex;
  gap: 14px;
  justify-content: flex-start;
  min-width: 0;
}
.map-first-shell .vehicle-primary-line strong { color: var(--navy-900); font-size: 14px; white-space: nowrap; }
.map-first-shell .vehicle-primary-line > span { color: var(--navy-800); font-size: 12px; font-weight: 900; white-space: nowrap; }
.map-first-shell .vehicle-status small {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.map-first-shell .vehicle-fuel-meter {
  background: #dfe8ee;
  border-radius: 999px;
  height: 6px;
  max-width: 260px;
  overflow: hidden;
  width: 100%;
}
.map-first-shell .vehicle-fuel-meter > span {
  background: linear-gradient(90deg, #18a868, #28c47c);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width .2s ease;
  width: 0;
}
.map-first-shell .fuel-low .vehicle-fuel-meter > span { background: #e7a321; }
.map-first-shell .fuel-critical .vehicle-fuel-meter > span { background: #d33b2f; }
.map-first-shell .vehicle-actions {
  align-items: stretch;
  display: grid;
  gap: 7px;
  grid-template-columns: minmax(0,.7fr) minmax(0,1fr) minmax(0,1.45fr);
}
.map-first-shell .smart-radius { margin: 0; }
.map-first-shell .smart-radius span { display: none; }
.map-first-shell .smart-radius select,
.map-first-shell .vehicle-refresh-button,
.map-first-shell .smart-fuel-button {
  min-height: 48px;
}
.map-first-shell .smart-radius select {
  border-radius: 12px;
  font-size: 12px;
  min-width: 92px;
  padding: 0 12px;
}
.map-first-shell .vehicle-refresh-button {
  border-radius: 12px;
  font-size: 12px;
  padding: 0 14px;
  white-space: nowrap;
}
.map-first-shell .smart-fuel-button {
  align-items: center;
  background: linear-gradient(135deg, #ff9b19, #ff7416);
  border-radius: 13px;
  box-shadow: 0 7px 16px rgba(246,139,31,.22);
  display: flex;
  gap: 9px;
  justify-content: center;
  padding: 6px 14px;
  text-align: left;
}
.map-first-shell .smart-fuel-symbol { font-size: 18px; }
.map-first-shell .smart-fuel-copy { display: grid; line-height: 1.05; }
.map-first-shell .smart-fuel-copy strong { font-size: 12px; white-space: nowrap; }
.map-first-shell .smart-fuel-copy small { font-size: 9px; font-weight: 700; opacity: .9; }
.map-first-shell .leaflet-bottom.leaflet-right {
  bottom: var(--vehicle-card-inset, 0px);
  transition: bottom .16s ease;
}
.map-first-shell .statusbar {
  font-size: 9px;
  min-height: calc(24px + var(--safe-bottom));
  padding: 3px 8px calc(3px + var(--safe-bottom));
}

@media (orientation: landscape) and (min-width: 701px) {
  .map-first-shell {
    grid-template-rows: auto auto minmax(0,1fr) auto;
  }
  .map-first-shell .topbar {
    min-height: calc(46px + var(--safe-top));
    padding: calc(5px + var(--safe-top)) 9px 5px;
  }
  .map-first-shell .brand-icon { height: 30px; width: 30px; }
  .map-first-shell .brand-block strong { font-size: 13px; }
  .map-first-shell .toolbar { padding: 5px 9px; }
  .map-first-shell .toolbar .search-box { min-height: 38px; }
  .map-first-shell .toolbar-button,
  .map-first-shell .fuel-choice-button { min-height: 38px; }
}

@media (orientation: portrait), (max-width: 700px) {
  .map-first-shell .topbar {
    min-height: calc(50px + var(--safe-top));
  }
  .map-first-shell .toolbar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0,1fr));
    overflow: visible;
  }
  .map-first-shell .toolbar .search-box {
    grid-column: 1 / -1;
    min-width: 0;
    width: 100%;
  }
  .map-first-shell .toolbar .toolbar-button,
  .map-first-shell .toolbar .fuel-choice-button {
    font-size: 10px;
    min-height: 38px;
    min-width: 0;
    padding: 0 4px;
    width: 100%;
  }
  .map-first-shell .fuel-choice { display: contents; }
  .map-first-shell .vehicle-strip {
    bottom: 8px;
    border-radius: 18px;
    gap: 8px;
    grid-template-columns: 1fr;
    left: 8px;
    padding: 8px 9px 9px;
    transform: none;
    width: calc(100% - 16px);
  }
  .map-first-shell .vehicle-status {
    grid-template-columns: auto minmax(0,1fr);
  }
  .map-first-shell .vehicle-icon { height: 44px; width: 52px; }
  .map-first-shell .vehicle-primary-line { gap: 10px; justify-content: space-between; }
  .map-first-shell .vehicle-fuel-meter { max-width: none; }
  .map-first-shell .vehicle-actions {
    grid-template-columns: minmax(0,.7fr) minmax(0,1fr) minmax(0,1.45fr);
  }
  .map-first-shell .smart-radius select,
  .map-first-shell .vehicle-refresh-button,
  .map-first-shell .smart-fuel-button { min-height: 42px; }
  .map-first-shell .smart-fuel-copy strong { font-size: 10px; }
  .map-first-shell .smart-fuel-copy small { display: none; }
  .map-first-shell .statusbar { font-size: 8px; }
}


@media (orientation: landscape) and (min-width: 701px) and (max-width: 860px) {
  .map-first-shell .vehicle-strip {
    gap: 7px;
    grid-template-columns: 1fr;
    max-height: min(44dvh, 210px);
    overflow: auto;
    width: min(92%, 700px);
  }
  .map-first-shell .vehicle-actions {
    grid-template-columns: minmax(0,.7fr) minmax(0,1fr) minmax(0,1.35fr);
  }
}

@media (max-width: 380px) {
  .map-first-shell .vehicle-actions { grid-template-columns: minmax(0,.75fr) minmax(0,1.25fr); }
  .map-first-shell .smart-fuel-button { grid-column: 1 / -1; }
}

@media (orientation: landscape) and (max-height: 520px) {
  .map-first-shell .vehicle-strip {
    bottom: 6px;
    gap: 6px;
    max-height: min(42dvh, 150px);
    overflow: auto;
    padding: 7px 9px;
  }
  .map-first-shell .vehicle-status small,
  .map-first-shell .vehicle-fuel-meter { display: none; }
  .map-first-shell .vehicle-icon { height: 40px; width: 44px; }
  .map-first-shell .smart-radius select,
  .map-first-shell .vehicle-refresh-button,
  .map-first-shell .smart-fuel-button { min-height: 40px; }
}
