@import url("https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;1,400;1,600&display=swap");

/* ------------------------------------------------------------------ */

/* Токены                                                              */

/* ------------------------------------------------------------------ */

:root {
  --bg: #f1efe9;
  --surface: #fffdf8;
  --surface-soft: #f8f4ec;
  --text: #191512;
  --muted: #71685e;
  --line: rgba(64, 52, 39, 0.13);
  --line-strong: rgba(64, 52, 39, 0.22);
  --accent: #b31318;
  --accent-dark: #870d11;
  --accent-soft: #f6e2df;
  --shadow: 0 18px 55px rgba(38, 29, 20, 0.09), 0 1px 0 rgba(255, 255, 255, 0.72) inset;
  --shadow-modal: 0 36px 100px rgba(18, 13, 9, 0.26), 0 1px 0 rgba(255, 255, 255, 0.74) inset;
  --radius: 18px;
  --ease-premium: cubic-bezier(0.32, 0.72, 0, 1);
  /* Единая система модалок: отступ от краёв экрана и предельные размеры.
     Крупные окна «почти на весь экран», но с ограничением на ультра-широких. */
  --modal-gap: clamp(10px, 2.4vh, 30px);
  --modal-w: min(1600px, calc(100vw - var(--modal-gap) * 2));
  --modal-h: min(1000px, calc(100vh - var(--modal-gap) * 2));
  --font-display: "Playfair Display", Georgia, serif;
  --font-sans: "Playfair Display", Georgia, serif;
  color: var(--text);
  background: var(--bg);
  font-family: var(--font-display);
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

html { background: var(--bg); }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  font-family: var(--font-display);
  font-size: 14.5px;
  line-height: 1.5;
  background:
    linear-gradient(90deg, rgba(72, 58, 40, 0.035) 1px, transparent 1px) 0 0 / 74px 74px,
    linear-gradient(0deg, rgba(72, 58, 40, 0.028) 1px, transparent 1px) 0 0 / 74px 74px,
    linear-gradient(180deg, #f8f5ee 0%, var(--bg) 48%, #ebe6dc 100%);
}

body::before {
  content: "";
  position: fixed;
  z-index: 1;
  inset: 0;
  pointer-events: none;
  opacity: 0.22;
  background-image:
    repeating-linear-gradient(45deg, rgba(61, 47, 31, 0.04) 0 1px, transparent 1px 7px);
  mix-blend-mode: multiply;
}

button, input, select, textarea { font: inherit; color: inherit; }

button { cursor: pointer; }

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(185, 28, 28, 0.4);
  outline-offset: 2px;
}

/* ------------------------------------------------------------------ */

/* Иконки-глифы                                                        */

/* ------------------------------------------------------------------ */

.uiIcon {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: var(--icon-size, 18px);
  height: var(--icon-size, 18px);
  line-height: 1;
}

.uiIcon::before {
  display: block;
  font-size: calc(var(--icon-size, 18px) * 0.92);
  font-weight: 700;
}

.uiIcon-search::before { content: "⌕"; font-weight: 800; }

.uiIcon-plus::before { content: "+"; }

.uiIcon-x::before { content: "×"; }

.uiIcon-flag::before { content: "⚑"; }

.uiIcon-layers::before { content: "▧"; }

.uiIcon-crosshair::before { content: "⌖"; }

.uiIcon-pin::before { content: "⌾"; }

.uiIcon-locate::before { content: "◎"; }

.uiIcon-camera::before { content: "◉"; }

.uiIcon-upload::before { content: "⇧"; }

.uiIcon-users::before { content: "⁑"; }

.uiIcon-pencil::before { content: "✎"; }

.uiIcon-trash::before { content: "⌦"; }

.uiIcon-link::before { content: "↗"; }

.uiIcon-scan::before { content: "❏"; }

.uiIcon-alert::before { content: "!"; }

.uiIcon-login::before { content: "⇥"; }

.uiIcon-sliders::before { content: "☷"; font-size: calc(var(--icon-size, 18px) * 0.82); }

.emblemStar { flex: 0 0 auto; }

/* ------------------------------------------------------------------ */

/* Кнопки                                                              */

/* ------------------------------------------------------------------ */

.btnPrimary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  color: #fff;
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: none;
  transition: background 150ms ease, border-color 150ms ease, transform 120ms ease;
}

.btnPrimary:hover { background: var(--accent-dark); border-color: var(--accent-dark); }

.btnPrimary:active { transform: translateY(1px); }

.btnPrimary:disabled { opacity: 0.55; cursor: default; }

.btnGhost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font-weight: 600;
  font-size: 14px;
  box-shadow: none;
  transition: border-color 150ms ease, background 150ms ease;
}

.btnGhost:hover { border-color: var(--muted); background: var(--surface-soft); }

.btnGhost:disabled { opacity: 0.55; cursor: default; }

.btnSmall { min-height: 36px; padding: 0 14px; font-size: 13px; }

.dangerButton {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  padding: 0 14px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(185, 28, 28, 0.35);
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  transition: background 150ms ease, border-color 150ms ease;
}

.dangerButton:hover { background: var(--accent-soft); border-color: var(--accent); }

.dangerButton:disabled { opacity: 0.55; cursor: default; }

.ghostIconButton {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  transition: color 150ms ease, border-color 150ms ease, background 150ms ease;
}

.ghostIconButton:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-soft); }

.muted { color: var(--muted); font-size: 13px; }

/* ------------------------------------------------------------------ */

/* Каркас страницы                                                     */

/* ------------------------------------------------------------------ */

.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 15px 16px;
}

/* --- Шапка --- */

.siteHeader {
  display: flex;
  align-items: center;
  gap: 32px;
  min-height: 78px;
  margin: 12px 0 14px;
  padding: 0 24px;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(64, 52, 39, 0.14);
  border-radius: 22px;
  box-shadow: 0 18px 52px rgba(38, 29, 20, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: inherit;
}

.brandText strong {
  display: block;
  font-family: var(--font-display);
  font-size: 19px;
  font-weight: 700;
  letter-spacing: 0.015em;
  line-height: 1.15;
}

.brandText small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.siteNav {
  display: flex;
  gap: 4px;
  margin-left: 12px;
}

.siteNav button {
  padding: 9px 14px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 500;
  font-size: 14px;
  transition: color 180ms ease, background 180ms ease, transform 180ms ease;
}

.siteNav button:hover { color: var(--text); background: rgba(179, 19, 24, 0.07); transform: translateY(-1px); }

.siteNav button.isActive { color: var(--accent); font-weight: 600; }

.headerActions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.headerStats {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  padding: 5px 10px;
  color: var(--muted);
  background: rgba(248, 244, 236, 0.74);
  border: 1px solid rgba(64, 52, 39, 0.12);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
  font-size: 11.5px;
  line-height: 1.1;
  white-space: nowrap;
}

.headerStats span {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
}

.headerStats strong {
  color: var(--accent);
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.headerActionButton {
  white-space: nowrap;
}

.headerSearch {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 12px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 8px;
  font-weight: 500;
  font-size: 14px;
}

.headerSearch:hover { color: var(--text); background: var(--surface-soft); }

.btnLogin {
  width: 40px;
  min-width: 40px;
  min-height: 40px;
  padding: 0;
  border-radius: 999px;
}

/* --- Статистика --- */

.statsBar {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 14px 24px;
  margin-bottom: 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.statsItems {
  display: flex;
  align-items: center;
  gap: 26px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.statItem {
  display: flex;
  align-items: center;
  gap: 12px;
}

.statItem > .uiIcon { color: var(--accent); }

.statItem strong {
  display: block;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.statItem span {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.statsActions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

/* --- Поиск --- */

.searchSection {
  position: relative;
  margin-bottom: 10px;
}

.searchBar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 18px;
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(64, 52, 39, 0.13);
  border-radius: 20px;
  box-shadow: var(--shadow);
}

.searchBar > .uiIcon { color: var(--muted); }

.searchBar input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 0;
  background: transparent;
  border: 0;
  font-size: 15px;
}

.searchBar input:focus-visible { outline: none; }

.searchBar input::placeholder { color: var(--muted); }

.btnFilters {
  min-height: 40px;
  gap: 9px;
}

.btnFilters.isActive {
  color: var(--accent-dark);
  background: linear-gradient(180deg, #fff8f4, var(--accent-soft));
  border-color: rgba(179, 19, 24, 0.24);
}

.btnFilters em {
  display: inline-grid;
  place-items: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  font-size: 11px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
}

.filterChevron {
  display: inline-block;
  color: var(--muted);
  font-size: 14px;
  line-height: 1;
  transform: translateY(-1px);
}

.searchResults {
  position: absolute;
  z-index: 20;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 380px;
  overflow-y: auto;
  background: rgba(255, 253, 248, 0.98);
  border: 1px solid rgba(64, 52, 39, 0.16);
  border-radius: 18px;
  box-shadow: var(--shadow-modal);
}

.searchResultItem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 18px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.searchResultItem:last-child { border-bottom: 0; }

.searchResultItem:hover { background: var(--surface-soft); }

.searchResultText { flex: 1 1 auto; min-width: 0; }

.searchResultText strong {
  display: block;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.searchResultText small {
  display: block;
  color: var(--muted);
  font-size: 12.5px;
}

.searchResultText small.searchResultName {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 2px;
  color: var(--accent-dark);
  font-weight: 600;
}

.searchResultName .uiIcon { color: var(--accent); }

.searchResultNotFound {
  padding: 16px 18px;
  color: var(--muted);
  font-size: 13.5px;
}

/* --- Фильтры поиска --- */

.filtersPanel {
  position: relative;
  margin-top: 10px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.96), rgba(248, 244, 236, 0.96));
  border: 1px solid rgba(64, 52, 39, 0.15);
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(38, 29, 20, 0.11), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.filtersPanel::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.54);
  border-radius: 18px;
}

.filtersGrid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(240px, 1.08fr) minmax(250px, 1.05fr) minmax(250px, 1fr);
  gap: 0;
}

.filterGroup {
  min-width: 0;
  padding: 18px 20px;
  border-right: 1px solid rgba(64, 52, 39, 0.12);
}

.filterGroup:last-child { border-right: 0; }

.filterGroupHead {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.filterGroupHead h3,
.filterPeriod h3 {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.2;
}

.filterGroupHead span {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 600;
}

.filterSearch {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 11px;
  background: rgba(255, 253, 248, 0.8);
  border: 1px solid rgba(64, 52, 39, 0.15);
  border-radius: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.filterSearch .uiIcon { color: var(--muted); }

.filterSearch input {
  flex: 1 1 auto;
  min-width: 0;
  height: 38px;
  padding: 0;
  background: transparent;
  border: 0;
  font-size: 13px;
}

.filterSearch input:focus-visible { outline: none; }

.filterList,
.filterRadioList {
  display: grid;
  gap: 7px;
}

.filterGroupRegions .filterList {
  max-height: min(320px, calc(100vh - 410px));
  min-height: 192px;
  overflow-y: auto;
  padding: 1px 6px 14px 0;
  scrollbar-gutter: stable;
}

.filterCheck,
.filterRadio {
  position: relative;
  display: grid;
  align-items: center;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  gap: 9px;
  min-height: 34px;
  padding: 7px 9px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.42);
  border: 1px solid rgba(64, 52, 39, 0.12);
  border-radius: 13px;
  font-size: 13px;
  line-height: 1.25;
  cursor: pointer;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease, box-shadow 180ms ease;
}

.filterTypeCheck {
  grid-template-columns: 18px 18px minmax(0, 1fr) auto;
}

.filterCheck input,
.filterRadio input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.filterCheck:hover,
.filterRadio:hover {
  background: rgba(255, 253, 248, 0.78);
  border-color: rgba(64, 52, 39, 0.2);
  transform: translateY(-1px);
}

.filterCheck.isChecked,
.filterRadio.isChecked {
  background: rgba(246, 226, 223, 0.64);
  border-color: rgba(179, 19, 24, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.filterBox,
.filterDot {
  display: grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(64, 52, 39, 0.24);
  background: rgba(255, 253, 248, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.filterBox { border-radius: 5px; }

.filterDot { border-radius: 50%; }

.filterCheck.isChecked .filterBox,
.filterRadio.isChecked .filterDot {
  border-color: var(--accent);
  background: var(--accent);
}

.filterCheck.isChecked .filterBox::before {
  content: "✓";
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.filterRadio.isChecked .filterDot::before {
  content: "";
  width: 7px;
  height: 7px;
  background: #fff;
  border-radius: 50%;
}

.filterTypeCheck .uiIcon { color: var(--muted); }

.filterTypeCheck.isChecked .uiIcon { color: var(--accent); }

.filterLabel {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filterCheck em,
.filterRadio em {
  color: var(--muted);
  font-size: 11.5px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
}

.filterPeriod {
  margin-top: 20px;
  padding-top: 15px;
  border-top: 1px solid rgba(64, 52, 39, 0.1);
}

.filterPeriodFields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 10px;
}

.filterPeriodFields label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.filterPeriodFields input {
  min-width: 0;
  width: 100%;
  height: 38px;
  padding: 0 11px;
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid rgba(64, 52, 39, 0.16);
  border-radius: 13px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 13px;
}

.filterPeriodFields input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(179, 19, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

.filtersFooter {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 13px 18px;
  border-top: 1px solid rgba(64, 52, 39, 0.12);
  background: rgba(255, 253, 248, 0.58);
}

.selectedFilters {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 1 1 auto;
}

.selectedFilters > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
}

.filterChips,
.activeFilterStrip {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  min-width: 0;
}

.filterChips em {
  color: var(--muted);
  font-size: 12.5px;
  font-style: normal;
}

.filterChips button,
.activeFilterStrip button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 240px;
  min-height: 31px;
  padding: 0 10px 0 12px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.86);
  border: 1px solid rgba(64, 52, 39, 0.14);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.filterChips button:hover,
.activeFilterStrip button:hover {
  background: var(--accent-soft);
  border-color: rgba(179, 19, 24, 0.24);
  transform: translateY(-1px);
}

.filterChips button span,
.activeFilterStrip button span {
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
}

.filterActions {
  display: flex;
  gap: 10px;
  flex: 0 0 auto;
}

.filterApplyDot {
  width: 7px;
  height: 7px;
  margin-left: 2px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.16);
}

.activeFilterStrip {
  margin-top: 9px;
  padding: 8px 12px;
  color: var(--muted);
  background: rgba(255, 253, 248, 0.58);
  border: 1px solid rgba(64, 52, 39, 0.11);
  border-radius: 18px;
  box-shadow: 0 12px 34px rgba(38, 29, 20, 0.06), inset 0 1px 0 rgba(255, 255, 255, 0.66);
}

.activeFilterStrip > span {
  font-size: 12px;
  font-weight: 700;
}

.activeFilterStrip .activeFilterReset {
  color: var(--accent);
}

/* --- Карта --- */

.mapSection {
  position: relative;
  height: calc(100vh - 156px);
  min-height: 460px;
  margin-bottom: 16px;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid rgba(64, 52, 39, 0.16);
  border-radius: 26px;
  box-shadow: 0 28px 80px rgba(38, 29, 20, 0.13), 0 1px 0 rgba(255, 255, 255, 0.82) inset;
}

.mapSection::before {
  content: "";
  position: absolute;
  z-index: 4;
  inset: 8px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 20px;
  box-shadow: inset 0 0 0 1px rgba(64, 52, 39, 0.04);
}

.mapCanvas { position: absolute; inset: 0; }

.mapClickLayer {
  position: fixed;
  z-index: 80;
  inset: 0;
  background: transparent;
  border: 0;
  cursor: crosshair;
}

.mapPanel {
  position: absolute;
  z-index: 10;
  top: 16px;
  left: 16px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100% - 90px));
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(64, 52, 39, 0.14);
  border-radius: 20px;
  box-shadow: 0 18px 48px rgba(38, 29, 20, 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(14px);
  overflow: hidden;
}

.mapPanelHead {
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(64, 52, 39, 0.12);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.88), rgba(248, 244, 236, 0.72));
}

.mapPanelHead h3 {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

.mapPanelHead small { color: var(--muted); font-size: 12.5px; }

.mapPanelHead em { color: var(--accent); font-style: normal; font-weight: 700; }

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

.mapPanelEmpty { padding: 18px; color: var(--muted); font-size: 13.5px; }

.panelSkeletonList {
  display: grid;
  gap: 0;
}

.panelSkeletonItem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panelSkeletonThumb,
.panelSkeletonText i {
  display: block;
  overflow: hidden;
  background: linear-gradient(90deg, rgba(64, 52, 39, 0.08), rgba(255, 253, 248, 0.82), rgba(64, 52, 39, 0.08));
  background-size: 220% 100%;
  animation: skeletonShift 1.35s ease-in-out infinite;
}

.panelSkeletonThumb {
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  border-radius: 10px;
}

.panelSkeletonText {
  display: grid;
  gap: 7px;
  flex: 1 1 auto;
}

.panelSkeletonText i {
  height: 10px;
  border-radius: 999px;
}

.panelSkeletonText i:nth-child(1) { width: 78%; }

.panelSkeletonText i:nth-child(2) { width: 56%; }

.panelSkeletonText i:nth-child(3) { width: 34%; }

@keyframes skeletonShift {
  from { background-position: 120% 0; }
  to { background-position: -120% 0; }
}

.panelItem {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 14px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  transition: background 180ms ease, transform 180ms ease;
}

.panelItem:hover { background: rgba(179, 19, 24, 0.055); transform: translateX(2px); }

.panelThumb {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  overflow: hidden;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 10px;
}

.panelThumb img { width: 100%; height: 100%; object-fit: cover; }

.panelText { flex: 1 1 auto; min-width: 0; }

.panelText strong {
  display: block;
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.panelText small { display: block; color: var(--muted); font-size: 12px; }

.panelText em { display: block; margin-top: 2px; color: var(--accent-dark); font-size: 12px; font-style: normal; font-weight: 600; }

.panelArrow { color: var(--line-strong); font-size: 20px; }

.panelItem:hover .panelArrow { color: var(--accent); }

.mapPanelFooter {
  padding: 12px;
  color: var(--accent);
  background: var(--surface);
  border: 0;
  border-top: 1px solid var(--line);
  font-weight: 600;
  font-size: 13.5px;
}

.mapPanelFooter:hover { background: var(--accent-soft); }

.mapCtrls {
  position: absolute;
  z-index: 10;
  top: 16px;
  right: 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.mapCtrls button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: var(--shadow);
  font-size: 20px;
  font-weight: 600;
  line-height: 1;
}

.mapCtrls button:hover { border-color: var(--line-strong); background: var(--surface-soft); }

.mapClusterNumber {
  display: grid;
  place-items: center;
  width: 46px;
  height: 38px;
  color: #fffdf8;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 800;
  line-height: 1;
  text-align: center;
  text-shadow: 0 1px 6px rgba(38, 10, 10, 0.42);
  transform: translateY(2px);
}

.mapHint {
  position: absolute;
  z-index: 90;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 11px 16px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-modal);
  font-weight: 600;
  font-size: 13.5px;
}

.mapHint .uiIcon { color: var(--accent); }

/* --- Инфо-плашка --- */

.infoStrip {
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.infoLead { color: var(--text); font-size: 13.5px; font-weight: 500; }

.infoPoints {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  flex: 1 1 auto;
}

.infoPoints span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
}

.infoPoints .uiIcon { color: var(--accent); }

.infoMore {
  color: var(--accent);
  background: transparent;
  border: 0;
  font-weight: 600;
  font-size: 13.5px;
}

.infoMore:hover { color: var(--accent-dark); text-decoration: underline; }

/* ------------------------------------------------------------------ */

/* Модальные окна: общее                                               */

/* ------------------------------------------------------------------ */

.modalHead {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 6px;
}

.modalHead h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 700;
  line-height: 1.2;
}

.modalFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-left: auto;
}

/* --- Поля форм --- */

.formRow { display: grid; gap: 14px; margin-bottom: 14px; }

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

.formRow3 { grid-template-columns: 1.2fr 1fr 1fr; }

.field { display: grid; gap: 6px; min-width: 0; align-content: start; }

.field > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.9);
  border: 1px solid rgba(64, 52, 39, 0.2);
  border-radius: 14px;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
  transition: border-color 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.field textarea { min-height: 88px; resize: vertical; line-height: 1.5; }

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  background: #fffefa;
  box-shadow: 0 0 0 4px rgba(179, 19, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.82);
}

.field input::placeholder,
.field textarea::placeholder { color: #a3a3a3; }

.fieldHint { color: var(--muted); font-size: 12px; font-style: normal; }

.fieldError { color: var(--accent); font-size: 12px; font-style: normal; font-weight: 500; }

.burialsTextarea { min-height: 120px; }

.suggestAnchor { position: relative; }

.localitySuggest {
  position: absolute;
  z-index: 30;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  background: rgba(255, 253, 248, 0.98);
  border: 1px solid rgba(64, 52, 39, 0.16);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
}

.localitySuggest button {
  display: block;
  width: 100%;
  padding: 10px 13px;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

.localitySuggest button:last-child { border-bottom: 0; }

.localitySuggest button:hover { background: var(--surface-soft); }

.localitySuggest strong { display: block; font-size: 13.5px; font-weight: 600; }

.localitySuggest small { display: block; color: var(--muted); font-size: 12px; }

.uploadArea {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 22px 16px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.72), rgba(248, 244, 236, 0.9));
  border: 1.5px dashed rgba(64, 52, 39, 0.28);
  border-radius: 16px;
  text-align: center;
  cursor: pointer;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.uploadArea:hover { border-color: var(--accent); background: linear-gradient(180deg, #fff8f4, var(--accent-soft)); transform: translateY(-1px); }

.uploadArea .uiIcon { color: var(--accent); }

.uploadArea strong { color: var(--text); font-size: 13px; font-weight: 600; line-height: 1.4; }

.uploadArea small { font-size: 12px; }

.uploadInline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  cursor: pointer;
}

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

.uploadInline .uiIcon { color: var(--accent); }

.fileButton { cursor: pointer; }

.subEditorActions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
  flex-wrap: wrap;
}

.photoPreviewGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 8px;
}

.photoPreview {
  position: relative;
  overflow: hidden;
  aspect-ratio: 1;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.photoPreview img { width: 100%; height: 100%; object-fit: cover; }

.photoPreview button {
  position: absolute;
  top: 4px;
  right: 4px;
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: #fff;
  background: rgba(23, 23, 23, 0.65);
  border: 0;
  border-radius: 7px;
  font-size: 15px;
  line-height: 1;
}

.photoPreview button:hover { background: var(--accent); }

/* --- Модалка добавления --- */

.addOverlay {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: flex;
  padding: var(--modal-gap);
  background: rgba(23, 20, 17, 0.58);
  pointer-events: none;
}

.addModal {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: min(1280px, calc(100vw - var(--modal-gap) * 2));
  height: var(--modal-h);
  max-height: var(--modal-h);
  padding: 8px;
  background: rgba(64, 52, 39, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.58);
  border-radius: 28px;
  box-shadow: var(--shadow-modal);
  pointer-events: auto;
  position: relative;
  z-index: 110;
}

.addModal::before {
  content: "";
  position: absolute;
  inset: 8px;
  z-index: 0;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.98), rgba(248, 244, 236, 0.98));
  border: 1px solid rgba(64, 52, 39, 0.13);
  border-radius: 20px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

.addModal > * {
  position: relative;
  z-index: 1;
}

.addModalBody {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 18px 8px;
}

.addModal .modalHead {
  margin-bottom: 0;
  padding: 18px 18px 0;
}

.addModal .modalFooter {
  padding: 16px 18px 12px;
  border-top-color: rgba(64, 52, 39, 0.12);
}

.draftPointBadge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

.draftPointBadge .uiIcon { color: var(--accent); }

/* --- Модалка импорта --- */

.importOverlay {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: var(--modal-gap);
  background: rgba(23, 20, 17, 0.6);
}

.importModal {
  position: relative;
  display: grid;
  margin: auto;
  gap: 14px;
  width: min(560px, calc(100vw - var(--modal-gap) * 2));
  max-height: var(--modal-h);
  overflow-y: auto;
  padding: 30px 32px;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(248, 244, 236, 0.98));
  border: 1px solid rgba(64, 52, 39, 0.15);
  border-radius: 26px;
  box-shadow: var(--shadow-modal);
}

.importHint { margin: 0; color: var(--muted); font-size: 13.5px; line-height: 1.55; }

.importHint code {
  padding: 1px 5px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
}

.importInput {
  width: 100%;
  min-height: 44px;
  padding: 10px 13px;
  background: rgba(255, 253, 248, 0.92);
  border: 1px solid rgba(64, 52, 39, 0.22);
  border-radius: 16px;
  font-size: 14px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.72);
}

.importInput:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(179, 19, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.78);
}

/* ------------------------------------------------------------------ */

/* Карточка мемориала                                                  */

/* ------------------------------------------------------------------ */

.cardOverlay {
  position: fixed;
  z-index: 110;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: var(--modal-gap);
  background: rgba(23, 20, 17, 0.62);
}

.memorialCard {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: auto;
  width: var(--modal-w);
  height: var(--modal-h);
  max-height: var(--modal-h);
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(248, 244, 236, 0.98));
  border: 1px solid rgba(64, 52, 39, 0.14);
  border-radius: 28px;
  box-shadow: var(--shadow-modal);
  contain: layout paint;
}

.memorialCard::before {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 21px;
  box-shadow: inset 0 0 0 1px rgba(64, 52, 39, 0.035);
}

.memorialCard.isEditing {
  width: min(1160px, calc(100vw - 56px));
}

.cardTop {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(64, 52, 39, 0.12);
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(248, 244, 236, 0.78));
}

.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.crumbs button {
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font-size: 13px;
}

.crumbs button:hover { color: var(--accent); text-decoration: underline; }

.crumbs b { color: var(--text); font-weight: 600; }

.cardGrid {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  grid-template-columns: 46fr 54fr;
}

.cardLeft {
  min-width: 0;
  overflow-y: auto;
  padding: 24px 26px;
  border-right: 1px solid rgba(64, 52, 39, 0.12);
}

.cardRight {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  padding: 24px 26px;
  background: linear-gradient(180deg, rgba(248, 244, 236, 0.78), rgba(241, 237, 228, 0.82));
}

.fieldLabel {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.cardTitle {
  margin: 0 0 18px;
  font-family: var(--font-display);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.005em;
}

.cardThumbs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

/* Hero-фото: размытый фон (cover) + чёткое фото целиком (contain).
   Так вертикальные и горизонтальные снимки выглядят одинаково опрятно. */

.cardHeroPhoto {
  position: relative;
  display: block;
  width: 100%;
  height: clamp(260px, 42vh, 540px);
  max-height: 560px;
  margin: 0 0 10px;
  padding: 0;
  overflow: hidden;
  background: #221c17;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: none;
  cursor: zoom-in;
}

.cardHeroPhoto::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: var(--hero-src);
  background-size: cover;
  background-position: center;
  opacity: 0.36;
  transform: scale(1.04);
}

.cardHeroPhoto img {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 220ms ease;
}

.cardHeroPhoto:hover img { transform: scale(1.02); }

.cardThumb {
  width: 86px;
  height: 66px;
  padding: 0;
  overflow: hidden;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: none;
  cursor: zoom-in;
}

.cardThumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 200ms ease;
}

.cardThumb:hover img { transform: scale(1.06); }

.allPhotosBtn {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 20px;
  padding: 0 16px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(185, 28, 28, 0.4);
  border-radius: 10px;
  font-weight: 600;
  font-size: 13px;
  transition: background 150ms ease;
}

.allPhotosBtn:hover { background: var(--accent-soft); }

.noPhotos { margin-bottom: 20px; }

.infoGrid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.8fr);
  gap: 12px;
  margin-bottom: 16px;
}

.infoItem {
  display: flex;
  gap: 12px;
  margin-bottom: 16px;
}

.infoGrid .infoItem {
  min-width: 0;
  margin-bottom: 0;
}

.infoIcon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  color: var(--accent);
  background: linear-gradient(180deg, #fff5f2, var(--accent-soft));
  border-radius: 50%;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.infoItem .fieldLabel { margin-bottom: 2px; }

.infoValue { font-size: 14px; font-weight: 500; line-height: 1.45; }

.cardDescription {
  margin: 4px 0 16px;
  color: var(--text);
  font-size: 13.5px;
  line-height: 1.6;
}

.detailsSource {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 500;
}

.detailsSource .uiIcon { color: var(--accent); }

.detailsSource a {
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 1px solid rgba(185, 28, 28, 0.3);
}

.detailsSource a:hover { border-bottom-color: var(--accent); }

.cardToolbar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.deleteConfirm {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 6px 6px 6px 12px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 600;
}

.cardBottomRow {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
}

.reportError {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 0;
  color: var(--accent);
  background: transparent;
  border: 0;
  font-size: 12.5px;
  font-weight: 600;
}

.reportError:hover { color: var(--accent-dark); text-decoration: underline; }

/* --- Правая колонка: имена --- */

.namesPanel {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
}

.namesHead {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.namesTitle {
  margin: 0 0 4px;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 700;
}

.namesFound { color: var(--muted); font-size: 13px; }

.namesFound em { color: var(--accent); font-style: normal; font-weight: 700; }

.namesManualButton {
  flex: 0 0 auto;
  white-space: nowrap;
}

.namesSearch {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 14px;
  padding: 0 12px;
  background: rgba(255, 253, 248, 0.84);
  border: 1px solid rgba(64, 52, 39, 0.18);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.namesSearch .uiIcon { color: var(--muted); }

.namesSearch input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 10px 0;
  background: transparent;
  border: 0;
  font-size: 14px;
}

.namesSearch input:focus-visible { outline: none; }

.namesSearch:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(179, 19, 24, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.78); }

.namesList {
  flex: 1 1 auto;
  min-height: 0;
  margin: 0;
  padding: 0 6px 0 0;
  list-style: none;
  columns: 1;
  column-count: 1;
  overflow-y: auto;
  scrollbar-gutter: stable;
}

.namesListSingle {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: max-content;
  align-content: start;
  align-items: start;
  gap: 0;
}

.namesList li {
  display: flex;
  gap: 8px;
  align-items: baseline;
  padding: 7px 2px;
  border-bottom: 1px solid rgba(64, 52, 39, 0.11);
  font-size: 13.5px;
  line-height: 1.35;
  break-inside: avoid;
}

.namesList li:hover {
  background: rgba(255, 253, 248, 0.55);
}

.nameNumber {
  min-width: 30px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.nameValue {
  flex: 1 1 auto;
  min-width: 0;
  font-weight: 500;
}

.nameValue small { color: var(--muted); font-size: 11.5px; font-weight: 400; }

.pamyatSearchLink {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  margin-left: auto;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(185, 28, 28, 0.24);
  border-radius: 999px;
  text-decoration: none;
  opacity: 0;
  transform: translateY(1px);
  transition: opacity 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease;
}

.namesList li:hover .pamyatSearchLink,
.namesList li:focus-within .pamyatSearchLink {
  opacity: 1;
  transform: translateY(0);
}

.pamyatSearchLink:hover {
  background: var(--accent-soft);
  border-color: rgba(185, 28, 28, 0.45);
}

.pamyatSearchLink:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .pamyatSearchLink { opacity: 1; }
}

.namesEmpty {
  flex: 1 1 auto;
  display: grid;
  place-content: center;
  gap: 4px;
  padding: 36px 16px;
  text-align: center;
}

.namesEmpty strong { font-family: var(--font-display); font-size: 17px; }

.namesEmpty span { color: var(--muted); font-size: 13px; }

.namesPageSummary {
  flex: 0 0 auto;
  margin-top: 12px;
  color: var(--muted);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

/* --- Пагинация --- */

.pagination {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
  padding-top: 4px;
}

.pagination button {
  min-height: 34px;
  padding: 0 12px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
}

.pagination button:hover:not(:disabled) { border-color: var(--muted); }

.pagination button:disabled { opacity: 0.45; cursor: default; }

.pagination .pageNum { min-width: 34px; padding: 0; }

.pagination .pageNum.isActive {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
  font-weight: 600;
}

.pageGap { color: var(--muted); padding: 0 2px; }

/* --- Редактирование в карточке --- */

.cardEdit {
  position: relative;
  z-index: 1;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow-y: auto;
  padding: 20px 26px 24px;
  overscroll-behavior: contain;
}

.editGridWrap { max-width: 860px; margin: 0 auto; display: grid; gap: 14px; }

.editMainFields,
.editNamesPanel {
  min-width: 0;
}

.editMainFields {
  display: grid;
  gap: 14px;
  align-content: start;
}

.editNamesPanel {
  display: grid;
  align-content: start;
}

.cardEdit .editError,
.cardEdit .modalActions {
  grid-column: 1 / -1;
}

.cardEdit .modalActions {
  position: sticky;
  bottom: -1px;
  z-index: 6;
  margin: 0 -4px -24px;
  padding: 12px 4px 14px;
  background:
    linear-gradient(180deg, rgba(250, 247, 241, 0), rgba(250, 247, 241, 0.96) 28%, rgba(250, 247, 241, 0.99));
  border-top: 1px solid rgba(72, 60, 48, 0.14);
  box-shadow: 0 -14px 26px rgba(38, 30, 22, 0.08);
}

.subEditor {
  display: grid;
  gap: 10px;
  padding: 14px 16px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.subEditorHead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font-size: 13.5px;
  font-weight: 600;
}

.subEditorHead > span { display: inline-flex; align-items: center; gap: 7px; }

.subEditorHead .uiIcon { color: var(--accent); }

.burialEditRow {
  display: grid;
  grid-template-columns: 2fr 1fr 0.7fr 0.7fr auto;
  gap: 8px;
  align-items: center;
}

.burialEditRow input {
  width: 100%;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 13px;
}

.burialEditRow input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.burialEditPager {
  display: grid;
  gap: 6px;
  padding-top: 4px;
}

.burialEditPager > span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.burialEditPager .pagination {
  margin-top: 0;
  padding-top: 0;
}

.burialEditPager .pagination button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
}

.burialRemove {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(185, 28, 28, 0.3);
  border-radius: 8px;
  font-size: 17px;
  line-height: 1;
}

.burialRemove:hover { background: var(--accent-soft); border-color: var(--accent); }

.editError {
  padding: 10px 13px;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid rgba(185, 28, 28, 0.25);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
}

/* --- Ручной ввод имён --- */

.manualLayer {
  position: fixed;
  z-index: 135;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: var(--modal-gap);
  background: rgba(12, 10, 9, 0.62);
}

.manualPanel {
  display: grid;
  margin: auto;
  grid-template-columns: minmax(320px, 0.8fr) minmax(560px, 1.2fr);
  width: var(--modal-w);
  height: var(--modal-h);
  max-height: var(--modal-h);
  min-height: 0;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(255, 253, 248, 0.99), rgba(248, 244, 236, 0.98));
  border: 1px solid rgba(64, 52, 39, 0.14);
  border-radius: 28px;
  box-shadow: var(--shadow-modal);
  contain: layout paint;
}

.manualPhotoPane {
  position: relative;
  min-width: 0;
  display: flex;
  align-items: stretch;
  justify-content: center;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 22%),
    #171512;
}

.manualPhotoPane > img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.manualPhotoEmpty {
  display: grid;
  place-content: center;
  gap: 10px;
  width: 100%;
  min-height: 320px;
  color: rgba(255, 255, 255, 0.75);
  text-align: center;
}

.manualPhotoEmpty .uiIcon { margin: 0 auto; color: rgba(255, 255, 255, 0.9); }

.manualThumbs {
  position: absolute;
  left: 14px;
  right: 14px;
  bottom: 14px;
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 2px;
}

.manualThumbs button {
  width: 58px;
  height: 42px;
  flex: 0 0 auto;
  padding: 0;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.12);
  border: 2px solid transparent;
  border-radius: 12px;
  opacity: 0.72;
}

.manualThumbs button:hover,
.manualThumbs button.isActive {
  opacity: 1;
  border-color: var(--accent);
}

.manualThumbs img { width: 100%; height: 100%; object-fit: cover; }

.manualFormPane {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 20px 22px 16px;
}

.manualHead { flex: 0 0 auto; margin-bottom: 10px; }

.manualEyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.manualBulkBox {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: minmax(132px, 0.46fr) minmax(210px, 1fr);
  gap: 8px 10px;
  align-items: start;
  margin-bottom: 10px;
  padding: 10px 11px;
  background: rgba(255, 253, 248, 0.78);
  border: 1px solid rgba(64, 52, 39, 0.12);
  border-radius: 14px;
}

.manualBulkTitle {
  display: grid;
  gap: 2px;
  align-content: start;
}

.manualBulkTitle strong {
  font-size: 12.4px;
  line-height: 1.15;
}

.manualBulkTitle span {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
}

.manualBulkActions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
  grid-column: 1;
}

.manualBulkBox textarea {
  grid-column: 2;
  grid-row: 1 / span 2;
  width: 100%;
  min-height: 64px;
  max-height: 96px;
  resize: vertical;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  font: inherit;
  font-size: 11.8px;
  line-height: 1.35;
}

.manualBulkBox textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(179, 19, 24, 0.1);
}

.manualRows {
  flex: 1 1 0;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow-y: scroll;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 0 8px 10px 0;
  scrollbar-gutter: stable;
}

.manualPager {
  flex: 0 0 auto;
  display: grid;
  gap: 6px;
  padding: 8px 0 0;
}

.manualPager > span {
  color: var(--muted);
  font-size: 12px;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.manualPager .pagination {
  margin-top: 0;
  padding-top: 0;
}

.manualPager .pagination button {
  min-height: 28px;
  padding: 0 9px;
  font-size: 11.5px;
}

/* Кнопка «Добавить строку» — сразу под введёнными строками, а не в футере */

.manualAddRow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  align-self: start;
  margin-top: 2px;
  padding: 8px 14px;
  color: var(--accent);
  background: rgba(179, 19, 24, 0.05);
  border: 1px dashed rgba(179, 19, 24, 0.4);
  border-radius: 12px;
  font-size: 12.5px;
  font-weight: 600;
  transition: background 150ms ease, border-color 150ms ease;
}

.manualAddRow:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
}

.manualAddRow .uiIcon { color: var(--accent); }

.manualRowsEnd {
  width: 1px;
  height: 1px;
}

.manualRowsHeader,
.manualRow {
  --manual-row-columns: 34px minmax(260px, 2fr) minmax(126px, 0.86fr) 74px 74px 32px;
  display: grid;
  grid-template-columns: var(--manual-row-columns);
  gap: 7px;
  align-items: center;
}

.manualRowsHeader {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  padding: 0 8px 5px 8px;
  color: var(--muted);
  background: linear-gradient(180deg, rgba(250, 247, 241, 0.98), rgba(250, 247, 241, 0.92));
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1;
}

.manualRow {
  display: grid;
  padding: 7px 8px;
  background: rgba(255, 253, 248, 0.72);
  border: 1px solid rgba(64, 52, 39, 0.1);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.68);
}

.manualRowIndex {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  color: var(--muted);
  background: rgba(64, 52, 39, 0.05);
  border-radius: 8px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
}

.manualRowRemove {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid rgba(185, 28, 28, 0.28);
  border-radius: 9px;
  font-size: 17px;
  line-height: 1;
}

.manualRowRemovePlaceholder {
  visibility: hidden;
}

.manualNameField { grid-column: auto; }

.manualFormPane .field {
  gap: 0;
}

.manualFormPane .field > span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.manualFormPane .field input {
  min-height: 32px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 12px;
}

.manualFooter {
  flex: 0 0 auto;
  margin-top: 10px;
  padding-top: 12px;
  background: linear-gradient(180deg, rgba(250, 247, 241, 0), rgba(250, 247, 241, 0.98) 24%);
}

/* ------------------------------------------------------------------ */

/* Лайтбокс                                                            */

/* ------------------------------------------------------------------ */

.detailsLightbox {
  position: fixed;
  z-index: 140;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 40px 120px;
  background: rgba(12, 10, 9, 0.88);
}

.detailsLightbox > img {
  max-width: min(1120px, 92vw);
  max-height: calc(100vh - 190px);
  object-fit: contain;
  border-radius: 18px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55), 0 0 0 8px rgba(255, 255, 255, 0.06);
}

.lightboxCounter {
  position: absolute;
  top: 18px;
  left: 24px;
  padding: 6px 13px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.lightboxClose {
  position: absolute;
  top: 14px;
  right: 20px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 12px;
}

.lightboxClose:hover { background: rgba(255, 255, 255, 0.24); }

.lightboxNav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 50px;
  height: 50px;
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  font-size: 25px;
  line-height: 1;
}

.lightboxNav:hover { background: rgba(255, 255, 255, 0.22); }

.lightboxPrev { left: 22px; }

.lightboxNext { right: 22px; }

.lightboxBottom {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  max-width: 92vw;
}

.lightboxThumbs {
  display: flex;
  gap: 7px;
  max-width: 92vw;
  overflow-x: auto;
  padding: 2px;
}

.lightboxThumbs button {
  width: 58px;
  height: 42px;
  flex: 0 0 auto;
  overflow: hidden;
  padding: 0;
  background: rgba(255, 255, 255, 0.14);
  border: 2px solid transparent;
  border-radius: 8px;
  opacity: 0.65;
  transition: opacity 130ms ease, border-color 130ms ease;
}

.lightboxThumbs button:hover { opacity: 1; }

.lightboxThumbs button.isActive { border-color: var(--accent); opacity: 1; }

.lightboxThumbs img { width: 100%; height: 100%; object-fit: cover; }

.ocrButton {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 18px;
  color: #fff;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 10px;
  font-weight: 600;
  font-size: 13.5px;
}

.ocrButton:hover { background: var(--accent-dark); }

.ocrProgress {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 16px;
  color: #fff;
  background: rgba(0, 0, 0, 0.55);
  border-radius: 10px;
  font-size: 13.5px;
  font-weight: 500;
}

.lightboxError {
  position: absolute;
  bottom: 130px;
  left: 50%;
  transform: translateX(-50%);
  max-width: min(560px, 90vw);
  padding: 10px 16px;
  color: #fff;
  background: rgba(185, 28, 28, 0.94);
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  text-align: center;
}

/* ------------------------------------------------------------------ */

/* Экран проверки распознанных имён                                    */

/* ------------------------------------------------------------------ */

.ocrLayer {
  position: fixed;
  z-index: 150;
  inset: 0;
  display: flex;
  overflow-y: auto;
  padding: var(--modal-gap);
  background: rgba(12, 10, 9, 0.6);
}

.ocrPanel {
  display: flex;
  flex-direction: column;
  margin: auto;
  width: min(720px, 100%);
  max-height: calc(100vh - 56px);
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 16px;
  box-shadow: var(--shadow-modal);
}

.ocrPanelSplit {
  flex-direction: row;
  width: var(--modal-w);
  height: var(--modal-h);
  max-height: var(--modal-h);
  padding: 0;
  overflow: hidden;
}

.ocrPhotoPane {
  position: relative;
  flex: 1 1 54%;
  min-width: 0;
  display: flex;
  background: #171512;
  border-right: 1px solid var(--line);
}

.ocrPhotoScroll { flex: 1; overflow: auto; display: block; }

.ocrPhotoScroll img { display: block; min-width: 100%; height: auto; }

.ocrZoom {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px;
  background: rgba(23, 21, 18, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
}

.ocrZoom button {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 7px;
  font-size: 17px;
  line-height: 1;
}

.ocrZoom button:hover { background: rgba(255, 255, 255, 0.16); }

.ocrZoom span {
  min-width: 46px;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ocrListPane {
  flex: 1 1 46%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  padding: 20px 22px;
}

.ocrHint { margin: 4px 0 14px; color: var(--muted); font-size: 13px; line-height: 1.5; }

.ocrRows {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 8px;
  overflow-y: auto;
  padding-right: 4px;
}

.ocrRow {
  display: grid;
  grid-template-columns: 26px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
}

.ocrRow.isOff { opacity: 0.55; }

.ocrCheck input {
  width: 17px;
  height: 17px;
  accent-color: var(--accent);
  cursor: pointer;
}

.ocrFields {
  display: grid;
  grid-template-columns: 2fr 1fr 0.7fr 0.7fr;
  gap: 8px;
  min-width: 0;
}

.ocrFields input {
  width: 100%;
  padding: 7px 9px;
  background: var(--surface);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  font-size: 12.5px;
}

.ocrFields input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.ocrBadge {
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 10.5px;
  font-weight: 600;
  white-space: nowrap;
}

.ocrBadge.isOk { color: #256029; background: #e9f3e5; border: 1px solid #bfd9b6; }

.ocrBadge.isLow { color: #8a5a00; background: #fbf0d8; border: 1px solid #e4cf9a; }

.ocrBadge.isDup { color: var(--muted); background: var(--surface-soft); border: 1px solid var(--line); }

.ocrBadge.isBad { color: var(--accent); background: var(--accent-soft); border: 1px solid rgba(185, 28, 28, 0.3); }

/* ------------------------------------------------------------------ */

/* Балун карты, тост                                                   */

/* ------------------------------------------------------------------ */

.custom-balloon {
  max-width: 380px;
  overflow: hidden;
  font-family: var(--font-display);
  line-height: 1.5;
  color: var(--text);
  background: #fffdf8;
  border-radius: 18px;
  box-shadow: 0 18px 46px rgba(38, 29, 20, 0.16);
}

.custom-balloon__gallery {
  display: flex;
  gap: 6px;
  max-width: 380px;
  overflow-x: auto;
  padding: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 28%),
    #171512;
}

.custom-balloon__gallery img {
  flex: 0 0 210px;
  width: 210px;
  height: 120px;
  object-fit: cover;
  border-radius: 12px;
}

.custom-balloon__body { padding: 13px 15px 14px; }

.custom-balloon__title { font-weight: 700; font-size: 14.5px; margin-bottom: 4px; letter-spacing: 0.005em; }

.custom-balloon__meta { color: var(--muted); font-size: 12.5px; }

.custom-balloon__quote { margin-top: 8px; color: var(--text); font-size: 12.5px; }

.custom-balloon__source {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
}

.custom-balloon__source a { color: var(--accent); font-weight: 600; text-decoration: none; }

.toast {
  position: fixed;
  z-index: 160;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  max-width: min(560px, 92vw);
  padding: 12px 18px;
  color: var(--text);
  background: rgba(255, 253, 248, 0.96);
  border: 1px solid rgba(64, 52, 39, 0.18);
  border-radius: 999px;
  box-shadow: var(--shadow-modal);
  font-size: 13.5px;
  font-weight: 500;
  text-align: center;
}

/* ------------------------------------------------------------------ */

/* Компактная десктопная плотность                                     */

/* ------------------------------------------------------------------ */

@media (min-width: 761px) {
  body { font-size: 12.8px; }

  .btnPrimary,
  .btnGhost {
    min-height: 35px;
    padding: 0 14px;
    border-radius: 9px;
    font-size: 12.4px;
  }

  .btnSmall {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .dangerButton {
    min-height: 30px;
    padding: 0 10px;
    font-size: 12px;
  }

  .ghostIconButton {
    width: 30px;
    height: 30px;
    border-radius: 9px;
  }

  .siteHeader {
    gap: 20px;
    min-height: 58px;
    margin-top: 10px;
    margin-bottom: 9px;
    padding: 0 18px;
    border-radius: 20px;
  }

  .brand { gap: 10px; }
  .brandText strong { font-size: 15.8px; }
  .brandText small { font-size: 10.5px; }
  .siteNav button { padding: 6px 10px; font-size: 12.4px; }
  .headerActions { gap: 7px; }
  .headerStats {
    gap: 8px;
    padding: 4px 8px;
    font-size: 10.8px;
    border-radius: 999px;
  }
  .headerStats strong { font-size: 12.8px; }
  .headerActionButton { min-height: 34px; }
  .btnLogin {
    width: 34px;
    min-width: 34px;
    min-height: 34px;
  }

  .statsBar {
    gap: 15px;
    padding: 8px 15px;
    margin-bottom: 7px;
  }

  .statsItems { gap: 16px; }
  .statItem { gap: 7px; }
  .statItem strong { font-size: 16.5px; }
  .statItem span { font-size: 10.8px; }

  .searchSection { margin-bottom: 7px; }
  .searchBar {
    gap: 8px;
    padding: 5px 6px 5px 12px;
  }

  .searchBar input {
    padding: 7px 0;
    font-size: 12.8px;
  }

  .btnFilters { min-height: 34px; }
  .searchResultItem { padding: 8px 12px; }
  .searchResultText strong { font-size: 12.4px; }
  .searchResultText small { font-size: 10.8px; }

  .filtersPanel {
    margin-top: 7px;
    border-radius: 20px;
  }

  .filtersPanel::before {
    inset: 5px;
    border-radius: 15px;
  }

  .filterGroup {
    padding: 13px 15px;
  }

  .filterGroupHead {
    margin-bottom: 9px;
  }

  .filterGroupHead h3,
  .filterPeriod h3 {
    font-size: 12.8px;
  }

  .filterGroupHead span,
  .filterCheck em,
  .filterRadio em {
    font-size: 10.4px;
  }

  .filterSearch {
    margin-bottom: 8px;
    border-radius: 12px;
  }

  .filterSearch input,
  .filterPeriodFields input {
    height: 32px;
    font-size: 11.6px;
  }

  .filterList,
  .filterRadioList {
    gap: 5px;
  }

  .filterGroupRegions .filterList {
    max-height: 154px;
  }

  .filterCheck,
  .filterRadio {
    min-height: 29px;
    padding: 5px 7px;
    border-radius: 11px;
    font-size: 11.5px;
  }

  .filterPeriod {
    margin-top: 14px;
    padding-top: 11px;
  }

  .filterPeriodFields {
    gap: 8px;
    margin-top: 8px;
  }

  .filterPeriodFields label {
    gap: 6px;
    font-size: 10.8px;
  }

  .filtersFooter {
    padding: 10px 14px;
  }

  .selectedFilters > span,
  .filterChips em {
    font-size: 11px;
  }

  .filterChips button,
  .activeFilterStrip button {
    min-height: 27px;
    max-width: 210px;
    font-size: 11.2px;
  }

  .activeFilterStrip {
    margin-top: 7px;
    padding: 7px 10px;
  }

  .mapSection {
    flex: 0 0 auto;
    height: calc(100vh - 140px);
    min-height: min(640px, calc(100vh - 140px));
    margin-bottom: 12px;
    border-radius: 24px;
  }

  .searchSection,
  .siteHeader,
  .infoStrip { flex: 0 0 auto; }

  .mapSection::before {
    inset: 6px;
    border-radius: 18px;
  }

  .mapPanel {
    top: 10px;
    left: 10px;
    bottom: 10px;
    width: min(292px, calc(100% - 72px));
    border-radius: 18px;
  }

  .mapPanelHead { padding: 10px 12px 8px; }
  .mapPanelHead h3 { font-size: 14.8px; }
  .mapPanelHead small { font-size: 10.8px; }
  .panelItem { gap: 8px; padding: 7px 9px; }
  .panelThumb { width: 38px; height: 38px; border-radius: 8px; }
  .panelText strong { font-size: 11.8px; }
  .panelText small,
  .panelText em { font-size: 10.8px; }
  .panelArrow { font-size: 16px; }
  .mapPanelFooter { padding: 8px; font-size: 11.8px; }
  .mapCtrls { top: 10px; right: 10px; }
  .mapCtrls button { width: 32px; height: 32px; font-size: 16px; border-radius: 9px; }
  .mapHint { padding: 8px 11px; font-size: 11.8px; }

  .infoStrip {
    gap: 15px;
    padding: 10px 15px;
  }

  .infoLead,
  .infoMore { font-size: 11.8px; }
  .infoPoints { gap: 13px; }
  .infoPoints span { font-size: 11.3px; }

  .cardOverlay { padding: 12px; }
  .memorialCard { border-radius: 24px; }

  .memorialCard::before {
    inset: 6px;
    border-radius: 18px;
  }

  .cardTop {
    gap: 10px;
    padding: 8px 15px;
  }

  .crumbs,
  .crumbs button { font-size: 11.3px; }

  .cardLeft,
  .cardRight {
    padding: 15px 17px;
  }

  .cardTitle {
    margin-bottom: 10px;
    font-size: clamp(19px, 1.75vw, 24px);
  }

  .cardHeroPhoto {
    height: clamp(240px, 36vh, 460px);
    margin-bottom: 8px;
    border-width: 1px;
    border-radius: 10px;
  }

  .cardThumbs { gap: 6px; margin-bottom: 7px; }
  .cardThumb { width: 62px; height: 46px; border-radius: 8px; }
  .infoGrid { gap: 8px; margin-bottom: 10px; }
  .infoItem { gap: 8px; margin-bottom: 10px; }
  .infoIcon { width: 28px; height: 28px; }
  .fieldLabel { font-size: 10.8px; }
  .infoValue { font-size: 12.3px; }
  .cardDescription {
    margin-bottom: 10px;
    font-size: 12px;
    line-height: 1.46;
  }

  .detailsSource { margin-bottom: 10px; font-size: 11px; }
  .cardToolbar { gap: 7px; margin-bottom: 11px; }
  .cardBottomRow { padding-top: 9px; font-size: 11px; }
  .reportError { font-size: 11px; }

  .namesHead { gap: 10px; margin-bottom: 8px; }
  .namesTitle { font-size: 16.5px; }
  .namesFound { font-size: 11.3px; }
  .namesSearch { margin-bottom: 8px; padding: 0 9px; }
  .namesSearch input { padding: 7px 0; font-size: 12.2px; }
  .namesList li {
    gap: 6px;
    padding: 4px 2px;
    font-size: 11.8px;
    line-height: 1.24;
  }

  .nameNumber {
    min-width: 24px;
    font-size: 10.9px;
  }

  .nameValue small { font-size: 10.2px; }
  .namesPageSummary {
    margin-top: 8px;
    font-size: 11px;
  }

  .pamyatSearchLink {
    width: 22px;
    height: 22px;
    border-radius: 7px;
  }

  .pagination {
    gap: 4px;
    margin-top: 10px;
  }

  .pagination button {
    min-height: 28px;
    padding: 0 8px;
    font-size: 11.4px;
  }

  .pagination .pageNum { min-width: 28px; }
}

/* ------------------------------------------------------------------ */

/* Большие экраны (27"+): контейнер контента, чтобы не расползалось     */

/* ------------------------------------------------------------------ */

@media (min-width: 1200px) {
  body { font-size: 12.8px; }

  .mapSection {
    height: calc(100vh - 140px);
    min-height: min(720px, calc(100vh - 140px));
  }

  .mapPanel { width: min(328px, calc(100% - 80px)); }
  .mapPanelHead h3 { font-size: 15.4px; }
  .panelText strong { font-size: 12.2px; }

  .memorialCard { border-radius: 22px; }

  .cardTop { padding: 7px 14px; }

  .cardLeft,
  .cardRight {
    padding: 13px 15px;
  }

  .cardTitle {
    margin-bottom: 8px;
    font-size: clamp(18px, 1.25vw, 22px);
  }

  .cardGrid { grid-template-columns: 44fr 56fr; }
  .cardHeroPhoto { height: clamp(250px, 40vh, 500px); }
  .cardThumb { width: 52px; height: 38px; }
  .infoGrid { gap: 7px; margin-bottom: 8px; }
  .infoItem { margin-bottom: 8px; }
  .infoIcon { width: 26px; height: 26px; }
  .cardDescription { font-size: 11.4px; line-height: 1.38; }
  .namesTitle { font-size: 15.8px; }
  .namesSearch input { font-size: 11.8px; }
  .namesList li { padding: 3px 2px; font-size: 11.2px; line-height: 1.22; }

  .cardEdit {
    overflow-y: hidden;
    padding: 12px 15px 0;
  }

  .editGridWrap {
    width: 100%;
    max-width: none;
    flex: 1 1 auto;
    min-height: 0;
    grid-template-columns: minmax(390px, 0.9fr) minmax(500px, 1.1fr);
    gap: 10px 14px;
    align-content: start;
    overflow-y: auto;
    padding-right: 2px;
  }

  .editMainFields {
    gap: 9px;
  }

  .editNamesPanel {
    min-height: 0;
  }

  .editNamesPanel .subEditor {
    min-height: 100%;
    overflow-y: auto;
  }

  .cardEdit .formRow {
    gap: 9px;
    margin-bottom: 9px;
  }

  .cardEdit .field {
    gap: 4px;
  }

  .cardEdit .field > span {
    font-size: 10.8px;
  }

  .cardEdit .field input,
  .cardEdit .field select,
  .cardEdit .field textarea {
    min-height: 32px;
    padding: 6px 9px;
    border-radius: 10px;
    font-size: 11.8px;
  }

  .cardEdit .field textarea {
    min-height: 58px;
    line-height: 1.35;
  }

  .cardEdit .subEditor {
    gap: 7px;
    padding: 9px 11px;
    border-radius: 10px;
  }

  .cardEdit .subEditorHead {
    font-size: 11.8px;
  }

  .cardEdit .photoPreviewGrid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    margin-top: 4px;
  }

  .cardEdit .burialEditRow {
    grid-template-columns: minmax(0, 2fr) minmax(92px, 1fr) 58px 58px 26px;
    gap: 6px;
  }

  .cardEdit .burialEditRow input {
    padding: 6px 8px;
    border-radius: 7px;
    font-size: 11.6px;
  }

  .cardEdit .burialRemove {
    width: 26px;
    height: 26px;
    font-size: 15px;
  }

  .cardEdit .modalActions {
    gap: 8px;
    margin: 0 -3px 0;
    padding: 9px 3px 11px;
    box-shadow: 0 -10px 20px rgba(38, 30, 22, 0.07);
  }


}

/* ------------------------------------------------------------------ */

/* Адаптивность                                                        */

/* ------------------------------------------------------------------ */

@media (max-width: 1120px) {
  .siteNav { display: none; }
  .filtersGrid { grid-template-columns: 1fr 1fr; }
  .filterGroup:nth-child(2n) { border-right: 0; }
  .filterGroup:nth-child(-n + 2) { border-bottom: 1px solid rgba(64, 52, 39, 0.12); }
  .cardGrid { display: block; overflow-y: auto; }
  .cardLeft { overflow: visible; border-right: 0; border-bottom: 1px solid var(--line); }
  .cardRight {
    display: block;
    overflow: visible;
  }

  .namesPanel {
    min-height: auto;
    overflow: visible;
  }

  .namesList {
    overflow: visible;
    padding-right: 0;
  }

  .formRow3 { grid-template-columns: 1fr; }
  .manualPanel {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(210px, 38vh) minmax(0, 1fr);
  }

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

  .manualBulkActions,
  .manualBulkBox textarea {
    grid-column: auto;
    grid-row: auto;
  }

  .manualRowsHeader,
  .manualRow {
    grid-template-columns: 32px minmax(240px, 1.8fr) minmax(120px, 1fr) 72px 72px 32px;
  }
}

@media (max-width: 900px) {
  .ocrPanelSplit { flex-direction: column; width: min(560px, 96vw); }
  .ocrPhotoPane { flex: 0 0 42vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .ocrListPane { flex: 1 1 auto; min-height: 0; }
}

@media (max-width: 760px) {
  .page { padding: 0 0 28px; }
  .siteHeader { margin: 0 0 10px; padding: 12px 16px; gap: 12px; min-height: 0; flex-wrap: wrap; }
  .headerActions { width: 100%; margin-left: 0; flex-wrap: wrap; }
  .headerStats {
    order: -1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 6px;
    padding: 7px 8px;
    white-space: normal;
  }
  .headerStats span {
    min-width: 0;
    display: grid;
    gap: 1px;
  }
  .headerStats strong { font-size: 15px; line-height: 1; }
  .headerActionButton { flex: 1 1 auto; }
  .btnLogin {
    flex: 0 0 38px;
    width: 38px;
    min-width: 38px;
    min-height: 38px;
  }
  .statsBar { gap: 10px; padding: 10px 16px; border-radius: 0; border-left: 0; border-right: 0; }
  .statsItems { width: 100%; gap: 8px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .statItem { align-items: flex-start; gap: 6px; }
  .statItem strong { font-size: 19px; }
  .statItem span { font-size: 11.5px; line-height: 1.15; }
  .statsActions { width: 100%; }
  .statsActions button { flex: 1 1 auto; }
  .searchBar { flex-wrap: wrap; padding: 8px 12px; border-radius: 0; border-left: 0; border-right: 0; }
  .searchBar input { flex-basis: calc(100% - 34px); }
  .btnFilters { width: 100%; }
  .filtersPanel {
    margin: 8px 8px 0;
    border-radius: 18px;
  }
  .filtersPanel::before { display: none; }
  .filtersGrid { grid-template-columns: 1fr; }
  .filterGroup,
  .filterGroup:nth-child(2n),
  .filterGroup:nth-child(-n + 2) {
    padding: 14px;
    border-right: 0;
    border-bottom: 1px solid rgba(64, 52, 39, 0.12);
  }
  .filterGroup:last-child { border-bottom: 0; }
  .filterGroupRegions .filterList {
    max-height: 240px;
    min-height: 178px;
  }
  .filtersFooter {
    display: grid;
    gap: 12px;
    padding: 13px 14px;
  }
  .selectedFilters {
    display: grid;
    gap: 8px;
  }
  .filterActions {
    display: grid;
    grid-template-columns: 1fr;
  }
  .filterActions button { width: 100%; }
  .activeFilterStrip {
    margin: 8px 8px 0;
    border-radius: 16px;
  }
  .mapSection { height: 66vh; min-height: 390px; border-radius: 0; border-left: 0; border-right: 0; }
  .mapPanel { top: auto; bottom: 12px; left: 12px; right: 12px; width: auto; max-height: 44%; }
  .mapCtrls { top: 12px; right: 12px; }
  .formRow2 { grid-template-columns: 1fr; }
  .cardOverlay { padding: 8px; }
  .memorialCard { max-height: calc(100vh - 16px); }
  .cardLeft, .cardRight { padding: 18px 16px; }
  .cardHeroPhoto { height: clamp(110px, 22vh, 170px); }
  .infoGrid { grid-template-columns: 1fr; }
  .namesHead { display: grid; }
  .namesManualButton { width: 100%; }
  .manualLayer { padding: 8px; }
  .manualPanel { display: block; height: calc(100vh - 16px); overflow-y: auto; border-radius: 16px; }
  .manualPhotoPane { height: 140px; min-height: 140px; }
  .manualFormPane { display: block; padding: 18px 16px; }
  .manualRows { overflow: visible; padding: 2px 0 18px; }
  .manualRowsHeader { display: none; }
  .manualRow {
    grid-template-columns: 28px minmax(0, 1fr) 30px;
    gap: 7px;
  }
  .manualRowIndex { grid-column: 1; grid-row: 1; }
  .manualNameField { grid-column: 2 / 3; grid-row: 1; }
  .manualRow .field:not(.manualNameField) { grid-column: 2 / 3; }
  .manualRowRemove { grid-column: 3; grid-row: 1; }
  .manualFooter { align-items: stretch; }
  .manualFooter > .btnGhost,
  .manualFooter .modalActions,
  .manualFooter .modalActions button { width: 100%; }
  .manualFooter .modalActions { display: grid; margin-left: 0; }
  .detailsLightbox { padding: 48px 10px 116px; }
  .lightboxPrev { left: 8px; }
  .lightboxNext { right: 8px; }
  .infoStrip { flex-direction: column; align-items: flex-start; gap: 10px; }
  .photoPreviewGrid { grid-template-columns: repeat(3, 1fr); }
  .burialEditRow { grid-template-columns: 1fr 1fr auto; }
  .burialEditRow input:first-child { grid-column: 1 / -1; }
}
