/* ============================================================
   Highland Fuels Design System — CSS Tokens
   Source: Brand Guidelines v18-07-23
   ============================================================ */

/* Google Fonts — Exo 2 (substitute for licensed Exo Soft) */
@import url('https://fonts.googleapis.com/css2?family=Exo+2:ital,wght@0,200;0,300;0,400;0,500;0,600;0,700;0,800;1,400&display=swap');

:root {
  /* Brand Red — Pantone 485 */
  --hf-red-100: #e42312;
  --hf-red-75:  #eb5640;
  --hf-red-50:  #f2916e;
  --hf-red-25:  #f8c8ba;
  --hf-red-10:  #fdeeed;

  /* Brand Blue — Pantone 300 */
  --hf-blue-100: #0069b4;
  --hf-blue-75:  #3387c3;
  --hf-blue-50:  #80b4d9;
  --hf-blue-25:  #bfd9ec;
  --hf-blue-10:  #e6f1f8;

  /* Neutrals */
  --hf-white:    #ffffff;
  --hf-grey-50:  #f7f8fa;
  --hf-grey-100: #f0f2f5;
  --hf-grey-200: #e4e7ec;
  --hf-grey-300: #cdd2d9;
  --hf-grey-400: #9ba4b0;
  --hf-grey-500: #6b7585;
  --hf-grey-600: #4a5360;
  --hf-grey-700: #2e3540;
  --hf-grey-900: #111720;

  /* Semantic — Text */
  --color-fg-primary:   var(--hf-grey-900);
  --color-fg-secondary: var(--hf-grey-600);
  --color-fg-tertiary:  var(--hf-grey-400);
  --color-fg-inverse:   var(--hf-white);
  --color-fg-brand:     var(--hf-blue-100);
  --color-fg-danger:    var(--hf-red-100);

  /* Semantic — Backgrounds */
  --color-bg-base:      var(--hf-white);
  --color-bg-subtle:    var(--hf-grey-50);
  --color-bg-muted:     var(--hf-grey-100);
  --color-bg-brand:     var(--hf-blue-100);
  --color-bg-brand-alt: var(--hf-red-100);

  /* Semantic — Borders */
  --color-border-default: var(--hf-grey-200);
  --color-border-strong:  var(--hf-grey-300);
  --color-border-brand:   var(--hf-blue-100);

  /* Semantic — Actions */
  --color-action-primary:         var(--hf-red-100);
  --color-action-primary-hover:   #c41e0f;
  --color-action-secondary:       var(--hf-blue-100);
  --color-action-secondary-hover: #005a9a;

  /* Semantic — Status */
  --color-status-success:    #1a8a4a;
  --color-status-success-bg: #e6f5ed;
  --color-status-danger:     var(--hf-red-100);
  --color-status-danger-bg:  var(--hf-red-10);
  --color-status-info:       var(--hf-blue-100);
  --color-status-info-bg:    var(--hf-blue-10);

  /* Typography */
  --font-sans: 'exo-soft', 'Exo 2', Calibri, 'Segoe UI', sans-serif;

  --text-xs:   0.75rem;
  --text-sm:   0.8125rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;

  --weight-regular:  400;
  --weight-medium:   500;
  --weight-semibold: 600;
  --weight-bold:     700;
  --weight-extrabold: 800;

  --leading-tight:  1.2;
  --leading-snug:   1.35;
  --leading-normal: 1.5;

  --tracking-wide:  0.04em;
  --tracking-wider: 0.08em;

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;

  /* Border Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-xs: 0 1px 2px rgba(17,23,32,0.06);
  --shadow-sm: 0 1px 3px rgba(17,23,32,0.08), 0 1px 2px rgba(17,23,32,0.06);
  --shadow-md: 0 4px 8px rgba(17,23,32,0.08), 0 2px 4px rgba(17,23,32,0.06);
  --shadow-lg: 0 12px 24px rgba(17,23,32,0.10), 0 4px 8px rgba(17,23,32,0.06);
  --shadow-xl: 0 24px 48px rgba(17,23,32,0.12), 0 8px 16px rgba(17,23,32,0.08);

  /* Transitions */
  --transition-fast:   150ms ease;
  --transition-normal: 250ms ease;
}

/* ── Reset ─────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  overflow: hidden;
  font-family: var(--font-sans);
  color: var(--color-fg-primary);
  -webkit-font-smoothing: antialiased;
}

/* ── App layout ─────────────────────────────────── */
#app-container {
  height: calc(100% - 52px);
  margin-top: 52px;
  box-sizing: border-box;
  position: relative;
  display: flex;
}

#app-map {
  flex: 1;
  height: 100%;
  min-width: 0;
}

#app-panel {
  width: 304px;
  height: 100%;
  flex-shrink: 0;
  min-height: 0;
  box-sizing: border-box;
  background: var(--color-bg-base);
  border-right: 1px solid var(--color-border-default);
  border-top: 3px solid var(--hf-red-100);
  padding: var(--space-6) var(--space-4) var(--space-4);
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
  transition: width var(--transition-normal), padding var(--transition-normal);
  z-index: 2;
  scrollbar-width: thin;
  scrollbar-color: var(--hf-grey-300) transparent;
}

#app-panel > * { flex-shrink: 0; }

#app-panel.collapsed {
  width: 0;
  padding: 0;
  overflow: hidden;
  border-right: none;
  border-top: none;
}

/* ── Top bar ────────────────────────────────────── */
#view-toggle {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 52px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  background: var(--color-bg-base);
  border-bottom: 3px solid var(--hf-red-100);
  z-index: 9999;
  padding: 0 var(--space-4);
  box-shadow: var(--shadow-sm);
}

/* ── Logo ────────────────────────────────────────── */
#hf-logo-full,
#hf-logo-small {
  height: 30px;
  width: auto;
  flex-shrink: 0;
  display: block;
  cursor: pointer;
}
#hf-logo-small { display: none; }

@media (max-width: 520px) {
  #hf-logo-full  { display: none; }
  #hf-logo-small { display: block; }
}

/* Map corner logo */
.map-logo-overlay {
  position: absolute;
  bottom: 28px;
  right: 10px;
  height: 38px;
  width: auto;
  z-index: 9000;
  pointer-events: none;
  opacity: 0.9;
  filter: drop-shadow(0 1px 4px rgba(0,0,0,0.15));
}

/* ── View toggle buttons ─────────────────────────── */
.view-btn-group {
  flex: 1;
  display: flex;
  justify-content: center;
  gap: var(--space-2);
}

.view-btn {
  flex: 0 0 auto;
  padding: 7px 22px;
  border: 1.5px solid var(--hf-blue-100);
  border-radius: var(--radius-full);
  background: var(--color-bg-base);
  color: var(--hf-blue-100);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.view-btn:hover {
  background: var(--hf-blue-10);
}

.view-btn.active {
  background: var(--hf-red-100);
  border-color: var(--hf-red-100);
  color: var(--color-fg-inverse);
}

/* ── Network PIN button ──────────────────────────── */
#network-pin-btn {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 1.5px solid var(--hf-blue-100);
  border-radius: var(--radius-full);
  background: var(--color-bg-base);
  color: var(--hf-blue-100);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-2);
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
  white-space: nowrap;
}

#network-pin-btn:hover { background: var(--hf-blue-10); }

#network-pin-btn[data-tooltip] {
  position: relative;
}
#network-pin-btn[data-tooltip]::after {
  content: attr(data-tooltip);
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 230px;
  background: #1a1a2e;
  color: #fff;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.5;
  padding: 8px 10px;
  border-radius: 6px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.15s ease;
  z-index: 9999;
  white-space: normal;
}
#network-pin-btn[data-tooltip]:hover::after {
  opacity: 1;
}

#network-pin-btn.unlocked {
  border-color: var(--color-status-success);
  color: var(--color-status-success);
}
#network-pin-btn.unlocked:hover { background: var(--color-status-success-bg); }

.pin-lock-icon::before            { content: "🔒"; font-size: 12px; }
#network-pin-btn.unlocked .pin-lock-icon::before { content: "🔓"; }

@media (max-width: 600px) {
  .pin-btn-text { display: none; }
  #network-pin-btn { padding: 6px 8px; gap: 0; }
}

/* ── Panel toggle ────────────────────────────────── */
#panel-toggle {
  position: absolute;
  left: 304px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 25;
  width: 28px;
  height: 72px;
  background: var(--color-bg-base);
  border: 1px solid var(--color-border-default);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-size: 20px;
  font-weight: var(--weight-bold);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  padding: 0;
  line-height: 1;
  color: var(--hf-blue-100);
  transition: left var(--transition-normal), background var(--transition-fast);
}

#panel-toggle:hover {
  background: var(--hf-blue-10);
  color: var(--hf-red-100);
}

#app-panel.collapsed + #panel-toggle { left: 0; }

@media (max-width: 600px) {
  #app-panel {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    width: 288px !important;
    z-index: 20;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition-normal);
    padding: var(--space-4);
  }
  #app-panel.collapsed {
    transform: translateX(-288px);
    padding: var(--space-4);
    overflow: hidden;
  }
  #panel-toggle { left: 288px; }
  #app-panel.collapsed + #panel-toggle { left: 0; }
}

/* ── Proxy status ────────────────────────────────── */
.map-proxy-status {
  min-height: 16px;
  margin: -8px 0 -12px;
  font-size: var(--text-xs);
  color: var(--color-fg-tertiary);
}

/* ── Search button ───────────────────────────────── */
#search-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  width: 100%;
  min-height: 44px;
  padding: 0 0 0 4px;
  background: var(--color-bg-base);
  color: var(--hf-blue-100);
  border: 2px solid var(--hf-red-100);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  cursor: pointer;
  overflow: hidden;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast), border-color var(--transition-fast);
}

#search-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-lg);
  border-color: var(--hf-blue-100);
}

#search-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px rgba(0,105,180,0.18), var(--shadow-md);
}

.search-btn-logo-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.search-btn-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.search-btn-label {
  flex: 1;
  text-align: center;
  color: var(--hf-blue-100);
  padding: 0 var(--space-2);
  font-size: clamp(11px, 1.1vw, 15px);
  font-weight: var(--weight-extrabold);
  line-height: 1;
  white-space: nowrap;
}

.search-btn-arrow-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 40px;
  flex-shrink: 0;
  background: var(--hf-red-100);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

#search-btn:hover .search-btn-arrow-wrap { background: var(--hf-blue-100); }

.search-btn-arrow {
  position: relative;
  width: 16px;
  height: 16px;
}

.search-btn-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 2px;
  width: 8px;
  height: 8px;
  border-top: 2.5px solid var(--hf-white);
  border-right: 2.5px solid var(--hf-white);
  background: transparent;
  border-radius: 0;
  transform: translateY(-50%) rotate(45deg);
}

@media (max-width: 600px) {
  #search-btn      { min-height: 40px; padding-left: 3px; }
  .search-btn-logo-wrap  { width: 32px; height: 32px; }
  .search-btn-arrow-wrap { width: 36px; }
}

/* ── Route input groups ──────────────────────────── */
.route-input-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
}

.route-input-group:last-child { margin-bottom: 0; }

.route-input-group label {
  font-size: 10px;
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--hf-blue-100);
}

.route-input-group input,
.route-input-group select {
  width: 100%;
  padding: 9px 14px;
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-fg-primary);
  background: var(--color-bg-base);
  box-sizing: border-box;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  appearance: none;
  -webkit-appearance: none;
}

.autocomplete-wrapper input { padding-right: 42px; }

.route-input-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%230069b4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 32px;
}

.route-input-group input:focus,
.route-input-group select:focus {
  outline: none;
  border-color: var(--hf-blue-100);
  box-shadow: 0 0 0 3px rgba(0,105,180,0.12);
}

/* Autocomplete */
.autocomplete-wrapper { position: relative; }

.location-input-btn {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: var(--hf-blue-100);
  cursor: pointer;
  z-index: 2;
  transition: opacity var(--transition-fast);
  opacity: 0.75;
}

.location-input-btn::before {
  content: "";
  display: block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230069b4' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3Cpath d='M12 2v3'/%3E%3Cpath d='M12 19v3'/%3E%3Cpath d='M2 12h3'/%3E%3Cpath d='M19 12h3'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

.location-input-btn:hover { opacity: 1; }

.autocomplete-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--color-bg-base);
  border: 1.5px solid var(--color-border-default);
  border-top: none;
  border-radius: 0 0 var(--radius-md) var(--radius-md);
  list-style: none;
  margin: 0;
  padding: 0;
  z-index: 100;
  max-height: 180px;
  overflow-y: auto;
  box-shadow: var(--shadow-md);
}

.autocomplete-suggestions:empty { display: none; }

.autocomplete-suggestions li {
  padding: 9px 14px;
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  border-bottom: 1px solid var(--color-border-default);
}

.autocomplete-suggestions li:last-child { border-bottom: none; }

.autocomplete-suggestions li:hover {
  background: var(--hf-blue-10);
  color: var(--hf-blue-100);
}

/* ── Results ─────────────────────────────────────── */
#app-results {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

#search-status {
  font-size: var(--text-xs);
  color: var(--color-fg-tertiary);
  min-height: 18px;
}

.results-empty-state {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  background: var(--color-bg-subtle);
}

.results-empty-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--color-fg-primary);
}

.results-empty-text {
  font-size: var(--text-xs);
  line-height: var(--leading-normal);
  color: var(--color-fg-secondary);
}

.results-empty-action {
  align-self: flex-start;
  padding: 6px 14px;
  border: 1.5px solid var(--hf-blue-100);
  border-radius: var(--radius-full);
  background: var(--color-bg-base);
  color: var(--hf-blue-100);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast);
}

.results-empty-action:hover {
  background: var(--hf-blue-100);
  color: var(--color-fg-inverse);
}

.results-action-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-1);
}

.results-new-search-btn,
.results-download-btn {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: 6px 14px 6px 10px;
  border: 1.5px solid var(--color-border-strong);
  border-radius: var(--radius-full);
  background: var(--color-bg-base);
  color: var(--color-fg-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast), color var(--transition-fast), border-color var(--transition-fast);
}

.results-new-search-btn::before { content: "←"; font-size: 13px; }
.results-download-btn::before   { content: "↓"; font-size: 13px; }

.results-new-search-btn:hover,
.results-download-btn:hover:not(:disabled) {
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
  background: var(--hf-blue-10);
}

.results-download-btn:disabled { opacity: 0.4; cursor: not-allowed; }

#back-to-top-btn {
  position: fixed;
  bottom: 18px;
  left: 18px;
  padding: 8px 18px;
  border: 1.5px solid var(--hf-blue-100);
  border-radius: var(--radius-full);
  background: var(--color-bg-base);
  color: var(--hf-blue-100);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  box-shadow: var(--shadow-md);
  cursor: pointer;
  z-index: 50;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal), background var(--transition-fast);
}

#back-to-top-btn.visible {
  opacity: 1;
  pointer-events: auto;
}

#back-to-top-btn:hover { background: var(--hf-blue-10); }

@media (max-width: 600px) {
  #back-to-top-btn { left: 8px; bottom: 10px; }
}

/* Route result items */
.route-result-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 10px 12px;
  background: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.route-result-header {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.route-result-distance {
  margin-top: var(--space-1);
  color: var(--color-fg-secondary);
  font-size: var(--text-xs);
  font-weight: var(--weight-semibold);
}

.route-result-hours { color: var(--hf-grey-600); font-weight: var(--weight-medium); }
.route-result-meta  { color: var(--hf-grey-500); font-weight: var(--weight-semibold); }

.route-result-item:hover {
  background: var(--hf-blue-10);
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
}

.route-result-item.active {
  background: var(--hf-blue-10);
  border-color: var(--hf-blue-100);
  box-shadow: 0 0 0 1px rgba(0,105,180,0.1);
}

/* ── Filter panels ───────────────────────────────── */
.filter-panel {
  margin-bottom: var(--space-1);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  overflow: hidden;
}

#app-card-panel { margin-top: var(--space-3); }

.filter-dropdown-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 9px 12px;
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  cursor: pointer;
  background: var(--color-bg-subtle);
  color: var(--color-fg-primary);
  user-select: none;
  border-left: 3px solid var(--hf-red-100);
  transition: background var(--transition-fast), border-color var(--transition-fast);
}

.filter-dropdown-header.open   { border-left-color: var(--hf-blue-100); }
.filter-dropdown-header:hover  { background: var(--hf-blue-10); }

.filter-arrow {
  font-size: 11px;
  color: var(--hf-red-100);
  transition: transform var(--transition-normal), color var(--transition-fast);
}

.filter-dropdown-header.open .filter-arrow {
  color: var(--hf-blue-100);
  transform: rotate(180deg);
}

.filter-header-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  max-width: 120px;
  margin-left: auto;
  margin-right: var(--space-2);
  padding: 0 6px;
  border-radius: var(--radius-full);
  background: var(--hf-blue-100);
  color: var(--color-fg-inverse);
  font-size: 11px;
  font-weight: var(--weight-bold);
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.filter-dropdown-body {
  padding: var(--space-2);
  background: var(--color-bg-base);
}

.filter-dropdown-body.hidden { display: none; }

#app-panel .filter-card-img   { height: 56px; }
#app-panel .filter-dropdown-body { max-height: none; overflow-y: visible; }

.filter-placeholder {
  padding: var(--space-1) var(--space-1);
  font-size: var(--text-xs);
  color: var(--color-fg-tertiary);
  font-style: italic;
}

.filter-diesel-note {
  padding: var(--space-1) var(--space-2) var(--space-2);
  font-size: var(--text-xs);
  color: var(--color-fg-secondary);
  font-style: italic;
  border-bottom: 1px solid var(--color-border-default);
  margin-bottom: var(--space-2);
}

/* Filter buttons */
.filter-item button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 12px;
  margin-bottom: var(--space-1);
  background: var(--color-bg-subtle);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  color: var(--color-fg-primary);
  cursor: pointer;
  text-align: left;
  box-sizing: border-box;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.filter-option-label {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 0;
}

.filter-option-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: currentColor;
  flex-shrink: 0;
}

.filter-option-icon svg { width: 14px; height: 14px; }

.filter-item button:hover {
  background: var(--hf-blue-10);
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
}

.filter-item.active button {
  background: var(--hf-blue-10);
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
  font-weight: var(--weight-semibold);
}

/* Facilities grid */
#app-facilities-panel .filter-dropdown-body,
#app-keyfuels-facilities-panel .filter-dropdown-body {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-2);
}

#app-facilities-panel .filter-item button,
#app-keyfuels-facilities-panel .filter-item button {
  justify-content: center;
  margin-bottom: 0;
  min-height: 40px;
  padding: 7px 10px;
}

#app-facilities-panel .filter-item button:hover,
#app-keyfuels-facilities-panel .filter-item button:hover {
  background: var(--hf-red-10);
  border-color: var(--hf-red-100);
  color: var(--hf-red-100);
}

#app-facilities-panel .filter-item.active button,
#app-keyfuels-facilities-panel .filter-item.active button {
  background: var(--hf-blue-10);
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
}

#app-facilities-panel .filter-option-label,
#app-keyfuels-facilities-panel .filter-option-label {
  justify-content: center;
  gap: var(--space-2);
  width: 100%;
  text-align: center;
}

#app-facilities-panel .filter-check,
#app-keyfuels-facilities-panel .filter-check { display: none !important; }

#app-facilities-panel .filter-option-label span:last-child,
#app-keyfuels-facilities-panel .filter-option-label span:last-child { line-height: 1.15; }

#app-card-panel .filter-check { display: none !important; }

/* Card filter buttons — bank card corner radius */
#app-card-panel .filter-item button {
  border-radius: var(--radius-md);
}

#app-card-panel .filter-item button:hover {
  background: var(--hf-red-10);
  border-color: var(--hf-red-100);
  color: var(--hf-red-100);
}

#app-card-panel .filter-item.active button {
  background: var(--hf-blue-10);
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
}

.filter-check { display: none !important; }

@media (max-width: 420px) {
  #app-facilities-panel .filter-dropdown-body,
  #app-keyfuels-facilities-panel .filter-dropdown-body { grid-template-columns: 1fr; }
}

/* ── Misc filter components ──────────────────────── */
.band-swatch {
  display: inline-block;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  margin-right: var(--space-2);
  flex-shrink: 0;
}

.filter-card-img {
  height: 84px;
  width: auto;
  object-fit: contain;
  margin-left: auto;
  margin-right: var(--space-2);
}

/* ── Route mode divider ──────────────────────────── */
.route-zoom-divider {
  border-bottom: 1px solid var(--color-border-default);
  width: 80%;
}

/* ── Animations ──────────────────────────────────── */
.hidden { display: none !important; }

@keyframes viewFadeOut { from { opacity: 1; } to { opacity: 0; } }
@keyframes viewFadeIn  { from { opacity: 0; } to { opacity: 1; } }

.view-fade-out { animation: viewFadeOut 0.2s ease forwards; }
.view-fade-in  { animation: viewFadeIn  0.25s ease forwards; }

/* ── Route mode toggle ───────────────────────────── */
#route-mode-toggle {
  display: flex;
  gap: var(--space-2);
  padding-bottom: var(--space-1);
}

.route-mode-btn {
  flex: 1;
  padding: 7px 10px;
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-full);
  background: var(--color-bg-base);
  color: var(--color-fg-primary);
  font-size: var(--text-sm);
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.route-mode-btn.active {
  background: var(--hf-blue-100);
  border-color: var(--hf-blue-100);
  color: var(--color-fg-inverse);
}

.route-mode-btn:not(.active):hover {
  border-color: var(--hf-blue-100);
  color: var(--hf-blue-100);
}

/* ── Map zoom controls ───────────────────────────── */
.maplibregl-ctrl-top-right,
.mapboxgl-ctrl-top-right {
  top: 50% !important;
  transform: translateY(-50%) !important;
  margin-right: 10px !important;
  padding: 0 !important;
}

.maplibregl-ctrl-group,
.mapboxgl-ctrl-group {
  box-shadow: var(--shadow-md) !important;
  border-radius: var(--radius-md) !important;
  overflow: hidden;
  border: 1px solid var(--color-border-default);
  background: var(--color-bg-base) !important;
}

.maplibregl-ctrl-group > button,
.mapboxgl-ctrl-group > button {
  width: 40px !important;
  height: 40px !important;
  border-bottom: 1px solid var(--color-border-default) !important;
  transition: background var(--transition-fast) !important;
}

.maplibregl-ctrl-group > button:last-child,
.mapboxgl-ctrl-group > button:last-child { border-bottom: none !important; }

.maplibregl-ctrl-group > button:hover,
.mapboxgl-ctrl-group > button:hover { background-color: var(--hf-blue-10) !important; }

.maplibregl-ctrl-zoom-in .maplibregl-ctrl-icon,
.mapboxgl-ctrl-zoom-in .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%230069b4' d='M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z'/%3E%3C/svg%3E") !important;
  background-size: 20px 20px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.maplibregl-ctrl-zoom-out .maplibregl-ctrl-icon,
.mapboxgl-ctrl-zoom-out .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23e42312' d='M19 13H5v-2h14v2z'/%3E%3C/svg%3E") !important;
  background-size: 20px 20px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

.maplibregl-ctrl-compass .maplibregl-ctrl-icon,
.mapboxgl-ctrl-compass .mapboxgl-ctrl-icon {
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23e42312' d='M12 2L8.5 12.5L12 11.5L12 2Z'/%3E%3Cpath fill='%230069b4' d='M12 22L15.5 12.5L12 11.5L12 22Z'/%3E%3C/svg%3E") !important;
  background-size: 20px 20px !important;
  background-position: center !important;
  background-repeat: no-repeat !important;
}

/* ── Info window close button ────────────────────── */
.infoBox img[align="right"] { width: 28px !important; height: 28px !important; margin: 6px !important; }

.mapboxgl-popup-close-button,
.maplibregl-popup-close-button {
  top: 4px !important;
  right: 4px !important;
  width: 34px !important;
  height: 34px !important;
  padding: 0 !important;
  font-size: 28px !important;
  line-height: 34px !important;
  color: var(--hf-blue-100) !important;
}

.mapboxgl-popup-content > button,
.maplibregl-popup-content > button,
.mapboxgl-popup-content button[aria-label="Close popup"],
.maplibregl-popup-content button[aria-label="Close popup"] {
  top: 2px !important;
  right: 2px !important;
  width: 40px !important;
  height: 40px !important;
  padding: 0 !important;
  font-size: 32px !important;
  line-height: 40px !important;
  color: var(--hf-blue-100) !important;
}

.mapboxgl-popup-close-button:hover,
.maplibregl-popup-close-button:hover,
.mapboxgl-popup-content > button:hover,
.maplibregl-popup-content button[aria-label="Close popup"]:hover {
  color: var(--hf-red-100) !important;
  background: var(--hf-blue-10) !important;
}

/* ── Info window content ─────────────────────────── */
.iw-content {
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  min-width: 224px;
  max-width: 288px;
  line-height: var(--leading-normal);
  padding: 2px 2px 0;
}

.iw-header {
  margin-bottom: var(--space-3);
  padding-bottom: var(--space-2);
  border-bottom: 1px solid var(--color-border-default);
}

.iw-body {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.iw-title {
  font-size: 15px;
  font-weight: var(--weight-extrabold);
  color: var(--color-fg-primary);
  margin-bottom: var(--space-1);
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.iw-swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}

.iw-address {
  color: var(--color-fg-secondary);
  font-size: var(--text-xs);
}

.iw-row {
  display: flex;
  align-items: flex-start;
  gap: var(--space-2);
  color: var(--hf-grey-700);
}

.iw-label {
  font-weight: var(--weight-bold);
  color: var(--color-fg-tertiary);
  min-width: 46px;
  flex-shrink: 0;
}

.iw-value { color: var(--hf-grey-700); }

.iw-row a {
  color: var(--hf-blue-100);
  text-decoration: none;
}
.iw-row a:hover { text-decoration: underline; }

/* Hours */
.iw-hours-details { margin: 0 0 var(--space-2); }

.iw-hours-summary {
  color: var(--hf-blue-100);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  cursor: pointer;
  list-style: none;
}
.iw-hours-summary::-webkit-details-marker { display: none; }

.iw-hours-list {
  margin-top: var(--space-2);
  padding-top: var(--space-2);
  border-top: 1px solid var(--color-border-default);
}

.iw-hours-row {
  display: flex;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--text-xs);
  color: var(--color-fg-secondary);
  padding: 1px 0;
}

.iw-hours-day { font-weight: var(--weight-bold); color: var(--color-fg-primary); }

/* Directions button */
.iw-directions-btn {
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 44px;
  margin-top: var(--space-5);
  padding: 0 0 0 4px;
  background: var(--color-bg-base) !important;
  color: var(--hf-blue-100) !important;
  border: 2px solid var(--hf-red-100);
  border-radius: var(--radius-full);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  letter-spacing: 0.01em;
  text-align: left;
  text-decoration: none !important;
  cursor: pointer;
  box-sizing: border-box;
  overflow: hidden;
  transition: box-shadow var(--transition-fast), border-color var(--transition-fast), transform var(--transition-fast);
}

.iw-directions-btn:hover {
  border-color: var(--hf-blue-100);
  box-shadow: var(--shadow-lg);
  transform: translateY(-1px);
}

.iw-directions-label {
  display: block;
  flex: 1;
  color: var(--hf-blue-100);
  text-align: center;
  font-size: var(--text-sm);
  font-weight: var(--weight-extrabold);
}

.iw-directions-logo-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
}

.iw-directions-logo { width: 34px; height: 34px; object-fit: contain; }

.iw-directions-arrow-wrap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: stretch;
  width: 40px;
  flex-shrink: 0;
  background: var(--hf-red-100);
  border-radius: var(--radius-full);
  transition: background var(--transition-fast);
}

.iw-directions-btn:hover .iw-directions-arrow-wrap { background: var(--hf-blue-100); }

.iw-directions-arrow {
  position: relative;
  width: 14px;
  height: 14px;
}

.iw-directions-arrow::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 1px;
  width: 7px;
  height: 7px;
  border-top: 2.5px solid var(--hf-white);
  border-right: 2.5px solid var(--hf-white);
  transform: translateY(-50%) rotate(45deg);
}

/* Amenity tags */
.iw-amenities {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-top: var(--space-2);
  margin-bottom: var(--space-3);
}

.amenity-tag {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  background: var(--hf-blue-10);
  color: var(--hf-blue-100);
  border: 1px solid var(--hf-blue-25);
  border-radius: var(--radius-lg);
  padding: 2px 8px;
  font-size: 11px;
  font-weight: var(--weight-semibold);
  white-space: nowrap;
  line-height: 1.6;
}

.map-store-detail { max-width: none; min-width: 0; padding: 12px; }

/* ── PIN modal ───────────────────────────────────── */
#pin-modal {
  position: fixed;
  inset: 0;
  background: rgba(17,23,32,0.5);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pin-modal-box {
  background: var(--color-bg-base);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  padding: var(--space-8) var(--space-8) var(--space-6);
  width: 320px;
  max-width: calc(100vw - 32px);
  position: relative;
  border-top: 3px solid var(--hf-red-100);
}

.pin-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--color-fg-tertiary);
  line-height: 1;
  padding: 4px 6px;
  border-radius: var(--radius-sm);
  transition: color var(--transition-fast), background var(--transition-fast);
}

.pin-modal-close:hover {
  color: var(--color-fg-primary);
  background: var(--color-bg-muted);
}

.pin-modal-title {
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  color: var(--color-fg-primary);
  margin-bottom: var(--space-4);
  padding-right: var(--space-6);
}

.pin-modal-desc {
  font-size: var(--text-sm);
  color: var(--color-fg-secondary);
  margin: 0 0 var(--space-4);
  line-height: var(--leading-normal);
}

#pin-input {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  font-size: 15px;
  font-family: var(--font-sans);
  box-sizing: border-box;
  margin-bottom: var(--space-2);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  letter-spacing: 0.12em;
}

#pin-input:focus {
  outline: none;
  border-color: var(--hf-blue-100);
  box-shadow: 0 0 0 3px rgba(0,105,180,0.12);
}

.pin-error {
  font-size: var(--text-xs);
  color: var(--hf-red-100);
  margin: 0 0 var(--space-3);
}

.pin-submit-btn {
  width: 100%;
  padding: 11px;
  background: var(--hf-red-100);
  color: var(--color-fg-inverse);
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast);
  letter-spacing: 0.02em;
}

.pin-submit-btn:hover { background: var(--color-action-primary-hover); }

.pin-unlocked-msg {
  color: var(--color-status-success);
  font-weight: var(--weight-semibold);
}

.pin-remove-btn {
  width: 100%;
  padding: 10px;
  background: var(--color-bg-subtle);
  color: var(--color-fg-secondary);
  border: 1.5px solid var(--color-border-default);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: var(--weight-semibold);
  font-family: var(--font-sans);
  cursor: pointer;
  transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.pin-remove-btn:hover {
  background: var(--hf-red-10);
  border-color: var(--hf-red-100);
  color: var(--hf-red-100);
}
