/* ═══════════════════════════════════════════
   Забензином.рф — Design System
   Inspired by CRM Modern: green accent, dark/light themes
   ═══════════════════════════════════════════ */

/* Calculator — шрифт как на табло АЗС */
@font-face {
  font-family: 'Calculator';
  src: url('/fonts/Calculator.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
}

/* ─── Tokens: Dark (default) ─── */
:root {
  --bg: #151515;
  --bg2: #191919;
  --bg3: #232323;
  --bg4: #2B2D33;
  --tx1: #FFFFFF;
  --tx2: #D0D0D0;
  --tx3: #A5AAB5;
  --tx4: #808898;
  --bd: #353535;
  --bd2: rgba(255,255,255,.08);
  --accent: #00856B;
  --on-accent: #FFFFFF;
  --rd: #FF3B30;
  --gr: #00C88A;
  --bl: #1086F9;
  --white: #FFFFFF;
  --f: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --fh: 'Archivo', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --radius: 16px;
  --radius-sm: 12px;
  --radius-pill: 50px;
  --radius-pill-sm: 20px;
  --shadow: 0 8px 32px rgba(0,0,0,.4);
  --shadow-sm: 0 2px 8px rgba(0,0,0,.3);
  --card-shadow: none;
  --transition: .3s ease;
  --text-muted: var(--tx4);
  --text-secondary: var(--tx3);
  --accent-cyan: var(--bl);
  --bg-card: var(--bg3);
  /* Popup / board-wrap (тёмное табло АЗС) */
  --popup-bg: #0d0d0d;
  --popup-border: #1a1a1a;
  --popup-text: #ccc;
  --popup-text-muted: #888;
  --popup-text-dim: #666;
  --popup-text-faint: #555;
  --popup-btn-bg: #1a1a1a;
  --popup-btn-text: #888;
  --popup-btn-hover-text: #fff;
  --popup-btn-hover-bg: #222;
  --popup-digit-color: #00ff88;
  --popup-digit-glow: 0 0 6px rgba(0,255,136,0.5), 0 0 20px rgba(0,255,136,0.15);
  --popup-svc-bg: #1a1a1a;
  --popup-svc-text: #999;
  --popup-fuel-text: #ccc;
  --popup-muted-text: #555;
  --popup-queue-bar-bg: #1a1a1a;
  --popup-queue-label: #aaa;
}

/* ─── Tokens: Light ─── */
[data-theme="light"] {
  --bg: #F0F3F5;
  --bg2: #FFFFFF;
  --bg3: #DCE2E8;
  --bg4: #CDD4DC;
  --tx1: #1A1A1A;
  --tx2: #5A6570;
  --tx3: #8A95A0;
  --tx4: #B8C0C8;
  --bd: #B4BCC8;
  --bd2: rgba(0,0,0,.1);
  --shadow: 0 2px 12px rgba(0,0,0,.08);
  --shadow-sm: 0 1px 4px rgba(0,0,0,.05);
  --card-shadow: 0 2px 8px rgba(0,0,0,.06);
  /* Popup (светлая карточка вместо табло) */
  --popup-bg: #ffffff;
  --popup-border: #e4e7ec;
  --popup-text: #333;
  --popup-text-muted: #666;
  --popup-text-dim: #888;
  --popup-text-faint: #aaa;
  --popup-btn-bg: #f0f2f5;
  --popup-btn-text: #5a6570;
  --popup-btn-hover-text: #1a1a1a;
  --popup-btn-hover-bg: #e0e4ea;
  --popup-digit-color: #00a86b;
  --popup-digit-glow: 0 0 4px rgba(0,168,107,0.25);
  --popup-svc-bg: #f0f2f5;
  --popup-svc-text: #5a6570;
  --popup-fuel-text: #444;
  --popup-muted-text: #888;
  --popup-queue-bar-bg: #e0e4ea;
  --popup-queue-label: #666;
}

html.theme-transitioning * {
  transition: background-color .3s ease, color .3s ease, border-color .3s ease, box-shadow .3s ease !important;
}

/* ─── Reset ─── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; overflow: hidden; }
body {
  font-family: var(--f);
  background: var(--bg);
  color: var(--tx1);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.15;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: var(--f); }

/* ─── Layout ─── */
.layout {
  display: flex;
  height: 100vh;
  position: relative;
}

/* ─── Sidebar Header (logo + city + tabs) ─── */
.sidebar-top-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
.sidebar-top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.sidebar-top-row .logo {
  font-family: var(--fh);
  font-size: 16px;
  font-weight: 700;
  color: var(--accent);
  line-height: 1;
}
.sidebar-header .city-selector {
  width: 100%;
  margin-bottom: 6px;
}
.sidebar-header .city-btn {
  width: 100%;
  justify-content: center;
}
.sidebar-header .city-dropdown {
  left: 0;
  right: 0;
  transform: none;
  width: auto;
}

.city-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: var(--tx1);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.city-btn:hover { background: var(--bg4); color: var(--tx1); }
.city-btn svg { color: var(--accent); }

.city-selector { position: relative; }
.city-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: 280px;
  max-height: 340px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
  z-index: 1000;
  margin-top: 6px;
  overflow: hidden;
}
.city-dropdown.active { display: block; }
.city-dropdown input {
  width: 100%;
  padding: 10px 12px;
  border: none;
  border-bottom: 1px solid var(--bd);
  background: var(--bg);
  color: var(--tx1);
  font-size: 14px;
  outline: none;
}
.city-dropdown input::placeholder { color: var(--tx4); }
.city-list { overflow-y: auto; max-height: 280px; }
.city-list-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 13px;
  color: var(--tx2);
  transition: background .1s;
}
.city-list-item:hover { background: var(--bg3); }
.city-list-item .city-region { font-size: 11px; color: var(--tx4); margin-left: 6px; }
.city-list-empty { padding: 20px 12px; text-align: center; color: var(--tx4); font-size: 13px; }

.icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--bd);
  border-radius: 50%;
  background: transparent;
  color: var(--tx2);
  cursor: pointer;
  transition: all var(--transition);
}
.icon-btn:hover { background: var(--bg4); color: var(--tx1); }
.icon-btn svg { width: 18px; height: 18px; }
.heatmap-btn.active { background: var(--accent); color: var(--white); }
.heatmap-btn.active svg { fill: var(--white); }

.sidebar {
  width: 380px;
  min-width: 380px;
  background: var(--bg2);
  border-right: 1px solid var(--bd);
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 500;
}

.map-container {
  flex: 1;
  position: relative;
}
#map { width: 100%; height: 100%; }

/* ─── Sidebar ─── */
.sidebar-header { padding: 10px 12px 8px; }
.tab-bar {
  display: flex;
  gap: 4px;
  background: var(--bg3);
  border-radius: var(--radius-pill);
  padding: 4px;
}
.tab {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--tx2);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--f);
}
.tab.active { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.tab:hover:not(.active) { color: var(--tx1); }

.sidebar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  border-bottom: 1px solid var(--bd);
}
.filter-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: var(--radius-pill);
  padding: 4px 10px;
  color: var(--tx2);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--f);
}
.filter-btn:hover { background: var(--bg4); color: var(--tx1); }
.filter-btn.active {
  background: rgba(0,200,138,.15);
  border-color: var(--gr);
  color: var(--gr);
  font-weight: 600;
}
.station-count { font-size: 12px; color: var(--tx4); }
.live-indicator {
  font-size: 8px;
  color: #00C88A;
  opacity: 0.7;
  animation: livePulse 2s ease-in-out infinite;
  line-height: 1;
}
@keyframes livePulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ─── Fuel pills ─── */
.fuel-pills {
  display: flex;
  gap: 4px;
  padding: 4px 8px;
  overflow-x: auto;
  scrollbar-width: none;
  border-bottom: 1px solid var(--bd);
  flex-shrink: 0;
}
.fuel-pills::-webkit-scrollbar { display: none; }
.fuel-pills .pill {
  flex-shrink: 0;
  padding: 4px 12px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .03em;
  background: var(--bg3);
  border: 1px solid var(--bd);
  border-radius: var(--radius-pill);
  color: var(--tx2);
  cursor: pointer;
  transition: all .12s;
  white-space: nowrap;
  font-family: var(--f);
}
.fuel-pills .pill:hover { background: var(--bg4); color: var(--tx1); }
.fuel-pills .pill.active { background: var(--bl); color: var(--white); border-color: var(--bl); }

/* ─── Search bar ─── */
.search-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-bottom: 1px solid var(--bd);
  background: var(--bg2);
  flex-shrink: 0;
}
.search-icon { color: var(--tx4); flex-shrink: 0; }
.search-input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--tx1);
  font-size: 14px;
  outline: none;
  font-family: var(--f);
}
.search-input::placeholder { color: var(--tx4); }
.search-clear {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: none;
  background: var(--bg3);
  border-radius: 50%;
  color: var(--tx4);
  cursor: pointer;
  font-size: 14px;
  flex-shrink: 0;
}
.search-clear:hover { color: var(--tx1); }

.sidebar-content {
  flex: 1;
  overflow-y: auto;
  padding: 4px 6px;
}
.sidebar-content::-webkit-scrollbar { width: 6px; }
.sidebar-content::-webkit-scrollbar-thumb { background: var(--bd2); border-radius: 3px; }
.sidebar-content::-webkit-scrollbar-thumb:hover { background: var(--tx4); }
.sidebar-content::-webkit-scrollbar-track { background: transparent; }
.sidebar-content { scrollbar-width: thin; scrollbar-color: var(--bd2) transparent; }

/* ─── Station Card (Compact) ─── */
.station-card {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  padding: 6px 8px;
  margin-bottom: 3px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-left: 4px solid var(--bd);
  border-radius: 8px;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: var(--card-shadow);
  animation: cardIn .3s ease both;
}
.station-card:hover {
  background: var(--bg3);
  border-color: rgba(0,133,107,.2);
  border-left-width: 4px;
}
.station-card:active { transform: scale(.99); }

/* Цветная рамка по статусу топлива */
.sc-border-yes { border-left-color: #00ff88; }
.sc-border-low { border-left-color: #fbbf24; }
.sc-border-queue { border-left-color: #f59e0b; }
.sc-border-no { border-left-color: #ff4444; }
.sc-border-limit { border-left-color: #8888ff; }
.sc-border-unknown { border-left-color: var(--tx4); }

/* Card entrance stagger (indices set by JS) */
.station-card[data-stagger="0"] { animation-delay: 0s; }
.station-card[data-stagger="1"] { animation-delay: .03s; }
.station-card[data-stagger="2"] { animation-delay: .06s; }
.station-card[data-stagger="3"] { animation-delay: .09s; }
.station-card[data-stagger="4"] { animation-delay: .12s; }
.station-card[data-stagger="5"] { animation-delay: .15s; }
.station-card[data-stagger="6"] { animation-delay: .18s; }
.station-card[data-stagger="7"] { animation-delay: .21s; }
.station-card[data-stagger="8"] { animation-delay: .24s; }
.station-card[data-stagger="9"] { animation-delay: .27s; }
.station-card[data-stagger="10"] { animation-delay: .3s; }
.station-card[data-stagger="11"] { animation-delay: .33s; }
.station-card[data-stagger="12"] { animation-delay: .36s; }
.station-card[data-stagger="13"] { animation-delay: .39s; }
.station-card[data-stagger="14"] { animation-delay: .42s; }
.station-card[data-stagger="15"] { animation-delay: .45s; }

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.97); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

/* ─── Skeleton loading ─── */
.skeleton-list { padding: 6px; }
.skeleton-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  margin-bottom: 6px;
  background: var(--bg3);
  border-radius: 10px;
  overflow: hidden;
}
.skeleton-card-shimmer {
  width: 100%;
  height: 16px;
  border-radius: 4px;
  background: linear-gradient(90deg, var(--bg4) 25%, var(--bg3) 50%, var(--bg4) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}
.skeleton-card .sk-logo { width: 32px; height: 32px; flex-shrink: 0; }
.skeleton-card .sk-name { width: 40%; }
.skeleton-card .sk-addr { width: 65%; margin-top: 6px; height: 12px; }
.skeleton-card .sk-dist { width: 20%; margin-top: 6px; height: 12px; margin-left: auto; flex-shrink: 0; }
.skeleton-card .sk-body { flex: 1; min-width: 0; }

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Tab content transition */
.tab-content {
  transition: opacity .2s ease;
}
.tab-content.fading {
  opacity: 0;
}

/* Empty states with icon */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  text-align: center;
  color: var(--tx4);
  gap: 8px;
}
.empty-state svg {
  width: 48px;
  height: 48px;
  opacity: .3;
  margin-bottom: 4px;
}
.empty-state-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--tx3);
}
.empty-state-desc {
  font-size: 13px;
  color: var(--tx4);
  max-width: 240px;
  line-height: 1.4;
}

/* Status indicator removed — now uses colored left border on .station-card */

.sc-logo {
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sc-logo img {
  width: 28px;
  height: 28px;
  border-radius: 4px;
  background: rgba(255,255,255,.06);
  object-fit: contain;
}

.sc-info { flex: 1; min-width: 0; }
.sc-top { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.sc-name {
  font-size: 12px;
  font-weight: 600;
  color: var(--tx1);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.3;
}
.sc-name-brand { font-weight: 400; color: var(--tx3); font-size: 11px; }
.sc-meta-time { font-size: 11px; color: var(--tx4); white-space: nowrap; flex-shrink: 0; }
.sc-brand { font-size: 12px; color: var(--accent); font-weight: 500; }
.sc-addr { font-size: 11px; color: var(--tx3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sc-meta { display: flex; align-items: center; gap: 2px 4px; margin-top: 1px; flex-wrap: wrap; font-size: 11px; }
.sc-prices { display: inline; }
.sc-prices .pp-price-item { font-size: 11px; }
.sc-prices .pp-price-fuel { color: var(--tx4); }
.sc-prices .pp-price-value { color: var(--bl); font-weight: 700; }
.sc-conf {
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--tx4);
}
.sc-status-badge {
  background: var(--bg3);
  white-space: nowrap;
}
.sc-status-badge.sc-yes { color: var(--gr); background: color-mix(in srgb, var(--gr) 12%, transparent); }
.sc-status-badge.sc-no { color: var(--rd); background: color-mix(in srgb, var(--rd) 12%, transparent); }
.sc-status-badge.sc-queue { color: #e6a817; background: color-mix(in srgb, #e6a817 12%, transparent); }
.sc-status-badge.sc-low { color: #e67e17; background: color-mix(in srgb, #e67e17 12%, transparent); }
.sc-status-badge.sc-limit { color: var(--tx4); background: var(--bg3); }
.sc-time { background: none; padding: 1px 2px; color: var(--tx4); opacity: 0.7; }
.sc-conf[title] { position: relative; }
.sc-conf[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: calc(100% + 4px);
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a2e;
  color: #fff;
  font-size: 10px;
  padding: 3px 7px;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}
.sc-extra { margin-top: 1px; font-size: 12px; line-height: 1.3; }
.sc-hours { color: var(--tx4); }
.sc-phone { color: var(--bl); cursor: pointer; text-decoration: none; }
.sc-phone:hover { text-decoration: underline; }

/* ─── FAB ─── */
.fab {
  position: absolute;
  bottom: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: var(--on-accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 6px 24px rgba(0,133,107,.35);
  transition: all var(--transition);
  z-index: 100;
}
.fab:hover { background: var(--accent); transform: scale(1.05); opacity: .85; }
.fab:active { transform: scale(.95); }

/* ─── Map Controls ─── */
.map-controls {
  position: absolute;
  right: 16px;
  bottom: 80px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  z-index: 500;
}
.map-controls-group {
  display: flex;
  flex-direction: column;
  gap: 1px;
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.map-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  background: var(--bg2);
  color: var(--tx2);
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  transition: all var(--transition);
}
.map-btn:hover { background: var(--bg4); color: var(--tx1); }
.map-btn + .map-btn { border-top: 1px solid var(--bd2); }

/* ─── Map legend ─── */
.map-legend {
  position: absolute;
  right: 16px;
  bottom: calc(80px + 36px + 8px); /* above controls + legendBtn + gap */
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 10px 12px;
  z-index: 499;
  min-width: 150px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}
.legend-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--tx1);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.legend-row {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--tx2);
  padding: 2px 0;
}
.legend-dot {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-divider {
  height: 1px;
  background: var(--bd2);
  margin: 4px 0;
}
.legend-note {
  font-size: 11px;
  color: var(--tx4);
  margin-top: 4px;
  font-style: italic;
}

/* Locate button — красная капелька без кружка */
.map-btn-locate {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 44px;
  border: none;
  background: transparent;
  cursor: pointer;
  transition: transform var(--transition);
  margin: 0 auto;
}
.map-btn-locate:hover { transform: scale(1.15); }
.map-btn-locate:active { transform: scale(.92); }
.map-btn-locate svg { width: 22px; height: 28px; }

/* User location marker — синяя точка с пульсацией */
.user-location-marker {
  background: none !important;
  border: none !important;
}
.user-location-marker .pulse-ring {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24px;
  height: 24px;
  margin: -12px 0 0 -12px;
  border-radius: 50%;
  background: rgba(66, 133, 244, .25);
  animation: userPulse 2s ease-out infinite;
  pointer-events: none;
}
.user-location-marker .pulse-dot-center {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 12px;
  height: 12px;
  margin: -6px 0 0 -6px;
  border-radius: 50%;
  background: #4285F4;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0,0,0,.3);
  pointer-events: none;
}
@keyframes userPulse {
  0% { transform: scale(.5); opacity: 1; }
  100% { transform: scale(2.5); opacity: 0; }
}

/* ─── Geo Prompt ─── */
.geo-prompt {
  position: absolute;
  bottom: 180px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  padding: 20px 24px;
  box-shadow: var(--shadow);
  z-index: 600;
  text-align: center;
  max-width: 320px;
  display: none;
}
.geo-prompt p { font-size: 14px; color: var(--tx3); margin-bottom: 14px; }
.geo-prompt-actions { display: flex; gap: 8px; justify-content: center; }

/* ─── Buttons (CRM Modern pill style) ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-size: 15px;
  font-weight: 400;
  font-family: var(--f);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  white-space: nowrap;
}
.btn:hover { opacity: .85; }
.btn:active { transform: scale(.97); }
.btn-primary { background: var(--accent); color: var(--on-accent); border: 1px solid var(--accent); }
.btn-secondary { background: var(--bg2); border: 1px solid var(--bd); color: var(--tx1); }
.btn-secondary:hover { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn-ghost { background: transparent; color: var(--tx2); border: 1px solid var(--bd); }
.btn-ghost:hover { background: var(--bg4); color: var(--tx1); }
.btn-sm { padding: 6px 16px; font-size: 14px; }
.btn-lg { padding: 14px 32px; font-size: 17px; }
.btn-ico { width: 38px; height: 38px; padding: 0; border-radius: 50%; }

/* ─── Modal ─── */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(0,0,0,.6);
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity .2s ease;
}
.modal-overlay.active { opacity: 1; }
.modal-overlay.active { display: flex; }
.modal {
  background: var(--bg2);
  border: 1px solid var(--bd);
  border-radius: var(--radius);
  width: 90%;
  max-width: 440px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow);
}
.modal-wide { max-width: 520px; }
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px;
  border-bottom: 1px solid var(--bd);
}
.modal-header h3 { font-size: 17px; font-weight: 600; font-family: var(--fh); }
.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--bd);
  border-radius: 50%;
  background: transparent;
  color: var(--tx3);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
  font-size: 17px;
}
.modal-close:hover { background: var(--bg4); color: var(--tx1); }
.modal-body { padding: 22px; overflow-y: auto; flex: 1; }
.modal-footer {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  padding: 14px 22px;
  border-top: 1px solid var(--bd);
}
.modal-footer-board {
  display: flex;
  gap: 1px;
  padding: 8px 12px 12px;
  justify-content: stretch;
}
.modal-footer-board .board-btn {
  padding: 7px 4px;
  font-size: 12px;
  border-radius: 4px;
}
.modal-note { font-size: 13px; color: var(--tx3); margin-bottom: 16px; }

/* ─── Auth Modal ─── */
.auth-modal { max-width: 380px; }
.auth-providers { display: flex; flex-direction: column; gap: 10px; margin-bottom: 16px; }
.auth-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--bd);
  background: var(--bg3);
  color: var(--tx1);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  justify-content: center;
}
.auth-btn svg { flex-shrink: 0; }
.auth-btn span { flex: 1; text-align: left; }
.auth-btn:hover { background: var(--bg4); border-color: var(--accent); }
.auth-btn:disabled { opacity: .5; cursor: default; }
.auth-tg { background: #1e96c8; color: #fff; border-color: #1e96c8; }
.auth-tg:hover { background: #1688b8; color: #fff; }
.auth-vk { background: #0077ff; color: #fff; border-color: #0077ff; }
.auth-vk:hover { background: #0066dd; color: #fff; }
.auth-ya { background: #fc3f1d; color: #fff; border-color: #fc3f1d; }
.auth-ya:hover { background: #e03514; color: #fff; }
.auth-info { font-size: 13px; color: var(--tx3); line-height: 1.4; text-align: center; }
.profile-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg3);
  border-radius: var(--radius);
  margin-bottom: 16px;
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--bg4);
  flex-shrink: 0;
}
.profile-info { flex: 1; min-width: 0; }
.profile-name { font-size: 17px; font-weight: 700; color: var(--tx1); }
.profile-meta { font-size: 12px; color: var(--tx4); margin-top: 2px; }
.profile-actions { display: flex; gap: 8px; justify-content: center; }

/* Profile stats & ranks */
.profile-stats {
  background: var(--bg3);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}
.profile-rank {
  font-size: 14px;
  font-weight: 700;
  text-align: center;
  margin-bottom: 10px;
  color: var(--accent);
}
.profile-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 10px;
}
.stat-item {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stat-value {
  font-size: 20px;
  font-weight: 700;
  color: var(--tx1);
}
.stat-label {
  font-size: 11px;
  color: var(--tx4);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.profile-xp-bar {
  height: 6px;
  background: var(--bg4);
  border-radius: 3px;
  overflow: hidden;
}
.profile-xp-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--accent2, var(--accent)));
  border-radius: 3px;
  transition: width 0.4s ease;
}

/* ─── Profile Car Section ─── */
.profile-car-section {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg3);
  border-radius: var(--radius);
}
.profile-section-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--tx3);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.profile-car-form { display: flex; flex-direction: column; gap: 10px; }
.car-field { display: flex; flex-direction: column; gap: 4px; }
.car-label { font-size: 12px; color: var(--tx4); font-weight: 500; }
.car-select-wrap { position: relative; }
.car-select {
  width: 100%;
  padding: 8px 28px 8px 10px;
  font-size: 14px;
  color: var(--tx1);
  background: var(--bg4);
  border: 1px solid var(--bd);
  border-radius: 8px;
  appearance: none;
  cursor: pointer;
  outline: none;
  font-family: inherit;
}
.car-select:focus { border-color: var(--accent); }
.car-select:disabled { opacity: 0.5; cursor: default; }
.car-select-wrap::after {
  content: '▾';
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--tx4);
  pointer-events: none;
  font-size: 10px;
}
.car-save-btn { margin-top: 4px; width: 100%; }
.car-save-btn:disabled { opacity: 0.5; cursor: default; }
.car-display {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
}
.car-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
  border-radius: 6px;
  background: #fff;
  padding: 4px;
}
.car-display-name { font-size: 15px; font-weight: 600; color: var(--tx1); }
.car-display-meta { font-size: 12px; color: var(--tx4); margin-top: 1px; }
.car-display-info { flex: 1; min-width: 0; }
.car-model-photo-wrap { position:relative; width:100%; max-height:160px; overflow:hidden; border-radius:8px; margin-top:8px }
.car-model-photo-wrap:empty { display:none }
.car-model-photo { width:100%; height:auto; max-height:160px; object-fit:cover; border-radius:8px; background:var(--bg2) }
.car-edit-btn {
  margin-left: auto;
  background: none;
  border: none;
  color: var(--tx3);
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 6px;
  line-height: 1;
}
.car-edit-btn:hover { background: var(--bg4); color: var(--tx1); }

/* ─── Status Cards (report modal) ─── */
.status-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.status-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border: 2px solid var(--bd);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  cursor: pointer;
  transition: all var(--transition);
}
.status-card:hover { border-color: var(--accent); }
.status-card.selected { border-color: var(--accent); background: rgba(0,133,107,.08); }
.status-card.sc-yes.selected { border-color: #22C55E; background: rgba(34,197,94,.08); }
.status-card.sc-queue.selected { border-color: #F97316; background: rgba(249,115,22,.08); }
.status-card.sc-low.selected { border-color: #EAB308; background: rgba(234,179,8,.08); }
.status-card.sc-no.selected { border-color: #EF4444; background: rgba(239,68,68,.08); }
.status-card.sc-limit.selected { border-color: #8B5CF6; background: rgba(139,92,246,.08); }
.sc-icon { font-size: 20px; }
.sc-label { font-size: 12px; font-weight: 500; text-align: center; line-height: 1.3; color: var(--tx2); }

.station-preview {
  padding: 12px 16px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
}
.station-preview strong { display: block; font-size: 14px; margin-bottom: 2px; }

/* ─── Filter chips ─── */
.filter-section { margin-bottom: 16px; }
.filter-label {
  font-size: 12px;
  color: var(--tx3);
  margin-bottom: 8px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-brand-chip { font-size: 12px; }
.filter-brand-chip.off { opacity: .4; }
.chip {
  padding: 6px 14px;
  border: 1px solid var(--bd2);
  border-radius: var(--radius-pill);
  background: var(--bg2);
  color: var(--tx2);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.active { background: rgba(0,133,107,.12); border-color: var(--accent); color: var(--accent); }

.filter-select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--tx1);
  font-size: 14px;
}

/* ─── Report options ─── */
.chip-label { font-size: 12px; color: var(--tx3); margin-right: 4px; align-self: center; }
.fuel-chips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin-bottom: 16px; }
.fuel-chips .chip:hover { border-color: var(--bl); }
.fuel-chips .chip.active { background: var(--bl); color: var(--white); border-color: var(--bl); }

.report-option {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--tx3);
  cursor: pointer;
  margin-bottom: 16px;
}
.report-option input { accent-color: var(--bl); }
.report-actions { display: flex; gap: 8px; justify-content: flex-end; }

/* ─── Queue length buttons ─── */
.queue-len-btns { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.queue-len-chip { font-size: 12px; padding: 6px 12px; border-radius: var(--radius-sm); border: 1px solid var(--bd); background: var(--bg2); color: var(--tx2); cursor: pointer; transition: all .15s; }
.queue-len-chip:hover { border-color: var(--bl); }
.queue-len-chip.active { background: var(--bl); color: var(--white); border-color: var(--bl); }

/* ─── Form ─── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; color: var(--tx3); margin-bottom: 4px; }
.form-input {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--bd);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--tx1);
  font-size: 15px;
  font-family: var(--f);
  outline: none;
  transition: border-color var(--transition);
}
.form-input:focus { border-color: var(--accent); }
.form-row { display: flex; gap: 12px; }
.form-row .form-group { flex: 1; }

/* ─── Station Detail ─── */
.station-detail { padding: 0; }
.station-detail-info { margin-bottom: 16px; }
.station-detail-info p { font-size: 15px; color: var(--tx3); margin-bottom: 4px; }
.station-detail-hl {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg3);
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
}
.sd-status { font-weight: 600; font-size: 14px; }
.sd-status.yes { color: var(--gr); }
.sd-status.queue { color: var(--accent); }
.sd-status.low { color: var(--accent); }
.sd-status.no { color: var(--rd); }
.sd-status.unknown { color: var(--tx4); }

.sd-history { margin-top: 12px; }
.sd-history h4 {
  font-size: 12px;
  color: var(--tx4);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.sd-history-item {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--bd2);
  font-size: 12px;
}
.sd-history-item:last-child { border-bottom: none; }

/* ─── Loading ─── */
.loading-pulse {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 24px;
  justify-content: center;
  color: var(--tx4);
  font-size: 13px;
}
.pulse-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 1.2s infinite;
}
@keyframes pulse { 0%, 100% { opacity: .4; transform: scale(.8); } 50% { opacity: 1; transform: scale(1.2); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .pulse-dot { animation: none; opacity: .6; }
}

/* ─── Toast ─── */
.toast-container {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 3000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast {
  padding: 10px 20px;
  border-radius: var(--radius-sm);
  background: var(--bg2);
  border: 1px solid var(--bd);
  color: var(--tx1);
  font-size: 13px;
  box-shadow: var(--shadow);
  animation: toastIn .2s ease-out;
  pointer-events: none;
}
.toast.success { border-color: var(--gr); }
.toast.error { border-color: var(--rd); }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* ─── Leaflet overrides ─── */
.leaflet-container { background: var(--bg); }
.leaflet-control-zoom { display: none !important; }

/* ── Cluster icons ── */
.custom-cluster-icon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1px;
  border-radius: 50%;
  box-shadow: 0 2px 8px rgba(0,0,0,.35);
  cursor: pointer;
  transition: transform .15s;
}
.custom-cluster-icon:hover { transform: scale(1.1); }
.cluster-icon-svg { display: block; flex-shrink: 0; }
.cluster-count {
  color: #fff;
  font-weight: 700;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}
.cluster-price {
  color: rgba(255,255,255,.9);
  font-weight: 600;
  line-height: 1;
  text-shadow: 0 1px 2px rgba(0,0,0,.3);
}

/* MarkerCluster default icons hidden — we use custom */
.marker-cluster-small,
.marker-cluster-medium,
.marker-cluster-large { display: none !important; }

/* Marker icons */
.custom-marker { background: transparent !important; border: none !important; }
.brand-marker { background: transparent !important; border: none !important; z-index: 10000 !important; }

/* ─── Price board — LED-табло в редакторе цен ─── */
.pc-board {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 12px;
  overflow: hidden;
}
.pc-board-inner {
  padding: 4px 0;
}
/* Строка топлива — переиспользуем ld-row из попапа, но с курсором */
.pc-board-inner .ld-row {
  cursor: pointer;
  padding: 6px 12px;
  transition: background .15s;
  border-top: 1px solid #1a1a1a;
}
.pc-board-inner .ld-row:first-child { border-top: none; }
.pc-board-inner .ld-row:hover { background: rgba(255,255,255,.04); }
/* Выбранная строка мигает */
.pc-row-sel {
  background: rgba(0,255,136,.06) !important;
  animation: pcBlink 1.2s ease-in-out infinite;
}
@keyframes pcBlink {
  0%, 100% { background: rgba(0,255,136,.06); }
  50% { background: rgba(0,255,136,.14); }
}
/* Цена изменена — ярче, сильнее свечение */
.pc-digit-staged {
  color: #88ffbb !important;
  text-shadow: 0 0 8px rgba(136,255,187,0.6), 0 0 24px rgba(136,255,187,0.2) !important;
}
.pc-na { color: #666; font-size: 13px; font-family: var(--f); }

/* ─── Modal: compact price editor ─── */
.modal-numpad { max-width: 320px; }
.modal-numpad .modal-header { padding: 8px 12px; }
.modal-numpad .modal-header h3 { font-size: 14px; }
.modal-numpad .modal-body { padding: 10px 12px 14px; }
.modal-numpad .modal-close { top: 6px; right: 8px; font-size: 16px; }

/* ─── Price board — LED-табло в редакторе цен ─── */
.pc-board {
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.pc-board-inner {
  padding: 2px 0;
}
/* Строка топлива */
.pc-board-inner .ld-row {
  cursor: pointer;
  padding: 4px 12px;
  transition: background .15s;
  border-top: 1px solid #1a1a1a;
}
.pc-board-inner .ld-row:first-child { border-top: none; }
.pc-board-inner .ld-row:hover { background: rgba(255,255,255,.04); }
/* Выбранная строка мигает */
.pc-row-sel {
  background: rgba(0,255,136,.06) !important;
  animation: pcBlink 1.2s ease-in-out infinite;
}
@keyframes pcBlink {
  0%, 100% { background: rgba(0,255,136,.06); }
  50% { background: rgba(0,255,136,.14); }
}
/* Цена изменена — ярче, сильнее свечение */
.pc-digit-staged {
  color: #88ffbb !important;
  text-shadow: 0 0 8px rgba(136,255,187,0.6), 0 0 24px rgba(136,255,187,0.2) !important;
}
.pc-na { color: #666; font-size: 13px; font-family: var(--f); }

/* ─── Numpad (digital keypad for price input) ─── */
.numpad-wrap {
  user-select: none;
}
.numpad-display {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #0d0d0d;
  border: 1px solid #2a2a2a;
  border-radius: 10px;
  padding: 6px 14px;
  margin-bottom: 8px;
  min-height: 42px;
}
.numpad-digits {
  font-family: 'Calculator', monospace;
  font-size: 32px;
  font-weight: 700;
  color: #00ff88;
  text-shadow: 0 0 8px rgba(0,255,136,0.4);
  letter-spacing: 1px;
  line-height: 1;
}
.numpad-currency {
  font-size: 20px;
  font-weight: 600;
  color: #888;
}
.numpad-keys {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 5px;
  margin-bottom: 10px;
}
.npk {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border: 1px solid var(--bd);
  border-radius: 10px;
  background: var(--bg3);
  color: var(--tx1);
  font-size: 20px;
  font-weight: 600;
  cursor: pointer;
  transition: all .12s;
  font-family: inherit;
  -webkit-tap-highlight-color: transparent;
}
.npk:hover { background: var(--bg4); border-color: var(--accent); }
.npk:active { transform: scale(.95); background: var(--accent); color: var(--on-accent); }
.npk-dot { font-weight: 700; }
.npk-del { color: #ff6666; font-size: 18px; border-color: #442222; }
.npk-del:hover { background: #332222; border-color: #ff6666; }
.npk-submit {
  display: block;
  width: 100%;
  padding: 12px;
  font-size: 15px;
  border-radius: 10px;
  margin-top: 2px;
}
.numpad-warn {
  text-align: center;
  font-size: 12px;
  color: #ff6666;
  min-height: 18px;
  margin-bottom: 6px;
  transition: opacity .2s;
}

/* ─── Brand filter bar ─── */
.brand-filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 8px 12px;
  border-top: 1px solid var(--bd);
  background: var(--bg2);
}
.brand-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border: 1px solid var(--bd);
  border-radius: var(--radius-pill);
  background: var(--bg2);
  color: var(--tx1);
  font-size: 11px;
  cursor: pointer;
  transition: all var(--transition);
}
.brand-chip:hover { background: var(--bg4); }
.brand-chip.off { opacity: .4; }

/* ─── Route options ─── */
.route-options { display: flex; flex-direction: column; gap: 8px; }
.route-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid var(--bd);
  border-radius: var(--radius-sm);
  background: var(--bg2);
  color: var(--tx1);
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition);
  font-weight: 500;
}
.route-option .route-icon { flex-shrink: 0; }
.route-option:hover { border-color: var(--accent); background: rgba(0,133,107,.06); }

/* ─── Station detail sections ─── */
.sd-section { margin-top: 12px; }
.sd-section-title {
  font-size: 12px;
  color: var(--tx4);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}

/* ─── Price history mini chart ─── */
.pc-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.pc-fuel { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.pc-label { font-size: 11px; color: var(--tx4); font-weight: 600; }
.pc-svg { background: var(--bg); border-radius: 4px; }
.pc-chart-wrap { width: 160px; height: 80px; }

/* ─── Photo gallery ─── */
.sd-photos-grid { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.sd-photo-thumb { width: 80px; height: 80px; border-radius: 6px; overflow: hidden; border: 1px solid var(--bd); flex-shrink: 0; transition: transform .15s; }
.sd-photo-thumb:hover { transform: scale(1.05); }
.sd-photo-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sd-photos-loading { font-size: 13px; color: var(--tx4); padding: 4px 0; }
.pc-values { display: flex; justify-content: space-between; width: 100%; font-size: 9px; color: var(--tx4); }
.pc-low { text-align: left; }
.pc-high { text-align: right; }

/* ─── Fuel types row ─── */
.fuel-types-row { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 2px; }
.fuel-chip {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  background: var(--bg3);
  color: var(--tx2);
  border: 1px solid var(--bd2);
}

/* Все названия топлива — капслок */
.fuel-chip,
.ld-fuel,
.pp-price-fuel,
.sc-prices .pp-price-fuel,
.fuel-types-row .fuel-chip { text-transform: uppercase; }
/* Но цифры/AI-префиксы не растягивать */
.fuel-chip, .ld-fuel { letter-spacing: 0.3px; }

/* ─── Responsive ─── */
.sidebar-handle {
  display: none;
}
@media (max-width: 768px) {
  .sidebar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    min-width: 0;
    height: 45vh;
    border-right: none;
    border-top: 1px solid var(--bd);
    border-radius: var(--radius) var(--radius) 0 0;
    z-index: 800;
    transition: transform .35s cubic-bezier(.32,.72,0,1), height .35s cubic-bezier(.32,.72,0,1);
    will-change: transform, height;
  }
  .sidebar.collapsed { /* transform handled by JS */ }
  .sidebar.expanded { height: calc(100vh - 60px) !important; /* full screen minus top gap */ }

  .sidebar-handle {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    padding: 2px 0 0;
    cursor: grab;
    touch-action: none;
    flex-shrink: 0;
  }
  .sidebar-handle-bar {
    width: 32px;
    height: 3px;
    border-radius: 2px;
    background: var(--tx4);
    opacity: 0.5;
    transition: opacity .2s;
  }
  .sidebar-handle:active .sidebar-handle-bar { opacity: 0.8; }

  .map-controls { bottom: calc(45vh + 20px); }
  .geo-prompt { bottom: calc(45vh + 90px); }
  .modal { width: 95%; max-width: 95%; }
  .sidebar-header { padding: 2px 8px 4px; }
  .sidebar-top-row .logo { font-size: 12px; }
  .sidebar-top-row .logo span { font-size: 10px; }
  .sidebar-toolbar { padding: 4px 8px; }
  .fuel-pills { padding: 2px 6px; }
  .fuel-pills .pill { padding: 2px 8px; font-size: 10px; }
  .search-bar { padding: 3px 8px; }
  .search-input { font-size: 12px; }
  .tab-bar { padding: 3px; }
  .tab { padding: 5px 8px; font-size: 11px; }
  .filter-btn { padding: 2px 6px; font-size: 11px; }
  .station-count { font-size: 10px; }
  .brand-filter-bar { padding: 4px 8px; }
  .station-card { padding: 6px 10px; gap: 4px; }
  .station-card .sd-name { font-size: 12px; }
  .station-card .sd-addr { font-size: 10px; }
  .station-card .sd-status { font-size: 10px; }
  .station-card .sd-price { font-size: 11px; }
}

/* Sidebar collapsed — map controls follow */
.sidebar.collapsed ~ .map-container .map-controls { bottom: 80px; }
.sidebar.collapsed ~ .map-container .geo-prompt { bottom: 130px; }
.sidebar.collapsed ~ .map-container .map-legend { bottom: calc(80px + 36px + 8px); }
.sidebar.expanded ~ .map-container .map-controls { bottom: 24px; }
.sidebar.expanded ~ .map-container .geo-prompt { bottom: 100px; }
.sidebar.expanded ~ .map-container .map-legend { bottom: calc(24px + 36px + 8px); }

/* ─── Prices in popup (sidebar fallback) ─── */
.pp-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 8px;
  margin: 4px 0;
  padding: 4px 8px;
  background: rgba(16,134,249,.06);
  border-radius: 6px;
}
.pp-price-item {
  font-size: 12px;
  color: var(--tx3);
  white-space: nowrap;
}
.pp-price-fuel { color: var(--tx4); }
.pp-price-value { color: var(--bl); font-weight: 700; }

.sd-brand-prices {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 12px;
}
.sd-brand-prices .pp-price-item { font-size: 15px; }
.sd-brand-prices .pp-price-value { font-size: 17px; }
.sc-prices .pp-prices { background: transparent; padding: 0; margin: 2px 0 0; gap: 2px 6px; }

/* ─── GAS STATION PRICE BOARD POPUP ─── */
.board-wrap {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  width: 200px;
  background: var(--popup-bg);
  border-radius: 6px;
  overflow: hidden;
  line-height: 1.2;
}
/* Header — compact station name */
.board-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 8px 3px;
  gap: 6px;
}
.board-name {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 600;
  color: var(--popup-text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  letter-spacing: .3px;
}
.board-name img { border-radius: 3px; width: 14px; height: 14px; flex-shrink: 0; }
/* ─── Favorite button row ─── */
.board-fav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 5px 8px 7px;
  cursor: pointer;
  color: var(--popup-text-faint);
  transition: all .15s;
  user-select: none;
}
.board-fav-row:hover { color: #FF3B30; background: rgba(128,128,128,.06); }
.board-fav-icon { font-size: 13px; line-height: 1; }
.board-fav-label { font-size: 10px; font-weight: 500; }
.board-fav-row:hover .board-fav-icon { color: #FF3B30; }
.board-addr {
  padding: 0 8px 4px;
  font-size: 9px;
  color: var(--popup-text-dim);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* Status — compact single line with emoji icon + label + time */
.board-status {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
}
.bp-status-icon { font-size: 11px; line-height: 1; flex-shrink: 0; }
.bp-status-label { font-size: 10px; font-weight: 500; color: var(--popup-text-muted); }
.bp-status-time { font-size: 9px; color: var(--popup-text-faint); white-space: nowrap; }
.board-fuels-tag {
  font-size: 9px;
  color: var(--popup-text-dim);
  background: var(--popup-btn-bg);
  padding: 1px 5px;
  border-radius: 4px;
  white-space: nowrap;
  margin-left: auto;
}
/* Status timeline in popup — compact */
.board-timeline {
  padding: 2px 8px;
  display: flex;
  flex-direction: column;
  gap: 1px;
}
.tl-item {
  font-size: 9px;
  color: var(--popup-text-dim);
  display: flex;
  align-items: center;
  gap: 3px;
}
.tl-dot {
  width: 4px; height: 4px;
  border-radius: 50%;
  display: inline-block;
  flex-shrink: 0;
}
.tl-dot.yes { background: #00ff88; }
.tl-dot.queue { background: #D4A017; }
.tl-dot.low { background: #D4A017; }
.tl-dot.no { background: #ff4444; }
.tl-dot.limit { background: #CE93D8; }
.tl-dot.unknown { background: #555; }
.tl-time { margin-left: auto; font-size: 8px; color: var(--popup-text-faint); white-space: nowrap; }

/* Popup summary — compact conf + confidence */
.bp-summary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 2px 8px 1px;
  font-size: 9px;
  color: var(--popup-text-faint);
}

/* Action buttons — compact panel, единый стиль для всех */
.board-actions {
  display: flex;
  gap: 1px;
  margin: 2px 6px 1px;
  border-radius: 4px;
  overflow: hidden;
}
.board-btn {
  flex: 1;
  padding: 5px 2px;
  border: none;
  background: var(--popup-btn-bg);
  color: var(--popup-btn-text);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  font-family: inherit;
  white-space: nowrap;
}
.board-btn:hover { color: var(--popup-btn-hover-text); background: var(--popup-btn-hover-bg); }
.board-btn-report { color: #4ade80; }
.board-btn-report:hover { background: rgba(74,222,128,0.15); }
.board-btn-price { color: #60a5fa; }
.board-btn-price:hover { background: rgba(96,165,250,0.15); }
.board-btn-route { color: #fbbf24; }
.board-btn-route:hover { background: rgba(251,191,36,0.15); }

/* Footer action buttons — те же стили, что и выше */
.board-actions-footer {
  display: flex;
  gap: 1px;
  margin: 0 6px 4px;
  border-radius: 4px;
  overflow: hidden;
}
.board-act-footer {
  flex: 1;
  padding: 4px 2px;
  border: none;
  background: var(--popup-btn-bg);
  color: var(--popup-btn-text);
  font-size: 9px;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  font-family: inherit;
  white-space: nowrap;
}
.board-act-footer:hover { color: var(--popup-btn-hover-text); background: var(--popup-btn-hover-bg); }
.board-act-incorrect { color: #fbbf24; }
.board-act-incorrect:hover { background: rgba(251,191,36,0.12); }
.board-act-share { color: #60a5fa; }
.board-act-share:hover { background: rgba(96,165,250,0.12); }
.board-act-sub { color: #34d399; }
.board-act-sub:hover { background: rgba(52,211,153,0.12); }

/* Leaflet popup overrides */
.leaflet-popup-content-wrapper {
  background: var(--popup-bg) !important;
  border-radius: 6px !important;
  padding: 0 !important;
  box-shadow: 0 4px 20px rgba(0,0,0,.4) !important;
  border: 1px solid var(--popup-border) !important;
}
.leaflet-popup-content {
  margin: 0 !important;
  font-size: inherit !important;
  line-height: inherit !important;
  width: auto !important;
  max-width: 210px !important;
  min-width: 160px !important;
}
.leaflet-popup-tip { display: none !important; }
.leaflet-popup-close-button {
  top: 4px !important;
  right: 4px !important;
  font-size: 14px !important;
  color: var(--popup-text-faint) !important;
  width: 18px !important;
  height: 18px !important;
  z-index: 10 !important;
}

/* ─── Services & payment chips ─── */
.pp-section-label {
  font-size: 10px;
  color: var(--popup-text-dim);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin: 4px 8px 2px;
}
.svc-row { display: flex; flex-wrap: wrap; gap: 3px; padding: 0 8px; }
.svc-chip {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 1px 6px 1px 4px;
  font-size: 10px;
  color: var(--popup-svc-text);
  background: var(--popup-svc-bg);
  border-radius: 4px;
  line-height: 1.3;
}
.svc-icon { font-size: 11px; }

.pp-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  margin: 4px 8px 2px;
}
.pp-contact {
  font-size: 10px;
  color: var(--popup-text-dim);
  text-decoration: none;
  white-space: nowrap;
}
.pp-contact:hover { color: #60a5fa; text-decoration: underline; }
.pp-operator { font-size: 10px; color: var(--popup-text-dim); margin: 2px 8px; }

.leaflet-control-attribution { display: none !important; }

/* ═══════════════════════════
   Station detail — gas station price board style
   ═══════════════════════════ */
.price-digit {
  font-family: 'Calculator', monospace;
  font-weight: 700;
  letter-spacing: 1px;
  font-size: 20px;
}

/* LED-style price board — hero of the popup */
.ld-board {
  padding: 6px 8px 4px;
}
.ld-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
}
.ld-row + .ld-row {
  border-top: 1px solid var(--popup-border);
}
.ld-fuel {
  font-size: 12px;
  color: var(--popup-fuel-text);
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.ld-val {
  display: flex;
  align-items: center;
  gap: 2px;
}
.ld-val .price-digit {
  font-size: 24px;
  color: var(--popup-digit-color);
  text-shadow: var(--popup-digit-glow);
}
/* Статусные цвета цен — всегда яркие, не зависят от темы */
.ld-board-yes .ld-val .price-digit {
  color: #00ff88;
  text-shadow: 0 0 6px rgba(0,255,136,0.5), 0 0 20px rgba(0,255,136,0.15);
}
.ld-board-low .ld-val .price-digit {
  color: #fbbf24;
  text-shadow: 0 0 6px rgba(251,191,36,0.5), 0 0 20px rgba(251,191,36,0.15);
}
.ld-board-queue .ld-val .price-digit {
  color: #f59e0b;
  text-shadow: 0 0 6px rgba(245,158,11,0.5), 0 0 20px rgba(245,158,11,0.15);
}
.ld-board-no .ld-val .price-digit {
  color: #ff4444;
  text-shadow: 0 0 6px rgba(255,68,68,0.5), 0 0 20px rgba(255,68,68,0.15);
}
.ld-board-limit .ld-val .price-digit {
  color: #8888ff;
  text-shadow: 0 0 6px rgba(136,136,255,0.5), 0 0 20px rgba(136,136,255,0.15);
}
.ld-trend { font-size: 11px; }
.ld-trend.up { color: #ff4444; }
.ld-trend.down { color: #00cc66; }
.ld-muted { color: var(--popup-muted-text); font-size: 11px; }

/* Queue bar */
.ld-queue {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 4px 0;
}
.ld-queue-bar {
  flex: 1;
  height: 8px;
  background: var(--popup-queue-bar-bg);
  border-radius: 4px;
  overflow: hidden;
  max-width: 80px;
}
.ld-queue-fill {
  height: 100%;
  background: linear-gradient(90deg, #ff8800, #ff4444);
  border-radius: 4px;
  transition: width 0.3s;
}
.ld-queue-label {
  font-size: 12px;
  color: var(--popup-queue-label);
  white-space: nowrap;
}

/* Popup queue */
.board-wrap .ld-queue {
  padding: 0 8px 2px;
  margin: 0;
}

/* Station detail panel */
.station-detail-panel { padding: 0; }
.sd-board-header {
  background: var(--bg);
  border-radius: 10px 10px 0 0;
  padding: 14px 16px 10px;
  text-align: center;
  border-bottom: 1px solid var(--bd);
}
.sd-board-header .sd-name {
  font-size: 17px;
  font-weight: 700;
  color: var(--tx1);
  margin: 0;
  line-height: 1.3;
}
.sd-board-header .sd-address {
  font-size: 12px;
  color: var(--tx3);
  margin-top: 3px;
  line-height: 1.4;
}
.sd-board-status {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  background: var(--bg-card);
  font-size: 14px;
  flex-wrap: wrap;
}
.sd-board-status .sd-stat-icon { font-size: 18px; }
.sd-board-status .sd-stat-label { color: var(--tx1); }
.sd-board-status .sd-stat-time { color: var(--text-muted); font-size: 13px; }
.sd-board-status .sd-stat-fav {
  margin-left: auto;
  font-size: 17px;
  cursor: pointer;
  user-select: none;
}

.sd-section-board {
  padding: 0 16px 14px;
  margin-top: 10px;
}
.sd-section-board h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px;
  font-weight: 600;
}

/* Service & payment chips */
.sd-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.sd-chip {
  font-size: 12px;
  background: var(--bg-card);
  padding: 3px 10px;
  border-radius: 12px;
  color: var(--text-secondary);
  border: 1px solid var(--bd2);
}

/* Contact row */
.sd-contacts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  padding: 12px 16px;
  background: var(--bg-card);
  border-radius: 8px;
  margin: 8px 16px;
  font-size: 14px;
  align-items: center;
}

/* ─── Chat ─── */
.sd-chat { margin-top: 14px; border-top: 1px solid var(--bd); padding-top: 10px; }
.sd-chat h4 { font-size: 14px; font-weight: 600; color: var(--tx1); margin: 0 0 10px; }
.sd-msgs { max-height: 300px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }
.sd-msg { display: flex; gap: 10px; align-items: flex-start; }
.sd-msg-avatar { width: 32px; height: 32px; border-radius: 50%; flex-shrink: 0; background: var(--bg4); color: var(--tx1); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 700; }
.sd-msg-body { flex: 1; min-width: 0; }
.sd-msg-meta { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.sd-msg-author { font-weight: 600; font-size: 12px; color: var(--bl); }
.sd-msg-time { font-size: 11px; color: var(--tx4); }
.sd-msg-text { font-size: 14px; color: var(--tx1); margin-top: 2px; line-height: 1.4; word-break: break-word; }
  line-height: 1.4;
}
.sd-comment-form {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--bd);
}
.sd-comment-form-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.sd-comment-form input,
.sd-comment-form textarea {
  background: var(--bg3);
  border: 1px solid var(--bd2);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  color: var(--tx1);
  font-family: inherit;
  outline: none;
}
.sd-comment-form input:focus,
.sd-comment-form textarea:focus {
  border-color: var(--accent);
}
.sd-comment-form input { flex: 0 0 100px; }
.sd-comment-form textarea { flex: 1; min-height: 36px; resize: vertical; }
.sd-captcha {
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.sd-captcha input { flex: 0 0 60px; width: 60px; }
.sd-comment-btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.sd-comment-btn:hover { opacity: 0.85; }
.sd-comment-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.sd-comment-error { font-size: 13px; color: #e94560; margin-top: 4px; }
.sd-comment-success { font-size: 13px; color: #00c88a; margin-top: 4px; }
.sd-comments-loading {
  text-align: center;
  padding: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

/* Price font in station list cards */
.sc-prices .price-digit {
  font-family: 'Calculator', monospace;
  font-weight: 700;
  font-size: 16px;
  color: var(--accent-green, #00c88a);
  letter-spacing: 0.5px;
}

/* ─── Station detail: status summary (compact one-liner) ─── */
.sd-summary {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  font-size: 12px;
  color: var(--tx3);
  border-bottom: 1px solid var(--bd);
  flex-wrap: wrap;
}
.sd-summary-icon { font-size: 13px; flex-shrink: 0; }
.sd-summary-text { font-weight: 500; color: var(--tx2); }
.sd-summary-conf { font-weight: 600; color: var(--bl); }
.sd-summary-source { color: var(--tx4); }

/* ─── Station detail: action buttons ─── */
.sd-actions {
  display: flex;
  gap: 8px;
  padding: 8px 16px 10px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--bd);
}
.sd-btn {
  flex: 1;
  padding: 8px 12px;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
  white-space: nowrap;
}
.sd-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.sd-btn-confirm {
  background: var(--accent-green, #00c88a);
  color: #fff;
}
.sd-btn-confirm:hover:not(:disabled) { opacity: 0.85; }
.sd-btn-changed {
  background: var(--bg3);
  color: var(--tx1);
  border: 1px solid var(--bd2);
}
.sd-btn-changed:hover:not(:disabled) { background: var(--bg4); }

/* ─── Station detail: enriched history ─── */
.sd-history {
  padding: 0 16px 14px;
  margin-top: 10px;
}
.sd-history h4 {
  font-size: 12px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin: 0 0 8px;
  font-weight: 600;
}
.sd-history-item {
  padding: 8px 10px;
  margin-bottom: 6px;
  background: var(--bg-card);
  border-radius: 8px;
  border: 1px solid var(--bd2);
}
.sd-hi-top {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 4px;
}
.sd-hi-status {
  font-size: 13px;
  font-weight: 600;
}
.sd-hi-time {
  font-size: 11px;
  color: var(--tx4);
  margin-left: auto;
}
.sd-hi-conf {
  font-size: 11px;
  color: var(--accent-green, #00c88a);
  font-weight: 600;
  background: var(--bg3);
  padding: 1px 6px;
  border-radius: 8px;
}
.sd-hi-fuels {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 4px;
}
.sd-fuel-tag {
  font-size: 11px;
  font-weight: 600;
  background: var(--bg3);
  color: var(--tx1);
  padding: 2px 8px;
  border-radius: 4px;
  border: 1px solid var(--bd2);
}
.sd-hi-extras {
  font-size: 12px;
  color: var(--tx3);
  line-height: 1.4;
}
