/* ══════════════════════════════════════════════════════════════════
   TankFinder DK — Uber-inspired design
══════════════════════════════════════════════════════════════════ */

:root {
  --navy: #1B3A6B;
  --green: #22C55E;
  --green-dark: #16A34A;
  --yellow: #D97706;
  --red: #EF4444;
  --black: #111111;
  --sheet-bg: #FFFFFF;
  --sheet-text: #111111;
  --sheet-sub: #6B7280;
  --sheet-border: #F0F0F0;
  --sheet-card: #F8F8F8;
  --input-bg: #F5F5F5;
  --tab-h: 0px;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%; overflow: hidden;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #e8eaf0;
  color: var(--sheet-text);
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
}

/* ── Full-screen map ─────────────────────────────────────────── */
#app { position: fixed; inset: 0; }
#map {
  position: absolute; inset: 0;
  background: #e8eaf0;
  z-index: 0;
  transform: translateZ(0);
  contain: strict;
}

/* ── Floating top bar ────────────────────────────────────────── */
#top-bar {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 14px 16px;
  padding-top: max(14px, env(safe-area-inset-top));
  display: flex; align-items: center; justify-content: space-between;
  z-index: 20; pointer-events: none;
}
#top-bar > * { pointer-events: all; }

.logo-pill {
  display: flex; align-items: center; gap: 8px;
  background: #fff;
  border-radius: 24px; padding: 10px 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
}
.logo-icon { width: 24px; height: 24px; border-radius: 6px; display: block; }
.logo-text { font-size: 15px; font-weight: 800; color: #111; letter-spacing: -.3px; }

.top-actions { display: flex; gap: 10px; }
.top-btn {
  width: 44px; height: 44px; border-radius: 22px; border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  box-shadow: 0 2px 12px rgba(0,0,0,.15);
  color: #111; transition: opacity .15s;
}
.top-btn:active { opacity: .75; transform: scale(.93); }
.top-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; }
.top-btn.follow-active { background: var(--green); color: #fff; box-shadow: 0 2px 12px rgba(34,197,94,.4); }

/* Status chip */
#status-chip {
  position: absolute; left: 16px;
  top: max(80px, calc(env(safe-area-inset-top) + 66px));
  background: #fff;
  border-radius: 20px; padding: 7px 12px;
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 500; color: #6B7280;
  box-shadow: 0 2px 8px rgba(0,0,0,.12); z-index: 20;
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--green); flex-shrink: 0; }
.status-dot.offline { background: var(--yellow); }

/* Offline banner */
#offline-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 300;
  background: var(--yellow); color: #fff;
  padding: 10px; text-align: center;
  font-size: 13px; font-weight: 600;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transform: translateY(-100%); transition: transform .3s;
}
#offline-banner.show { transform: translateY(0); }

/* ── User location dot ───────────────────────────────────────── */
.user-dot { position: relative; width: 24px; height: 24px; }
.user-dot-core {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: #1B3A6B; border: 3px solid #fff;
  box-shadow: 0 2px 8px rgba(27,58,107,.5); z-index: 2;
}
.user-dot-pulse {
  position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: 16px; height: 16px; border-radius: 50%;
  background: rgba(27,58,107,.35);
  animation: gpsPulse 2s ease-out infinite; z-index: 1;
}
@keyframes gpsPulse {
  0%   { transform: translate(-50%,-50%) scale(1); opacity: .8; }
  100% { transform: translate(-50%,-50%) scale(3.5); opacity: 0; }
}
.user-heading-cone {
  width: 40px; height: 40px;
  clip-path: polygon(50% 0%, 20% 100%, 80% 100%);
  background: rgba(27,58,107,.45);
  transform-origin: center bottom;
}

/* ── Map pins ────────────────────────────────────────────────── */
.map-pin {
  padding: 5px 9px; border-radius: 20px;
  font-size: 12px; font-weight: 800; color: #fff;
  white-space: nowrap; cursor: pointer;
  transform: translateZ(0);
}
.map-pin.green  { background: #16A34A; }
.map-pin.yellow { background: #D97706; }
.map-pin.red    { background: #DC2626; }
.map-pin.selected { outline: 3px solid #fff; outline-offset: 1px; }

/* ══════════════════════════════════════════════════════════════════
   BOTTOM SHEET (Uber-style, draggable, 3 snap points)
══════════════════════════════════════════════════════════════════ */
#bottom-sheet {
  position: fixed; inset: 0;
  z-index: 50; pointer-events: none;
}
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  background: var(--sheet-bg);
  border-radius: 24px 24px 0 0;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -4px 40px rgba(0,0,0,.25);
  overflow: hidden;
  pointer-events: all;
  will-change: transform;
  display: flex;
  flex-direction: column;
}
.sheet-handle-wrap {
  padding: 12px 0 4px; cursor: grab; display: flex; justify-content: center;
}
.sheet-handle-wrap:active { cursor: grabbing; }
.sheet-handle {
  width: 36px; height: 4px; border-radius: 2px;
  background: var(--sheet-border);
}

/* ── Peek state (snap 0) — just the cheapest row ── */
.sheet-peek {
  padding: 0 20px 16px;
  display: flex; align-items: center; gap: 14px;
  cursor: pointer;
}
.peek-left { flex: 1; min-width: 0; }
.peek-label {
  font-size: 11px; font-weight: 700; color: var(--sheet-sub);
  text-transform: uppercase; letter-spacing: .8px; margin-bottom: 4px;
}
.peek-name { font-size: 20px; font-weight: 800; color: var(--sheet-text); margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-addr { font-size: 13px; color: var(--sheet-sub); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.peek-right { text-align: right; flex-shrink: 0; }
.peek-price { font-size: 38px; font-weight: 900; color: var(--green); letter-spacing: -2px; line-height: 1; }
.peek-unit  { font-size: 13px; font-weight: 600; color: var(--sheet-sub); }

/* ── Mid / Full content ── */
.sheet-body {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
}

/* Search */
.sheet-search {
  padding: 4px 20px 16px;
}
.search-input-wrap {
  display: flex; align-items: center; gap: 10px;
  background: var(--input-bg); border-radius: 14px;
  padding: 13px 16px;
}
.search-input-wrap svg { width: 18px; height: 18px; fill: none; stroke: var(--sheet-sub); stroke-width: 2; flex-shrink: 0; }
#search-input {
  flex: 1; background: none; border: none; outline: none;
  font-size: 15px; font-weight: 500; color: var(--sheet-text);
}
#search-input::placeholder { color: var(--sheet-sub); }

#search-suggestions {
  background: var(--sheet-bg); border-radius: 14px; margin-top: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,.14); overflow: hidden;
  display: none;
}
#search-suggestions.open { display: block; }
.suggestion-item {
  padding: 13px 16px; font-size: 15px; font-weight: 500; cursor: pointer;
  border-bottom: 1px solid var(--sheet-border);
  display: flex; align-items: center; gap: 10px; color: var(--sheet-text);
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:active { background: var(--input-bg); }
.suggestion-item svg { flex-shrink: 0; }

/* Radius row */
.sheet-radius {
  padding: 0 20px 16px;
  display: flex; align-items: center; gap: 12px;
}
.radius-label-small { font-size: 13px; font-weight: 600; color: var(--sheet-sub); white-space: nowrap; }
#radius-slider { flex: 1; accent-color: var(--black); height: 3px; cursor: pointer; }
@media (prefers-color-scheme: dark) { #radius-slider { accent-color: #fff; } }
.radius-badge {
  background: var(--black); color: #fff;
  padding: 5px 12px; border-radius: 20px;
  font-size: 12px; font-weight: 700; white-space: nowrap; flex-shrink: 0;
}
@media (prefers-color-scheme: dark) {
  .radius-badge { background: #fff; color: #000; }
}

/* Section header */
.sheet-section-header {
  padding: 4px 20px 12px;
  display: flex; align-items: center; justify-content: space-between;
}
.sheet-section-title { font-size: 18px; font-weight: 800; color: var(--sheet-text); }
.sheet-section-count { font-size: 13px; font-weight: 600; color: var(--sheet-sub); }

/* ── Station list (Uber-style rows) ── */
.station-list { padding: 0 20px; }
.station-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid var(--sheet-border);
  cursor: pointer;
  transition: opacity .15s;
}
.station-row:active { opacity: .65; }
.station-row:last-child { border-bottom: none; }

.station-row-logo {
  width: 48px; height: 48px; border-radius: 14px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; font-weight: 800; color: #fff;
}
.station-row-info { flex: 1; min-width: 0; }
.station-row-name { font-size: 16px; font-weight: 700; color: var(--sheet-text); margin-bottom: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station-row-meta { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--sheet-sub); font-weight: 500; }
.station-row-meta .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--sheet-border); flex-shrink: 0; }
.station-row-right { text-align: right; flex-shrink: 0; }
.station-row-price { font-size: 22px; font-weight: 900; color: var(--sheet-text); letter-spacing: -.5px; line-height: 1; }
.station-row-unit { font-size: 11px; font-weight: 600; color: var(--sheet-sub); margin-top: 2px; }
.station-row-rank {
  width: 22px; height: 22px; border-radius: 11px;
  font-size: 11px; font-weight: 800; color: #fff;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.rank-1 { background: var(--green); }
.rank-2 { background: #84CC16; }
.rank-3 { background: var(--yellow); }
.rank-n { background: var(--sheet-border); color: var(--sheet-sub); }

/* Drive cost below price */
.station-row-cost { font-size: 11px; color: var(--sheet-sub); font-weight: 500; text-align: right; margin-top: 3px; }

/* ── Settings inside sheet ── */
.sheet-settings { padding: 0 20px 40px; }

/* ── Bottom nav tabs inside sheet ── */
.sheet-tabs {
  display: flex; gap: 4px; padding: 4px 20px 0;
  border-bottom: 1px solid var(--sheet-border); margin-bottom: 4px;
}
.sheet-tab {
  flex: 1; padding: 10px 8px; border: none; background: none;
  font-size: 13px; font-weight: 600; color: var(--sheet-sub);
  cursor: pointer; border-bottom: 2px solid transparent; transition: all .2s;
}
.sheet-tab.active { color: var(--sheet-text); border-bottom-color: var(--sheet-text); }

/* ── Empty state ── */
.empty-state { text-align: center; padding: 60px 20px; }
.empty-state svg { width: 48px; height: 48px; stroke: var(--sheet-border); fill: none; stroke-width: 1.5; margin-bottom: 16px; }
.empty-state h3 { font-size: 18px; font-weight: 700; margin-bottom: 8px; color: var(--sheet-text); }
.empty-state p { font-size: 14px; color: var(--sheet-sub); }

/* Skeleton */
.skeleton { background: var(--sheet-border); border-radius: 8px; animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: .5; } 50% { opacity: 1; } }
.skeleton-row { display: flex; align-items: center; gap: 14px; padding: 16px 20px; border-bottom: 1px solid var(--sheet-border); }

/* ══════════════════════════════════════════════════════════════════
   STATION DETAIL SHEET
══════════════════════════════════════════════════════════════════ */
#station-sheet {
  position: fixed; inset: 0; z-index: 200; pointer-events: none;
}
#station-sheet.open { pointer-events: all; }
.station-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0);
  transition: background .3s;
}
#station-sheet.open .station-backdrop { background: rgba(0,0,0,.5); }
.station-panel {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: var(--sheet-bg);
  border-radius: 24px 24px 0 0;
  transform: translateY(100%);
  transition: transform .4s cubic-bezier(.32,1.2,.6,1);
  max-height: 88vh; overflow-y: auto;
  padding-bottom: env(safe-area-inset-bottom);
}
#station-sheet.open .station-panel { transform: translateY(0); }

.station-panel-topbar {
  display: flex; align-items: center; justify-content: center;
  padding: 14px 16px 4px; position: relative;
}
.station-panel-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--sheet-border); }
.station-close-btn {
  position: absolute; right: 16px; top: 10px;
  width: 32px; height: 32px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--sheet-card); color: var(--sheet-sub);
  display: flex; align-items: center; justify-content: center;
}
.station-close-btn svg { width: 16px; height: 16px; }
.station-panel-content { padding: 20px 20px 32px; }

/* Station header */
.sp-header { display: flex; align-items: flex-start; gap: 14px; margin-bottom: 20px; }
.sp-logo { width: 56px; height: 56px; border-radius: 16px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: 800; color: #fff; }
.sp-name { font-size: 22px; font-weight: 800; color: var(--sheet-text); margin-bottom: 3px; }
.sp-addr { font-size: 13px; color: var(--sheet-sub); margin-bottom: 8px; }
.sp-meta { display: flex; align-items: center; gap: 8px; }
.sp-meta-pill {
  display: flex; align-items: center; gap: 4px;
  background: var(--input-bg); border-radius: 20px;
  padding: 5px 10px; font-size: 12px; font-weight: 600; color: var(--sheet-text);
}
.sp-meta-pill svg { width: 13px; height: 13px; fill: none; stroke: var(--sheet-sub); stroke-width: 2.5; }

/* Drive hero card */
.sp-drive-card {
  background: var(--black); border-radius: 20px;
  padding: 20px; margin-bottom: 20px;
  display: flex; align-items: stretch; gap: 0;
}
@media (prefers-color-scheme: dark) { .sp-drive-card { background: #1C1C1C; } }
.sp-drive-col { flex: 1; }
.sp-drive-label { font-size: 11px; color: rgba(255,255,255,.5); font-weight: 600; text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.sp-drive-value { font-size: 26px; font-weight: 900; color: #fff; letter-spacing: -.5px; }
.sp-drive-divider { width: 1px; background: rgba(255,255,255,.1); margin: 0 20px; }
.sp-drive-note { font-size: 11px; color: rgba(255,255,255,.4); margin-top: 10px; }

/* Fuel prices */
.sp-section-title { font-size: 16px; font-weight: 700; color: var(--sheet-text); margin-bottom: 12px; }
.sp-fuels { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 20px; }
.sp-fuel {
  background: var(--sheet-card); border-radius: 14px; padding: 14px;
  border: 1.5px solid var(--sheet-border); position: relative;
}
.sp-fuel.preferred { border-color: var(--green); }
.sp-fuel-label { font-size: 11px; color: var(--sheet-sub); font-weight: 500; margin-bottom: 8px; }
.sp-fuel-price { font-size: 24px; font-weight: 900; color: var(--sheet-text); letter-spacing: -.5px; }
.sp-fuel-unit { font-size: 12px; color: var(--sheet-sub); font-weight: 500; }
.sp-fuel-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }

/* Savings */
.sp-savings {
  display: flex; align-items: center; gap: 12px;
  background: #DCFCE7; border-radius: 14px; padding: 14px; margin-bottom: 20px;
}
@media (prefers-color-scheme: dark) { .sp-savings { background: rgba(34,197,94,.12); } }
.sp-savings svg { width: 20px; height: 20px; fill: none; stroke: var(--green-dark); stroke-width: 2; flex-shrink: 0; }
.sp-savings-title { font-size: 14px; font-weight: 700; color: var(--green-dark); }
.sp-savings-desc { font-size: 13px; color: var(--green-dark); margin-top: 2px; }

/* Direction button — Uber black */
.sp-dir-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 17px; border-radius: 14px; border: none; cursor: pointer;
  background: var(--black); color: #fff;
  font-size: 16px; font-weight: 700;
  transition: opacity .2s;
}
@media (prefers-color-scheme: dark) { .sp-dir-btn { background: #fff; color: #000; } }
.sp-dir-btn:active { opacity: .8; }
.sp-dir-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; }

/* ══════════════════════════════════════════════════════════════════
   DIRECTIONS MODAL
══════════════════════════════════════════════════════════════════ */
#dir-modal {
  position: fixed; inset: 0; z-index: 400;
  background: rgba(0,0,0,0); pointer-events: none; transition: background .3s;
  display: flex; align-items: flex-end;
}
#dir-modal.open { background: rgba(0,0,0,.5); pointer-events: all; }
.dir-modal-panel {
  width: 100%; background: var(--sheet-bg);
  border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom);
  transform: translateY(100%); transition: transform .35s cubic-bezier(.34,1.2,.64,1);
}
#dir-modal.open .dir-modal-panel { transform: translateY(0); }
.dir-modal-title { text-align: center; font-size: 12px; font-weight: 600; color: var(--sheet-sub); padding: 16px 20px 2px; text-transform: uppercase; letter-spacing: .5px; }
.dir-modal-name { text-align: center; font-size: 20px; font-weight: 800; color: var(--sheet-text); padding: 0 20px 16px; }
.dir-options {}
.dir-option {
  display: flex; align-items: center; gap: 14px; padding: 16px 20px;
  border-top: 1px solid var(--sheet-border); cursor: pointer; transition: background .15s;
}
.dir-option:active { background: var(--input-bg); }
.dir-option-icon { width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 22px; background: var(--input-bg); flex-shrink: 0; }
.dir-option-label { font-size: 16px; font-weight: 700; color: var(--sheet-text); }
.dir-option-sub { font-size: 12px; color: var(--sheet-sub); margin-top: 2px; }
.dir-cancel { display: block; width: calc(100% - 32px); margin: 8px 16px 16px; padding: 16px; background: var(--input-bg); border: none; border-radius: 14px; font-size: 16px; font-weight: 700; color: var(--sheet-sub); cursor: pointer; }

/* ══════════════════════════════════════════════════════════════════
   GARAGE & SETTINGS (inside sheet)
══════════════════════════════════════════════════════════════════ */
.settings-section { margin-bottom: 28px; }
.settings-section-title {
  font-size: 11px; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--sheet-sub);
  margin-bottom: 10px; margin-left: 4px;
}
.settings-card { background: var(--sheet-card); border-radius: 18px; overflow: hidden; }
.settings-row {
  display: flex; align-items: center; padding: 14px 16px; gap: 12px;
  border-bottom: 1px solid var(--sheet-border);
}
.settings-row:last-child { border-bottom: none; }
.settings-icon {
  width: 36px; height: 36px; border-radius: 10px;
  background: var(--input-bg); display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.settings-icon svg { width: 18px; height: 18px; fill: none; stroke: var(--sheet-text); stroke-width: 2; }
.settings-row-text { flex: 1; }
.settings-row-label { font-size: 15px; font-weight: 600; color: var(--sheet-text); }
.settings-row-sub { font-size: 12px; color: var(--sheet-sub); margin-top: 1px; }
.settings-input {
  width: 80px; padding: 7px 10px; text-align: center;
  border: 1.5px solid var(--sheet-border); border-radius: 10px;
  font-size: 16px; font-weight: 700; color: var(--sheet-text);
  background: var(--input-bg); outline: none;
}
.settings-input:focus { border-color: var(--sheet-text); }

.fuel-option {
  display: flex; align-items: center; padding: 16px;
  border-bottom: 1px solid var(--sheet-border); cursor: pointer;
  gap: 12px; transition: background .15s;
}
.fuel-option:last-child { border-bottom: none; }
.fuel-option:active { background: var(--input-bg); }
.fuel-option.selected { background: rgba(0,0,0,.03); }
@media (prefers-color-scheme: dark) { .fuel-option.selected { background: rgba(255,255,255,.05); } }
.fuel-option-text { flex: 1; }
.fuel-option-label { font-size: 15px; font-weight: 600; color: var(--sheet-text); }
.fuel-option-sub { font-size: 12px; color: var(--sheet-sub); margin-top: 1px; }
.radio { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--sheet-border); display: flex; align-items: center; justify-content: center; flex-shrink: 0; transition: all .2s; }
.fuel-option.selected .radio { background: var(--black); border-color: var(--black); }
@media (prefers-color-scheme: dark) { .fuel-option.selected .radio { background: #fff; border-color: #fff; } }
.radio-check { display: none; }
.fuel-option.selected .radio-check { display: block; }
.radio-check svg { width: 14px; height: 14px; fill: none; stroke: #fff; stroke-width: 3; }
@media (prefers-color-scheme: dark) { .fuel-option.selected .radio-check svg { stroke: #000; } }
.settings-footer { text-align: center; font-size: 12px; color: var(--sheet-sub); line-height: 1.8; margin-top: 8px; }

/* Garage */
.garage-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; margin-left: 4px; }
.garage-add-btn {
  display: flex; align-items: center; gap: 6px;
  background: var(--black); color: #fff; border: none; border-radius: 20px;
  padding: 8px 14px; font-size: 13px; font-weight: 700; cursor: pointer;
}
@media (prefers-color-scheme: dark) { .garage-add-btn { background: #fff; color: #000; } }
.garage-add-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.garage-grid { display: flex; flex-direction: column; gap: 12px; }
.garage-empty { text-align: center; padding: 32px 20px; background: var(--sheet-card); border-radius: 20px; border: 2px dashed var(--sheet-border); }
.garage-empty-icon { font-size: 40px; margin-bottom: 12px; }
.garage-empty-title { font-size: 16px; font-weight: 700; color: var(--sheet-text); margin-bottom: 6px; }
.garage-empty-sub { font-size: 13px; color: var(--sheet-sub); }

.car-suggestions {
  position: absolute; left: 0; right: 0; top: 100%;
  background: var(--sheet-bg); border: 1px solid var(--sheet-border);
  border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.12);
  overflow: hidden; z-index: 100; display: none;
}
.car-suggestions.open { display: block; }
.car-suggestion-item {
  padding: 11px 14px; font-size: 14px; font-weight: 500; cursor: pointer;
  display: flex; align-items: center; gap: 10px; color: var(--sheet-text);
  border-bottom: 1px solid var(--sheet-border);
}
.car-suggestion-item:last-child { border-bottom: none; }
.car-suggestion-item:active { background: var(--sheet-card); }
.car-suggestion-sub { font-size: 12px; font-weight: 400; color: var(--sheet-sub); margin-left: auto; }
.car-field { position: relative; }

.consumption-hint {
  font-size: 12px; font-weight: 500; color: var(--yellow);
  padding: 6px 4px 0;
}

.car-card { background: var(--sheet-card); border-radius: 20px; padding: 16px; cursor: pointer; border: 2px solid transparent; box-shadow: 0 1px 8px rgba(0,0,0,.05); transition: border-color .2s; position: relative; }
.car-card.active { border-color: var(--black); }
@media (prefers-color-scheme: dark) { .car-card.active { border-color: #fff; } }
.car-card-top { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.car-svg-wrap { width: 90px; height: 46px; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.car-svg-wrap svg { width: 100%; height: 100%; }
.car-card-name { font-size: 17px; font-weight: 800; color: var(--sheet-text); margin-bottom: 3px; }
.car-card-fuel { display: inline-flex; align-items: center; background: var(--input-bg); border-radius: 20px; padding: 3px 10px; font-size: 11px; font-weight: 700; color: var(--sheet-text); }
.car-card-stats { display: flex; gap: 8px; }
.car-stat { flex: 1; background: var(--sheet-bg); border-radius: 12px; padding: 10px 12px; text-align: center; }
.car-stat-label { font-size: 10px; color: var(--sheet-sub); font-weight: 600; margin-bottom: 4px; text-transform: uppercase; letter-spacing: .4px; }
.car-stat-value { font-size: 16px; font-weight: 800; color: var(--sheet-text); }
.car-stat-unit { font-size: 10px; color: var(--sheet-sub); font-weight: 500; }
.active-badge { position: absolute; top: 14px; right: 14px; background: var(--black); color: #fff; font-size: 10px; font-weight: 700; padding: 3px 10px; border-radius: 20px; }
@media (prefers-color-scheme: dark) { .active-badge { background: #fff; color: #000; } }
.car-card-actions { display: flex; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--sheet-border); }
.car-action-btn { flex: 1; padding: 9px; border-radius: 10px; border: none; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; gap: 6px; }
.car-action-btn svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.car-action-edit { background: var(--input-bg); color: var(--sheet-text); }
.car-action-delete { background: #FEE2E2; color: #991B1B; }
.car-action-select { background: var(--black); color: #fff; }
@media (prefers-color-scheme: dark) { .car-action-select { background: #fff; color: #000; } }

/* ══════════════════════════════════════════════════════════════════
   CAR MODAL
══════════════════════════════════════════════════════════════════ */
#car-modal { position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,0); pointer-events: none; transition: background .3s; display: flex; align-items: flex-end; }
#car-modal.open { background: rgba(0,0,0,.5); pointer-events: all; }
.car-modal-panel { width: 100%; background: var(--sheet-bg); border-radius: 24px 24px 0 0; padding-bottom: env(safe-area-inset-bottom); transform: translateY(100%); transition: transform .4s cubic-bezier(.34,1.2,.64,1); max-height: 92vh; overflow-y: auto; }
#car-modal.open .car-modal-panel { transform: translateY(0); }
.car-modal-handle { width: 36px; height: 4px; border-radius: 2px; background: var(--sheet-border); margin: 12px auto 0; }
.car-modal-header { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px 0; }
.car-modal-title { font-size: 20px; font-weight: 800; color: var(--sheet-text); }
.car-modal-close { width: 32px; height: 32px; border-radius: 16px; background: var(--input-bg); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--sheet-sub); }
.car-modal-close svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.5; }
.car-modal-preview { margin: 16px 20px; background: var(--input-bg); border-radius: 16px; padding: 16px; display: flex; justify-content: center; align-items: center; min-height: 90px; }
.car-modal-preview svg { width: 180px; height: 90px; }
.car-modal-body { padding: 0 20px 24px; display: flex; flex-direction: column; gap: 16px; }
.car-field label { display: block; font-size: 12px; font-weight: 700; color: var(--sheet-sub); letter-spacing: .5px; text-transform: uppercase; margin-bottom: 6px; }
.car-field input, .car-field select { width: 100%; padding: 14px; background: var(--input-bg); border: 1.5px solid transparent; border-radius: 12px; font-size: 15px; font-weight: 600; color: var(--sheet-text); outline: none; transition: border-color .2s; }
.car-field input:focus, .car-field select:focus { border-color: var(--sheet-text); }
.car-field-row { display: flex; gap: 12px; }
.car-field-row .car-field { flex: 1; }
.car-modal-save { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 17px; border-radius: 14px; border: none; cursor: pointer; background: var(--black); color: #fff; font-size: 16px; font-weight: 700; margin-top: 4px; }
@media (prefers-color-scheme: dark) { .car-modal-save { background: #fff; color: #000; } }
.car-modal-save svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.5; }

/* ══════════════════════════════════════════════════════════════════
   INSTALL PROMPT & LOCATION MODAL
══════════════════════════════════════════════════════════════════ */
#install-prompt { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.55); display: none; align-items: flex-end; justify-content: center; padding: 0 0 env(safe-area-inset-bottom); }
#install-prompt.show { display: flex; }
.install-card { background: var(--sheet-bg); border-radius: 28px 28px 0 0; padding: 28px 28px 32px; width: 100%; text-align: center; animation: slideUp .4s cubic-bezier(.34,1.2,.64,1); }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
.install-icon-wrap { width: 80px; height: 80px; border-radius: 24px; background: var(--black); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 38px; }
@media (prefers-color-scheme: dark) { .install-icon-wrap { background: #fff; } }
.install-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; color: var(--sheet-text); }
.install-body { font-size: 15px; color: var(--sheet-sub); line-height: 1.6; margin-bottom: 24px; }
.install-steps { text-align: left; background: var(--input-bg); border-radius: 16px; padding: 16px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 14px; }
.install-step { display: flex; align-items: center; gap: 12px; }
.step-num { width: 28px; height: 28px; border-radius: 50%; background: var(--black); display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0; }
@media (prefers-color-scheme: dark) { .step-num { background: #fff; color: #000; } }
.step-text { font-size: 14px; line-height: 1.4; color: var(--sheet-text); }
.step-text strong { color: var(--sheet-text); }
.install-action-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 17px; border-radius: 14px; border: none; cursor: pointer; background: var(--black); color: #fff; font-size: 16px; font-weight: 700; margin-bottom: 12px; }
@media (prefers-color-scheme: dark) { .install-action-btn { background: #fff; color: #000; } }
.install-skip { background: none; border: none; color: var(--sheet-sub); font-size: 15px; font-weight: 600; cursor: pointer; padding: 8px; }

#loc-modal { position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.55); display: none; align-items: center; justify-content: center; padding: 24px; }
#loc-modal.show { display: flex; }
.loc-card { background: var(--sheet-bg); border-radius: 28px; padding: 28px; width: 100%; text-align: center; animation: fadeScale .3s ease; }
@keyframes fadeScale { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.loc-icon { width: 80px; height: 80px; border-radius: 40px; background: var(--black); display: flex; align-items: center; justify-content: center; margin: 0 auto 20px; font-size: 36px; }
@media (prefers-color-scheme: dark) { .loc-icon { background: #fff; } }
.loc-title { font-size: 22px; font-weight: 800; margin-bottom: 10px; color: var(--sheet-text); }
.loc-body { font-size: 15px; color: var(--sheet-sub); line-height: 1.6; margin-bottom: 20px; }
.loc-steps { text-align: left; border: 1px solid var(--sheet-border); border-radius: 16px; padding: 16px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 12px; }
.loc-btn { width: 100%; padding: 17px; border-radius: 14px; border: none; background: var(--black); color: #fff; font-size: 16px; font-weight: 700; cursor: pointer; margin-bottom: 14px; }
@media (prefers-color-scheme: dark) { .loc-btn { background: #fff; color: #000; } }
.loc-note { font-size: 12px; color: var(--sheet-sub); }
