/* style.css — сервис «ГВР на карте». Чистый компактный UI, без внешних библиотек.
   Панель слева отдельной колонкой: карта и её копирайты/лого Яндекса ничем не
   перекрываются (SPEC §8). */

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  margin: 0;
}

body {
  display: flex;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  color: #1f2937;
  background: #f8fafc;
}

.hidden {
  display: none !important;
}

/* ------------------------------- Панель слева --------------------------- */

#sidebar {
  width: 380px;
  min-width: 320px;
  height: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 14px 16px;
  background: #ffffff;
  border-right: 1px solid #e5e7eb;
}

#mapDetails > summary h1 {
  display: inline;
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

#app-header .subtitle {
  margin: 2px 0 0;
  font-size: 12px;
  color: #6b7280;
}

#sidebar > section {
  flex-shrink: 0;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

.account-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.account-bar > div:first-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-wrap: anywhere;
}

.account-role,
.user-status {
  color: #64748b;
  font-size: 11px;
}

.account-actions {
  margin-top: 0;
}

.admin-dialog {
  width: min(620px, calc(100vw - 28px));
  max-height: min(88vh, 800px);
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #1f2937;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.25);
}

.admin-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.imports-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(88vh, 800px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #1f2937;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.25);
}

.imports-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.imports-section h2,
.imports-dialog h2 {
  margin: 0;
  font-size: 15px;
}

.imports-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}

.imports-journal,
.imports-result {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

.import-run,
.import-item {
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.import-run-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.import-run time,
.import-muted {
  color: #64748b;
  font-size: 11px;
}

.import-run-summary,
.import-item p {
  margin: 5px 0 0;
}

.imports-form {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.imports-form label {
  font-size: 12px;
  color: #475569;
}

.import-pagination {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.import-pagination span {
  margin-right: auto;
  color: #64748b;
  font-size: 12px;
}

.imports-dialog :focus-visible,
.imports-section :focus-visible {
  outline: 2px solid #0b6bcb;
  outline-offset: 2px;
}

.records-section h2,
.records-dialog h2 {
  margin: 0;
  font-size: 15px;
}

.records-search,
.records-detail-form {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.records-search label,
.records-detail-form label {
  color: #475569;
  font-size: 12px;
}

.records-search input,
.records-search select,
.records-detail-form input,
.records-detail-form textarea,
.records-detail-form select {
  width: 100%;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  color: #1f2937;
  background: #fff;
  font: inherit;
}

.records-detail-form textarea {
  min-height: 70px;
  resize: vertical;
}

.records-list,
.records-detail {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.records-dialog {
  width: min(760px, calc(100vw - 28px));
  max-height: min(88vh, 900px);
  overflow: auto;
  padding: 18px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  color: #1f2937;
  box-shadow: 0 16px 48px rgba(15, 23, 42, 0.25);
}

.records-dialog::backdrop {
  background: rgba(15, 23, 42, 0.45);
}

.records-heading,
.record-version-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.record-version,
.record-event,
.record-summary,
.import-resolve-candidate {
  padding: 10px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow-wrap: anywhere;
}

.record-version.is-current {
  border-color: #60a5fa;
  background: #eff6ff;
}

.record-fields {
  display: grid;
  grid-template-columns: minmax(115px, 0.8fr) minmax(0, 2fr);
  gap: 4px 10px;
  margin: 8px 0;
}

.record-fields dt {
  color: #64748b;
}

.record-fields dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.record-events {
  display: grid;
  gap: 7px;
}

.record-event time,
.record-muted {
  color: #64748b;
  font-size: 11px;
}

.records-dialog :focus-visible,
.records-section :focus-visible {
  outline: 2px solid #0b6bcb;
  outline-offset: 2px;
}

.import-resolve-candidate label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  cursor: pointer;
}

.admin-head,
.admin-user-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.admin-head h2,
.admin-create h3 {
  margin: 0;
  font-size: 15px;
}

.admin-users {
  display: grid;
  gap: 8px;
  max-height: 38vh;
  overflow: auto;
}

.admin-user {
  padding: 9px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.admin-user-controls {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 7px;
}

.admin-user-controls select {
  width: auto;
  min-width: 140px;
  flex: 1;
}

.user-status.disabled {
  color: #b91c1c;
}

.admin-create {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e5e7eb;
}

.admin-create label,
.login-card label {
  display: grid;
  gap: 4px;
  font-size: 12px;
  color: #475569;
}

/* Экран входа */
.login-page {
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.login-card {
  width: min(390px, 100%);
  padding: 24px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
}

.login-card h1 {
  margin: 0;
  font-size: 21px;
}

.login-card .subtitle {
  margin: 4px 0 20px;
  color: #64748b;
}

.login-card form {
  display: grid;
  gap: 8px;
}

.login-card .btn {
  margin-top: 8px;
}

.login-card .error {
  margin: 3px 0 0;
}

button:focus-visible,
select:focus-visible {
  outline: 2px solid #0b6bcb;
  outline-offset: 2px;
}

#sidebar h2 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: #374151;
}

.note {
  margin: 6px 0 0;
  font-size: 11.5px;
  color: #6b7280;
}

.warn-note {
  color: #92400e;
}

.empty {
  margin: 4px 0;
  font-size: 12px;
  color: #9ca3af;
}

/* ---------------------------------- Слои -------------------------------- */

.layer-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}

.chk {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  cursor: pointer;
}

.chk.disabled {
  color: #9ca3af;
  cursor: not-allowed;
}

/* Легенда цветов категорий (SPEC-2 П2). */

.legend {
  display: flex;
  flex-direction: column;
  gap: 3px;
  margin-top: 8px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  color: #374151;
}

.swatch {
  flex: none;
  width: 14px;
  height: 10px;
  border-radius: 3px;
  border: 1.5px solid transparent;
}

/* Категории 2.5 (SPEC-3 П2/П3): договор — зелёный, решение — фиолетовый,
   аквакультура — синий; ГТС — оранжевый; проблемные — красный контур. */

.swatch-contract {
  background: rgba(16, 185, 129, 0.28);
  border-color: #047857;
}

.swatch-decision {
  background: rgba(139, 92, 246, 0.28);
  border-color: #6d28d9;
}

.swatch-aqua {
  background: rgba(14, 165, 233, 0.32);
  border-color: #0369a1;
}

.swatch-unknown {
  background: rgba(148, 163, 184, 0.32);
  border-color: #64748b;
}

.swatch-gts {
  background: rgba(245, 158, 11, 0.5);
  border-color: #b45309;
}

.swatch-inactive {
  background: #94a3b8;
  border-color: #64748b;
}

/* Проблемные координаты — прозрачная заливка, жирный красный пунктир. */
.swatch-problem {
  background: transparent;
  border: 2px dashed #dc2626;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

#water-user-search {
  position: relative;
}

.results-actions,
.results-pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin: 8px 0;
}

.results-pagination span {
  margin-right: auto;
  color: #64748b;
  font-size: 12px;
}

.results-table-wrap {
  max-width: 100%;
  max-height: min(360px, 45vh);
  overflow: auto;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.results-table-wrap table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.results-table-wrap th,
.results-table-wrap td {
  min-width: 100px;
  padding: 6px 8px;
  border-bottom: 1px solid #e2e8f0;
  text-align: left;
  vertical-align: top;
}

.results-table-wrap th {
  position: sticky;
  top: 0;
  background: #f8fafc;
}

.results-table-wrap td {
  max-width: 280px;
  overflow-wrap: anywhere;
}

.results-table-wrap .btn {
  min-height: 44px;
  white-space: nowrap;
}

.results-table-wrap:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

/* Аккордеон «Формы ГВР» (SPEC-3 П4). */

#formsAccordion {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 10px;
}

.forms-subhead {
  margin: 8px 0 4px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  color: #64748b;
}

.form-chk {
  display: grid;
  grid-template-columns: 16px 16px minmax(0, 1fr) auto;
  align-items: start;
  column-gap: 6px;
  margin: 3px 0;
}

.form-chk input {
  margin: 2px 0 0;
}

.form-chk .swatch {
  margin: 4px 0 0;
}

.form-chk-label {
  min-width: 0;
}

.cat-count {
  padding-top: 1px;
  white-space: nowrap;
  color: #94a3b8;
  font-size: 11px;
}

.form-note-item {
  margin: 3px 0;
  padding-left: 6px;
  border-left: 2px solid #e5e7eb;
  font-size: 11.5px;
  color: #6b7280;
}

.form-note-item.form-empty {
  border-left-color: #cbd5e1;
  color: #9ca3af;
}

.status-row {
  margin-top: 8px;
}

.geometry-mode-row {
  margin-top: 8px;
}

.status-row .chk {
  gap: 8px;
}

.status-row select {
  width: auto;
  flex: 1;
}

.geometry-mode-row select {
  width: auto;
  flex: 1;
  font-size: 12px;
}

/* ------------------------------ Формы и кнопки --------------------------- */

select,
input {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
  color: inherit;
  background: #fff;
}

select:focus,
input:focus {
  outline: 2px solid #bfdbfe;
  border-color: #0b6bcb;
}

.layer-row select {
  width: auto;
  flex: 1;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 8px;
  margin-top: 8px;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 11.5px;
  color: #374151;
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.btn {
  padding: 6px 12px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  font-size: 13px;
  font-family: inherit;
  color: #1f2937;
  cursor: pointer;
}

.btn:hover {
  background: #eef2f7;
}

.btn:disabled {
  opacity: 0.6;
  cursor: wait;
}

.btn-primary {
  background: #0b6bcb;
  border-color: #0b6bcb;
  color: #fff;
}

.btn-primary:hover {
  background: #095aa9;
}

#pondPickBtn {
  margin-top: 8px;
  width: 100%;
}

#aqPickBtn,
#polyFinishBtn {
  flex: 1 1 auto;
}

/* Режимы указания участка (SPEC-2 П6): линия берега / полигон / линейка. */

.mode-tabs {
  display: flex;
  gap: 4px;
  margin-top: 8px;
}

.mode-tab {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 4px 6px;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  background: #f8fafc;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
}

.mode-tab input {
  width: auto;
  margin: 0;
  accent-color: #0b6bcb;
}

.mode-tab:hover {
  background: #eef2f7;
}

.mode-tab:has(input:checked) {
  background: #dbeafe;
  border-color: #0b6bcb;
  color: #0b6bcb;
  font-weight: 600;
}

#aqModeStatus {
  color: #0f766e;
  font-weight: 600;
}

/* Поиск по справочнику водных объектов 1.9 (SPEC-2 П1). */

.search-row {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.search-row input {
  flex: 1;
}

.search-row .btn {
  flex: none;
}

#woResults {
  margin-top: 6px;
}

/* --------------------------- Секции-проверки ----------------------------- */

details > summary {
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  user-select: none;
}

details[open] > summary {
  margin-bottom: 4px;
}

/* ------------------------------- Результаты ------------------------------ */

.verdict {
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
}

.verdict-free {
  background: #dcfce7;
  color: #166534;
}

.verdict-warning {
  background: #fef3c7;
  color: #92400e;
}

.verdict-restricted {
  background: #fee2e2;
  color: #991b1b;
}

.badges {
  margin-bottom: 8px;
}

.badge {
  display: inline-block;
  padding: 2px 9px;
  margin: 0 4px 4px 0;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}

.badge-red {
  background: #fee2e2;
  color: #991b1b;
}

.badge-green {
  background: #dcfce7;
  color: #166534;
}

.badge-amber {
  background: #fef3c7;
  color: #92400e;
}

.badge-blue {
  background: #dbeafe;
  color: #1e40af;
}

.badge-gray {
  background: #f1f5f9;
  color: #475569;
}

.warn {
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: 8px;
  background: #fff7ed;
  color: #9a3412;
  font-size: 12px;
}

.error {
  padding: 8px 10px;
  border-radius: 8px;
  background: #fee2e2;
  color: #991b1b;
  font-size: 12.5px;
}

.res-sec {
  margin-top: 6px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 6px 8px;
}

.res-sec > summary {
  font-size: 12.5px;
}

.tbl-wrap {
  margin-top: 6px;
  max-height: 240px;
  overflow: auto;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 11.5px;
}

th,
td {
  padding: 4px 6px;
  border-bottom: 1px solid #f1f5f9;
  text-align: left;
  vertical-align: top;
}

th {
  position: sticky;
  top: 0;
  background: #f8fafc;
  color: #374151;
  white-space: nowrap;
}

.row-active {
  font-weight: 700;
}

/* Строка результата с проблемными координатами (SPEC-3 П5). */
.row-problem td:first-child {
  border-left: 3px solid #dc2626;
}

.row-problem td:first-child::before {
  content: "⚠ ";
  color: #dc2626;
}

/* --------------------------------- Футер --------------------------------- */

#attribution {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
  font-size: 11px;
  color: #6b7280;
}

#attribution a {
  color: #0b6bcb;
}

/* Строка актуальности открытых данных ГВР (SPEC-3 П1). */
.coverage-line {
  margin-bottom: 6px;
  padding: 5px 8px;
  border-radius: 6px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
  font-size: 11px;
  line-height: 1.35;
}

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

#map-wrap {
  position: relative;
  flex: 1;
  height: 100%;
  min-width: 0;
  overflow: hidden;
}

#map {
  position: absolute;
  inset: 0;
}

body.picking #map,
body.picking #map * {
  cursor: crosshair !important;
}

#modeHint {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 20;
  padding: 6px 14px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 12.5px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
  pointer-events: none;
  white-space: nowrap;
}

/* Заглушка без ключа API. */

#map-stub {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: #eef2f7;
}

.stub-card {
  max-width: 480px;
  padding: 22px 26px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  font-size: 13px;
}

.stub-card h2 {
  margin: 0 0 8px;
  font-size: 16px;
}

.stub-card code {
  padding: 1px 5px;
  border-radius: 4px;
  background: #f1f5f9;
  font-size: 12px;
}

#stubError {
  padding: 6px 10px;
  border-radius: 6px;
  background: #fee2e2;
  color: #991b1b;
}

/* --------------------------- Маркеры и попапы ---------------------------- */
/* DOM-элементы внутри YMapMarker: точка привязки — координата, центрируем
   сдвигом transform. */

.dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.45);
  transform: translate(-50%, -50%);
  cursor: pointer;
}

.dot-wu {
  background: #0b6bcb;
}

/* Категории 2.5 (SPEC-3 П2/П3): договор — зелёный, решение — фиолетовый,
   аквакультура — синий. */

.dot-wu-contract {
  background: #047857;
}

.dot-wu-decision {
  background: #6d28d9;
}

.dot-wu-aqua {
  background: #0369a1;
}

.dot-wu-unknown {
  background: #64748b;
}

.dot-inactive {
  background: #94a3b8;
}

/* Проблемные координаты (SPEC-3 П5): красная обводка точечного маркера. */
.dot-problem {
  border-color: #dc2626;
  box-shadow: 0 0 0 1.5px #dc2626, 0 0 3px rgba(0, 0, 0, 0.45);
}

/* Выбросная координата поверх заливки участка. */
.dot-problem-point {
  width: 15px;
  height: 15px;
  background: #fff;
  border: 3px solid #dc2626;
  box-shadow: 0 0 0 2px #fff, 0 0 0 4px #dc2626;
  cursor: pointer;
  z-index: 5;
}

.dot-conflict {
  background: #dc2626;
}

.dot-nearby {
  background: #d97706;
}

/* ГТС — оранжевые точки (SPEC-3 П2). */

.dot-gts {
  background: #f59e0b;
}

.dot-center {
  background: #0f766e;
}

/* Подпись дистанции сегмента линейки (v3; в v2.1 — stretchy-иконка). */

.map-label {
  transform: translate(-50%, -50%);
  padding: 1px 7px;
  border-radius: 6px;
  background: #111827;
  color: #fff;
  font-size: 10.5px;
  white-space: nowrap;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.pick-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  transform: translate(-50%, -100%);
  pointer-events: none;
}

.pick-label {
  padding: 1px 7px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 10.5px;
  white-space: nowrap;
}

.pick-pin {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #111827;
  border: 2px solid #fff;
  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}

.map-popup {
  position: relative;
  transform: translate(-50%, calc(-100% - 12px));
  width: max-content;
  max-width: 300px;
  padding: 10px 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
  font-size: 12px;
  cursor: default;
}

.pp-title {
  font-weight: 700;
  font-size: 12px;
  margin: 0 18px 6px 0;
}

/* Плашка проблемных координат в попапе/карточке (SPEC-3 П5). */
.pp-problem {
  margin: 0 0 6px;
  padding: 4px 7px;
  border-radius: 6px;
  background: #fee2e2;
  border: 1px solid #fca5a5;
  color: #991b1b;
  font-size: 11px;
  font-weight: 700;
}

.geometry-toggle {
  width: 100%;
  margin: 0 0 7px;
  padding: 5px 7px;
  border: 1px solid #93c5fd;
  border-radius: 6px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.geometry-toggle:hover {
  background: #dbeafe;
}

.pp-row {
  display: flex;
  gap: 8px;
  padding: 1.5px 0;
}

.pp-row span {
  flex: 0 0 96px;
  color: #6b7280;
}

.pp-row b {
  font-weight: 600;
  word-break: break-word;
}

.popup-close {
  position: absolute;
  top: 4px;
  right: 6px;
  border: none;
  background: none;
  font-size: 16px;
  line-height: 1;
  color: #9ca3af;
  cursor: pointer;
}

.popup-close:hover {
  color: #374151;
}

/* Режим без карты: прячем элементы, которым нужна карта. */

body.no-map .map-only {
  display: none !important;
}

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

@media (max-width: 800px) {
  body {
    flex-direction: column;
  }

  #sidebar {
    width: 100%;
    min-width: 0;
    height: 48%;
    border-right: none;
    border-bottom: 1px solid #e5e7eb;
  }

  #map-wrap {
    height: 52%;
  }
}

/* Порядок меню совпадает с DOM; раскрытие не сбрасывает фильтры карты. */
#mapDetails > summary,
#importsDetails > summary {
  min-height: 44px;
  padding: 10px 0;
}

#mapDetails > summary:focus-visible,
#importsDetails > summary:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 3px;
  border-radius: 4px;
}

#importsDetails > summary {
  font-size: 15px;
}

#importsDetails[open] > summary {
  margin-bottom: 8px;
}

#app-header {
  margin-bottom: 10px;
}

.account-details {
  margin: 16px 0;
}

.account-details dt {
  color: #64748b;
  margin-top: 8px;
}

.account-details dd {
  margin: 0;
  overflow-wrap: anywhere;
}
