:root {
  --background: #f7f8fb;
  --foreground: #111827;
  --card: #ffffff;
  --card-foreground: #111827;
  --popover: rgba(255, 255, 255, 0.86);
  --popover-strong: rgba(255, 255, 255, 0.96);
  --muted: #637083;
  --muted-foreground: #637083;
  --muted-surface: #f1f4f8;
  --border: rgba(17, 24, 39, 0.12);
  --input: rgba(17, 24, 39, 0.14);
  --ring: rgba(37, 99, 235, 0.28);
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-foreground: #ffffff;
  --success: #13a76b;
  --warning: #d7a514;
  --destructive: #e5484d;
  --orange: #f17822;
  --unknown: #8a94a6;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --shadow-sm: 0 8px 24px rgba(15, 23, 42, 0.1);
  --shadow-md: 0 18px 46px rgba(15, 23, 42, 0.16);
  --shadow-blue: 0 14px 36px rgba(37, 99, 235, 0.26);
  --top-fade: linear-gradient(180deg, rgba(247, 248, 251, 0.78), rgba(247, 248, 251, 0.34) 46%, rgba(247, 248, 251, 0));
  --bg: var(--background);
  --panel: var(--card);
  --panel-soft: var(--popover);
  --text: var(--foreground);
  --line: var(--border);
  --blue: var(--primary);
  --blue-dark: var(--primary-hover);
  --green: var(--success);
  --yellow: var(--warning);
  --red: var(--destructive);
  --shadow: var(--shadow-md);
}

body[data-theme="dark"] {
  --background: #090d12;
  --foreground: #f5f7fb;
  --card: #111822;
  --card-foreground: #f5f7fb;
  --popover: rgba(17, 24, 34, 0.84);
  --popover-strong: rgba(17, 24, 34, 0.96);
  --muted: #9aa6b8;
  --muted-foreground: #9aa6b8;
  --muted-surface: #17202c;
  --border: rgba(255, 255, 255, 0.14);
  --input: rgba(255, 255, 255, 0.16);
  --ring: rgba(96, 165, 250, 0.35);
  --primary: #60a5fa;
  --primary-hover: #93c5fd;
  --primary-foreground: #ffffff;
  --success: #30d985;
  --warning: #f2c94c;
  --destructive: #ff5b68;
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 18px 52px rgba(0, 0, 0, 0.42);
  --shadow-blue: 0 14px 36px rgba(96, 165, 250, 0.22);
  --top-fade: linear-gradient(180deg, rgba(9, 13, 18, 0.68), rgba(9, 13, 18, 0.22) 48%, rgba(9, 13, 18, 0));
  --bg: var(--background);
  --panel: var(--card);
  --panel-soft: var(--popover);
  --text: var(--foreground);
  --line: var(--border);
  --blue: var(--primary);
  --blue-dark: var(--primary-hover);
  --green: var(--success);
  --yellow: var(--warning);
  --red: var(--destructive);
  --shadow: var(--shadow-md);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Arial, sans-serif;
  overscroll-behavior: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

button {
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

button,
input,
select,
textarea,
a {
  transition: border-color 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
a:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 4px var(--ring), var(--shadow-sm);
}

button:active {
  transform: scale(0.98);
}

.app {
  position: fixed;
  inset: 0;
  display: block;
  background: var(--bg);
}

.topbar {
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  z-index: 1300;
  display: flex;
  align-items: center;
  gap: 22px;
  min-height: 68px;
  padding: 12px 18px 8px;
  background: transparent;
}

.topbar::before {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  top: 0;
  height: 96px;
  z-index: -1;
  pointer-events: none;
  background: var(--top-fade);
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  text-decoration: none;
  min-width: max-content;
  padding: 6px 10px 6px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--popover-strong);
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: var(--shadow-sm);
}

.brand-mark {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: var(--primary-foreground);
  font-size: 13px;
  font-weight: 900;
}

.brand-text {
  font-size: 20px;
  font-weight: 820;
  letter-spacing: 0;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.ghost-button,
.filter-button,
.fuel-tab,
.secondary-button {
  border: 1px solid var(--line);
  background: var(--panel-soft);
  color: var(--text);
  border-radius: var(--radius-sm);
  min-height: 38px;
  padding: 0 14px;
  font-weight: 700;
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: var(--shadow-sm);
}

.nav-link.active,
.filter-button.active,
.fuel-tab.active {
  border-color: color-mix(in srgb, var(--blue), transparent 62%);
  background: color-mix(in srgb, var(--blue), transparent 90%);
  color: var(--blue);
}

.nav-link:hover,
.ghost-button:hover,
.fuel-tab:hover,
.secondary-button:hover,
.icon-button:hover,
.city-grid button:hover,
.station-list-item:hover {
  border-color: color-mix(in srgb, var(--blue), transparent 62%);
  background: color-mix(in srgb, var(--panel), var(--blue) 8%);
}

.ghost-button {
  margin-left: auto;
}

.add-station-top {
  margin-left: auto;
}

.add-station-top + .ghost-button {
  margin-left: 0;
}

.filters {
  position: fixed;
  left: 16px;
  right: 16px;
  top: 72px;
  z-index: 1300;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 0;
  background: transparent;
}

.filters::before {
  content: "";
  position: absolute;
  inset: -3px -5px -4px;
  z-index: -1;
  border-radius: var(--radius-md);
  pointer-events: none;
  background: color-mix(in srgb, var(--panel), transparent 68%);
  backdrop-filter: blur(16px) saturate(1.08);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.primary-filters,
.fuel-tabs,
.quick-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.quick-actions {
  justify-content: flex-end;
}

.fuel-tabs {
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0;
  width: fit-content;
  max-width: 100%;
}

.fuel-tabs::-webkit-scrollbar {
  display: none;
}

.fuel-tab {
  min-width: 48px;
  min-height: 38px;
}

.search-box {
  height: 44px;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0 13px;
  background: var(--panel-soft);
  backdrop-filter: blur(18px) saturate(1.08);
  box-shadow: var(--shadow-sm);
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font-size: 15px;
  font-weight: 560;
}

.search-box input::placeholder,
.field input::placeholder,
.field textarea::placeholder {
  color: color-mix(in srgb, var(--muted), transparent 22%);
}

.search-icon {
  width: 18px;
  height: 18px;
  display: inline-block;
  border: 2px solid var(--blue);
  border-radius: 50%;
  position: relative;
  flex: none;
}

.search-icon::after {
  content: "";
  position: absolute;
  width: 8px;
  height: 2px;
  right: -6px;
  bottom: -3px;
  border-radius: 2px;
  background: var(--blue);
  transform: rotate(45deg);
}

.map-shell {
  position: fixed;
  inset: 0;
  overflow: hidden;
  background: #dce7d6;
}

body[data-theme="dark"] .map-shell,
body[data-theme="dark"] .leaflet-container {
  background: #080d12;
}

.map,
.fallback-map {
  position: absolute;
  inset: 0;
  width: 100vw;
  height: 100dvh;
}

.leaflet-container {
  position: absolute !important;
  inset: 0;
  width: 100vw !important;
  height: 100dvh !important;
  background: #dce7d6;
  font: inherit;
}

.leaflet-control-attribution {
  font-size: 10px;
  background: color-mix(in srgb, var(--panel), transparent 24%) !important;
  color: var(--muted) !important;
}

.leaflet-control-attribution a {
  color: var(--blue) !important;
}

.leaflet-marker-icon {
  background: transparent;
  border: 0;
}

.fallback-map {
  background:
    radial-gradient(circle at 57% 42%, rgba(36, 107, 254, 0.08), transparent 18%),
    linear-gradient(145deg, #e9f0df, #dce9f1 48%, #edf1e2);
}

.fallback-grid {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  background-image:
    linear-gradient(rgba(80, 111, 138, 0.18) 1px, transparent 1px),
    linear-gradient(90deg, rgba(80, 111, 138, 0.18) 1px, transparent 1px);
  background-size: 58px 58px;
}

.fallback-road {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: inset 0 0 0 2px rgba(235, 184, 77, 0.55);
}

.road-a {
  left: -8%;
  top: 47%;
  width: 118%;
  height: 22px;
  transform: rotate(-8deg);
}

.road-b {
  left: 33%;
  top: -8%;
  width: 20px;
  height: 118%;
  transform: rotate(15deg);
}

.road-c {
  left: 14%;
  top: 18%;
  width: 90%;
  height: 18px;
  transform: rotate(31deg);
}

.fallback-metro {
  position: absolute;
  left: 47%;
  top: 43%;
  padding: 8px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  color: #3c4655;
  font-weight: 800;
}

.fallback-note {
  position: absolute;
  left: 18px;
  bottom: 96px;
  max-width: 420px;
  margin: 0;
  padding: 11px 13px;
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  box-shadow: 0 10px 28px rgba(20, 25, 34, 0.12);
}

.mock-marker,
.ymap-marker,
.leaflet-fuel-marker {
  --marker: var(--unknown);
  width: 18px;
  height: 18px;
  display: block;
  border: 2px solid #fff;
  border-radius: 50%;
  background: var(--marker);
  box-shadow: 0 3px 12px rgba(20, 25, 34, 0.35);
}

.mock-marker {
  position: absolute;
  transform: translate(-50%, -50%);
}

.mock-marker.selected,
.ymap-marker.selected,
.leaflet-fuel-marker.selected {
  width: 28px;
  height: 28px;
  box-shadow: 0 0 0 7px color-mix(in srgb, var(--marker), transparent 72%), 0 8px 24px rgba(20, 25, 34, 0.3);
}

.map-controls {
  position: absolute;
  right: 16px;
  top: 132px;
  z-index: 1200;
  display: grid;
  gap: 9px;
}

.icon-button {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--popover-strong);
  color: var(--blue);
  font-size: 25px;
  font-weight: 700;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(1.08);
}

#themeToggleButton {
  font-size: 20px;
}

.locate-button.is-loading {
  color: var(--muted);
}

.locate-button.is-active {
  background: var(--blue);
  color: var(--primary-foreground);
}

.icon-location-arrow {
  width: 21px;
  height: 21px;
  display: block;
  position: relative;
  transform: rotate(45deg);
}

.icon-location-arrow::before {
  content: "";
  position: absolute;
  left: 3px;
  top: 2px;
  width: 0;
  height: 0;
  border-left: 8px solid transparent;
  border-right: 8px solid transparent;
  border-bottom: 19px solid currentColor;
  filter: drop-shadow(0 2px 4px rgba(15, 23, 42, 0.18));
}

.icon-location-arrow::after {
  content: "";
  position: absolute;
  left: 8px;
  top: 9px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--popover-strong);
}

.user-location-dot {
  position: relative;
  width: 18px;
  height: 18px;
  display: block;
  border: 3px solid #fff;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.22), 0 10px 24px rgba(37, 99, 235, 0.45);
}

.user-location-dot::after {
  content: "";
  position: absolute;
  inset: -12px;
  border: 1px solid rgba(37, 99, 235, 0.3);
  border-radius: 50%;
  animation: user-location-pulse 1.9s ease-out infinite;
}

.user-accuracy-circle {
  stroke: #2563eb;
  stroke-width: 1;
  stroke-opacity: 0.35;
  fill: #2563eb;
  fill-opacity: 0.12;
}

@keyframes user-location-pulse {
  from {
    transform: scale(0.55);
    opacity: 0.75;
  }
  to {
    transform: scale(1.35);
    opacity: 0;
  }
}

.pick-station-layer {
  position: absolute;
  inset: 0;
  z-index: 1250;
  pointer-events: none;
}

.pick-center-pin {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  height: 30px;
  border-radius: 50% 50% 50% 0;
  background: var(--green);
  box-shadow: 0 0 0 9px color-mix(in srgb, var(--green), transparent 78%), 0 12px 28px rgba(0, 0, 0, 0.28);
  transform: translate(-50%, -100%) rotate(-45deg);
}

.pick-center-pin::after {
  content: "";
  position: absolute;
  inset: 8px;
  border-radius: 50%;
  background: #fff;
}

.pick-hint {
  position: absolute;
  left: 50%;
  bottom: 136px;
  width: min(330px, calc(100vw - 44px));
  transform: translateX(-50%);
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--popover-strong);
  color: var(--text);
  text-align: center;
  font-weight: 750;
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.pick-actions {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: calc(74px + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.55fr);
  gap: 12px;
  pointer-events: auto;
}

.map-link-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.map-link-row .field {
  margin-bottom: 13px;
}

.warning-note {
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1px solid color-mix(in srgb, var(--orange), transparent 35%);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--orange), transparent 88%);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.city-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  max-height: 300px;
  overflow: auto;
  margin: -2px 0 14px;
  padding-right: 2px;
}

.city-grid button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel), transparent 6%);
  color: var(--text);
  font-weight: 750;
  text-align: left;
  padding: 0 11px;
}

.city-grid button[hidden] {
  display: none;
}

.city-results {
  display: grid;
  gap: 8px;
  margin: -2px 0 14px;
}

.city-result-button {
  width: 100%;
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 8px 11px;
  border: 1px solid color-mix(in srgb, var(--blue), transparent 64%);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--blue), transparent 91%);
  color: var(--text);
  text-align: left;
}

.city-result-button strong {
  font-size: 14px;
}

.city-result-button span {
  color: var(--muted);
  font-size: 12px;
}

.list-toggle {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 22px;
  transform: translateX(-50%);
  z-index: 1100;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--popover-strong);
  color: var(--text);
  font-weight: 800;
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(1.08);
}

.legend {
  position: absolute;
  left: 16px;
  bottom: 104px;
  z-index: 1100;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--panel-soft);
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(20, 25, 34, 0.12);
}

.how-card {
  position: absolute;
  left: 16px;
  top: 132px;
  z-index: 1150;
  width: 300px;
  display: grid;
  gap: 5px;
  padding: 13px 42px 13px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--popover-strong);
  box-shadow: var(--shadow-sm);
  backdrop-filter: blur(18px) saturate(1.08);
}

.how-card strong {
  font-size: 15px;
}

.how-card span,
.dialog-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.how-close {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 26px;
  height: 26px;
  border: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--text), transparent 92%);
  color: var(--muted);
  font-size: 18px;
}

.legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.dot {
  width: 9px;
  height: 9px;
  display: inline-block;
  border-radius: 50%;
}

.dot-ok {
  background: var(--green);
}

.dot-low {
  background: var(--yellow);
}

.dot-queue {
  background: var(--orange);
}

.dot-empty {
  background: var(--red);
}

.bottom-sheet,
.list-panel {
  position: fixed;
  z-index: 1250;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.mobile-add-station {
  display: none;
}

.mobile-nav {
  display: none;
}

.bottom-sheet {
  left: 50%;
  bottom: 18px;
  width: min(560px, calc(100vw - 32px));
  transform: translateX(-50%);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 8px 14px 14px;
}

.sheet-handle {
  width: 42px;
  height: 4px;
  margin: 0 auto 10px;
  border-radius: 999px;
  background: rgba(20, 25, 34, 0.18);
}

.empty-state {
  display: grid;
  gap: 4px;
  text-align: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
}

.station-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.station-brand,
.station-address {
  margin: 0;
  color: var(--muted);
}

.station-brand {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.station-head h1 {
  margin: 2px 0 4px;
  font-size: 23px;
  line-height: 1.15;
}

.close-button {
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 8px;
  background: rgba(20, 25, 34, 0.06);
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
}

.status-summary {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.summary-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text), transparent 92%);
  color: var(--muted);
  font-weight: 750;
}

.fuel-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.fuel-card {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px;
  background: color-mix(in srgb, var(--panel), transparent 8%);
}

.fuel-card strong {
  display: block;
  font-size: 16px;
}

.fuel-card span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.sheet-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin-top: 13px;
}

.secondary-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 9px;
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--blue);
  color: var(--primary-foreground);
  font-weight: 850;
  box-shadow: var(--shadow-blue);
}

.primary-button:hover {
  background: var(--blue-dark);
}

.full-width {
  width: 100%;
}

.list-panel {
  top: 156px;
  right: 18px;
  bottom: 18px;
  width: min(420px, calc(100vw - 36px));
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
}

.list-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid var(--line);
}

.station-list {
  height: calc(100% - 63px);
  overflow: auto;
  padding: 10px;
}

.station-list-item {
  width: 100%;
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--panel), transparent 4%);
  text-align: left;
}

.station-list-item strong {
  font-size: 15px;
}

.station-list-item span {
  color: var(--muted);
  font-size: 12px;
}

.brand-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--brand-bg, var(--muted-surface));
  color: var(--brand-fg, var(--text));
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.station-list-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.station-list-main strong,
.station-list-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.station-list-meta {
  display: grid;
  justify-items: end;
  gap: 4px;
  min-width: 76px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--status), transparent 88%);
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.status-badge::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status);
}

.situation-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 10px;
}

.situation-card {
  min-height: 66px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--panel), transparent 4%);
}

.situation-card strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.situation-card span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.station-history {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.history-item {
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: color-mix(in srgb, var(--text), transparent 95%);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.history-item strong {
  color: var(--text);
}

.report-dialog {
  width: min(440px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius-lg);
  padding: 0;
  box-shadow: var(--shadow);
}

.report-dialog::backdrop {
  background: rgba(20, 25, 34, 0.44);
}

.report-dialog form {
  padding: 18px;
  background: var(--panel);
  color: var(--text);
}

.dialog-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.dialog-head p,
.dialog-head h2 {
  margin: 0;
}

.dialog-head p {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.field {
  display: grid;
  gap: 7px;
  margin-bottom: 13px;
  color: var(--muted);
  font-weight: 750;
}

.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.dialog-note {
  margin: -2px 0 14px;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  color: var(--text);
  background: var(--panel);
  outline: 0;
}

.status-choice {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 13px;
  padding: 0;
  border: 0;
}

.route-options {
  display: grid;
  gap: 10px;
}

.status-choice legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-weight: 750;
}

.status-choice label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-weight: 800;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 80;
  max-width: min(460px, calc(100vw - 24px));
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.94);
  color: #fff;
  font-weight: 750;
  box-shadow: var(--shadow);
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

@media (max-width: 860px) {
  .app {
    display: block;
  }

  .topbar {
    min-height: 62px;
    padding: calc(10px + env(safe-area-inset-top)) 14px 8px;
    gap: 9px;
  }

  .topbar::before {
    height: 104px;
  }

  .brand-text {
    font-size: 17px;
  }

  .brand {
    gap: 8px;
    max-width: calc(100vw - 150px);
  }

  .brand-mark {
    width: 32px;
    height: 32px;
    border-radius: 9px;
  }

  .desktop-nav {
    display: flex;
    margin-left: auto;
    overflow-x: auto;
    scrollbar-width: none;
    flex: none;
  }

  .desktop-nav::-webkit-scrollbar {
    display: none;
  }

  .desktop-nav .nav-link:not(#cityButton) {
    display: none;
  }

  #cityButton {
    max-width: 116px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .ghost-button {
    display: none;
  }

  .filters {
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
    left: 10px;
    right: 10px;
    top: calc(68px + env(safe-area-inset-top));
    padding: 0;
  }

  .primary-filters {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .primary-filters::-webkit-scrollbar {
    display: none;
  }

  .filter-button {
    flex: 0 0 auto;
    min-height: 36px;
    padding: 0 12px;
  }

  .search-box {
    height: 42px;
  }

  .fuel-tab {
    min-height: 38px;
    min-width: 56px;
  }

  .status-choice {
    grid-template-columns: 1fr;
  }

  .map-controls {
    top: calc(126px + env(safe-area-inset-top));
    right: max(10px, env(safe-area-inset-right));
    gap: 8px;
  }

  .icon-button {
    width: 46px;
    height: 46px;
  }

  .how-card {
    left: 12px;
    right: 70px;
    top: calc(126px + env(safe-area-inset-top));
    width: auto;
    padding: 11px 38px 11px 12px;
  }

  .list-toggle {
    left: 12px;
    right: auto;
    bottom: calc(88px + env(safe-area-inset-bottom));
    transform: none;
    white-space: nowrap;
  }

  .legend {
    display: none;
  }

  .bottom-sheet {
    left: 0;
    right: 0;
    bottom: 0;
    width: auto;
    transform: none;
    border-radius: 18px 18px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .mobile-add-station {
    position: fixed;
    right: max(12px, env(safe-area-inset-right));
    bottom: calc(86px + env(safe-area-inset-bottom));
    z-index: 1200;
    display: block;
    width: 164px;
    min-height: 44px;
    border: 0;
    border-radius: var(--radius-md);
    background: var(--blue);
    color: var(--primary-foreground);
    font-weight: 850;
    box-shadow: var(--shadow-blue);
  }

  .mobile-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1400;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
    background: var(--popover-strong);
    backdrop-filter: blur(18px) saturate(1.08);
    border-top: 1px solid var(--line);
    box-shadow: 0 -8px 24px rgba(20, 25, 34, 0.08);
  }

  .mobile-nav-button {
    min-height: 42px;
    border: 0;
    border-radius: var(--radius-sm);
    background: transparent;
    color: var(--muted);
    font-size: 13px;
    font-weight: 850;
  }

  .mobile-nav-button.active {
    background: color-mix(in srgb, var(--blue), transparent 90%);
    color: var(--blue);
  }

  .fuel-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .list-panel {
    left: 0;
    right: 0;
    top: auto;
    bottom: calc(58px + env(safe-area-inset-bottom));
    width: auto;
    height: min(72dvh, calc(100dvh - 168px));
    border-radius: 18px 18px 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
  }

  .fallback-note {
    left: 10px;
    right: 10px;
    bottom: 250px;
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .map-link-row {
    grid-template-columns: 1fr;
  }

  .map-link-row .secondary-button {
    width: 100%;
  }

  .report-dialog {
    width: 100vw;
    max-width: none;
    margin: auto 0 0;
    border-radius: 18px 18px 0 0;
  }

  .report-dialog form {
    max-height: 82dvh;
    overflow: auto;
    padding-bottom: calc(18px + env(safe-area-inset-bottom));
  }
}

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