:root {
  --bg: #071018;
  --panel: rgba(17, 27, 34, 0.94);
  --panel-soft: rgba(255, 255, 255, 0.045);
  --line: rgba(220, 208, 162, 0.14);

  --gold: #d8c98f;
  --olive: #9fb483;
  --olive-dark: #6f845c;
  --earth: #b8965d;

  --text: #eef4ea;
  --muted: #b3c0b3;

  --shadow: 0 18px 36px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, #203427 0%, #0b141c 55%, #05080d 100%);
  overflow: hidden;
}

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

.topbar {
  height: 64px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;

  background: linear-gradient(
    90deg,
    rgba(9, 16, 24, 0.96),
    rgba(16, 26, 31, 0.98)
  );

  border-bottom: 1px solid var(--line);
}

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

.brand-logo {
  position: relative;
  width: 58px;
  height: 40px;
  border-radius: 10px;

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

  font-size: 17px;
  font-weight: 900;
  letter-spacing: 0.08em;
  color: #f5fbff;
  text-shadow:
    0 0 7px rgba(148, 220, 255, 0.72),
    0 0 14px rgba(143, 102, 255, 0.42);

  background:
    linear-gradient(135deg, rgba(214, 224, 231, 0.2), rgba(127, 91, 180, 0.14)),
    linear-gradient(180deg, rgba(21, 31, 40, 0.98), rgba(10, 15, 22, 0.98));
  border: 1px solid rgba(198, 224, 235, 0.42);
  box-shadow:
    inset 0 0 18px rgba(148, 220, 255, 0.12),
    0 0 18px rgba(144, 104, 255, 0.22),
    0 0 26px rgba(93, 224, 218, 0.12);
}

.brand-logo:focus-visible {
  outline: 2px solid rgba(148, 220, 255, 0.72);
  outline-offset: 4px;
}

.brand-logo-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  z-index: 10050;
  display: grid;
  gap: 4px;
  width: max-content;
  max-width: 280px;
  padding: 12px 14px;
  border: 1px solid rgba(148, 220, 255, 0.48);
  border-radius: 14px;
  background:
    radial-gradient(circle at 12% 10%, rgba(148, 220, 255, 0.26), transparent 38%),
    linear-gradient(180deg, rgba(19, 31, 42, 0.98), rgba(10, 15, 22, 0.98));
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.52),
    0 0 24px rgba(144, 104, 255, 0.2);
  color: #e8f8ff;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.brand-logo:hover .brand-logo-tooltip,
.brand-logo:focus-visible .brand-logo-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.brand-logo-tooltip span {
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(203, 238, 255, 0.72);
}

.brand-logo-tooltip strong {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  letter-spacing: 0;
  color: #ffffff;
}

.brand-title {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  margin-top: 2px;
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-status {
  padding: 8px 12px;
  border-radius: 999px;

  font-size: 12px;
  color: var(--muted);

  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.ym-informer,
.ym-advanced-informer,
a[href*="metrika.yandex"],
img[src*="informer.yandex"] {
  position: absolute !important;
  left: -9999px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.layout {
  flex: 1;
  display: grid;
  grid-template-columns: 330px 1fr 390px;
  min-height: 0;
}

.sidebar,
.details {
  padding: 18px;
  overflow: auto;

  background: linear-gradient(
    180deg,
    rgba(16, 26, 31, 0.96),
    rgba(10, 16, 20, 0.98)
  );
}

.sidebar {
  border-right: 1px solid var(--line);
}

.details {
  border-left: 1px solid var(--line);
}

.panel {
  margin-bottom: 14px;
  padding: 14px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.025)
  );

  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.section-title {
  margin-bottom: 10px;

  font-size: 10px;
  font-weight: 800;
  color: var(--gold);

  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.input {
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 14px;

  color: var(--text);
  font-size: 14px;

  outline: none;
  border-radius: 16px;

  background: rgba(255, 255, 255, 0.045);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.input option {
  color: #ffffff;
  background: #11202a;
}

.legend-row {
  display: flex;
  align-items: center;
  gap: 8px;

  margin-bottom: 10px;
  font-size: 13px;
  color: var(--muted);
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
}

.legend-dot-active {
  background: var(--olive);
}

.legend-dot-free {
  background: var(--earth);
}

.legend-note {
  margin-top: 12px;

  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.map-area {
  position: relative;
  min-width: 0;
  min-height: 0;
  background: #273224;
  border: 2px solid rgba(216, 201, 143, 0.35);
  border-radius: 20px;
  box-shadow: 
    0 0 0 6px rgba(17, 27, 34, 0.6),
    0 25px 60px rgba(0, 0, 0, 0.55),
    inset 0 1px 0 rgba(255,255,255,0.08);
  overflow: hidden;
}

.map {
  position: absolute;
  inset: 0;

  background:
    linear-gradient(180deg, rgba(216, 201, 143, 0.06), transparent 35%),
    radial-gradient(circle at center, #35452f 0%, #1f2d24 60%, #121a18 100%);
}

.details-card {
  min-height: 260px;
}

.details-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}
.aqua-marker {
  position: relative;
  z-index: 1;
  border-radius: 50%;
  border: 2px solid rgba(245, 220, 150, 0.95);
  box-shadow: 0 0 10px rgba(236, 205, 132, 0.55);
  cursor: pointer;
  transform: translate(-50%, -50%);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.aqua-marker--small {
  width: 10px;
  height: 10px;
}

.aqua-marker--medium {
  width: 15px;
  height: 15px;
}

.aqua-marker--large {
  width: 22px;
  height: 22px;
}

.aqua-marker--active {
  background: rgba(92, 155, 105, 0.95);
}

.aqua-marker--free {
  background: rgba(210, 175, 84, 0.95);
}

.aqua-marker--hover {
  transform: translate(-50%, -50%) scale(1.25);
  z-index: 1000000 !important;
  box-shadow: 0 0 18px rgba(245, 220, 150, 0.9);
}

.aqua-tooltip {
  position: absolute;
  left: 50%;
  bottom: 130%;
  min-width: 180px;
  max-width: 260px;
  transform: translateX(-50%);
  padding: 10px 12px;
  border: 1px solid rgba(219, 189, 118, 0.75);
  border-radius: 12px;
  background: rgba(35, 42, 28, 0.96);
  color: #f4e5bd;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.16s ease, transform 0.16s ease;
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  z-index: 999999 !important;
  overflow-wrap: break-word;
}

.aqua-marker--hover .aqua-tooltip {
  opacity: 1;
  transform: translateX(-50%) translateY(-4px);
}

.aqua-tooltip__title {
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  color: #f6d98b;
}

.aqua-tooltip__meta {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(244, 229, 189, 0.82);
}
.rvu-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: #f3e6bf;
  border: none !important;
  box-shadow: none !important;
}

.rvu-card-hero {
  padding: 16px;
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(74, 84, 50, 0.92), rgba(31, 39, 28, 0.96)),
    radial-gradient(circle at top left, rgba(238, 204, 126, 0.16), transparent 35%);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.26);
}

.rvu-card-kicker {
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: rgba(246, 217, 139, 0.72);
}

.rvu-card-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.rvu-card-title {
  margin: 0;
  font-size: 22px;
  line-height: 1.15;
  font-weight: 800;
  color: #f7df9e;
}

.rvu-card-water {
  font-size: 15px;
  line-height: 1.45;
  color: rgba(244, 229, 189, 0.92);
}

.rvu-card-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.rvu-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border: 1px solid rgba(219, 189, 118, 0.35);
  border-radius: 999px;
  background: rgba(20, 28, 20, 0.42);
  font-size: 12px;
  line-height: 1.2;
  color: rgba(244, 229, 189, 0.9);
}

.rvu-status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  white-space: nowrap;
}

.rvu-status-active {
  border: 1px solid rgba(143, 202, 126, 0.52);
  background: rgba(87, 143, 94, 0.28);
  color: #bfe6aa;
}

.rvu-status-free {
  border: 1px solid rgba(226, 188, 91, 0.6);
  background: rgba(184, 143, 45, 0.22);
  color: #f3d083;
}

.rvu-status-unknown {
  border: 1px solid rgba(190, 190, 170, 0.4);
  background: rgba(190, 190, 170, 0.12);
  color: #ddd6bd;
}

.rvu-section {
  margin-bottom: 16px;
  padding: 18px 20px;

  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.05),
    rgba(255, 255, 255, 0.025)
  );

  border: none;
  border-radius: 20px;
  box-shadow: var(--shadow);
  overflow: visible !important;
}

.rvu-section-title {
  margin-bottom: 14px;
  font-size: 10px;
  font-weight: 800;
  color: #f6d98b;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.rvu-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

.rvu-info-item {
  display: grid;
  grid-template-columns: minmax(96px, 42%) 1fr;
  gap: 12px;
  align-items: start;
}

.rvu-info-item span {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(244, 229, 189, 0.58);
}

.rvu-info-item strong {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  color: rgba(244, 229, 189, 0.96);
}

.rvu-geometry-box {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.rvu-geometry-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.rvu-geometry-row span {
  font-size: 12px;
  line-height: 1.45;
  color: rgba(244, 229, 189, 0.58);
}

.rvu-geometry-row strong {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  text-align: right;
  color: rgba(244, 229, 189, 0.96);
}

.rvu-quality-note {
  padding: 10px 12px;
  border: 1px solid rgba(226, 188, 91, 0.22);
  border-radius: 12px;
  background: rgba(226, 188, 91, 0.08);
  font-size: 12px;
  line-height: 1.55;
  color: rgba(244, 229, 189, 0.78);
}

.rvu-raw {
  border: 1px solid rgba(219, 189, 118, 0.24);
  border-radius: 14px;
  background: rgba(20, 28, 20, 0.58);
  overflow: hidden;
}

.rvu-raw summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  color: #f6d98b;
}

.rvu-raw-text {
  padding: 0 14px 14px;
  font-size: 12px;
  line-height: 1.6;
  color: rgba(244, 229, 189, 0.74);
  word-break: break-word;
}

.details-empty {
  padding: 18px;
  border: 1px dashed rgba(219, 189, 118, 0.32);
  border-radius: 16px;
  font-size: 14px;
  line-height: 1.55;
  color: rgba(244, 229, 189, 0.66);
  background: rgba(31, 39, 28, 0.42);
}
.rvu-contract-card {
  position: relative;
  padding: 14px;
  border: 1px solid rgba(219, 189, 118, 0.34);
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(36, 47, 32, 0.86), rgba(20, 28, 20, 0.82)),
    radial-gradient(circle at top right, rgba(246, 217, 139, 0.12), transparent 34%);
}

.rvu-contract-label {
  margin-bottom: 8px;
  font-size: 11px;
  line-height: 1.3;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: rgba(246, 217, 139, 0.72);
}

.rvu-contract-subject-wrap {
  position: relative;
}

.rvu-contract-subject {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(246, 217, 139, 0.38);
  border-radius: 13px;
  background: rgba(246, 217, 139, 0.08);
  color: #f7df9e;
  font-size: 14px;
  line-height: 1.35;
  font-weight: 750;
  text-align: left;
}

.rvu-contract-subject::after {
  content: "досье";
  flex: 0 0 auto;
  margin-left: 10px;
  padding: 4px 7px;
  border-radius: 999px;
  border: 1px solid rgba(246, 217, 139, 0.28);
  color: rgba(246, 217, 139, 0.72);
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rvu-contract-subject:disabled {
  cursor: default;
  opacity: 1;
}

.rvu-contract-subject--active {
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    box-shadow 0.16s ease,
    transform 0.16s ease;
}

.rvu-contract-subject--active:hover {
  border-color: rgba(246, 217, 139, 0.66);
  background: rgba(246, 217, 139, 0.13);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
  transform: translateY(-1px);
}

.rvu-contract-subject--active:focus-visible {
  outline: none;
  border-color: rgba(246, 217, 139, 0.82);
  box-shadow:
    0 0 0 3px rgba(246, 217, 139, 0.12),
    0 10px 24px rgba(0, 0, 0, 0.26);
}

.rvu-contract-tooltip {
  pointer-events: none;
  position: static;
  margin-top: 10px;
  padding: 12px;
  border: 1px solid rgba(239, 154, 73, 0.48);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(91, 50, 21, 0.97), rgba(48, 29, 19, 0.98)),
    radial-gradient(circle at top right, rgba(255, 181, 87, 0.22), transparent 42%);
  box-shadow:
    0 12px 24px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 235, 201, 0.1);
  color: #ffe2b1;
  opacity: 0;
  overflow: hidden;
  transform: translateY(4px);
  transition:
    opacity 0.36s ease 0.14s,
    transform 0.36s ease 0.14s;
}

.rvu-contract-card:hover .rvu-contract-tooltip,
.rvu-contract-card:focus-within .rvu-contract-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.rvu-contract-tooltip-title {
  margin-bottom: 9px;
  color: #ffbd72;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.rvu-contract-tooltip-row {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 8px;
  border-radius: 8px;
  background: rgba(255, 226, 177, 0.07);
}

.rvu-contract-tooltip-row + .rvu-contract-tooltip-row {
  margin-top: 6px;
}

.rvu-contract-tooltip-row span {
  min-width: 0;
  color: rgba(255, 226, 177, 0.74);
  font-size: 12px;
  line-height: 1.35;
}

.rvu-contract-tooltip-row strong {
  min-width: max-content;
  color: #ffe2b1;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 850;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.rvu-contract-meta {
  display: inline-flex;
  align-items: center;
  margin-top: 8px;
  padding: 5px 8px;
  border: 1px solid rgba(246, 217, 139, 0.24);
  border-radius: 999px;
  background: rgba(20, 28, 20, 0.36);
  color: rgba(244, 229, 189, 0.76);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.results-counter {
  margin-top: 4px;
  padding: 10px 12px;
  border: 1px solid rgba(219, 189, 118, 0.24);
  border-radius: 14px;
  background: rgba(216, 201, 143, 0.07);
  color: rgba(244, 229, 189, 0.78);
  font-size: 12px;
  line-height: 1.4;
}

.results-counter strong {
  color: #f6d98b;
  font-weight: 800;
}
.reset-filters-button {
  width: 100%;
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(219, 189, 118, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(31, 39, 28, 0.88), rgba(18, 27, 22, 0.94));
  color: #f3e6bf;
  font-size: 13px;
  line-height: 1.2;
  font-weight: 750;
  cursor: pointer;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
  transition:
    background 0.16s ease,
    border-color 0.16s ease,
    transform 0.16s ease,
    box-shadow 0.16s ease;
}

.reset-filters-button:hover {
  border-color: rgba(246, 217, 139, 0.62);
  background:
    linear-gradient(180deg, rgba(45, 56, 39, 0.92), rgba(23, 34, 27, 0.96));
  color: #f6d98b;
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.24);
}

.reset-filters-button:active {
  transform: translateY(0);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.16);
}

.reset-filters-button:focus-visible {
  outline: none;
  border-color: rgba(246, 217, 139, 0.76);
  box-shadow:
    0 0 0 3px rgba(246, 217, 139, 0.10),
    0 10px 22px rgba(0, 0, 0, 0.24);
}
.active-filters-indicator {
  margin-top: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(159, 180, 131, 0.32);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(42, 58, 40, 0.72), rgba(22, 32, 26, 0.86));
  color: rgba(244, 229, 189, 0.78);
  font-size: 12px;
  line-height: 1.45;
}

.active-filters-indicator.is-empty {
  display: none;
}

.active-filters-title {
  margin-bottom: 8px;
  color: rgba(246, 217, 139, 0.82);
  font-size: 11px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

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

.active-filter-chip {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid rgba(246, 217, 139, 0.28);
  border-radius: 999px;
  background: rgba(216, 201, 143, 0.08);
  color: rgba(244, 229, 189, 0.88);
  font-size: 11px;
  line-height: 1.25;
}

.active-filter-chip strong {
  margin-right: 4px;
  color: #f6d98b;
  font-weight: 800;
}
.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.summary-stat-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(219, 189, 118, 0.12);
}

.summary-stat-row:last-child {
  padding-bottom: 0;
  border-bottom: none;
}

.summary-stat-row span {
  font-size: 12px;
  line-height: 1.35;
  color: rgba(244, 229, 189, 0.58);
}

.summary-stat-row strong {
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  text-align: right;
  color: #f6d98b;
}

.summary-stat-note {
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(159, 180, 131, 0.22);
  border-radius: 12px;
  background: rgba(159, 180, 131, 0.07);
  font-size: 11px;
  line-height: 1.5;
  color: rgba(244, 229, 189, 0.62);
}

/* === СВОДКА ПО БАЗЕ (databaseStats) === */
.database-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 8px;
}

.database-stat-card {
  display: flex;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, rgba(255,255,255,0.04), rgba(255,255,255,0.02));
  border: 1px solid rgba(219, 189, 118, 0.18);
  border-radius: 14px;
  padding: 12px;
  text-align: center;
  transition: all 0.2s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.database-stat-button {
  width: 100%;
  color: inherit;
  font: inherit;
  cursor: pointer;
  appearance: none;
}

.database-stat-card:hover {
  border-color: rgba(246, 217, 139, 0.35);
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

.database-stat-button:focus-visible {
  outline: 2px solid rgba(246, 217, 139, 0.72);
  outline-offset: 3px;
}

.database-stat-label {
  max-width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: rgba(244, 229, 189, 0.65);
  line-height: 1.35;
  margin-bottom: 6px;
}

.database-stat-value {
  max-width: 100%;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.15;
  color: #f6d98b;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.database-stat-wide {
  grid-column: 1 / -1;
  min-height: 88px;
  padding: 14px 16px;
}

.database-stat-note {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 6px;
  padding: 10px 12px;
  border: 1px solid rgba(159, 180, 131, 0.25);
  border-radius: 12px;
  background: rgba(159, 180, 131, 0.06);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  color: rgba(244, 229, 189, 0.72);
}

.database-stat-note--district {
  text-align: left;
}

.database-stat-note-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 7px 8px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.database-stat-note-row span {
  min-width: 0;
  color: rgba(244, 229, 189, 0.58);
}

.database-stat-note-row strong {
  min-width: max-content;
  color: #f6d98b;
  font-weight: 700;
  text-align: right;
}

/* === КРАСИВАЯ КАРТОЧКА УЧАСТКА (как на скрине) === */
.rvu-card {
  background: linear-gradient(180deg, #1a241f 0%, #121a16 100%);
  border: 1px solid rgba(219, 189, 118, 0.28);
  border-radius: 22px;
  overflow: visible !important;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.5);
  color: #f3e6bf;
}

.rvu-card-hero {
  padding: 22px 24px 18px;
  background: linear-gradient(135deg, rgba(58, 68, 42, 0.95), rgba(28, 35, 26, 0.98));
}

.rvu-card-kicker {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(246, 217, 139, 0.65);
  margin-bottom: 8px;
}

.rvu-card-title {
  font-size: 21px;
  font-weight: 800;
  color: #f7df9e;
  line-height: 1.15;
  margin: 0 0 6px 0;
}

.rvu-card-water {
  font-size: 15.5px;
  color: rgba(244, 229, 189, 0.92);
  margin-bottom: 14px;
}

.water-info-trigger {
  position: relative;
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  color: #c7fbf2;
  cursor: help;
  overflow-wrap: anywhere;
}

.water-info-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;
  background: #5de0da;
  box-shadow: 0 0 12px rgba(93, 224, 218, 0.82);
  flex: 0 0 auto;
}

.water-info-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  z-index: 10000;
  display: block;
  width: min(310px, 72vw);
  padding: 14px;
  border: 1px solid rgba(93, 224, 218, 0.45);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 8%, rgba(93, 224, 218, 0.24), transparent 36%),
    linear-gradient(180deg, rgba(13, 47, 48, 0.98), rgba(10, 30, 31, 0.98));
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.48),
    0 0 22px rgba(93, 224, 218, 0.14);
  color: #d8fffa;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-8px);
  transition: opacity 0.16s ease, transform 0.16s ease;
}

.water-info-trigger:hover .water-info-tooltip,
.water-info-trigger:focus-visible .water-info-tooltip {
  opacity: 1;
  transform: translateY(0);
}

.water-info-trigger:focus-visible {
  outline: 2px solid rgba(93, 224, 218, 0.72);
  outline-offset: 4px;
  border-radius: 6px;
}

.water-info-kicker,
.water-info-title,
.water-info-source {
  display: block;
}

.water-info-kicker {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(177, 255, 247, 0.68);
}

.water-info-title {
  margin-bottom: 11px;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  color: #8ff3ec;
}

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

.water-info-metric {
  display: flex;
  min-height: 54px;
  flex-direction: column;
  justify-content: center;
  padding: 8px;
  border: 1px solid rgba(177, 255, 247, 0.18);
  border-radius: 10px;
  background: rgba(177, 255, 247, 0.07);
}

.water-info-metric span {
  margin-bottom: 3px;
  font-size: 10px;
  line-height: 1.25;
  color: rgba(216, 255, 250, 0.62);
}

.water-info-metric strong {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 800;
  color: #ffffff;
}

.water-info-source {
  margin-top: 10px;
  font-size: 10.5px;
  line-height: 1.35;
  color: rgba(216, 255, 250, 0.58);
}

.rvu-card-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.rvu-badge {
  background: rgba(18, 25, 20, 0.65);
  border: 1px solid rgba(219, 189, 118, 0.4);
  color: #e8d9a8;
  font-size: 12.5px;
  padding: 6px 13px;
  border-radius: 999px;
  font-weight: 600;
}

.rvu-area-badge {
  position: relative;
  cursor: help;
  outline: none;
}

.rvu-area-badge:focus-visible {
  border-color: rgba(246, 173, 89, 0.82);
  box-shadow: 0 0 0 3px rgba(211, 112, 42, 0.22);
}

.rvu-area-tooltip {
  position: absolute;
  left: 0;
  top: calc(100% + 12px);
  z-index: 10020;
  display: grid;
  gap: 9px;
  width: min(300px, 72vw);
  padding: 13px 14px;
  border: 1px solid rgba(246, 173, 89, 0.58);
  border-radius: 15px;
  background:
    radial-gradient(circle at 12% 10%, rgba(246, 173, 89, 0.28), transparent 38%),
    linear-gradient(180deg, rgba(92, 45, 18, 0.98), rgba(50, 27, 17, 0.98));
  box-shadow:
    0 18px 38px rgba(0, 0, 0, 0.5),
    0 0 24px rgba(211, 112, 42, 0.18);
  color: #ffe7bd;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-7px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.rvu-area-badge:hover .rvu-area-tooltip,
.rvu-area-badge:focus-visible .rvu-area-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.rvu-area-tooltip-title {
  font-size: 10px;
  line-height: 1.25;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: rgba(255, 213, 153, 0.74);
}

.rvu-area-tooltip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;
  background: rgba(255, 214, 158, 0.09);
}

.rvu-area-tooltip-row span {
  font-size: 12px;
  line-height: 1.3;
  color: rgba(255, 232, 199, 0.76);
}

.rvu-area-tooltip-row strong {
  font-size: 16px;
  line-height: 1.2;
  font-weight: 850;
  color: #fff2d6;
  white-space: nowrap;
}

/* Hover-блок с координатами */
.rvu-geometry-box {
  position: relative;
  cursor: grab;
  overflow: visible !important;
}

.rvu-geometry-box:hover .rvu-coords-tooltip {
  opacity: 1 !important;
  visibility: visible !important;
  transform: translateX(-50%) translateY(0) !important;
}

.rvu-coords-tooltip {
  position: absolute;
  bottom: calc(100% + 14px);   /* появляется НАД блоком */
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: #0c120f;
  border: 1px solid #d8c98f;
  border-radius: 16px;
  padding: 16px 18px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.75);
  z-index: 999999 !important;
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  font-size: 12.5px;
  line-height: 1.55;
  color: #d4c48f;
  min-width: 280px;
  max-width: 320px;
  pointer-events: none;
}

.rvu-coords-tooltip::before {
  content: '';
  position: absolute;
  top: -7px;
  left: 50%;
  transform: translateX(-50%);
  border-left: 7px solid transparent;
  border-right: 7px solid transparent;
  border-bottom: 7px solid #d8c98f;  /* стрелка вниз */
}

.rvu-coords-list {
  max-height: 180px;
  overflow-y: auto;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-size: 11.5px;
  color: #b8a96d;
  line-height: 1.65;
  padding-right: 6px;
}

.contract-dossier-modal {
  position: fixed;
  inset: 0;
  z-index: 2000000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.contract-dossier-backdrop {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 52% 24%, rgba(216, 201, 143, 0.08), transparent 34%),
    rgba(3, 7, 9, 0.72);
  backdrop-filter: blur(7px);
}

.contract-dossier-panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(780px, calc(100vh - 48px));
  overflow: auto;
  border: 1px solid rgba(216, 201, 143, 0.3);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(27, 37, 30, 0.98), rgba(12, 18, 15, 0.99)),
    radial-gradient(circle at top left, rgba(246, 217, 139, 0.13), transparent 34%);
  box-shadow:
    0 32px 80px rgba(0, 0, 0, 0.72),
    inset 0 1px 0 rgba(255, 255, 255, 0.07);
  color: #f3e6bf;
}

.contract-dossier-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 24px 26px 18px;
  border-bottom: 1px solid rgba(216, 201, 143, 0.18);
  background:
    linear-gradient(135deg, rgba(74, 84, 50, 0.72), rgba(20, 28, 20, 0.18));
}

.contract-dossier-kicker {
  margin-bottom: 7px;
  color: rgba(246, 217, 139, 0.72);
  font-size: 10px;
  line-height: 1.3;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contract-dossier-title {
  margin: 0;
  color: #f7df9e;
  font-size: 28px;
  line-height: 1.12;
  font-weight: 850;
}

.contract-dossier-subtitle {
  margin-top: 8px;
  color: rgba(244, 229, 189, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.contract-dossier-close {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(246, 217, 139, 0.28);
  border-radius: 12px;
  background: rgba(20, 28, 20, 0.62);
  color: #f7df9e;
  font-size: 24px;
  line-height: 1;
  cursor: pointer;
}

.contract-dossier-close:hover,
.contract-dossier-close:focus-visible {
  outline: none;
  border-color: rgba(246, 217, 139, 0.62);
  background: rgba(246, 217, 139, 0.1);
}

.contract-dossier-status-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 26px 0;
}

.contract-dossier-status,
.contract-dossier-inn {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 6px 10px;
  border: 1px solid rgba(246, 217, 139, 0.28);
  border-radius: 999px;
  background: rgba(216, 201, 143, 0.08);
  color: rgba(244, 229, 189, 0.84);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.contract-dossier-status {
  border-color: rgba(159, 180, 131, 0.34);
  background: rgba(159, 180, 131, 0.1);
  color: #cfe1b7;
}

.contract-dossier-status--loading {
  border-color: rgba(246, 217, 139, 0.34);
  background: rgba(216, 201, 143, 0.08);
  color: #f6d98b;
}

.contract-dossier-status--success {
  border-color: rgba(159, 180, 131, 0.42);
  background: rgba(159, 180, 131, 0.12);
  color: #cfe1b7;
}

.contract-dossier-status--error {
  border-color: rgba(221, 183, 92, 0.44);
  background: rgba(184, 143, 45, 0.14);
  color: #f1c66d;
}

.contract-dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 16px 26px 24px;
}

.contract-dossier-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(216, 201, 143, 0.16);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.038), rgba(255, 255, 255, 0.018));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.2);
}

.contract-dossier-card--wide {
  grid-column: 1 / -1;
}

.contract-dossier-card-title {
  margin-bottom: 10px;
  color: #f6d98b;
  font-size: 10px;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.contract-dossier-list {
  display: grid;
  gap: 6px;
}

.contract-dossier-row {
  display: grid;
  grid-template-columns: minmax(118px, 30%) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(216, 201, 143, 0.08);
  border-radius: 9px;
  background: rgba(4, 9, 8, 0.18);
}

.contract-dossier-row span {
  min-width: 0;
  color: rgba(244, 229, 189, 0.56);
  font-size: 12px;
  line-height: 1.45;
}

.contract-dossier-row strong {
  min-width: 0;
  color: rgba(244, 229, 189, 0.94);
  font-size: 13px;
  line-height: 1.45;
  font-weight: 720;
  overflow-wrap: anywhere;
  white-space: pre-line;
}

.contract-dossier-footer {
  margin: 0 26px 24px;
  padding: 12px 14px;
  border: 1px solid rgba(159, 180, 131, 0.24);
  border-radius: 14px;
  background: rgba(159, 180, 131, 0.07);
  color: rgba(244, 229, 189, 0.68);
  font-size: 12px;
  line-height: 1.55;
}

@media (max-width: 760px) {
  .contract-dossier-modal {
    padding: 12px;
  }

  .contract-dossier-panel {
    max-height: calc(100vh - 24px);
    border-radius: 18px;
  }

  .contract-dossier-hero,
  .contract-dossier-status-row,
  .contract-dossier-grid {
    padding-left: 16px;
    padding-right: 16px;
  }

  .contract-dossier-title {
    font-size: 22px;
  }

  .contract-dossier-grid {
    grid-template-columns: 1fr;
  }

  .contract-dossier-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .contract-dossier-footer {
    margin-left: 16px;
    margin-right: 16px;
  }
}

/* === Кроссбраузерный адаптив === */
@media (max-width: 1440px) {
  .layout {
    grid-template-columns: 300px minmax(0, 1fr) 350px;
  }

  .sidebar,
  .details {
    padding: 14px;
  }
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .app {
    min-height: 100vh;
    height: auto;
  }

  .layout {
    grid-template-columns: 300px minmax(0, 1fr);
    grid-template-rows: minmax(520px, calc(100vh - 64px)) auto;
    min-height: calc(100vh - 64px);
  }

  .sidebar {
    border-right: 1px solid var(--line);
  }

  .map-area {
    min-height: 520px;
    border-radius: 16px;
  }

  .details {
    grid-column: 1 / -1;
    border-top: 1px solid var(--line);
    border-left: none;
    overflow: visible;
  }

  .details-card {
    min-height: 0;
  }

  .rvu-card {
    max-width: 920px;
    margin: 0 auto;
  }
}

@media (max-width: 900px) {
  .topbar {
    height: auto;
    min-height: 64px;
    gap: 12px;
    padding: 12px 14px;
  }

  .brand {
    min-width: 0;
  }

  .brand-title {
    font-size: 21px;
    letter-spacing: 0;
  }

  .brand-subtitle {
    font-size: 10px;
    letter-spacing: 0.05em;
  }

  .layout {
    display: flex;
    min-height: 0;
    flex-direction: column;
  }

  .sidebar,
  .details {
    padding: 12px;
    border: none;
    overflow: visible;
  }

  .map-area {
    order: 1;
    min-height: 58vh;
    margin: 0 12px;
  }

  .sidebar {
    order: 2;
    border-bottom: 1px solid var(--line);
  }

  .details {
    order: 3;
    border-top: 1px solid var(--line);
  }

  .panel {
    border-radius: 16px;
  }

  .sidebar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(220px, 0.72fr);
    gap: 12px;
  }

  .sidebar .panel {
    margin-bottom: 0;
  }

  .sidebar .panel:first-child {
    grid-row: span 2;
  }
}

@media (max-width: 640px) {
  .topbar {
    align-items: flex-start;
  }

  .brand-logo {
    width: 52px;
    height: 38px;
    font-size: 16px;
  }

  .brand-subtitle {
    display: none;
  }

  .topbar-status {
    padding: 7px 10px;
    font-size: 11px;
  }

  .sidebar {
    display: block;
  }

  .sidebar .panel {
    margin-bottom: 12px;
  }

  .map-area {
    min-height: 54vh;
    margin: 0 10px;
    border-width: 1px;
    border-radius: 14px;
    box-shadow: 0 12px 34px rgba(0, 0, 0, 0.4);
  }

  .details {
    padding: 10px;
  }

  .rvu-card-hero,
  .rvu-section,
  .rvu-contract-card {
    padding: 14px;
    border-radius: 14px;
  }

  .rvu-card-title-row,
  .rvu-geometry-row,
  .database-stat-note-row,
  .summary-stat-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 5px;
  }

  .rvu-status {
    white-space: normal;
  }

  .rvu-info-item {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .database-stats-grid,
  .water-info-grid {
    grid-template-columns: 1fr;
  }

  .rvu-contract-subject {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .rvu-contract-subject::after {
    margin-left: 0;
  }

  .contract-dossier-hero {
    flex-direction: column;
  }

  .contract-dossier-close {
    align-self: flex-end;
  }
}

@media (max-width: 430px) {
  .brand-title {
    font-size: 19px;
  }

  .panel,
  .rvu-card-hero,
  .rvu-section,
  .rvu-contract-card {
    padding: 12px;
  }

  .map-area {
    min-height: 50vh;
  }

  .rvu-card-title {
    font-size: 20px;
  }

  .rvu-card-badges {
    gap: 6px;
  }

  .rvu-badge {
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }
}

@media (hover: none), (pointer: coarse) {
  .brand-logo-tooltip,
  .water-info-tooltip,
  .rvu-area-tooltip,
  .rvu-coords-tooltip {
    max-width: calc(100vw - 28px);
  }

  .brand-logo:focus .brand-logo-tooltip,
  .brand-logo.is-tooltip-open .brand-logo-tooltip,
  .water-info-trigger:focus .water-info-tooltip,
  .water-info-trigger.is-tooltip-open .water-info-tooltip,
  .rvu-area-badge:focus .rvu-area-tooltip,
  .rvu-area-badge.is-tooltip-open .rvu-area-tooltip {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }

  .rvu-geometry-box:focus .rvu-coords-tooltip,
  .rvu-geometry-box.is-tooltip-open .rvu-coords-tooltip {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateX(-50%) translateY(0) !important;
  }

  .rvu-contract-card.is-tooltip-open .rvu-contract-tooltip {
    opacity: 1;
    transform: translateY(0);
  }
}
