/* UKFuelPrices.uk — application styles */

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-ui);
  font-feature-settings: "zero" 1;
  font-size: 14.5px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; }
a { color: var(--brand); text-decoration: none; }
.ic { flex: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
h1, h2, h3 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.02em; margin: 0; }

/* ------------------------------- Topbar ------------------------------- */
.topbar {
  position: -webkit-sticky;
  position: sticky; top: 0; z-index: 40; height: var(--topbar-h);
  display: flex; align-items: center; gap: var(--s4);
  padding: 0 var(--s4);
  background: radial-gradient(1000px 100% at 50% -30%, rgba(37, 99, 235, 0.22) 0%, transparent 70%), #0F172A;
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid #1E293B;
  transition: transform .28s cubic-bezier(0.16, 1, 0.3, 1), box-shadow .2s ease, border-color .2s ease;
  will-change: transform;
}
body.scrolled .topbar {
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.35);
  border-bottom-color: rgba(255, 255, 255, 0.1);
}
.wordmark { display: flex; align-items: center; gap: 9px; white-space: nowrap; color: #FFFFFF; }
.wordmark .glyph {
  width: 28px; height: 28px; border-radius: 7px; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; flex: none; overflow: hidden;
}
.wordmark .glyph svg {
  width: 100%; height: 100%; display: block;
}
.wordmark .txt { font-family: var(--font-display); font-weight: 700; font-size: 16px; letter-spacing: -.03em; color: #FFFFFF; }
.wordmark .txt .lt { color: #3B82F6; font-weight: 800; }
.wordmark .txt .tld { color: #94A3B8; font-weight: 700; opacity: 0.9; }

.search {
  flex: 1; max-width: 400px; display: flex; align-items: center; gap: var(--s2);
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--r-pill); padding: 9px 14px; min-width: 0; color: #94A3B8;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.search { position: relative; }
.search:focus-within { border-color: #3B82F6; box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.25); background: rgba(255, 255, 255, 0.12); }
.search input { flex: 1; min-width: 0; background: none; border: 0; outline: none; color: #FFFFFF; }
.search input::placeholder { color: #94A3B8; }

.suggest {
  position: absolute; top: calc(100% + 8px); left: 0; right: 0; z-index: 70;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); overflow: hidden auto; max-height: 62vh;
}
.sug {
  display: flex; align-items: center; gap: 11px; width: 100%; text-align: left;
  padding: 10px 14px; border-bottom: 1px solid var(--line); background: var(--surface);
}
.sug:last-child { border-bottom: 0; }
.sug:hover { background: var(--surface-2); }
.sug .sico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.sug .stx { min-width: 0; }
.sug .stx b { display: block; font-family: var(--font-display); font-size: 13.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sug .stx span { font-size: 11.5px; color: var(--muted); }

.topright { margin-left: auto; display: flex; align-items: center; gap: var(--s3); }
.ticker { display: none; gap: var(--s4); font-size: 12.5px; color: #CBD5E1; white-space: nowrap; align-items: center; }
.ticker b { color: #FFFFFF; }
.ticker .up { color: var(--warn); }
.ticker .down { color: var(--good); }

.iconbtn {
  width: 38px; height: 38px; border-radius: var(--r-sm); display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.08); border: 1px solid rgba(255, 255, 255, 0.15); color: #CBD5E1;
  transition: background .15s, color .15s, border-color .15s;
}
.iconbtn:hover { background: rgba(255, 255, 255, 0.18); color: #FFFFFF; border-color: rgba(255, 255, 255, 0.25); }
.menu-btn { display: none; }

/* ------------------------------- Layout ------------------------------- */
.app { min-height: 100vh; overflow-x: clip; }
.stage { display: block; position: relative; max-width: 100%; }
.pane-left { display: block; min-width: 0; max-width: 100%; }
.left-scroll { padding: var(--s4); padding-bottom: calc(var(--dock-h) + var(--s6)); max-width: 100%; box-sizing: border-box; }
.pane-right { display: none; }

/* ------------------------------ Sections ------------------------------ */
.section { margin-bottom: var(--s5); }
.section > h2 {
  font-size: 11.5px; font-family: var(--font-ui); font-weight: 700;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
  margin: 0 0 var(--s3); display: flex; align-items: center; gap: 7px;
}
.section .sub { color: var(--text-2); font-size: 12.5px; margin: -6px 0 var(--s3); }

/* ------------------------------- Cards -------------------------------- */
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); padding: 13px 14px; margin-bottom: 10px;
  box-shadow: var(--shadow-1);
}
/* Modern station card styling (Image 1 aesthetic) */
.station.card {
  border-radius: 18px;
  padding: 15px 16px;
  margin-bottom: 12px;
}
.station .top { gap: 12px; }
.station .tankcost, .station .meta.tags { margin-top: 4px; }
.station .savings { margin-top: 9px; padding: 7px 11px; }
.station .grades { margin-top: 10px; }
.station .footer-row { margin-top: 13px; padding-top: 12px; border-top: 1px solid var(--line); }
.station .brandchip { width: 44px; height: 44px; border-radius: 12px; }
.station .brandchip img { width: 28px; height: 28px; }
.station .name { font-size: 16px; font-weight: 700; line-height: 1.24; color: var(--text); }
.station .price { font-size: 26px; font-weight: 700; line-height: 1; font-family: var(--font-display); letter-spacing: -.03em; color: var(--text); }
.station .price sub { font-size: 15px; font-weight: 600; }
.station .tankcost { font-size: 12px; font-weight: 600; color: var(--text-2); margin-top: 4px; text-align: right; }
.card.tap { transition: border-color .15s, box-shadow .15s, transform .06s; }
.card.tap:hover { border-color: var(--line-2); box-shadow: var(--shadow-2); }
.card.tap:active { transform: translateY(1px); }

/* --------------------------------------------------------------------------
 * Station Brand Identity: Ambient Logo Aura + Border Tint
 * Subtle 2-3% brand glow radiating organically around the brand logo chip
 * -------------------------------------------------------------------------- */
.card.station[data-brand] {
  --b-rgb: 2, 132, 199;
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(160px circle at 38px 38px, rgba(var(--b-rgb), 0.055) 0%, rgba(var(--b-rgb), 0.015) 55%, transparent 100%),
    var(--surface);
  border-color: color-mix(in srgb, rgb(var(--b-rgb)) 16%, var(--line));
}
.card.station[data-brand]::before {
  content: "";
  position: absolute;
  top: 14px;
  bottom: 14px;
  left: 0;
  width: 3.5px;
  border-radius: 0 3px 3px 0;
  background: rgb(var(--b-rgb));
  opacity: 0.9;
  transition: opacity .15s ease, width .15s ease;
}
.card.station[data-brand]:hover::before {
  width: 4.5px;
  opacity: 1;
}
.card.station[data-brand] .brandchip {
  border-color: color-mix(in srgb, rgb(var(--b-rgb)) 28%, var(--line));
  box-shadow: 0 2px 8px rgba(var(--b-rgb), 0.10);
}

/* Green Group: Supermarkets & Stations */
.card.station[data-brand="asda"]         { --b-rgb: 0, 120, 51; }    /* Asda Emerald */
.card.station[data-brand="bp"]           { --b-rgb: 0, 153, 0; }     /* BP Green */
.card.station[data-brand="morrisons"]    { --b-rgb: 0, 78, 55; }     /* Morrisons Dark Green */
.card.station[data-brand="applegreen"]   { --b-rgb: 0, 132, 61; }    /* Applegreen Leaf */
.card.station[data-brand="murco"]        { --b-rgb: 0, 104, 55; }    /* Murco Kelly Green */
.card.station[data-brand="spar"]         { --b-rgb: 0, 122, 61; }    /* Spar Green */
.card.station[data-brand="harvest"]      { --b-rgb: 0, 133, 66; }    /* Harvest Energy */
.card.station[data-brand="extra"]        { --b-rgb: 56, 161, 105; }  /* Extra Green */
.card.station[data-brand="welcomebreak"] { --b-rgb: 125, 182, 65; }  /* Welcome Break Lime */

/* Red / Burgundy Group */
.card.station[data-brand="esso"]         { --b-rgb: 238, 28, 37; }   /* Esso Racing Red */
.card.station[data-brand="shell"]        { --b-rgb: 221, 29, 33; }   /* Shell Warm Red */
.card.station[data-brand="texaco"]       { --b-rgb: 237, 28, 36; }   /* Texaco Star Red */
.card.station[data-brand="circlek"]      { --b-rgb: 237, 28, 36; }   /* Circle K Red */
.card.station[data-brand="total"]        { --b-rgb: 226, 0, 26; }    /* Total Red */
.card.station[data-brand="essar"]        { --b-rgb: 185, 28, 28; }   /* Essar Red */
.card.station[data-brand="rontec"]       { --b-rgb: 158, 27, 85; }   /* Rontec Magenta */

/* Blue / Cyan Group */
.card.station[data-brand="tesco"]        { --b-rgb: 0, 83, 159; }    /* Tesco Royal Blue */
.card.station[data-brand="valero"]       { --b-rgb: 0, 98, 152; }    /* Valero Electric Blue */
.card.station[data-brand="costco"]       { --b-rgb: 0, 93, 170; }    /* Costco Warehouse Blue */
.card.station[data-brand="jet"]          { --b-rgb: 0, 51, 102; }    /* Jet Aviation Navy */
.card.station[data-brand="ascona"]       { --b-rgb: 0, 85, 165; }    /* Ascona Blue */
.card.station[data-brand="coop"]         { --b-rgb: 0, 176, 230; }   /* Co-op Cyan */

/* Warm Orange / Amber / Teal Group */
.card.station[data-brand="sainsburys"]   { --b-rgb: 224, 90, 0; }    /* Sainsbury's Warm Orange */
.card.station[data-brand="gulf"]         { --b-rgb: 255, 102, 0; }   /* Gulf Vibrant Orange */
.card.station[data-brand="roadchef"]     { --b-rgb: 238, 114, 3; }   /* Roadchef Orange */
.card.station[data-brand="mfg"]          { --b-rgb: 217, 119, 6; }   /* MFG Amber Gold */
.card.station[data-brand="moto"]         { --b-rgb: 0, 128, 128; }   /* Moto Teal */
.card.station[data-brand="independent"]  { --b-rgb: 2, 132, 199; }   /* Independent Clean Blue */

/* Dark Theme Overrides — dimmed below light theme so brand colour is a subtle hint, never neon */
[data-theme="dark"] .card.station[data-brand] {
  background:
    radial-gradient(145px circle at 38px 38px, rgba(var(--b-rgb), 0.04) 0%, rgba(var(--b-rgb), 0.01) 52%, transparent 100%),
    var(--surface);
  border-color: color-mix(in srgb, rgb(var(--b-rgb)) 9%, var(--line));
}
[data-theme="dark"] .card.station[data-brand] .brandchip {
  background: #0f172a;
  border-color: color-mix(in srgb, rgb(var(--b-rgb)) 15%, var(--line));
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.35);
}

/* Winner Card Preservation: Keep green winner border prominent */
.card.station.winner {
  border-color: color-mix(in srgb, var(--good) 50%, var(--line)) !important;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 25%, transparent), var(--shadow-1) !important;
}
.card.station.winner::before {
  background: var(--good) !important;
  width: 4px;
  top: 12px;
  bottom: 12px;
  border-radius: 0 3px 3px 0;
}

/* Station card */
.station .top { display: flex; align-items: flex-start; gap: var(--s3); }
.brandchip {
  width: 42px; height: 42px; border-radius: 11px; flex: none; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); overflow: hidden;
}
.brandchip img { width: 28px; height: 28px; object-fit: contain; display: block; }
.brandchip .mono-mark { font-family: var(--font-display); font-weight: 700; font-size: 15px; color: var(--brand); }
.station .id { flex: 1; min-width: 0; }
.station .name { font-family: var(--font-display); font-weight: 600; font-size: 15px; letter-spacing: -.02em; }
.station .meta { color: var(--text-2); font-size: 12.5px; margin-top: 4px; }
.station .meta.text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.station .meta.tags {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-wrap: wrap;
}
/* Inline Station Status Line (Option 1: Dot + Metadata, Image 1 aesthetic) */
.station-status-line {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  color: var(--text-2);
  margin-top: 8px;
  line-height: 1.35;
  width: 100%;
  box-sizing: border-box;
  white-space: nowrap;
  overflow: hidden;
  padding: 1px 2px;
}
.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  display: inline-block;
  flex: none;
  margin-top: 0;
  margin-left: 2px;
}
.status-dot.ok {
  background: #16a34a;
  box-shadow: 0 0 0 2.5px rgba(22, 163, 74, 0.16);
}
.status-dot.soon {
  background: #d97706;
  box-shadow: 0 0 0 2.5px rgba(217, 119, 6, 0.18);
}
.status-dot.closed {
  background: #dc2626;
  box-shadow: 0 0 0 2.5px rgba(220, 38, 38, 0.18);
}
.status-dot.warn {
  background: #d97706;
  box-shadow: 0 0 0 2.5px rgba(217, 119, 6, 0.18);
}
[data-theme="dark"] .status-dot.ok {
  background: #22c55e;
  box-shadow: 0 0 0 2.5px rgba(34, 197, 94, 0.22);
}
[data-theme="dark"] .status-dot.soon {
  background: #f59e0b;
  box-shadow: 0 0 0 2.5px rgba(245, 158, 11, 0.22);
}
[data-theme="dark"] .status-dot.closed {
  background: #ef4444;
  box-shadow: 0 0 0 2.5px rgba(239, 68, 68, 0.22);
}
.status-parts {
  display: block;
  flex: 0 1 auto;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-2);
  line-height: 1.35;
}
.status-sep {
  color: var(--muted);
  opacity: 0.65;
  margin: 0 4px;
}
.status-member {
  font-weight: 600;
  color: var(--text);
}
.status-dist {
  font-weight: 600;
  color: var(--text);
}
.status-missing {
  color: var(--warn);
  font-weight: 600;
}
.status-unverified {
  color: var(--warn);
  font-weight: 600;
}
.status-stale {
  color: var(--warn);
}
.status-drop {
  font-weight: 600;
  color: var(--good);
}
.status-detour {
  font-weight: 600;
  color: var(--brand);
}
.status-msa {
  font-weight: 600;
  color: var(--brand);
}
.status-msa .m-sign {
  font-weight: 800;
  margin-right: 3px;
  color: #0066cc;
}
.amen-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
  padding: 1.5px 5.5px;
  border-radius: 999px;
  background: var(--surface-2, rgba(0, 0, 0, 0.05));
  color: var(--text-2, #64748b);
  border: 1px solid var(--line, rgba(0, 0, 0, 0.08));
  vertical-align: middle;
  margin-left: 0;
  letter-spacing: -0.2px;
  white-space: nowrap;
  flex-shrink: 0;
}
[data-theme="dark"] .amen-more {
  background: rgba(255, 255, 255, 0.07);
  color: var(--text-2, #94a3b8);
  border-color: rgba(255, 255, 255, 0.12);
}
.price-caveat {
  font-size: 11px;
  font-weight: 600;
  margin-top: 2px;
  text-align: right;
  letter-spacing: -0.1px;
}
.price-caveat.stale {
  color: var(--warn, #d97706);
}
.price-caveat.warn {
  color: var(--warn, #d97706);
}
.lowest-price-tag {
  font-size: 11px;
  font-weight: 700;
  margin-top: 2px;
  text-align: right;
  color: var(--good, #16a34a);
  letter-spacing: -0.1px;
}

/* --------------------------------------------------------------------------
 * Town Navigation Bar & Mobile-Friendly Back Button
 * -------------------------------------------------------------------------- */
.town-nav-bar {
  margin: 2px 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  font-size: 13px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.town-nav-label {
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.town-nav-label b {
  color: var(--text);
  font-weight: 700;
}
.town-nav-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
}
.town-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  min-height: 32px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  flex: none;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.town-back-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}
.town-back-btn:active {
  transform: scale(0.96);
  background: var(--brand-soft);
}
.town-back-btn svg {
  flex: none;
}
.town-start-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
  cursor: pointer;
  flex: none;
  transition: all 0.15s ease;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.town-start-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
}
.town-start-btn:active {
  transform: scale(0.95);
}
@media (max-width: 640px) {
  .town-back-btn {
    min-height: 34px;
    padding: 6px 13px;
    font-size: 12.5px;
  }
  .town-start-btn {
    width: 34px;
    height: 34px;
  }
}

/* --------------------------------------------------------------------------
 * Nearby Towns Quick-Select Pills
 * -------------------------------------------------------------------------- */
.nearby-towns-wrap {
  margin: 18px 0 12px;
  padding: 12px 14px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.nearby-towns-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 9px;
}
.nearby-towns-title {
  font-weight: 700;
  font-size: 13px;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.nearby-towns-sub {
  font-size: 11.5px;
  color: var(--text-2);
}
.nearby-towns-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 7px;
}
@media (min-width: 480px) and (max-width: 768px) {
  .nearby-towns-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
.town-pill-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  padding: 7px 11px;
  border-radius: var(--r-sm);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: left;
  transition: all 0.15s ease;
  min-height: 42px;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.town-pill-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}
.town-pill-btn:active {
  transform: scale(0.98);
}
.tpb-name {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.town-pill-btn:hover .tpb-name {
  color: var(--brand);
}
.tpb-meta {
  font-size: 11px;
  font-weight: 500;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.2;
}
[data-theme="dark"] .town-pill-btn {
  background: var(--surface);
}
[data-theme="dark"] .town-pill-btn:hover {
  background: rgba(2, 132, 199, 0.15);
  border-color: var(--brand);
}
[data-theme="dark"] .lowest-price-tag {
  color: #4ade80;
}
.station .meta.tags.card-tags-row {
  margin-top: 8px;
  margin-left: 0; /* formerly margin-left: 49px; updated for full-width badge row */
  width: 100%;
  box-sizing: border-box;
  gap: 6px;
}
.station.card:not(.expanded) .grades {
  display: none !important;
}
.station.card:not(.expanded) .station-stale-banner {
  display: none !important;
}
.station.card:not(.expanded) .footer-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 13px;
}
.station .meta.tags .badge,
.station .meta.tags .tag,
.station .meta.tags .dist-tag {
  flex-shrink: 0;
  white-space: nowrap;
  font-size: 11px;
  padding: 2.5px 7.5px;
  border-radius: var(--r-pill);
}
.station .name {
  font-size: 15.5px; line-height: 1.22; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* price block styling applies in the list AND the drawer/sheet */
.priceblock { text-align: right; flex: none; }
.price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.price .p-int { font-weight: 800; }
.price .p-dec { font-size: 0.78em; opacity: 0.9; font-weight: 700; margin-left: 0.5px; }
.price .perlitre { font-size: 13px; font-weight: 600; opacity: .65; margin-left: 1.5px; }
.tankcost { font-size: 11.5px; color: var(--muted); margin-top: 5px; }
.drawer .price { font-size: 24px; }
.station .priceblock { text-align: right; flex: none; }
.station .price { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.station .price .p-int { font-weight: 800; }
.station .price .p-dec { font-size: 0.78em; opacity: 0.9; font-weight: 700; margin-left: 0.5px; }
.station .price .perlitre { font-size: 13px; font-weight: 600; opacity: .65; margin-left: 1.5px; }
.station .tankcost { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

.savings {
  display: flex; align-items: center; gap: var(--s2); margin-top: var(--s3);
  padding: 9px var(--s3); border-radius: var(--r-md); font-size: 13px; font-weight: 700;
  background: var(--good-soft); color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 28%, transparent);
}
.savings.amber { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 28%, transparent); }
.savings .ic { opacity: .9; }
.savings .detail { margin-left: auto; font-weight: 600; opacity: .85; font-size: 12px; }

.grades {
  display: grid; grid-template-columns: 1fr 1fr; gap: 1px;
  margin-top: 10px; background: var(--line);
  border: 1px solid var(--line); border-radius: 12px;
  overflow: hidden;
}
.grades .g {
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  min-width: 0; padding: 9px 10px; background: var(--surface);
  color: var(--text); font-size: 13px; font-weight: 600;
}
.grades .g:last-child:nth-child(odd) { grid-column: 1 / -1; }
.grades .gk {
  display: inline-flex; align-items: center; gap: 4px;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.grades .gk .fuel-dot {
  color: var(--fuel, var(--brand));
  display: inline-grid; place-items: center; flex: none;
}
.grades .gk-name {
  font-size: 13px; font-weight: 700; color: var(--text);
  white-space: nowrap;
}
.grades .gk-code {
  font-size: 11px; font-weight: 600; color: var(--muted);
  white-space: nowrap; opacity: 0.85;
}
.grades .gv { display: inline-flex; align-items: center; gap: 4px; flex: none; margin-left: auto; }
.grades .gv b {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  color: var(--fuel, var(--text)); font-weight: 800; font-size: 14.5px;
  white-space: nowrap;
}
.grades .fuel-e10 { --fuel: var(--fuel-e10); }
.grades .fuel-e5 { --fuel: var(--fuel-e5); }
.grades .fuel-b7s { --fuel: var(--fuel-b7s); }
.grades .fuel-b7p { --fuel: var(--fuel-b7p); }
.grades .fuel-b10 { --fuel: var(--fuel-b10); }
.grades .fuel-hvo { --fuel: var(--fuel-hvo); }
.grades .g.off { opacity: .45; }

.amen { display: flex; flex-wrap: wrap; gap: 6px; margin-top: var(--s3); }
.chip {
  font-size: 11px; color: var(--text-2); background: var(--chip);
  border-radius: var(--r-pill); padding: 4px 9px; display: inline-flex; align-items: center; gap: 5px;
}
.amen-chip .ic { flex: none; opacity: .9; }

.footer-row {
  display: flex; align-items: center; flex-wrap: wrap; gap: var(--s2); row-gap: 8px;
  margin-top: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line);
  font-size: 12px; color: var(--muted);
}
.footer-row .grow { flex: 1 1 auto; min-width: 0; }
.footer-row .grow .badge { white-space: normal; }
.footer-row .tapoff { flex: none; }
.footer-row .route-stop-toggle { flex: none; }
.footer-row .btn { flex: none; margin-left: auto; }
@media (max-width: 420px) {
  .footer-row .grow { flex: 1 1 100%; }
  .footer-row .tapoff { order: 2; }
  .footer-row .btn { order: 3; }
}

.station .footer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 13px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  gap: 10px;
}
.station.card.expanded .footer-row {
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 14px;
}
.station .footer-left {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.station .starbtn, .station .alertbtn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  display: inline-grid;
  place-items: center;
  flex: none;
  cursor: pointer;
  transition: all .15s ease;
}
.station .starbtn:hover, .station .alertbtn:hover {
  background: var(--surface-2);
  border-color: var(--line);
  color: var(--text);
}
.station .starbtn.on {
  color: #E59500;
  border-color: #E59500;
  background: rgba(229, 149, 0, 0.08);
}
.station .alertbtn.on {
  color: #fff !important;
  background: var(--good, #15803d) !important;
  border-color: var(--good, #15803d) !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 28%, transparent);
}
.station .alertbtn.paused {
  color: var(--text-2) !important;
  background: var(--surface-2) !important;
  border: 1px dashed var(--line-2) !important;
  opacity: .85;
}
.station .detailsbtn {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--brand);
  background: transparent;
  border: none;
  padding: 6px 8px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  border-radius: var(--r-sm);
}
.station .detailsbtn:hover {
  text-decoration: underline;
}
.station .btn.go-btn {
  background: var(--nav-btn, #0D9488);
  color: #ffffff !important;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 13.5px;
  padding: 7px 18px;
  border: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: none;
  box-shadow: 0 2px 6px rgba(13, 148, 136, 0.28);
  transition: transform .08s, filter .15s, background .15s;
}
.station .btn.go-btn:hover {
  filter: brightness(1.08);
  color: #ffffff !important;
}
.station .btn.go-btn:active {
  transform: scale(.96);
}
.station-stale-banner {
  display: flex;
  margin-top: 10px;
}
.station-stale-banner .badge.stale {
  width: 100%;
  justify-content: center;
  padding: 6px 12px;
  font-size: 12px;
  border-radius: var(--r-pill);
  background: var(--warn-soft);
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 24%, transparent);
}
[data-theme="dark"] .station .btn.go-btn {
  background: var(--nav-btn, #0D9488);
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .station .btn.go-btn:hover {
  filter: brightness(1.12);
}
[data-theme="dark"] .station .starbtn,
[data-theme="dark"] .station .alertbtn {
  background: var(--surface-2);
  border-color: var(--line);
}
[data-theme="dark"] .station .grades {
  background: var(--line);
  border-color: var(--line);
}
[data-theme="dark"] .station .grades .g {
  background: var(--surface);
}

/* ------------------------------- Badges ------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 600;
  border-radius: var(--r-pill); padding: 4px 9px; border: 1px solid transparent; white-space: nowrap;
}
.badge.ok { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 20%, transparent); }
.badge.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.badge.stale { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.badge.neutral { background: var(--chip); color: var(--text-2); border-color: var(--line); }
.badge.closed { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.badge.soon { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.badge.motorway { background: #0066cc; color: #ffffff; border-color: #0055b3; font-weight: 700; letter-spacing: .02em; box-shadow: 0 1px 2px rgba(0, 102, 204, 0.25); }
.badge.motorway .m-sign { font-weight: 800; font-size: 11.5px; line-height: 1; }
.badge.motorway.sm { font-size: 10px; padding: 1px 6px; border-radius: 4px; vertical-align: middle; display: inline-flex; align-items: center; gap: 3px; }
[data-theme="dark"] .badge.motorway {
  background: color-mix(in srgb, #2563eb 25%, var(--surface-2, #1e293b));
  color: #93c5fd;
  border-color: rgba(59, 130, 246, 0.4);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .badge.motorway {
    background: color-mix(in srgb, #2563eb 25%, var(--surface-2, #1e293b));
    color: #93c5fd;
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  }
}
.badge.save { background: var(--good-soft); color: var(--good); }

/* ---------------------------- Buy window ------------------------------ */
.buywindow { border-radius: var(--r-lg); padding: var(--s4); border: 1px solid var(--line); margin-bottom: var(--s4); background: var(--surface); box-shadow: var(--shadow-1); }
.buywindow .eyebrow { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; opacity: .8; display: flex; align-items: center; gap: 6px; color: var(--text-2); }
.buywindow .state { font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: -.02em; margin-top: 6px; }
.buywindow .detail { color: var(--text-2); font-size: 13.5px; line-height: 1.45; margin-top: 6px; }
.buywindow .facts { display: flex; gap: var(--s4); margin-top: var(--s3); font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.buywindow.fill { border-color: color-mix(in srgb, var(--good) 40%, var(--line)); background: linear-gradient(180deg, var(--good-soft), var(--surface) 70%); }
.buywindow.fill .state { color: var(--good); }
.buywindow.topup { border-color: color-mix(in srgb, var(--warn) 40%, var(--line)); background: linear-gradient(180deg, var(--warn-soft), var(--surface) 70%); }
.buywindow.topup .state { color: var(--warn); }
.buywindow.stable { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); background: linear-gradient(180deg, var(--brand-soft), var(--surface) 70%); }
.buywindow.stable .state { color: var(--brand); }

.market-compare-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 14px;
}
.mcp-card {
  padding: 11px 13px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.mcp-card.highlight {
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  background: var(--surface-2);
}
.mcp-label {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--text-2);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mcp-val {
  font-size: 20px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.1;
}
.mcp-diff {
  font-size: 11px;
  font-weight: 700;
  color: var(--good);
}
  font-weight: 700;
  color: var(--text);
}
.mcp-diff {
  font-size: 11px;
  font-weight: 600;
  color: var(--good);
}
.market-cta-wrap {
  margin-top: 14px;
  display: flex;
  align-items: center;
}
.market-cta-wrap .btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-weight: 600;
  border-radius: var(--r-pill);
}

/* -------------------------------- Bars -------------------------------- */
.pillrow { display: flex; gap: var(--s2); overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.pillrow::-webkit-scrollbar { display: none; }
.pill {
  flex: none; border: 1px solid var(--line-2); background: var(--surface);
  border-radius: var(--r-pill); padding: 7px 13px; font-size: 12.5px; font-weight: 600; color: var(--text-2);
  white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; transition: all .12s;
}
.pill:hover { border-color: var(--muted); }
.pill.active { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }

.filterbar { display: flex; gap: var(--s2); flex-wrap: wrap; margin-bottom: var(--s4); }
.filter {
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.filter.on { background: var(--text); color: var(--bg); border-color: var(--text); }

/* -------------------------------- Dock -------------------------------- */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  border-top: 1px solid var(--line);
  padding: var(--s3) var(--s3) calc(var(--s3) + env(safe-area-inset-bottom));
}
.dock .row { display: flex; gap: var(--s2); align-items: center; }
.dock .row + .row { margin-top: 6px; padding-top: 6px; border-top: 1px solid var(--line); }
.tabs { display: flex; gap: 0; align-items: stretch; flex: 1; background: transparent; border-radius: 0; padding: 0; }
.tab {
  flex: 1; min-width: 0; border: 0; border-radius: 0; padding: 6px 2px; font-size: 10.5px; font-weight: 600;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 4px; background: transparent; box-shadow: none; transition: color .12s;
}
.tab span { white-space: nowrap; }
.tab.active { background: transparent; color: var(--brand); box-shadow: none; font-weight: 700; }
.tab:active { color: var(--brand); }
.tankbtn {
  flex: none; border: 0; background: var(--surface-2); border-radius: var(--r-pill);
  padding: 3px 9px; font-size: 12px; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  margin-left: 2px;
}
.tankbtn .ic { color: var(--text-2); }
.tankbtn:hover { background: var(--line); }
.graderow { display: flex; gap: 6px; width: 100%; }
.graderow .gbtn { flex: 1 1 0; min-width: 0; justify-content: center; padding: 9px 4px; gap: 6px; }
.graderow .gbtn span { font-size: 12.5px; }
@media (max-width: 360px) { .graderow .gbtn span { display: none; } .graderow .gbtn { padding: 10px 4px; } }

/* vehicle bar (moved out of the dock) */
.vehbar {
  width: 100%; display: flex; align-items: center; gap: 10px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 9px 12px; margin-bottom: var(--s4); box-shadow: var(--shadow-1); text-align: left;
}
.vehbar:hover { border-color: var(--line-2); }
.vehbar .vehico { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.vehbar .vehtxt { flex: 1; min-width: 0; }
.vehbar .vehtxt b { font-family: var(--font-display); font-size: 13.5px; display: block; letter-spacing: -.01em; }
.vehbar .vehtxt span { font-size: 12px; color: var(--text-2); }
.vehbar .vehchange { font-size: 12px; font-weight: 700; color: var(--brand); flex: none; }

/* ------------------------------- Map ---------------------------------- */
.map { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--map-bg); border: 1px solid var(--line); isolation: isolate; }
.mapstrip-wrap { display: block; }
#mapMobile { height: 268px; margin-bottom: 0; border-radius: var(--r-lg); overflow: hidden; border: 1px solid var(--line); position: relative; isolation: isolate; z-index: 10; }
#mapPane { position: relative; isolation: isolate; z-index: 10; }
#mapMobile .maplibregl-map, #mapPane .maplibregl-map { position: absolute; inset: 0; }
.maplibregl-map { font-family: var(--font-ui); }
.maplibregl-ctrl-attrib {
  background: color-mix(in srgb, var(--surface) 92%, transparent) !important;
  color: var(--text-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: var(--r-xs); font-size: 10px; line-height: 1.4;
}
/* keep attribution legally available, but collapsed behind the (i) on compact screens */
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  min-height: 26px;
  min-width: 26px;
}
.maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) .maplibregl-ctrl-attrib-inner {
  display: none !important;
}
/* When attribution is expanded (mobile and desktop) */
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
  display: inline-flex !important;
  align-items: center !important;
  padding: 2px 14px 2px 34px !important; /* 34px clearance ensures zero overlap with 26px button */
  min-height: 28px !important;
  border-radius: 999px !important;
  background: color-mix(in srgb, var(--surface) 96%, transparent) !important;
  border: 1px solid var(--line) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12) !important;
  font-size: 11px !important;
  line-height: 24px !important;
  box-sizing: border-box !important;
  position: relative !important;
}
.maplibregl-ctrl-bottom-left .maplibregl-ctrl-attrib.maplibregl-compact .maplibregl-ctrl-attrib-button {
  left: 1px !important;
  top: 50% !important;
  transform: translateY(-50%) !important;
  position: absolute !important;
}
.maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
  display: inline-block !important;
  white-space: nowrap !important;
}
@media (max-width: 900px) {
  .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
    font-size: 9.5px !important;
    line-height: 1.35 !important;
    padding: 3px 10px 3px 31px !important;
    max-width: calc(100vw - 16px) !important;
    border-radius: 14px !important;
  }
  .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show .maplibregl-ctrl-attrib-inner {
    white-space: normal !important;
  }
}
.maplibregl-ctrl-attrib a { color: var(--brand) !important; text-decoration: none; }
.maplibregl-ctrl-attrib a:hover { text-decoration: underline; }

.maplibregl-ctrl-attrib-button {
  background: color-mix(in srgb, var(--surface) 96%, transparent) !important;
  background-image: none !important;
  color: var(--text-2) !important;
  border: 1px solid var(--line) !important;
  border-radius: 50% !important;
  width: 26px !important;
  height: 26px !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12) !important;
  transition: background-color 0.15s, color 0.15s, border-color 0.15s !important;
  padding: 0 !important;
  outline: none !important;
}
.maplibregl-ctrl-attrib-button svg {
  pointer-events: none;
  stroke: currentColor;
  display: block;
}
.maplibregl-ctrl-attrib-button:hover,
.maplibregl-ctrl-attrib-button:focus-visible {
  background: var(--surface) !important;
  color: var(--brand) !important;
  border-color: var(--brand-line, var(--brand)) !important;
}
[data-theme="dark"] .maplibregl-ctrl-attrib {
  background: rgba(15, 23, 42, 0.92) !important;
  color: #CBD5E1 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
}
[data-theme="dark"] .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
  background: rgba(15, 23, 42, 0.95) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.5) !important;
}
[data-theme="dark"] .maplibregl-ctrl-attrib a { color: #60A5FA !important; }
[data-theme="dark"] .maplibregl-ctrl-attrib-button {
  background: rgba(17, 24, 39, 0.94) !important;
  color: #94A3B8 !important;
  border-color: rgba(255, 255, 255, 0.16) !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4) !important;
  filter: none !important;
}
[data-theme="dark"] .maplibregl-ctrl-attrib-button:hover,
[data-theme="dark"] .maplibregl-ctrl-attrib-button:focus-visible {
  color: #60A5FA !important;
  border-color: rgba(96, 165, 250, 0.5) !important;
}

.pricetag-wrap {
  display: inline-flex;
  flex-direction: column;
  align-items: stretch;
  position: relative;
  pointer-events: auto;
  border-radius: 8px;
  transition: transform .14s ease, box-shadow .14s ease;
}

.pricetag-wrap.with-stop:hover,
.pricetag-wrap.with-stop.hover-sync,
.pricetag-wrap.with-stop.has-selected {
  transform: scale(1.06);
  z-index: 45 !important;
}

.map-stop-btn {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
  text-align: center;
  border-radius: 0 0 8px 8px;
  border: 1.5px solid var(--brand);
  border-top: none;
  background: color-mix(in srgb, var(--brand) 10%, var(--surface));
  color: var(--brand);
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
  pointer-events: auto;
  transition: max-height .18s cubic-bezier(0.16, 1, 0.3, 1), opacity .16s ease, transform .16s ease, background .14s ease, color .14s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
}

/* Collapsed state */
.pricetag-wrap:not(.has-selected):not(:hover) .map-stop-btn {
  max-height: 0;
  opacity: 0;
  padding: 0;
  border-width: 0;
  pointer-events: none;
  overflow: hidden;
  transform: translateY(-3px);
}

/* Desktop hover / focus-within / mobile tap */
.pricetag-wrap:hover .map-stop-btn,
.pricetag-wrap:focus-within .map-stop-btn,
.pricetag-wrap.hover-sync .map-stop-btn,
.pricetag-wrap.has-selected .map-stop-btn {
  opacity: 1;
  max-height: 28px;
  padding: 3.5px 8px 4.5px;
  border: 1.5px solid var(--brand);
  border-top: none;
  pointer-events: auto;
  overflow: visible;
  transform: translateY(0);
}

.pricetag-wrap.with-stop:hover .pricetag,
.pricetag-wrap.with-stop:focus-within .pricetag,
.pricetag-wrap.with-stop.hover-sync .pricetag,
.pricetag-wrap.with-stop.has-selected .pricetag {
  border-bottom-left-radius: 0 !important;
  border-bottom-right-radius: 0 !important;
  border-color: var(--brand) !important;
  border-bottom: 1px dashed color-mix(in srgb, var(--brand) 35%, var(--line-2)) !important;
  box-shadow: 0 -2px 8px rgba(0, 70, 171, 0.15) !important;
  transform: none !important;
}

/* Stop button hover highlight */
.map-stop-btn:hover {
  background: var(--brand) !important;
  color: #ffffff !important;
  border-color: var(--brand) !important;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 40%, transparent);
}

.map-stop-btn.on {
  border-color: #059669 !important;
  background: #059669 !important;
  color: #ffffff !important;
}
.map-stop-btn.on:hover {
  border-color: #047857 !important;
  background: #047857 !important;
  color: #ffffff !important;
  box-shadow: 0 2px 8px rgba(5, 150, 105, 0.4);
}

.pricetag-wrap.with-stop:has(.map-stop-btn.on):hover .pricetag,
.pricetag-wrap.with-stop:has(.map-stop-btn.on).has-selected .pricetag {
  border-color: #059669 !important;
  border-bottom: 1px dashed rgba(5, 150, 105, 0.35) !important;
}

/* Dark mode styling */
[data-theme="dark"] .pricetag-wrap:hover .map-stop-btn,
[data-theme="dark"] .pricetag-wrap:focus-within .map-stop-btn,
[data-theme="dark"] .pricetag-wrap.hover-sync .map-stop-btn,
[data-theme="dark"] .pricetag-wrap.has-selected .map-stop-btn {
  background: #0f172a;
  border-color: #38bdf8;
  color: #38bdf8;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
}
[data-theme="dark"] .map-stop-btn:hover {
  background: #0284c7 !important;
  border-color: #0284c7 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .pricetag-wrap.with-stop:hover .pricetag,
[data-theme="dark"] .pricetag-wrap.with-stop:focus-within .pricetag,
[data-theme="dark"] .pricetag-wrap.with-stop.hover-sync .pricetag,
[data-theme="dark"] .pricetag-wrap.with-stop.has-selected .pricetag {
  border-color: #38bdf8 !important;
  border-bottom: 1px dashed rgba(56, 189, 248, 0.35) !important;
  box-shadow: 0 -2px 8px rgba(56, 189, 248, 0.2) !important;
  transform: none !important;
}
[data-theme="dark"] .map-stop-btn.on {
  border-color: #059669 !important;
  background: #059669 !important;
  color: #ffffff !important;
}
[data-theme="dark"] .map-stop-btn.on:hover {
  border-color: #047857 !important;
  background: #047857 !important;
}

/* Detour time chip attached to the right of the pin (Solution A) */
.map-detour-chip {
  position: absolute;
  left: calc(100% + 5px);
  top: 50%;
  transform: translateY(-50%) translateX(-4px);
  opacity: 0;
  pointer-events: none;
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line-2));
  border-radius: var(--r-pill);
  padding: 2.5px 7px 3px;
  font-size: 10.5px;
  font-weight: 700;
  font-family: var(--font-ui);
  color: var(--brand);
  white-space: nowrap;
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.16);
  transition: opacity .16s ease, transform .16s ease;
  z-index: 10;
  line-height: 1.1;
}

.map-detour-chip.on-route {
  color: #065f46;
  border-color: #10b981;
  background: #ecfdf5;
  box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

.pricetag-wrap:hover .map-detour-chip,
.pricetag-wrap:focus-within .map-detour-chip,
.pricetag-wrap.hover-sync .map-detour-chip,
.pricetag-wrap.has-selected .map-detour-chip {
  opacity: 1;
  transform: translateY(-50%) translateX(0);
}

[data-theme="dark"] .map-detour-chip {
  background: #0f172a;
  border-color: rgba(56, 189, 248, 0.45);
  color: #38bdf8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}
[data-theme="dark"] .map-detour-chip.on-route {
  background: #064e3b;
  border-color: #059669;
  color: #6ee7b7;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.6);
}

.pricetag {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  font-size: 11.5px; font-weight: 700; padding: 3px 6px 3px 4px; border-radius: 8px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  box-shadow: var(--shadow-1); display: flex; align-items: center; gap: 5px; cursor: pointer;
  position: relative;
  transition: transform .12s ease, box-shadow .12s ease, opacity .15s;
}
.pricetag:hover {
  transform: scale(1.06);
  box-shadow: 0 0 0 1.5px var(--brand), 0 3px 10px rgba(0, 70, 171, 0.28) !important;
  z-index: 25;
}
[data-theme="dark"] .pricetag:hover {
  box-shadow: 0 0 0 1.5px #38bdf8, 0 3px 12px rgba(56, 189, 248, 0.35) !important;
}
.pricetag .lg { width: 15px; height: 15px; border-radius: 4px; object-fit: contain; background: #fff; }
.pricetag .lgtext {
  font-size: 8.5px; font-weight: 800; letter-spacing: .03em; line-height: 1;
  color: var(--brand); background: #fff; border: 1px solid var(--line-2);
  border-radius: 4px; padding: 2px 3px; font-family: var(--font-ui);
}
.pricetag.cheap { color: var(--good); border-color: color-mix(in srgb, var(--good) 45%, var(--line-2)); }
.pricetag.route-winner,
.pricetag.area-cheapest {
  background: var(--good, #059669) !important;
  color: #FFFFFF !important;
  border: 1.5px solid var(--good, #059669) !important;
  font-weight: 800 !important;
  box-shadow: 0 3px 12px rgba(5, 150, 105, 0.45) !important;
  z-index: 35 !important;
  transform: scale(1.05);
}
.pricetag.route-winner .star-badge,
.pricetag.area-cheapest .star-badge {
  color: #FDE047;
  font-size: 11px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  margin-right: 2px;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.pricetag.route-winner .lg,
.pricetag.area-cheapest .lg {
  background: #FFFFFF;
  border-radius: 3px;
  padding: 1px;
}
.pricetag.route-winner .lgtext,
.pricetag.area-cheapest .lgtext {
  background: #FFFFFF;
  color: var(--good, #059669);
  border-color: #FFFFFF;
}
[data-theme="dark"] .pricetag.route-winner,
[data-theme="dark"] .pricetag.area-cheapest {
  background: #059669 !important;
  color: #FFFFFF !important;
  border-color: #10B981 !important;
  box-shadow: 0 3px 14px rgba(16, 185, 129, 0.5) !important;
}
.pricetag.dear { color: var(--warn); border-color: color-mix(in srgb, var(--warn) 45%, var(--line-2)); }
.pricetag.sel {
  box-shadow: 0 0 0 1.5px var(--brand), 0 4px 12px rgba(0, 70, 171, 0.3) !important;
  z-index: 15 !important;
  transform: scale(1.06);
}
[data-theme="dark"] .pricetag.sel {
  box-shadow: 0 0 0 1.5px #38bdf8, 0 4px 14px rgba(56, 189, 248, 0.35) !important;
}
.pricetag.hover-sync,
.pricetag-wrap.hover-sync .pricetag,
.pricetag-wrap:hover .pricetag {
  transform: scale(1.06) !important;
  z-index: 30 !important;
  box-shadow: 0 0 0 1.5px var(--brand), 0 4px 14px rgba(0, 70, 171, 0.32) !important;
  transition: transform .12s ease, box-shadow .12s ease;
}
[data-theme="dark"] .pricetag.hover-sync,
[data-theme="dark"] .pricetag-wrap.hover-sync .pricetag,
[data-theme="dark"] .pricetag-wrap:hover .pricetag {
  box-shadow: 0 0 0 1.5px #38bdf8, 0 4px 16px rgba(56, 189, 248, 0.4) !important;
}
.card.station.map-hover-sync {
  border-color: var(--brand) !important;
  box-shadow: 0 0 0 2px var(--brand), var(--shadow-2) !important;
  background: var(--surface-hover, var(--surface)) !important;
  transform: translateY(-1px);
  transition: all .12s ease;
}
[data-theme="dark"] .card.station.map-hover-sync {
  border-color: #38bdf8 !important;
  box-shadow: 0 0 0 2px #38bdf8, 0 4px 16px rgba(0,0,0,0.5) !important;
}
.pill-stop-char {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 17px;
  height: 17px;
  border-radius: 50%;
  background: var(--brand, #0046AB);
  color: #fff;
  font-size: 10px;
  font-weight: 800;
  margin-right: 3px;
  flex-shrink: 0;
  font-family: var(--font-ui);
}
.pricetag-wrap.is-route-stop {
  z-index: 35 !important;
}
.pricetag-wrap.is-route-stop .pricetag {
  border: 1.5px solid var(--brand, #0046AB);
  box-shadow: 0 3px 10px rgba(0, 70, 171, 0.25);
}
.pricetag.sel .lgtext, .pricetag.sel .lg { box-shadow: none; }

/* stale-price notice + active filter chips */
.staleline, .feed-notice {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  background: var(--warn-soft); color: var(--warn); border-radius: var(--r-md);
  padding: 9px 12px; margin-bottom: 10px; font-size: 12.5px;
}
.staleline span, .feed-notice span { flex: 1; min-width: 0; }
.linkbtn { background: none; border: 0; color: inherit; font-weight: 700; text-decoration: underline; padding: 0; }

.clustercap {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); color: var(--text);
  border: 2px solid var(--surface); border-radius: var(--r-pill);
  padding: 3px 10px 3px 3px; box-shadow: var(--shadow-2); cursor: pointer;
  transition: transform .1s, box-shadow .12s, border-color .12s;
}
.clustercap:hover { transform: scale(1.05); }
.clustercap.hover-sync {
  transform: scale(1.12);
  border-color: var(--brand);
  box-shadow: 0 0 0 2px var(--brand), 0 6px 18px rgba(0, 70, 171, 0.42);
  z-index: 50 !important;
}
[data-theme="dark"] .clustercap.hover-sync {
  border-color: #38bdf8;
  box-shadow: 0 0 0 2px #38bdf8, 0 6px 18px rgba(56, 189, 248, 0.45);
}
.clustercap .cnum {
  width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2); font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
}
.clustercap .cnum.b1 { background: var(--good); color: var(--brand-ink); }
.clustercap .cnum.b2 { background: var(--brand); color: var(--brand-ink); }
.clustercap .cnum.b3 { background: var(--warn); color: var(--brand-ink); }
.clustercap .cnum.b4 { background: var(--bad); color: var(--brand-ink); }
.clustercap .cprice { font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-size: 12px; font-weight: 700; color: var(--text); }

.tlabel {
  color: var(--map-label); font-size: 11px; font-weight: 600; letter-spacing: .01em;
  text-shadow: 0 0 3px var(--map-label-halo), 0 0 3px var(--map-label-halo), 0 0 2px var(--map-label-halo);
  white-space: nowrap; pointer-events: none;
}

.mapctl { position: absolute; top: 12px; right: 12px; z-index: 6; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; }
.seg {
  display: flex; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); border-radius: var(--r-pill); padding: 3px; box-shadow: var(--shadow-2);
}
.seg button {
  border-radius: var(--r-pill); padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--text-2);
  display: inline-flex; align-items: center; gap: 6px;
}
.seg button.on { background: var(--text); color: var(--bg); }
.mapctl .round {
  width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow-2);
}
.mapctl .round:hover { background: var(--surface); }
.mapctl .maphint { font-size: 11px; font-weight: 600; background: var(--warn-soft); color: var(--warn); padding: 4px 9px; border-radius: var(--r-pill); }
/* the map style control stays collapsed behind one button until tapped */
.seg-toggle { display: grid; }
.mapctl .seg { display: none; }
.mapctl.expanded .seg { display: flex; }
@media (max-width: 560px) {
  .mapctl { gap: 6px; top: 10px; right: 10px; }
  .mapctl .round { width: 34px; height: 34px; }
  .seg button { padding: 6px 11px; font-size: 12px; }
  .seg { padding: 3px; }
}

/* ------------------- Bottom sheet (fuel / vehicle) -------------------- */
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 84vh; overflow: auto;
  background: var(--surface); border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl);
  border-top: 1px solid var(--line); box-shadow: var(--shadow-2);
  transform: translateY(102%); transition: transform .24s cubic-bezier(.2,.75,.2,1);
  padding: var(--s4) var(--s4) calc(var(--s5) + env(safe-area-inset-bottom));
}
.sheet.open { transform: translateY(0); }
.sheet .grip, .drawer .grip { display: none !important; }
.sheet h3 { font-size: 17px; margin-bottom: var(--s3); }
.sheet .btnrow .btn { justify-content: center; text-align: center; }
.sheet-close-btn {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface-2); border: 1px solid var(--line-2);
  color: var(--text-2); cursor: pointer; padding: 0;
  transition: background .15s, color .15s, transform .1s;
}
.sheet-close-btn:hover { background: var(--surface-3); color: var(--text); }
.sheet-close-btn:active { transform: scale(.94); }
.sheet-head-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
}
.sheet-head-bar h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--text);
  text-align: center;
  flex: 1;
}
.sheet-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 99px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, color .15s, transform .1s;
  flex-shrink: 0;
}
.sheet-back-btn:hover { background: var(--surface-3); color: var(--text); }
.sheet-back-btn:active { transform: scale(0.95); }
.sheet-done-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 99px;
  background: var(--brand);
  border: 1px solid transparent;
  color: #FFFFFF;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background .15s, transform .1s;
  flex-shrink: 0;
}
.sheet-done-btn:hover { background: var(--brand-dark, #1d4ed8); }
.sheet-done-btn:active { transform: scale(0.95); }
.sheet-menu-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
}
.sheet-nav-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  font-size: 13.5px;
  font-weight: 500;
  cursor: pointer;
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--line);
  transition: all .15s ease;
}
.sheet-nav-btn:hover {
  background: var(--surface-3);
  border-color: var(--line-2);
}
.sheet-nav-btn.active {
  background: var(--brand);
  color: var(--brand-ink, #fff);
  font-weight: 700;
  border-color: transparent;
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}
.sheet-divider {
  height: 1px;
  background: var(--line);
  margin: 16px 0 14px;
}
.sheetlist { display: block; }
.fuelopt {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left;
  padding: 11px; border-radius: var(--r-md); border: 1px solid var(--line);
  background: var(--surface); margin-bottom: 8px; transition: border-color .12s, background .12s;
}
.fuelopt:hover { border-color: var(--line-2); }
.fuelopt.on { border-color: var(--brand); background: var(--brand-soft); }
.fuelopt .fo-ico { width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center; background: var(--surface-3); color: var(--text-2); flex: none; border: 1px solid transparent; }
.fuelopt.on .fo-ico { background: #fff; color: var(--brand); border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent); }

.fuelopt .fo-ico.fuel-e10 { color: var(--fuel-e10); background: color-mix(in srgb, var(--fuel-e10) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--fuel-e10) 24%, transparent); }
.fuelopt .fo-ico.fuel-b7s { color: var(--fuel-b7s); background: color-mix(in srgb, var(--fuel-b7s) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--fuel-b7s) 24%, transparent); }
.fuelopt .fo-ico.fuel-e5  { color: var(--fuel-e5);  background: color-mix(in srgb, var(--fuel-e5) 14%, var(--surface-2));  border-color: color-mix(in srgb, var(--fuel-e5) 24%, transparent); }
.fuelopt .fo-ico.fuel-b7p { color: var(--fuel-b7p); background: color-mix(in srgb, var(--fuel-b7p) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--fuel-b7p) 24%, transparent); }
.fuelopt .fo-ico.fuel-b10 { color: var(--fuel-b10); background: color-mix(in srgb, var(--fuel-b10) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--fuel-b10) 24%, transparent); }
.fuelopt .fo-ico.fuel-hvo { color: var(--fuel-hvo); background: color-mix(in srgb, var(--fuel-hvo) 14%, var(--surface-2)); border-color: color-mix(in srgb, var(--fuel-hvo) 24%, transparent); }

[data-theme="dark"] .fuelopt .fo-ico.fuel-e10 { color: var(--fuel-e10); background: color-mix(in srgb, var(--fuel-e10) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelopt .fo-ico.fuel-b7s { color: var(--fuel-b7s); background: color-mix(in srgb, var(--fuel-b7s) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelopt .fo-ico.fuel-e5  { color: var(--fuel-e5);  background: color-mix(in srgb, var(--fuel-e5) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelopt .fo-ico.fuel-b7p { color: var(--fuel-b7p); background: color-mix(in srgb, var(--fuel-b7p) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelopt .fo-ico.fuel-b10 { color: var(--fuel-b10); background: color-mix(in srgb, var(--fuel-b10) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelopt .fo-ico.fuel-hvo { color: var(--fuel-hvo); background: color-mix(in srgb, var(--fuel-hvo) 22%, var(--surface-2)); }

.fuelopt.on .fo-ico.fuel-e10 { background: var(--fuel-e10); color: #fff; border-color: transparent; }
.fuelopt.on .fo-ico.fuel-b7s { background: var(--fuel-b7s); color: #fff; border-color: transparent; }
.fuelopt.on .fo-ico.fuel-e5  { background: var(--fuel-e5);  color: #fff; border-color: transparent; }
.fuelopt.on .fo-ico.fuel-b7p { background: var(--fuel-b7p); color: #fff; border-color: transparent; }
.fuelopt.on .fo-ico.fuel-b10 { background: var(--fuel-b10); color: #fff; border-color: transparent; }
.fuelopt.on .fo-ico.fuel-hvo { background: var(--fuel-hvo); color: #fff; border-color: transparent; }

[data-theme="dark"] .fuelopt.on .fo-ico.fuel-b7s { background: var(--fuel-b7s); color: #0b1320; }
[data-theme="dark"] .fuelopt.on .fo-ico.fuel-e5  { background: var(--fuel-e5);  color: #1a1200; }
[data-theme="dark"] .fuelopt.on .fo-ico.fuel-e10 { background: var(--fuel-e10); color: #052e16; }
[data-theme="dark"] .fuelopt.on .fo-ico.fuel-b7p { background: var(--fuel-b7p); color: #270d03; }
[data-theme="dark"] .fuelopt.on .fo-ico.fuel-b10 { background: var(--fuel-b10); color: #042429; }
[data-theme="dark"] .fuelopt.on .fo-ico.fuel-hvo { background: var(--fuel-hvo); color: #031e3b; }
.fuelopt .fo-txt { flex: 1; min-width: 0; }
.fuelopt .fo-txt b { display: block; font-family: var(--font-display); font-size: 14.5px; letter-spacing: -.01em; }
.fuelopt .fo-txt span { font-size: 12px; color: var(--text-2); }
.fuelopt > .ic { color: var(--brand); }
.fuelopt .fo-ico .ic { color: inherit; }

.filter-grid {
  display: flex;
  flex-direction: column;
}
/* Facilities filter group on desktop: 2-column grid */
@media (min-width: 769px) {
  .filter-grid-facilities {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }
  .filter-grid-facilities .fuelopt {
    margin-bottom: 0;
    padding: 8px 10px;
    gap: 8px;
    min-height: 52px;
  }
  .filter-grid-facilities .fuelopt .fo-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .filter-grid-facilities .fuelopt .fo-ico svg {
    width: 15px;
    height: 15px;
  }
  .filter-grid-facilities .fuelopt .fo-txt {
    min-width: 0;
    flex: 1;
  }
  .filter-grid-facilities .fuelopt .fo-txt b {
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .filter-grid-facilities .fuelopt .fo-txt span {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .filter-grid-facilities .fuelopt > svg.ic:last-child {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
  .filter-grid-facilities > .fuelopt:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}
@media (max-width: 768px) {
  .filter-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    margin-bottom: 8px;
  }
  .filter-grid .fuelopt {
    margin-bottom: 0;
    padding: 8px 10px;
    gap: 8px;
    min-height: 52px;
  }
  .filter-grid .fuelopt .fo-ico {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .filter-grid .fuelopt .fo-ico svg {
    width: 15px;
    height: 15px;
  }
  .filter-grid .fuelopt .fo-txt {
    min-width: 0;
    flex: 1;
  }
  .filter-grid .fuelopt .fo-txt b {
    font-size: 13px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .filter-grid .fuelopt .fo-txt span {
    font-size: 11px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .filter-grid .fuelopt > svg.ic:last-child {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
  }
  /* When an odd number of items exists, the last item spans cleanly across both columns */
  .filter-grid > .fuelopt:last-child:nth-child(odd) {
    grid-column: span 2;
  }
}

/* fuel + vehicle selector in the dock — one slim segmented row */
.fuelrow {
  display: flex; align-items: stretch; gap: 0; width: 100%;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 3px;
}
.fuelbtn {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; text-align: left;
  background: transparent; border: 0; border-radius: var(--r-pill); padding: 3px 8px 3px 4px;
}
.fuelbtn:hover { background: var(--surface-2); }
.fuelbtn .fico { width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); flex: none; }
.fuelbtn .fico.fuel-e10 { color: var(--fuel-e10); background: color-mix(in srgb, var(--fuel-e10) 14%, var(--surface-2)); }
.fuelbtn .fico.fuel-b7s { color: var(--fuel-b7s); background: color-mix(in srgb, var(--fuel-b7s) 14%, var(--surface-2)); }
.fuelbtn .fico.fuel-e5  { color: var(--fuel-e5);  background: color-mix(in srgb, var(--fuel-e5) 14%, var(--surface-2)); }
.fuelbtn .fico.fuel-b7p { color: var(--fuel-b7p); background: color-mix(in srgb, var(--fuel-b7p) 14%, var(--surface-2)); }
.fuelbtn .fico.fuel-b10 { color: var(--fuel-b10); background: color-mix(in srgb, var(--fuel-b10) 14%, var(--surface-2)); }
.fuelbtn .fico.fuel-hvo { color: var(--fuel-hvo); background: color-mix(in srgb, var(--fuel-hvo) 14%, var(--surface-2)); }
[data-theme="dark"] .fuelbtn .fico.fuel-e10 { color: var(--fuel-e10); background: color-mix(in srgb, var(--fuel-e10) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelbtn .fico.fuel-b7s { color: var(--fuel-b7s); background: color-mix(in srgb, var(--fuel-b7s) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelbtn .fico.fuel-e5  { color: var(--fuel-e5);  background: color-mix(in srgb, var(--fuel-e5) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelbtn .fico.fuel-b7p { color: var(--fuel-b7p); background: color-mix(in srgb, var(--fuel-b7p) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelbtn .fico.fuel-b10 { color: var(--fuel-b10); background: color-mix(in srgb, var(--fuel-b10) 22%, var(--surface-2)); }
[data-theme="dark"] .fuelbtn .fico.fuel-hvo { color: var(--fuel-hvo); background: color-mix(in srgb, var(--fuel-hvo) 22%, var(--surface-2)); }
.fuelbtn .ftxt { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; }
.fuelbtn .ftxt b { min-width: 0; font-family: var(--font-display); font-size: 12.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fuelbtn .fprice { font-size: 11.5px; color: var(--text-2); white-space: nowrap; }
.fuelbtn .fprice i { font-style: normal; color: var(--muted); font-size: 10px; }
.fuelbtn > .ic { color: var(--muted); flex: none; }
@media (max-width: 420px) { .hide-xs, .fuelbtn .fctx { display: none; } }

/* live "you are here" dot */
.userdot {
  width: 16px; height: 16px; border-radius: 50%; background: var(--brand);
  border: 3px solid #fff; box-shadow: 0 1px 4px rgba(0,0,0,.35);
}
.userdot::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; border-radius: 50%;
  background: var(--brand); opacity: .35; transform: translate(-50%,-50%);
  animation: ufpulse 2s ease-out infinite;
}
@keyframes ufpulse {
  0%   { opacity: .45; transform: translate(-50%,-50%) scale(.6); }
  100% { opacity: 0;   transform: translate(-50%,-50%) scale(2.6); }
}
/* Keep interactive map canvas in natural, legible light style across all themes */
.invert-map .maplibregl-canvas { filter: none; }
.map .attrib { position: absolute; left: 10px; bottom: 8px; font-size: 10px; color: var(--map-label); opacity: .8; }

/* ------------------------------ Drawer -------------------------------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(6,10,16,.5); z-index: 1000; opacity: 0; pointer-events: none; transition: opacity .18s; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 1001; max-height: 90vh; overflow: auto;
  background: var(--surface); border-top-left-radius: var(--r-xl); border-top-right-radius: var(--r-xl);
  border-top: 1px solid var(--line); box-shadow: var(--shadow-2);
  transform: translateY(102%); transition: transform .24s cubic-bezier(.2,.75,.2,1);
  padding: 14px 16px calc(var(--s5) + env(safe-area-inset-bottom));
}
/* compact the detail panel */
.drawer .brandchip { width: 44px; height: 44px; border-radius: 12px; }
.drawer h3 { font-size: 16.5px; }
.drawer .meta.tags { margin-top: 6px; }
.drawer .savings { margin-top: 10px; padding: 8px 12px; }
.drawer .section { margin-bottom: 14px; }
.drawer .section h2 { margin-bottom: 8px; }
.drawer .section > h2 { margin-top: 2px; }
.drawer .btnrow .btn { padding: 8px 13px; justify-content: center; }
.drawer.open { transform: translateY(0); }

/* Unified station drawer header */
.dhead {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding-right: 0;
  margin-bottom: var(--s3);
}
.drawer-logo {
  width: 48px;
  height: 48px;
  border-radius: 13px;
  flex-shrink: 0;
}
.dhead-main {
  flex: 1 1 0;
  min-width: 0;
}
.dhead-main h3,
.drawer h3 {
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.25;
  color: var(--text);
  overflow-wrap: break-word;
  padding-right: 0;
  margin: 0 0 3px 0;
}
.dhead-main .meta {
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.35;
}
.dhead-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
  margin-top: 1px;
}
.drawer-circle-btn {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: var(--surface-2);
  color: var(--text-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.15s ease;
  padding: 0;
  flex-shrink: 0;
  line-height: 1;
  position: static !important;
  top: auto !important;
  right: auto !important;
}
.drawer-circle-btn:hover {
  background: var(--surface-3);
  color: var(--text);
  border-color: var(--line-2);
}
.drawer-circle-btn.starbtn.on {
  color: #eab308;
  background: color-mix(in srgb, #eab308 14%, var(--surface));
  border-color: color-mix(in srgb, #eab308 45%, var(--line));
}
.drawer-circle-btn.close-btn {
  color: var(--text-2);
}
.drawer-circle-btn.close-btn:hover {
  color: var(--text);
}
@media (max-width: 560px) {
  .dhead { gap: 10px; }
  .drawer-logo { width: 42px; height: 42px; border-radius: 11px; }
  .dhead-main h3, .drawer h3 { font-size: 16px; line-height: 1.25; }
  .drawer-circle-btn { width: 32px; height: 32px; }
}

.rowsplit { display: flex; gap: var(--s3); align-items: baseline; justify-content: space-between; margin-top: var(--s4); }
.rowsplit > * { min-width: 0; }
.gradegrid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 8px; }
.sechead { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.sechead h2 { margin: 0; }
.sechead > span { font-size: 10px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 800; }
.statusgrid2 {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-top: 14px; background: var(--surface-2);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 11px 12px;
}
.statcell { min-width: 0; }
.statcell + .statcell { border-left: 1px solid var(--line); padding-left: 10px; }
.statcell > .slabel {
  display: block; font-size: 9.5px; text-transform: uppercase;
  letter-spacing: .08em; color: var(--muted); font-weight: 800; margin-bottom: 5px;
}
.statval { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.25; }
.statval.warn { color: var(--warn); }
.sdot { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--muted); }
.sdot.good { background: var(--good); }
.sdot.warn { background: var(--warn); }
.sdot.bad { background: var(--bad); }
.statnote { font-size: 10.5px; color: var(--warn); margin-top: 3px; padding-left: 13px; display: inline-flex; align-items: center; gap: 4px; }
.stale-info-btn { background: transparent; border: none; padding: 0; margin: 0; cursor: pointer; color: var(--warn); display: inline-flex; align-items: center; justify-content: center; opacity: .85; transition: opacity .15s; }
.stale-info-btn:hover { opacity: 1; }
.stale-info-popover { margin-top: 6px; padding: 6px 9px; background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; font-size: 11px; line-height: 1.35; color: var(--text-2); }
.stale-info-popover .sip-mobile { display: inline; }
.stale-info-popover .sip-desktop { display: none; }
@media (min-width: 641px) {
  .stale-info-popover .sip-mobile { display: none; }
  .stale-info-popover .sip-desktop { display: inline; }
}
@media (max-width: 340px) {
  .statusgrid2 { gap: 8px; padding: 10px; }
  .statval { font-size: 12px; }
}
.gradebox {
  position: relative; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: var(--r-md); padding: 10px 12px 9px; overflow: hidden;
}
.gradebox.fuel-e10 { --fuel: var(--fuel-e10); }
.gradebox.fuel-e5 { --fuel: var(--fuel-e5); }
.gradebox.fuel-b7s { --fuel: var(--fuel-b7s); }
.gradebox.fuel-b7p { --fuel: var(--fuel-b7p); }
.gradebox.fuel-b10 { --fuel: var(--fuel-b10); }
.gradebox.fuel-hvo { --fuel: var(--fuel-hvo); }
.gradebox::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3.5px; background: var(--fuel, var(--line-2)); }
.gradebox .gk {
  font-size: 12px; color: var(--text-2); text-transform: none;
  letter-spacing: -.01em; font-weight: 700;
}
.gradebox .gv {
  font-family: var(--font-mono); font-variant-numeric: tabular-nums;
  display: flex; align-items: baseline; gap: 1px; margin-top: 4px;
}
.gradebox .gv b { font-size: 28px; font-weight: 800; letter-spacing: -.03em; line-height: 1; }
.gradebox .gv i { font-style: normal; font-size: 17px; font-weight: 800; transform: translateY(-6px); }
.gradebox .gv em { font-style: normal; font-size: 11px; font-weight: 700; color: var(--muted); margin-left: 3px; transform: translateY(-10px); }
.gradebox.best { border-color: color-mix(in srgb, var(--good) 45%, var(--line)); background: var(--good-soft); }
.gradebox.best::before { background: var(--good); }
.gradebox.best .gv { color: var(--good); }
.gradebox.best .gv em { color: color-mix(in srgb, var(--good) 70%, var(--muted)); }
.gradebox .gfill { font-size: 11.5px; font-weight: 600; color: var(--text-2); margin-top: 5px; letter-spacing: -.01em; line-height: 1.2; }
.gradebox.best .gfill { color: color-mix(in srgb, var(--good) 85%, var(--text)); font-weight: 700; }

.affiliate {
  display: flex; gap: var(--s3); align-items: center; margin-top: var(--s4); padding: var(--s3);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line)); background: var(--brand-soft);
  border-radius: var(--r-md); font-size: 13px;
}
.affiliate .cta { margin-left: auto; background: var(--brand); color: var(--brand-ink); border-radius: var(--r-pill); padding: 8px 14px; font-weight: 600; flex: none; text-decoration: none; }
@media (max-width: 540px) {
  .affiliate { flex-direction: column; align-items: stretch; gap: 10px; }
  .affiliate .cta { margin-left: 0; text-align: center; justify-content: center; width: 100%; }
}
.trust { margin-top: var(--s4); font-size: 12px; color: var(--muted); }

/* --------------------------- Charts / trend --------------------------- */
.trend-card {
  padding: 16px;
  border-radius: var(--r-lg);
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-1);
}
.trend-card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}
.trend-eyebrow {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--text-2);
  display: block;
  margin-bottom: 3px;
}
.trend-title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}
.trend-metric {
  text-align: right;
  flex-shrink: 0;
}
.trend-current {
  display: block;
  font-size: 19px;
  font-weight: 800;
  color: var(--text);
  line-height: 1.15;
}
.trend-delta {
  font-size: 12px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 3px;
  margin-top: 2px;
}
.trend-delta.down { color: var(--good, #16a34a); }
.trend-delta.up { color: var(--bad, #dc2626); }
.trend-delta.flat { color: var(--text-2); }
.trend-chart-wrap {
  width: 100%;
  height: 84px;
  position: relative;
  overflow: hidden;
  border-radius: 9px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.trend-svg {
  width: 100%;
  height: 100%;
  display: block;
}
.trend-timeline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 8px;
  padding: 0 4px;
}
.trend-timeline-now {
  font-weight: 700;
  color: var(--brand);
}
.trend { display: flex; align-items: flex-end; gap: 4px; height: 76px; margin-top: var(--s3); }
.trend .bar { flex: 1; background: var(--brand-soft); border-radius: 4px 4px 0 0; min-height: 4px; }
.trend .bar.now { background: var(--brand); }
.bars { margin-top: var(--s3); }
.bar-row { display: flex; align-items: center; gap: var(--s3); margin-bottom: 9px; font-size: 12.5px; }
.bar-row .lab { width: 92px; color: var(--text-2); flex: none; }
.bar-row .track { flex: 1; height: 9px; background: var(--surface-3); border-radius: var(--r-pill); overflow: hidden; }
.bar-row .fill { height: 100%; background: var(--brand); border-radius: var(--r-pill); }
.bar-row .val { width: 56px; text-align: right; font-family: var(--font-mono); font-variant-numeric: tabular-nums; font-weight: 600; }

/* --------------------------- Hero + footer ---------------------------- */
.hero {
  width: 100%; display: flex; align-items: center; gap: var(--s3); text-align: left;
  background: linear-gradient(135deg, var(--brand), color-mix(in srgb, var(--brand) 70%, #000));
  color: var(--brand-ink); border-radius: var(--r-lg); padding: 14px 16px; margin-bottom: var(--s4);
  box-shadow: var(--shadow-2);
}
.hero:hover { filter: brightness(1.06); }
.hero .heroidx { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,255,255,.18); flex: none; }
.hero .herotext { flex: 1; min-width: 0; }
.hero .herotext b { display: block; font-family: var(--font-display); font-size: 15.5px; letter-spacing: -.02em; }
.hero .herotext span { font-size: 12.5px; opacity: .85; }
.site-footer {
  margin: 32px 0 24px 0;
  padding: 0 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 12px;
}
.footlinks {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
}
.footlink {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  padding: 8px 16px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  transition: all 0.15s ease;
}
.footlink:hover {
  color: var(--text);
  border-color: var(--line-2);
  transform: translateY(-1px);
}
.footattr {
  font-size: 11.5px;
  color: var(--muted);
  line-height: 1.4;
  margin: 0;
}
.aboutblk { margin-bottom: 14px; }
.aboutblk b { font-family: var(--font-display); font-size: 14px; display: block; margin-bottom: 3px; }
.aboutblk p { margin: 0; font-size: 12.5px; color: var(--text-2); line-height: 1.5; }

/* --------------------------- Expanded card ---------------------------- */
.station.expanded { border-color: color-mix(in srgb, var(--brand) 35%, var(--line)); }
.expand { margin-top: var(--s3); border-top: 1px solid var(--line); padding-top: var(--s3); animation: exp .18s ease-out; }
@keyframes exp { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.exp-sec { margin-bottom: var(--s4); }
.exp-sec h4 {
  display: flex; align-items: center; gap: 6px; margin: 0 0 8px;
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .09em; color: var(--muted);
}
.addrbox {
  width: 100%; display: flex; align-items: flex-start; gap: 10px; text-align: left;
  background: var(--surface-2); border: 1px dashed var(--line-2); border-radius: var(--r-md);
  padding: 11px 12px; font-size: 13px; color: var(--text);
}
.addrbox:hover { border-style: solid; border-color: var(--brand); }
.addrbox .addrtext { flex: 1; min-width: 0; line-height: 1.4; }
.addrbox .addrcta { color: var(--brand); flex: none; }
.hoursum { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.hoursum .hint { font-size: 12.5px; color: var(--text-2); }
.hgrid { border: 1px solid var(--line); border-radius: var(--r-md); overflow: hidden; }
.hrow { display: flex; justify-content: space-between; padding: 5px 12px; font-size: 12.5px; border-bottom: 1px solid var(--line); }
.hrow:last-child { border-bottom: 0; }
.hrow span:first-child { color: var(--text-2); }
.hrow.today { background: var(--brand-soft); }
.hrow.today span { color: var(--brand); font-weight: 700; }
.badge.drop { background: var(--good-soft); color: var(--good); }
.badge.rise { background: var(--warn-soft); color: var(--warn); }
.badge.closed { background: var(--bad-soft); color: var(--bad); border-color: color-mix(in srgb, var(--bad) 20%, transparent); }
.badge.soon { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 20%, transparent); }
.notstock {
  display: flex; align-items: center; gap: 6px; margin-top: 8px;
  font-size: 11.5px; color: var(--muted);
}
.tiny { font-size: 11.5px; color: var(--muted); }
.subrow { display: flex; gap: 10px; align-items: flex-start; justify-content: space-between; flex-wrap: wrap; }
.submain { min-width: 0; flex: 1; }
.subtag { flex: none; padding-top: 2px; }
.fgroup { margin-bottom: 16px; }
.fgroup h4 {
  margin: 0 0 8px; font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .09em; color: var(--muted);
}

/* closed stations: still shown with their last price — greyed + faded, no words */
.pricetag.closed {
  background: var(--surface-2);
  color: var(--text-2);
  border-style: dashed;
  border-color: var(--line-2);
  opacity: .68;
}
.pricetag.closed .lg, .pricetag.closed .lgtext { filter: grayscale(1); }

/* status dot — a tiny corner badge. grey = closed, amber = closing soon */
.pricetag .dot {
  position: absolute; top: -4px; right: -4px;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--muted); border: 1.5px solid var(--surface);
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--text) 14%, transparent);
}
.pricetag.soon .dot { background: var(--warn); }
@keyframes tagdot { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(1.35); opacity: .5; } }
.pricetag.soon .dot { animation: tagdot 1.8s ease-in-out infinite; }
.pricetag.msa-tag { border-color: #0066cc; }
.pricetag .msa-dot { position: absolute; top: -6px; left: -6px; width: 14px; height: 14px; border-radius: 4px; background: #0066cc; color: #fff; font-size: 9px; font-weight: 800; line-height: 14px; text-align: center; box-shadow: 0 1px 2px rgba(0,0,0,0.3); }
@media (prefers-reduced-motion: reduce) { .pricetag.soon .dot { animation: none; } }

/* town table rows are tappable */
.rank-table tr.rowclick { cursor: pointer; }
.tapoff {
  display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600;
  color: var(--brand); white-space: nowrap;
}

/* ------------------- Mobile map: drag + full screen ------------------- */
/* drag handle — a bar UNDER the map, outside the map canvas. No words: the
   chevrons + bar read as "pull me up / down". */
.mapgrip {
  display: flex; align-items: center; justify-content: center;
  height: 42px; margin: 0 0 4px; width: 100%;
  touch-action: none; cursor: ns-resize; user-select: none;
  -webkit-tap-highlight-color: transparent;
  background: transparent; border: 0; color: var(--muted);
  transition: color .15s;
}
.mapgrip.dragging { cursor: grabbing; }
.mapgrip.dragging .bar { background: var(--brand); opacity: .9; }
@media (max-width: 1023px) {
  #mapMobile { transition: height .22s cubic-bezier(.2,.75,.2,1); }
  #mapMobile.map-dragging { transition: none; }
}
.gripinner {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 0; border: 0; border-radius: 0; background: transparent;
}
.mapgrip.expanded .gripinner { background: transparent; border-color: transparent; box-shadow: none; padding: 0; }
.mapgrip .bar { width: 48px; height: 5px; border-radius: 3px; background: currentColor; opacity: .6; transition: opacity .15s, background .15s; }
.mapgrip:hover, .mapgrip:active, .mapgrip:focus-visible { color: var(--brand); }
.mapgrip:hover .bar, .mapgrip:active .bar { opacity: .9; }
.mapgrip.expanded .bar { background: var(--brand); opacity: .85; }
.mapgrip .gripfs {
  display: none !important;
}
@media (min-width: 1024px) { .mapgrip { display: none; } }

/* Filter control on the full-screen mobile map. It sits at the top-left,
   detached from the right-hand stack so a retracting drawer/sheet can never
   cover it. */
.mapfilterctl {
  position: absolute; top: calc(10px + env(safe-area-inset-top)); left: 10px;
  z-index: 7; display: block;
}
.mapfilter {
  display: flex; align-items: center; gap: 7px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px); color: var(--text);
  font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-2);
  cursor: pointer;
}
.mapfilter:hover { background: var(--surface); }
.mapfilter .ic { color: var(--text-2); }
.mapfilter .fbadge {
  display: none; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px;
  background: var(--brand); color: var(--brand-ink);
  font-size: 9px; font-weight: 800; line-height: 1; place-items: center;
}
.mapfilter.hasfilters .fbadge { display: grid; }
@media (max-width: 560px) {
  .mapfilterctl { top: calc(8px + env(safe-area-inset-top)); left: 8px; }
  .mapfilter { height: 36px; padding: 0 11px; font-size: 12px; }
}

/* mobile search sits under the map, where the thumb is */
body.tab-route .topbar .search { display: none !important; }
.msearch { display: none; }
@media (max-width: 1023px) {
  .topbar {
    padding: 0 12px;
    gap: 8px;
    max-width: 100vw;
    box-sizing: border-box;
    transition: background 0.25s ease, backdrop-filter 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  }
  body.scrolled .topbar {
    background: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    border-bottom-color: transparent !important;
    box-shadow: none !important;
    pointer-events: none;
  }
  .menu-btn { display: inline-grid; place-items: center; }
  #settingsBtn, #themeBtn { display: none !important; }
  .topbar .search { display: none; }
  .wordmark {
    gap: 7px;
    flex-shrink: 1;
    min-width: 0;
    pointer-events: auto;
  }
  .wordmark .glyph {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    flex-shrink: 0;
    transition: box-shadow 0.25s ease, transform 0.2s ease;
  }
  body.scrolled .wordmark .glyph {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.22);
  }
  .wordmark .txt {
    font-size: 15px;
    white-space: nowrap;
    display: inline-block;
    max-width: 180px;
    opacity: 1;
    overflow: hidden;
    transition: max-width 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
    transform-origin: left center;
  }
  body.scrolled .wordmark .txt {
    max-width: 0 !important;
    opacity: 0 !important;
    transform: scale(0.9);
    pointer-events: none;
    margin: 0;
  }
  .topright {
    gap: 6px;
    flex-shrink: 0;
    margin-left: auto;
    pointer-events: none;
  }
  body.scrolled #ticker,
  body.scrolled #mbuyBadge {
    max-width: 0 !important;
    opacity: 0 !important;
    pointer-events: none !important;
    overflow: hidden !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    transition: max-width 0.25s ease, opacity 0.2s ease;
  }
  #menuBtn {
    pointer-events: auto;
    transition: background 0.2s ease, box-shadow 0.25s ease, border-color 0.2s ease;
  }
  body.scrolled #menuBtn {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    color: var(--text);
  }
  [data-theme="dark"] body.scrolled #menuBtn {
    background: rgba(15, 23, 42, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
    color: var(--text);
  }
  .iconbtn {
    width: 34px;
    height: 34px;
    border-radius: 8px;
    flex-shrink: 0;
  }
  .iconbtn svg {
    width: 16px;
    height: 16px;
  }
  .mbuy {
    display: none !important;
  }
  .msearch {
    position: relative; display: flex; align-items: center; gap: 8px;
    margin: 0 12px 12px; padding: 4px 5px 4px 13px;
    background: var(--surface); border: 1.5px solid var(--line-2);
    border-radius: var(--r-pill); box-shadow: 0 3px 12px rgba(0, 0, 0, 0.06);
  }
  .msearch .suggest {
    top: calc(100% + 6px);
    max-height: min(50vh, 420px);
    z-index: 75;
  }
  .msearch .msearch-pin {
    display: none;
  }
  .msearch .msearch-back {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 4px 9px;
    height: 28px;
    border-radius: var(--r-pill, 99px);
    background: var(--surface-2, #f1f5f9);
    border: 1px solid var(--line-2, #cbd5e1);
    color: var(--text, #0f172a);
    font: 700 12px/1 var(--ui, system-ui, sans-serif);
    cursor: pointer;
    flex: none;
    box-sizing: border-box;
    white-space: nowrap;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.1s;
  }
  .msearch .msearch-back[hidden] {
    display: none;
  }
  .msearch .msearch-back:hover {
    background: var(--brand-soft);
    border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
    color: var(--brand);
  }
  .msearch .msearch-back:active {
    transform: scale(0.96);
    background: var(--brand-soft);
  }
  .msearch .msearch-back svg {
    flex: none;
    color: var(--brand);
  }
  [data-theme="dark"] .msearch .msearch-back {
    background: #1e293b;
    border-color: #334155;
    color: #f8fafc;
  }
  .msearch input {
    flex: 1; min-width: 0; border: 0; background: transparent; color: var(--text);
    font: inherit; font-size: 14.5px; outline: none; padding: 7px 2px;
  }
  .msearch input::placeholder { color: var(--muted, #94a3b8); font-weight: 400; }
  .msearch .mnear {
    display: inline-flex; align-items: center; gap: 5px; flex: none;
    border: 0; background: var(--brand-soft); color: var(--brand);
    font-weight: 700; font-size: 12.5px; padding: 7px 12px; border-radius: var(--r-pill); cursor: pointer;
    transition: background .12s, color .12s, transform .1s;
  }
  .msearch .mnear:hover {
    background: color-mix(in srgb, var(--brand-soft) 70%, var(--brand));
  }
  [data-theme="dark"] .msearch .mnear {
    background: var(--brand-soft);
    color: var(--brand);
  }
  .msearch .mgo {
    width: 36px; height: 36px; flex: none; border: 0;
    background: #1e293b; color: #ffffff;
    display: grid; place-items: center; border-radius: 50%; cursor: pointer;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    transition: transform .1s, background .15s;
  }
  [data-theme="dark"] .msearch .mgo {
    background: var(--brand); color: var(--brand-ink);
  }
  .msearch .mgo:active, .msearch .mnear:active { transform: scale(.96); }
  .msearch input[type="search"]::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
  body.map-full #msearch { display: none !important; }
  body.tab-route #msearch { display: none !important; }
  body.tab-buywindow #msearch { display: none !important; }
}

@media (max-width: 400px) {
  .topbar {
    padding: 0 8px;
    gap: 6px;
  }
  .msearch {
    margin: 2px 8px 10px;
    padding: 3px 4px 3px 12px;
    gap: 6px;
  }
  .msearch input {
    font-size: 13.5px;
  }
  .msearch .mnear {
    padding: 6px 9px;
    font-size: 11.5px;
    gap: 4px;
  }
  .msearch .mgo {
    width: 33px;
    height: 33px;
  }
  .wordmark {
    gap: 5px;
  }
  .wordmark .txt {
    font-size: 13.5px;
  }
  .wordmark .txt .tld {
    display: none;
  }
  .topright {
    gap: 5px;
  }
  .iconbtn {
    width: 32px;
    height: 32px;
  }
  .mbuy .badge {
    padding: 3px 6px;
    font-size: 11px;
    gap: 3px;
  }
}

@media (max-width: 350px) {
  .topbar {
    padding: 0 6px;
    gap: 4px;
  }
  .topright {
    gap: 4px;
  }
  .mbuy .badge span {
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

/* the full-screen map button only exists where the mobile map does */
.mapctl .round.only-mobile { display: none; }
@media (max-width: 1023px) { .mapctl .round.only-mobile { display: grid; } }
html[data-forcemobile="1"] .mapctl .round.only-mobile { display: grid; }

body.map-full {
  overflow: hidden;
  --mf-bar-offset: calc(64px + env(safe-area-inset-bottom, 0px));
}
body.map-full.has-peek {
  --mf-bar-offset: calc(185px + env(safe-area-inset-bottom, 0px));
}
body.map-full #mapMobile {
  position: fixed; inset: 0; height: 100vh !important; height: 100dvh !important; width: 100%;
  margin: 0; border: 0; border-radius: 0; z-index: 80; isolation: isolate;
}
body.map-full .drawer-scrim { z-index: 1000; }
body.map-full .drawer, body.map-full .sheet { z-index: 1001; }
body.map-full .route-opts-popover { z-index: 1050; }
body.map-full .toast { z-index: 1200 !important; bottom: calc(var(--mf-bar-offset) + 12px) !important; }
body.map-full .fuelmenu { z-index: 1260 !important; }

/* ------------------- Full-Screen Mobile Map HUD & Controls ------------------- */
body.map-full #mapMobile .mapctl {
  top: auto !important;
  right: 10px !important;
  bottom: calc(var(--mf-bar-offset) + 4px) !important;
  transition: bottom 0.2s ease-out;
  z-index: 25;
}
body.map-full #mapMobile .mapctl.expanded .seg {
  position: absolute;
  top: 0;
  right: 42px;
  white-space: nowrap;
}
body.tab-route #mapMobile .mapfilterctl {
  display: none !important;
}
body.tab-route .maparea-btn,
body.tab-route .map-reset-origin-btn {
  display: none !important;
}
body.tab-buywindow #mapMobile,
body.tab-buywindow #msearch,
body.tab-buywindow .mapfilterctl,
body.tab-buywindow .maparea-btn,
body.tab-buywindow .map-reset-origin-btn {
  display: none !important;
}
@media (max-width: 1023px) {
  body.tab-buywindow .pane-left {
    height: auto;
    min-height: calc(100vh - 120px);
  }
  body.tab-buywindow #feed {
    height: auto;
    overflow: visible;
    padding-top: var(--s3);
  }
}
body.map-full:not(.tab-route) #mapMobile .mapfilterctl {
  top: calc(58px + env(safe-area-inset-top, 0px)) !important;
  left: 10px !important;
  z-index: 25;
}
body.map-full #mapMobile .zoomctl {
  top: auto !important;
  bottom: calc(var(--mf-bar-offset) + 34px) !important;
  left: 10px !important;
  transition: bottom 0.2s ease-out;
  z-index: 25;
}
body.map-full #mapMobile .maplibregl-ctrl-bottom-left {
  left: 10px !important;
  bottom: calc(var(--mf-bar-offset) + 2px) !important;
  margin: 0 !important;
  z-index: 26 !important;
  transition: bottom 0.2s ease-out;
}
body.map-full #mapMobile .maplibregl-ctrl-attrib.maplibregl-compact:not(.maplibregl-compact-show) {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  backdrop-filter: none !important;
  padding: 0 !important;
}
body.map-full #mapMobile .maplibregl-ctrl-attrib.maplibregl-compact.maplibregl-compact-show {
  margin: 0 !important;
  max-width: calc(100vw - 64px);
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  color: var(--text-2);
  backdrop-filter: blur(8px);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
}

.mapfull-hud {
  display: none;
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 86;
  font-family: inherit;
  flex-direction: column;
  justify-content: space-between;
}
body.map-full .mapfull-hud {
  display: flex !important;
}

/* Top Floating Bar */
.mf-top-slot {
  position: relative;
  z-index: 87;
  pointer-events: auto;
}
.mf-top-bar-wrap {
  position: relative;
  z-index: 2;
}
.mf-top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 6px;
  pointer-events: auto;
  z-index: 22;
  position: relative;
}
.mf-msearch {
  flex: 1;
  min-width: 0;
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 40px;
  margin: 0;
  padding: 3px 4px 3px 11px;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line-2, #e2e8f0);
  border-radius: var(--r-pill, 999px);
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.14);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.mf-msearch:focus-within {
  border-color: var(--brand, #0066cc);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand, #0066cc) 18%, transparent), 0 4px 14px rgba(0, 0, 0, 0.14);
}
.mf-msearch .mf-search-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  color: var(--text, #0f172a);
  font: inherit;
  font-size: 13.5px;
  font-weight: 500;
  outline: none;
  padding: 3px 0;
}
.mf-msearch .mf-search-input::placeholder {
  color: var(--muted, #94a3b8);
  font-size: 13px;
  font-weight: 400;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mf-msearch .mf-search-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  display: none;
}
.mf-msearch .mf-search-clear {
  width: 24px;
  height: 24px;
  flex: none;
  border: 0;
  border-radius: 50%;
  background: var(--surface-2, #f1f5f9);
  color: var(--muted, #64748b);
  font-size: 12px;
  line-height: 1;
  display: inline-grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}
.mf-msearch .mf-search-clear[hidden] {
  display: none !important;
}
.mf-msearch .mf-near {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: none;
  border: 0;
  background: var(--brand-soft, #eff6ff);
  color: var(--brand, #0066cc);
  font-weight: 700;
  font-size: 11.5px;
  padding: 5px 9px;
  border-radius: var(--r-pill, 999px);
  cursor: pointer;
  white-space: nowrap;
}
.mf-msearch .mf-go {
  width: 30px;
  height: 30px;
  flex: none;
  border: 0;
  background: transparent;
  color: var(--text-2, #475569);
  display: grid;
  place-items: center;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
}
.mf-msearch .mf-go:active,
.mf-msearch .mf-near:active {
  transform: scale(0.96);
}
@media (max-width: 390px) {
  .mf-msearch { padding-left: 9px; gap: 3px; }
  .mf-msearch .mf-search-input { font-size: 12.5px; }
  .mf-msearch .mf-search-input::placeholder { font-size: 12px; }
  .mf-msearch .mf-near { padding: 5px 7px; font-size: 11px; }
  .mf-top-bar .mf-fuel-pill { padding: 0 7px; font-size: 11.5px; }
}
@media (max-width: 340px) {
  .mf-msearch .mf-near span { display: none; }
  .mf-msearch .mf-near { padding: 5px; }
}
.suggest[hidden],
.mf-suggest[hidden] {
  display: none !important;
}
.mf-suggest {
  position: absolute;
  top: calc(100% + 2px);
  left: 10px;
  right: 10px;
  max-height: min(56dvh, 380px);
  overflow-y: auto;
  background: var(--surface, #ffffff);
  border: 1px solid var(--line, #e2e8f0);
  border-radius: var(--r-lg, 14px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.2);
  z-index: 95;
  pointer-events: auto;
  padding: 0;
}
.mf-pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  height: 40px;
  padding: 0 11px;
  border-radius: 20px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
  color: var(--text, #0f172a);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  touch-action: manipulation;
  transition: all 0.15s ease;
}
.mf-pill:active {
  transform: scale(0.97);
  background: var(--bg-hover, #f1f5f9);
}
.mf-route-pill {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  gap: 6px;
}
.mf-route-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.mf-stops-badge {
  font-size: 10.5px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  background: var(--surface-3, #e2e8f0);
  color: var(--text-2, #475569);
  margin-left: 2px;
}
.mf-top-right {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}
.mf-fuel-pill {
  padding: 0 9px;
}
.mf-fuel-pill .mf-droplet {
  color: var(--brand, #0066cc);
  display: inline-flex;
}
.mf-fuel-pill .mf-chev {
  font-size: 10px;
  opacity: 0.6;
}
.mf-gps-pill {
  padding: 0 9px;
  gap: 5px;
  color: var(--brand, #0066cc);
  font-weight: 600;
}
.mf-gps-pill .mf-icon {
  display: inline-flex;
}
.mf-gps-pill.is-loading {
  color: var(--muted, #64748b);
}
@media (max-width: 380px) {
  .mf-gps-pill span:not(.mf-icon):not(.rts-spinner) {
    display: none;
  }
  .mf-gps-pill {
    padding: 0 8px;
  }
}

/* Free-roaming map area indicator */
.map-roam-badge {
  position: absolute;
  top: 14px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 30;
  background: rgba(15, 23, 42, 0.88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  padding: 6px 14px;
  border-radius: 99px;
  font: 600 12.5px/1.2 var(--sans, system-ui, sans-serif);
  display: flex;
  align-items: center;
  gap: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
  pointer-events: auto;
  cursor: pointer;
  border: 1px solid rgba(255, 255, 255, 0.15);
  transition: opacity 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}
.map-roam-badge.hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateX(-50%) translateY(-6px);
}
.map-roam-badge .mrb-price {
  color: #4ade80;
  font-weight: 700;
}
[data-theme="light"] .map-roam-badge {
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  border: 1px solid rgba(0, 0, 0, 0.1);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}
[data-theme="light"] .map-roam-badge .mrb-price {
  color: #16a34a;
}

/* Drawer menu theme selector */
.sheet-theme-box {
  margin-top: 10px;
  padding: 10px 12px;
  background: var(--surface-2);
  border-radius: 12px;
  border: 1px solid var(--line-2);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sheet-theme-title {
  font: 700 11px/1.2 var(--ui);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-3);
}
.sheet-theme-seg {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 2px;
  gap: 2px;
}
.sheet-theme-opt {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 7px 4px;
  border-radius: 6px;
  background: transparent;
  border: 0;
  color: var(--text-2);
  font: 600 12px var(--ui);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.sheet-theme-opt:hover {
  color: var(--text);
}
.sheet-theme-opt.active {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
}

/* Bottom Floating Bar & Summary */
.mf-bottom-bar {
  padding: 8px 10px env(safe-area-inset-bottom, 8px);
  pointer-events: auto;
  z-index: 22;
}
.mf-bottom-trip-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 14px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 3px 14px rgba(0, 0, 0, 0.13);
}
.mf-trip-metrics {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text, #0f172a);
  flex-wrap: nowrap;
  overflow: hidden;
}
.mf-trip-glyph {
  display: inline-flex;
  color: var(--brand, #0066cc);
}
.mf-trip-dot { color: var(--muted, #94a3b8); }
.mf-trip-time { font-weight: 700; }
.mf-trip-dist { color: var(--muted, #64748b); }
.mf-lowest-pill { font-size: 12px; }
.mf-trip-count { color: var(--muted, #64748b); font-size: 11.5px; }
.mf-nav-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 0 10px;
}
.mf-bottom-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.mf-corridor-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  font-size: 11.5px;
  font-weight: 600;
  border-radius: 10px;
  padding: 0 10px;
}

/* Compact Peek Card */
.mf-peek-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 10px 12px;
  border-radius: 15px;
  background: var(--card-bg, #ffffff);
  border: 1px solid var(--border, #e2e8f0);
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.16);
  animation: peekSlideUp 0.18s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes peekSlideUp {
  from { transform: translateY(16px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.mf-peek-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.mf-peek-brand-col {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.mf-peek-logo {
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.mf-peek-title-col {
  min-width: 0;
  flex: 1;
}
.mf-peek-name {
  font-size: 13px;
  font-weight: 700;
  color: var(--text, #0f172a);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mf-peek-dist {
  font-size: 11px;
  color: var(--muted, #64748b);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mf-peek-status-dot {
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.mf-peek-status-dot.ok { background: var(--ok, #16a34a); }
.mf-peek-status-dot.soon { background: var(--warn, #d97706); }
.mf-peek-status-dot.closed { background: var(--muted, #94a3b8); }
.mf-peek-price-col {
  text-align: right;
  flex-shrink: 0;
}
.mf-peek-price {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--text, #0f172a);
  letter-spacing: -0.02em;
  line-height: 1.1;
}
.mf-peek-fill {
  font-size: 10.5px;
  color: var(--muted, #64748b);
}
.mf-peek-close {
  background: transparent;
  border: none;
  font-size: 18px;
  line-height: 1;
  color: var(--muted, #94a3b8);
  padding: 2px 4px;
  cursor: pointer;
  touch-action: manipulation;
}
.mf-peek-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 1px;
}
.mf-peek-actions .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex: 1;
  font-size: 11.5px;
  height: 30px;
  border-radius: 8px;
  white-space: nowrap;
  padding: 0 7px;
}
.mf-peek-actions .mf-btn-cta {
  flex: 1.3;
}
.mf-peek-actions .mf-btn-icon {
  flex: 0 0 34px;
  width: 34px;
  padding: 0;
}
.mf-peek-actions .btn.is-saved {
  color: var(--warn, #d97706);
  border-color: color-mix(in srgb, var(--warn, #d97706) 45%, var(--line-2, #e2e8f0));
}

.mf-peek-route-nav {
  margin-top: 6px;
  padding-top: 8px;
  border-top: 1px solid var(--border, #e2e8f0);
}
.mf-peek-route-nav .mf-btn-full-nav {
  width: 100%;
  height: 38px;
  font-size: 13px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: 9px;
  box-shadow: 0 2px 8px rgba(0, 102, 204, 0.25);
  text-decoration: none;
}
[data-theme="dark"] .mf-peek-route-nav {
  border-top-color: rgba(255, 255, 255, 0.12);
}

/* In-fullscreen Sheets Header */
body.map-full .sheet .mf-sheet-header {
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  margin: -14px -16px 12px -16px;
  border-bottom: 1px solid var(--line-2);
}
.mf-sheet-title {
  display: flex !important;
  flex-direction: column !important;
  gap: 3px !important;
  min-width: 0;
  flex: 1;
}
.mf-sheet-heading {
  display: flex !important;
  align-items: center !important;
  gap: 8px !important;
  font-size: 16px !important;
  font-weight: 700 !important;
  color: var(--text) !important;
  line-height: 1.25 !important;
  letter-spacing: -0.2px;
}
.mf-sheet-heading > span:first-child {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.mf-sheet-count-badge {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  font-size: 11px !important;
  font-weight: 700 !important;
  padding: 1.5px 7px !important;
  border-radius: 999px !important;
  background: var(--surface-2, #f1f5f9) !important;
  color: var(--text-2, #64748b) !important;
  border: 1px solid var(--line-2, #e2e8f0) !important;
  line-height: 1.2 !important;
  flex-shrink: 0 !important;
}
[data-theme="dark"] .mf-sheet-count-badge {
  background: rgba(255, 255, 255, 0.08) !important;
  color: var(--text-2, #94a3b8) !important;
  border-color: rgba(255, 255, 255, 0.12) !important;
}
.mf-sheet-sub {
  font-size: 12px !important;
  color: var(--muted) !important;
  line-height: 1.3 !important;
  display: block !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
body.map-full .sheet .mf-sheet-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-2, #f1f5f9);
  color: var(--text-2, #64748b);
  border: 1px solid var(--line-2, #e2e8f0);
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  transition: background 0.15s ease, color 0.15s ease;
  touch-action: manipulation;
}
body.map-full .sheet .mf-sheet-close:active {
  background: var(--surface-3, #e2e8f0);
  color: var(--text);
}
[data-theme="dark"] body.map-full .sheet .mf-sheet-close {
  background: rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  border-color: rgba(255, 255, 255, 0.12);
}
[data-theme="dark"] .mf-gps-pill {
  color: #60a5fa;
}

/* Dark mode overrides for full-screen HUD */
[data-theme="dark"] .mf-pill,
[data-theme="dark"] .mf-msearch,
[data-theme="dark"] .mf-search-box,
[data-theme="dark"] .mf-suggest,
[data-theme="dark"] .mf-bottom-trip-bar,
[data-theme="dark"] .mf-peek-card {
  background: #182234;
  border-color: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.45);
}
[data-theme="dark"] .mf-msearch .mf-near {
  background: var(--brand-soft);
  color: var(--brand);
}
[data-theme="dark"] .mf-msearch .mf-search-clear {
  background: rgba(255, 255, 255, 0.1);
  color: #cbd5e1;
}
[data-theme="dark"] .mf-msearch .mf-go {
  color: #cbd5e1;
}
[data-theme="dark"] .mf-search-input,
[data-theme="dark"] .mf-peek-name,
[data-theme="dark"] .mf-peek-price {
  color: #f8fafc;
}
[data-theme="dark"] .mf-stops-badge {
  background: rgba(255, 255, 255, 0.12);
  color: #cbd5e1;
}
[data-theme="dark"] .mf-peek-dist,
[data-theme="dark"] .mf-peek-fill,
[data-theme="dark"] .mf-trip-dist,
[data-theme="dark"] .mf-trip-count {
  color: #94a3b8;
}

/* GPS Locating Animation & Loading Bar */
.msearch.is-locating,
.mf-msearch.is-locating,
.route-inp-wrap.is-locating {
  position: relative;
}
.msearch.is-locating::after,
.mf-msearch.is-locating::after,
.route-inp-wrap.is-locating::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2.5px;
  background: linear-gradient(90deg, transparent 0%, var(--brand, #0066cc) 50%, transparent 100%);
  background-size: 200% 100%;
  border-radius: 0 0 8px 8px;
  animation: gpsShimmer 1.2s infinite linear;
  z-index: 10;
}
@keyframes gpsShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

[data-locate].is-loading svg {
  animation: rtsSpin 0.8s linear infinite;
  color: var(--brand, #0066cc);
}
.route-near-btn.is-loading,
.mnear.is-loading,
.mf-gps-pill.is-loading {
  opacity: 0.85;
  pointer-events: none;
}
/* only hide the feed/dock when the mobile map is the one going full screen —
   on desktop the map lives in the right pane and the list must stay put */
@media (max-width: 1023px) {
  body.map-full .left-scroll, body.map-full .dock, body.map-full .mapgrip { display: none !important; }
  /* Pure native app touch experience: hide browser scrollbar rails on mobile */
  html, body, .stage, .pane-left, .left-scroll, #feed, .combo .sugbox,
  .drawer-body, .drawer, .route-stops-container, .pillrow, .brandchips,
  .mapMobile, #mapMobile, .route-planner-card, .suggest, .stations {
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
  }
  html::-webkit-scrollbar, body::-webkit-scrollbar, .stage::-webkit-scrollbar,
  .pane-left::-webkit-scrollbar, .left-scroll::-webkit-scrollbar, #feed::-webkit-scrollbar,
  .combo .sugbox::-webkit-scrollbar, .drawer-body::-webkit-scrollbar,
  .drawer::-webkit-scrollbar, .route-stops-container::-webkit-scrollbar,
  .pillrow::-webkit-scrollbar, .brandchips::-webkit-scrollbar,
  .mapMobile::-webkit-scrollbar, #mapMobile::-webkit-scrollbar,
  .route-planner-card::-webkit-scrollbar, .suggest::-webkit-scrollbar,
  .stations::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }
}
.tiny-logo { width: 26px; height: 26px; }

/* ------------------- Modern Route Stops & Detour Layout ------------------- */
.route-planner-card {
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.03);
}
.route-inputs-body {
  position: relative;
  display: block;
  width: 100%;
}
.route-stops-container {
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}
.route-swap-side-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 28px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  border: 1.5px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  cursor: pointer;
  flex-shrink: 0;
  font-size: 11px;
  font-weight: 700;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  transition: all 0.18s ease;
}
.route-swap-side-btn.route-inp-icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
}
.route-swap-side-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 25%, transparent);
}
.route-swap-side-btn.route-inp-icon-btn:hover {
  transform: translateY(-50%) scale(1.03);
}
.route-swap-side-btn:active {
  transform: translateY(-50%) scale(0.95);
}
[data-theme="dark"] .route-swap-side-btn {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.14);
  color: var(--text-2);
}
[data-theme="dark"] .route-swap-side-btn:hover {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: #38bdf8;
}
.route-point-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  position: relative;
  transition: transform 0.15s ease, opacity 0.15s ease, background 0.15s ease;
}
.route-icon-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 28px;
  padding-top: 8px;
  flex-shrink: 0;
  position: relative;
}
.route-dot {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font: 800 11.5px/1 var(--sans);
  flex-shrink: 0;
  z-index: 2;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
/* Origin: Soft Brand-blue ice tint with deep Brand Blue start ring */
.route-dot.start {
  background: var(--brand-soft);
  border: 1.5px solid color-mix(in srgb, var(--brand) 32%, transparent);
  color: var(--brand);
}
/* Fuel Stop: Solid Brand Blue circle with white Fuel pump icon */
.route-dot.stop.fuel,
.route-dot.stop:not(.waypoint):not(.adding) {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  border: 1.5px solid transparent;
  color: #fff;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 30%, transparent);
  cursor: grab;
  cursor: -webkit-grab;
}
.route-dot.stop.fuel:hover,
.route-dot.stop:not(.waypoint):not(.adding):hover {
  transform: scale(1.08);
  box-shadow: 0 3px 10px color-mix(in srgb, var(--brand) 45%, transparent);
}
/* Waypoint / Town Stop: Subtle slate surface with brand ring */
.route-dot.stop.waypoint {
  background: var(--surface-2);
  border: 1.5px solid var(--line-2);
  color: var(--text-2);
  cursor: grab;
  cursor: -webkit-grab;
}
.route-dot.stop.waypoint:hover {
  border-color: var(--brand);
  color: var(--brand);
  transform: scale(1.08);
}
/* Empty / Adding stop */
.route-dot.stop.adding {
  background: var(--surface-2);
  border: 1.5px dashed var(--line-2);
  color: var(--muted);
}
/* Destination: Soft slate surface with deep slate/navy pin icon */
.route-dot.dest {
  background: var(--surface-2);
  border: 1.5px solid var(--line-2);
  color: var(--text-2);
}
.route-line-track {
  width: 2.5px;
  flex: 1;
  min-height: 16px;
  background: color-mix(in srgb, var(--line-2) 75%, var(--brand));
  border-radius: 99px;
  margin-top: 4px;
  margin-bottom: -4px;
  z-index: 1;
}
.route-input-col {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.route-input-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  min-height: 20px;
}
.route-stop-tag {
  font-size: 10.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--brand);
}
.route-stop-tag.start {
  color: var(--good);
}
.route-stop-tag.dest {
  color: var(--text-2);
}
.route-stop-ctrls {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
.route-move-btn {
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  border-radius: 6px;
  width: 22px;
  height: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 8.5px;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: all 0.15s ease;
}
.route-move-btn:hover {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand);
}
.route-remove-btn {
  background: transparent;
  border: 1px solid transparent;
  font-size: 11px;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 7px;
  border-radius: 99px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  transition: all 0.15s ease;
}
.route-remove-btn:hover {
  background: var(--warn-soft);
  color: var(--warn);
  border-color: color-mix(in srgb, var(--warn) 30%, transparent);
  text-decoration: none;
}
.route-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  padding: 3px;
  border-radius: 6px;
  user-select: none;
  touch-action: none;
  transition: all 0.15s ease;
}
.route-drag-handle:hover {
  background: var(--surface-2);
  color: var(--text);
}
.route-drag-handle:active {
  cursor: grabbing;
  background: var(--brand-soft);
  color: var(--brand);
}
.route-inp {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--surface-2);
  color: var(--text);
  font: 600 14px/1.4 var(--sans);
  transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
}
.route-inp:focus {
  outline: none;
  border-color: var(--brand);
  background: var(--surface);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 18%, transparent);
}
.route-point-row.stop-row {
  border-radius: 14px;
  padding: 4px 6px;
  margin: -4px -6px;
}
.route-point-row.stop-row.is-dragging {
  opacity: 0.35;
  background: var(--surface-2);
  transform: scale(0.98);
}
.route-point-row.stop-row.drag-over {
  border-top: 2px solid var(--brand);
  box-shadow: 0 -3px 8px color-mix(in srgb, var(--brand) 20%, transparent);
}
.route-point-row.stop-row.just-added {
  animation: stopRowPulse 1.4s ease-out;
}
@keyframes stopRowPulse {
  0% { background: color-mix(in srgb, var(--brand) 22%, var(--surface)); transform: scale(1.02); }
  100% { background: transparent; transform: scale(1); }
}
.route-actions-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: var(--s2);
  padding-top: var(--s2);
  border-top: 1px solid var(--line);
  gap: 10px;
  flex-wrap: nowrap !important;
  width: 100%;
  box-sizing: border-box;
}
.route-actions-left {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
}
.route-actions-center {
  display: flex;
  gap: 8px;
  align-items: center;
  position: relative;
  flex: 0 0 auto;
  margin-left: 2px;
}
.route-actions-right {
  display: flex;
  gap: 8px;
  align-items: center;
  flex: 0 0 auto;
  margin-left: auto;
}

/* Route Options Dropdown Menu & Popover */
.route-opts-menu-wrap {
  position: relative;
  display: inline-block;
}
.route-opts-menu-wrap summary {
  list-style: none;
}
.route-opts-menu-wrap summary::-webkit-details-marker {
  display: none;
}
.route-opts-trigger .rop-chevron {
  font-size: 10px;
  margin-left: 2px;
  transition: transform .15s ease;
}
.route-opts-menu-wrap[open] .route-opts-trigger .rop-chevron {
  transform: rotate(180deg);
}
.rop-active-badge {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand);
  display: inline-block;
  margin-left: 4px;
}
.route-opts-popover {
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  width: min(320px, calc(100vw - 32px));
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
  padding: 16px;
  z-index: 100;
  animation: ropFadeIn .15s ease-out;
  box-sizing: border-box;
}
@keyframes ropFadeIn {
  from { opacity: 0; transform: translate(-50%, -6px); }
  to { opacity: 1; transform: translate(-50%, 0); }
}
.rop-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.rop-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.rop-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--surface-2);
  border: none;
  font-size: 16px;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  line-height: 1;
  transition: all .15s ease;
}
.rop-close:hover {
  background: var(--surface-3);
  color: var(--text);
}
.rop-body {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin-bottom: 16px;
}
.rop-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.rop-row:last-child {
  border-bottom: none;
}
.rop-icon-box {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--text);
}
.rop-info {
  flex: 1;
  min-width: 0;
}
.rop-info b {
  display: block;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.25;
}
.rop-info span {
  display: block;
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
  margin-top: 2px;
}
/* iOS/Android style toggle switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  cursor: pointer;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--line-2);
  transition: .2s ease;
  border-radius: 26px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px;
  width: 20px;
  left: 3px;
  bottom: 3px;
  background-color: #fff;
  transition: .2s ease;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
}
.toggle-switch input:checked + .toggle-slider {
  background-color: var(--brand);
}
.toggle-switch input:checked + .toggle-slider:before {
  transform: translateX(18px);
}
/* If Avoid motorways is checked, hide Motorway services row immediately */
.route-opts-popover:has(input[data-act="route-avoid-motorway"]:checked) .rop-msa-row {
  display: none !important;
}
.rop-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  gap: 12px;
}
.rop-cancel-btn {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  padding: 8px 12px;
  text-decoration: none !important;
  background: transparent;
  border: none;
}
.rop-cancel-btn:hover {
  color: var(--text);
}
.rop-apply-btn {
  flex: 1;
  justify-content: center;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-pill);
}
[data-theme="dark"] .route-opts-popover {
  background: #0f172a;
  border-color: rgba(56, 189, 248, 0.25);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.55);
}
.route-actions-strip .chip-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 6px 10px;
  font-size: 11.5px;
  font-weight: 600;
  text-decoration: none !important;
  cursor: pointer;
  transition: all .15s ease;
  line-height: 1.2;
  white-space: nowrap;
  box-sizing: border-box;
}
.route-inp-wrap {
  position: relative;
  width: 100%;
}
.route-inp-wrap .route-inp {
  width: 100%;
  box-sizing: border-box;
  padding-right: 68px;
  height: 42px;
  border-radius: var(--r-md);
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text);
  font-size: 14px;
}
.route-near-btn.route-inp-icon-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  height: 28px;
  padding: 0 9px;
  border-radius: var(--r-pill);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  color: var(--brand);
  cursor: pointer;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1;
  transition: all .15s ease;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
.route-near-btn.route-inp-icon-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  transform: translateY(-50%) scale(1.03);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 30%, transparent);
}
.route-near-btn.route-inp-icon-btn .rnb-icon {
  display: flex;
  align-items: center;
}
.route-near-btn.route-inp-icon-btn svg {
  display: block;
}
[data-theme="dark"] .route-near-btn.route-inp-icon-btn {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 35%, transparent);
}
[data-theme="dark"] .route-near-btn.route-inp-icon-btn:hover {
  background: var(--brand);
  color: var(--brand-ink);
  border-color: var(--brand);
}

.route-inp-wrap.has-move .route-inp {
  padding-right: 56px;
}

.route-stop-inline-actions {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.route-stop-inline-actions .route-remove-btn.route-inp-icon-btn {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all .15s ease;
}
.route-stop-inline-actions .route-remove-btn.route-inp-icon-btn:hover {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  transform: scale(1.08);
}
}
.route-stop-inline-actions .route-drag-handle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  width: 20px;
  height: 24px;
  border-radius: 4px;
  user-select: none;
  touch-action: none;
  transition: all 0.15s ease;
}
.route-stop-inline-actions .route-drag-handle:hover {
  background: var(--surface-2);
  color: var(--brand);
}
.route-stop-inline-actions .route-drag-handle:active {
  cursor: grabbing;
  background: var(--brand-soft);
  color: var(--brand);
}
.route-stop-inline-actions .route-move-btn {
  display: none !important;
}

/* Rich Minimalist Fuel Stop Card in Route Planner */
.route-stop-card {
  box-sizing: border-box;
  width: 100%;
  background: var(--surface-2);
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 6px 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  transition: all 0.18s ease;
}
.route-stop-card:hover {
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-2));
  background: color-mix(in srgb, var(--brand) 2%, var(--surface-2));
}
.rsc-top {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
}
.rsc-drag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  cursor: grab;
  width: 18px;
  height: 20px;
  flex-shrink: 0;
  user-select: none;
  touch-action: none;
  border-radius: 4px;
  transition: color 0.15s ease;
}
.rsc-drag:hover {
  color: var(--brand);
}
.rsc-drag:active {
  cursor: grabbing;
}
.rsc-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.rsc-name:hover {
  color: var(--brand);
}
.rsc-price {
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  flex-shrink: 0;
}
.rsc-remove {
  background: var(--surface);
  border: 1px solid var(--line-2);
  color: var(--text-2);
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  padding: 0;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  transition: all 0.15s ease;
}
.rsc-remove:hover {
  background: var(--bad-soft);
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 35%, transparent);
  transform: scale(1.08);
}
.route-stop-card.rsc-single {
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 10px;
}
.route-stop-card.rsc-single .rsc-name {
  flex: 1;
  min-width: 0;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
}
.rsc-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding-left: 26px;
  width: 100%;
  box-sizing: border-box;
}
.rsc-sub {
  font-size: 11.5px;
  font-weight: 500;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.rsc-detour-pill {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  background: color-mix(in srgb, var(--brand) 12%, transparent);
  color: var(--brand);
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  line-height: 1.3;
}
.rsc-detour-pill.direct {
  background: color-mix(in srgb, var(--good) 12%, transparent);
  color: var(--good);
  border-color: color-mix(in srgb, var(--good) 25%, transparent);
}
.rsc-detour-pill.via {
  background: var(--surface);
  color: var(--muted);
  border-color: var(--line-2);
}

[data-theme="dark"] .route-stop-card {
  background: rgba(30, 41, 59, 0.65);
  border-color: rgba(255, 255, 255, 0.1);
}
[data-theme="dark"] .route-stop-card:hover {
  background: rgba(30, 41, 59, 0.9);
  border-color: rgba(56, 189, 248, 0.35);
}
[data-theme="dark"] .rsc-detour-pill {
  background: rgba(56, 189, 248, 0.15);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .rsc-detour-pill.direct {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border-color: rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .route-dot.start {
  background: rgba(0, 70, 171, 0.2);
  border-color: rgba(56, 189, 248, 0.35);
  color: #38bdf8;
}
[data-theme="dark"] .route-dot.stop.waypoint,
[data-theme="dark"] .route-dot.dest {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.15);
  color: var(--text-2);
}
[data-theme="dark"] .rsc-remove,
[data-theme="dark"] .route-stop-inline-actions .route-remove-btn.route-inp-icon-btn {
  background: var(--surface-2);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--text-2);
}
[data-theme="dark"] .rsc-remove:hover,
[data-theme="dark"] .route-stop-inline-actions .route-remove-btn.route-inp-icon-btn:hover {
  background: rgba(239, 68, 68, 0.2);
  color: #f87171;
  border-color: rgba(239, 68, 68, 0.4);
}
@media (max-width: 480px) {
  .route-near-btn span,
  .route-swap-side-btn span { display: none; }
}

/* Alternative Routes Selector (Google Maps style) */
.route-alt-selector {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(96px, 1fr));
  gap: 6px;
  width: 100%;
  box-sizing: border-box;
  margin: 12px 0 0;
}
.route-alt-pill {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 7px 8px;
  background: var(--surface-1, #ffffff);
  border: 1.5px solid var(--line-2, #e2e8f0);
  border-radius: var(--r-md, 10px);
  cursor: pointer;
  text-align: left;
  transition: all 0.16s ease;
  font-family: inherit;
  color: var(--text);
  box-sizing: border-box;
}
.route-alt-pill:hover {
  border-color: color-mix(in srgb, var(--brand) 60%, var(--line-2));
}
.route-alt-pill.active {
  border-color: var(--brand, #0046AB);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface-1, #ffffff));
  box-shadow: 0 1px 4px rgba(0, 70, 171, 0.12);
}
.rap-road {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--text);
  width: 100%;
  min-width: 0;
  line-height: 1.25;
}
.rap-sub {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  width: 100%;
  min-width: 0;
  font-size: 11px;
  color: var(--muted, #64748b);
  font-weight: 500;
  line-height: 1.25;
  margin-top: 2px;
}
.rap-miles {
  white-space: nowrap;
  font-size: 11px;
  color: var(--muted, #64748b);
  font-weight: 500;
  min-width: 0;
  flex-shrink: 0;
}
.rap-badge {
  font-size: 9.5px;
  font-weight: 700;
  padding: 1.5px 5px;
  border-radius: 5px;
  background: var(--surface-2, #f1f5f9);
  color: var(--muted, #64748b);
  flex-shrink: 0;
  white-space: nowrap;
  line-height: 1.2;
}
.rap-badge.fastest {
  background: #DCFCE7;
  color: #15803D;
}
[data-theme="dark"] .route-alt-pill {
  background: var(--surface-1, #1e293b);
  border-color: var(--line-2, #334155);
}
[data-theme="dark"] .route-alt-pill.active {
  background: rgba(56, 189, 248, 0.12);
  border-color: #38bdf8;
}
[data-theme="dark"] .rap-badge {
  background: rgba(255, 255, 255, 0.08);
  color: var(--muted, #94a3b8);
}
[data-theme="dark"] .rap-badge.fastest {
  background: rgba(34, 197, 94, 0.2);
  color: #4ade80;
}

/* Scannable Route Trip Summary Bar */
.route-trip-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 4px;
  padding: 8px 10px;
  margin: 12px 0 0;
  background: color-mix(in srgb, var(--brand) 6%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--brand) 20%, var(--line-2));
  border-radius: var(--r-md);
  color: var(--text);
  overflow: hidden;
}
.route-trip-summary .rts-metric {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
}
.route-trip-summary .rts-icon {
  display: inline-flex;
  align-items: center;
  color: var(--text-2);
  flex-shrink: 0;
}
.route-trip-summary .rts-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.15;
}
.route-trip-summary .rts-val {
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-trip-summary .rts-sub {
  font-size: 10px;
  color: var(--muted);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.route-trip-summary .rts-sep {
  color: var(--line-2);
  user-select: none;
  font-weight: 300;
  font-size: 14px;
  flex-shrink: 0;
  opacity: 0.7;
}
.route-trip-summary .rts-loading {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.route-trip-summary .rts-spinner {
  width: 12px;
  height: 12px;
  border: 2px solid color-mix(in srgb, var(--brand) 30%, transparent);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: rtsSpin 0.7s linear infinite;
}
@keyframes rtsSpin {
  to { transform: rotate(360deg); }
}
[data-theme="dark"] .route-trip-summary {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.22);
}
@media (max-width: 480px) {
  .route-trip-summary {
    padding: 7px 6px;
    gap: 2px;
  }
  .route-trip-summary .rts-metric {
    gap: 4px;
  }
  .route-trip-summary .rts-val {
    font-size: 11px;
  }
  .route-trip-summary .rts-sub {
    font-size: 9.5px;
  }
}

/* Route Welcome & Guide Card (matching Image 2) */
.route-welcome-section {
  margin-top: var(--s3);
}
.route-welcome-box {
  padding: 30px 22px 22px;
  text-align: center;
  background: var(--surface);
  border: 1.5px dashed color-mix(in srgb, var(--brand) 32%, var(--line));
  border-radius: var(--r-xl);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}
.rwb-icon {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  margin-bottom: 14px;
}
.rwb-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin: 0 0 7px;
  letter-spacing: -0.02em;
  line-height: 1.3;
}
.rwb-desc {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-2);
  max-width: 380px;
  margin: 0 auto 18px;
}
.rwb-graphic {
  width: 100%;
  max-width: 440px;
  height: auto;
  display: block;
  margin: 0 auto;
}
.rwb-disclaimer {
  font-size: 11.5px;
  font-style: italic;
  color: var(--muted);
  margin-top: 14px;
  text-align: center;
}
[data-theme="dark"] .route-welcome-box {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(56, 189, 248, 0.28);
}
[data-theme="dark"] .rwb-icon {
  background: rgba(56, 189, 248, 0.16);
  color: #38bdf8;
}

/* Split section header with route sort pills */
.section-head-split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 18px 0 10px;
}
.section-head-split h2 {
  font-size: 11.5px;
  font-family: var(--font-ui);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin: 0;
  white-space: nowrap;
}
.route-sort-pills {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 2px;
  flex-shrink: 0;
}
.route-sort-btn {
  background: transparent;
  border: none;
  border-radius: var(--r-pill);
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  font-family: var(--font-ui);
  color: var(--text-2);
  cursor: pointer;
  white-space: nowrap;
  transition: all .15s ease;
}
.route-sort-btn:hover {
  color: var(--text);
}
.route-sort-btn.on {
  background: var(--surface);
  color: var(--brand);
  font-weight: 700;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}
[data-theme="dark"] .route-sort-btn.on {
  background: var(--surface);
  color: #38bdf8;
}

/* Trip progress badge on station card */
.tag.dist-tag.trip-prog {
  background: color-mix(in srgb, var(--brand) 10%, transparent);
  color: var(--brand);
  border: 1px solid color-mix(in srgb, var(--brand) 25%, transparent);
  font-weight: 700;
}
[data-theme="dark"] .tag.dist-tag.trip-prog {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}

/* Structured 2-column Route Card Meta Box */
.route-card-meta-box {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  background: var(--surface-2);
  margin-top: 10px;
  overflow: hidden;
}
.rcm-col {
  display: flex;
  flex-direction: column;
}
.rcm-col.rcm-left {
  border-right: 1px solid var(--line-2);
}
.rcm-cell {
  padding: 7px 11px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.rcm-cell:first-child {
  border-bottom: 1px solid var(--line-2);
}
.rcm-lbl {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}
.rcm-val {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.rcm-col.is-open .rcm-status-text {
  color: var(--good);
  font-weight: 700;
}
.rcm-col.is-closed .rcm-status-text {
  color: var(--warn);
  font-weight: 700;
}
[data-theme="dark"] .route-card-meta-box {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.09);
}
[data-theme="dark"] .rcm-col.rcm-left,
[data-theme="dark"] .rcm-cell:first-child {
  border-color: rgba(255, 255, 255, 0.09);
}

/* Motorway pump-price comparison card */
.slip-saver-card {
  background: color-mix(in srgb, var(--good) 6%, var(--surface)) !important;
  border: 1.5px solid color-mix(in srgb, var(--good) 30%, var(--line-2)) !important;
  border-radius: var(--r-md);
  padding: 14px;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ssc-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.ssc-hero {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.ssc-titles {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.ssc-name {
  font-size: 14px;
  font-weight: 800;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ssc-meta {
  font-size: 11.5px;
  color: var(--text-2);
  margin-top: 2px;
}
.ssc-price .ssc-val {
  font-size: 18px;
  font-weight: 800;
  color: var(--good);
}
.ssc-comparison {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 8px 10px;
  background: var(--surface);
  border-radius: var(--r-sm);
  border: 1px dashed color-mix(in srgb, var(--good) 35%, var(--line-2));
  font-size: 12px;
}
.ssc-badge-save {
  font-weight: 800;
  color: var(--good);
}
.ssc-bypass-text {
  color: var(--text-2);
}
.ssc-bypass-text s {
  color: var(--warn);
  font-weight: 700;
}
.ssc-actions {
  display: flex;
  gap: 8px;
  margin-top: 2px;
}
[data-theme="dark"] .slip-saver-card {
  background: rgba(16, 185, 129, 0.08) !important;
  border-color: rgba(16, 185, 129, 0.25) !important;
}
[data-theme="dark"] .ssc-price .ssc-val {
  color: #34d399;
}
[data-theme="dark"] .ssc-badge-save {
  color: #34d399;
}
.route-actions-strip .chip-action.route-reset-btn {
  color: var(--text-2);
  border-color: var(--line-2);
  background: var(--surface-2);
  font-weight: 600;
}
.route-actions-strip .chip-action.route-reset-btn:hover {
  color: var(--bad);
  border-color: var(--bad);
  background: var(--bad-soft);
}
.route-actions-strip .chip-action:hover {
  background: var(--surface-3); border-color: var(--brand); text-decoration: none !important;
}
.route-actions-strip .chip-action:active { transform: scale(0.96); }
.route-actions-strip .chip-action.add-stop {
  background: var(--brand-soft); color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line)); font-weight: 700;
}
.route-actions-strip .chip-action.add-stop:hover {
  background: color-mix(in srgb, var(--brand-soft) 80%, var(--brand)); color: var(--brand);
}
.route-actions-strip .chip-action.route-gmaps-btn {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: color-mix(in srgb, var(--brand) 30%, var(--line));
  font-weight: 700;
  text-decoration: none;
}
.route-actions-strip .chip-action.route-gmaps-btn:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
[data-theme="dark"] .route-actions-strip .chip-action.route-gmaps-btn {
  background: rgba(56, 189, 248, 0.12);
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .route-actions-strip .chip-action.route-gmaps-btn:hover {
  background: #0284c7;
  color: #fff;
}
.route-actions-strip .chip-action svg { flex-shrink: 0; }
/* Collapsible Detour Buffer & Preferences */
.route-opts-details {
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
}
.route-opts-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-md);
  cursor: pointer;
  font-size: 13px;
  user-select: none;
  transition: all 0.15s ease;
  list-style: none;
}
.route-opts-summary::-webkit-details-marker {
  display: none;
}
.route-opts-summary:hover {
  background: color-mix(in srgb, var(--brand) 6%, var(--surface-2));
  border-color: color-mix(in srgb, var(--brand) 25%, var(--line-2));
}
.route-opts-sum-left {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-weight: 600;
  color: var(--text);
}
.route-opts-sum-icon {
  display: inline-flex;
  color: var(--brand);
}
.route-opts-sum-title {
  font-size: 12.5px;
  font-weight: 600;
}
.route-opts-sum-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.route-opts-sum-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 2px 8px;
  color: var(--brand);
}
.route-opts-sum-chevron {
  font-size: 11px;
  color: var(--muted);
  transition: transform 0.2s ease;
}
.route-opts-details[open] .route-opts-summary {
  border-radius: var(--r-md) var(--r-md) 0 0;
  border-bottom-color: transparent;
}
.route-opts-details[open] .route-opts-sum-chevron {
  transform: rotate(180deg);
}
.route-opts-dropdown {
  margin-top: 0;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-top: 1px dashed var(--line-2);
  border-radius: 0 0 var(--r-md) var(--r-md);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
[data-theme="dark"] .route-opts-sum-badge {
  color: #38bdf8;
  border-color: rgba(56, 189, 248, 0.3);
}
[data-theme="dark"] .route-opts-sum-icon {
  color: #38bdf8;
}
.buf-section-compact {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.buf-row-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  flex-wrap: nowrap;
}
.buf-inline-label {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
  white-space: nowrap;
}
.buf-segmented {
  display: flex;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.buf-seg-btn {
  flex: 1;
  min-width: 0;
  padding: 5px 6px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 6px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  transition: all .15s ease;
}
.buf-seg-btn:hover { border-color: var(--brand); }
.buf-seg-btn.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.buf-save-btn {
  padding: 5px 12px !important;
  height: 29px !important;
  font-size: 11.5px !important;
  font-weight: 700 !important;
  border-radius: 6px !important;
  line-height: 1 !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
  cursor: pointer !important;
}

.buf-custom-box.buf-custom-inline,
.buf-custom-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-sizing: border-box;
}
.buf-custom-box.buf-custom-inline[hidden],
.buf-custom-box.buf-custom-inline[style*="display:none"],
.buf-custom-box.buf-custom-inline[style*="display: none"] {
  display: none !important;
}
.buf-custom-lbl {
  font-size: 11.5px !important;
  color: var(--muted) !important;
  font-weight: 600 !important;
  margin: 0 !important;
}
.buf-custom-input-wrap {
  display: flex !important;
  align-items: center !important;
  gap: 6px !important;
}
.buf-custom-inline .buf-custom-inp {
  width: 64px !important;
  height: 28px !important;
  padding: 2px 6px !important;
  border: 1px solid var(--line-2) !important;
  border-radius: 4px !important;
  font-weight: 700 !important;
  font-size: 13px !important;
  color: var(--text) !important;
  background: var(--bg) !important;
  text-align: center !important;
  box-sizing: border-box !important;
}
.buf-custom-inline .buf-custom-inp:focus {
  border-color: var(--brand) !important;
  outline: none !important;
}
.buf-custom-inline .buf-custom-unit {
  font-size: 11.5px !important;
  color: var(--text-2) !important;
  font-weight: 600 !important;
}

/* Compact inline route option chips */
.route-toggles-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding-top: 6px;
  border-top: 1px dashed var(--line-2);
}
.route-opt-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  user-select: none;
  background: var(--surface);
  border: 1px solid var(--line-2);
  padding: 4px 8px;
  border-radius: var(--r-pill);
  transition: all .15s ease;
  line-height: 1.2;
}
.route-opt-chip:hover {
  border-color: var(--brand);
}
.route-opt-chip:has(input:checked) {
  background: var(--brand-soft);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line-2));
  color: var(--brand);
}
.route-opt-chip input[type="checkbox"] {
  width: 13px;
  height: 13px;
  margin: 0;
  cursor: pointer;
  accent-color: var(--brand);
}
[data-theme="dark"] .route-opt-chip {
  background: var(--surface);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
}
[data-theme="dark"] .route-opt-chip:has(input:checked) {
  background: rgba(56, 189, 248, 0.15);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}

@media (max-width: 390px) {
  .buf-seg-btn {
    padding: 5px 4px;
    font-size: 11px;
  }
  .buf-save-btn {
    padding: 5px 10px !important;
    font-size: 11px !important;
  }
}

/* Google Maps Navigation Export Bar */
.route-nav-export-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 10px;
  padding: 9px 11px;
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  border: 1.5px solid color-mix(in srgb, var(--brand) 28%, var(--line-2));
  border-radius: var(--r-md);
  box-shadow: 0 2px 8px color-mix(in srgb, var(--brand) 8%, transparent);
}
.rne-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}
.rne-glyph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 35%, transparent);
}
.rne-glyph svg {
  color: #fff;
  display: block;
}
.rne-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  line-height: 1.25;
}
.rne-text b {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.rne-text span {
  font-size: 11px;
  color: var(--text-2);
  margin-top: 2px;
  line-height: 1.25;
}
.route-trip-summary.rts-time-updated {
  animation: timePulse 1.4s ease-out;
}
@keyframes timePulse {
  0% { transform: scale(1.02); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
  100% { transform: scale(1); box-shadow: none; }
}
.rne-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--brand);
  color: #fff !important;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 12px;
  border-radius: var(--r-pill);
  text-decoration: none !important;
  white-space: nowrap;
  flex-shrink: 0;
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 30%, transparent);
  transition: all .15s ease;
}
.rne-btn:hover {
  background: var(--brand-2, #003685);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--brand) 40%, transparent);
}
.rne-btn:active {
  transform: translateY(0);
}
[data-theme="dark"] .route-nav-export-bar {
  background: rgba(56, 189, 248, 0.08);
  border-color: rgba(56, 189, 248, 0.25);
}
[data-theme="dark"] .rne-glyph {
  background: #0284c7;
}
[data-theme="dark"] .rne-btn {
  background: #0284c7;
  color: #fff !important;
}
[data-theme="dark"] .rne-btn:hover {
  background: #38bdf8;
  color: #0c1a2e !important;
}
@media (max-width: 480px) {
  .route-nav-export-bar {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .rne-btn {
    justify-content: center;
    width: 100%;
    padding: 9px;
  }
}


/* ------------------------------ Buttons ------------------------------- */
.btn {
  border: 1px solid var(--line-2); background: var(--surface); border-radius: var(--r-pill);
  padding: 9px 15px; font-size: 13px; font-weight: 600; color: var(--text);
  display: inline-flex; align-items: center; justify-content: center; text-align: center; gap: 7px; transition: all .12s;
}
.btn:hover { border-color: var(--muted); background: var(--surface-2); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); justify-content: center; }
.btn.primary:hover { background: var(--brand-2); border-color: var(--brand-2); }
.btn.green { background: var(--good); border-color: var(--good); color: var(--brand-ink); }
.btn.ghost { background: none; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { padding: 6px 11px; font-size: 12px; }
.btnrow { display: flex; gap: var(--s2); flex-wrap: wrap; }

.input, .select {
  width: 100%; background: var(--surface-2); border: 1px solid var(--line-2);
  border-radius: var(--r-md); padding: 11px 13px; outline: none; color: var(--text);
}
.input:focus, .select:focus { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-soft); }
.field { margin-bottom: var(--s3); }
.field label { display: block; font-size: 12px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.notice {
  font-size: 12.5px; color: var(--text-2); background: var(--surface-2);
  border: 1px dashed var(--line-2); border-radius: var(--r-md); padding: var(--s3);
}
.emptystate { text-align: center; padding: var(--s6); color: var(--muted); }

/* ------------------------------- Toast -------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(var(--dock-h) + 18px); transform: translate(-50%, 20px);
  z-index: 70; max-width: 90vw; background: var(--text); color: var(--bg);
  border-radius: var(--r-pill); padding: 11px 18px; font-size: 13px; font-weight: 600;
  box-shadow: var(--shadow-2); opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ------------------------------- Table -------------------------------- */
.tablecard { padding: 0; overflow: hidden; }
.rank-table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 13px; }
.rank-table th {
  font-size: 10.5px; text-transform: uppercase; letter-spacing: .09em; font-weight: 700;
  color: var(--muted); text-align: left; padding: 11px 14px; border-bottom: 1px solid var(--line);
  background: var(--surface-2);
}
.rank-table th.num, .rank-table td.num { text-align: right; white-space: nowrap; }
.rank-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.rank-table td.num { display: table-cell; }
.rank-table td.num .tprice { display: block; font-size: 14px; font-weight: 700; }
.rank-table td.num .badge { margin-top: 4px; font-size: 10.5px; }
.tiny-logo { width: 26px; height: 26px; }
.rank-table tr:last-child td { border-bottom: 0; }
.rank-table tbody tr:hover { background: var(--surface-2); }
.rank-table .rank { width: 44px; }
.rank-table th.num, .rank-table td.num { width: 112px; }
.rank-table td { overflow: hidden; }
.rnum {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 7px;
  background: var(--surface-3); color: var(--text-2); font-family: var(--font-mono);
  font-size: 11.5px; font-weight: 700;
}
.rnum.top { background: var(--good-soft); color: var(--good); }
.stname { display: flex; align-items: center; gap: 10px; min-width: 0; }
.tiny-logo {
  width: 28px; height: 28px; border-radius: 8px; flex: none; display: grid; place-items: center;
  background: #fff; border: 1px solid var(--line); overflow: hidden;
}
.tiny-logo img { width: 20px; height: 20px; object-fit: contain; }
.tiny-logo .mono-mark { font-size: 10px; }
.stxt { min-width: 0; }
.stxt b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 13.5px; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stxt span { font-size: 11.5px; color: var(--muted); }
.townchips { display: flex; flex-wrap: wrap; gap: 6px; }
.townchip {
  font-size: 12px; font-weight: 600; padding: 6px 11px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); color: var(--text-2);
}
.townchip:hover { border-color: var(--muted); color: var(--text); }
.townchip.on { background: var(--text); border-color: var(--text); color: var(--bg); }

/* --------------------------- Desktop layout --------------------------- */
@media (min-width: 1024px) {
  .stage { display: grid; grid-template-columns: var(--pane-w) 1fr; height: calc(100vh - var(--topbar-h)); min-height: 0; overflow: hidden; }
  .pane-left { display: flex; flex-direction: column; border-right: 1px solid var(--line); height: 100%; min-height: 0; background: var(--bg); }
  .left-scroll { flex: 1; min-height: 0; overflow-y: auto; padding-bottom: var(--s5); }
  .dock { position: static; box-shadow: none; border-radius: 0; border-top: 1px solid var(--line); backdrop-filter: none; background: var(--surface); }
  .pane-right { display: block; position: relative; overflow: hidden; min-height: 0; height: 100%; }
  .mapstrip-wrap, #mapMobile { display: none; }
  .ticker { display: flex; }
  .drawer, .sheet { left: auto; right: 0; width: 430px; top: 0; bottom: 0; max-height: none; border-radius: var(--r-xl) 0 0 var(--r-xl); transform: translateX(102%); }
  .drawer.open, .sheet.open { transform: translateX(0); }
}

/* ---------------------- Accessibility & touch ---------------------- */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skiplink {
  position: absolute; left: -9999px; top: 0; z-index: 200;
  background: var(--surface); color: var(--text); padding: 10px 14px;
  border: 1px solid var(--line-2); border-radius: 0 0 var(--r-md) 0;
  font-weight: 700; text-decoration: none; box-shadow: var(--shadow-2);
}
.skiplink:focus { left: 0; }

:where(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid color-mix(in srgb, var(--brand) 55%, transparent);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .iconbtn { min-width: 44px; min-height: 44px; }
  .mapctl .round { min-width: 40px; min-height: 40px; }
  .pill { min-height: 40px; }
}

.affiliate .cta[disabled] { opacity: .55; cursor: default; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------- Data status, legend, updates ---------------------- */
.mapkey {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px;
  color: var(--text-2); font-size: 12.5px;
}
.mapkey-item { display: inline-flex; align-items: center; gap: 8px; }
.mapkey-sample {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 7px; border-radius: 6px;
  font-family: var(--font-mono); font-size: 11px; font-weight: 700; line-height: 1;
  background: var(--surface); border: 1.5px solid var(--line-2); color: var(--text);
  box-shadow: 0 1px 2px rgba(0,0,0,0.06);
}
.mapkey-sample.cheap {
  color: var(--good); border-color: color-mix(in srgb, var(--good) 50%, var(--line-2));
  background: color-mix(in srgb, var(--good) 6%, var(--surface));
}
.mapkey-sample.dear {
  color: var(--warn); border-color: color-mix(in srgb, var(--warn) 50%, var(--line-2));
  background: color-mix(in srgb, var(--warn) 6%, var(--surface));
}
.mapkey-sample.closed { opacity: 0.75; }
.mapkey-sample.no-price {
  border-style: dashed;
  border-color: var(--line-2);
  color: var(--text-2);
  opacity: 0.85;
}
.mapkey-sample.msa {
  color: #0066cc;
  border-color: #0066cc;
  background: color-mix(in srgb, #0066cc 6%, var(--surface));
}
.mapkey-sample .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--muted); display: inline-block; }
.mapkey-sample .dot.soon { background: var(--warn); }
.mapkey span { display: inline-flex; align-items: center; gap: 7px; }
.mapkey .lg { width: 10px; height: 10px; border-radius: 3px; background: var(--surface-2); border: 1px solid var(--line-2); display: inline-block; }
.mapkey .lg.cheap { background: var(--good); border-color: var(--good); }
.mapkey .lg.dear { background: var(--bad); border-color: var(--bad); }
.mapkey .lg.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--muted); border: 1.5px solid var(--surface); }
.mapkey .lg.dot.soon { background: var(--warn); }

.staleline.bad, .feed-notice.bad { color: var(--bad); }
.staleline.bad svg, .feed-notice.bad svg { color: var(--bad); }

.updatebar {
  position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%);
  z-index: 300; display: flex; align-items: center; gap: 10px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line-2);
  border-radius: var(--r-pill); padding: 8px 8px 8px 16px; box-shadow: var(--shadow-2);
  font-size: 13px; font-weight: 600;
}

details.calc { margin: 6px 0 0; }
details.calc summary {
  cursor: pointer; color: var(--text-2); font-size: 12px; font-weight: 600;
  padding: 6px 0; list-style: none;
}
details.calc summary::-webkit-details-marker { display: none; }
details.calc summary::before { content: '\25B8  '; color: var(--muted); }
details.calc[open] summary::before { content: '\25BE  '; }
details.calc .trust { margin-top: 4px; }

.btn[disabled], .cta[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------------------- Landing (first visit) ---------------------- */
.landing { padding: 4px 14px 24px; }
.lhero {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 10px 0 6px;
}
.leyebrow { font-size: 11px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--brand); }
.lhero-trust {
  display: flex;
  justify-content: center;
  margin: 4px auto 8px;
}
.lhero h1 {
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.2;
  text-align: center;
  margin: 0 auto 6px;
  letter-spacing: -.025em;
}
.lhero p, .lhero-sub {
  color: var(--text-2);
  font-size: 14px;
  line-height: 1.4;
  text-align: center;
  margin: 0 auto 14px;
  max-width: 480px;
}
.lrow { display: flex; gap: 8px; flex-wrap: wrap; }
.lchips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0 auto 16px;
  width: 100%;
  max-width: 440px;
}
.lchips .chip {
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.2;
  height: 32px;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: all .15s ease;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
  box-sizing: border-box;
}
.lchips .chip:hover {
  border-color: var(--brand);
  transform: translateY(-1px);
  box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
}
.lchips .chip:active {
  transform: scale(0.97);
}
.lsteps, .lstat, .ltrust { margin-top: 18px; }
.lsteps h2, .lstat h2 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: var(--text-2); margin: 0; }
.lstat-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.ltrust-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  font-size: 12px;
  font-weight: 600;
  border: 1px solid color-mix(in srgb, var(--good) 30%, var(--line));
  background: color-mix(in srgb, var(--good-soft) 45%, var(--surface));
  color: var(--text);
  line-height: 1.25;
}
.ltrust-pill.warn {
  border-color: color-mix(in srgb, var(--warn) 35%, var(--line));
  background: var(--warn-soft);
  color: var(--warn);
}
.ltrust-pill svg {
  color: var(--good);
  flex-shrink: 0;
}
.ltrust-pill.warn svg {
  color: var(--warn);
}
.ltrust-pill .ltrust-dot {
  color: var(--muted);
  font-size: 11px;
}
.ltrust-pill .ltrust-time {
  color: var(--good);
  font-weight: 500;
}
.lsteps ol { margin: 0; padding-left: 18px; color: var(--text-2); font-size: 13px; }
.lsteps li { margin-bottom: 6px; }
.lsteps b { color: var(--text); }
.lgrid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; align-items: stretch; }
.lcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px 13px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
button.lcard, a.lcard {
  text-align: left;
  font-family: inherit;
  color: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease;
  width: 100%;
}
button.lcard:hover, a.lcard:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand-soft) 25%, var(--surface));
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
button.lcard:active, a.lcard:active {
  transform: scale(0.98);
}
.lcard-hint {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 0 !important;
  min-height: 0 !important;
  width: 100%;
}
.lcard-hint-txt {
  font-size: 11.5px !important;
  font-weight: 600;
  color: var(--brand) !important;
  text-transform: none !important;
  letter-spacing: 0 !important;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.lcard-circle-btn {
  width: 22px;
  height: 22px;
  border-radius: 50% !important;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  color: var(--brand);
  flex-shrink: 0;
  margin: 0 !important;
  padding: 0 !important;
  transition: all .18s cubic-bezier(0.16, 1, 0.3, 1);
}
.lcard-circle-btn svg {
  display: block;
  transition: transform .18s ease;
}
button.lcard:hover .lcard-circle-btn,
a.lcard:hover .lcard-circle-btn,
.market-pulse-card:hover .lcard-circle-btn {
  background: var(--brand) !important;
  color: var(--brand-ink, #ffffff) !important;
  border-color: var(--brand) !important;
  transform: scale(1.08);
  box-shadow: 0 2px 6px color-mix(in srgb, var(--brand) 35%, transparent);
}
button.lcard:hover .lcard-circle-btn svg,
a.lcard:hover .lcard-circle-btn svg,
.market-pulse-card:hover .lcard-circle-btn svg {
  transform: translateX(1.5px);
}
[data-theme="dark"] .lcard-circle-btn {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.12);
  color: var(--brand);
}
[data-theme="dark"] button.lcard:hover .lcard-circle-btn,
[data-theme="dark"] a.lcard:hover .lcard-circle-btn,
[data-theme="dark"] .market-pulse-card:hover .lcard-circle-btn {
  background: var(--brand) !important;
  color: #0b1220 !important;
  border-color: var(--brand) !important;
}
.lcard span {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 6px;
}
.lcard b {
  font-family: var(--font-mono);
  font-size: 21px;
  line-height: 1.1;
  display: block;
}
.lrowsub { margin-top: 8px; }
.ltrust p { color: var(--muted); font-size: 11.5px; margin: 0 0 8px; }
@media (max-width: 290px) { .lgrid { grid-template-columns: 1fr; } }

/* sort + filters */
.sortbar { display: flex; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sortbar .pillrow { flex: 1; min-width: 0; }
.sortbar > .pill { flex: none; }
.sortbar > .pill:last-child { margin-left: 0; }
@media (max-width: 1023px) {
  .sortbar button[data-act="fuel-sheet"] { display: none; }
  .town-nav-bar { display: none; }
}
.sortpill { display: inline-flex; align-items: center; gap: 6px; background: var(--surface); border: 1px solid var(--line-2); color: var(--text); }
.sortpill:hover { background: var(--surface-2); }
.sortpill .ic { color: var(--text-2); }
.sortnote { color: var(--muted); font-size: 11.5px; margin: -4px 0 10px; }
.locbanner {
  background: var(--brand-soft);
  border: 1px solid color-mix(in srgb, var(--brand) 30%, var(--line));
  border-radius: var(--r-md);
  padding: 9px 12px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  color: var(--text);
}

@media (max-width: 560px) {
  .subrow { flex-direction: column; align-items: flex-start; gap: 6px; }
  .subtag { padding-top: 0; }
  .subrow h2 { font-size: 20px; }
}

.sl-short { display: none; }

@media (max-width: 1023px) {
  .lrow [data-act="focus-search"] { display: none; }
  .lrow [data-act="locate-me"] { width: 100%; justify-content: center; }
  .locbanner { display: none !important; }
  .sl-long { display: none; }
  .sl-short { display: inline; }
  .staleline {
    padding: 6px 10px;
    margin-bottom: 8px;
    font-size: 11.5px;
    gap: 6px;
  }
}

/* fuel type popover */
.fuelmenu {
  position: fixed; z-index: 1260; background: var(--surface);
  border: 1px solid var(--line-2); border-radius: var(--r-lg);
  box-shadow: var(--shadow-2); padding: 6px;
  display: flex; flex-direction: column; gap: 2px;
  animation: fmIn .12s ease-out;
}
.fuelmenu.vehmenu { max-height: calc(100vh - 24px); overflow: auto; overscroll-behavior: contain; }
@keyframes fmIn { from { opacity: 0; transform: translateY(6px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fuelmenu { animation: none; } }
.fmrow {
  display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
  border: 0; background: transparent; color: var(--text); padding: 8px 10px;
  border-radius: var(--r-sm); cursor: pointer; font: inherit;
}
.fmrow:hover, .fmrow:focus-visible { background: var(--surface-2); }
.fmrow.on { background: var(--brand-soft); }
.fmico {
  width: 32px; height: 32px; border-radius: 9px; background: var(--surface-2);
  color: var(--text-2); display: grid; place-items: center; flex: none;
  transition: transform .12s ease, background-color .15s ease;
}
.fmico.fuel-e10 { color: var(--fuel-e10); background: color-mix(in srgb, var(--fuel-e10) 14%, var(--surface-2)); }
.fmico.fuel-b7s { color: var(--fuel-b7s); background: color-mix(in srgb, var(--fuel-b7s) 14%, var(--surface-2)); }
.fmico.fuel-e5  { color: var(--fuel-e5);  background: color-mix(in srgb, var(--fuel-e5) 14%, var(--surface-2)); }
.fmico.fuel-b7p { color: var(--fuel-b7p); background: color-mix(in srgb, var(--fuel-b7p) 14%, var(--surface-2)); }
.fmico.fuel-b10 { color: var(--fuel-b10); background: color-mix(in srgb, var(--fuel-b10) 14%, var(--surface-2)); }
.fmico.fuel-hvo { color: var(--fuel-hvo); background: color-mix(in srgb, var(--fuel-hvo) 14%, var(--surface-2)); }

.fmrow.on .fmico.fuel-e10 { background: var(--fuel-e10); color: #fff; }
.fmrow.on .fmico.fuel-b7s { background: var(--fuel-b7s); color: #fff; }
.fmrow.on .fmico.fuel-e5  { background: var(--fuel-e5);  color: #fff; }
.fmrow.on .fmico.fuel-b7p { background: var(--fuel-b7p); color: #fff; }
.fmrow.on .fmico.fuel-b10 { background: var(--fuel-b10); color: #fff; }
.fmrow.on .fmico.fuel-hvo { background: var(--fuel-hvo); color: #fff; }

[data-theme="dark"] .fmrow.on .fmico.fuel-b7s { background: var(--fuel-b7s); color: #0b1320; }
[data-theme="dark"] .fmrow.on .fmico.fuel-e5  { background: var(--fuel-e5);  color: #1a1200; }
[data-theme="dark"] .fmrow.on .fmico.fuel-e10 { background: var(--fuel-e10); color: #052e16; }
[data-theme="dark"] .fmrow.on .fmico.fuel-b7p { background: var(--fuel-b7p); color: #270d03; }
[data-theme="dark"] .fmrow.on .fmico.fuel-b10 { background: var(--fuel-b10); color: #042429; }
[data-theme="dark"] .fmrow.on .fmico.fuel-hvo { background: var(--fuel-hvo); color: #031e3b; }
.fmtx { flex: 1; min-width: 0; }
.fmtx b { display: block; font-size: 14px; font-weight: 700; }
.fmtx span { display: block; font-size: 12px; color: var(--text-2); }
.fmrow.on .fmtx b { color: var(--brand); }

.fmhead {
  font-size: 10px; text-transform: uppercase; letter-spacing: .08em;
  color: var(--muted); font-weight: 800; padding: 6px 10px 4px;
}
.fmlabel {
  display: flex; align-items: center; justify-content: space-between;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}

.fmcustomwrap {
  border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px;
}
.fmcustomwrap > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center;
  justify-content: space-between; padding: 2px 6px 7px;
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted);
}
.fmcustomwrap > summary::-webkit-details-marker { display: none; }
.fmcustomwrap > summary::after { content: '+'; font-size: 14px; line-height: 1; color: var(--text-2); }
.fmcustomwrap[open] > summary::after { content: '−'; }
.fmcustom {
  display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px;
  align-items: end; padding: 0 6px 2px;
}
.fmcustom label {
  display: block; font-size: 10px; text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); font-weight: 800;
}
.fmcustom input {
  width: 100%; margin-top: 4px; padding: 8px;
  border: 1px solid var(--line-2); border-radius: 8px;
  background: var(--surface-2); color: var(--text); font: inherit;
}
.fmcustom .fm-save {
  grid-column: auto; width: auto; min-height: 36px;
  margin: 0 0 1px; padding: 0 12px; border-radius: 8px;
  justify-content: center; font-size: 12.5px;
}
@media (max-width: 340px) {
  .fmcustom { grid-template-columns: 1fr 1fr; }
  .fmcustom .fm-save { grid-column: 1 / -1; width: 100%; }
}

/* branded navigation buttons */
.btn.act-maps {
  border-color: color-mix(in srgb, var(--maps) 45%, var(--line-2));
  background: color-mix(in srgb, var(--maps) 7%, var(--surface));
}
.btn.act-maps .ic { color: var(--maps); }
.btn.act-waze {
  border-color: color-mix(in srgb, var(--waze) 45%, var(--line-2));
  background: color-mix(in srgb, var(--waze) 9%, var(--surface));
}
.btn.act-waze .ic { color: var(--waze); }

/* route combobox */
.combo { position: relative; }
.combo .sugbox {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 35;
  background: var(--surface); border: 1px solid var(--line-2);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  max-height: 220px; overflow-y: auto; padding: 4px;
}
.sugitem {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  width: 100%; border: 0; background: transparent; color: var(--text);
  padding: 9px 10px; border-radius: var(--r-sm); text-align: left;
  font: inherit; font-size: 13px; cursor: pointer;
}
.sugitem:hover, .sugitem:focus-visible { background: var(--surface-2); }
.sugitem small { color: var(--muted); font-size: 11px; flex: none; }
.routeopts { display: flex; align-items: center; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.switchline { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }
.switchline input { accent-color: var(--brand); width: 16px; height: 16px; }

.brandchip .mono-mark.brandword {
  font-size: 9px; line-height: 1.05; letter-spacing: -.02em; text-align: center; padding: 0 2px;
}
.btn.primary.act-maps { background: var(--maps); border-color: var(--maps); color: var(--brand-ink); }
.btn.primary.act-maps .ic { color: currentColor; }

.detailsbtn {
  display: inline-flex; align-items: center; gap: 4px; min-height: 36px;
  border: 0; background: transparent; color: var(--brand);
  font: inherit; font-size: 12.5px; font-weight: 700; padding: 6px 4px; cursor: pointer;
}
.detailsbtn:hover { text-decoration: underline; }
.detailsbtn .ic { color: var(--brand); }
.badge.members { background: var(--chip); color: var(--text-2); }
.notice.membership { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.notice.motorway-notice { display: flex; align-items: flex-start; gap: 10px; padding: 10px 14px; background: color-mix(in srgb, #0066cc 8%, var(--surface)); border: 1px solid color-mix(in srgb, #0066cc 35%, transparent); border-left: 4px solid #0066cc; border-radius: var(--r-md); margin: 10px 0; color: var(--text); font-size: 13px; line-height: 1.45; }
.msa-notice-badge { display: inline-grid; place-items: center; flex-shrink: 0; width: 24px; height: 24px; border-radius: 4px; background: #0066cc; color: #fff; font-weight: 800; font-size: 14px; line-height: 1; }


/* map zoom controls — bottom-left, above the attribution (i) */
.zoomctl {
  position: absolute; left: 10px; bottom: 48px; z-index: 7;
  display: flex; flex-direction: column; gap: 6px;
}
.zoomctl .round {
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(10px);
  border: 1px solid var(--line-2); color: var(--text); box-shadow: var(--shadow-2);
}
.zoomctl .round:hover { background: var(--surface); }
@media (max-width: 560px) {
  .zoomctl { left: 10px; bottom: 40px; gap: 5px; }
  .zoomctl .round { width: 34px; height: 34px; }
}

/* local context between sort and filters */
.sortstats {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 6px 14px;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.2;
  white-space: nowrap;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02);
  flex: 0 1 auto;
}
.sortstats .stat-lbl {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.sortstats b {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
}
@media (max-width: 380px) {
  .sortstats {
    padding: 5px 10px;
    font-size: 11.5px;
  }
}
[data-theme="dark"] .sortstats {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.08);
}

/* responsive landing headline */
.h-short { display: none; }
@media (max-width: 560px) {
  .h-long { display: none; }
  .h-short { display: inline; }
}

.station .meta { overflow-wrap: anywhere; }
.station .meta.metarow { line-height: 1.45; }
.station .meta.metarow .pc { white-space: nowrap; }
.station .meta.metarow .distseg {
  display: inline-flex; align-items: center; gap: 7px;
  white-space: nowrap; color: var(--muted);
  margin-left: 5px; padding-left: 2px;
}
.station .meta.metarow .vsep {
  display: inline-block; width: 1px; height: 12px;
  background: var(--line-2); flex: none; margin-right: 1px;
}

.coarsechip {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  margin-top: 12px; padding: 6px 10px; font-size: 11.5px;
  color: var(--muted); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-pill);
}
.coarsechip .ic { color: var(--muted); flex: none; }
.coarsechip .linkbtn { margin-left: auto; }

/* ---------------- v63 UX polish: search clear, star, map area, mobile buy badge ---------------- */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
  display: none;
}
.suggest { scrollbar-width: none; }
.suggest::-webkit-scrollbar { display: none; }

.search-clear {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--surface-3); color: var(--text-2);
  font-size: 11px; line-height: 1; padding: 0;
  transition: background .12s, color .12s;
}
.search-clear[hidden] { display: none !important; }
.search-clear:hover { background: var(--line-2); color: var(--text); }

.mbuy { display: flex; align-items: center; }
@media (min-width: 1024px) { .mbuy { display: none; } }

.starbtn, .alertbtn {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  display: inline-grid; place-items: center;
  color: var(--muted); background: transparent;
  transition: color .12s, background .12s, transform .1s;
}
.starbtn:hover, .alertbtn:hover { background: var(--surface-2); color: var(--text); }
.starbtn.on { color: #E59500; }
.alertbtn.on {
  color: #fff !important;
  background: var(--good) !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--good) 28%, transparent), 0 2px 5px rgba(0,0,0,0.18);
}
.alertbtn.on:hover {
  background: color-mix(in srgb, var(--good) 88%, #000) !important;
  color: #fff !important;
}
.alertbtn.paused {
  color: var(--text-2) !important;
  background: var(--surface-2) !important;
  border: 1px dashed var(--line-2) !important;
  border-radius: 50% !important;
  opacity: .85;
}
.alertbtn.paused:hover {
  background: var(--chip) !important;
  color: var(--text) !important;
}
.starbtn:active, .alertbtn:active { transform: scale(.92); }

.toggle-switch.good input:checked + .toggle-slider {
  background-color: var(--good);
}

.clear-saved-btn {
  background: transparent; border: 0; color: var(--bad);
  font-size: 13px; font-weight: 600; text-decoration: none !important;
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; padding: 0;
  transition: opacity .12s;
}
.clear-saved-btn:hover { text-decoration: none !important; opacity: .85; }

.saved-segmented {
  display: flex;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
  margin-top: 10px;
}
.saved-seg-btn {
  flex: 1;
  min-width: 0;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 700;
  border-radius: var(--r-sm);
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  text-align: center;
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  transition: all .15s ease;
}
.saved-seg-btn:hover {
  color: var(--text);
}
.saved-seg-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.08);
}
.saved-seg-btn .seg-count {
  font-size: 11px;
  font-weight: 800;
  padding: 1px 7px;
  border-radius: 9px;
  background: var(--surface-3);
  color: var(--text-2);
}
.saved-seg-btn.active .seg-count {
  background: var(--brand);
  color: var(--brand-ink);
}

.showmore {
  width: 100%; justify-content: center; margin: 6px 0 14px;
  padding: 11px 16px; font-weight: 700;
}

.mapfilterctl {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  max-width: calc(100% - 76px);
}
.maparea-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 13px;
  border: 1px solid var(--brand); border-radius: var(--r-pill);
  background: var(--brand); color: var(--brand-ink);
  font-size: 12.5px; font-weight: 700; box-shadow: var(--shadow-2);
  cursor: pointer; white-space: nowrap;
  animation: fmIn .15s ease-out;
}
.maparea-btn[hidden] { display: none !important; }
.maparea-btn:hover { filter: brightness(1.06); }
.map-reset-origin-btn {
  display: inline-flex; align-items: center; gap: 5px; height: 38px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--surface); color: var(--text);
  font-size: 12px; font-weight: 700; box-shadow: var(--shadow-2);
  cursor: pointer; white-space: nowrap;
  animation: fmIn .15s ease-out;
  transition: background .15s, border-color .15s;
}
.map-reset-origin-btn[hidden] { display: none !important; }
.map-reset-origin-btn:hover { background: var(--surface-2); border-color: var(--brand); }
@media (max-width: 560px) {
  .maparea-btn { height: 36px; padding: 0 11px; font-size: 12px; }
  .map-reset-origin-btn { height: 36px; padding: 0 9px; font-size: 11.5px; }
}

/* v64: Winner card highlight, ribbon, compact grades inline & discount pill */
.station.winner {
  border-color: color-mix(in srgb, var(--good) 45%, var(--line));
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--good) 25%, transparent), var(--shadow-1);
}
.winbar {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: none;
  color: var(--good);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: normal;
  text-transform: none;
  padding: 0;
  margin-bottom: 9px;
  width: fit-content;
}
.winbar svg {
  flex: none;
  color: #eab308;
}
[data-theme="dark"] .winbar {
  color: #4ade80;
}
[data-theme="dark"] .winbar svg {
  color: #facc15;
}
.disc-pill {
  display: inline-block; padding: 1px 5px; border-radius: var(--r-xs);
  background: var(--good-soft); color: var(--good); font-size: 10px; font-weight: 700;
  margin-left: 3px; vertical-align: 1px;
}


/* ---------------- Amenity Chips — Semantic Pastel Palette ---------------- */
.chip.amen-chip {
  font-size: 12px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--line-2);
  transition: transform .1s;
}
.chip.amen-chip:hover { transform: translateY(-1px); }
.chip.amen-adblue_packaged, .chip.amen-adblue_pumps, .chip.amen-adblue {
  background: #e0f2fe; color: #0369a1; border-color: #bae6fd;
}
.chip.amen-car_wash, .chip.amen-wash {
  background: #e0f7fa; color: #00796b; border-color: #b2dfdb;
}
.chip.amen-air_pump_or_screenwash, .chip.amen-air {
  background: #ecfdf5; color: #047857; border-color: #a7f3d0;
}
.chip.amen-customer_toilets, .chip.amen-wc {
  background: #f3e8ff; color: #6b21a8; border-color: #e9d5ff;
}
.chip.amen-water_filling, .chip.amen-water {
  background: #eff6ff; color: #1d4ed8; border-color: #bfdbfe;
}
.chip.amen-lpg_pumps, .chip.amen-lpg {
  background: #fffbeb; color: #b45309; border-color: #fde68a;
}
.chip.amen-twenty_four_hour_fuel, .chip.amen-24h {
  background: #dcfce7; color: #15803d; border-color: #bbf7d0;
}

[data-theme="dark"] .chip.amen-adblue_packaged, [data-theme="dark"] .chip.amen-adblue_pumps, [data-theme="dark"] .chip.amen-adblue {
  background: rgba(3, 105, 161, 0.22); color: #7dd3fc; border-color: rgba(125, 211, 252, 0.25);
}
[data-theme="dark"] .chip.amen-car_wash, [data-theme="dark"] .chip.amen-wash {
  background: rgba(0, 121, 107, 0.22); color: #5eead4; border-color: rgba(94, 234, 212, 0.25);
}
[data-theme="dark"] .chip.amen-air_pump_or_screenwash, [data-theme="dark"] .chip.amen-air {
  background: rgba(4, 120, 87, 0.22); color: #6ee7b7; border-color: rgba(110, 231, 183, 0.25);
}
[data-theme="dark"] .chip.amen-customer_toilets, [data-theme="dark"] .chip.amen-wc {
  background: rgba(107, 33, 168, 0.22); color: #d8b4fe; border-color: rgba(216, 180, 254, 0.25);
}
[data-theme="dark"] .chip.amen-water_filling, [data-theme="dark"] .chip.amen-water {
  background: rgba(29, 78, 216, 0.22); color: #93c5fd; border-color: rgba(147, 197, 253, 0.25);
}
[data-theme="dark"] .chip.amen-lpg_pumps, [data-theme="dark"] .chip.amen-lpg {
  background: rgba(180, 83, 9, 0.22); color: #fcd34d; border-color: rgba(252, 211, 77, 0.25);
}

/* ---------------- Navigation App Picker Sheet ---------------- */
.nav-picker-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 16px 0;
}
.nav-picker-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  text-align: left;
  cursor: pointer;
  transition: background .12s, border-color .12s, transform .1s;
  width: 100%;
  box-sizing: border-box;
}
.nav-picker-btn:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--brand) 40%, var(--line));
  transform: translateY(-1px);
}
.np-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.np-icon.np-google {
  background: #e8f0fe;
  color: #1a73e8;
}
.np-icon.np-waze {
  background: #e0f2fe;
  color: #0284c7;
}
.np-icon.np-apple {
  background: #f3f4f6;
  color: #111827;
}
[data-theme="dark"] .np-icon.np-google { background: rgba(26, 115, 232, 0.2); color: #8ab4f8; }
[data-theme="dark"] .np-icon.np-waze { background: rgba(2, 132, 199, 0.2); color: #38bdf8; }
[data-theme="dark"] .np-icon.np-apple { background: rgba(255, 255, 255, 0.12); color: #f9fafb; }
.np-text {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.np-text b {
  font-size: 15px;
  color: var(--text);
  font-weight: 700;
}
.np-text span {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.3;
}
.np-arrow {
  font-size: 18px;
  color: var(--muted);
  flex: none;
  font-weight: 700;
}
.nav-picker-footer {
  margin-top: 8px;
}

/* ---------------- 7-Day Sparkline Price Chart ---------------- */
.sparkbox {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 12px 14px;
  margin: 12px 0 8px;
}
.sparkhead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.sparktitle-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}
.sparktitle {
  font-size: 11.5px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--muted);
}
.spark-grade-badge {
  font-size: 10.5px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 99px;
  background: var(--surface);
  border: 1px solid var(--line);
  color: var(--text-2);
}
.sparktrend-pill {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 99px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.sparktrend-pill.drop {
  background: color-mix(in srgb, var(--good) 14%, var(--surface));
  color: var(--good);
  border: 1px solid color-mix(in srgb, var(--good) 30%, transparent);
}
.sparktrend-pill.rise {
  background: color-mix(in srgb, var(--warn) 14%, var(--surface));
  color: var(--warn);
  border: 1px solid color-mix(in srgb, var(--warn) 30%, transparent);
}
.sparktrend-pill.stable {
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}
.spark-compare-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 6px 12px;
  margin-bottom: 10px;
}
.spark-stat {
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.spark-stat-lbl {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .03em;
  color: var(--muted);
  font-weight: 600;
}
.spark-stat-val {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
}
.spark-stat.current .spark-stat-val {
  color: var(--brand);
}
.spark-arrow {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}
.sparkwrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.sparksvg {
  width: 100%;
  height: 42px;
  display: block;
  overflow: visible;
}
.spark-takeaway {
  font-size: 11.5px;
  color: var(--text-2);
  line-height: 1.35;
  margin-top: 2px;
}

/* Simplified Motorway Notice — Full-width centered highway corridor strip */
.notice.motorway-notice.simple {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 9px 14px;
  background: #0066cc;
  color: #fff;
  border: none;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 700;
  margin: 10px 0 4px;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}
.notice.motorway-notice.simple .msa-notice-badge {
  width: auto;
  height: auto;
  background: transparent;
  font-size: 15px;
  line-height: 1;
}
.exp-sec.msa-sec {
  padding: 8px 0;
}

/* Mobile Search & Hero Layout styled matching Image 1 specification */
@media (max-width: 1023px) {
  .mapgrip {
    height: 18px !important;
    margin: 2px 0 4px !important;
  }
  .mapgrip .bar {
    width: 40px !important;
    height: 4px !important;
    border-radius: 2px !important;
  }
  .left-scroll {
    padding: 6px 14px calc(var(--dock-h) + var(--s6)) !important;
  }
  .landing {
    padding: 0 0 24px !important;
  }
  .lhero {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
    padding: 4px 0 16px !important;
  }
  .lhero-trust {
    display: flex !important;
    justify-content: center !important;
    margin: 0 auto 8px !important;
  }
  .lhero h1 {
    font-family: var(--font-display) !important;
    font-size: 23px !important;
    font-weight: 800 !important;
    letter-spacing: -0.025em !important;
    line-height: 1.2 !important;
    color: var(--text, #0f172a) !important;
    text-align: center !important;
    margin: 0 auto 6px !important;
  }
  @media (max-width: 390px) {
    .lhero h1 { font-size: 21.5px !important; }
  }
  .lhero-sub {
    font-size: 13.5px !important;
    color: var(--text-2, #475569) !important;
    line-height: 1.4 !important;
    text-align: center !important;
    margin: 0 auto 12px !important;
    max-width: 440px !important;
  }
  .lsearch-bar { display: none !important; }
  .lhero .lsearch-slot {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
    margin: 0 auto 12px !important;
  }
  .lhero .msearch {
    margin: 0 auto !important;
    width: 100% !important;
    max-width: 480px !important;
    box-sizing: border-box !important;
  }
  .msearch {
    margin: 2px 14px 10px !important;
  }
  .lhero .lchips {
    display: flex !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 8px !important;
    width: 100% !important;
    max-width: 420px !important;
    margin: 0 auto 16px !important;
  }
  .lhero .lchips .chip {
    background: var(--surface, #ffffff) !important;
    border: 1.5px solid var(--line-2, #cbd5e1) !important;
    border-radius: var(--r-pill, 999px) !important;
    padding: 6px 14px !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    height: 32px !important;
    color: var(--text, #0f172a) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
    cursor: pointer !important;
    transition: all .15s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    white-space: nowrap !important;
    box-sizing: border-box !important;
  }
  [data-theme="dark"] .lhero .lchips .chip {
    background: #1e293b !important;
    border-color: #334155 !important;
    color: #f8fafc !important;
  }
  .lhero .lchips .chip:hover {
    border-color: var(--brand, #0046AB) !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08) !important;
  }
  .lhero .lchips .chip:active {
    transform: scale(0.97) !important;
  }
  .lstat {
    margin-top: 14px !important;
  }
}

/* Desktop unified search bar - perfectly aligned inline and centered */
@media (min-width: 1024px) {
  .lsearch-bar {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    height: 48px;
    gap: 8px;
    background: var(--surface) !important;
    border: 1.5px solid var(--line-2) !important;
    border-radius: var(--r-pill) !important;
    padding: 0 6px 0 16px !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06) !important;
    width: 100%;
    max-width: 480px !important;
    margin: 10px auto 14px !important;
    box-sizing: border-box;
    cursor: pointer;
  }
.lsearch-trigger {
  display: flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: none;
  padding: 0;
  margin: 0;
  font-size: 14px;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  flex: 1;
  min-width: 0;
  text-align: left;
  height: 100%;
  line-height: 1;
}
.lsearch-trigger svg, .lsearch-trigger .ic {
  display: block;
  flex-shrink: 0;
  color: var(--text-2);
  margin: 0;
}
.lsearch-trigger span {
  line-height: 1;
  display: inline-block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.llocate-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--brand-soft);
  color: var(--brand);
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  padding: 0 12px;
  height: 34px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
  box-sizing: border-box;
  line-height: 1;
  flex-shrink: 0;
}
.llocate-btn:hover {
  background: color-mix(in srgb, var(--brand-soft) 70%, var(--brand));
  color: var(--brand);
}
[data-theme="dark"] .llocate-btn {
  background: var(--brand-soft);
  color: var(--brand);
}
.llocate-btn svg, .llocate-btn .ic {
  display: block;
  flex-shrink: 0;
  margin: 0;
}
.llocate-btn span {
  line-height: 1;
  display: inline-block;
}
}

/* Dedicated Navigation & Directions section */
.nav-actions-sec {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
}
.nav-actions-sec h2, .nav-actions-sec h4 {
  margin-bottom: 8px;
}

/* Drawer route stop bar & Station card stop toggle */
.drawer-route-stop-bar {
  margin-top: 10px;
  padding: 9px 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  transition: all .15s ease;
}
.drawer-route-stop-bar.is-added {
  background: rgba(5, 150, 105, 0.06);
  border-color: rgba(5, 150, 105, 0.35);
}
.drawer-route-stop-bar .drs-info {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}
.drawer-route-stop-bar .drs-icon {
  color: var(--brand);
  display: flex;
  align-items: center;
  flex-shrink: 0;
}
.drawer-route-stop-bar.is-added .drs-icon {
  color: #059669;
}
.drawer-route-stop-bar .drs-text {
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.drawer-route-stop-bar .drs-text b {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.drawer-route-stop-bar .drs-text span {
  font-size: 11px;
  color: var(--text-2);
  line-height: 1.2;
}

.route-stop-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--brand);
  background: rgba(0, 70, 171, 0.08);
  color: var(--brand);
  cursor: pointer;
  transition: all .15s ease;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}
.route-stop-toggle:hover {
  background: var(--brand);
  color: #fff;
}
.route-stop-toggle.on {
  border-color: #059669;
  background: rgba(5, 150, 105, 0.12);
  color: #059669;
}
.route-stop-toggle.on:hover {
  background: #059669;
  color: #fff;
}
[data-theme="dark"] .drawer-route-stop-bar {
  background: rgba(255, 255, 255, 0.03);
  border-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .drawer-route-stop-bar.is-added {
  background: rgba(16, 185, 129, 0.08);
  border-color: rgba(16, 185, 129, 0.3);
}
[data-theme="dark"] .route-stop-toggle {
  background: rgba(56, 189, 248, 0.12);
  border-color: rgba(56, 189, 248, 0.4);
  color: #38bdf8;
}
[data-theme="dark"] .route-stop-toggle:hover {
  background: #0284c7;
  color: #fff;
}
[data-theme="dark"] .route-stop-toggle.on {
  background: rgba(16, 185, 129, 0.15);
  border-color: rgba(16, 185, 129, 0.4);
  color: #34d399;
}
[data-theme="dark"] .route-stop-toggle.on:hover {
  background: #059669;
  color: #fff;
}

/* Route buffer pill buttons */
.bufgroup .pill.sm {
  padding: 3px 8px;
  font-size: 11.5px;
  font-weight: 700;
  border-radius: 99px;
  cursor: pointer;
  border: 1px solid var(--line-2);
  background: var(--surface);
  color: var(--text-2);
  transition: all .12s;
  height: 27px;
  display: inline-flex;
  align-items: center;
  box-sizing: border-box;
}
.bufgroup .pill.sm.on {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}

.dist.off-route,
.dist-tag.off-route {
  background: var(--brand-soft);
  color: var(--brand);
  padding: 2.5px 8px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: 11px;
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  flex-shrink: 0;
  line-height: 1.2;
}

/* Route map endpoint badges (A & B) */
.routemarker {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface);
  border: 1.5px solid var(--line-2);
  border-radius: var(--r-pill);
  padding: 3px 9px 3px 4px;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.22);
  font-size: 11.5px;
  font-weight: 700;
  pointer-events: none;
  transform: translateY(-8px);
  white-space: nowrap;
  line-height: 1;
  z-index: 20;
}
.routemarker .rm-badge {
  display: inline-grid;
  place-items: center;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  color: #ffffff;
  font-weight: 800;
  font-size: 10.5px;
  line-height: 1;
}
.routemarker.start .rm-badge {
  background: var(--good);
}
.routemarker.dest .rm-badge {
  background: var(--brand);
}
.routemarker.stop .rm-badge {
  background: var(--brand-accent, #0D9488);
}
.routemarker .rm-name {
  color: var(--text);
  font-weight: 600;
  font-size: 12px;
}

/* ---------------- Brand Filter Grid (Wrap Without Cut-Off) ---------------- */
.brand-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 4px;
}
.brand-filter-grid .pill {
  flex: none;
  padding: 6px 12px;
  font-size: 13px;
  border-radius: var(--r-pill);
}

/* ---------------- Award-Winning Responsive Footer on App Index ---------------- */
footer.site-footer {
  margin-top: 48px;
  padding: 40px 20px 28px;
  border-top: 1px solid #1E293B;
  background: radial-gradient(1200px 100% at 50% 0%, rgba(37, 99, 235, 0.22) 0%, transparent 70%), #0A1120;
  color: #E2E8F0;
  border-radius: var(--r-lg) var(--r-lg) 0 0;
}
/* Main App Sidebar Feed Actions (Share / About block) */
.pane-left .site-footer:not(.app-footer) {
  margin: 18px 0 0 0 !important;
  padding: 12px 8px 8px !important;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: var(--text-2) !important;
  border-radius: 0 !important;
}
.pane-left .site-footer:not(.app-footer) .footlinks {
  display: flex;
  gap: 10px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.pane-left .site-footer:not(.app-footer) .footattr {
  font-size: 11px;
  color: var(--muted);
  text-align: center;
  margin-top: 8px;
  opacity: 0.85;
}

.f-wrap { max-width: 1040px; margin: 0 auto; }
.f-top { display: grid; grid-template-columns: 1.2fr 2.8fr; gap: 36px; margin-bottom: 30px; }
.f-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 12px; }
.f-logo { display: inline-flex; align-items: center; justify-content: center; align-self: center; gap: 8px; font: 800 18px var(--sans); color: #FFFFFF; text-decoration: none; }
.f-logo .glyph { width: 28px; height: 28px; border-radius: 7px; background: transparent; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.f-logo .glyph svg { width: 100%; height: 100%; display: block; }
.f-logo .lt { color: #3B82F6; font-weight: 800; }
.f-logo .tld { opacity: 0.85; font-weight: 500; font-size: 15px; color: #94A3B8; }
.f-motto { font-size: 13px; line-height: 1.55; color: #94A3B8; margin: 0 auto; text-align: center; max-width: 480px; }
.f-live-pill {
  display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 600;
  color: #CBD5E1; background: rgba(255, 255, 255, 0.06); padding: 4px 11px; border-radius: 99px;
  width: fit-content; border: 1px solid rgba(255, 255, 255, 0.12); margin: 0 auto; align-self: center;
}
.f-dot { width: 6px; height: 6px; border-radius: 50%; background: #10B981; display: inline-block; box-shadow: 0 0 8px #10B981; }
@keyframes fPulse { 0%,100%{opacity:1} 50%{opacity:0.4} }

.f-cols { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.f-cols b { display: block; font: 700 11px/1.4 var(--sans); text-transform: uppercase; letter-spacing: 0.08em; color: #F8FAFC; margin-bottom: 10px; }
.f-cols a { display: block; font-size: 13px; color: #94A3B8; margin-bottom: 7px; text-decoration: none; transition: color .12s, transform .12s; }
.f-cols a:hover { color: #FFFFFF; transform: translateX(2px); text-decoration: none; }


.f-disclaimer { border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 20px; margin-bottom: 20px; }
.f-disclaimer .disc { font-size: 11.5px; line-height: 1.6; color: #64748B; margin: 0; }
.f-disclaimer a { color: #94A3B8; text-decoration: underline; }

.f-bar {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 18px; font-size: 12px; color: #64748B;
}
.f-badge { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: #94A3B8; }
.f-flag { font-size: 15px; }

[data-theme="dark"] footer.site-footer {
  background: radial-gradient(1200px 100% at 50% 0%, rgba(37, 99, 235, 0.18) 0%, transparent 70%), #080C14;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] .f-live-pill {
  background: rgba(255, 255, 255, 0.04);
  border-color: rgba(255, 255, 255, 0.1);
  color: var(--text-2);
  box-shadow: none;
}

@media (max-width: 860px) {
  .f-top { grid-template-columns: 1fr; gap: 28px; }
  .f-cols { grid-template-columns: repeat(2, 1fr); gap: 24px 16px; }
}
@media (max-width: 520px) {
  footer.site-footer { padding: 32px 14px 20px; margin-top: 36px; }
  .f-cols { grid-template-columns: 1fr 1fr; gap: 20px 14px; }
  .f-cols a { font-size: 12.5px; }
  .f-bar { flex-direction: column; align-items: center; text-align: center; justify-content: center; gap: 8px; }
  .f-bar .f-copy, .f-bar .f-badge { text-align: center; justify-content: center; }
}
footer.app-footer {
  margin-top: 24px;
  padding: 28px 16px 20px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}
footer.app-footer .f-wrap {
  width: 100%;
}
footer.app-footer .f-top {
  display: flex !important;
  flex-direction: column !important;
  gap: 22px !important;
  margin-bottom: 22px !important;
}
footer.app-footer .f-brand {
  display: flex !important;
  flex-direction: column !important;
  align-items: center !important;
  text-align: center !important;
  gap: 12px !important;
}
footer.app-footer .f-logo {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  align-self: center !important;
  color: var(--text) !important;
}
footer.app-footer .f-logo .tld {
  color: var(--muted) !important;
}
footer.app-footer .f-motto {
  text-align: center !important;
  max-width: 480px !important;
  margin: 0 auto !important;
  color: var(--muted) !important;
}
footer.app-footer .f-live-pill {
  margin: 0 auto !important;
  align-self: center !important;
  background: var(--surface-2) !important;
  border: 1px solid var(--line) !important;
  color: var(--text) !important;
}
footer.app-footer .f-cols {
  display: grid !important;
  grid-template-columns: repeat(2, 1fr) !important;
  gap: 20px 14px !important;
}
footer.app-footer .f-cols b {
  display: block;
  font: 700 11px/1.4 var(--sans);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text) !important;
  margin-bottom: 9px;
}
footer.app-footer .f-cols a {
  font-size: 12.5px;
  margin-bottom: 6px;
  white-space: normal;
  word-break: break-word;
  color: var(--muted) !important;
}
footer.app-footer .f-cols a:hover {
  color: var(--brand) !important;
}
footer.app-footer .f-disclaimer {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-bottom: 16px;
}
footer.app-footer .f-disclaimer .disc {
  font-size: 11px;
  line-height: 1.55;
  color: var(--muted) !important;
}
footer.app-footer .f-disclaimer a {
  color: var(--text) !important;
}
footer.app-footer .f-bar {
  border-top: 1px solid var(--line);
  color: var(--muted) !important;
}

[data-theme="dark"] footer.app-footer {
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: radial-gradient(1000px 100% at 50% 0%, rgba(37, 99, 235, 0.18) 0%, transparent 70%), #080C14;
  color: #E2E8F0;
  box-shadow: none;
}
[data-theme="dark"] footer.app-footer .f-motto {
  color: #94A3B8 !important;
}
[data-theme="dark"] footer.app-footer .f-cols b {
  color: #F8FAFC !important;
}
[data-theme="dark"] footer.app-footer .f-cols a {
  color: #94A3B8 !important;
}
[data-theme="dark"] footer.app-footer .f-cols a:hover {
  color: #FFFFFF !important;
}
[data-theme="dark"] footer.app-footer .f-live-pill {
  background: rgba(255, 255, 255, 0.04) !important;
  border-color: rgba(255, 255, 255, 0.1) !important;
  color: var(--text-2) !important;
}
[data-theme="dark"] footer.app-footer .f-logo {
  color: #FFFFFF !important;
}
[data-theme="dark"] footer.app-footer .f-logo .tld {
  color: #94A3B8 !important;
}
[data-theme="dark"] footer.app-footer .f-disclaimer {
  border-top-color: rgba(255, 255, 255, 0.08);
}
[data-theme="dark"] footer.app-footer .f-disclaimer .disc {
  color: #64748B !important;
}
[data-theme="dark"] footer.app-footer .f-disclaimer a {
  color: #94A3B8 !important;
}
[data-theme="dark"] footer.app-footer .f-bar {
  border-top-color: rgba(255, 255, 255, 0.08);
  color: #64748B !important;
}

@media (max-width: 1023px) {
  footer.app-footer {
    padding-bottom: 88px !important; /* Clears mobile floating dock */
  }
}
@media (max-width: 520px) {
  footer.app-footer .f-bar {
    flex-direction: column;
    align-items: center;
    text-align: center;
    justify-content: center;
    gap: 8px;
  }
  footer.app-footer .f-bar .f-copy,
  footer.app-footer .f-bar .f-badge {
    text-align: center;
    justify-content: center;
  }
}

/* ---------------- AdSense & Sponsored Placement Slots ---------------- */
.ad-slot-wrap {
  width: 100%;
  max-width: 980px;
  margin: 20px auto 14px;
  text-align: center;
  overflow: hidden;
  clear: both;
}
.ad-slot-label {
  display: block;
  font: 700 10px/1 var(--sans, sans-serif);
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}
.ad-slot-box {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  max-height: 280px;
  background: var(--surface-2);
  border: 1px dashed var(--line);
  border-radius: 12px;
  padding: 12px;
  transition: border-color .15s ease;
}
.ad-slot-box:hover {
  border-color: var(--brand);
}
.ad-slot-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
}
.ad-slot-placeholder b {
  font-size: 12.5px;
  color: var(--text-2);
}
[data-theme="dark"] .ad-slot-box {
  background: rgba(255, 255, 255, 0.02);
  border-color: rgba(255, 255, 255, 0.08);
}
.ad-fallback-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  width: 100%;
  max-width: 620px;
  padding: 4px 8px;
}
.ad-fallback-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}
.ad-fallback-badge {
  display: inline-block;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: var(--brand);
}
.ad-fallback-title {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.ad-fallback-desc {
  margin: 0;
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.4;
}
.ad-fallback-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--brand);
  color: var(--brand-ink, #0c2014);
  font-size: 12px;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: 999px;
  text-decoration: none;
  margin-top: 4px;
  transition: transform .1s ease, filter .15s ease;
}
.ad-fallback-btn:hover {
  filter: brightness(1.08);
  transform: translateY(-1px);
}

/* Route & Stops in-sheet action buttons */
.mf-route-sheet-footer {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.mf-route-sheet-btns {
  display: flex;
  gap: 8px;
  align-items: center;
}
.mf-sheet-btn-map,
.mf-sheet-btn-list {
  flex: 1;
  height: 42px;
  font-size: 13.5px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border-radius: var(--r-md);
}
.mf-route-sheet-gmaps a {
  font-size: 12.5px;
  color: var(--text-2);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: color .15s ease;
}
.mf-route-sheet-gmaps a:hover {
  color: var(--brand);
}

.buywindow-nav-row {
  margin-bottom: 12px;
}
@media (min-width: 1024px) {
  .buywindow-nav-row {
    display: none;
  }
}

/* Menu sheet market outlook card */
.sheet-menu-market {
  margin-top: 10px;
}
.sheet-market-btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  text-align: left;
  font-family: inherit;
  transition: border-color .15s ease, background .15s ease, transform .1s ease;
}
.sheet-market-btn:hover {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 6%, var(--surface-2));
}
.sheet-market-btn:active {
  transform: scale(0.99);
}
.smm-left {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
  min-width: 0;
  flex: 1;
}
.smm-desc {
  font-size: 12px;
  line-height: 1.35;
  color: var(--text-2);
  white-space: normal;
  word-break: break-word;
}
.smm-arrow {
  font-size: 14px;
  color: var(--brand);
  font-weight: 700;
  flex: none;
}

/* Interactive market pulse card on landing */
.market-pulse-card {
  border: 1px solid var(--line);
  background: var(--surface);
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.market-pulse-card:hover {
  border-color: var(--brand) !important;
  background: color-mix(in srgb, var(--brand-soft) 25%, var(--surface)) !important;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}
[data-theme="dark"] .market-pulse-card:hover {
  border-color: var(--brand) !important;
  background: color-mix(in srgb, var(--brand) 18%, var(--surface)) !important;
}
.market-pulse-card:active {
  transform: scale(0.99);
}

/* Area View cohesive breadcrumb & back bar */
.area-nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 12px;
}
.area-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-full, 9999px);
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.area-back-btn:hover {
  background: var(--surface-2, #f1f5f9);
  color: var(--text);
  border-color: var(--line-2, #cbd5e1);
}
.area-crumb-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-2);
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line);
  border-radius: var(--r-full, 9999px);
  letter-spacing: 0.02em;
}
[data-theme="dark"] .area-crumb-badge {
  background: rgba(255, 255, 255, 0.06);
}

/* ------------------- Accessibility Settings & Controls ------------------- */
.a11y-settings-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 6px;
}
.a11y-toggle-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  cursor: pointer;
  padding: 6px 0;
  user-select: none;
  background: none;
  border: none;
  text-align: left;
  width: 100%;
}
.a11y-toggle-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}
.a11y-toggle-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.25;
}
.a11y-toggle-desc {
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-2);
}
.a11y-switch {
  width: 48px;
  height: 28px;
  border-radius: 999px;
  background: #CBD5E1;
  border: none;
  padding: 2px;
  cursor: pointer;
  position: relative;
  flex: none;
  transition: background .2s ease;
  outline: none;
  box-sizing: border-box;
}
[data-theme="dark"] .a11y-switch {
  background: #475569;
}
.a11y-switch[aria-checked="true"] {
  background: var(--brand, #2563EB);
}
.a11y-knob {
  display: block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #FFFFFF;
  box-shadow: 0 1px 3px rgba(0,0,0,0.25);
  transition: transform .2s cubic-bezier(0.4, 0, 0.2, 1);
  transform: translateX(0);
}
.a11y-switch[aria-checked="true"] .a11y-knob {
  transform: translateX(20px);
}

/* Unpriced / Unreported Station Pins on Map */
.pricetag.no-price {
  background: var(--surface);
  color: var(--text-2);
  border: 1.5px dashed var(--line-2);
  opacity: .88;
}
.pricetag.no-price:hover,
.pricetag.no-price.hover-sync {
  opacity: 1;
  border-style: solid;
}
[data-theme="dark"] .pricetag.no-price {
  background: var(--surface-2);
  color: var(--text-2);
  border-color: var(--line-2);
}

/* High Contrast Outlines & Stronger Borders */
[data-contrast="high"] .card.station {
  border: 2px solid var(--line-2);
}
[data-contrast="high"] .pricetag {
  border-width: 2px;
  font-weight: 800;
}
[data-contrast="high"] .badge {
  border-width: 1.5px;
}
[data-contrast="high"] .btn {
  border: 2px solid currentColor;
}
[data-contrast="high"] .input,
[data-contrast="high"] input[type="search"] {
  border-width: 2px;
}
[data-contrast="high"] .a11y-switch {
  border: 2px solid var(--text);
}

/* ---- Floating back-to-top button for long directory & town pages ---- */
.back-to-top-btn {
  position: fixed;
  bottom: 24px;
  right: 20px;
  z-index: 80;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 14px;
  border-radius: 99px;
  background: #0F172A;
  color: #FFFFFF;
  border: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease, background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}
.back-to-top-btn.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.back-to-top-btn:hover {
  background: var(--brand, #2563EB);
  border-color: var(--brand, #2563EB);
}
.back-to-top-btn:active {
  transform: scale(0.95);
}
[data-theme="dark"] .back-to-top-btn {
  background: #1E293B;
  border-color: rgba(255, 255, 255, 0.16);
}
[data-theme="dark"] .back-to-top-btn:hover {
  background: var(--brand, #2563EB);
}
@media (max-width: 600px) {
  .back-to-top-btn {
    bottom: 20px;
    right: 16px;
    height: 38px;
    padding: 0 12px;
    font-size: 12.5px;
  }
}
