:root {
  color-scheme: light dark;

  --target-size: 24px;

  --bg-light: #f4f7f6;
  --bg-dark: #091312;
  --surface-light: rgba(255, 255, 255, 0.94);
  --surface-dark: rgba(17, 28, 27, 0.94);
  --surface-solid-light: #ffffff;
  --surface-solid-dark: #111c1b;
  --surface-muted-light: #e8efed;
  --surface-muted-dark: #1b2c2a;
  --text-light: #0f1f1d;
  --text-dark: #eaf4f2;
  --text-muted-light: #4a615d;
  --text-muted-dark: #9cb5b0;
  --border-light: rgba(15, 31, 29, 0.14);
  --border-dark: rgba(234, 244, 242, 0.16);

  --brand-light: #0f766e;
  --brand-dark: #2dd4bf;
  --brand-text-light: #ffffff;
  --brand-text-dark: #052e2b;

  --low-light: #15803d;
  --low-dark: #22c55e;
  --mid-light: #b45309;
  --mid-dark: #f59e0b;
  --high-light: #b91c1c;
  --high-dark: #f87171;

  --error-light: #b91c1c;
  --error-dark: #fca5a5;
  --error-bg-light: #fef2f2;
  --error-bg-dark: rgba(185, 28, 28, 0.22);

  --bg: var(--bg-light);
  --surface: var(--surface-light);
  --surface-solid: var(--surface-solid-light);
  --surface-muted: var(--surface-muted-light);
  --text: var(--text-light);
  --text-muted: var(--text-muted-light);
  --border: var(--border-light);
  --brand: var(--brand-light);
  --brand-text: var(--brand-text-light);
  --tier-low: var(--low-light);
  --tier-mid: var(--mid-light);
  --tier-high: var(--high-light);
  --error: var(--error-light);
  --error-bg: var(--error-bg-light);
  --pin-halo-light: rgba(244, 247, 246, 0.94);
  --pin-halo-dark: rgba(9, 19, 18, 0.92);
  --pin-halo: var(--pin-halo-light);
  --shadow-light: 0 10px 28px rgba(0, 0, 0, 0.16);
  --shadow-dark: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow: var(--shadow-light);

  color-scheme: light dark;

  &:has(> head > meta[name="color-scheme"][content="dark"]) {
    color-scheme: dark;
    --shadow: var(--shadow-dark);
  }

  &:has(> head > meta[name="color-scheme"][content="light"]) {
    color-scheme: light;
    --shadow: var(--shadow-light);
  }

  @media (prefers-color-scheme: dark) {
    &:not(:has(> head > meta[name="color-scheme"][content="light"])) {
      --shadow: var(--shadow-dark);
    }
  }

  @supports not (color: light-dark(white, black)) {
    @media (prefers-color-scheme: dark) {
      --bg: var(--bg-dark);
      --surface: var(--surface-dark);
      --surface-solid: var(--surface-solid-dark);
      --surface-muted: var(--surface-muted-dark);
      --text: var(--text-dark);
      --text-muted: var(--text-muted-dark);
      --border: var(--border-dark);
      --brand: var(--brand-dark);
      --brand-text: var(--brand-text-dark);
      --tier-low: var(--low-dark);
      --tier-mid: var(--mid-dark);
      --tier-high: var(--high-dark);
      --error: var(--error-dark);
      --error-bg: var(--error-bg-dark);
      --pin-halo: var(--pin-halo-dark);
    }

    &:has(> head > meta[name="color-scheme"][content="dark"]) {
      --bg: var(--bg-dark);
      --surface: var(--surface-dark);
      --surface-solid: var(--surface-solid-dark);
      --surface-muted: var(--surface-muted-dark);
      --text: var(--text-dark);
      --text-muted: var(--text-muted-dark);
      --border: var(--border-dark);
      --brand: var(--brand-dark);
      --brand-text: var(--brand-text-dark);
      --tier-low: var(--low-dark);
      --tier-mid: var(--mid-dark);
      --tier-high: var(--high-dark);
      --error: var(--error-dark);
      --error-bg: var(--error-bg-dark);
      --pin-halo: var(--pin-halo-dark);
    }

    &:has(> head > meta[name="color-scheme"][content="light"]) {
      --bg: var(--bg-light);
      --surface: var(--surface-light);
      --surface-solid: var(--surface-solid-light);
      --surface-muted: var(--surface-muted-light);
      --text: var(--text-light);
      --text-muted: var(--text-muted-light);
      --border: var(--border-light);
      --brand: var(--brand-light);
      --brand-text: var(--brand-text-light);
      --tier-low: var(--low-light);
      --tier-mid: var(--mid-light);
      --tier-high: var(--high-light);
      --error: var(--error-light);
      --error-bg: var(--error-bg-light);
      --pin-halo: var(--pin-halo-light);
    }
  }

  @supports (color: light-dark(white, black)) {
    --bg: light-dark(var(--bg-light), var(--bg-dark));
    --surface: light-dark(var(--surface-light), var(--surface-dark));
    --surface-solid: light-dark(var(--surface-solid-light), var(--surface-solid-dark));
    --surface-muted: light-dark(var(--surface-muted-light), var(--surface-muted-dark));
    --text: light-dark(var(--text-light), var(--text-dark));
    --text-muted: light-dark(var(--text-muted-light), var(--text-muted-dark));
    --border: light-dark(var(--border-light), var(--border-dark));
    --brand: light-dark(var(--brand-light), var(--brand-dark));
    --brand-text: light-dark(var(--brand-text-light), var(--brand-text-dark));
    --tier-low: light-dark(var(--low-light), var(--low-dark));
    --tier-mid: light-dark(var(--mid-light), var(--mid-dark));
    --tier-high: light-dark(var(--high-light), var(--high-dark));
    --error: light-dark(var(--error-light), var(--error-dark));
    --error-bg: light-dark(var(--error-bg-light), var(--error-bg-dark));
    --pin-halo: light-dark(var(--pin-halo-light), var(--pin-halo-dark));
  }

  accent-color: var(--brand);
}

@media (pointer: coarse) {
  :root {
    --target-size: 44px;
  }
}

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

html,
body {
  margin: 0;
  padding: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  line-height: 1.4;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}

h1, h2, h3 {
  text-wrap: balance;
  margin: 0;
}

p, li {
  text-wrap: pretty;
}

:where(button, select, textarea, input:not([type="checkbox"], [type="radio"]), [role="button"], a) {
  min-block-size: var(--target-size);
  min-inline-size: var(--target-size);
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
a:focus-visible {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

.svg-sprite {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  pointer-events: none;
}

.visually-hidden:where(:not(:focus-within, :active)) {
  position: absolute !important;
  clip-path: inset(50%) !important;
  overflow: hidden !important;
  width: 1px !important;
  height: 1px !important;
  margin: -1px !important;
  padding: 0 !important;
  border: 0 !important;
  white-space: nowrap !important;
}

/* Full-Viewport Shell */
.app-shell {
  position: relative;
  width: 100dvw;
  height: 100dvh;
  overflow: hidden;
}

/* Startup GPS & Map Loading Overlay */
@property --arc-start {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --arc-end {
  syntax: "<angle>";
  inherits: false;
  initial-value: 0deg;
}

@property --progress-dash-animation {
  syntax: "*";
  inherits: false;
  initial-value: , progress-dash 2.6s ease-in-out infinite;
}

.startup-loader {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 1.5rem;
  background: var(--bg);
  color: var(--text);
  transition: opacity 220ms ease-out;
}

.startup-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .startup-loader {
    transition: none;
  }
}

.startup-loader-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0.9rem;
  width: min(100%, 21rem);
  max-width: 21rem;
}

.startup-loader-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
}

.brand-badge.is-large {
  width: 2.5rem;
  height: 2.5rem;
  font-size: 1.3rem;
}

.startup-title {
  margin: 0;
  font-size: 1.35rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.startup-gps-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.35rem 0.8rem;
  border-radius: 999px;
  background: var(--surface-muted);
  border: 1px solid var(--border);
  max-width: 100%;
}

.startup-status {
  margin: 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-muted);
}

.startup-status.is-ready {
  color: var(--tier-low);
}

.startup-name-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  text-align: left;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 1.15rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}

.startup-continue-btn {
  width: 100%;
  min-block-size: 48px;
}

.startup-skip-btn {
  margin-top: 0.1rem;
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

progress.loading-spinner:indeterminate::-webkit-progress-bar {
  display: none;
  background: none;
}

progress.loading-spinner:indeterminate::-webkit-progress-value {
  display: none;
  background: none;
}

progress.loading-spinner:indeterminate::-moz-progress-bar {
  display: none;
  background: none;
}

progress.loading-spinner:indeterminate::slider-fill {
  display: none;
  background: none;
}

progress.loading-spinner:indeterminate {
  --_from: calc(90deg + var(--arc-start, 0deg));
  --_to: calc(90deg + var(--arc-end, 158deg));
  --size: 40px;
  --thickness: 3.5px;
  --spinner-color: var(--brand);
  --track-color: var(--surface-muted);
  --spinner-duration: 1.25s;
  --_used-spinner-duration: var(--spinner-duration);

  position: relative;
  width: var(--size);
  height: var(--size);
  border-radius: 50%;
  appearance: none;
  background: conic-gradient(
      from var(--_from),
      var(--spinner-color) calc(var(--_to) - var(--_from)),
      transparent 0
    )
    var(--track-color);
  animation:
    progress-spin var(--_used-spinner-duration) linear infinite
    var(--progress-dash-animation, );

  @supports (background-clip: border-area) {
    background-clip: border-area;
    border: var(--thickness) solid transparent;
    background-origin: border-box;
  }

  @supports not (background-clip: border-area) {
    -webkit-mask-image: radial-gradient(
      closest-side,
      transparent calc(100% - var(--thickness)),
      #000 calc(100% - var(--thickness) + 1px)
    );
    mask-image: radial-gradient(
      closest-side,
      transparent calc(100% - var(--thickness)),
      #000 calc(100% - var(--thickness) + 1px)
    );
    border: 0;
  }

  @media (forced-colors: active) {
    forced-color-adjust: none;
    --spinner-color: CanvasText;
    --track-color: Canvas;
  }
}

progress.loading-spinner.is-compact:indeterminate {
  --size: 18px;
  --thickness: 2.5px;
  flex: 0 0 auto;
}

@media (prefers-reduced-motion: reduce) {
  progress.loading-spinner:indeterminate {
    --_used-spinner-duration: 6s;
    --progress-dash-animation: ;
    --arc-end: 158deg;
  }
}

@keyframes progress-spin {
  to {
    rotate: 1turn;
  }
}

@keyframes progress-dash {
  from {
    --arc-start: 0deg;
    --arc-end: 12deg;
  }
  50% {
    --arc-start: 100deg;
    --arc-end: 348deg;
  }
  to {
    --arc-start: 360deg;
    --arc-end: 372deg;
  }
}

.map-stage,
.map-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* Top Floating HUD */
.top-hud {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  pointer-events: none;
}

.top-hud > * {
  pointer-events: auto;
}

.hud-top-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
}

:where(.hud-top-row > :not(button, input, select, textarea, a, [role="button"], label)) {
  min-inline-size: 0;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.35rem 0.75rem 0.35rem 0.4rem;
  box-shadow: var(--shadow);
}

.brand-badge {
  display: inline-grid;
  place-items: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 800;
  font-size: 0.95rem;
}

.brand-title {
  font-weight: 750;
  font-size: 0.92rem;
  letter-spacing: -0.01em;
}

@media (max-width: 400px) {
  .brand-title {
    display: none;
  }
  .brand-mark {
    padding: 0.3rem;
  }
}

.place-search {
  position: relative;
  flex: 1 1 6.5rem;
  min-inline-size: 0;
}

.place-search form {
  display: flex;
  align-items: center;
  background: var(--surface);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding-inline: 0.75rem 0.25rem;
  box-shadow: var(--shadow);
}

.place-search input[type="search"] {
  flex: 1 1 auto;
  min-inline-size: 0;
  border: 0;
  background: transparent;
  padding: 0.45rem 0.25rem;
  font-size: max(1rem, 0.95rem);
  outline: none;
}

.icon-btn {
  display: inline-grid;
  place-items: center;
  border: 0;
  background: transparent;
  border-radius: 999px;
  padding: 0.4rem;
  cursor: pointer;
}

.hud-icon-btn {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  min-block-size: 44px;
  min-inline-size: 44px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  color: var(--text);
  box-shadow: var(--shadow);
  cursor: pointer;
}

@media (hover: hover) {
  .hud-icon-btn:hover {
    background: var(--surface-solid);
  }
}

.hud-actions-panel {
  display: none;
  padding: 0.35rem;
  min-inline-size: 12.25rem;
  max-inline-size: calc(100dvw - 1.5rem);
  border: 1px solid var(--border);
  border-radius: 1rem;
  background: var(--surface-solid);
  color: var(--text);
  box-shadow: var(--shadow);
  overflow: visible;
}

.hud-actions-panel:is(:popover-open, .\:popover-open) {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

@supports (position-area: block-end) {
  .hud-actions-panel {
    inset: auto;
    margin: 0.45rem 0 0 0;
    position-area: block-end span-inline-start;
    position-try-fallbacks: flip-block, flip-inline, flip-block flip-inline;
  }
}

@supports not (position-area: block-end) {
  .hud-actions-panel {
    position: fixed;
    inset: auto;
    top: max(4rem, calc(env(safe-area-inset-top, 0px) + 3.45rem));
    right: max(0.75rem, env(safe-area-inset-right, 0px));
    margin: 0;
  }
}

.hud-panel-item {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  width: 100%;
  min-block-size: 44px;
  padding: 0.5rem 0.75rem;
  border: 0;
  border-radius: 0.72rem;
  background: transparent;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 650;
  text-align: left;
  cursor: pointer;
}

.hud-panel-item svg {
  flex: 0 0 auto;
  color: var(--brand);
}

@media (hover: hover) {
  .hud-panel-item:hover {
    background: var(--surface-muted);
  }
}

.hud-panel-item:active {
  background: var(--surface-muted);
}

.theme-toggle-btn .theme-opt.is-to-light {
  display: none;
}

.theme-toggle-btn .theme-opt.is-to-dark {
  display: block;
}

@media (prefers-color-scheme: dark) {
  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-toggle-btn .theme-opt.is-to-light {
    display: block;
  }

  :root:not(:has(> head > meta[name="color-scheme"][content="light"])) .theme-toggle-btn .theme-opt.is-to-dark {
    display: none;
  }
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle-btn .theme-opt.is-to-light {
  display: block;
}

:root:has(> head > meta[name="color-scheme"][content="dark"]) .theme-toggle-btn .theme-opt.is-to-dark {
  display: none;
}

.search-results {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  margin: 0;
  padding: 0.35rem;
  list-style: none;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 1rem;
  box-shadow: var(--shadow);
  max-block-size: 42dvh;
  overflow-y: auto;
  z-index: 30;
}

.search-results button {
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0.65rem 0.75rem;
  border-radius: 0.65rem;
  cursor: pointer;
  font-size: 0.92rem;
}

.search-results button:hover,
.search-results button:active {
  background: var(--surface-muted);
}

.install-btn {
  border: 0;
  border-radius: 999px;
  padding: 0.5rem 0.9rem;
  background: var(--brand);
  color: var(--brand-text);
  font-weight: 700;
  font-size: 0.875rem;
  cursor: pointer;
  box-shadow: var(--shadow);
}

@media (max-width: 420px) {
  .install-btn {
    padding: 0.45rem 0.72rem;
    font-size: 0.82rem;
  }
}

.context-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem 0.6rem;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-color: color-mix(in srgb, var(--brand) 42%, var(--border));
  border-radius: 0.9rem;
  padding: 0.45rem 0.7rem;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  line-height: 1.3;
}

.context-banner-text {
  margin: 0;
  flex: 1 1 13rem;
}

.context-banner-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
}

.mini-btn {
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text);
  padding: 0.35rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 650;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.mini-btn[aria-disabled="true"] {
  opacity: 0.65;
  cursor: progress;
}

.mini-btn.is-ghost {
  background: transparent;
  border-color: transparent;
}

.mini-btn.is-brand {
  background: var(--brand);
  color: var(--brand-text);
  border-color: transparent;
}

.mini-btn.is-clear {
  background: var(--error-bg);
  color: var(--error);
  border-color: color-mix(in srgb, var(--error) 28%, transparent);
}

.mini-btn:disabled {
  opacity: 0.45;
  cursor: default;
}

/* Crosshair Picker */
.crosshair-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 18;
}

.crosshair-overlay[hidden] {
  display: none;
}

.crosshair-pin {
  width: 24px;
  height: 24px;
  border-radius: 999px 999px 999px 0;
  transform: rotate(-45deg) translate(8px, -8px);
  background: var(--brand);
  border: 3px solid #ffffff;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.35);
}

.crosshair-shadow {
  position: absolute;
  width: 10px;
  height: 4px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  transform: translateY(10px);
}

.pin-picker-bar {
  position: fixed;
  left: max(0.75rem, env(safe-area-inset-left, 0px));
  right: max(0.75rem, env(safe-area-inset-right, 0px));
  bottom: max(5.2rem, calc(env(safe-area-inset-bottom, 0px) + 4.75rem));
  z-index: 22;
  background: var(--surface-solid);
  border: 1px solid var(--border);
  border-radius: 1.1rem;
  padding: 0.85rem;
  box-shadow: var(--shadow);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
}

.pin-picker-bar[hidden] {
  display: none;
}

.pin-picker-prompt {
  margin: 0;
  font-weight: 650;
  font-size: 0.92rem;
}

.pin-picker-actions {
  display: flex;
  gap: 0.5rem;
}

/* Bottom Thumb-Zone Dock */
.bottom-dock {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.45rem;
  padding-bottom: max(0.75rem, env(safe-area-inset-bottom, 0px));
  padding-left: max(0.75rem, env(safe-area-inset-left, 0px));
  padding-right: max(0.75rem, env(safe-area-inset-right, 0px));
  pointer-events: none;
}

@media (max-width: 350px) {
  .bottom-dock {
    flex-wrap: wrap;
  }
}

.bottom-dock > * {
  pointer-events: auto;
}

.dock-left,
.dock-right {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.dock-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-block-size: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  backdrop-filter: blur(12px);
  padding: 0.5rem 0.9rem;
  font-weight: 650;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  cursor: pointer;
  white-space: nowrap;
}

.fab-btn {
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
  cursor: pointer;
}

.fab-btn.is-primary {
  background: var(--brand);
  color: var(--brand-text);
  border-color: transparent;
}

/* Map Pins (POI Circular Fuel-Pump Icon + Haloed Name Below) */
.station-marker {
  width: 0;
  height: 0;
  overflow: visible;
}

.station-pin {
  --pin-bg: var(--surface-solid);
  --pin-border: color-mix(in oklab, var(--text) 24%, transparent);
  position: absolute;
  left: 0;
  top: 0;
  transform: translate(-50%, -33px);
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: 0;
  padding: 0;
  margin: 0;
  cursor: pointer;
  min-inline-size: 30px;
  min-block-size: 30px;
  color: var(--text);
}

@media (pointer: coarse) {
  .station-pin::after {
    content: "";
    position: absolute;
    inset: -6px -8px;
  }
}

.station-pin-head {
  position: relative;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--pin-bg);
  border: 1.5px solid var(--pin-border);
  color: var(--brand);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.32);
}

.station-pin-head::before {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -6px;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid var(--pin-bg);
  pointer-events: none;
}

.station-pin-glyph {
  display: block;
  width: 14px;
  height: 14px;
  pointer-events: none;
}

.station-pin.has-prices .station-pin-head {
  border-color: color-mix(in oklab, var(--brand) 72%, var(--border));
}

.station-pin.in-radius {
  opacity: 1;
  z-index: 2;
}

.station-pin.in-radius .station-pin-head {
  border-color: color-mix(in oklab, var(--brand) 58%, var(--border));
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.32),
    0 0 0 2px color-mix(in oklab, var(--brand) 20%, transparent);
}

.station-pin.in-radius.has-prices .station-pin-head {
  border-color: color-mix(in oklab, var(--brand) 82%, var(--border));
}

.station-pin.out-radius {
  opacity: 0.56;
  transition: opacity 150ms ease-out;
}

.station-pin.out-radius .station-pin-head {
  color: var(--text-muted);
}

.station-pin.out-radius:is(:hover, :focus-visible) {
  opacity: 1;
  z-index: 3;
}

@media (prefers-reduced-motion: reduce) {
  .station-pin.out-radius {
    transition: none;
  }
}

.station-pin-status {
  position: absolute;
  top: -2px;
  right: -2px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--brand);
  border: 1.5px solid var(--pin-bg);
  pointer-events: none;
}

.station-pin-label {
  display: block;
  margin-top: 6px;
  min-inline-size: 0;
  max-inline-size: 18ch;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 0.72rem;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: 0.01em;
  color: var(--text);
  text-shadow:
    -1px -1px 0 var(--pin-halo),
     1px -1px 0 var(--pin-halo),
    -1px  1px 0 var(--pin-halo),
     1px  1px 0 var(--pin-halo),
     0 1px 4px var(--pin-halo);
}

.map-canvas.is-zoomed-out .station-pin {
  transform: translate(-50%, -50%);
  min-inline-size: 10px;
  min-block-size: 10px;
}

.map-canvas.is-zoomed-out .station-pin-head {
  width: 10px;
  height: 10px;
  border-width: 1.5px;
  border-color: #ffffff;
  background: #64748b;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  opacity: 0.92;
}

.map-canvas.is-zoomed-out .station-pin.has-prices .station-pin-head {
  width: 12px;
  height: 12px;
  background: var(--surface-solid);
  border: 2px solid var(--brand);
  opacity: 1;
}

.map-canvas.is-zoomed-out .station-pin.out-radius {
  opacity: 0.42;
}

.map-canvas.is-zoomed-out .station-pin.in-radius .station-pin-head {
  border-color: var(--brand);
}

.map-canvas.is-zoomed-out .station-pin-head::before,
.map-canvas.is-zoomed-out .station-pin-glyph,
.map-canvas.is-zoomed-out .station-pin-status {
  display: none;
}

.map-canvas.is-zoomed-out .station-pin-label {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@media (forced-colors: active) {
  .station-pin.out-radius {
    opacity: 1;
  }

  .station-pin-head {
    background: Canvas;
    color: CanvasText;
    border-color: ButtonText;
  }

  .station-pin.in-radius .station-pin-head {
    border-color: Highlight;
  }

  .station-pin-status {
    background: Highlight;
    border-color: Canvas;
  }
}

.user-dot {
  width: 14px;
  height: 14px;
  min-inline-size: 0;
  min-block-size: 0;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.28);
  pointer-events: none;
}

/* Native Bottom-Sheet Dialogs */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(5, 12, 11, 0.46);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

.bottom-sheet {
  border: 1px solid var(--border);
  background: var(--surface-solid);
  color: var(--text);
  width: min(100%, 36rem);
  max-width: 100%;
  max-block-size: 86dvh;
  margin: auto auto 0 auto;
  border-radius: 1.35rem 1.35rem 0 0;
  padding: 0;
  box-shadow: var(--shadow);
}

.settings-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-section {
  border: 1px solid var(--border);
  border-radius: 0.95rem;
  padding: 0.85rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.settings-section-title {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 750;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}

.settings-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
}

@media (min-width: 44rem) {
  .bottom-sheet {
    margin: auto;
    border-radius: 1.35rem;
    max-block-size: 82dvh;
  }
}

.bottom-sheet[open] {
  display: flex;
  flex-direction: column;
  animation: sheet-slide-up 180ms ease-out;
}

.bottom-sheet.is-tall[open] {
  block-size: 76dvh;
}

@keyframes sheet-slide-up {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .bottom-sheet[open] {
    animation: none;
  }
}

.sheet-handle {
  width: 2.5rem;
  height: 0.25rem;
  border-radius: 999px;
  background: var(--border);
  margin: 0.55rem auto 0.15rem;
  flex: 0 0 auto;
}

.sheet-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 1rem 0.75rem;
  border-bottom: 1px solid var(--border);
}

.sheet-header.is-stacked {
  flex-direction: column;
  align-items: stretch;
  gap: 0.45rem;
}

.sheet-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
}

.sheet-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  min-inline-size: 0;
}

.sheet-distance {
  font-size: 0.8rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
}

.sheet-title-wrap {
  min-inline-size: 0;
  width: 100%;
}

.sheet-title-wrap h2 {
  font-size: 1.18rem;
  line-height: 1.25;
}

.sheet-meta {
  margin: 0.2rem 0 0;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.sheet-header-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  width: 100%;
  margin-top: 0.15rem;
}

.sheet-save-status {
  margin-inline-start: auto;
  font-size: 0.78rem;
  font-weight: 700;
  padding: 0.22rem 0.65rem;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--text-muted);
}

.sheet-save-status.is-saving {
  color: var(--text);
}

.sheet-save-status.is-saved {
  color: var(--tier-low);
}

.sheet-save-status.is-error {
  color: var(--error);
  background: var(--error-bg);
}

.icon-close-btn {
  display: inline-grid;
  place-items: center;
  border: 1px solid var(--border);
  background: var(--surface-muted);
  border-radius: 999px;
  width: 2.4rem;
  height: 2.4rem;
  font-weight: 700;
  cursor: pointer;
  flex: none;
}

.brand-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 750;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  background: var(--surface-muted);
}

.sheet-body {
  container: sheet / inline-size;
  overflow-y: auto;
  padding: 0.85rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.prices-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
}

.price-row {
  border: 1px solid var(--border);
  border-radius: 0.9rem;
  padding: 0.65rem 0.8rem;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.price-row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.price-row-info {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  min-inline-size: 0;
  flex: 1 1 auto;
}

.price-row-grade {
  font-weight: 750;
  font-size: 0.96rem;
  color: var(--text);
  cursor: pointer;
}

.price-row-meta {
  font-size: 0.78rem;
  color: var(--text-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  align-items: center;
}

.freshness-tag {
  padding: 0.1rem 0.45rem;
  border-radius: 999px;
  font-weight: 650;
  background: var(--surface-muted);
}

.freshness-tag.is-fresh {
  color: var(--tier-low);
}

.freshness-tag.is-aging {
  color: var(--tier-mid);
}

.peso-input-wrap.is-inline {
  flex: 0 0 auto;
  width: 9.2rem;
  padding-inline: 0.65rem;
  min-block-size: 48px;
  background: var(--surface-solid);
  gap: 0.3rem;
}

@media (pointer: coarse) {
  .peso-input-wrap.is-inline {
    min-block-size: 52px;
  }
}

.peso-input-wrap.is-inline.is-changed {
  border-color: var(--brand);
}

.peso-input-wrap.is-inline input {
  flex: 1 1 0%;
  width: 100%;
  text-align: right;
  font-size: max(1rem, 1.12rem) !important;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  padding-block: 0.45rem;
}

.btn-primary,
.btn-secondary {
  border-radius: 0.75rem;
  padding: 0.6rem 0.95rem;
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--brand);
  color: var(--brand-text);
}

.btn-secondary {
  background: var(--surface-muted);
  color: var(--text);
  border-color: var(--border);
}

.btn-primary[aria-disabled="true"] {
  opacity: 0.65;
  cursor: progress;
}

.history-details summary {
  font-weight: 650;
  cursor: pointer;
  padding-block: 0.35rem;
}

.history-list,
.station-list {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

.history-item {
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.5rem;
  font-size: 0.85rem;
}

/* Nearby Window Radius Scaler & Station Cards */
.nearby-radius-bar {
  padding: 0.7rem 1rem 0.55rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface-solid);
  flex: 0 0 auto;
}

.nearby-radius-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
}

.nearby-radius-top label {
  font-size: 0.85rem;
  font-weight: 700;
}

.nearby-radius-top output {
  font-size: 0.88rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}

#nearby-radius-input {
  --slider-track-size: 0.45rem;
  --slider-thumb-size: 1.35rem;
  --slider-track-radius: 999px;
  --slider-thumb-radius: 50%;
  --slider-track-color: var(--surface-muted);
  --slider-fill-color: var(--brand);
  --slider-thumb-color: var(--brand);
  --slider-direction: to right;
  --attr-min: attr(min type(<number>), 1);
  --attr-max: attr(max type(<number>), 10);
  --control-value: attr(value type(<number>), 3);
  --slider-progress: calc(
    progress(var(--control-value), var(--attr-min), var(--attr-max)) * 100%
  );

  appearance: none;
  -webkit-appearance: none;
  inline-size: 100%;
  block-size: 2.5rem;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  cursor: pointer;
}

#nearby-radius-input:dir(rtl) {
  --slider-direction: to left;
}

@supports not (opacity: progress(1, 0, 100)) {
  #nearby-radius-input {
    --slider-progress: calc(
      (var(--control-value) - var(--attr-min)) /
      (var(--attr-max) - var(--attr-min)) * 100%
    );
  }
}

#nearby-radius-input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 4px;
}

#nearby-radius-input::-webkit-slider-runnable-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: linear-gradient(
    var(--slider-direction),
    var(--slider-fill-color) var(--slider-progress),
    var(--slider-track-color) var(--slider-progress)
  );
}

#nearby-radius-input::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  margin-block-start: calc(
    (var(--slider-track-size) - var(--slider-thumb-size)) / 2
  );
  border: 2px solid var(--surface-solid);
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

#nearby-radius-input::-moz-range-track {
  block-size: var(--slider-track-size);
  border: 0;
  border-radius: var(--slider-track-radius);
  background: var(--slider-track-color);
}

#nearby-radius-input::-moz-range-progress {
  block-size: var(--slider-track-size);
  border-radius: var(--slider-track-radius);
  background: var(--slider-fill-color);
}

#nearby-radius-input::-moz-range-thumb {
  inline-size: var(--slider-thumb-size);
  block-size: var(--slider-thumb-size);
  border: 2px solid var(--surface-solid);
  border-radius: var(--slider-thumb-radius);
  background: var(--slider-thumb-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.25);
}

.station-list-btn {
  width: 100%;
  text-align: left;
  border: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0.95rem;
  padding: 0.8rem;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.55rem;
  cursor: pointer;
}

.station-card-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
}

.station-card-name {
  font-weight: 750;
  font-size: 0.96rem;
  line-height: 1.25;
  color: var(--text);
}

.station-card-distance {
  font-size: 0.8rem;
  font-weight: 650;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  flex: 0 0 auto;
}

.station-card-fuels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.42rem;
  width: 100%;
}

.station-fuel-cell {
  background: var(--surface-muted);
  border-radius: 0.6rem;
  padding: 0.42rem 0.48rem;
  display: flex;
  flex-direction: column;
  gap: 0.14rem;
  min-inline-size: 0;
}

.station-fuel-name {
  font-size: 0.68rem;
  font-weight: 650;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.station-fuel-price {
  font-size: 0.9rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text);
}

.station-fuel-price.is-empty {
  font-weight: 650;
  color: var(--text-muted);
}

/* Forms & Validation (:user-invalid after interaction) */
.sheet-form {
  overflow-y: auto;
  padding: 0.9rem 1rem max(1rem, env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.fuel-fieldset {
  border: 0;
  padding: 0;
  margin: 0;
}

.fuel-fieldset legend {
  font-weight: 700;
  font-size: 0.92rem;
  margin-bottom: 0.5rem;
}

.grade-input-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.grade-input-row {
  border: 1px solid var(--border);
  border-radius: 0.85rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
}

.grade-input-header {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.4rem;
}

.form-summary-error {
  border: 1px solid var(--error);
  background: var(--error-bg);
  color: var(--error);
  border-radius: 0.75rem;
  padding: 0.6rem 0.8rem;
  font-size: 0.88rem;
  font-weight: 650;
}

.fuel-radio-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.5rem;
}

.fuel-radio-pill {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  background: var(--bg);
  font-weight: 650;
  font-size: 0.9rem;
  cursor: pointer;
  min-block-size: 48px;
}

.fuel-radio-pill:has(input:checked) {
  border-color: var(--brand);
  background: var(--surface-muted);
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.field-group label {
  font-weight: 700;
  font-size: 0.92rem;
}

.field-hint {
  color: var(--text-muted);
  font-size: 0.82rem;
}

.field-group input[type="text"],
.field-group select {
  width: 100%;
  font: inherit;
  font-size: max(1rem, 1em);
  padding: 0.7rem 0.85rem;
  min-block-size: 48px;
  border-radius: 0.75rem;
  border: 1px solid var(--border);
  background: var(--bg);
}

@media (pointer: coarse) {
  .field-group input[type="text"],
  .field-group select {
    min-block-size: 52px;
  }
}

.peso-input-wrap {
  display: flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 0.75rem;
  background: var(--bg);
  padding-inline: 0.85rem;
  gap: 0.45rem;
}

.peso-input-wrap:has(input:focus-visible) {
  outline: 3px solid var(--brand);
  outline-offset: 2px;
}

.peso-prefix,
.peso-suffix {
  font-weight: 750;
  color: var(--text-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.peso-suffix {
  font-size: 0.85rem;
}

.peso-input-wrap input {
  flex: 1 1 0%;
  width: 100%;
  min-inline-size: 0;
  border: 0 !important;
  background: transparent !important;
  padding-inline: 0 !important;
  font-size: max(1rem, 1.12rem);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  outline: none;
}

.error-msg {
  display: none;
  color: var(--error);
  font-size: 0.85rem;
  font-weight: 600;
  margin-top: 0.2rem;
}

:is(input:user-invalid, input.user-invalid-fallback),
.field-group :is(input:user-invalid, input.user-invalid-fallback) {
  border-color: var(--error);
  background-color: var(--error-bg);
}

.peso-input-wrap:has(input:user-invalid),
.peso-input-wrap:has(input.user-invalid-fallback) {
  border-color: var(--error);
  background-color: var(--error-bg);
}

:is(input:user-invalid, input.user-invalid-fallback) + .error-msg,
.peso-input-wrap:has(input:user-invalid) + .error-msg,
.peso-input-wrap:has(input.user-invalid-fallback) + .error-msg {
  display: block;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  margin-top: 0.25rem;
}

/* Toast Popovers (Top-Layer swipeable auto-fading pill below top HUD) */
.toast-region {
  display: contents;
}

.toast-item {
  --toast-drag-x: 0px;
  position: fixed;
  inset: auto;
  top: var(--toast-item-top, max(4.75rem, calc(env(safe-area-inset-top, 0px) + 4.25rem)));
  left: 50%;
  transform: translate3d(calc(-50% + var(--toast-drag-x)), 0, 0);
  margin: 0;
  width: fit-content;
  max-width: min(88dvw, 22rem);
  overflow: visible;
  touch-action: pan-y;
  user-select: none;
  cursor: grab;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--text);
  padding: 0.44rem 1rem;
  box-shadow: var(--shadow);
  pointer-events: auto;
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.83rem;
  font-weight: 600;
  line-height: 1.25;
  opacity: 1;
  transition: opacity 180ms ease-out, transform 180ms ease-out, display 180ms, overlay 180ms;
  transition-behavior: allow-discrete;
}

.toast-item > span {
  min-inline-size: 0;
  overflow-wrap: anywhere;
}

.toast-item:is(:popover-open, .\:popover-open) {
  display: inline-flex;
}

@starting-style {
  .toast-item:is(:popover-open, .\:popover-open) {
    opacity: 0;
  }
}

.toast-item.is-dragging {
  transition: none;
  cursor: grabbing;
}

.toast-item.is-leaving {
  opacity: 0;
  pointer-events: none;
}

.toast-item.is-error {
  border-color: var(--error);
}

@media (prefers-reduced-motion: reduce) {
  .toast-item {
    transition: none;
  }
}
