:root,
:root[data-theme='dark'] {
  --bg: #0d1117;
  --panel: #161b22;
  --panel-2: #1c2230;
  --border: #2a3140;
  --text: #e6edf3;
  --muted: #8b949e;
  --green: #2ea043;
  --green-2: #238636;
  --red: #e5484d;
  --yellow: #d4a017;
  --map-bg: #0a0e14;
}
:root[data-theme='light'] {
  --bg: #f4f6f8;
  --panel: #ffffff;
  --panel-2: #eef1f5;
  --border: #d7dde5;
  --text: #17202b;
  --muted: #5c6773;
  --green: #1f9d3f;
  --green-2: #187a31;
  --red: #d33036;
  --yellow: #b8860b;
  --map-bg: #e8ecef;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
}

#app {
  display: flex;
  height: 100vh;
}

/* --- Sidebar --- */
#sidebar {
  width: 400px;
  min-width: 400px;
  background: var(--panel);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}
.logo {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
}
.logo-mark {
  font-size: 22px;
}
.logo-text b {
  color: var(--green);
}
.top-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.top-actions select,
.city-select select {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  cursor: pointer;
  max-width: 150px;
}
.icon-btn {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 16px;
  cursor: pointer;
}

.search-row {
  padding: 10px 16px 0;
}
.search-row input {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 10px 14px;
  font-size: 14px;
}
.search-row input:focus {
  outline: none;
  border-color: var(--green);
}

.filters {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  flex-wrap: wrap;
  align-items: center;
}
.chip {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
  cursor: pointer;
  transition: 0.15s;
}
.chip:hover {
  color: var(--text);
}
.chip.active {
  background: var(--green-2);
  border-color: var(--green);
  color: #fff;
}
.chip-select {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 20px;
  padding: 6px 10px;
  font-size: 13px;
  cursor: pointer;
  max-width: 165px;
}

.stats-bar {
  display: flex;
  gap: 8px;
  padding: 0 16px 8px;
  font-size: 12px;
}
.stat {
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 700;
}
.stat::before {
  content: '● ';
}
.stat.yes {
  color: var(--green);
  background: rgba(46, 160, 67, 0.12);
}
.stat.limit {
  color: var(--yellow);
  background: rgba(212, 160, 23, 0.12);
}
.stat.no {
  color: var(--red);
  background: rgba(229, 72, 77, 0.12);
}
.stat.unknown {
  color: var(--muted);
  background: rgba(139, 148, 158, 0.12);
}

.list-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  font-weight: 600;
  font-size: 14px;
  color: var(--muted);
}
.count {
  background: var(--panel-2);
  border-radius: 12px;
  padding: 2px 10px;
  font-size: 12px;
}

.station-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 12px 12px;
}

.station-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  cursor: pointer;
  transition: 0.15s;
}
.station-card:hover {
  border-color: var(--green);
}
.station-card .brand-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  background: rgba(0, 0, 0, 0.25);
  flex-shrink: 0;
}
:root[data-theme='light'] .station-card .brand-icon,
:root[data-theme='light'] .detail-head .brand-icon {
  background: rgba(0, 0, 0, 0.06);
}
.station-card .info {
  flex: 1;
  min-width: 0;
}
.station-card .info .row1 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.station-card .brand-name {
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-card .addr {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.station-card .dist {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.badge.yes {
  background: rgba(46, 160, 67, 0.18);
  color: var(--green);
}
.badge.limit {
  background: rgba(212, 160, 23, 0.18);
  color: var(--yellow);
}
.badge.no {
  background: rgba(229, 72, 77, 0.18);
  color: var(--red);
}
.badge.unknown {
  background: rgba(139, 148, 158, 0.18);
  color: var(--muted);
}
.confirm-note {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

/* --- Map --- */
#mapWrap {
  flex: 1;
  position: relative;
}
#map {
  width: 100%;
  height: 100%;
  background: var(--map-bg);
}
.legend {
  position: absolute;
  left: 12px;
  bottom: 24px;
  z-index: 500;
  display: flex;
  gap: 12px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12px;
  color: var(--muted);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}
.legend .dot-l {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-l.yes {
  background: #22c55e;
}
.dot-l.limit {
  background: #f5c518;
}
.dot-l.no {
  background: #ef4444;
}
.dot-l.unknown {
  background: #8a94a6;
}

#locateBtn,
#notifyBtn {
  position: absolute;
  right: 16px;
  z-index: 500;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  font-size: 20px;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
#locateBtn {
  bottom: 24px;
}
#notifyBtn {
  bottom: 80px;
}
#notifyBtn.on {
  background: var(--green);
  color: #fff;
  border-color: var(--green);
}

.maplibregl-marker {
  background: transparent !important;
  border: none !important;
}
.me-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #2ea043;
  border: 3px solid #fff;
  box-shadow: 0 0 0 4px rgba(46, 160, 67, 0.35);
}

/* --- Detail panel --- */
.detail-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  max-width: 90vw;
  height: 100vh;
  background: var(--panel);
  border-left: 1px solid var(--border);
  z-index: 1000;
  overflow-y: auto;
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.5);
  transform: translateX(0);
  transition: transform 0.25s;
}
.detail-panel.hidden {
  transform: translateX(110%);
}
.detail-content {
  padding: 20px;
}
.detail-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.detail-head .brand-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  background: rgba(0, 0, 0, 0.25);
}
.detail-head h2 {
  font-size: 20px;
  flex: 1;
}
.detail-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 26px;
  cursor: pointer;
  line-height: 1;
}

.status-box {
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.status-box.yes {
  background: rgba(46, 160, 67, 0.1);
  border-color: rgba(46, 160, 67, 0.4);
}
.status-box.limit {
  background: rgba(212, 160, 23, 0.1);
  border-color: rgba(212, 160, 23, 0.4);
}
.status-box.no {
  background: rgba(229, 72, 77, 0.1);
  border-color: rgba(229, 72, 77, 0.4);
}
.status-box.unknown {
  background: var(--panel-2);
}
.status-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 8px;
}
.status-title.yes {
  color: var(--green);
}
.status-title.limit {
  color: var(--yellow);
}
.status-title.no {
  color: var(--red);
}
.status-title.unknown {
  color: var(--muted);
}
.status-meta {
  font-size: 13px;
  color: var(--muted);
}

.section-label {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 16px 0 8px;
  font-weight: 700;
}
.fuel-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.fuel-pill {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 13px;
}
.fuel-pill.on {
  background: var(--green-2);
  border-color: var(--green);
  color: #fff;
}

.price-grid {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px 14px;
}
.price-row .fuel {
  color: var(--muted);
  font-size: 13px;
}
.price-row .val {
  font-size: 18px;
  font-weight: 800;
}
.price-row .val span {
  font-size: 12px;
  color: var(--muted);
  font-weight: 400;
}

.add-price {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}
.add-price select,
.add-price input {
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  padding: 8px 10px;
  font-size: 13px;
}
.add-price select {
  flex: 1;
}
.add-price input {
  width: 100px;
}

.detail-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 20px 0;
}

.history-item {
  font-size: 12px;
  color: var(--muted);
  padding: 8px 0;
  border-top: 1px solid var(--border);
}
.history-item b {
  color: var(--text);
}

/* --- Modal --- */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 16px;
}
.modal-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 22px;
  width: 100%;
  max-width: 460px;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-box h3 {
  margin-bottom: 16px;
  font-size: 18px;
}
.field {
  margin-bottom: 16px;
}
.field > label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 700;
}
.field input[type='number'] {
  width: 100%;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text);
  padding: 12px 14px;
  font-size: 14px;
}

.seg {
  display: flex;
  gap: 8px;
}
.seg-btn {
  flex: 1;
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: 12px;
  font-size: 14px;
  cursor: pointer;
}
.seg-btn.active {
  background: var(--green-2);
  border-color: var(--green);
  color: #fff;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.tag {
  background: var(--panel-2);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  cursor: pointer;
}
.tag.on {
  background: var(--green-2);
  border-color: var(--green);
  color: #fff;
}

.hint {
  font-size: 12px;
  color: var(--muted);
  margin: 4px 0 16px;
}
.modal-actions {
  display: flex;
  gap: 10px;
}

.btn {
  border: none;
  border-radius: 10px;
  padding: 14px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary {
  background: var(--green);
  color: #fff;
  flex: 1;
}
.btn.primary:hover {
  background: var(--green-2);
}
.btn.ghost {
  background: var(--panel-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn.block {
  width: 100%;
}

.hidden {
  display: none !important;
}

/* ---------- Видимый фокус для клавиатурной навигации ---------- */
button:focus-visible,
.chip:focus-visible,
.tag:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 2px;
}

/* ---------- Избранные АЗС ---------- */
.fav-btn {
  font-size: 18px;
  color: var(--muted);
}
.fav-btn.on {
  color: var(--yellow);
  border-color: var(--yellow);
}
.station-card .fav-star {
  color: var(--yellow);
  font-size: 13px;
  flex-shrink: 0;
}

/* ---------- Выбор навигатора для маршрута ---------- */
.nav-choice {
  display: flex;
  gap: 8px;
}
.nav-choice .nav-opt {
  flex: 1;
  padding: 10px 8px;
  font-size: 13px;
  white-space: nowrap;
}
.nav-choice .nav-opt:hover {
  border-color: var(--green);
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 14px;
  z-index: 4000;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-width: 92vw;
}

/* ---------- Шкала уверенности ---------- */
.confidence {
  margin: 10px 0 4px;
}
.conf-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}
.conf-i {
  cursor: help;
  opacity: 0.7;
}
.conf-pct {
  font-weight: 700;
  font-size: 15px;
  color: var(--green);
}
.conf-bars {
  display: flex;
  gap: 2px;
}
.conf-bars i {
  flex: 1;
  height: 8px;
  border-radius: 2px;
  background: rgba(128, 128, 128, 0.18);
  transition: background 0.2s;
}
.conf-bars i.on {
  background: var(--green);
}
.conf-note {
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}

/* ---------- Маркеры ---------- */
.dot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.5));
}
.dot svg {
  position: absolute;
  inset: 0;
}

.cluster-donut {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.55));
}
.cluster-donut svg {
  position: absolute;
  inset: 0;
}
/* transform самого .maplibregl-marker не трогаем — его использует MapLibre */
.maplibregl-marker .dot,
.maplibregl-marker .cluster-donut {
  transition: transform 0.12s ease;
}
.maplibregl-marker:hover {
  z-index: 1000;
}
.maplibregl-marker:hover .dot,
.maplibregl-marker:hover .cluster-donut {
  transform: scale(1.12);
}

/* ---------- Кнопка «Я на этой АЗС» ---------- */
#hereBtn {
  position: absolute;
  right: 16px;
  bottom: 136px;
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 24px;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
}
#hereBtn:hover {
  border-color: var(--green);
}
#hereBtn:disabled {
  opacity: 0.6;
  cursor: wait;
}
#hereBtn .hb-ic {
  font-size: 16px;
}

/* ---------- Онбординг первого посещения ---------- */
.onboarding {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2500;
  padding: 16px;
}
.ob-box {
  position: relative;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px 22px;
  width: 100%;
  max-width: 400px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.ob-skip {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  color: var(--muted);
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}
.ob-skip:hover {
  color: var(--text);
}
.ob-step {
  display: none;
  text-align: center;
  min-height: 130px;
}
.ob-step.on {
  display: block;
}
.ob-icon {
  font-size: 40px;
  margin-bottom: 10px;
}
.ob-step h3 {
  font-size: 18px;
  margin-bottom: 8px;
}
.ob-step p {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.55;
}
.ob-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
}
.ob-dot.yes {
  background: #22c55e;
}
.ob-dot.limit {
  background: #f5c518;
}
.ob-dot.no {
  background: #ef4444;
}
.ob-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
}
.ob-dots {
  display: flex;
  gap: 6px;
}
.ob-dots i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border);
  transition: background 0.2s;
}
.ob-dots i.on {
  background: var(--green);
}
.ob-foot .btn {
  flex: 0 0 auto;
  padding: 12px 24px;
}

/* ---------- Приглашение поделиться геолокацией ---------- */
.geoprompt {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2600;
  padding: 16px;
}
.gp-box {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 28px 22px 22px;
  width: 100%;
  max-width: 380px;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5);
}
.gp-icon {
  width: 64px;
  height: 64px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: rgba(46, 160, 67, 0.15);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
}
.gp-box h3 {
  font-size: 19px;
  margin-bottom: 10px;
}
.gp-box p {
  font-size: 13px;
  color: var(--muted);
  line-height: 1.55;
  margin-bottom: 20px;
}
.gp-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.gp-skip {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 13px;
  padding: 6px;
  cursor: pointer;
}
.gp-skip:hover {
  color: var(--text);
}

/* ---------- Баннер согласия на cookies ---------- */
#cookieBanner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 3200;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.35);
}
#cookieBanner .cb-text {
  font-size: 13px;
  line-height: 1.4;
  color: var(--text);
  flex: 1 1 420px;
  max-width: 720px;
}
#cookieBanner .cb-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}
#cookieBanner button {
  border: none;
  border-radius: 10px;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
#cookieBanner #cookieAccept {
  background: var(--green);
  color: #fff;
}
#cookieBanner #cookieDecline {
  background: transparent;
  color: var(--muted);
  border: 1px solid var(--border);
}

/* ---------- Скелетоны загрузки (shimmer) ---------- */
.sk {
  position: relative;
  overflow: hidden;
  background: rgba(128, 128, 128, 0.16);
  border-radius: 8px;
}
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.08), transparent);
  animation: sk-shimmer 1.4s infinite;
}
:root[data-theme='light'] .sk {
  background: rgba(120, 130, 145, 0.18);
}
:root[data-theme='light'] .sk::after {
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.7), transparent);
}
@keyframes sk-shimmer {
  100% {
    transform: translateX(100%);
  }
}
.skeleton-card {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--panel-2);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
}
.sk-icon {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
}
.sk-lines {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.sk-line {
  height: 12px;
  border-radius: 6px;
}
.sk-line.sk-title {
  height: 20px;
  flex: 1;
}
.sk-line.w40 {
  width: 40%;
}
.sk-line.w60 {
  width: 60%;
}
.sk-line.w90 {
  width: 90%;
}
.sk-block {
  height: 64px;
  border-radius: 14px;
  margin: 12px 0;
}
.sk-block.tall {
  height: 150px;
}
.detail-content > .sk-line {
  margin: 16px 0 6px;
}

/* ---------- Серверные кластеры (малый зум) ---------- */
.cluster-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--panel);
  border: 4px solid #8a94a6;
  color: var(--text);
  font-weight: 800;
  font-size: 14px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
  transition: transform 0.12s ease;
}
.cluster-cell.yes {
  border-color: #22c55e;
}
.cluster-cell.limit {
  border-color: #f5c518;
}
.cluster-cell.no {
  border-color: #ef4444;
}
.cluster-cell.unknown {
  border-color: #8a94a6;
}
.maplibregl-marker:hover .cluster-cell {
  transform: scale(1.1);
}

/* ---------- PWA install banner ---------- */
#installBanner {
  position: fixed;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  z-index: 3000;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.5);
  max-width: 92vw;
}
#installBanner .ib-text {
  font-size: 13px;
  line-height: 1.3;
}
#installBanner button {
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 700;
  cursor: pointer;
}
#installBanner .ib-yes {
  background: var(--green);
  color: #fff;
}
#installBanner .ib-no {
  background: transparent;
  color: var(--muted);
}

/* ---------- Мобильный адаптив ---------- */
@media (max-width: 768px) {
  #app {
    flex-direction: column;
  }
  #mapWrap {
    order: 1;
    height: 100vh;
    width: 100%;
  }
  #sidebar {
    order: 2;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    min-width: 0;
    height: 66vh;
    border: none;
    border-top: 1px solid var(--border);
    border-radius: 18px 18px 0 0;
    box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.5);
    transform: translateY(calc(100% - 132px));
    transition: transform 0.28s ease;
    z-index: 1000;
  }
  #sidebar.open {
    transform: translateY(0);
  }
  #sidebar::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    width: 44px;
    height: 5px;
    border-radius: 3px;
    background: var(--border);
  }
  .topbar {
    padding-top: 18px;
  }
  .legend {
    left: 8px;
    bottom: 148px;
    gap: 8px;
    padding: 6px 8px;
    font-size: 11px;
  }
  .detail-panel {
    width: 100%;
    left: 0;
    right: 0;
    max-width: 100%;
    border-radius: 18px 18px 0 0;
  }
  .modal-box {
    max-width: 100%;
    border-radius: 18px 18px 0 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
  }
  #locateBtn {
    bottom: 148px;
  }
  #notifyBtn {
    bottom: 204px;
  }
  #hereBtn {
    bottom: 260px;
    padding: 11px 14px;
  }
  .chip,
  .tag,
  .seg-btn {
    min-height: 44px;
  }
}
