@font-face {
  font-family: "Montserrat";
  src: url("/fonts/Montserrat-Variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
}

:root {
  --bg: #eef4f4;
  --bg2: #e5eeed;
  --surface: rgba(255, 255, 255, 0.9);
  --surface-strong: #ffffff;
  --surface-subtle: #f6fbfa;
  --surface-muted: #edf6f4;
  --text: #17262f;
  --ink-soft: #25404e;
  --muted: #5e7381;
  --muted-2: #8095a2;
  --line: rgba(23, 38, 47, 0.13);
  --line-soft: rgba(23, 38, 47, 0.08);

  --brand: #0f766e;
  --brand-soft: rgba(15, 118, 110, 0.13);
  --accent: #cc7a12;
  --accent-soft: rgba(204, 122, 18, 0.15);
  --success: #0b8a66;
  --success-soft: rgba(11, 138, 102, 0.13);
  --warning: #b55e00;
  --warning-soft: rgba(181, 94, 0, 0.14);

  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;

  --shadow-sm: 0 10px 26px rgba(9, 29, 41, 0.08);
  --shadow-md: 0 20px 46px rgba(9, 29, 41, 0.13);

  --focus: 0 0 0 4px rgba(15, 118, 110, 0.22);
}

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

html {
  /* scroll-behavior: smooth; — wyłączone dla wydajności */
}
html,
body {
  margin: 0;
  padding: 0;
  overflow-x: clip;
}

body {
  font-family: "Montserrat", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  touch-action: manipulation;
  background:
    radial-gradient(980px 460px at 18% -8%, rgba(15, 118, 110, 0.14), transparent 58%),
    radial-gradient(900px 460px at 92% -4%, rgba(204, 122, 18, 0.11), transparent 56%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

a {
  color: inherit;
}

.crawl-map {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 20px 0 12px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow-sm);
}

.crawl-map__title {
  font-size: 13px;
  font-weight: 800;
  color: var(--ink-soft);
  margin-right: 4px;
}

.crawl-map__link {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 8px 14px;
  border-radius: 999px;
  border: 1px solid rgba(15, 118, 110, 0.18);
  background: var(--brand-soft);
  color: var(--brand);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.crawl-map__link:hover {
  border-color: rgba(15, 118, 110, 0.34);
  background: rgba(15, 118, 110, 0.18);
}

.crawl-map__pages {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.crawl-map__section {
  margin-top: 18px;
}

.crawl-map__section:first-of-type {
  margin-top: 0;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 10px;
}

.desktop-only {
  display: block;
}

.mobile-only {
  display: none;
}

@media (max-width: 820px) {
  .desktop-only {
    display: none;
  }

  .mobile-only {
    display: block;
  }
}

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

.skeleton {
  background: linear-gradient(
    90deg,
    rgba(15, 23, 42, 0.08) 25%,
    rgba(15, 23, 42, 0.15) 45%,
    rgba(15, 23, 42, 0.08) 65%
  );
  background-size: 400px 100%;
  animation: shimmer 1.15s linear infinite;
}

.header {
  position: sticky;
  top: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, 0.97);
  /* backdrop-filter: blur(12px); — wyłączone dla wydajności */
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
}

.brand-cluster {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.brand-link--home .logo {
  transition: transform 0.15s ease;
}

.brand-link--home:hover .logo {
  transform: translateY(-1px) scale(1.02);
}

.logo {
  height: 38px;
  width: auto;
  display: block;
}

.brand-name {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #1e3a8a;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(239, 246, 255, 0.96));
  border-radius: 10px;
  padding: 4px 9px;
  line-height: 1.1;
}

.brand-name::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

.brand-name--reset {
  text-decoration: none;
}

.brand-name--reset:hover {
  color: #1e3a8a;
  border-color: rgba(37, 99, 235, 0.34);
  background: linear-gradient(180deg, rgba(255, 255, 255, 1), rgba(229, 238, 255, 0.98));
}

.header-status {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 16px;
  background: #1a2f5e;
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 999px;
  color: #ffffff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  box-shadow: 0 2px 10px rgba(26,47,94,.25);
  text-decoration: none;
}

.header-status:hover {
  background: #243d78;
}

.header-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
  background: #e7392e;
  box-shadow: 0 0 0 3px rgba(231,57,46,.28);
}

@media (max-width: 820px) {
  .header {
    padding: 8px 10px;
  }

  .header-status {
    display: none !important;
  }

  .brand-link {
    gap: 8px;
  }

  .brand-cluster {
    gap: 8px;
  }

  .logo {
    height: 32px;
  }

  .brand-name {
    font-size: 10px;
    padding: 4px 8px;
  }
}

.wrapper {
  max-width: 1500px;
  margin: 0 auto;
  padding: 14px 12px 28px;
  display: flex;
  gap: 14px;
}

.content {
  flex: 1;
  min-width: 0;
}

.sidebar {
  position: sticky;
  top: 74px;
  align-self: flex-start;
  width: 304px;
  min-width: 304px;
  max-height: calc(100vh - 84px);
  border-radius: 18px;
  border: 1px solid rgba(17, 34, 51, 0.1);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-sm);
  padding: 10px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  scrollbar-width: none;
}

.sidebar::-webkit-scrollbar {
  display: none;
}

.filters-scroll {
  display: grid;
  gap: 8px;
}

.filters-head {
  border: 1px solid rgba(37, 99, 235, 0.18);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.1), rgba(37, 99, 235, 0.04));
  border-radius: 14px;
  padding: 10px 11px;
}

.filters-head-title {
  font-size: 13px;
  font-weight: 800;
  color: #0c4f49;
}

.filters-head-sub {
  margin-top: 4px;
  font-size: 11px;
  line-height: 1.35;
  color: #36546f;
}

.fsec {
  border: 1px solid rgba(17, 34, 51, 0.1);
  border-radius: 14px;
  background: var(--surface-strong);
  overflow: hidden;
}

.fsec summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 11px;
  color: #13263a;
  font-size: 12px;
  font-weight: 700;
}

.fsec summary::-webkit-details-marker {
  display: none;
}

.fsec summary::after {
  content: "+";
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border-radius: 6px;
  background: rgba(17, 34, 51, 0.07);
  color: #5d7086;
  font-size: 16px;
  font-weight: 400;
  line-height: 1;
  transition: background 0.12s, color 0.12s;
}

.fsec[open] summary::after {
  content: "−";
  background: rgba(37, 99, 235, 0.12);
  color: #2563eb;
}

.fsec[open] summary {
  background: rgba(37, 99, 235, 0.07);
}

.fsec-body {
  display: grid;
  gap: 8px;
  padding: 10px 11px;
  border-top: 1px solid rgba(17, 34, 51, 0.06);
}

.sidebar input[type="search"],
.sidebar input[type="text"],
.sidebar input[type="number"],
.sidebar select,
.combo {
  width: 100%;
  height: 38px;
  border: 1.5px solid rgba(17, 34, 51, 0.13);
  border-radius: 10px;
  background: #fff;
  color: #0f1f2e;
  padding: 0 12px;
  margin: 0;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.sidebar select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%235d7086' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
  padding-right: 32px;
  cursor: pointer;
}

.sidebar input::placeholder,
.combo::placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.sidebar input:hover,
.sidebar select:hover,
.combo:hover {
  border-color: rgba(17, 34, 51, 0.28);
}

.sidebar input:focus,
.sidebar select:focus,
.combo:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.hint,
.range2-hint {
  font-size: 11px;
  color: var(--muted);
  line-height: 1.35;
}

.year-range-fields,
.range2-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.range2-row {
  margin-bottom: 8px;
}

.range2 {
  border: 1px solid rgba(17, 34, 51, 0.12);
  border-radius: 12px;
  padding: 9px;
  background: rgba(249, 251, 255, 0.85);
}

.range2-sliders {
  display: grid;
  gap: 10px;
  margin-top: 10px;
}

.range2-sliders input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  margin: 0;
  height: 6px;
  border-radius: 3px;
  background: #e2e8f0;
  accent-color: #2563eb;
  cursor: pointer;
  outline: none;
}

.range2-sliders input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.35);
  cursor: pointer;
  transition: box-shadow 0.12s;
}

.range2-sliders input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 1px 8px rgba(37, 99, 235, 0.55);
}

.range2-sliders input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #2563eb;
  border: 2.5px solid #fff;
  box-shadow: 0 1px 6px rgba(37, 99, 235, 0.35);
  cursor: pointer;
}

.vt-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.vt-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1.5px solid rgba(17, 34, 51, 0.11);
  background: #f9fafc;
  cursor: pointer;
  font-size: 12px;
  transition: border-color 0.12s, background 0.12s;
}

.vt-item input {
  display: none;
}

.vt-item:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.05);
}

.vt-item:has(input:checked) {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.1);
}

.vt-item:has(input:checked) .vt-label {
  color: #1d4ed8;
}

.vt-item:has(input:checked) .vt-badge {
  border-color: #2563eb;
  background: #2563eb;
  color: #fff;
}

.filter-flags {
  display: grid;
  gap: 6px;
}

.filter-flag {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  border: 1.5px solid rgba(17, 34, 51, 0.1);
  border-radius: 10px;
  padding: 8px 10px;
  background: #f9fafc;
  cursor: pointer;
  transition: border-color 0.12s, background 0.12s;
}

.filter-flag::before {
  content: '';
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid rgba(17, 34, 51, 0.2);
  flex-shrink: 0;
  transition: border-color 0.12s, background 0.12s;
}

.filter-flag:hover {
  border-color: rgba(37, 99, 235, 0.3);
  background: rgba(37, 99, 235, 0.04);
}

.filter-flag:hover::before {
  border-color: rgba(37, 99, 235, 0.4);
}

.filter-flag input {
  display: none;
}

.filter-flag__name {
  color: #1a2f42;
  font-size: 12px;
  font-weight: 700;
  transition: color 0.12s;
}

.filter-flag__count {
  color: #64748b;
  font-size: 11px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.filter-flag:has(input:checked) {
  border-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

.filter-flag:has(input:checked)::before {
  border-color: #2563eb;
  background: #2563eb;
  box-shadow: inset 0 0 0 2px #fff;
}

.filter-flag:has(input:checked) .filter-flag__name {
  color: #1d4ed8;
}

.vt-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  color: #122033;
  font-size: 12px;
  font-weight: 700;
}

.vt-badge {
  min-width: 27px;
  height: 21px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(17, 34, 51, 0.12);
  background: #ffffff;
  color: #20354a;
  font-size: 10px;
  font-weight: 800;
}

.vt-count {
  color: #55708c;
  font-size: 11px;
  font-weight: 700;
}

.f-label {
  display: block;
  margin-top: 4px;
  color: #2b435b;
  font-size: 11px;
  font-weight: 700;
}

/* ---- Custom Select / Combo Dropdowns ---- */

.csel {
  position: relative;
  width: 100%;
}

.csel__trigger {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 12px;
  border: 1.5px solid rgba(17,34,51,.13);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  color: #0f1f2e;
  transition: border-color .15s, box-shadow .15s;
}

.csel__trigger:hover {
  border-color: rgba(17,34,51,.28);
}

.csel.is-open .csel__trigger {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.csel__trigger-text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  flex: 1;
  text-align: left;
}

.csel__trigger-text.is-placeholder {
  color: #94a3b8;
  font-weight: 500;
}

.csel__arrow {
  flex-shrink: 0;
  width: 14px;
  height: 14px;
  margin-left: 8px;
  transition: transform .2s;
}

.csel.is-open .csel__arrow {
  transform: rotate(180deg);
}

.csel__dropdown {
  position: fixed;
  z-index: 300;
  background: #fff;
  border: 1px solid rgba(17,34,51,.10);
  border-radius: 12px;
  box-shadow: 0 12px 36px rgba(0,0,0,.14), 0 2px 8px rgba(0,0,0,.06);
  max-height: 260px;
  display: none;
  flex-direction: column;
  overflow: hidden;
  min-width: 200px;
}

.csel.is-open .csel__dropdown {
  display: flex;
  animation: csel-fadein .12s ease-out;
}

@keyframes csel-fadein {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.csel__search-wrap {
  padding: 8px 8px 4px;
}

.csel__search {
  width: 100%;
  height: 32px;
  border: 1.5px solid rgba(17,34,51,.10);
  border-radius: 8px;
  padding: 0 10px;
  font: inherit;
  font-size: 12px;
  font-weight: 500;
  outline: none;
  color: #0f1f2e;
  background: #f8fafc;
  transition: border-color .12s;
}

.csel__search::placeholder {
  color: #94a3b8;
}

.csel__search:focus {
  border-color: #2563eb;
  background: #fff;
}

.csel__options {
  overflow-y: auto;
  padding: 4px 6px 6px;
  flex: 1;
  scrollbar-width: thin;
}

.csel__option {
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  color: #1a2f42;
  cursor: pointer;
  transition: background .08s;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.csel__option:hover,
.csel__option.is-focused {
  background: rgba(37,99,235,.06);
}

.csel__option.is-active {
  background: rgba(37,99,235,.10);
  color: #1d4ed8;
  font-weight: 700;
}

.csel__empty {
  padding: 14px;
  text-align: center;
  color: #94a3b8;
  font-size: 12px;
}

/* Combo (make/model) */
.ccombo {
  position: relative;
  width: 100%;
}

.ccombo .csel__dropdown {
  min-width: 100%;
}

.ccombo.is-open .csel__dropdown {
  display: flex;
  animation: csel-fadein .12s ease-out;
}

.ccombo--disabled input {
  opacity: 0.45;
  cursor: not-allowed;
  background: #f3f4f6;
  color: #9ca3af;
}

.ccombo--disabled::after {
  content: '';
  position: absolute;
  inset: 0;
  cursor: not-allowed;
  border-radius: inherit;
}

#models-group {
  display: block;
}

#filter-actions-sticky {
  border-top: 1px solid rgba(17, 34, 51, 0.1);
  margin-top: 10px;
  padding: 10px 6px;
  display: flex;
  gap: 8px;
}

#filter-actions-sticky button {
  flex: 1;
  height: 38px;
  border-radius: 12px;
  border: 1px solid rgba(17, 34, 51, 0.13);
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
}

#apply {
  color: #1e3a8a;
  border-color: rgba(37, 99, 235, 0.32);
  background: linear-gradient(180deg, rgba(37, 99, 235, 0.18), rgba(37, 99, 235, 0.08));
}

#apply:hover {
  background: rgba(37, 99, 235, 0.16);
}

#clear {
  color: #21364b;
  background: rgba(17, 34, 51, 0.05);
}

#clear:hover {
  background: rgba(17, 34, 51, 0.09);
}

#filter-actions-sticky button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.active-filters {
  margin: 0 0 6px;
}

.chips-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.af-label {
  color: #2e465e;
  font-size: 12px;
  font-weight: 700;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 999px;
  border: 1px solid rgba(37, 99, 235, 0.28);
  background: rgba(239, 246, 255, 0.95);
  color: #1e40af;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
}

.chip--safe {
  border-color: rgba(245, 158, 11, 0.36);
  background: rgba(245, 158, 11, 0.17);
  color: #8a4b03;
}

.chip--archive {
  border: 1.5px solid rgba(251, 191, 36, 0.55);
  background: #1e293b;
  color: #fbbf24;
  font-weight: 800;
  animation: archive-pulse 2.4s ease-in-out infinite;
}

@keyframes archive-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(251, 191, 36, 0); }
  50%       { box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.22); }
}

.chip-x {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  border: 1px solid rgba(17, 34, 51, 0.17);
  background: rgba(255, 255, 255, 0.75);
  color: #1f3348;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.chip-clearall {
  border-radius: 999px;
  border: 1px solid rgba(17, 34, 51, 0.16);
  background: rgba(255, 255, 255, 0.7);
  color: #233a50;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.filters-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(3, 12, 24, 0.58);
  z-index: 420;
}

.filters-backdrop.is-open {
  display: block;
}

#gallery-backdrop,
#lead-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(3, 12, 24, 0.65);
  z-index: 10008;
}

#video-backdrop {
  position: fixed;
  inset: 0;
  display: none;
  background: rgba(3, 8, 16, 0.82);
  z-index: 10100;
}

#video-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, 90vw);
  height: min(520px, 80vh);
  z-index: 10101;
  display: none;
  flex-direction: column;
  gap: 0;
  background: #0a0f1a;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 20px;
  padding: 0;
  color: #e2e8f0;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6);
  overflow: hidden;
}

#video-close {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px 8px;
  flex-shrink: 0;
}

#video-close .gallery-title {
  font-size: 14px;
  font-weight: 800;
  color: #94a3b8;
}

#video-player {
  flex: 1;
  min-height: 0;
  width: 100%;
  border-radius: 0 0 20px 20px;
  background: #000;
  display: block;
}

#gallery-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(880px, 92vw);
  height: min(640px, 85vh);
  z-index: 10009;
  display: none;
  flex-direction: column;
  background: #0d1117;
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 20px;
  padding: 14px 14px 10px;
  color: #f1f5f9;
  box-shadow: 0 40px 100px rgba(0,0,0,.7);
}

#gallery-backdrop {
  backdrop-filter: blur(4px);
}

.gallery-topbar {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  margin-bottom: 10px;
  margin-top: 0;
  flex-shrink: 0;
}

.gallery-title {
  font-size: 15px;
  font-weight: 800;
  color: #f1f5f9;
  margin-right: auto;
}

.gallery-lot {
  font-size: 12px;
  font-weight: 700;
  color: #64748b;
  margin-left: 6px;
}

.gallery-counter {
  min-width: 58px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: #94a3b8;
  font-size: 11px;
  font-weight: 800;
}

.gallery-close-btn {
  width: 32px;
  height: 32px;
  padding: 0;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.07);
  color: #94a3b8;
  cursor: pointer;
  font-size: 16px;
  font-weight: 400;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, color .15s;
}

.gallery-close-btn:hover {
  background: rgba(255,255,255,.14);
  color: #f1f5f9;
}

.gallery-viewer {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gallery-img-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: #060a0f;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.gallery-big {
  width: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  cursor: pointer;
  display: block;
}

.gallery-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,.15);
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  color: #f1f5f9;
  font-size: 28px;
  font-weight: 300;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2;
  transition: background .15s;
  line-height: 1;
  padding-bottom: 2px;
}

.gallery-nav-btn:hover {
  background: rgba(0,0,0,.8);
}

.gallery-nav-btn:disabled {
  opacity: 0.35;
  cursor: default;
}

.gallery-nav-btn--prev { left: 8px; }
.gallery-nav-btn--next { right: 8px; }

.gallery-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #e2e8f0;
  font-size: 14px;
  font-weight: 700;
  background: rgba(6,10,15,.75);
}

.gallery-thumbs {
  display: flex;
  justify-content: center;
  gap: 6px;
  overflow-x: auto;
  padding: 4px 0 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.2) transparent;
  flex-shrink: 0;
}

.gallery-thumbs::-webkit-scrollbar { height: 4px; }
.gallery-thumbs::-webkit-scrollbar-thumb { background: rgba(255,255,255,.2); border-radius: 99px; }

.gallery-thumbs .gallery-thumb {
  flex: 0 0 auto;
  width: 72px;
  border: 2px solid rgba(255,255,255,.12);
  border-radius: 8px;
  background: rgba(255,255,255,.06);
  transition: border-color .15s;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}

.gallery-thumbs .gallery-thumb.active {
  border-color: rgba(99,179,237,.7);
}

.gallery-thumbs .gallery-thumb img {
  width: 72px;
  height: 50px;
  object-fit: cover;
  display: block;
}

.gallery-empty {
  padding: 10px 8px;
  color: #94a3b8;
  font-size: 13px;
  font-weight: 700;
}


#lead-modal {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(560px, 92vw);
  max-height: 80vh;
  overflow: auto;
  z-index: 10009;
  display: none;
  background: rgba(255, 255, 255, 0.97);
  border: 1px solid rgba(17, 34, 51, 0.14);
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.28);
}

body.modal-open {
  overflow: hidden;
}

.lead-head {
  position: sticky;
  top: 0;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  padding: 12px 14px 9px;
  border-bottom: 1px solid rgba(17, 34, 51, 0.08);
  background: rgba(255, 255, 255, 0.97);
}

.lead-title {
  font-size: 15px;
  font-weight: 800;
}

.lead-sub {
  margin-top: 4px;
  color: #64758a;
  font-size: 12px;
  font-weight: 700;
}

.lead-close {
  border: 1px solid rgba(17, 34, 51, 0.14);
  background: rgba(17, 34, 51, 0.05);
  color: #243a50;
  border-radius: 10px;
  font-family: inherit;
  font-size: 12px;
  font-weight: 700;
  padding: 7px 10px;
  cursor: pointer;
}

.lead-body {
  padding: 12px 14px 14px;
}

.lead-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.lead-body label {
  display: block;
  color: #233a50;
  font-size: 12px;
  font-weight: 700;
  margin-top: 8px;
}

.lead-body input,
.lead-body textarea {
  width: 100%;
  border: 1px solid rgba(17, 34, 51, 0.15);
  border-radius: 12px;
  background: #f9fbff;
  color: #122033;
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  margin-top: 5px;
  padding: 9px 10px;
}

.lead-body textarea {
  min-height: 104px;
  resize: vertical;
}

.lead-actions {
  margin-top: 11px;
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.modal__status {
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
}

.modal__status.ok {
  color: #1d4ed8;
}

.modal__status.err {
  color: #b91c1c;
}

@media (max-width: 980px) {
  .wrapper {
    padding: 4px 8px 20px;
    gap: 10px;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    height: 100vh;
    height: 100dvh;
    z-index: 430;
    width: min(75vw, 320px) !important;
    min-width: 0 !important;
    border-radius: 0 16px 16px 0;
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    box-shadow: 0 32px 80px rgba(2, 6, 23, 0.34);
    overflow: hidden;
    display: flex;
    flex-direction: column;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .filters-scroll {
    flex: 1;
    min-height: 0;
    display: block;
    overflow-y: scroll;
    overflow-x: hidden;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
    padding-right: 4px;
    padding-bottom: 10px;
  }

  #filter-actions-sticky {
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(8px);
  }
}

@media (max-width: 760px) {
  .wrapper {
    padding: 2px 6px 16px;
    gap: 8px;
  }

  .header {
    padding: 7px 8px;
  }

  .lead-grid {
    grid-template-columns: 1fr;
  }

  #gallery-modal {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: calc(100vw - 12px);
    height: calc(100vh - 12px);
    border-radius: 16px;
    padding: 9px;
  }

  .gallery-thumbs .gallery-thumb { width: 58px; }
  .gallery-thumbs .gallery-thumb img { width: 58px; height: 40px; }
}

@media (max-width: 480px) {
  .brand-name {
    font-size: 9px;
    letter-spacing: 0.03em;
  }
}

/* Theme refresh */
.header {
  background: rgba(255, 255, 255, 0.97);
  border-bottom-color: var(--line);
  box-shadow: 0 12px 30px rgba(9, 29, 41, 0.09);
}

.brand-name {
  color: #175550;
  border-color: rgba(15, 118, 110, 0.25);
  background: linear-gradient(180deg, #ffffff 0%, #edf8f6 100%);
}

.brand-name::before {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.2);
}

.brand-name--reset:hover {
  color: #144c47;
  border-color: rgba(15, 118, 110, 0.36);
  background: linear-gradient(180deg, #ffffff 0%, #e8f5f3 100%);
}


.sidebar {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.93);
}

.filters-head {
  border-color: rgba(15, 118, 110, 0.24);
  background: linear-gradient(180deg, rgba(15, 118, 110, 0.14), rgba(204, 122, 18, 0.08));
}

.filters-head-title {
  color: #1c4f4a;
}

.filters-head-sub {
  color: #536f7b;
}

.fsec {
  border-color: var(--line);
}

.fsec summary {
  color: var(--text);
}

.fsec summary::after {
  color: var(--muted);
}

.fsec[open] summary {
  background: rgba(15, 118, 110, 0.08);
}

.fsec-body {
  border-top-color: var(--line-soft);
}

.sidebar input[type="search"],
.sidebar input[type="text"],
.sidebar input[type="number"],
.sidebar select,
.combo {
  border-color: rgba(23, 38, 47, 0.16);
  background: var(--surface-subtle);
  color: var(--text);
}

.sidebar input::placeholder,
.combo::placeholder {
  color: var(--muted-2);
}

.sidebar input:focus,
.sidebar select:focus,
.combo:focus {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.16);
}

.range2 {
  border-color: var(--line);
  background: rgba(246, 249, 253, 0.92);
}

.vt-item,
.filter-flag {
  border-color: var(--line);
  background: var(--surface-subtle);
}

.vt-item:has(input:checked),
.filter-flag:has(input:checked) {
  border-color: rgba(15, 118, 110, 0.36);
  background: rgba(15, 118, 110, 0.12);
}

.vt-label,
.filter-flag__name,
.f-label,
.af-label {
  color: var(--ink-soft);
}

.vt-badge {
  border-color: var(--line);
  color: var(--ink-soft);
}

.vt-count,
.filter-flag__count {
  color: var(--muted);
}

#filter-actions-sticky {
  border-top-color: var(--line);
}

#filter-actions-sticky button {
  border-color: var(--line);
}

#apply {
  color: #ffffff;
  border-color: rgba(15, 118, 110, 0.42);
  background: linear-gradient(180deg, #1b8b81 0%, #0f766e 100%);
}

#apply:hover {
  background: linear-gradient(180deg, #1f9388 0%, #117f75 100%);
}

#clear {
  color: var(--ink-soft);
  background: var(--surface-subtle);
}

#clear:hover {
  background: #edf7f6;
}

.chip {
  border-color: rgba(15, 118, 110, 0.3);
  background: rgba(232, 248, 246, 0.95);
  color: #1b5a55;
}

.chip--safe {
  border-color: rgba(11, 138, 102, 0.34);
  background: rgba(11, 138, 102, 0.13);
  color: #0b6f53;
}

.chip--archive {
  border-color: rgba(251, 191, 36, 0.5);
  background: #1e293b;
  color: #fbbf24;
}

.chip-x,
.chip-clearall {
  border-color: var(--line);
  background: rgba(255, 255, 255, 0.8);
  color: var(--ink-soft);
}

.filters-backdrop {
  background: rgba(8, 23, 29, 0.48);
}

#gallery-backdrop,
#lead-backdrop,
#video-backdrop {
  background: rgba(8, 23, 29, 0.56);
}


#lead-modal {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--line);
}

.lead-head {
  border-bottom-color: var(--line-soft);
  background: rgba(255, 255, 255, 0.98);
}

.lead-sub {
  color: var(--muted);
}

.lead-close {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--ink-soft);
}

.lead-body label {
  color: var(--ink-soft);
}

.lead-body input,
.lead-body textarea {
  border-color: var(--line);
  background: var(--surface-subtle);
  color: var(--text);
}

.modal__status.ok {
  color: var(--brand);
}

.modal__status.err {
  color: #b72020;
}

@media (max-width: 980px) {
  #filter-actions-sticky {
    background: rgba(255, 255, 255, 0.97);
  }
}

/* Theme v4: deep navy + amber – premium auto import */
:root {
  --bg: #f3f4f6;
  --bg2: #e9ebee;
  --surface: rgba(255, 255, 255, 0.92);
  --surface-strong: #ffffff;
  --surface-subtle: #f8f9fb;
  --surface-muted: #f0f1f4;
  --text: #111827;
  --ink-soft: #374151;
  --muted: #6b7280;
  --muted-2: #9ca3af;
  --line: rgba(17, 24, 39, 0.12);
  --line-soft: rgba(17, 24, 39, 0.07);

  --brand: #1e3a5f;
  --brand-soft: rgba(30, 58, 95, 0.1);
  --accent: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.14);
  --success: #059669;
  --success-soft: rgba(5, 150, 105, 0.12);
  --warning: #b45309;
  --warning-soft: rgba(180, 83, 9, 0.13);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.11);

  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 4px 16px rgba(17, 24, 39, 0.08);
  --shadow-md: 0 12px 32px rgba(17, 24, 39, 0.12);
  --focus: 0 0 0 4px rgba(30, 58, 95, 0.18);
}

body {
  background:
    radial-gradient(860px 380px at 14% -12%, rgba(30, 58, 95, 0.09), transparent 54%),
    radial-gradient(720px 340px at 90% -6%, rgba(217, 119, 6, 0.07), transparent 50%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg2) 100%);
}

.brand-name {
  color: #1e3a5f;
  border-color: rgba(30, 58, 95, 0.22);
  background: linear-gradient(180deg, #ffffff 0%, #f0f4fa 100%);
}

.brand-name::before {
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.18);
}

.brand-name--reset:hover {
  color: #172d4a;
  border-color: rgba(30, 58, 95, 0.34);
  background: linear-gradient(180deg, #ffffff 0%, #e8eef8 100%);
}


.filters-head {
  border-color: rgba(30, 58, 95, 0.18);
  background: linear-gradient(180deg, rgba(30, 58, 95, 0.1), rgba(217, 119, 6, 0.05));
}

.filters-head-title {
  color: #1e3a5f;
}

.filters-head-sub {
  color: #56687c;
}

.fsec[open] summary {
  background: rgba(30, 58, 95, 0.07);
}

.sidebar input:focus,
.sidebar select:focus,
.combo:focus {
  border-color: rgba(30, 58, 95, 0.4);
  box-shadow: 0 0 0 3px rgba(30, 58, 95, 0.12);
}

.vt-item:has(input:checked),
.filter-flag:has(input:checked) {
  border-color: rgba(30, 58, 95, 0.3);
  background: rgba(30, 58, 95, 0.09);
}

#apply {
  color: #ffffff;
  border-color: rgba(30, 58, 95, 0.5);
  background: linear-gradient(180deg, #264d7a 0%, #1e3a5f 100%);
}

#apply:hover {
  background: linear-gradient(180deg, #2e5a8e 0%, #234570 100%);
}

#clear:hover {
  background: #eceff4;
}

.chip {
  border-color: rgba(30, 58, 95, 0.25);
  background: rgba(240, 244, 250, 0.95);
  color: #1e3a5f;
}


/* Filter UX simplification */
.sidebar {
  border-radius: 20px;
  padding: 12px;
}

.filters-scroll {
  gap: 10px;
}

.fsec {
  border-radius: 16px;
  border-color: rgba(23, 38, 47, 0.12);
  background: #ffffff;
}

.fsec summary {
  min-height: 44px;
  padding: 12px 13px;
  font-size: 13px;
  font-weight: 800;
}

.fsec summary::after {
  content: "+";
  width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(37, 99, 235, 0.11);
  color: #1f4ca3;
  font-size: 14px;
  font-weight: 900;
  transition: transform 0.15s ease, background 0.15s ease;
}

.fsec[open] summary::after {
  content: "−";
  transform: none;
  background: rgba(37, 99, 235, 0.18);
}

.fsec-body {
  gap: 10px;
  padding: 12px;
}

.sidebar input[type="search"],
.sidebar input[type="text"],
.sidebar input[type="number"],
.sidebar select,
.combo {
  height: 40px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 650;
  background: #f8fbff;
}

.hint,
.range2-hint {
  font-size: 11px;
  line-height: 1.45;
}

.vt-list {
  display: grid;
  gap: 7px;
}

.vt-item {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  border-radius: 12px;
  padding: 8px 10px;
}

.vt-label {
  gap: 8px;
}

.vt-count {
  margin-left: auto;
  font-weight: 800;
}

.filter-flags {
  gap: 7px;
}

.filter-flag {
  border-radius: 12px;
  padding: 8px 10px;
}

.filter-flag__name {
  font-size: 12px;
  font-weight: 750;
}

.filter-flag__count {
  font-size: 11px;
  font-weight: 800;
}

.f-label {
  margin-top: 2px;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.01em;
}

#filter-actions-sticky {
  margin-top: 12px;
  padding: 12px 6px 6px;
  border-top-color: rgba(23, 38, 47, 0.12);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.98) 35%);
}

#filter-actions-sticky button {
  height: 40px;
  font-size: 13px;
  font-weight: 800;
}

#apply {
  flex: 2;
}

@media (max-width: 980px) {
  .sidebar {
    border-radius: 0 20px 20px 0;
    padding: 10px;
  }
}

/* Odo unit toggle */
.odo-unit-toggle {
  display: inline-flex;
  border-radius: 10px;
  border: 1px solid var(--line);
  overflow: hidden;
  margin-bottom: 8px;
}

.odo-unit-btn {
  border: 0;
  background: var(--surface-subtle);
  color: var(--muted);
  padding: 5px 14px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  font-family: inherit;
  transition: background .12s, color .12s;
}

.odo-unit-btn.is-active {
  background: var(--brand);
  color: #ffffff;
}

.odo-unit-btn:not(.is-active):hover {
  background: rgba(30, 58, 95, 0.08);
}

/* Lead form extras */
.lead-req {
  color: #dc2626;
  font-weight: 800;
}

.lead-privacy {
  display: flex !important;
  align-items: flex-start;
  gap: 8px;
  margin-top: 10px !important;
  font-size: 11px !important;
  line-height: 1.4;
  cursor: pointer;
}

.lead-privacy input[type="checkbox"] {
  width: 18px !important;
  height: 18px !important;
  min-width: 18px;
  margin: 0 !important;
  padding: 0 !important;
  border-radius: 6px;
  accent-color: var(--brand);
  cursor: pointer;
  flex-shrink: 0;
}

.lead-privacy a {
  color: var(--brand);
  text-decoration: underline;
}

.lead-privacy a:hover {
  color: #172d4a;
}

/* Ribbon tooltip cursor */
.lot__ribbon {
  cursor: help;
  pointer-events: auto;
}
