:root {
  --bg: #0b1411;
  --bg-2: #0f1d18;
  --panel: #14241e;
  --panel-2: #1b3329;
  --accent: #2fd07a;
  --accent-hi: #45dd8b;
  --on-accent: #06231a;
  --glow: 47, 208, 122;
  --accent-deep: #0b3d2e;
  --accent-soft: rgba(var(--glow),0.14);
  --text: #eef5f1;
  --text-dim: #9db3a9;
  --text-faint: #6b837a;
  --danger: #ff6b6b;
  --warn: #ffb454;
  --border: rgba(255, 255, 255, 0.10);
  --radius: 22px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.45);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

  /* ---- Liquid Glass tokens ---- */
  --glass: rgba(22, 38, 32, 0.55);
  --glass-strong: rgba(18, 32, 27, 0.72);
  --glass-light: rgba(255, 255, 255, 0.07);
  --glass-blur: saturate(180%) blur(22px);
  --glass-border: rgba(255, 255, 255, 0.14);
  /* specular sheen: bright top edge + soft outer depth */
  --sheen: inset 0 1px 0 rgba(255, 255, 255, 0.28), inset 0 -1px 0 rgba(0, 0, 0, 0.25);
  --glass-shadow: 0 20px 50px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --spring: cubic-bezier(0.22, 1, 0.36, 1);
}

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

html, body {
  margin: 0;
  height: 100%;
  background: #060d0b;
  color: var(--text);
  font-family: var(--font);
  overscroll-behavior: none;
  /* hand text rendering + scrolling to the GPU/compositor */
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- Hardware acceleration ----
   Momentum scrolling on every scroller, and a hint to the browser that these
   surfaces animate/scroll so it keeps them on their own GPU-composited layer
   (smoother sheets, carousels, and map panning; no repaint storms). */
.sheet-panel, .map-modal-panel, #trip-results, .tp-photos, .ac-list, .modal-body {
  -webkit-overflow-scrolling: touch;
}
.sheet-panel, .map-modal-panel { transform: translateZ(0); }

/* living gradient backdrop — gives the glass something to refract.
   Two layers (green / electric-blue) crossfade on the gas ↔ EV theme switch. */
body::before, body::after {
  content: "";
  position: fixed;
  inset: -20%;
  z-index: 0;
  pointer-events: none;
  filter: blur(26px);
  /* steps() updates the drift ~4×/sec instead of 60 — the motion is so slight
     (a few % over 22s, heavily blurred) it's visually identical, but it stops
     forcing every glass panel to re-blur the backdrop 60 times a second.
     will-change caches the blurred layer as a texture so it isn't re-rasterized. */
  animation: aurora 22s steps(88) infinite alternate;
  transition: opacity 0.9s ease;
  will-change: transform;
  transform: translateZ(0);
}
body::before {
  background:
    radial-gradient(38% 32% at 18% 12%, rgba(47, 208, 122, 0.32), transparent 70%),
    radial-gradient(42% 38% at 86% 22%, rgba(56, 189, 248, 0.22), transparent 72%),
    radial-gradient(46% 42% at 70% 95%, rgba(168, 85, 247, 0.20), transparent 72%),
    radial-gradient(50% 50% at 28% 88%, rgba(45, 212, 160, 0.18), transparent 72%);
  opacity: 1;
}
body::after {
  background:
    radial-gradient(38% 32% at 18% 12%, rgba(56, 189, 248, 0.34), transparent 70%),
    radial-gradient(42% 38% at 86% 22%, rgba(99, 102, 241, 0.24), transparent 72%),
    radial-gradient(46% 42% at 70% 95%, rgba(34, 211, 238, 0.20), transparent 72%),
    radial-gradient(50% 50% at 28% 88%, rgba(59, 130, 246, 0.20), transparent 72%);
  opacity: 0;
}
body.ev::before { opacity: 0; }
body.ev::after { opacity: 1; }
@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(2%, -2%, 0) scale(1.08); }
  100% { transform: translate3d(-2%, 1%, 0) scale(1.04); }
}

/* ---- EV theme: electric blue ---- */
body.ev {
  --accent: #38bdf8;
  --accent-hi: #6ad2ff;
  --on-accent: #03212e;
  --glow: 56, 189, 248;
  --accent-deep: #0a3144;
  --accent-soft: rgba(56, 189, 248, 0.14);
}

#app {
  max-width: 460px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  z-index: 1;
  background: transparent;
  display: flex;
  flex-direction: column;
}

.hidden { display: none !important; }

.screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  animation: fade 0.28s ease;
}

@keyframes fade { from { opacity: 0; transform: translateY(6px);} to {opacity: 1; transform: none;} }

/* ---------- Buttons / controls ---------- */
.btn {
  border: none;
  border-radius: 16px;
  padding: 15px 18px;
  font-size: 16px;
  font-weight: 650;
  font-family: var(--font);
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s var(--spring), opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-primary {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--on-accent);
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.35);
}
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }
.btn-ghost {
  background: var(--glass-light);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--text);
  border: 1px solid var(--glass-border);
  box-shadow: var(--sheen);
}
.btn-ghost:hover:not(:disabled) { background: rgba(255, 255, 255, 0.12); }
.btn-block { width: 100%; }

.icon-btn {
  background: var(--glass-light);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: 19px;
  width: 42px; height: 42px;
  border-radius: 50%;
  cursor: pointer;
  display: grid; place-items: center;
  box-shadow: var(--sheen);
  transition: transform 0.18s var(--spring), background 0.2s ease;
}
.icon-btn:hover { background: rgba(255,255,255,0.16); }
.icon-btn:active { transform: scale(0.92); }
.icon-btn svg { width: 19px; height: 19px; display: block; color: var(--text); }
.round-btn svg { width: 21px; height: 21px; display: block; }

/* ---------- Brand ---------- */
.brand { text-align: center; margin-bottom: 22px; }
.brand-mark {
  font-size: 46px;
  width: 86px; height: 86px;
  margin: 0 auto 10px;
  display: grid; place-items: center;
  background: var(--accent-soft);
  border-radius: 26px;
}
.brand-mark.sm { width: 32px; height: 32px; border-radius: 10px; display: inline-grid; vertical-align: middle; }
.brand-mark svg { width: 42px; height: 42px; color: var(--accent); }
.brand-mark.sm svg { width: 19px; height: 19px; color: var(--accent); }
/* optically center the logo with the title text */
.topbar-title .brand-mark.sm { transform: translateY(3px); }
.brand h1 { margin: 4px 0 2px; font-size: 30px; letter-spacing: -0.5px; }
.tagline { margin: 0; color: var(--text-dim); font-size: 15px; }

/* ---------- Onboarding ---------- */
.onboarding { justify-content: center; padding: 28px 22px; }
.onboard-card {
  background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  padding: 28px 22px;
  box-shadow: var(--sheen), var(--glass-shadow);
}
.brand-mark {
  box-shadow: var(--sheen), 0 8px 24px rgba(var(--glow),0.25);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.onboard-intro { color: var(--text-dim); font-size: 14.5px; line-height: 1.5; margin: 0 0 18px; }

/* splash / intro step — bigger, airier, centered */
.ob-splash-step { text-align: center; padding: 18px 4px 6px; }
.ob-splash { margin-bottom: 18px; }
.brand-mark-lg { width: 104px; height: 104px; border-radius: 30px; margin-bottom: 16px; animation: splashPop 0.6s var(--spring); }
.brand-mark-lg svg { width: 52px; height: 52px; }
.ob-splash-step h1 { font-size: 34px; }
.ob-splash-intro { font-size: 15.5px; line-height: 1.55; max-width: 320px; margin: 4px auto 24px; }
@keyframes splashPop { from { transform: scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* onboarding steps */
.ob-step { animation: fade 0.3s ease; }
.ob-step-head { text-align: center; margin-bottom: 14px; }
.ob-icon {
  width: 64px; height: 64px; margin: 0 auto 10px; display: grid; place-items: center;
  border-radius: 20px; background: var(--accent-soft); color: var(--accent);
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.22);
}
.ob-icon svg { width: 30px; height: 30px; }
.ob-step-head h2 { margin: 0; font-size: 22px; display: inline-flex; align-items: center; gap: 8px; }
.ob-opt {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px;
  color: var(--text-faint); background: var(--glass-light); border: 1px solid var(--glass-border);
  padding: 3px 8px; border-radius: 8px;
}
.ob-step .btn { margin-top: 6px; }
.ob-step .btn + .btn { margin-top: 10px; }
.ob-step #ob-next { margin-top: 4px; }
#ob-learn { display: inline-block; margin: 10px 2px 16px; }
/* plan comparison on onboarding step 2 */
.plan-compare { display: flex; flex-direction: column; gap: 8px; margin: 6px 0 16px; }
.plan-line {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 13px; color: var(--text-dim); line-height: 1.4;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  border-radius: 13px; padding: 11px 12px;
}
.plan-line.pro { border-color: rgba(var(--glow),0.35); background: var(--accent-soft); }
.plan-line b { color: var(--text); }
.plan-tag {
  flex-shrink: 0; font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.4px; padding: 3px 8px; border-radius: 7px; line-height: 1.5;
}
.plan-tag.free { background: rgba(255, 255, 255, 0.08); color: var(--text-dim); }
.plan-tag.pro { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--on-accent); box-shadow: 0 0 10px rgba(var(--glow),0.4); }
.ob-foot { font-size: 11.5px; color: var(--text-faint); text-align: center; margin: 12px 0 0; line-height: 1.45; }
.ob-foot b { color: var(--text-dim); }

/* "save key to my account" — liquid-glass checkbox (native input hidden; the .ksr-box
   span is the visual, since iOS Safari can't restyle real checkboxes) */
.key-save-row { display: flex; align-items: center; gap: 9px; margin: 10px 2px 2px; font-size: 12.5px; color: var(--text-dim); cursor: pointer; -webkit-tap-highlight-color: transparent; }
.key-save-row input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.key-save-row .ksr-box {
  flex: none; width: 19px; height: 19px; border-radius: 6px; position: relative;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  transition: background 0.25s var(--spring), border-color 0.25s var(--spring), box-shadow 0.3s var(--spring), transform 0.25s var(--spring);
}
.key-save-row .ksr-box::after {
  content: ""; position: absolute; left: 6px; top: 2.5px; width: 5px; height: 9px;
  border: solid #06231a; border-width: 0 2px 2px 0;
  transform: rotate(45deg) scale(0); transform-origin: center;
  transition: transform 0.25s var(--spring);
}
.key-save-row:active .ksr-box { transform: scale(0.88); }
.key-save-row input:checked + .ksr-box {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: var(--accent);
  box-shadow: var(--sheen), 0 1px 6px rgba(var(--glow), 0.3); /* tight & sleek — no halo ring */
}
.key-save-row input:checked + .ksr-box::after { transform: rotate(45deg) scale(1); }
.key-save-row input:focus-visible + .ksr-box { box-shadow: 0 0 0 3px rgba(var(--glow), 0.4); }
.key-save-row em { color: var(--text-faint); font-style: normal; }

/* inline text links (Terms etc.) — glow green like .link-note, not browser blue */
.warn-note a, .help-note a, .ob-foot a, #gm-body a {
  color: var(--accent); font-weight: 600; text-decoration: underline;
  text-decoration-color: rgba(var(--glow), 0.5); text-underline-offset: 2px;
}
.warn-note a:hover, .help-note a:hover, .ob-foot a:hover, #gm-body a:hover {
  color: var(--accent-hi); text-shadow: 0 0 14px rgba(var(--glow), 0.6);
}

/* onboarding account step */
.ob-account-action { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 48px; margin: 14px 0 12px; }
.ob-account-action > div { display: flex; justify-content: center; } /* the GIS button iframe wrapper */
.ob-signedin { font-size: 14px; color: var(--text-dim); text-align: center; margin: 0; }
.ob-signedin b { color: var(--text); }

.ob-dots { display: flex; gap: 8px; justify-content: center; margin-top: 16px; }
.ob-dots span { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: 0.3s var(--spring); }
.ob-dots span.on { background: var(--accent); transform: scale(1.4); box-shadow: 0 0 8px rgba(var(--glow),0.6); }

/* ---------- Toggle rows ---------- */
.toggle-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--border);
}
.toggle-row:first-of-type { border-top: none; }

/* glass-card each toggle row inside onboarding + settings */
.onboard-card .toggle-row,
.sheet-panel .toggle-row {
  border-top: none;
  background: var(--glass-light);
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}

.toggle-text { display: flex; flex-direction: column; gap: 3px; }
.toggle-title { font-weight: 600; font-size: 15px; }
.toggle-sub { color: var(--text-faint); font-size: 12.5px; line-height: 1.4; }

.switch { position: relative; width: 50px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute; inset: 0;
  background: #2b3b34; border-radius: 30px;
  transition: 0.25s; cursor: pointer;
}
.slider::before {
  content: ""; position: absolute;
  height: 24px; width: 24px; left: 3px; top: 3px;
  background: #fff; border-radius: 50%; transition: 0.25s;
}
.slider {
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.4);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.slider::before {
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 0.3s var(--spring), background 0.25s;
}
.switch input:checked + .slider { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); box-shadow: inset 0 1px 0 rgba(255,255,255,0.25), 0 4px 12px rgba(var(--glow),0.4); }
.switch input:checked + .slider::before { transform: translateX(20px); }

/* ---------- Topbar ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 12px;
  position: sticky; top: 10px; z-index: 5;
  margin: 12px 12px 2px;
  background: linear-gradient(180deg, rgba(16, 28, 23, 0.66), rgba(10, 18, 15, 0.4));
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  box-shadow: var(--sheen), 0 10px 28px rgba(0, 0, 0, 0.3);
}
.topbar-title { font-weight: 700; font-size: 17px; display: flex; align-items: center; gap: 9px; }
.results-summary { font-size: 15px; color: var(--text-dim); }

/* ---------- Setup ---------- */
.setup-body { padding: 20px 18px 30px; }
.setup-body h2 { margin: 6px 0 16px; font-size: 22px; }

/* gas ↔ EV switch */
.vehicle-seg { margin-bottom: 20px; }
.vehicle-seg .seg { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 10px; font-size: 15px; }
.vehicle-seg .seg svg { width: 17px; height: 17px; flex-shrink: 0; }

.loc-status {
  display: flex; align-items: center; gap: 9px;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  padding: 12px 14px; border-radius: 16px; font-size: 13.5px;
  color: var(--text-dim); margin-bottom: 18px;
  box-shadow: var(--sheen);
}
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.pending { background: var(--warn); animation: pulse 1.2s infinite; }
.dot.ok { background: var(--accent); }
.dot.err { background: var(--danger); }
@keyframes pulse { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

.seg-group {
  display: flex; gap: 4px; background: var(--glass);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border); border-radius: 16px; padding: 4px;
  box-shadow: var(--sheen);
}
.seg-group.small .seg { padding: 8px 10px; font-size: 13px; }
.seg {
  flex: 1; border: none; background: transparent; color: var(--text-dim);
  padding: 11px 10px; border-radius: 12px; font-size: 14px; font-weight: 600;
  cursor: pointer; font-family: var(--font);
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.2s var(--spring), color 0.2s ease, background 0.25s ease;
  white-space: nowrap;
}
.seg:active { transform: scale(0.95); }
.seg.active {
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  color: var(--on-accent);
  box-shadow: var(--sheen), 0 4px 14px rgba(var(--glow),0.35);
}

.mode-panel { margin-top: 18px; animation: panelIn 0.32s var(--spring); }
@keyframes panelIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.panel-note { color: var(--text-dim); font-size: 13.5px; line-height: 1.5; }
.panel-note b { color: var(--text); }

.radius-readout { font-size: 38px; font-weight: 750; letter-spacing: -1px; margin: 4px 0 12px; }
.radius-readout.small { font-size: 22px; margin: 16px 0 8px; }
.radius-readout .unit-label { font-size: 18px; color: var(--text-dim); font-weight: 600; }
.radius-readout.small .unit-label { font-size: 14px; }

input[type="range"] {
  -webkit-appearance: none; appearance: none; width: 100%; height: 6px;
  background: #243a31; border-radius: 6px; outline: none; margin: 8px 0;
}
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 26px; height: 26px;
  border-radius: 50%; background: var(--accent); cursor: pointer;
  border: 4px solid var(--on-accent); box-shadow: 0 2px 8px rgba(0,0,0,0.4);
}
input[type="range"]::-moz-range-thumb {
  width: 22px; height: 22px; border-radius: 50%; background: var(--accent);
  cursor: pointer; border: 4px solid var(--on-accent);
}
.range-ticks { display: flex; justify-content: space-between; color: var(--text-faint); font-size: 11px; }

.text-input, .select-input {
  width: 100%; padding: 14px; font-size: 15px; font-family: var(--font);
  background: var(--glass-light);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 14px; color: var(--text); outline: none;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.25);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.text-input:focus, .select-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.select-input { width: auto; min-width: 130px; }

/* custom in-app dropdown (replaces native <select>) */
.dropdown { position: relative; }
.dropdown.open { z-index: 30; }
/* lift the glass row above siblings so the menu isn't covered */
.toggle-row.dd-open { position: relative; z-index: 30; overflow: visible; }
.dropdown-btn {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-width: 132px; padding: 12px 14px; font-family: var(--font); font-size: 15px;
  color: var(--text); cursor: pointer;
  background: var(--glass-light); border: 1px solid var(--glass-border); border-radius: 14px;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
  transition: transform 0.15s var(--spring), border-color 0.2s ease;
}
.dropdown-btn:active { transform: scale(0.97); }
.dropdown-btn .chev { width: 16px; height: 16px; color: var(--text-dim); transition: transform 0.25s var(--spring); }
.dropdown.open .dropdown-btn { border-color: var(--accent); }
.dropdown.open .dropdown-btn .chev { transform: rotate(180deg); }
.dropdown-menu {
  position: absolute; right: 0; left: 0; top: calc(100% + 6px); z-index: 12;
  background: var(--glass-strong); border: 1px solid var(--glass-border); border-radius: 14px; padding: 6px;
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sheen), var(--glass-shadow);
  transform-origin: top center; transform: scale(0.96) translateY(-4px); opacity: 0; pointer-events: none;
  transition: transform 0.2s var(--spring), opacity 0.15s ease;
}
.dropdown.open .dropdown-menu { transform: scale(1) translateY(0); opacity: 1; pointer-events: auto; }
.dropdown-opt {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  background: none; border: none; color: var(--text-dim); font-family: var(--font); font-size: 14px;
  border-radius: 10px; cursor: pointer; transition: background 0.15s ease, color 0.15s ease;
}
.dropdown-opt:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.dropdown-opt.sel { color: var(--accent); font-weight: 650; }

/* EV fast-charger option card */
.ev-fast-card {
  margin-top: 20px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 6px 14px 12px;
  box-shadow: var(--sheen);
  animation: panelIn 0.32s var(--spring);
}
.ev-fast-card .toggle-row { border-top: none; padding: 12px 0; }
.ev-fast-card .toggle-title { display: flex; align-items: center; gap: 8px; }
/* dynamic info note — smoothly expands/collapses with the toggle */
.ev-fast-note {
  overflow: hidden;
  max-height: 0; opacity: 0;
  margin-top: 0; padding-top: 0;
  border-top: 0 solid var(--border);
  transition: max-height 0.4s var(--spring), opacity 0.3s ease,
              margin-top 0.4s var(--spring), padding-top 0.4s var(--spring);
}
.ev-fast-note.show {
  max-height: 220px; opacity: 1;
  margin-top: 6px; padding-top: 12px; border-top-width: 1px;
}
.ev-fast-note p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; color: var(--text-dim); }
.ev-fast-note p:last-child { margin-bottom: 0; }
.ev-fast-note b { color: var(--text); }

/* radius readout reacts when fast-only flips (slider range transforms) */
@keyframes readoutPulse { 0% { transform: scale(1); } 45% { transform: scale(1.12); } 100% { transform: scale(1); } }
.radius-readout.pulse { animation: readoutPulse 0.45s var(--spring); transform-origin: left center; }
input[type="range"] { transition: opacity 0.3s ease; }

/* plug-type bar (EV only) */
.plug-bar { padding-top: 0; }

/* peak/off-peak sub-line under the price (capped so it wraps, never overflows) */
.price-sub { font-size: 11.5px; color: var(--text-faint); margin-top: 3px; max-width: 120px; margin-left: auto; line-height: 1.35; }
.price-sub b { color: var(--warn); font-weight: 700; }

#find-btn { margin-top: 26px; }
.data-note { text-align: center; color: var(--text-faint); font-size: 11.5px; margin-top: 14px; }

/* ---------- Results ---------- */
.sort-bar { display: flex; align-items: center; gap: 12px; padding: 14px 16px 6px; }
.sort-bar .seg-group { flex: 1; }
.sort-label { font-size: 12px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.5px; font-weight: 700; flex-shrink: 0; }

.card-stack {
  position: relative;
  flex: 1;
  margin: 10px 16px;
  min-height: 440px;
  perspective: 1400px;
}

.gas-card {
  position: absolute;
  inset: 0;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--sheen), var(--glass-shadow);
  display: flex; flex-direction: column;
  transition: transform 0.45s var(--spring), opacity 0.4s ease;
  will-change: transform;
  touch-action: pan-y;
  contain: layout style; /* card's internals don't reflow the stack (no paint clip → shadow intact) */
}

.card-map { height: 200px; width: 100%; background: var(--panel-2); cursor: pointer; }
.map-expand {
  position: absolute; top: 12px; right: 12px; z-index: 4;
  width: 36px; height: 36px; border-radius: 12px;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  color: var(--text); display: grid; place-items: center; cursor: pointer;
  box-shadow: var(--sheen), 0 4px 12px rgba(0,0,0,0.3);
  transition: transform 0.18s var(--spring), background 0.2s ease;
}
.map-expand:hover { background: rgba(255,255,255,0.16); }
.map-expand:active { transform: scale(0.9); }
.map-expand svg { width: 17px; height: 17px; display: block; }
.card-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }

.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.station-name { font-size: 19px; font-weight: 700; line-height: 1.2; }
.station-brand { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; display: flex; align-items: center; gap: 6px; }
.badge {
  font-size: 10.5px; font-weight: 700; padding: 3px 8px; border-radius: 8px;
  text-transform: uppercase; letter-spacing: 0.3px;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.15);
}
.badge.indep { background: rgba(255,180,84,0.16); color: var(--warn); }
.badge.deal { background: var(--accent-soft); color: var(--accent); }
.badge.fast { background: rgba(56,189,248,0.16); color: #38bdf8; }
.badge.best { background: linear-gradient(180deg, var(--accent-hi), var(--accent)); color: var(--on-accent); box-shadow: var(--sheen), 0 3px 10px rgba(var(--glow),0.4); }

.price-tag { text-align: right; flex-shrink: 0; }
.price-num { font-size: 30px; font-weight: 800; letter-spacing: -1px; line-height: 1; }
.price-unit { font-size: 12px; color: var(--text-dim); }
.price-was { font-size: 12px; color: var(--text-faint); text-decoration: line-through; }

.card-meta { display: flex; gap: 18px; flex-wrap: wrap; }
.meta-item { display: flex; flex-direction: column; gap: 2px; }
.meta-label { font-size: 11px; color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.4px; }
.meta-val { font-size: 15px; font-weight: 650; }

.deal-line {
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; padding: 9px 12px; border-radius: 12px;
  display: flex; align-items: center; gap: 8px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.08);
}
.deal-line svg { width: 15px; height: 15px; flex-shrink: 0; }
.deal-line + .deal-line { margin-top: 6px; }
/* computed "below local avg" deal — calmer than a promo */
.deal-line.value { background: var(--glass-light); color: var(--text-dim); }
.deal-line.value svg { color: var(--accent); }

/* brand-rewards link in the detail modal */
.reward-chip {
  color: var(--accent); text-decoration: none; font-weight: 600;
}
.reward-chip:hover { text-decoration: underline; }

/* community-deal checkbox in the report form */
.rep-deal-check {
  display: flex; align-items: center; gap: 8px; margin: 4px 0 8px;
  font-size: 13px; color: var(--text-dim); font-weight: 600; cursor: pointer;
}
.rep-deal-check input { width: 16px; height: 16px; accent-color: var(--accent); }

.card-actions { margin-top: auto; display: flex; gap: 10px; }
.card-actions .btn { flex: 1; }

.swipe-hint { text-align: center; color: var(--text-faint); font-size: 11px; padding-bottom: 4px; }

/* card navigation */
.card-nav {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  padding: 12px 16px 26px;
}
.round-btn {
  width: 50px; height: 50px; border-radius: 50%;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur);
  backdrop-filter: var(--glass-blur);
  color: var(--text); font-size: 24px; cursor: pointer; line-height: 1;
  display: grid; place-items: center;
  box-shadow: var(--sheen), 0 6px 18px rgba(0,0,0,0.3);
  transition: transform 0.2s var(--spring), background 0.2s ease;
}
.round-btn:hover:not(:disabled) { background: rgba(255,255,255,0.14); }
.round-btn:active:not(:disabled) { transform: scale(0.9); }
.round-btn:disabled { opacity: 0.3; cursor: default; }
.card-dots { display: flex; gap: 7px; flex-wrap: wrap; max-width: 200px; justify-content: center; }
.card-dots .d { width: 7px; height: 7px; border-radius: 50%; background: rgba(255,255,255,0.2); transition: 0.3s var(--spring); }
.card-dots .d.on { background: var(--accent); transform: scale(1.5); box-shadow: 0 0 10px rgba(var(--glow),0.7); }

/* ---------- Empty ---------- */
.empty { justify-content: center; }
.empty-inner { text-align: center; padding: 40px 28px; }
.empty-icon { margin-bottom: 16px; display: grid; place-items: center; }
.empty-icon svg {
  width: 56px; height: 56px; color: var(--text-faint);
  padding: 18px; border-radius: 24px;
  background: var(--glass); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--sheen); box-sizing: content-box;
}
.empty-inner h2 { margin: 0 0 8px; }
.empty-inner p { color: var(--text-dim); margin: 0 0 22px; }

/* ---------- Settings sheet ---------- */
.sheet { position: fixed; inset: 0; z-index: 50; }
/* frost lives on the (non-scrolling) backdrop layer to avoid iOS box-shadow
   drift on a scrolling backdrop-filtered panel */
.sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); -webkit-backdrop-filter: saturate(160%) blur(20px); backdrop-filter: saturate(160%) blur(20px); animation: fade 0.2s ease; }
.sheet-panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: 460px; margin: 0 auto;
  background: rgba(17, 29, 25, 0.95); /* near-opaque: no backdrop-filter on the scroller */
  border-top-left-radius: 28px; border-top-right-radius: 28px;
  border: 1px solid var(--glass-border); padding: 8px 20px calc(28px + env(safe-area-inset-bottom));
  box-shadow: var(--sheen), 0 -10px 40px rgba(0,0,0,0.4);
  animation: slideUp 0.42s var(--spring);
  max-height: 88vh; overflow-y: auto;
}
@keyframes slideUp { from { transform: translateY(100%);} to {transform: none;} }
/* animated close (slide down + backdrop fade) — see dismissSheet() in ui.js */
@keyframes sheetDown { from { transform: none; opacity: 1; } to { transform: translateY(100%); opacity: 0.5; } }
@keyframes backdropOut { to { opacity: 0; } }
.sheet.closing .sheet-panel { animation: sheetDown 0.34s var(--spring) forwards; }
.sheet.closing .sheet-backdrop { animation: backdropOut 0.34s ease forwards; }
/* sleek thin scrollbar for scrollable glass panels */
.sheet-panel, .map-modal-panel { scrollbar-width: thin; scrollbar-color: rgba(255,255,255,0.2) transparent; }
.sheet-panel::-webkit-scrollbar, .map-modal-panel::-webkit-scrollbar { width: 8px; }
/* big top/bottom inset → shorter bar that never reaches the rounded corners */
.sheet-panel::-webkit-scrollbar-track, .map-modal-panel::-webkit-scrollbar-track { background: transparent; margin: 34px 0; }
.sheet-panel::-webkit-scrollbar-thumb, .map-modal-panel::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2); border-radius: 99px;
  border: 2px solid transparent; background-clip: padding-box;  /* thin pill, inset from edge */
}
.sheet-panel::-webkit-scrollbar-thumb:hover, .map-modal-panel::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.34); background-clip: padding-box; }
.sheet-handle { width: 40px; height: 4px; background: rgba(255,255,255,0.25); border-radius: 4px; margin: 6px auto 4px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; }
.sheet-head h2 { margin: 0; font-size: 20px; }
.units-seg { max-width: 180px; }
.toggle-row.col { flex-direction: column; align-items: stretch; gap: 10px; }
.toggle-row.col .text-input { width: 100%; }
.link-note {
  align-self: flex-start;
  background: none; border: none; padding: 0; margin: 0;
  font-family: var(--font); font-size: 12.5px; font-weight: 600;
  color: var(--accent); text-decoration: none; cursor: pointer;
  text-shadow: 0 0 10px rgba(var(--glow),0.35);
  transition: text-shadow 0.2s ease, color 0.2s ease, opacity 0.15s ease;
}
.link-note:hover { color: var(--accent-hi); text-shadow: 0 0 16px rgba(var(--glow),0.65); }
.link-note:active { opacity: 0.6; }
#redo-onboarding { margin-top: 20px; }

/* movable plan CTA slots — collapse cleanly when empty */
/* The outside slot eases open/shut (height + margin) so the sheet "scoots" to make
   room instead of snapping when the button relocates. Its overflow clip would slice
   the button's big halo into a harsh band, so the slot carries padding for the glow
   (negative margins keep the layout) and the button wears the tamer drawer glow. */
#plan-cta-outside {
  margin: 0 -12px; padding: 0 12px; max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.32s var(--spring), opacity 0.24s ease, margin 0.32s var(--spring), padding 0.32s var(--spring);
}
#plan-cta-outside.open { margin: 6px -12px -10px; padding: 4px 12px 18px; max-height: 96px; opacity: 1; }
#plan-cta-outside .btn-primary { box-shadow: var(--sheen), 0 4px 12px rgba(var(--glow), 0.25); }
#plan-cta-outside .btn-primary:hover:not(:disabled) { filter: none; }
#plan-cta-inside:empty { display: none; }
#plan-cta-inside { margin-bottom: 4px; }
/* smooth fade when the Upgrade/Manage button glides between slots */
#plan-cta { transition: opacity 0.2s ease, transform 0.2s var(--spring), filter 0.2s ease; }
#plan-cta.cta-fading { opacity: 0; transform: translateY(4px); }

/* API & more (collapsible) */
.settings-section { border-top: 1px solid var(--border); margin-top: 8px; }
.section-toggle {
  width: 100%; display: flex; align-items: center; justify-content: space-between;
  background: none; border: none; color: var(--text); font-family: var(--font);
  font-size: 15px; font-weight: 600; padding: 16px 2px; cursor: pointer;
}
.section-toggle .chev { width: 18px; height: 18px; color: var(--text-dim); transition: transform 0.25s var(--spring); }
.section-toggle.open .chev { transform: rotate(180deg); }
.section-body {
  display: flex; flex-direction: column; gap: 10px; padding: 0 2px;
  max-height: 0; opacity: 0; overflow: hidden;
  transition: max-height 0.4s var(--spring), opacity 0.3s ease, padding 0.4s var(--spring);
}
.section-body.show { max-height: 960px; opacity: 1; padding: 4px 2px 8px; }
/* tame glows inside the drawer — big halos get clipped by its overflow and
   leave harsh bands, so keep them tight in here */
.section-body .btn-primary { box-shadow: var(--sheen), 0 3px 10px rgba(var(--glow),0.2); }
.section-body .seg.active { box-shadow: var(--sheen), 0 2px 6px rgba(var(--glow),0.2); }
.section-body .btn-primary:hover:not(:disabled) { filter: none; }
.field-label {
  font-size: 11px; color: var(--text-faint); text-transform: uppercase;
  letter-spacing: 0.4px; font-weight: 700; margin: 2px 0 7px;
  display: flex; align-items: center; gap: 8px; /* badges sit beside the text, not over the field below */
}
.api-or { text-align: center; font-size: 11.5px; color: var(--text-faint); margin: 4px 0 2px; }
.usekey-seg { width: 100%; }
.api-pro-card {
  display: flex; align-items: center; gap: 10px;
  background: var(--accent-soft); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 12px 14px;
}
.api-pro-card p { margin: 0; font-size: 13px; color: var(--text-dim); }

/* ---------- data source pill + loading ---------- */
.data-banner { display: flex; justify-content: center; padding: 4px 16px 0; }
.src-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 12px; font-size: 11px; font-weight: 600;
  color: var(--text-dim); letter-spacing: 0.2px;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  border-radius: 999px;
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.10);
}
.src-dot { width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0; }
.src-pill.src-google .src-dot { background: var(--accent); box-shadow: 0 0 8px var(--accent); }
.src-pill.src-osm .src-dot { background: var(--warn); }
.src-pill.src-demo .src-dot { background: var(--text-faint); }
button.src-pill { cursor: pointer; font-family: var(--font); }
.src-pill.src-warn {
  color: var(--warn); border-color: rgba(255,180,84,0.4);
  background: rgba(255,180,84,0.12);
}
.src-pill.src-warn .src-dot { background: var(--warn); box-shadow: 0 0 8px var(--warn); animation: pulse 1.4s infinite; }

/* help / troubleshooting sheet */
.help-section { margin: 4px 0 8px; }
.help-section h3 { font-size: 15px; margin: 14px 0 8px; }
.help-note { color: var(--text-dim); font-size: 13px; line-height: 1.5; margin: 0 0 10px; }
/* small non-blocking toast (e.g. "maps limit reached — switched to free map") */
.fs-toast {
  position: fixed; left: 50%; bottom: 26px; transform: translate(-50%, 16px);
  z-index: 9999; pointer-events: none; max-width: min(92vw, 420px);
  padding: 12px 18px; border-radius: 14px; font-size: 13.5px; font-weight: 600;
  color: var(--text); text-align: center;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sheen), var(--glass-shadow);
  opacity: 0; transition: opacity 0.35s ease, transform 0.35s var(--spring);
}
.fs-toast.show { opacity: 1; transform: translate(-50%, 0); }

.warn-note { color: var(--warn); font-size: 12px; }
.warn-note b { color: var(--warn); }
.help-steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 9px; }
.help-steps li { color: var(--text-dim); font-size: 13px; line-height: 1.5; }
.help-steps li b { color: var(--text); }
.help-steps code {
  display: inline-block; margin-top: 4px; font-size: 12px;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  padding: 4px 8px; border-radius: 8px; color: var(--accent);
  word-break: break-all;
}
.help-section a { color: var(--accent); }
.help-keyrow { display: flex; gap: 8px; margin-top: 14px; }
.help-keyrow .text-input { flex: 1; }
.help-keyrow .btn { white-space: nowrap; }
.loading-overlay {
  position: fixed; inset: 0; z-index: 60;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; background: rgba(8,14,12,0.55);
  -webkit-backdrop-filter: saturate(160%) blur(16px);
  backdrop-filter: saturate(160%) blur(16px);
  color: var(--text-dim); font-size: 14px;
}
.spinner {
  width: 44px; height: 44px; border-radius: 50%;
  border: 4px solid #243a31; border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}

/* ---------- "Add to Home Screen" banner ---------- */
.install-banner {
  position: fixed; z-index: 70;
  left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
  max-width: 440px; margin: 0 auto;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: 22px; padding: 16px 16px 14px;
  -webkit-backdrop-filter: var(--glass-blur); backdrop-filter: var(--glass-blur);
  box-shadow: var(--sheen), 0 12px 34px rgba(0,0,0,0.45);
  transform: translateY(140%); opacity: 0;
  transition: transform 0.42s var(--spring), opacity 0.3s ease;
}
.install-banner.show { transform: none; opacity: 1; }
.install-x {
  position: absolute; top: 10px; right: 10px;
  width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border);
  color: var(--text-dim); font-size: 12px; line-height: 1; cursor: pointer;
}
.install-row { display: flex; align-items: center; gap: 12px; padding-right: 24px; }
.install-icon { width: 44px; height: 44px; border-radius: 12px; flex: none; box-shadow: 0 2px 8px rgba(0,0,0,0.4); }
.install-text { display: flex; flex-direction: column; gap: 3px; }
.install-text b { font-size: 14.5px; color: var(--text); }
.install-text span { font-size: 12.5px; color: var(--text-dim); line-height: 1.4; }
.ios-share { display: inline-block; width: 15px; height: 15px; vertical-align: -3px; fill: var(--accent); }
.install-actions { margin-top: 12px; }
.install-actions .btn { padding: 12px 14px; font-size: 15px; }
.install-hint { font-size: 11.5px; color: var(--text-faint); margin: 8px 2px 0; line-height: 1.45; text-align: center; }
.install-hint b { color: var(--text-dim); }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- full interactive map modal ---------- */
.map-modal { position: fixed; inset: 0; z-index: 70; display: flex; }
.map-modal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  animation: fade 0.2s ease;
}
.map-modal-panel {
  position: relative; margin: auto;
  width: min(440px, 94vw); height: min(86vh, 780px);
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: 28px;
  -webkit-backdrop-filter: saturate(180%) blur(30px); backdrop-filter: saturate(180%) blur(30px);
  box-shadow: var(--sheen), var(--glass-shadow);
  animation: popIn 0.4s var(--spring);
}
@keyframes popIn { from { transform: scale(0.92); opacity: 0; } to { transform: none; opacity: 1; } }
.map-modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 16px 12px; }
.mm-name { font-size: 18px; font-weight: 700; line-height: 1.2; }
.mm-sub { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.map-modal-map { flex: 1; width: 100%; background: var(--panel-2); }
.map-modal-actions { padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); }

/* leaflet dark tweak */
.leaflet-container { background: var(--panel-2); font-family: var(--font); }
.leaflet-control-attribution { font-size: 9px; opacity: 0.6; }

/* maplibre dark tweak — match the liquid-glass theme */
.maplibregl-map { background: var(--panel-2); font-family: var(--font); }
.maplibregl-ctrl-attrib { font-size: 9px; opacity: 0.7; background: rgba(10, 16, 13, 0.55) !important; }
.maplibregl-ctrl-attrib a { color: #9fb3a9 !important; }
.maplibregl-ctrl-group {
  background: rgba(16, 24, 20, 0.82) !important;
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.maplibregl-ctrl-group button + button { border-top: 1px solid rgba(255, 255, 255, 0.1) !important; }
.maplibregl-ctrl button .maplibregl-ctrl-icon { filter: invert(0.88); }

/* ---------- glass modal (replaces alert) ---------- */
.gmodal { position: fixed; inset: 0; z-index: 80; display: flex; }
.gmodal-backdrop {
  position: absolute; inset: 0; background: rgba(0,0,0,0.5);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  animation: fade 0.2s ease;
}
.gmodal-panel {
  position: relative; margin: auto; width: min(360px, 88vw);
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: 26px; padding: 24px 22px 20px;
  -webkit-backdrop-filter: saturate(180%) blur(28px); backdrop-filter: saturate(180%) blur(28px);
  box-shadow: var(--sheen), var(--glass-shadow);
  animation: popIn 0.38s var(--spring);
  text-align: center;
}
.gmodal-icon {
  width: 56px; height: 56px; margin: 0 auto 12px; display: grid; place-items: center;
  border-radius: 18px; background: var(--accent-soft); color: var(--accent);
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.25);
}

/* in-app embedded checkout (Option A) */
.checkout-panel {
  width: min(460px, 94vw); max-height: 90vh; padding: 0; overflow: hidden;
  display: flex; flex-direction: column; text-align: left;
}
.checkout-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--glass-border);
  font-weight: 700; font-size: 15px; flex: none;
}
.co-close {
  background: rgba(255,255,255,0.08); border: 1px solid var(--glass-border);
  color: var(--text-dim); width: 30px; height: 30px; border-radius: 50%;
  font-size: 14px; cursor: pointer; line-height: 1; flex: none;
  transition: background 0.2s, color 0.2s;
}
.co-close:hover { background: rgba(255,255,255,0.15); color: var(--text); }
#co-mount, #co-custom { overflow-y: auto; padding: 14px 16px 18px; -webkit-overflow-scrolling: touch; }
#co-mount { min-height: 220px; }
.co-loading { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 48px 0; color: var(--text-faint); font-size: 13px; }
.co-error { padding: 32px 16px; text-align: center; color: var(--text-dim); font-size: 14px; }

/* custom liquid-glass payment sheet (Option B) */
#co-express { min-height: 0; margin-bottom: 4px; }
.co-divider { display: flex; align-items: center; gap: 12px; margin: 14px 0; color: var(--text-faint); font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.4px; }
.co-divider::before, .co-divider::after { content: ""; flex: 1; height: 1px; background: var(--glass-border); }
#co-payment { margin-bottom: 14px; }
#co-pay { padding: 14px; font-size: 16px; }
.co-err2 { color: #ff8a8a; font-size: 13px; margin: 10px 2px 0; text-align: center; }
.co-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; flex-wrap: wrap; }
.co-powered, #co-powered { font-size: 11.5px; color: var(--text-faint); text-decoration: none; }
.co-powered:hover, #co-powered:hover { color: var(--text-dim); }
.co-extlink { background: none; border: none; padding: 0; font-family: var(--font); font-size: 11.5px; font-weight: 600; color: var(--accent); cursor: pointer; }
.co-extlink:hover { color: var(--accent-hi); text-shadow: 0 0 12px rgba(var(--glow), 0.5); }
.gmodal-icon svg { width: 26px; height: 26px; }
.gmodal-title { margin: 0 0 8px; font-size: 19px; }
.gmodal-body { font-size: 14px; color: var(--text-dim); line-height: 1.55; text-align: left; }
.gmodal-body b { color: var(--text); }
.gmodal-actions { display: flex; gap: 10px; margin-top: 18px; }
.gmodal-actions .btn { flex: 1; padding: 13px 14px; font-size: 15px; }
.gm-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px;
}
.gm-row:last-child { border-bottom: none; }
.gm-k { color: var(--text-faint); }
.gm-v { color: var(--text); font-weight: 600; text-align: right; }

/* plan picker (Pro pitch) — clear price + trial, tappable rows */
.gm-plans { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.gm-plan {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 13px 16px; border-radius: 16px; cursor: pointer;
  background: rgba(255,255,255,0.05); border: 1px solid var(--glass-border);
  color: var(--text); font-family: var(--font); text-align: left;
  transition: transform 0.15s var(--spring), border-color 0.2s, background 0.2s;
}
.gm-plan:hover { border-color: var(--accent); background: var(--accent-soft); }
.gm-plan:active { transform: scale(0.98); }
.gm-plan-l { display: flex; flex-direction: column; gap: 2px; font-size: 15px; font-weight: 650; }
.gm-plan-trial { font-size: 11.5px; font-weight: 600; color: var(--accent); }
.gm-plan-r { font-size: 20px; font-weight: 750; white-space: nowrap; }
.gm-per { font-size: 12.5px; font-weight: 600; color: var(--text-faint); }

/* ad placeholder */
.ad-box { text-align: center; padding: 8px 0 2px; }
.ad-count {
  width: 64px; height: 64px; margin: 0 auto 10px; display: grid; place-items: center;
  border-radius: 50%; font-size: 26px; font-weight: 800;
  background: var(--accent-soft); color: var(--accent);
  box-shadow: 0 0 18px rgba(var(--glow),0.4);
}

/* ---------- chips (trip categories) ---------- */
.chip-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-check {
  padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600;
  font-family: var(--font); cursor: pointer; color: var(--text-dim);
  background: var(--glass-light); border: 1px solid var(--glass-border);
  transition: transform 0.15s var(--spring), background 0.2s, color 0.2s, border-color 0.2s;
}
.chip-check:active { transform: scale(0.94); }
.chip-check.on {
  background: var(--accent-soft); color: var(--accent);
  border-color: rgba(var(--glow),0.45); box-shadow: 0 0 10px rgba(var(--glow),0.25);
}

/* ---------- autocomplete ---------- */
.ac-wrap { position: relative; }
.ac-list {
  position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 25;
  background: var(--glass-strong); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 6px; overflow: hidden;
  -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sheen), var(--glass-shadow);
  animation: fade 0.15s ease;
}
.ac-item {
  display: block; width: 100%; text-align: left; padding: 10px 12px;
  background: none; border: none; color: var(--text-dim);
  font-family: var(--font); font-size: 14px; border-radius: 10px; cursor: pointer;
}
.ac-item:hover { background: rgba(255,255,255,0.08); color: var(--text); }
.ac-main { display: block; color: var(--text); font-size: 14px; font-weight: 600; line-height: 1.25; }
.ac-sub { display: block; color: var(--text-faint); font-size: 12px; margin-top: 2px; }

/* ---------- report sheet ---------- */
.rep-list { display: flex; flex-direction: column; gap: 7px; margin-top: 10px; max-height: 320px; overflow-y: auto; }
.rep-item {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 13px 14px; border-radius: 14px; cursor: pointer; text-align: left;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  color: var(--text); font-family: var(--font); font-size: 14px;
  transition: background 0.15s ease, transform 0.15s var(--spring);
}
.rep-item:active { transform: scale(0.98); }
.rep-item:hover { background: rgba(255,255,255,0.09); }
.rep-item-name { font-weight: 600; }
.rep-item-addr { display: block; color: var(--text-faint); font-size: 12px; margin-top: 3px; line-height: 1.35; }
.rep-item-dist { color: var(--text-faint); font-size: 12.5px; flex-shrink: 0; }
.rep-item.here {
  background: var(--accent-soft);
  border-color: rgba(var(--glow),0.45);
  box-shadow: 0 0 10px rgba(var(--glow),0.18);
}
.rep-item.here .rep-item-dist { color: var(--accent); font-weight: 700; }
.rep-empty { color: var(--text-faint); font-size: 13px; text-align: center; padding: 18px 8px; }
.rep-station { font-size: 18px; font-weight: 700; margin: 10px 0 8px; }
.rep-verify { margin-bottom: 12px; }
.rep-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 10px 0; }
.rep-grid label { display: flex; flex-direction: column; gap: 5px; font-size: 12px; color: var(--text-faint); font-weight: 600; }
#rep-submit { margin-top: 6px; }

/* card: "I'm here" + crowd tag */
.crowd-line {
  display: flex; align-items: center; gap: 8px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 12.5px; padding: 9px 12px; border-radius: 12px;
}
.crowd-line svg { width: 15px; height: 15px; flex-shrink: 0; }
.imhere-btn {
  width: 100%; padding: 11px; border-radius: 12px; cursor: pointer;
  background: var(--accent-soft); border: 1px dashed rgba(var(--glow),0.5);
  color: var(--accent); font-family: var(--font); font-size: 13.5px; font-weight: 650;
  transition: background 0.2s ease, transform 0.15s var(--spring);
}
.imhere-btn:active { transform: scale(0.98); }

/* ---------- trip planner ---------- */
#trip-sheet .sheet-panel {
  width: min(460px, calc(100vw - 24px));
  max-height: calc(100vh - 20px);
  max-height: calc(100dvh - 20px);
  bottom: max(10px, env(safe-area-inset-bottom));
  border-radius: 30px;
  padding: 8px 16px 18px;
  background:
    linear-gradient(180deg, rgba(19, 35, 29, 0.92), rgba(10, 20, 17, 0.96)),
    var(--glass-strong);
  box-shadow: var(--sheen), 0 -12px 44px rgba(0,0,0,0.42), 0 0 0 1px rgba(255,255,255,0.04);
  scroll-padding-bottom: 86px;
}
#trip-sheet .sheet-head {
  margin: 8px 2px 18px;
  align-items: center;
}
#trip-sheet .sheet-head h2 {
  font-size: 24px;
  letter-spacing: -0.4px;
}
#trip-sheet .icon-btn {
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
}
#trip-form {
  display: flex;
  flex-direction: column;
}
#trip-form .field-label {
  margin: 0 0 8px;
}
#trip-form .trip-label-row {
  justify-content: space-between;
  margin-bottom: 8px;
}
.current-loc-chip {
  flex: 0 0 auto;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--glass-light);
  color: var(--text-dim);
  font-family: var(--font);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2px;
  text-transform: none;
  cursor: pointer;
  box-shadow: var(--sheen);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.18s var(--spring), background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.current-loc-chip.on {
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: rgba(var(--glow),0.45);
  box-shadow: var(--sheen), 0 4px 12px rgba(var(--glow),0.18);
}
.current-loc-chip:is(:hover, :focus-visible) {
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(var(--glow),0.18), rgba(var(--glow),0.08)),
    rgba(255,255,255,0.08);
  border-color: rgba(var(--glow),0.36);
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.22), 0 0 16px rgba(var(--glow),0.12);
}
.current-loc-chip.on:is(:hover, :focus-visible) {
  color: var(--on-accent);
  background: linear-gradient(180deg, var(--accent-hi), var(--accent));
  border-color: rgba(var(--glow),0.45);
  filter: brightness(1.08);
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.35), 0 0 18px rgba(var(--glow),0.18);
}
.current-loc-chip:active {
  transform: scale(0.95);
}
#trip-form .ac-wrap {
  margin-bottom: 12px;
}
#trip-form .text-input {
  min-height: 54px;
  border-radius: 18px;
  background: rgba(44, 74, 62, 0.34);
}
#trip-form .text-input:disabled {
  opacity: 1;
  color: var(--accent);
  -webkit-text-fill-color: var(--accent);
  background:
    linear-gradient(180deg, rgba(var(--glow),0.14), rgba(var(--glow),0.06)),
    rgba(44, 74, 62, 0.30);
  border-color: rgba(var(--glow),0.32);
  box-shadow: var(--sheen), inset 0 1px 2px rgba(0,0,0,0.18);
}
#trip-form textarea.text-input {
  min-height: 82px;
  line-height: 1.35;
}
#trip-form .help-note {
  margin: 8px 0 16px;
}
#trip-sheet .trip-toggle {
  align-items: center;
  gap: 16px;
  padding: 16px 22px 16px 18px;
  margin: 0 0 14px;
  border-radius: 20px;
}
#trip-sheet .trip-toggle .toggle-text {
  min-width: 0;
  padding: 2px 10px 2px 2px;
}
#trip-sheet .trip-toggle .toggle-title {
  display: block;
  line-height: 1.2;
}
#trip-sheet .trip-toggle .toggle-sub {
  display: block;
  margin-top: 5px;
  line-height: 1.3;
}
#trip-sheet .trip-toggle .switch {
  margin-right: 2px;
}
#trip-vehicle {
  margin-bottom: 4px;
}
#trip-gas-inputs {
  margin: 0 0 10px;
}
#trip-gas-inputs .range-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  line-height: 1.25;
  font-size: 12px;
  color: var(--text-faint);
  font-weight: 600;
}
#trip-gas-inputs .range-label {
  min-height: 30px;
  display: flex;
  align-items: flex-end;
}
.num-stepper {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  align-items: center;
  gap: 6px;
  min-height: 54px;
  padding: 5px;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255,255,255,0.07), rgba(255,255,255,0.025)),
    rgba(44, 74, 62, 0.30);
  border: 1px solid var(--glass-border);
  box-shadow: var(--sheen), inset 0 1px 2px rgba(0,0,0,0.18);
}
.num-stepper .text-input {
  min-height: 42px;
  padding: 8px 4px;
  border: none;
  border-radius: 12px;
  background: transparent;
  box-shadow: none;
  text-align: center;
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
}
.num-stepper .text-input:focus {
  box-shadow: none;
}
.num-stepper input[type="number"]::-webkit-outer-spin-button,
.num-stepper input[type="number"]::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.num-stepper input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}
.step-btn {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: rgba(255,255,255,0.08);
  color: var(--text-dim);
  font-family: var(--font);
  cursor: pointer;
  box-shadow: var(--sheen);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: transform 0.18s var(--spring), color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}
.step-btn span {
  position: relative;
  width: 14px;
  height: 14px;
  display: block;
  pointer-events: none;
}
.step-btn span::before,
.step-btn span::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 14px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.22);
}
.step-btn span::after {
  display: none;
}
.step-btn.plus span::after {
  display: block;
  transform: translate(-50%, -50%) rotate(90deg);
}
.step-btn.plus span {
  width: 14px;
  height: 14px;
}
.step-btn.plus span::before,
.step-btn.plus span::after {
  height: 2px;
  width: 14px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.22);
}
.step-btn:hover,
.step-btn.minus:hover {
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(var(--glow),0.18), rgba(var(--glow),0.08)),
    rgba(255,255,255,0.08);
  border-color: rgba(var(--glow),0.36);
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.22), 0 0 16px rgba(var(--glow),0.12);
}
.step-btn.plus:hover {
  color: var(--accent);
  background:
    linear-gradient(180deg, rgba(var(--glow),0.18), rgba(var(--glow),0.08)),
    rgba(255,255,255,0.08);
  border-color: rgba(var(--glow),0.36);
  filter: none;
  box-shadow: var(--sheen), 0 8px 22px rgba(var(--glow),0.22), 0 0 16px rgba(var(--glow),0.12);
}
.step-btn:focus-visible {
  outline: none;
  border-color: rgba(var(--glow),0.30);
  box-shadow: var(--sheen), 0 0 0 2px rgba(var(--glow),0.18);
}
.step-btn:active {
  transform: scale(0.9);
}
#trip-cats {
  margin-bottom: 18px;
}
#trip-go {
  position: sticky;
  bottom: 0;
  z-index: 3;
  margin-top: 18px;
  margin-bottom: 8px;
  min-height: 54px;
  flex-shrink: 0;
}
#trip-quota {
  margin: 10px 0 0;
  padding-bottom: 2px;
}
.trip-sum {
  background: var(--accent-soft); border: 1px solid rgba(var(--glow),0.35);
  border-radius: 16px; padding: 14px 16px; margin: 10px 0 6px;
}
.trip-sum-main { font-size: 22px; font-weight: 800; letter-spacing: -0.5px; }
.trip-sum-sub { font-size: 12.5px; color: var(--text-dim); margin-top: 3px; }
.trip-h { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--text-faint); margin: 18px 0 8px; }
.trip-stop {
  background: var(--glass-light); border: 1px solid var(--glass-border);
  border-radius: 14px; padding: 12px 14px; margin-bottom: 10px;
}
.trip-stop-mi { font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 8px; }
.trip-opt {
  display: flex; justify-content: space-between; align-items: center; gap: 10px;
  padding: 8px 0; border-top: 1px solid var(--border); font-size: 14px;
}
.trip-opt:first-of-type { border-top: none; }
.trip-opt-sub { display: block; font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.trip-opt .btn { flex: 0 0 auto; padding: 8px 16px; font-size: 13px; }
.trip-rec { padding: 9px 2px; border-bottom: 1px solid var(--border); font-size: 14px; }
.trip-rec:last-of-type { border-bottom: none; }
#trip-vibe { resize: none; }

/* ---- interactive results: live map + selectable stops ---- */
.trip-delta {
  margin-top: 6px; font-size: 12.5px; font-weight: 700; color: var(--warn);
}
.trip-tip { font-size: 12.5px; color: var(--text-dim); margin: 10px 0 8px; }
/* small, neat map-provider switch on the trip results page (shown only on fallback) */
.trip-map-switch { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 6px 0 2px; }
.trip-map-switch > span { font-size: 12px; color: var(--text-faint); font-weight: 600; }
.trip-map-switch .seg-group { padding: 3px; }
.trip-map-switch .seg { padding: 5px 12px; font-size: 12px; }
#trip-map {
  height: 230px; border-radius: 16px; overflow: hidden; margin: 4px 0 6px;
  border: 1px solid var(--glass-border); box-shadow: var(--sheen), 0 8px 24px rgba(0,0,0,0.35);
  background: var(--panel);
}
#trip-map .leaflet-container { background: var(--panel); font-family: var(--font); }

/* Google Maps Embed has no native dark mode (sealed iframe) — fake it with a CSS
   filter on the iframe element (works cross-origin since it filters the rendered
   output, not the inner DOM). invert+hue-rotate flips the light map to dark while
   keeping water/route colours roughly sane. */
.embed-map { filter: invert(0.92) hue-rotate(180deg) saturate(0.75) brightness(0.95) contrast(0.92); }

.trip-ai-msg {
  font-size: 14px; line-height: 1.5; color: var(--text); margin: 2px 0 12px;
  padding: 11px 13px; background: var(--accent-soft);
  border: 1px solid rgba(var(--glow),0.30); border-radius: 13px;
}

/* a selectable stop row */
.trip-pick {
  display: flex; align-items: center; gap: 11px;
  padding: 11px 12px; margin-bottom: 8px; border-radius: 13px;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  cursor: pointer; transition: background 0.2s, border-color 0.2s, transform 0.12s var(--spring);
}
.trip-pick:active { transform: scale(0.99); }
.trip-pick.on {
  background: var(--accent-soft); border-color: rgba(var(--glow),0.45);
  box-shadow: 0 0 12px rgba(var(--glow),0.18);
}
.pick-check {
  flex: 0 0 auto; width: 22px; height: 22px; border-radius: 7px;
  border: 2px solid var(--glass-border); background: rgba(255,255,255,0.04);
  position: relative; transition: background 0.2s, border-color 0.2s;
}
.trip-pick.on .pick-check { background: var(--accent); border-color: var(--accent); }
.trip-pick.on .pick-check::after {
  content: ""; position: absolute; left: 6px; top: 2px;
  width: 5px; height: 10px; border: solid var(--on-accent);
  border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.pick-body { flex: 1 1 auto; min-width: 0; }
.pick-name { display: block; font-size: 14px; font-weight: 600; color: var(--text); }
.pick-sub { display: block; font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.pick-detour { color: var(--text-dim); font-weight: 600; }
.pick-reason { display: block; font-size: 12.5px; color: var(--text-dim); margin-top: 5px; line-height: 1.45; font-style: italic; }
.pick-nav { flex: 0 0 auto; padding: 7px 14px; font-size: 13px; }
.trip-alts { font-size: 12px; color: var(--text-faint); margin-top: 8px; line-height: 1.5; }

/* ===== CARD PAGER =====
   Every card is ALWAYS fully open. You magnetically SNAP to each card (scroll-snap mandatory
   + snap-stop → intentional, swipe-like). A SUBTLE depth fisheye (scale + fade, JS-driven via
   transform/opacity) makes it feel like swiping through full cards — GPU, no layout reflow. */
.tp-card {
  position: relative; margin-bottom: 12px; border-radius: 16px; overflow: hidden;
  background: var(--glass-light); border: 1px solid var(--glass-border);
  transition: background .3s, border-color .3s, box-shadow .35s var(--spring);
  cursor: pointer; transform-origin: center center; will-change: transform, opacity;
  /* COLLAPSED cards: snap-stop NORMAL → a flick can glide past unopened cards more easily */
  scroll-snap-align: start; scroll-snap-stop: normal;
}
/* OPENED cards snap FIRMLY (you can't fly past an expanded card) — keeps the magnet on open cards + section starts */
.tp-card.expanded { scroll-snap-stop: always; }
/* "Collapse" pill on an open card's photo — clipped away when the card is collapsed (media height 0) */
.tp-collapse {
  position: absolute; top: 8px; right: 8px; z-index: 3;
  display: inline-flex; align-items: center; gap: 3px;
  padding: 5px 11px; font-size: 11px; font-weight: 700; line-height: 1;
  color: #fff; background: rgba(0,0,0,0.42); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,0.28); border-radius: 999px;
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.tp-collapse:hover { background: rgba(0,0,0,0.62); }
.tp-collapse:active { transform: scale(.95); }
#trip-sheet .sheet-panel.tp-snapping { scroll-snap-type: y mandatory; overflow-anchor: none; }

/* the centered card gets the accent highlight (.tp-focus set by JS) */
.tp-card.tp-focus {
  background: var(--accent-soft); border-color: rgba(var(--glow),.45);
  box-shadow: 0 14px 34px rgba(0,0,0,.4), inset 0 0 0 1px rgba(var(--glow),.16);
}
.tp-card.selected { border-color: rgba(var(--glow),.5); }
.tp-card.selected::after {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px;
  background: var(--accent); z-index: 5; box-shadow: 0 0 10px rgba(var(--glow),.6);
}

/* PHOTO BAND — always fully open */
/* media + extra collapse/expand by class (only the FIRST card of each section opens by default;
   tap any other to open it). Discrete state → a smooth spring transition on tap. */
.tp-media { position: relative; height: 0; overflow: hidden; background: var(--panel); transition: height .42s var(--spring); }
.tp-card.expanded .tp-media { height: 190px; }
.tp-photos {
  display: flex; height: 190px; overflow-x: auto; overflow-y: hidden;
  scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
  scrollbar-width: none; overscroll-behavior-x: contain;
  touch-action: pan-x; cursor: grab;
}
.tp-photos:active { cursor: grabbing; }
.tp-photos::-webkit-scrollbar { display: none; }
.tp-photo {
  flex: 0 0 100%; width: 100%; height: 190px; scroll-snap-align: center;
  background-size: cover; background-position: center; background-repeat: no-repeat;
  position: relative;
}
.tp-photo.gen { display: flex; align-items: center; justify-content: center; }
.tp-photo .tp-glyph { font-size: 58px; line-height: 1; filter: drop-shadow(0 3px 10px rgba(0,0,0,.45)); }
.tp-media-grad {
  position: absolute; left: 0; right: 0; bottom: 0; height: 96px; z-index: 2; pointer-events: none;
  background: linear-gradient(to top, rgba(6,13,11,.94), rgba(6,13,11,.45) 45%, transparent);
}
.tp-cap { position: absolute; left: 14px; right: 14px; bottom: 12px; z-index: 3; pointer-events: none; }
.tp-cap-name { display: block; font-size: 17px; font-weight: 800; letter-spacing: -.3px; color: #fff; text-shadow: 0 1px 8px rgba(0,0,0,.65); }
.tp-cap-meta { display: block; font-size: 12.5px; color: #e3f1ea; margin-top: 2px; text-shadow: 0 1px 6px rgba(0,0,0,.6); }
.tp-dots { position: absolute; bottom: 8px; left: 0; right: 0; z-index: 4; display: flex; gap: 5px; justify-content: center; pointer-events: none; }
.tp-dots i { width: 5px; height: 5px; border-radius: 50%; background: rgba(255,255,255,.45); transition: width .25s var(--spring), background .25s; }
.tp-dots i.on { width: 16px; background: #fff; }
.tp-rating-badge {
  position: absolute; top: 10px; right: 10px; z-index: 4; display: flex; align-items: center; gap: 3px;
  background: rgba(6,13,11,.62); border: 1px solid rgba(255,255,255,.18); border-radius: 999px;
  padding: 4px 10px; font-size: 12px; font-weight: 700; color: #fff; backdrop-filter: blur(8px);
}

/* compact row */
.tp-row { display: flex; align-items: center; gap: 11px; padding: 12px 13px; }
.tp-check {
  flex: 0 0 auto; width: 24px; height: 24px; border-radius: 8px; padding: 0;
  border: 2px solid var(--glass-border); background: rgba(255,255,255,.04);
  position: relative; transition: background .2s, border-color .2s, transform .15s var(--spring);
}
.tp-check:active { transform: scale(.86); }
.tp-card.selected .tp-check { background: var(--accent); border-color: var(--accent); }
.tp-card.selected .tp-check::after {
  content: ""; position: absolute; left: 7px; top: 3px; width: 5px; height: 10px;
  border: solid var(--on-accent); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg);
}
.tp-body { flex: 1 1 auto; min-width: 0; }
/* collapsed card → compact row (name + sub). Expanded → caption shows the name, row shows
   the "Add to your route" action label. */
.tp-name { display: block; font-size: 14.5px; font-weight: 700; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tp-sub { display: block; font-size: 12px; color: var(--text-faint); margin-top: 2px; }
.tp-sel-label { display: none; font-size: 13.5px; font-weight: 700; color: var(--accent); }
.tp-card.expanded .tp-name, .tp-card.expanded .tp-sub { display: none; }
.tp-card.expanded .tp-sel-label { display: block; }
.tp-go { flex: 0 0 auto; padding: 8px 15px; font-size: 13px; }

/* EXTRA DETAIL — always fully shown */
.tp-extra { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .42s var(--spring); }
.tp-card.expanded .tp-extra { grid-template-rows: 1fr; }
.tp-extra-in { overflow: hidden; min-height: 0; }
.tp-extra-pad { padding: 0 14px 14px; }
.tp-reason { font-size: 13px; color: var(--text-dim); line-height: 1.5; font-style: italic; margin: 0 0 11px; }
.tp-facts { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 12px; }
.tp-fact { font-size: 12px; font-weight: 600; color: var(--text-dim); background: rgba(255,255,255,.05); border: 1px solid var(--glass-border); border-radius: 999px; padding: 5px 11px; }
.tp-fact b { color: var(--text); font-weight: 800; }
.tp-actions { display: flex; gap: 9px; }
.tp-add { flex: 1 1 auto; padding: 11px; font-size: 14px; }
.tp-go2 { flex: 0 0 auto; padding: 11px 18px; font-size: 14px; }

/* info / call / website */
.tp-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.tp-link {
  flex: 1 1 0; min-width: 92px; text-align: center; text-decoration: none;
  font-size: 13px; font-weight: 600; color: var(--text);
  background: rgba(255,255,255,.05); border: 1px solid var(--glass-border);
  border-radius: 10px; padding: 9px 8px; cursor: pointer; white-space: nowrap;
}
.tp-link:active { transform: scale(.97); }

/* floating footer */
.trip-foot {
  position: sticky; bottom: 0; z-index: 30;
  margin: 16px -20px 0; padding: 16px 20px 12px;
  background: linear-gradient(to top, rgba(17,29,25,0.99) 0%, rgba(17,29,25,0.99) 58%, rgba(17,29,25,0) 100%);
}
.trip-foot .btn { margin: 0; width: 100%; }
.tp-spacer { flex: 0 0 auto; }

/* sections: grouping + sticky headers. CARDS (not sections) are the snap points now. */
.tp-compartment { padding-bottom: 4px; }
.tp-compartment > .trip-h {
  position: sticky; top: 0; z-index: 8;
  margin: 0 -20px 10px; padding: 13px 20px 11px; font-size: 13.5px;
  background: linear-gradient(to bottom, rgba(17,29,25,0.985) 74%, rgba(17,29,25,0));
}
/* map/ETA = the first full-screen page (min-height set by JS); map is smaller, leaving blank space below, and it snaps */
.tp-comp-map { scroll-snap-align: start; scroll-snap-stop: always; display: flex; flex-direction: column; }
.tp-comp-map #trip-map { flex: 0 0 auto; height: clamp(300px, 62vh, 560px); min-height: 0; }

/* conversational AI write-up = its own snap page so it lands in view (same physics as cards) */
.tp-ai-page {
  scroll-snap-align: start; scroll-snap-stop: always;
  min-height: clamp(150px, 32vh, 320px);
  display: flex; align-items: center;
  margin: 6px 0 12px;
}
.tp-ai-page .trip-ai-msg { margin: 0; width: 100%; }

@media (prefers-reduced-motion: reduce) {
  .tp-card, .tp-dots i { transition: none !important; }
}

@media (max-width: 390px) {
  #trip-sheet .sheet-panel {
    width: calc(100vw - 16px);
    padding-left: 14px;
    padding-right: 14px;
  }
  #trip-sheet .trip-toggle {
    align-items: flex-start;
  }
  #trip-sheet .trip-toggle .switch {
    margin-top: 2px;
  }
  #trip-form .trip-label-row {
    align-items: flex-start;
    gap: 8px;
  }
  .current-loc-chip {
    max-width: 150px;
    white-space: normal;
    text-align: center;
    line-height: 1.15;
  }
  #trip-gas-inputs {
    grid-template-columns: 1fr;
  }
  .chip-check {
    padding: 9px 12px;
    font-size: 12.5px;
  }
}

@media (max-height: 760px) {
  #trip-sheet .sheet-panel {
    max-height: calc(100dvh - 18px);
    padding-bottom: 14px;
  }
  #trip-sheet .sheet-head {
    margin-bottom: 12px;
  }
  #trip-form .help-note {
    margin-bottom: 12px;
  }
  #trip-cats {
    margin-bottom: 14px;
  }
}

/* trip entry button on setup */
.trip-entry {
  margin-top: 12px; width: 100%; display: flex; align-items: center; justify-content: center; gap: 9px;
  padding: 14px; border-radius: 16px; cursor: pointer;
  background: var(--glass); border: 1px solid var(--glass-border);
  color: var(--text); font-family: var(--font); font-size: 15px; font-weight: 650;
  box-shadow: var(--sheen);
  transition: transform 0.18s var(--spring), background 0.2s ease;
}
.trip-entry:active { transform: scale(0.97); }
.trip-entry:hover { background: rgba(255,255,255,0.1); }
.trip-entry svg { width: 18px; height: 18px; color: var(--accent); }
.trip-entry .badge { margin-left: 2px; }
.report-entry { margin-top: 10px; background: transparent; box-shadow: none; border-style: dashed; color: var(--text-dim); font-size: 13.5px; padding: 11px; }

/* redeem code row */
.redeem-row { display: flex; gap: 8px; margin-top: 6px; }
.redeem-row .text-input { flex: 1; }
.redeem-row .btn { white-space: nowrap; padding: 12px 16px; }
