/* ====== БАЗА ====== */
:root {
    --bg-main: #050913;
    --bg-elevated: #0B1220;
    --bg-elevated-2: #111827;
    --border-subtle: #171F2F;
    --border-strong: #202840;

    --text-main: #E5ECFF;
    --text-muted: #8C9BB5;
    --text-soft: #5D6A87;

    --accent-1: #3AF2C4; /* friendly / neutral */
    --accent-1-soft: rgba(58, 242, 196, 0.16);
    --accent-2: #FF6B4A; /* hostile / warning */
    --accent-2-soft: rgba(255, 107, 74, 0.18);

    --danger: #FF4F64;
    --radius-lg: 14px;
    --radius-md: 10px;
    --radius-sm: 6px;
    --h-control: 32px;
    --pad-x: 12px;
    --gap-xs: 6px;
    --gap-sm: 8px;
    --gap-md: 10px;
    --shadow-soft: 0 22px 55px rgba(0, 0, 0, 0.75);
    --shadow-subtle: 0 0 0 1px rgba(58, 242, 196, 0.06);

    --font-main: system-ui, -apple-system, BlinkMacSystemFont, "SF Pro Text",
      "Segoe UI", sans-serif;

    --transition-fast: 0.16s ease-out;
    --transition-med: 0.22s ease-out;
}

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

html, body {
    margin: 0;
    padding: 0;
    height: 100%;
    background: radial-gradient(circle at top, #111827 0, #020617 55%, #000 100%);
    color: var(--text-main);
    font-family: var(--font-main);
    -webkit-font-smoothing: antialiased;
}

body {
    overflow: hidden;
}

/* ====== APP LAYOUT ====== */

.app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.topbar {
    height: 56px;
    display: grid;
    grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr);
    align-items: center;
    padding: 0 18px;
    background: linear-gradient(to right, rgba(3,7,18,0.98), rgba(10,17,35,0.98));
    border-bottom: 1px solid #111827;
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.65);
    z-index: 10;
}

.topbar__left,
.topbar__center,
.topbar__right {
    display: flex;
    align-items: center;
}

.topbar__center {
    justify-content: center;
    gap: 8px;
}

.topbar__right {
    justify-content: flex-end;
}

/* ====== BRAND ====== */

.brand {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.brand__badge {
    width: 28px;
    height: 28px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 30%, #3AF2C4 0, #0EA5E9 35%, transparent 70%);
    box-shadow:
      0 0 0 1px rgba(58, 242, 196, 0.8),
      0 0 22px rgba(56, 189, 248, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #020617;
}

.brand__title {
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #E5ECFF;
}

.brand__subtitle {
    font-size: 11px;
    color: var(--text-soft);
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ====== MODE BUTTONS ====== */

.mode-btn {
    border: 1px solid rgba(148, 163, 184, 0.2);
    background: radial-gradient(circle at top, rgba(15,23,42,0.9), rgba(15,23,42,0.8));
    color: var(--text-muted);
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 12px;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition:
      border-color var(--transition-fast),
      color var(--transition-fast),
      background var(--transition-fast),
      transform var(--transition-fast),
      box-shadow var(--transition-fast);
}

.mode-btn:hover {
    border-color: rgba(148, 163, 184, 0.45);
    color: var(--text-main);
    transform: translateY(-1px);
}

.mode-btn--active {
    border-color: rgba(58, 242, 196, 0.5);
    background:
      radial-gradient(circle at top, rgba(34, 197, 235, 0.16), rgba(15,23,42,0.95));
    color: var(--accent-1);
    box-shadow:
      0 0 0 1px rgba(58, 242, 196, 0.5),
      0 0 22px rgba(56, 189, 248, 0.55);
}

/* ====== STATUS ====== */

.status-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--text-soft);
}

.status-indicator__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent-1);
    box-shadow: 0 0 0 2px rgba(58, 242, 196, 0.24), 0 0 18px rgba(58, 242, 196, 0.8);
    position: relative;
}

.status-indicator__dot::after {
    content: "";
    position: absolute;
    inset: -6px;
    border-radius: inherit;
    border: 1px solid rgba(58, 242, 196, 0.35);
    opacity: 0.6;
    animation: ping 1.4s cubic-bezier(0, 0, 0.2, 1) infinite;
}

@keyframes ping {
    0% {
        transform: scale(0.9);
        opacity: 0.9;
    }
    100% {
        transform: scale(1.7);
        opacity: 0;
    }
}

/* ====== MAIN LAYOUT ====== */

.layout {
    flex: 1;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr) 320px;
    grid-template-rows: minmax(0, 1fr);
    gap: 10px;
    padding: 10px 14px 14px;
}

/* ====== SIDEBARS & PANELS ====== */

.sidebar {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ВАЖНО: чтобы правая колонка могла сжиматься и давать скролл списку */
.sidebar--right {
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-height: 0;
}

.panel {
    background: radial-gradient(circle at top left, rgba(15,23,42,0.98), rgba(2,6,23,0.98));
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-subtle);
    box-shadow: var(--shadow-soft), var(--shadow-subtle);
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* чтобы блок аналитики мог скроллиться внутри панели */
.panel.panel--flex {
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.panel.panel--flex .panel__body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
}

/* немного внутреннего отступа для скролла */
.panel.panel--flex .panel__body::-webkit-scrollbar {
    width: 6px;
}
.panel.panel--flex .panel__body::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
}
.panel.panel--flex .panel__body::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.9);
    border-radius: 999px;
}

.panel__title {
    margin: 0;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-soft);
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(15, 23, 42, 0.9);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

/* кнопка сворачивания справа от заголовка */
.panel__toggle {
    border: none;
    background: transparent;
    color: var(--text-soft);
    cursor: pointer;
    padding: 2px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--transition-fast), color var(--transition-fast);
}

.panel__toggle:hover {
    color: var(--accent-1);
}

.panel__toggle--collapsed i {
    transform: rotate(180deg);
}

/* тело панели, которое будет сворачиваться */
.panel__body {
    margin-top: 6px;
}

/* при скрытии */
.panel__body--hidden {
    display: none;
}

.panel__group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}

.panel__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-muted);
}

.export-dates {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.export-dates__row label {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 11px;
    color: var(--text-muted);
}



#export-from:focus,
#export-to:focus {
    border-color: rgba(58, 242, 196, 0.7);
    box-shadow: 0 0 0 1px rgba(58, 242, 196, 0.7);
}

/* ====== CHIPS, TAGS, TOGGLES ====== */

.chip-group {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.3);
    background: rgba(15, 23, 42, 0.9);
    padding: 4px 10px;
    font-size: 11px;
    color: var(--text-muted);
    cursor: pointer;
    transition:
      background var(--transition-fast),
      border-color var(--transition-fast),
      color var(--transition-fast),
      transform var(--transition-fast);
}

.chip:hover {
    border-color: rgba(148, 163, 184, 0.5);
    color: var(--text-main);
    transform: translateY(-1px);
}

.chip--active {
    border-color: rgba(58, 242, 196, 0.8);
    background: radial-gradient(circle at top, rgba(58, 242, 196, 0.2), rgba(15, 23, 42, 0.95));
    color: var(--accent-1);
    box-shadow:
      0 0 0 1px rgba(58, 242, 196, 0.4),
      0 0 16px rgba(34, 197, 235, 0.4);
}

.tag-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.tag {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.25);
    padding: 3px 9px;
    font-size: 11px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-muted);
    background: rgba(15, 23, 42, 0.9);
    cursor: pointer;
    transition:
      background var(--transition-fast),
      border-color var(--transition-fast),
      color var(--transition-fast),
      transform var(--transition-fast);
}

.tag__dot {
    width: 8px;
    height: 8px;
    border-radius: 999px;
}

.tag--active {
    border-color: rgba(251, 191, 36, 0.9);
    color: #FACC15;
    background:
      radial-gradient(circle at top, rgba(252, 211, 77, 0.2), rgba(15, 23, 42, 0.96));
    box-shadow:
      0 0 0 1px rgba(252, 211, 77, 0.5),
      0 0 20px rgba(234, 179, 8, 0.5);
}

.toggle {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    user-select: none;
    font-size: 12px;
    color: var(--text-muted);
}

.toggle input {
    display: none;
}

.toggle__track {
    width: 36px;
    height: 18px;
    border-radius: 999px;
    background: #020617;
    border: 1px solid rgba(148, 163, 184, 0.45);
    position: relative;
    transition:
      background var(--transition-fast),
      border-color var(--transition-fast);
}

.toggle__track::after {
    content: "";
    position: absolute;
    top: 1px;
    left: 1px;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #111827;
    box-shadow:
      0 1px 3px rgba(0, 0, 0, 0.8),
      0 0 0 1px rgba(15, 23, 42, 0.8);
    transition:
      transform var(--transition-fast),
      box-shadow var(--transition-fast),
      background var(--transition-fast);
}

.toggle input:checked + .toggle__track {
    background: radial-gradient(circle at 30% 50%, #3AF2C4, #0EA5E9);
    border-color: rgba(34, 197, 235, 0.8);
}

.toggle input:checked + .toggle__track::after {
    transform: translateX(16px);
    background: #020617;
    box-shadow:
      0 0 0 1px rgba(58, 242, 196, 1),
      0 0 10px rgba(56, 189, 248, 0.9);
}

.toggle__label {
    letter-spacing: 0.02em;
}

/* ====== MAP & TIMELINE ====== */

.map-wrapper {
    position: relative;
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: radial-gradient(circle at top, #020617 0, #020617 50%, #000 100%);
    border: 1px solid var(--border-strong);
    box-shadow: var(--shadow-soft);
    display: flex;
    flex-direction: column;
}

#map {
    flex: 1;
    min-height: 0;
    position: relative;
    isolation: isolate;
}

.timeline {
    height: 64px;
    display: flex;
    align-items: center;
    padding: 6px 10px 8px;
    gap: 10px;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.9));
    border-top: 1px solid rgba(15, 23, 42, 0.9);
}

.timeline__label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-soft);
    white-space: nowrap;
}

#timeline-range {
    flex: 1;
    appearance: none;
    height: 4px;
    border-radius: 999px;
    background: #020617;
    outline: none;
    cursor: pointer;
}

#timeline-range::-webkit-slider-thumb {
    appearance: none;
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #0EA5E9;
    border: 2px solid #22C55E;
    box-shadow:
      0 0 0 3px rgba(34, 197, 235, 0.3),
      0 0 18px rgba(56, 189, 248, 0.8);
    margin-top: -5px;
}

#timeline-range::-moz-range-thumb {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    background: #0EA5E9;
    border: 2px solid #22C55E;
    box-shadow:
      0 0 0 3px rgba(34, 197, 235, 0.3),
      0 0 18px rgba(56, 189, 248, 0.8);
}

.timeline__play {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.9);
    color: var(--text-muted);
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 13px;
    transition:
      background var(--transition-fast),
      border-color var(--transition-fast),
      transform var(--transition-fast),
      box-shadow var(--transition-fast);
}

.timeline__play:hover {
    border-color: rgba(58, 242, 196, 0.7);
    color: var(--accent-1);
    transform: translateY(-1px) scale(1.02);
    box-shadow:
      0 0 0 1px rgba(58, 242, 196, 0.5),
      0 0 16px rgba(56, 189, 248, 0.6);
}

/* ====== SUMMARY ====== */

.summary {
    display: flex;
    gap: 12px;
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: radial-gradient(circle at top left, rgba(15,23,42,0.9), rgba(15,23,42,0.7));
    padding: 8px 10px;
}

.summary__item {
    flex: 1;
}

.summary__label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.summary__value {
    font-weight: 600;
    font-size: 15px;
}

/* ====== POINTS LIST (больше не используется, но стили оставим) ====== */

.points-list {
    flex: 1;
    min-height: 0;
    overflow: auto;
    padding-right: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

/* основная карточка точки в правой панели */
.point-item {
    border-radius: var(--radius-md);
    border: 1px solid rgba(15, 23, 42, 0.9);
    background: rgba(15, 23, 42, 0.95);
    padding: 8px 9px;
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 4px 8px;
    cursor: pointer;
    transition:
      transform var(--transition-fast),
      box-shadow var(--transition-fast),
      border-color var(--transition-fast),
      background var(--transition-fast);
}

.point-item:hover {
    transform: translateY(-1px);
    border-color: rgba(58, 242, 196, 0.6);
    box-shadow: 0 0 18px rgba(56, 189, 248, 0.35);
    background: rgba(15, 23, 42, 1);
}

.point-item__marker {
    width: 14px;
    height: 14px;
    border-radius: 999px;
    margin-top: 2px;
    background: radial-gradient(circle at 30% 30%, #3AF2C4, #0EA5E9);
    box-shadow:
      0 0 0 1px rgba(58, 242, 196, 0.8),
      0 0 10px rgba(56, 189, 248, 0.9);
}

.point-item__header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.point-item__category {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-muted);
}

.point-item__time {
    font-size: 10px;
    color: var(--text-soft);
}

.point-item__text {
    grid-column: 1 / -1;
    margin-top: 2px;
    font-size: 12px;
    color: var(--text-main);
}

.point-item__meta {
    grid-column: 1 / -1;
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: var(--text-soft);
}

/* ====== SCROLLBAR ====== */

.points-list::-webkit-scrollbar {
    width: 6px;
}
.points-list::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.7);
}
.points-list::-webkit-scrollbar-thumb {
    background: rgba(51, 65, 85, 0.9);
    border-radius: 999px;
}

/* ====== RESPONSIVE (упрощённо) ====== */

@media (max-width: 1200px) {
    .layout {
        grid-template-columns: 240px minmax(0, 1fr) 280px;
    }
}

@media (max-width: 960px) {
    .layout {
        grid-template-columns: minmax(0, 1fr);
        grid-template-rows: auto auto auto;
    }
    .sidebar--left,
    .sidebar--right {
        order: 1;
    }
    .map-wrapper {
        order: 0;
        height: calc(55vh - 56px);
    }
}

/* ====== УПРАВЛЕНИЕ: КНОПКИ, СЕЛЕКТ ====== */

.control-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
}

/* Кнопки управления (Обновить / Пауза) */

.btn {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.95);
    color: #E5ECFF;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition:
      background var(--transition-fast),
      border-color var(--transition-fast),
      transform var(--transition-fast),
      box-shadow var(--transition-fast);
}

.btn:hover {
    border-color: rgba(58, 242, 196, 0.7);
    box-shadow: 0 0 15px rgba(56, 189, 248, 0.5);
    transform: translateY(-1px);
}

.btn-primary {
    border-color: rgba(58, 242, 196, 0.8);
    background:
      radial-gradient(circle at top, rgba(58, 242, 196, 0.15), rgba(15, 23, 42, 0.98));
}

.btn-icon {
    width: 14px;
    display: inline-flex;
    justify-content: center;
}

/* ===========================
   SELECT (унифицировано, исправлено)
   =========================== */

.select {
    border-radius: 999px;
    border: 1px solid rgba(148, 163, 184, 0.4);
    background: rgba(15, 23, 42, 0.95);
    color: var(--text-main);

    /* единая высота */
    height: 30px;
    line-height: 1.2;

    /* единые паддинги, справа место под стрелку */
    padding: 6px 34px 6px 12px;
    font-size: 12px;
    outline: none;

    /* убираем системный UI */
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;

    /* стрелка */
    background-image:
      linear-gradient(45deg, transparent 50%, rgba(229, 236, 255, 0.85) 50%),
      linear-gradient(135deg, rgba(229, 236, 255, 0.85) 50%, transparent 50%),
      radial-gradient(circle at 30% 50%, rgba(58, 242, 196, 0.10), rgba(15, 23, 42, 0.0) 60%);
    background-position:
      calc(100% - 18px) 50%,
      calc(100% - 12px) 50%,
      0 0;
    background-size: 6px 6px, 6px 6px, 100% 100%;
    background-repeat: no-repeat;

    transition:
      background var(--transition-fast),
      border-color var(--transition-fast),
      box-shadow var(--transition-fast),
      transform var(--transition-fast);
}

.select:hover {
    border-color: rgba(58, 242, 196, 0.55);
    box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
    transform: translateY(-1px);
}

.select:focus {
    border-color: rgba(58, 242, 196, 0.7);
    box-shadow: 0 0 0 1px rgba(58, 242, 196, 0.7);
}

/* справа (в панели управления) можно оставить min-width, но слева сделаем 100% ниже */
.select option {
    background: #0B1220;
    color: var(--text-main);
}

/* ====== ТАЙМЛАЙН ПО УМОЛЧАНИЮ СКРЫТ В РЕЖИМЕ "КАРТА" ====== */

#timeline {
    display: none;
}

/* ====== ДОП. МЕЛОЧИ ДЛЯ ЛУЧШЕГО ВИДА ====== */

.sidebar--right .panel {
    min-height: 0;
}

.panel__group:first-of-type {
    margin-top: 2px;
}

/* ==== НЕОНОВЫЕ МАРКЕРЫ ДЛЯ КАРТЫ ==== */

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

.custom-marker .marker-outer {
  --marker-color: #0EA5E9;

  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, #111827 0, #020617 55%, #000000 100%);
  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid rgba(148, 163, 184, 0.4);
  box-shadow:
    0 0 6px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(15, 23, 42, 0.9),
    0 0 12px rgba(15, 23, 42, 0.8);
  transition:
    transform 0.12s ease-out,
    box-shadow 0.12s ease-out;
}

.custom-marker .marker-inner {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background:
    radial-gradient(
      circle at 30% 30%,
      color-mix(in srgb, var(--marker-color) 78%, #ffffff 6%) 0,
      #020617 78%
    );
  display: flex;
  align-items: center;
  justify-content: center;

  box-shadow:
    0 0 4px color-mix(in srgb, var(--marker-color) 80%, transparent),
    inset 0 0 6px rgba(0, 0, 0, 0.9);
}

.custom-marker .marker-inner i {
  color: #e5e7eb;
  font-size: 14px;
  text-shadow:
    0 0 4px color-mix(in srgb, var(--marker-color) 60%, transparent),
    0 0 8px color-mix(in srgb, var(--marker-color) 30%, transparent);
}

.leaflet-marker-icon.custom-marker:hover .marker-outer {
  transform: scale(1.06);
  box-shadow:
    0 0 8px rgba(0, 0, 0, 1),
    0 0 14px color-mix(in srgb, var(--marker-color) 80%, rgba(15, 23, 42, 0.8)),
    0 0 18px color-mix(in srgb, var(--marker-color) 50%, transparent);
}

/* ==== ПУЛЬСАЦИЯ ДЛЯ НОВЫХ ТОЧЕК (<= 10 МИН) ==== */

.custom-marker.marker-new .marker-outer {
  animation: markerPulse 1.6s ease-out infinite;
}

@keyframes markerPulse {
  0% {
    box-shadow:
      0 0 6px rgba(0, 0, 0, 0.9),
      0 0 10px color-mix(in srgb, var(--marker-color) 60%, rgba(15, 23, 42, 0.9)),
      0 0 0 0 color-mix(in srgb, var(--marker-color) 30%, transparent);
  }
  60% {
    box-shadow:
      0 0 6px rgba(0, 0, 0, 0.9),
      0 0 16px color-mix(in srgb, var(--marker-color) 90%, rgba(15, 23, 42, 0.6)),
      0 0 0 10px color-mix(in srgb, var(--marker-color) 20%, transparent);
  }
  100% {
    box-shadow:
      0 0 6px rgba(0, 0, 0, 0.9),
      0 0 10px color-mix(in srgb, var(--marker-color) 55%, rgba(15, 23, 42, 0.9)),
      0 0 0 0 transparent;
  }
}

/* ====== ПОПАП КАРТЫ ====== */

.leaflet-popup-content-wrapper {
    border-radius: 8px;
    background: #101525;
    color: #e3e7ff;
    border: 1px solid #273047;
    box-shadow:
      0 0 0 1px rgba(0, 224, 255, 0.1),
      0 12px 30px rgba(0, 0, 0, 0.6);
    font-family: var(--font-main);
}

.leaflet-popup-content {
    margin: 8px 10px;
}

.popup-card {
    min-width: 240px;
    max-width: 320px;
    font-size: 12px;
}

.popup-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 6px;
}

.popup-title {
    font-size: 13px;
    font-weight: 600;
    color: #00e0ff;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.popup-datetime {
    font-size: 11px;
    color: #a0a7c6;
}

.popup-body {
    border-top: 1px solid #212840;
    border-bottom: 1px solid #212840;
    padding: 6px 0;
    margin: 4px 0 6px;
}

.popup-section {
    margin-bottom: 6px;
}

.popup-section:last-child {
    margin-bottom: 0;
}

.popup-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7b84a6;
    margin-bottom: 2px;
}

.popup-text {
    font-size: 12px;
    color: #e3e7ff;
    line-height: 1.4;
}

.popup-coords {
    display: flex;
    gap: 10px;
    font-size: 12px;
    color: #c1c7e0;
}

.popup-coords span {
    color: #ffffff;
    font-weight: 500;
}

.popup-footer {
    margin-top: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.popup-meta {
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: #8d96b8;
}

.popup-id {
    font-weight: 500;
}

/* === ДОБАВЛЕНИЕ: кнопка ручного ввода и форма в попапе === */

.neon-btn {
    background: #111827;
    color: #22d3ee;
    border: 1px solid #22d3ee;
    padding: 4px 12px;
    font-size: 12px;
    cursor: pointer;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition:
      background var(--transition-fast),
      color var(--transition-fast),
      border-color var(--transition-fast),
      box-shadow var(--transition-fast),
      transform var(--transition-fast);
}

.neon-btn:hover {
    background: #020617;
    box-shadow: 0 0 14px rgba(34, 211, 238, 0.6);
    transform: translateY(-1px);
}

.neon-btn.active {
    background: #22d3ee;
    color: #020617;
    box-shadow:
      0 0 0 1px rgba(34, 211, 238, 0.8),
      0 0 16px rgba(34, 211, 238, 0.8);
}

/* форма в попапе при добавлении точки */

.add-point-form h4 {
    margin: 0 0 6px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #22d3ee;
}

.add-point-form label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #7b84a6;
}

.add-point-form textarea,
.add-point-form input,
.add-point-form select {
    margin-top: 2px;
    background: #020617;
    color: #e5e7eb;
    border: 1px solid #1f2937;
    border-radius: 4px;
    font-size: 12px;
    padding: 4px 6px;
    width: 100%;
    outline: none;
}

.add-point-form textarea:focus,
.add-point-form input:focus,
.add-point-form select:focus {
    border-color: rgba(34, 197, 235, 0.8);
    box-shadow: 0 0 0 1px rgba(34, 197, 235, 0.6);
}

/* ====== АНАЛИТИКА СПРАВА ====== */

.analytics {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.analytics__row {
    display: flex;
    gap: 8px;
}

.analytics__row--full {
    flex-direction: column;
}

/* Метрики (верхние 2х2) */

.analytics__metric {
    flex: 1;
    border-radius: 8px;
    padding: 8px 10px;
    background: radial-gradient(circle at top left, rgba(15,23,42,0.95), rgba(2,6,23,0.96));
    border: 1px solid rgba(15, 23, 42, 0.95);
    box-shadow:
      0 0 0 1px rgba(15, 23, 42, 0.9),
      0 12px 24px rgba(0, 0, 0, 0.7);
}

.analytics__metric--alert {
    border-color: rgba(248, 113, 113, 0.9);
    box-shadow:
      0 0 0 1px rgba(248, 113, 113, 0.6),
      0 0 20px rgba(248, 113, 113, 0.4);
}

.analytics__metric-label {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.16em;
    color: var(--text-soft);
    margin-bottom: 4px;
}

.analytics__metric-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}

.analytics__metric-sub {
    margin-top: 2px;
    font-size: 11px;
    color: var(--text-muted);
}

/* Топ категорий снизу */

.analytics__top {
    border-radius: 8px;
    padding: 8px 10px;
    background: radial-gradient(circle at top left, rgba(15,23,42,0.95), rgba(2,6,23,0.96));
    border: 1px solid rgba(15, 23, 42, 0.95);
    box-shadow:
      0 0 0 1px rgba(15, 23, 42, 0.9),
      0 12px 24px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.analytics__top-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 8px;
}

.analytics__top-title {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    color: var(--text-soft);
}

.analytics__top-sub {
    font-size: 10px;
    color: var(--text-muted);
}

.analytics__top-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin-top: 2px;
}

.analytics__top-row {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-main);
}

.analytics__top-color {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    box-shadow: 0 0 8px rgba(15, 23, 42, 0.8);
}

.analytics__top-name {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text-main);
}

.analytics__top-count {
    font-weight: 600;
    font-size: 11px;
    color: var(--text-muted);
}

.analytics__empty {
    font-size: 11px;
    color: var(--text-soft);
    font-style: italic;
}

/* ====== ВСПОМОГАТЕЛЬНОЕ ====== */

.custom-attribution {
    background: rgba(0, 0, 0, 0.6);
    color: #e5e7eb;
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 4px;
    margin-right: 4px;
    margin-bottom: 4px;
}

.muted {
    color: #6c7598;
    font-style: italic;
}

/* ===========================
   TRACK UI (исправлено под твой HTML)
   =========================== */

/* слева делаем селекты на всю ширину */
.sidebar--left .select,
.sidebar--left #track-select {
    width: 100%;
    min-width: 0;
}



/* Кластер всегда сверху обычных маркеров */
.cluster-icon,
.cluster-marker {
  z-index: 1000;
  cursor: pointer;
}

/* твои точки категорий внутри (у тебя это используется) */
.cluster-dots{
  position: absolute;
  left: 50%;
  bottom: 6px;
  transform: translateX(-50%);
  display: inline-flex;
  gap: 4px;
  padding: 3px 6px;

  border-radius: 999px;
  background: rgba(2, 6, 23, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
}

.cluster-dot{
  width: 7px;
  height: 7px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.35);
}

/* У тебя бейдж называется cluster-badge (а не cluster-count) */
.cluster-badge{
  position: absolute;
  top: -6px;
  right: -6px;

  font-weight: 800;
  font-size: 12px;
  line-height: 1;

  padding: 5px 7px;
  border-radius: 999px;

  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.28);
  color: #fff;

  backdrop-filter: blur(6px);
}


/* =========================
   Cluster Popup (оставить)
   ========================= */

.leaflet-popup.cluster-popup-leaflet .leaflet-popup-content-wrapper{
  max-width: min(480px, calc(100vw - 28px));
}

/* Чуть шире попап */
.leaflet-popup.cluster-popup-leaflet .leaflet-popup-content{
  width: auto !important;
  max-width: min(480px, calc(100vw - 28px));
  margin: 12px 14px;
}

.cluster-popup{
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Arial;
  color: #e5e7eb;

  min-width: 0; /* вместо 360 */
  width: min(460px, calc(100vw - 40px));
}

.cluster-popup__head {
  display:flex;
  justify-content:space-between;
  gap: 12px;
  align-items:flex-start;
  margin-bottom: 10px;
}

.cluster-popup__title {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .2px;
}

.cluster-popup__meta {
  font-size: 12px;
  opacity: .75;
  margin-top: 2px;
}

.cluster-popup__count {
  font-weight: 800;
  font-size: 18px;
  padding: 6px 10px;
  border-radius: 12px;
  background: rgba(148,163,184,0.14);
  border: 1px solid rgba(148,163,184,0.22);
}

.cluster-popup__controls { margin-bottom: 10px; }

.cluster-popup__search{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 14px;
  background: rgba(15,23,42,0.55);
  border: 1px solid rgba(148,163,184,0.18);
}

.cluster-popup__search i { opacity:.7; }

.cluster-popup__search input{
  flex:1;
  background: transparent;
  border: none;
  outline: none;
  color: #e5e7eb;
  font-size: 13px;
}

.cluster-popup__clear{
  border: none;
  background: rgba(148,163,184,0.14);
  color: #e5e7eb;
  width: 26px;
  height: 26px;
  border-radius: 10px;
  cursor: pointer;
}

.cluster-popup__clear:hover{ background: rgba(148,163,184,0.22); }

.cluster-popup__chips{
  display:flex;
  flex-wrap:wrap;
  gap: 6px;
  margin-top: 8px;
}

.cluster-chip{
  display:flex;
  align-items:center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(148, 163, 184, 0.10);
  color: #e5e7eb;
  cursor: pointer;
  font-size: 12px;
}

.cluster-chip:hover { background: rgba(148,163,184,0.16); }

.cluster-chip.is-active{
  background: rgba(14,165,233,0.18);
  border-color: rgba(14,165,233,0.35);
}

.cluster-chip__dot{
  width: 8px; height: 8px;
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(255,255,255,0.07);
}

.cluster-popup__list{
  max-height: min(320px, calc(100vh - 320px));
  overflow: auto;
}

.cluster-row{
  position: relative;
  display:flex;
  gap: 10px;
  align-items:stretch;
  padding: 10px 10px;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(2,6,23,0.35);
  margin-top: 8px;
  cursor: pointer;
  transition: transform .08s ease, background .12s ease, border-color .12s ease;
}

.cluster-row:hover{
  transform: translateY(-1px);
  background: rgba(2,6,23,0.50);
  border-color: rgba(148,163,184,0.28);
}

.cluster-row__left{
  width: 40px;
  display:flex;
  align-items:center;
  justify-content:center;
}

.cluster-row__icon{
  width: 34px; height: 34px;
  border-radius: 12px;
  display:flex;
  align-items:center;
  justify-content:center;
  background: color-mix(in srgb, var(--c) 18%, rgba(15,23,42,0.55));
  border: 1px solid color-mix(in srgb, var(--c) 35%, rgba(148,163,184,0.18));
  color: #e5e7eb;
}

.cluster-row__body{ flex:1; min-width: 0; }

.cluster-row__top{
  display:flex;
  justify-content:space-between;
  gap: 10px;
}

.cluster-row__cat{ font-weight: 700; font-size: 13px; }

.cluster-row__time{ font-size: 12px; opacity: .75; white-space: nowrap; }

.cluster-row__desc{
  margin-top: 4px;
  font-size: 12px;
  opacity: .92;
  overflow:hidden;
  text-overflow: ellipsis;
}

.cluster-row__badge{
  align-self: flex-start;
  margin-left: 6px;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(34,197,94,0.18);
  border: 1px solid rgba(34,197,94,0.35);
  color: #bbf7d0;
}

.cluster-popup__foot{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap: 10px;
  margin-top: 10px;
}

.cluster-popup__more{
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(148,163,184,0.12);
  color: #e5e7eb;
  padding: 8px 10px;
  border-radius: 12px;
  cursor: pointer;
}

.cluster-popup__more:hover{ background: rgba(148,163,184,0.18); }

.muted { opacity: 0.7; }

/* ===== Day filter: аккуратно и не ломается ===== */
.day-filter{
  margin-top: 10px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;              /* <-- ключевое: перенос на узких */
}

/* дата-инпут пусть занимает всю доступную ширину строки */
.day-filter #day-select{
  flex: 1 1 160px;              /* растягивается, но не меньше 160px */
  min-width: 160px;
}

/* чтобы кнопки не растягивались */
.day-filter .chip{
  flex: 0 0 auto;
}

/* единый стиль для input (date/datetime/text) */
.input{
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  background: rgba(15, 23, 42, 0.95);
  color: var(--text-main);
  font-size: 12px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
.input:hover{
  border-color: rgba(58, 242, 196, 0.55);
  box-shadow: 0 0 16px rgba(56, 189, 248, 0.18);
  transform: translateY(-1px);
}
.input:focus{
  border-color: rgba(58, 242, 196, 0.7);
  box-shadow: 0 0 0 1px rgba(58, 242, 196, 0.7);
}

/* ==========================================
   UI SYSTEM (финальная выравнивалка)
   ВСТАВИТЬ В КОНЕЦ main.css
   ========================================== */



/* 1) Единая высота и вертикальное выравнивание для всех контролов */
.btn, .chip{
  height: var(--h-control);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.input, .select{
  height: var(--h-control);
  display: block;           /* <-- важно */
  line-height: normal;      /* <-- важно для date/datetime */
}

/* 2) Кнопки/чипы: одинаковые паддинги */
.btn,
.chip{
  padding: 0 12px;
}

/* 3) Инпуты: базовый вид (date/datetime/text) */
.input{
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.40);
  background: rgba(15,23,42,0.95);
  color: var(--text-main);
  font-size: 12px;
  padding: 0 var(--pad-x);
  outline: none;

  appearance: none;
  -webkit-appearance: none;
}

/* 4) Select: сохраняем твою стрелку, но фиксируем высоту/паддинги */
.select{
  width: 100%;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.40);
  background: rgba(15,23,42,0.95);
  color: var(--text-main);

  font-size: 12px;
  padding: 0 34px 0 var(--pad-x);
  outline: none;

  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;

  background-image:
    linear-gradient(45deg, transparent 50%, rgba(229,236,255,0.85) 50%),
    linear-gradient(135deg, rgba(229,236,255,0.85) 50%, transparent 50%),
    radial-gradient(circle at 30% 50%, rgba(58,242,196,0.10), rgba(15,23,42,0.0) 60%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size: 6px 6px, 6px 6px, 100% 100%;
  background-repeat: no-repeat;
}

/* 5) Hover/focus одинаковые для input/select */
.input:hover, .select:hover{
  border-color: rgba(58,242,196,0.55);
  box-shadow: 0 0 16px rgba(56,189,248,0.18);
  transform: translateY(-1px);
}
.input:focus, .select:focus{
  border-color: rgba(58,242,196,0.70);
  box-shadow: 0 0 0 1px rgba(58,242,196,0.70);
}

/* 6) Группы контролов: ровные расстояния */
.control-bar,
.chip-group,
.day-filter{
  display: flex;
  flex-wrap: wrap;
  gap: var(--gap-sm);
  align-items: center;
}

/* day-filter: дата растягивается, кнопки фикс */
.day-filter #day-select{
  flex: 1 1 180px;
  min-width: 180px;
}
.day-filter .chip{ flex: 0 0 auto; }

/* экспорт: ровные поля на всю ширину */
.export-dates{
  display: grid;
  gap: var(--gap-sm);
}
.export-dates__row label{
  display: grid;
  gap: 6px;
}

/* 7) Панели: чуть ровнее отступы */
.panel{ gap: var(--gap-md); }
.panel__group{ gap: var(--gap-xs); margin-top: 0; }

/* ==========================================
   Cluster popup: не вылазит за экран
   (перебивает твой min-width:360px)
   ========================================== */

.cluster-popup{
  min-width: 0 !important;
  width: min(460px, calc(100vw - 40px));
}

.leaflet-popup.cluster-popup-leaflet .leaflet-popup-content-wrapper{
  max-width: min(480px, calc(100vw - 28px));
}

.leaflet-popup.cluster-popup-leaflet .leaflet-popup-content{
  width: auto !important;
  max-width: min(480px, calc(100vw - 28px));
}

.cluster-popup__list{
  max-height: min(320px, calc(100vh - 320px));
  overflow: auto;
}

/* ==========================================
   ВАЖНО: убери эти старые стили, если они есть выше:
   - #export-from, #export-to { ... } (старый padding/высота)
   - #tracks-toggle { ... } (кастомный переключатель)
   Оставь один toggle через .toggle__track
   ========================================== */
/* ===== Leaflet Layers Control в стиле neon-btn ===== */

.leaflet-control.layers-modern{
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

/* Кнопка-тоггл (когда collapsed:true) */
.layers-modern .leaflet-control-layers-toggle{
  width: var(--h-control, 38px);
  height: var(--h-control, 38px);
  border-radius: 999px;               /* как neon-btn */
  padding: 0;

  background: #111827 !important;     /* как neon-btn */
  border: 1px solid #22d3ee !important;
  box-shadow: none;

  background-image: none !important;  /* убираем стандартную иконку Leaflet */
  display: inline-flex;
  align-items: center;
  justify-content: center;

  transition:
    background var(--transition-fast, 150ms),
    color var(--transition-fast, 150ms),
    border-color var(--transition-fast, 150ms),
    box-shadow var(--transition-fast, 150ms),
    transform var(--transition-fast, 150ms);
}

/* Иконка на кнопке (Font Awesome 6) */
.layers-modern .leaflet-control-layers-toggle::before{
  content: "\f5fd"; /* fa-layer-group */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
  color: #22d3ee;
}

/* Hover как neon-btn:hover */
.layers-modern .leaflet-control-layers-toggle:hover{
  background: #020617 !important;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.6);
  transform: translateY(-1px);
}

/* Когда панель раскрыта — делаем кнопку "active" */
.layers-modern.leaflet-control-layers-expanded .leaflet-control-layers-toggle{
  background: #22d3ee !important;
  border-color: #22d3ee !important;
  box-shadow:
    0 0 0 1px rgba(34, 211, 238, 0.8),
    0 0 16px rgba(34, 211, 238, 0.8);
}

.layers-modern.leaflet-control-layers-expanded .leaflet-control-layers-toggle::before{
  color: #020617;
}

/* Панель (выпадающий список) */
.layers-modern.leaflet-control-layers-expanded{
  background: #0b1220 !important;
  border: 1px solid rgba(34, 211, 238, 0.35) !important;
  border-radius: 16px !important;
  padding: 10px !important;
  box-shadow:
    0 14px 40px rgba(0,0,0,.45),
    0 0 18px rgba(34, 211, 238, 0.18) !important;
  backdrop-filter: blur(8px);
  min-width: 260px;
}

/* Список со скроллом */
.layers-modern .leaflet-control-layers-list{
  max-height: 55vh;
  overflow: auto;
  padding-right: 6px;
}

/* Разделитель base/overlay */
.layers-modern .leaflet-control-layers-separator{
  border-top: 1px solid rgba(255,255,255,.08);
  margin: 10px 0;
}

/* Строки слоёв */
.layers-modern .leaflet-control-layers-list label{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  margin: 2px 0;
  cursor: pointer;
  user-select: none;
  color: rgba(255,255,255,.92);
}

.layers-modern .leaflet-control-layers-list label:hover{
  background: rgba(34, 211, 238, 0.08);
}

/* Радио/чекбоксы */
.layers-modern input[type="radio"],
.layers-modern input[type="checkbox"]{
  transform: scale(1.05);
  accent-color: #22d3ee;
}

/* ===== Leaflet Zoom Control в стиле neon ===== */

.leaflet-control-zoom{
  border: 0 !important;
  box-shadow: none !important;
}

/* контейнер двух кнопок */
.leaflet-control-zoom a{
  width: var(--h-control, 38px) !important;
  height: var(--h-control, 38px) !important;
  line-height: var(--h-control, 38px) !important;

  background: #111827 !important;
  color: #22d3ee !important;
  border: 1px solid #22d3ee !important;

  box-shadow: none !important;
  text-decoration: none !important;

  display: flex !important;
  align-items: center;
  justify-content: center;

  transition:
    background var(--transition-fast, 150ms),
    border-color var(--transition-fast, 150ms),
    box-shadow var(--transition-fast, 150ms),
    transform var(--transition-fast, 150ms);
}

/* скругления: верхняя и нижняя */
.leaflet-control-zoom a.leaflet-control-zoom-in{
  border-radius: 999px 999px 10px 10px !important;
  margin-bottom: 6px; /* зазор между + и - */
}

.leaflet-control-zoom a.leaflet-control-zoom-out{
  border-radius: 10px 10px 999px 999px !important;
}

/* hover как neon-btn:hover */
.leaflet-control-zoom a:hover{
  background: #020617 !important;
  box-shadow: 0 0 14px rgba(34, 211, 238, 0.6) !important;
  transform: translateY(-1px);
}

/* active (нажатие) */
.leaflet-control-zoom a:active{
  transform: translateY(0px);
}

/* отключённое состояние */
.leaflet-control-zoom a.leaflet-disabled{
  opacity: .45 !important;
  cursor: default !important;
  box-shadow: none !important;
}

/* убираем “склейку” стандартных границ */
.leaflet-control-zoom a{
  border-bottom: 1px solid rgba(34, 211, 238, 0.35) !important;
}
.leaflet-control-zoom a.leaflet-control-zoom-out{
  border-bottom: 1px solid #22d3ee !important;
}

/* чтобы grid-ячейки могли сжиматься и появлялся скролл */
.layout { min-height: 0; }

/* скролл для левой и правой колонок */
.sidebar {
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;

  /* чтобы колесо не "пробивало" наружу на body */
  overscroll-behavior: contain;

  /* небольшой отступ под полоску прокрутки */
  padding-right: 4px;

  /* необязательно, но приятно: не дергает ширину при появлении скролла */
  scrollbar-gutter: stable;
}

/* стиль скроллбара для сайдбаров (как у тебя для points-list/panel__body) */
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-track { background: rgba(15, 23, 42, 0.7); }
.sidebar::-webkit-scrollbar-thumb {
  background: rgba(51, 65, 85, 0.9);
  border-radius: 999px;
}

/* принудительно нормальная укладка, без "плавающих" наложений */
.summary {
  position: relative;
  z-index: 1;
}

.tag-grid,
.chip-group,
#category-select,
.panel__body {
  position: relative;
  z-index: 2;
}

/* чтобы z-index работал у панелей */
.sidebar--right .panel,
.sidebar--left .panel {
  position: relative;
  z-index: 1;
}

/* панель, внутри которой сейчас фокус (кликнули в select/инпут) — поверх остальных */
.sidebar--right .panel:focus-within,
.sidebar--left .panel:focus-within {
  z-index: 50;
}

/* по умолчанию скрыт */
.baseparams-control {
  display: none;
}

/* показываем только когда включён fullscreen-режим карты (твой класс) */
body.map-fullscreen .baseparams-control {
  display: block;
}

/* (опционально) чтобы не наезжал на "Слои" — чуть отступ */
body.map-fullscreen .baseparams-control.leaflet-control {
  margin-top: 30px;
}

/* Кнопка (иконка) именно для "Параметров" */
.baseparams-control.layers-modern .leaflet-control-layers-toggle::before{
  content: "\f013"; /* fa-gear */
  font-family: "Font Awesome 6 Free";
  font-weight: 900;
  font-size: 14px;
}

/* Чуть “дороже” панель */
.baseparams-control .bp-panel{
  padding: 12px !important;
}

.baseparams-control .bp-head{
  margin-bottom: 10px;
}
.baseparams-control .bp-title{
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 800;
  color: #e5e7eb;
}
.baseparams-control .bp-subtitle{
  margin-top: 2px;
      color: rgba(255,255,255,0.68);

  font-size: 11px;
  opacity: .7;
}

.baseparams-control .bp-section{
  display: grid;
  gap: 8px;
}

.baseparams-control .bp-row{
  display:flex;
  align-items:center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid rgba(148,163,184,0.16);
  background: rgba(2,6,23,0.25);
  cursor: pointer;
}
.baseparams-control .bp-row:hover{
  background: rgba(34,211,238,0.08);
  border-color: rgba(34,211,238,0.22);
}

.baseparams-control .bp-row input{
  transform: scale(1.05);
  accent-color: #22d3ee;
}
/* Текст в строках (чекбоксы) ещё ярче */
.baseparams-control .bp-row span{
  color: rgba(255,255,255,0.95);
}

.baseparams-control .bp-divider{
  height: 1px;
  background: rgba(255,255,255,.08);
  margin: 10px 0;
}

.baseparams-control .bp-label{
  font-size: 11px;
      color: rgba(255,255,255,0.75);

  letter-spacing: .12em;
  text-transform: uppercase;
  opacity: .75;
}

.baseparams-control .bp-btns{
  display:flex;
  gap: 6px;
  flex-wrap: wrap;
}

.baseparams-control .bp-btn{
  border: 1px solid rgba(148,163,184,0.18);
  background: rgba(148,163,184,0.10);
    color: rgba(255,255,255,0.92);
  padding: 8px 10px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 12px;
  transition: background .12s ease, border-color .12s ease, transform .08s ease;
}
.baseparams-control .bp-btn:hover{
  background: rgba(34,211,238,0.12);
  border-color: rgba(34,211,238,0.28);
  transform: translateY(-1px);
}
.baseparams-control .bp-btn.active{
  background: rgba(34,211,238,0.18);
  border-color: rgba(34,211,238,0.38);
}