:root {
  --bg: #0b1220;
  --panel: rgba(17, 24, 39, 0.88);
  --panel-border: rgba(255, 255, 255, 0.08);
  --panel-soft: rgba(255, 255, 255, 0.06);
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --text-dim: #94a3b8;
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, 0.34);
  --shadow-md: 0 10px 26px rgba(0, 0, 0, 0.24);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --green: #16a34a;
  --blue: #2563eb;
  --orange: #d97706;
  --violet: #7c3aed;
  --red: #dc2626;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Inter, Arial, sans-serif;
  background: var(--bg);
}

* {
  box-sizing: border-box;
}

body {
  color: var(--text);
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
}

#map {
  width: 100%;
  height: 100%;
}

.status-toast {
  position: fixed;
  left: 50%;
  top: calc(16px + env(safe-area-inset-top));
  transform: translateX(-50%);
  z-index: 4000;
  min-width: 220px;
  max-width: min(92vw, 460px);
  padding: 12px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
  color: #fff;
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
  box-shadow: var(--shadow-md);
  border: 1px solid rgba(255,255,255,0.08);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.status-toast.is-visible {
  opacity: 1;
}

.custom-map-marker {
  background: transparent;
  border: 0;
}

.marker-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  pointer-events: none;
}

.marker-user svg,
.marker-car svg,
.marker-fuel svg,
.marker-charge svg,
.marker-search-point svg,
.marker-fuel-cheapest svg {
  display: block;
}

.marker-fuel-cheapest {
  filter: drop-shadow(0 0 12px rgba(250, 204, 21, 0.7));
}

.marker-fuel {
  filter: drop-shadow(0 2px 6px rgba(15, 23, 42, 0.22));
}

.main-menu {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 2200;
  width: 58px;
}

.main-menu-buttons {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.menu-mini-btn {
  width: 58px;
  height: 58px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 20px;
  color: #fff;
  font-size: 22px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--shadow-lg);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.menu-mini-btn:hover {
  transform: translateY(-1px);
}

.menu-mini-btn:active {
  transform: translateY(1px);
}

.menu-mini-btn-locate {
  background: linear-gradient(180deg, rgba(34,197,94,0.98), rgba(22,163,74,0.95));
}

.menu-mini-btn-parking {
  background: linear-gradient(180deg, rgba(30,41,59,0.98), rgba(15,23,42,0.96));
}

.menu-mini-btn-fuel {
  background: linear-gradient(180deg, rgba(217,119,6,0.98), rgba(180,83,9,0.95));
}

.menu-mini-btn-charge {
  background: linear-gradient(180deg, rgba(124,58,237,0.98), rgba(109,40,217,0.95));
}

.floating-panel {
  position: absolute;
  top: 0;
  right: 74px;
  width: min(88vw, 390px);
  max-height: min(78vh, 720px);
  overflow: auto;
  padding: 16px;
  border-radius: var(--radius-xl);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transform-origin: top right;
  transition: opacity 0.22s ease, transform 0.22s ease, visibility 0.22s ease;
  z-index: 1;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.floating-panel.is-collapsed {
  opacity: 0;
  transform: translateY(-10px) scale(0.96);
  visibility: hidden;
  pointer-events: none;
}

.panel-title {
  color: var(--text);
  font-size: 17px;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.panel-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.action-btn {
  min-height: 50px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  padding: 12px 14px;
  background: rgba(255,255,255,0.98);
  color: #0f172a;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  touch-action: manipulation;
  text-align: center;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
  box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.action-btn:hover {
  transform: translateY(-1px);
}

.action-btn:active {
  transform: translateY(1px);
}

.action-btn-primary {
  background: linear-gradient(180deg, #3b82f6, #2563eb);
  color: #ffffff;
}

.action-btn-danger {
  background: linear-gradient(180deg, #ef4444, #dc2626);
  color: #ffffff;
}

.field-wrap {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--text-soft);
  font-size: 14px;
}

.field-wrap span {
  font-weight: 700;
  color: var(--text);
}

.field-wrap select {
  min-height: 48px;
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 14px;
  padding: 10px 12px;
  font-size: 15px;
  background: rgba(255,255,255,0.96);
  color: #111827;
}

.checkbox-row {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 14px;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.hint-box {
  color: #dbeafe;
  font-size: 13px;
  line-height: 1.45;
  padding: 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
}

.result-info {
  color: var(--text-soft);
  font-size: 13px;
  line-height: 1.45;
}

.fuel-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fuel-list-item {
  padding: 12px;
  border-radius: 16px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.06);
  color: #ffffff;
  cursor: pointer;
  transition: transform 0.14s ease, background 0.14s ease, border-color 0.14s ease;
}

.fuel-list-item:hover {
  transform: translateY(-1px);
  background: rgba(255,255,255,0.09);
  border-color: rgba(255,255,255,0.12);
}

.fuel-list-item-title {
  font-weight: 800;
  margin-bottom: 6px;
  line-height: 1.35;
}

.fuel-list-item-meta {
  font-size: 13px;
  color: var(--text-soft);
  line-height: 1.4;
  margin-top: 2px;
}

.fuel-list-item-price {
  font-size: 14px;
  font-weight: 800;
  color: #ffffff;
  margin-top: 8px;
}

.popup-block {
  line-height: 1.45;
}

.leaflet-popup-content {
  max-width: min(88vw, 360px);
  line-height: 1.45;
}

.leaflet-popup-content button {
  border: 1px solid rgba(15,23,42,0.14);
  border-radius: 10px;
  padding: 7px 10px;
  background: #fff;
  cursor: pointer;
  font-weight: 700;
  margin-right: 6px;
}

.leaflet-control-zoom,
.leaflet-control-layers {
  margin-bottom: 12px !important;
}

@media (max-width: 640px) {
  .main-menu {
    top: calc(10px + env(safe-area-inset-top));
    right: 10px;
    width: auto;
  }

  .main-menu-buttons {
    flex-direction: row;
    gap: 8px;
  }

  .menu-mini-btn {
    width: 50px;
    height: 50px;
    border-radius: 16px;
    font-size: 19px;
    box-shadow: var(--shadow-md);
  }

  .floating-panel {
    top: 62px;
    right: 0;
    width: min(94vw, 380px);
    max-height: min(72vh, 560px);
    padding: 12px;
    border-radius: 20px;
    gap: 10px;
  }

  .panel-title {
    font-size: 15px;
  }

  .action-btn {
    min-height: 46px;
    padding: 10px 12px;
    border-radius: 14px;
    font-size: 14px;
  }

  .field-wrap {
    gap: 5px;
    font-size: 13px;
  }

  .field-wrap select {
    min-height: 44px;
    border-radius: 12px;
    font-size: 14px;
  }

  .checkbox-row {
    font-size: 13px;
  }

  .hint-box {
    font-size: 12px;
    padding: 10px;
  }

  .result-info {
    font-size: 12px;
  }

  .fuel-list-item {
    padding: 10px;
    border-radius: 14px;
  }

  .fuel-list-item-title {
    font-size: 14px;
  }

  .fuel-list-item-meta {
    font-size: 12px;
  }

  .fuel-list-item-price {
    font-size: 13px;
  }

  .status-toast {
    top: auto;
    bottom: calc(14px + env(safe-area-inset-bottom));
    max-width: min(92vw, 360px);
    font-size: 13px;
    padding: 10px 12px;
  }
}

@media (max-width: 480px) {
  .floating-panel {
    width: calc(100vw - 20px);
  }
}

.detail-drawer {
  position: fixed;
  top: calc(16px + env(safe-area-inset-top));
  left: 16px;
  bottom: 16px;
  width: min(430px, calc(100vw - 110px));
  background: rgba(15, 23, 42, 0.94);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(0,0,0,0.35);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  z-index: 2500;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.22s ease, opacity 0.22s ease, visibility 0.22s ease;
}

.detail-drawer.is-collapsed {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateX(-16px) scale(0.98);
}

.detail-drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-drawer-title {
  font-size: 16px;
  font-weight: 800;
  color: #fff;
}

.detail-drawer-close {
  border: 0;
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: rgba(255,255,255,0.08);
  color: #fff;
  cursor: pointer;
  font-size: 16px;
}

.detail-drawer-content {
  padding: 14px 16px 22px;
  overflow: auto;
  color: #e5e7eb;
  line-height: 1.45;
}

.detail-section {
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.detail-section:last-child {
  border-bottom: 0;
  margin-bottom: 0;
}

.detail-section h4 {
  margin: 0 0 8px 0;
  font-size: 14px;
  color: #fff;
}

.detail-line {
  margin: 2px 0;
  font-size: 13px;
}

.detail-point-card {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.06);
}

.detail-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 14px;
}

.detail-action-btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fff;
  color: #111827;
  font-weight: 700;
  cursor: pointer;
}

@media (max-width: 900px) {
  .detail-drawer {
    left: 10px;
    right: 10px;
    top: auto;
    bottom: 10px;
    width: auto;
    max-height: 62vh;
    border-radius: 22px;
  }

  .detail-drawer.is-collapsed {
    transform: translateY(14px) scale(0.98);
  }
}


.availability-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  border: 1px solid transparent;
}

.availability-badge-full {
  background: rgba(22, 163, 74, 0.16);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.35);
}

.availability-badge-partial {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}

.availability-badge-none {
  background: rgba(220, 38, 38, 0.16);
  color: #ef4444;
  border-color: rgba(220, 38, 38, 0.35);
}

/*connector*/
.availability-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  border: 1px solid transparent;
}

.availability-badge-full {
  background: rgba(22, 163, 74, 0.16);
  color: #16a34a;
  border-color: rgba(22, 163, 74, 0.35);
}

.availability-badge-partial {
  background: rgba(245, 158, 11, 0.16);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.35);
}

.availability-badge-none {
  background: rgba(220, 38, 38, 0.16);
  color: #ef4444;
  border-color: rgba(220, 38, 38, 0.35);
}

.connector-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.connector-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.14);
  border: 1px solid rgba(59, 130, 246, 0.28);
  color: #eaf2ff;
}

.connector-chip-icon {
  width: 22px;
  height: 22px;
  object-fit: contain;
  flex: 0 0 22px;
  display: block;
  filter: drop-shadow(0 1px 2px rgba(0,0,0,0.22));
}