:root {
  color-scheme: dark;
  --bg: #0c1720;
  --surface-deep: #111f29;
  --surface-well: #152630;
  --surface-panel: linear-gradient(155deg, #263740, #1c2c36 80%);
  --surface-raised: linear-gradient(155deg, #30454f, #263b45 82%);
  --panel: rgba(26, 40, 50, .98);
  --panel-soft: rgba(223, 235, 242, .035);
  --line: rgba(183, 202, 214, .2);
  --edge-light: rgba(232, 241, 246, .1);
  /* Slate carries content, turquoise marks actions, sand provides warmth. */
  --gold: #ddcda5;
  --teal: #a7d3d0;
  --success: #cfddc7;
  --olive: #a8be8d;
  --olive-dark: #6f845c;
  --earth: #b8965d;
  --text: #edf0ee;
  --muted: #b4c1c8;
  --text-soft: #99abb6;
  --shadow: 0 7px 18px rgba(0, 0, 0, .2);
  --panel-shadow: inset 0 1px 0 var(--edge-light), 0 4px 12px rgba(0, 0, 0, .16);
  --inset-shadow: inset 0 2px 5px rgba(0, 0, 0, .22), 0 1px 0 rgba(232, 241, 246, .05);
  --focus: #ecdcaf;
  --radius: 14px;
  --dossier-gutter: 26px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  overflow: hidden;
}

body:has(> .contract-dossier-modal, > .fish-banner-modal) {
  overflow: hidden;
}

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

.topbar {
  flex-shrink: 0;
  height: 68px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: linear-gradient(180deg, #293b45, #192b35);
  border-bottom: 1px solid var(--line);
  box-shadow: inset 0 1px 0 var(--edge-light), 0 3px 12px rgba(0, 0, 0, .18);
}

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

.brand-logo {
  position: relative;
  flex: 0 0 auto;
  width: 58px;
  height: 40px;
  border-radius: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .08em;
  color: #eee5bd;
  text-shadow: 0 1px 1px rgba(0, 0, 0, .5);
  background: linear-gradient(145deg, #625a48, #474438);
  border: 1px solid rgba(222, 205, 152, .38);
  box-shadow: inset 0 1px 0 rgba(247, 239, 196, .2), 0 2px 0 #24261f, 0 4px 9px rgba(0, 0, 0, .2);
}

.brand-logo:focus-visible {
  outline: 2px solid var(--focus);
  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 var(--line);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--panel-shadow), 0 10px 26px rgba(0, 0, 0, .35);
  color: var(--text);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity .16s ease, transform .16s ease, visibility .16s 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: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
}

.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-actions {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-width: 0;
  gap: 8px;
  padding: 0 18px;
}

.topbar-toggle {
  min-width: 96px;
  min-height: 40px;
  padding: 9px 14px;
  border-radius: 11px;
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: .03em;
}

.topbar-status {
  padding: 6px 11px;
  border-radius: 8px;
  font-size: 11px;
  color: var(--muted);
  background: var(--surface-well);
  border: 1px solid var(--line);
  box-shadow: var(--inset-shadow);
}

.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 {
  min-width: 0;
  padding: 18px;
  overflow: auto;
  background: linear-gradient(180deg, #182832, #111f29);
  scrollbar-width: thin;
  scrollbar-color: #61747f transparent;
}

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

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

.panel {
  min-width: 0;
  margin-bottom: 16px;
  padding: 16px;
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
}

.section-title {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  color: var(--gold);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.input {
  min-width: 0;
  min-height: 46px;
  width: 100%;
  max-width: 100%;
  margin-bottom: 12px;
  padding: 12px;
  color: var(--text);
  font: inherit;
  font-size: 14px;
  line-height: 1.45;
  border-radius: 10px;
  background: linear-gradient(180deg, #13232d, #192e38);
  border: 1px solid rgba(183, 202, 214, .25);
  box-shadow: var(--inset-shadow);
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input option {
  color: var(--text);
  background: #1b2d38;
}

.input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}

.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: #243a46;
  border: 1px solid rgba(222, 205, 152, .4);
  border-radius: 16px;
  box-shadow: inset 0 1px 0 var(--edge-light), 0 6px 20px rgba(0, 0, 0, .24);
  overflow: hidden;
}

.map {
  position: absolute;
  inset: 0;

  background:
    linear-gradient(180deg, rgba(216, 201, 143, 0.06), transparent 35%),
    radial-gradient(circle at center, #344c58 0%, #213440 60%, #15252f 100%);
}

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

.details-empty {
  padding: 18px;
  border: 1px dashed rgba(183, 202, 214, .27);
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--muted);
  background: var(--surface-well);
  box-shadow: var(--inset-shadow);
}
.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-marker--selected-pulse {
  z-index: 1000001 !important;
  animation: selectedMarkerPulse 0.9s ease-out 2;
}

.aqua-marker--selected-pulse::after {
  content: "";
  position: absolute;
  inset: -13px;
  border: 2px solid rgba(85, 174, 255, 0.94);
  border-radius: 50%;
  box-shadow:
    0 0 0 5px rgba(85, 174, 255, 0.14),
    0 0 24px rgba(85, 174, 255, 0.78);
  pointer-events: none;
  animation: selectedMarkerHalo 0.9s ease-out 2;
}

@keyframes selectedMarkerPulse {
  0% {
    box-shadow: 0 0 10px rgba(236, 205, 132, 0.55);
  }
  45% {
    box-shadow:
      0 0 16px rgba(245, 220, 150, 0.85),
      0 0 28px rgba(85, 174, 255, 0.58);
  }
  100% {
    box-shadow: 0 0 10px rgba(236, 205, 132, 0.55);
  }
}

@keyframes selectedMarkerHalo {
  0% {
    opacity: 0;
    transform: scale(0.55);
  }
  35% {
    opacity: 1;
  }
  100% {
    opacity: 0;
    transform: scale(1.65);
  }
}

.aqua-tooltip {
  position: absolute;
  left: 50%;
  bottom: 130%;
  min-width: 180px;
  max-width: 260px;
  transform: translateX(-50%);
  padding: 10px 12px;

  border: 1px solid rgba(199, 207, 207, .38);
  border-radius: 12px;

  background: var(--surface-raised);

  color: var(--text);

  box-shadow: var(--panel-shadow), 0 10px 26px rgba(0, 0, 0, .32);
  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: var(--gold);
}

.aqua-tooltip__meta {
  font-size: 12px;
  line-height: 1.35;

  color: var(--muted);
}

.fish-info-marker {
  position: relative;
  z-index: 1000002;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 1px solid rgba(128, 231, 224, 0.76);
  border-radius: 999px;
  background:
    radial-gradient(circle at 35% 28%, rgba(255, 240, 178, 0.36), transparent 30%),
    linear-gradient(145deg, rgba(18, 96, 100, 0.96), rgba(10, 35, 43, 0.98));
  box-shadow:
    0 0 0 6px rgba(62, 201, 211, 0.12),
    0 12px 26px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
  color: #d9fff7;
  cursor: pointer;
  transform: translate(-50%, -50%) scale(var(--fish-marker-scale, 1));
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.fish-info-marker:hover,
.fish-info-marker:focus-visible {
  outline: none;
  border-color: rgba(255, 224, 140, 0.92);
  box-shadow:
    0 0 0 8px rgba(62, 201, 211, 0.16),
    0 0 24px rgba(79, 230, 226, 0.56),
    0 14px 30px rgba(0, 0, 0, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  transform: translate(-50%, -50%) scale(var(--fish-marker-hover-scale, 1.08));
}

.fish-info-marker.is-hidden {
  display: none;
}

.fish-info-marker__icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 22px;
}

.fish-info-marker__icon svg {
  width: 100%;
  height: 100%;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.fish-info-marker__icon path {
  fill: #f7df9e;
}

.fish-info-marker__icon circle {
  fill: #102026;
}

.fish-info-marker__tooltip {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 10px);
  width: max-content;
  max-width: 180px;
  padding: 7px 10px;
  border: 1px solid rgba(128, 231, 224, 0.42);
  border-radius: 999px;
  background: rgba(13, 32, 35, 0.96);
  color: #effff8;
  font-size: 11px;
  line-height: 1.2;
  font-weight: 800;
  transform: translateX(-50%) translateY(5px);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.36);
}

.fish-info-marker:hover .fish-info-marker__tooltip,
.fish-info-marker:focus-visible .fish-info-marker__tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}
.rvu-card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  color: var(--text);
  min-width: 0;
}

.rvu-card-hero {
  padding: 20px;
  border: 1px solid rgba(199, 207, 207, .3);
  border-radius: var(--radius);
  background: linear-gradient(145deg, #454641, #2c3c43 80%);
  box-shadow: var(--panel-shadow);
}

.rvu-card-kicker {
  margin-bottom: 8px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}

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

.rvu-card-title {
  width: 100%;
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.25;
  font-weight: 750;
  color: #f1e5b9;
  overflow-wrap: anywhere;
  word-break: normal;
}

.rvu-card-water {
  position: relative;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text);
  margin-bottom: 14px;
}

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

.rvu-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(222, 205, 152, .25);
  border-radius: 9px;
  background: rgba(19, 32, 39, .48);
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .16), 0 1px 0 rgba(232, 241, 246, .04);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.4;
  color: #e5dfbf;
  overflow-wrap: anywhere;
}

.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 {
  min-width: 0;
  margin: 0;
  padding: 16px;
  background: var(--surface-panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--panel-shadow);
  overflow: visible;
}

.rvu-section-title {
  margin-bottom: 12px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--gold);
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

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

.rvu-info-item span {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  line-height: 1.45;
  color: var(--muted);
}

.rvu-info-item strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  color: var(--text);
}

.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: var(--muted);
}

.rvu-geometry-row strong {
  font-size: 13px;
  line-height: 1.45;
  font-weight: 650;
  text-align: right;
  color: var(--text);
}

.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 var(--line);
  border-radius: 14px;

  background: var(--surface-well);

  overflow: visible;
}

.rvu-raw summary {
  cursor: pointer;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.35;
  font-weight: 700;
  color: var(--gold);
}

.rvu-raw-text {
  padding: 12px 14px 14px;
  font-size: 12px;
  line-height: 1.6;

  color: var(--muted);
  word-break: break-word;
}

.rvu-contract-card {
  position: relative;
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(183, 202, 214, .3);
  border-radius: var(--radius);
  background: var(--surface-raised);
  box-shadow: var(--panel-shadow);
}

.rvu-contract-label {
  margin-bottom: 10px;
  font-size: 11px;
  line-height: 1.4;
  letter-spacing: .07em;
  text-transform: uppercase;
  color: var(--gold);
}

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

.rvu-contract-subject {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 10px 12px;
  border-radius: 10px;
  font: inherit;
  font-size: 14px;
  line-height: 1.4;
  font-weight: 650;
  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-tooltip {
  pointer-events: none;
  position: static;
  margin-top: 10px;
  padding: 12px;

  border: 1px solid rgba(199, 207, 207, .38);
  border-radius: 12px;

  background: var(--surface-raised);

  box-shadow: var(--panel-shadow), 0 10px 26px rgba(0, 0, 0, .32);

  color: var(--text);
  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: var(--gold);
  font-size: 10px;
  line-height: 1.3;

  font-weight: 700;
  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: var(--surface-well);
}

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

.rvu-contract-tooltip-row span {
  min-width: 0;

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

.rvu-contract-tooltip-row strong {
  min-width: 0;

  color: var(--text);
  font-size: 13px;
  line-height: 1.35;

  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.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(19, 32, 39, .4);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.results-counter {
  margin-top: 12px;
  padding: 11px 12px;
  border: 1px solid rgba(183, 202, 214, .12);
  border-radius: 10px;
  background: var(--surface-well);
  box-shadow: var(--inset-shadow);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.results-counter strong {
  color: var(--gold);
  font-weight: 800;
}
.reset-filters-button {
  width: 100%;
  min-height: 44px;
  margin-top: 12px;
  padding: 11px 14px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
}

.active-filters-indicator {
  margin-top: 12px;
  padding: 12px;
  border: 1px solid rgba(183, 202, 214, .18);
  border-radius: 10px;
  background: #223841;
  box-shadow: inset 0 1px 0 rgba(232, 241, 246, .05);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.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: var(--gold);
  font-weight: 800;
}

.subject-panel {
  overflow: visible;
  border-color: rgba(183, 202, 214, .26);
}

.subject-select {
  margin-bottom: 14px;
}

.subject-navigator-empty {
  padding: 14px;
  border: 1px dashed rgba(183, 202, 214, .22);
  border-radius: 10px;
  background: var(--surface-well);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  box-shadow: var(--inset-shadow);
}

.subject-navigator {
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}

.subject-current {
  min-width: 0;
}

.subject-current span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.subject-current strong {
  display: block;
  color: var(--text);
  font-size: 17px;
  line-height: 1.4;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.subject-summary {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(183, 202, 214, .25);
  border-radius: 14px;
  background:
    linear-gradient(180deg, #293c46, #1d303b);
}

.subject-summary-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.035);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.035);
}

.subject-summary-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.subject-summary-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--gold);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 800;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

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

.subject-rvu-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  /* Scroll the list; never compress a card below its text height. */
  grid-auto-rows: max-content;
  align-content: start;
  gap: 10px;
  max-height: 440px;
  overflow: auto;
  padding: 3px;
  margin: -3px;
  scrollbar-width: thin;
  scrollbar-color: #61747f transparent;
}

.subject-rvu-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  min-width: 0;
  min-height: 44px;
  height: auto;
  width: 100%;
  padding: 14px;
  border-radius: 11px;
  font: inherit;
  text-align: left;
  overflow-wrap: anywhere;
}

.subject-rvu-button span,
.subject-rvu-button strong {
  overflow-wrap: anywhere;
}

.subject-rvu-button span {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  font-weight: 700;
}

.subject-rvu-button strong {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
  font-weight: 700;
  text-align: right;
  font-variant-numeric: tabular-nums;
}
.summary-stats {
  display: flex;
  flex-direction: column;
  gap: 9px;
}

.summary-stat-row {
  display: flex;
  flex-wrap: wrap;
  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: var(--muted);
}

.summary-stat-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
  font-weight: 800;
  text-align: right;
  color: var(--gold);
}

.summary-stat-note {
  margin-top: 4px;
  padding: 9px 10px;
  border: 1px solid rgba(183, 202, 214, .22);
  border-radius: 12px;
  background: rgba(166, 194, 207, .07);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
}

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

.database-stat-card {
  display: flex;
  min-width: 0;
  min-height: 82px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 13px 11px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--surface-raised);
  box-shadow: var(--panel-shadow);
  text-align: center;
}

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

.database-stat-label {
  max-width: 100%;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--muted);
  line-height: 1.35;
  margin-bottom: 6px;
}

.database-stat-value {
  max-width: 100%;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--gold);
  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(183, 202, 214, .25);
  border-radius: 12px;
  background: rgba(166, 194, 207, .06);
  font-size: 12px;
  line-height: 1.5;
  text-align: left;
  color: var(--muted);
}

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

.database-stat-note-row {
  display: flex;
  flex-wrap: wrap;
  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: var(--muted);
}

.database-stat-note-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--gold);
  font-weight: 700;
  text-align: right;
}

/* Contextual information for the selected site. */
.water-info-trigger {
  position: static;
  display: inline-flex;
  align-items: center;
  max-width: 100%;

  color: var(--teal);
  cursor: help;
  overflow-wrap: anywhere;
}

.water-info-trigger::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-left: 7px;
  border-radius: 50%;

  background: var(--teal);

  box-shadow: 0 0 0 3px rgba(167, 211, 208, .12);
  flex: 0 0 auto;
}

.water-info-tooltip {
  position: absolute;
  left: 0;
  right: auto;
  top: calc(100% + 12px);
  z-index: 10000;
  display: block;
  width: min(100%, 330px);
  max-width: 100%;
  padding: 12px;

  border: 1px solid rgba(199, 207, 207, .38);
  border-radius: 16px;

  background: var(--surface-raised);

  box-shadow: var(--panel-shadow), 0 10px 26px rgba(0, 0, 0, .32);

  color: var(--text);
  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 var(--focus);
  outline-offset: 4px;
  border-radius: 6px;
}

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

.water-info-kicker {
  margin-bottom: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;

  color: var(--muted);
}

.water-info-title {
  margin-bottom: 11px;
  font-size: 15px;
  line-height: 1.2;

  font-weight: 700;

  color: var(--gold);
}

.water-info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.water-info-metric {
  min-width: 0;
  display: flex;
  min-height: 48px;
  flex-direction: column;
  justify-content: center;
  padding: 7px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--surface-well);
}

.water-info-metric span {
  margin-bottom: 3px;
  font-size: 10px;
  line-height: 1.25;

  color: var(--muted);
}

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

.water-info-note {
  margin-top: 10px;
  padding: 8px 9px;

  border: 1px solid var(--line);
  border-radius: 10px;

  background: var(--surface-well);

  font-size: 12px;

  line-height: 1.5;

  color: var(--muted);
}

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

.rvu-area-badge:focus-visible {
  border-color: var(--focus);

  box-shadow: none;
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.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(199, 207, 207, .38);
  border-radius: 15px;

  background: var(--surface-raised);

  box-shadow: var(--panel-shadow), 0 10px 26px rgba(0, 0, 0, .32);

  color: var(--text);
  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: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;

  color: var(--gold);
}

.rvu-area-tooltip-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border-radius: 10px;

  background: var(--surface-well);
}

.rvu-area-tooltip-row span {
  font-size: 12px;
  line-height: 1.3;

  color: var(--muted);
}

.rvu-area-tooltip-row strong {
  font-size: 16px;
  line-height: 1.2;

  font-weight: 700;

  color: var(--text);

  white-space: normal;
  overflow-wrap: anywhere;
}

/* 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: var(--surface-raised);

  border: 1px solid rgba(199, 207, 207, .38);
  border-radius: 16px;
  padding: 16px 18px;

  box-shadow: var(--panel-shadow), 0 10px 26px rgba(0, 0, 0, .32);
  z-index: 999999 !important;
  opacity: 0;
  visibility: hidden;

  transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
  font-size: 12.5px;
  line-height: 1.55;

  color: var(--text);

  min-width: min(280px, calc(100vw - 40px));

  max-width: min(320px, calc(100vw - 40px));
  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: var(--muted);
  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: rgba(5, 13, 21, .74);
  backdrop-filter: blur(4px);
}

.contract-dossier-panel {
  position: relative;
  width: min(1080px, 100%);
  max-height: min(860px, calc(100vh - 48px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(199, 207, 207, .36);
  border-radius: 20px;
  background: linear-gradient(180deg, #253640, #172833);
  box-shadow: inset 0 1px 0 rgba(241, 237, 224, .14), 0 24px 60px rgba(0, 0, 0, .52);
  color: var(--text);
  scrollbar-width: thin;
  scrollbar-color: #687b87 #172a35;
}

.contract-dossier-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 28px var(--dossier-gutter) 24px;
  border-bottom: 1px solid rgba(199, 207, 207, .24);
  background: linear-gradient(125deg, #49483f, #2b3c45 75%);
  box-shadow: inset 0 1px 0 rgba(241, 237, 224, .1), 0 1px 0 rgba(0, 0, 0, .24);
}

.contract-dossier-kicker {
  margin-bottom: 9px;
  color: #cfc8ae;
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.contract-dossier-title {
  margin: 0;
  color: #f1e7bf;
  font-size: 28px;
  line-height: 1.2;
  font-weight: 750;
}

.contract-dossier-subtitle {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.contract-dossier-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 25px;
  line-height: 1;
}

.fish-banner-modal {
  position: fixed;
  inset: 0;
  z-index: 2100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.fish-banner-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 13, 21, .74);
  backdrop-filter: blur(4px);
}

.fish-banner-panel {
  position: relative;
  width: min(860px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid rgba(199, 207, 207, .36);
  border-radius: 20px;
  background: linear-gradient(180deg, #2b3f49, #182b36);
  box-shadow: inset 0 1px 0 var(--edge-light), 0 24px 60px rgba(0, 0, 0, .52);
  color: var(--text);
}

.fish-banner-heading {
  padding: 24px 78px 20px 24px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(125deg, #3d484b, #283d49);
}

.fish-banner-kicker {
  margin-bottom: 5px;

  color: var(--muted);
  font-size: 10px;
  line-height: 1.3;
  font-weight: 850;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.fish-banner-heading h2 {
  margin: 0;

  color: #f1e7bf;
  font-size: 24px;
  line-height: 1.16;

  font-weight: 750;
  overflow-wrap: anywhere;
}

.fish-banner-close {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  top: 18px;
  right: 18px;
  z-index: 1;
  width: 44px;
  height: 44px;
  padding: 0;
  border-radius: 12px;
  font: inherit;
  font-size: 25px;
  line-height: 1;
}

.fish-banner-media {
  display: grid;
  place-items: center;
  min-height: 260px;
  padding: 18px;
}

.fish-banner-media img {
  display: block;
  width: 100%;
  max-height: calc(100vh - 170px);
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

.fish-banner-fallback {
  width: min(520px, 100%);
  padding: 22px;

  border: 1px dashed var(--line);
  border-radius: 14px;

  background: var(--surface-well);

  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
  text-align: center;
}

.contract-dossier-status-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.contract-dossier-hero > div {
  min-width: 0;
}

.contract-dossier-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px 24px;
  padding: 18px var(--dossier-gutter);
  border-bottom: 1px solid rgba(183, 202, 214, .16);
  background: linear-gradient(180deg, #2c3d47, #24353f);
  box-shadow: inset 0 1px 0 rgba(232, 241, 246, .035), 0 1px 0 rgba(0, 0, 0, .18);
}

.contract-dossier-navigation {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  gap: 10px;
}

.contract-dossier-toolbar .contract-dossier-status-row {
  padding: 0;
}

.contract-dossier-status,
.contract-dossier-inn {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(199, 207, 207, .18);
  border-radius: 8px;
  background: var(--surface-well);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .2), 0 1px 0 rgba(232, 241, 246, .04);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: .025em;
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

.contract-dossier-status {
  border-color: rgba(168, 190, 141, .22);
  background: #2b4038;
  color: var(--success);
}

.contract-dossier-status--loading {
  border-color: rgba(222, 205, 152, .28);
  background: #413d31;
  color: #e4d6b5;
}

.contract-dossier-status--success {
  border-color: rgba(168, 190, 141, .3);
  background: #2b4038;
  color: var(--success);
}

.contract-dossier-status--error {
  border-color: rgba(207, 167, 99, .4);
  background: #463630;
  color: #ecd0b2;
}

.contract-dossier-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  gap: 16px;
  padding: 22px var(--dossier-gutter) 26px;
}

.contract-dossier-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-panel);
  box-shadow: var(--panel-shadow);
}

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

.contract-dossier-card-title {
  margin-bottom: 14px;
  color: var(--gold);
  font-size: 11px;
  line-height: 1.4;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

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

.contract-dossier-row {
  display: grid;
  grid-template-columns: minmax(118px, 30%) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(183, 202, 214, .12);
  border-radius: 9px;
  background: var(--surface-well);
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, .14), 0 1px 0 rgba(232, 241, 246, .03);
}

.contract-dossier-row span {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.contract-dossier-row strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 600;
  overflow-wrap: anywhere;
  white-space: pre-line;
  font-variant-numeric: tabular-nums;
}

.contract-dossier-footer {
  margin: 0 var(--dossier-gutter) 26px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-well);
  box-shadow: var(--inset-shadow);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}

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

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

  .contract-dossier-hero,
  .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: var(--dossier-gutter);
    margin-right: var(--dossier-gutter);
  }
}

/* === Кроссбраузерный адаптив === */
@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 - 68px)) auto;
    min-height: calc(100vh - 68px);
  }

  .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;
  }

  .topbar-actions {
    justify-content: flex-start;
    order: 3;
    flex-basis: 100%;
    padding: 0;
  }

  .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) {
  .input {
    font-size: 16px;
  }

  .topbar {
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
  }

  .brand {
    flex: 0 0 auto;
  }

  .brand-title {
    white-space: nowrap;
  }

  .topbar-actions {
    flex: 0 0 auto;
    justify-content: flex-end;
    margin-left: auto;
  }

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

  .brand-subtitle {
    display: none;
  }

  .topbar-status {
    display: none;
  }

  .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,
  .subject-summary-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 {
    gap: 12px;
    padding-top: 20px;
    padding-bottom: 20px;
  }

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

@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);
  }
}

/* National coverage: accessible filters, restrained map groups, source cards. */
[hidden] { display: none !important; }
.aqua-marker--auction { background: #73b7ca; border-color: #c1edf5; }
.legend-dot-auction { background: #73b7ca; }
.aqua-marker--selected { outline: 3px solid #fff; outline-offset: 4px; }
.aqua-marker:focus-visible, .aqua-cluster:focus-visible { outline: 3px solid #fff; outline-offset: 4px; }
.aqua-cluster {
  width: 42px; height: 42px; border: 2px solid #e2d69e; border-radius: 50%;
  color: #f8f7e9; background: #243f43; box-shadow: 0 3px 12px #0007;
  transform: translate(-50%, -50%); font: 700 13px Arial, sans-serif; cursor: pointer;
}
.aqua-cluster:hover { background: #3b5d61; }
.map-message {
  position: absolute; top: 16px; left: 16px; right: 16px; z-index: 10;
  padding: 14px 18px; border: 1px solid var(--line); border-radius: 12px;

  background: var(--surface-raised); color: var(--text); font-size: 14px; line-height: 1.5;
  pointer-events: none;
  box-shadow: var(--panel-shadow);
}
.map-message--error { border-color: #b8965d; }
.map-view-summary {
  position: absolute; top: 10px; left: 10px; right: 10px; width: fit-content; max-width: calc(100% - 20px);
  z-index: 5; padding: 7px 10px; border-radius: 9px; background: rgba(14, 26, 32, .9);
  font-size: 11px; line-height: 1.4; pointer-events: none;
  background: rgba(29, 45, 56, .96);
  border: 1px solid var(--line);
}
.map-view-summary:empty { display: none; }
.search-results { margin-top: 18px; }
.search-results-heading { margin-bottom: 9px; font-size: 13px; color: var(--muted); }
.search-results-list {
  display: grid; grid-template-columns: minmax(0, 1fr); grid-auto-rows: max-content;
  align-content: start; gap: 9px; max-height: 400px; overflow: auto; padding: 3px;
  scrollbar-width: thin; scrollbar-color: #61747f transparent;
}
.search-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
  min-width: 0;
  min-height: 44px;
  width: 100%;
  padding: 13px;
  border-radius: 11px;
  text-align: left;
  font: inherit;
  overflow-wrap: anywhere;
}
.search-result strong { font-size: 14px; line-height: 1.4; }
.search-result span { font-size: 13px; line-height: 1.45; }
.search-result small { color: var(--muted); line-height: 1.45; font-size: 12px; }
.search-result .search-result-review { color: #e7c879; }
.search-results-empty, .subject-history-note { color: var(--muted); font-size: 12px; line-height: 1.5; }
.subject-rvu-button > span { min-width: 0; }
.subject-rvu-button small { display: block; margin-top: 5px; color: var(--muted); }
.rvu-review-note { color: #e1cba5; font-size: 13px; line-height: 1.5; }
.rvu-source, .rvu-source-note, .rvu-party { font-size: 12px; line-height: 1.5; overflow-wrap: anywhere; }
.rvu-source-note { color: var(--muted); }
.rvu-source a, .rvu-party a { color: var(--teal); text-underline-offset: 3px; }
.rvu-party-list { display: grid; gap: 10px; }
.rvu-auction-history > summary { margin-bottom: 0; cursor: pointer; }
.rvu-auction-history[open] > summary { margin-bottom: 12px; }
.rvu-auction-list { margin: 0; padding: 2px; list-style: none; max-height: 360px; overflow: auto; }
.rvu-party { padding: 11px; border: 1px solid var(--line); border-radius: 9px; }
.rvu-party-role { margin-bottom: 6px; color: var(--gold); font-size: 11px; }
.rvu-party-button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  max-width: 100%;
  padding: 9px 12px;
  border-radius: 9px;
  font: inherit;
  font-weight: 600;
  text-align: left;
  overflow-wrap: anywhere;
}
.database-stat-note p { line-height: 1.5; }
@media (max-width: 640px) {
  .search-results-list { max-height: 285px; }
  .map-message { left: 10px; right: 10px; top: 10px; padding: 11px; font-size: 12px; }
  .map-view-summary { max-width: calc(100% - 20px); font-size: 10px; }
}
.rvu-card-title, .rvu-card-water, .rvu-contract-subject, .subject-current strong, .contract-dossier-title { overflow-wrap: anywhere; }

.coverage-note { margin: -3px 0 14px; color: var(--muted); font-size: 11px; line-height: 1.5; }

/* Calm public navigation. Evidence stays available on demand. */
.search-options, .about-map, .site-provenance { font-size: 13px; }
.search-options > summary, .about-map > summary, .site-provenance > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 42px;
  padding: 11px 12px;
  border-radius: 10px;
  line-height: 1.4;
  list-style: none;
  font-weight: 600;
}
.search-options[open] > summary, .about-map[open] > summary, .site-provenance[open] > summary { margin-bottom: 10px; }
.about-map .section-title { margin-top: 20px; }
.site-provenance {
  min-width: 0;
  padding-top: 0;
}
.site-provenance > .rvu-info-item { margin-bottom: 12px; }
.search-results:empty { display: none; }
.card-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}
.map-action, .quiet-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 44px;
  max-width: 100%;
  padding: 11px 15px;
  border-radius: 10px;
  font: inherit;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 650;
  text-align: center;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.rvu-card-hero > .map-action { margin-top: 15px; }
.rvu-card-hero > .rvu-card-title { margin: 8px 0 12px; }
.rvu-contract-name { font-size: 17px; line-height: 1.4; color: #f3e6bf; overflow-wrap: anywhere; }
.rvu-contract-card .card-actions { margin-top: 16px; }
.location-note, .subject-meta { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 0; overflow-wrap: anywhere; }
.rvu-card-hero .location-note { margin-top: 14px; }
.subject-rvu-list--short { max-height: none; overflow: visible; }
.subject-rvu-button > strong {
  justify-self: start; max-width: 100%; font-size: 12px; line-height: 1.4;
  white-space: normal; color: var(--teal); text-align: left; font-weight: 600;
}
.subject-rvu-button small { font-weight: 400; font-size: 12px; line-height: 1.5; }
.subject-rvu-button small + small { color: var(--muted); }
.subject-identity, .rvu-contract-inn {
  color: var(--muted); font-size: 12px; line-height: 1.5;
  overflow-wrap: anywhere; font-variant-numeric: tabular-nums;
}
.subject-identity { margin-top: -6px; }
.rvu-contract-inn { margin-top: 8px; }
.subject-identity span, .rvu-contract-inn span { color: var(--text); letter-spacing: .02em; }
.result-action { color: var(--teal); padding-top: 4px; }
.map-selection {
  position: absolute;
  z-index: 6;
  bottom: 28px;
  left: 16px;
  right: 16px;
  width: fit-content;
  max-width: calc(100% - 32px);
  margin: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(199, 207, 207, .38);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--panel-shadow), 0 8px 24px rgba(0, 0, 0, .3);
}
.map-selection > div { min-width: 0; }
.map-selection strong, .map-selection span { display: block; overflow-wrap: anywhere; }
.map-selection strong { font-size: 13px; line-height: 1.4; }
.map-selection span { color: var(--muted); font-size: 11px; margin-top: 4px; line-height: 1.4; }
.map-selection .quiet-action { flex-shrink: 0; }
.map-area:focus, .details:focus, .subject-panel:focus { outline: none; }
.map-area:focus-visible, .details:focus-visible, .subject-panel:focus-visible { outline: 2px solid var(--gold); outline-offset: -2px; }
.dossier-sites {
  margin: 0;
}
@media (max-width: 640px) {
  .map-selection { bottom: 50px; left: 10px; right: 10px; max-width: calc(100% - 20px); gap: 10px; padding: 10px; }
  .map-selection strong { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .map-selection .quiet-action { padding: 10px; font-size: 12px; }
  .card-actions > button { flex-grow: 1; }
}
/* Controls share one material and the same hover, press and focus states. */
:is(.map-action, .quiet-action, .reset-filters-button, .topbar-toggle,
    .subject-rvu-button, .search-result, .database-stat-button,
    .rvu-contract-subject, .rvu-party-button, .contract-dossier-close, .fish-banner-close, summary) {
  --button-top: #3d515e;
  --button-bottom: #2d414f;
  --button-edge: rgba(178, 202, 217, .34);
  --button-ink: #e6eceb;
  --button-inset: inset 0 1px 0 rgba(228, 239, 247, .14);
  --button-foot: #101e28;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
  color: var(--button-ink);
  border: 1px solid var(--button-edge);
  background-color: var(--button-bottom);
  background-image:
    linear-gradient(115deg, rgba(246, 245, 215, .06), transparent 45%),
    linear-gradient(180deg, var(--button-top), var(--button-bottom));
  background-size: 200% 100%, 100% 100%;
  background-position: 100% 0, 0 0;
  box-shadow: var(--button-inset), 0 2px 0 var(--button-foot), 0 4px 9px rgba(0, 0, 0, .18);
  cursor: pointer;
  touch-action: manipulation;
  transition: background-position .2s ease, border-color .16s ease, box-shadow .16s ease, transform .12s ease;
}

.map-action, .quiet-action.dossier-sites {
  --button-top: #aed9d4;
  --button-bottom: #83bab7;
  --button-edge: #bbded8;
  --button-ink: #16353a;
  --button-inset: inset 0 1px 0 rgba(229, 255, 250, .5);
  --button-foot: #3d6d73;
  font-weight: 700;
}

.quiet-action, .rvu-party-button {
  --button-top: #36515a;
  --button-bottom: #2a414d;
  --button-edge: rgba(167, 211, 208, .42);
  --button-ink: #c5e2de;
}

.subject-rvu-button, .search-result, .database-stat-button {
  --button-top: #314550;
  --button-bottom: #253a46;
  --button-edge: rgba(183, 202, 214, .28);
  --button-ink: var(--text);
  --button-inset: inset 0 1px 0 rgba(228, 239, 247, .08);
}

.topbar-toggle {
  --button-top: #334752;
  --button-bottom: #263c49;
  --button-ink: var(--muted);
}

.topbar-toggle.is-active {
  --button-top: #3f6168;
  --button-bottom: #32535d;
  --button-edge: rgba(169, 216, 212, .58);
  --button-ink: #e0f0ed;
  --button-inset: inset 0 1px 0 rgba(228, 239, 247, .18);
}

.subject-rvu-button[aria-current="true"],
.search-result[aria-current="true"] {
  --button-top: #314b55;
  --button-bottom: #29434e;
  --button-edge: #a6ceca;
  --button-inset: inset 3px 0 0 var(--teal), inset 0 1px 0 rgba(228, 239, 247, .14);
}

.subject-rvu-button[aria-current="true"] small,
.search-result[aria-current="true"] small {
  color: #c2ced3;
}

:is(.search-options > summary, .about-map > summary, .site-provenance > summary,
    .rvu-auction-history > summary, .rvu-raw > summary) {
  --button-top: #30444f;
  --button-bottom: #253a46;
  --button-edge: rgba(183, 202, 214, .22);
  --button-ink: var(--muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 42px;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  list-style: none;
}

:is(.search-options, .about-map, .site-provenance, .rvu-auction-history, .rvu-raw) > summary::-webkit-details-marker {
  display: none;
}

:is(.search-options, .about-map, .site-provenance, .rvu-auction-history, .rvu-raw) > summary::after {
  content: "›";
  flex: 0 0 auto;
  font-size: 21px;
  font-weight: 400;
  line-height: 1;
  color: var(--gold);
  transform: rotate(90deg);
  transition: transform .16s ease;
}

:is(.search-options, .about-map, .site-provenance, .rvu-auction-history, .rvu-raw)[open] > summary::after {
  transform: rotate(-90deg);
}

:is(.map-action, .quiet-action, .reset-filters-button, .topbar-toggle,
    .subject-rvu-button, .search-result, .database-stat-button,
    .rvu-contract-subject, .rvu-party-button, .contract-dossier-close, .fish-banner-close, summary):focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

@media (hover: hover) {
  :is(.map-action, .quiet-action, .reset-filters-button, .topbar-toggle,
      .subject-rvu-button, .search-result, .database-stat-button,
      .rvu-contract-subject, .rvu-party-button, .contract-dossier-close, .fish-banner-close, summary):not(:disabled):not([aria-disabled="true"]):hover {
    border-color: #b9d4d6;
    background-position: 0 0, 0 0;
    box-shadow: var(--button-inset), 0 2px 0 var(--button-foot), 0 6px 13px rgba(0, 0, 0, .23);
  }
}

:is(.map-action, .quiet-action, .reset-filters-button, .topbar-toggle,
    .subject-rvu-button, .search-result, .database-stat-button,
    .rvu-contract-subject, .rvu-party-button, .contract-dossier-close, .fish-banner-close, summary):not(:disabled):not([aria-disabled="true"]):active {
  transform: translateY(1px);
  box-shadow: var(--button-inset), inset 0 2px 5px rgba(0, 0, 0, .18), 0 1px 0 var(--button-foot);
}

:is(.map-action, .quiet-action, .reset-filters-button, .topbar-toggle,
    .subject-rvu-button, .search-result, .database-stat-button,
    .rvu-contract-subject, .rvu-party-button, .contract-dossier-close, .fish-banner-close):is(:disabled, [aria-disabled="true"]) {
  cursor: not-allowed;
  opacity: .52;
  box-shadow: inset 0 1px 0 rgba(228, 239, 247, .06);
  transform: none;
}

.input:hover:not(:disabled) {
  border-color: rgba(174, 208, 213, .5);
}

.input:disabled {
  opacity: .55;
  cursor: not-allowed;
}

.input::placeholder {
  color: #a0b1bb;
  opacity: 1;
}

.rvu-party-button:focus-visible, summary:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
}

.subject-rvu-button:focus-visible, .search-result:focus-visible {
  outline-offset: 1px;
}

@media (max-width: 760px) {
  .contract-dossier-toolbar {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
    padding-top: 16px;
    padding-bottom: 16px;
  }

  .contract-dossier-card {
    padding: 14px;
  }

  .contract-dossier-grid {
    gap: 14px;
    padding-top: 18px;
  }
}

@media (max-width: 430px) {
  .contract-dossier-navigation {
    width: 100%;
  }

  .contract-dossier-navigation .dossier-sites {
    width: 100%;
  }

  .contract-dossier-row {
    padding: 10px;
  }

  .contract-dossier-panel {
    --dossier-gutter: 12px;
  }

  .contract-dossier-hero,
  .contract-dossier-grid {
    padding-left: var(--dossier-gutter);
    padding-right: var(--dossier-gutter);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}

.dossier-unavailable { margin-top: 12px; }

/* A document-based location is a reference point, never a verified contour. */
.aqua-marker--reference { background: #162d34; border: 3px dashed #d8c98f; box-shadow: 0 0 0 5px rgba(216,201,143,.18); }
