:root {
  --sidebar-width: 388px;
  --blue: #196fd1;
  --blue-dark: #0d4f9b;
  --blue-soft: #eaf3ff;
  --orange: #e9862f;
  --orange-soft: #fff3e8;
  --water: #2580c7;
  --water-soft: #e9f5ff;
  --text: #18212b;
  --muted: #65717f;
  --line: #e5eaf0;
  --surface: #ffffff;
  --page: #f2f5f8;
  --danger: #c64242;
  --shadow: 0 10px 32px rgba(29, 45, 62, 0.16);
  --small-shadow: 0 3px 12px rgba(29, 45, 62, 0.14);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

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

body {
  background: var(--page);
  color: var(--text);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial,
    sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
label,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

.site-shell {
  display: flex;
  width: 100%;
  height: 100%;
}

.sidebar {
  position: relative;
  z-index: 1000;
  display: flex;
  flex: 0 0 var(--sidebar-width);
  flex-direction: column;
  width: var(--sidebar-width);
  min-width: 0;
  height: 100%;
  overflow: hidden;
  background: var(--surface);
  border-right: 1px solid var(--line);
  box-shadow: 5px 0 24px rgba(30, 46, 62, 0.1);
}

.sidebar-header {
  display: flex;
  align-items: center;
  min-height: 82px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  margin-right: 13px;
  overflow: hidden;
  background: linear-gradient(145deg, #1667c2, #2d91dc);
  border-radius: 13px;
}

.brand-mark span {
  position: absolute;
  left: -4px;
  display: block;
  width: 50px;
  height: 8px;
  border: 2px solid rgba(255, 255, 255, 0.94);
  border-color: rgba(255, 255, 255, 0.94) transparent transparent transparent;
  border-radius: 50%;
}

.brand-mark span:nth-child(1) {
  top: 12px;
}

.brand-mark span:nth-child(2) {
  top: 20px;
  opacity: 0.82;
}

.brand-mark span:nth-child(3) {
  top: 28px;
  opacity: 0.64;
}

.brand-copy {
  min-width: 0;
}

.brand-copy h1 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.2px;
  line-height: 1.25;
}

.brand-copy p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.search-wrap {
  position: relative;
  margin: 16px 18px 12px;
}

.search-wrap > svg {
  position: absolute;
  top: 50%;
  left: 14px;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #798796;
  stroke-linecap: round;
  stroke-width: 1.8;
  transform: translateY(-50%);
  pointer-events: none;
}

.search-wrap input {
  width: 100%;
  height: 44px;
  padding: 0 38px 0 43px;
  color: var(--text);
  background: #f5f7fa;
  border: 1px solid transparent;
  border-radius: 12px;
  outline: none;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}

.search-wrap input::placeholder {
  color: #8c97a4;
}

.search-wrap input:focus {
  background: var(--surface);
  border-color: #8ab8ed;
  box-shadow: 0 0 0 3px rgba(25, 111, 209, 0.1);
}

.search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  display: none;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #7c8895;
  font-size: 21px;
  line-height: 28px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  transform: translateY(-50%);
  cursor: pointer;
}

.search-wrap.has-value .search-clear {
  display: block;
}

.search-clear:hover {
  background: #e8edf2;
}

.summary-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
  padding: 0 18px 15px;
  border-bottom: 1px solid var(--line);
}

.summary-card {
  display: flex;
  align-items: center;
  min-height: 49px;
  padding: 8px 11px;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  border: 1px solid transparent;
  border-radius: 11px;
}

.summary-card.land {
  color: #9d561a;
  background: var(--orange-soft);
  border-color: #f7d5b7;
}

.summary-card.water {
  color: #1a679f;
  background: var(--water-soft);
  border-color: #c7e2f6;
}

.summary-number {
  margin-right: 9px;
  font-size: 20px;
  font-weight: 750;
  line-height: 1;
}

.objects-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #c7ced6 transparent;
  scrollbar-width: thin;
}

.object-group + .object-group {
  border-top: 1px solid var(--line);
}

.group-heading {
  display: flex;
  align-items: center;
  min-height: 51px;
  padding-right: 16px;
  background: #fff;
}

.group-toggle {
  display: flex;
  flex: 1;
  align-items: center;
  align-self: stretch;
  min-width: 0;
  padding: 0 8px 0 18px;
  font-size: 14px;
  font-weight: 700;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.group-toggle:hover {
  background: #f8fafc;
}

.group-caret {
  width: 8px;
  height: 8px;
  margin: -3px 12px 0 2px;
  border-right: 2px solid #6f7b87;
  border-bottom: 2px solid #6f7b87;
  transform: rotate(45deg);
  transition: transform 0.18s ease;
}

.group-toggle[aria-expanded="false"] .group-caret {
  margin-top: 3px;
  transform: rotate(-45deg);
}

.group-count {
  min-width: 27px;
  margin-left: 8px;
  padding: 2px 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  text-align: center;
  background: #edf1f5;
  border-radius: 10px;
}

.visibility-switch {
  position: relative;
  display: inline-flex;
  cursor: pointer;
}

.visibility-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.visibility-switch span {
  position: relative;
  display: block;
  width: 34px;
  height: 20px;
  background: #c7ced6;
  border-radius: 12px;
  transition: background 0.15s ease;
}

.visibility-switch span::after {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.22);
  transition: transform 0.15s ease;
  content: "";
}

.visibility-switch input:checked + span {
  background: var(--blue);
}

.visibility-switch input:checked + span::after {
  transform: translateX(14px);
}

.visibility-switch input:focus-visible + span {
  outline: 3px solid rgba(25, 111, 209, 0.22);
}

.object-list {
  display: block;
}

.object-group.collapsed .object-list {
  display: none;
}

.object-item {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
  min-height: 49px;
  padding: 8px 18px 8px 22px;
  text-align: left;
  background: #fff;
  border: 0;
  border-top: 1px solid #f0f2f5;
  cursor: pointer;
  transition: background 0.12s ease;
}

.object-item:hover {
  background: #f4f8fd;
}

.object-item.active {
  background: var(--blue-soft);
}

.object-item.active::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 3px;
  background: var(--blue);
  content: "";
}

.object-symbol {
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-right: 12px;
  border: 2px solid;
  border-radius: 5px;
}

.object-symbol.land {
  background: rgba(233, 134, 47, 0.24);
  border-color: var(--orange);
}

.object-symbol.water {
  background: rgba(37, 128, 199, 0.22);
  border-color: var(--water);
}

.object-item.approximate .object-symbol {
  border-color: #d24a4a;
  border-style: dashed;
}

.object-name {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
}

.approximation-badge {
  margin-left: 8px;
  padding: 3px 6px;
  color: #a43131;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  background: #fff0f0;
  border-radius: 5px;
}

.object-arrow {
  width: 8px;
  height: 8px;
  margin-left: 12px;
  border-top: 1.5px solid #9aa4ae;
  border-right: 1.5px solid #9aa4ae;
  transform: rotate(45deg);
}

.empty-search {
  margin: 28px 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
  text-align: center;
}

.sidebar-actions {
  flex: 0 0 auto;
  padding: 12px 18px calc(12px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}

.secondary-button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 39px;
  padding: 8px 12px;
  color: #3d4b59;
  font-size: 12px;
  font-weight: 650;
  background: #f5f7fa;
  border: 1px solid #e5e9ee;
  border-radius: 9px;
  cursor: pointer;
}

.secondary-button + .secondary-button {
  margin-top: 7px;
}

.secondary-button:hover {
  color: var(--blue-dark);
  background: #edf4fc;
  border-color: #cfe0f3;
}

.secondary-button svg {
  width: 16px;
  height: 16px;
  margin-right: 8px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.details-panel {
  position: fixed;
  z-index: 1200;
  top: 0;
  bottom: 0;
  left: 0;
  display: flex;
  flex-direction: column;
  width: var(--sidebar-width);
  background: #fff;
  border-right: 1px solid var(--line);
  box-shadow: 5px 0 24px rgba(30, 46, 62, 0.1);
  visibility: hidden;
  opacity: 0;
  transform: translateX(-24px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s;
}

.details-panel.open {
  visibility: visible;
  opacity: 1;
  transform: translateX(0);
  transition-delay: 0s;
}

.details-toolbar {
  display: flex;
  align-items: center;
  min-height: 58px;
  padding: 8px 12px 8px 18px;
  border-bottom: 1px solid var(--line);
}

.details-back {
  flex: 1;
  padding: 8px 6px;
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 650;
  text-align: left;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.details-back span {
  margin-right: 8px;
  font-size: 18px;
}

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  font-size: 24px;
  line-height: 1;
  background: transparent;
  border: 0;
  border-radius: 10px;
  cursor: pointer;
}

.icon-button:hover {
  background: #f0f3f6;
}

.details-content {
  flex: 1;
  min-height: 0;
  padding: 22px 22px 32px;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.details-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  padding: 4px 8px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 750;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--blue-soft);
  border-radius: 6px;
}

.details-content > h2 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.2;
  letter-spacing: -0.35px;
}

.object-description h3 {
  display: none;
}

.object-description table {
  width: 100%;
  overflow: hidden;
  font-size: 12.5px;
  line-height: 1.45;
  border: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line) !important;
  border-radius: 10px;
}

.object-description tr + tr td {
  border-top: 1px solid var(--line);
}

.object-description td {
  display: block;
  width: 100%;
  padding: 7px 10px;
  vertical-align: top;
  border: 0 !important;
}

.object-description td:first-child {
  padding-bottom: 2px;
  color: #687583;
  font-size: 10.5px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  background: #f8fafc;
}

.object-description td:last-child {
  padding-top: 5px;
  background: #fff;
}

.object-description p {
  margin: 14px 0 0;
  color: #4c5966;
  font-size: 12.5px;
  line-height: 1.55;
}

.object-description p[style*="color"] {
  padding: 10px 12px;
  color: #9b3535 !important;
  background: #fff1f1;
  border: 1px solid #f5caca;
  border-radius: 9px;
}

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

#map {
  width: 100%;
  height: 100%;
  background: #dce4eb;
}

.leaflet-container {
  font-family: inherit;
}

.leaflet-control-zoom {
  margin-top: 16px !important;
  margin-right: 16px !important;
  border: 0 !important;
  box-shadow: var(--small-shadow) !important;
}

.leaflet-control-zoom a {
  width: 38px !important;
  height: 38px !important;
  color: #334354 !important;
  font-size: 22px !important;
  line-height: 38px !important;
  border: 0 !important;
}

.leaflet-control-zoom a:first-child {
  border-bottom: 1px solid var(--line) !important;
  border-radius: 10px 10px 0 0 !important;
}

.leaflet-control-zoom a:last-child {
  border-radius: 0 0 10px 10px !important;
}

.leaflet-control-attribution {
  margin: 0 10px 8px 0 !important;
  padding: 3px 7px !important;
  color: #586573;
  font-size: 10px !important;
  background: rgba(255, 255, 255, 0.88) !important;
  border-radius: 6px;
  backdrop-filter: blur(5px);
}

.leaflet-control-attribution a {
  color: #36689d;
}

.leaflet-control-scale {
  margin-right: 12px !important;
  margin-bottom: 38px !important;
}

.leaflet-control-scale-line {
  color: #304150;
  background: rgba(255, 255, 255, 0.72);
  border-color: #596775;
}

.map-tools {
  position: absolute;
  z-index: 800;
  top: 16px;
  right: 72px;
  display: flex;
  gap: 8px;
}

.map-tool-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 40px;
  padding: 0 13px;
  color: #334354;
  font-size: 13px;
  font-weight: 650;
  background: rgba(255, 255, 255, 0.97);
  border: 0;
  border-radius: 10px;
  box-shadow: var(--small-shadow);
  cursor: pointer;
}

.map-tool-button:hover,
.map-tool-button[aria-expanded="true"] {
  color: var(--blue-dark);
  background: #fff;
}

.map-tool-button svg {
  width: 19px;
  height: 19px;
  margin-right: 7px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.map-tool-button.icon-only {
  width: 40px;
  padding: 0;
}

.map-tool-button.icon-only svg {
  margin: 0;
}

.layers-card {
  position: absolute;
  z-index: 850;
  top: 66px;
  right: 72px;
  width: 310px;
  max-height: calc(100% - 92px);
  padding: 0 16px 14px;
  overflow-y: auto;
  background: rgba(255, 255, 255, 0.98);
  border: 1px solid rgba(222, 228, 234, 0.9);
  border-radius: 14px;
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  transform: translateY(-6px) scale(0.98);
  transform-origin: top right;
  transition:
    opacity 0.14s ease,
    transform 0.14s ease,
    visibility 0s linear 0.14s;
}

.layers-card.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0) scale(1);
  transition-delay: 0s;
}

.layers-card-header {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  margin: 0 -16px;
  padding: 14px 10px 12px 16px;
  background: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--line);
}

.layers-card-header > div {
  flex: 1;
}

.layers-card-header strong {
  display: block;
  font-size: 15px;
}

.layers-card-header span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
}

.layer-section {
  margin: 15px 0 0;
  padding: 0;
  border: 0;
}

.layer-section + .layer-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.layer-section legend {
  width: 100%;
  margin-bottom: 7px;
  color: #6d7986;
  font-size: 10px;
  font-weight: 750;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.nspd-section legend {
  display: flex;
  align-items: center;
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  margin-left: 7px;
  background: #d9a335;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(217, 163, 53, 0.14);
}

.status-dot.ok {
  background: #3ca567;
  box-shadow: 0 0 0 3px rgba(60, 165, 103, 0.14);
}

.status-dot.error {
  background: #d34c4c;
  box-shadow: 0 0 0 3px rgba(211, 76, 76, 0.14);
}

.layer-option {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 36px;
  padding: 5px 4px;
  font-size: 13px;
  cursor: pointer;
}

.layer-option:hover {
  color: var(--blue-dark);
}

.layer-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.radio-mark,
.checkbox-mark {
  position: relative;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
  margin-right: 10px;
  background: #fff;
  border: 1.5px solid #a8b1bb;
}

.radio-mark {
  border-radius: 50%;
}

.checkbox-mark {
  border-radius: 5px;
}

.layer-option input:checked + .radio-mark {
  border: 5px solid var(--blue);
}

.layer-option input:checked + .checkbox-mark {
  background: var(--blue);
  border-color: var(--blue);
}

.layer-option input:checked + .checkbox-mark::after {
  position: absolute;
  top: 2px;
  left: 5px;
  width: 4px;
  height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(45deg);
  content: "";
}

.layer-option input:focus-visible + span {
  outline: 3px solid rgba(25, 111, 209, 0.22);
  outline-offset: 2px;
}

.text-button {
  width: 100%;
  margin-top: 13px;
  padding: 9px 10px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 650;
  background: var(--blue-soft);
  border: 0;
  border-radius: 8px;
  cursor: pointer;
}

.text-button:hover {
  background: #dcecff;
}

.toast {
  position: absolute;
  z-index: 900;
  right: 18px;
  bottom: 58px;
  display: flex;
  align-items: flex-start;
  width: min(440px, calc(100% - 36px));
  padding: 13px 42px 13px 13px;
  background: #fff;
  border: 1px solid #f0caca;
  border-radius: 13px;
  box-shadow: var(--shadow);
  visibility: hidden;
  opacity: 0;
  transform: translateY(10px);
  transition:
    opacity 0.18s ease,
    transform 0.18s ease,
    visibility 0s linear 0.18s;
}

.toast.open {
  visibility: visible;
  opacity: 1;
  transform: translateY(0);
  transition-delay: 0s;
}

.toast-icon {
  display: flex;
  flex: 0 0 28px;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  margin-right: 10px;
  color: #fff;
  font-weight: 800;
  background: var(--danger);
  border-radius: 50%;
}

.toast strong {
  display: block;
  margin-top: 1px;
  font-size: 13px;
}

.toast p {
  margin: 4px 0 0;
  color: #64717d;
  font-size: 11.5px;
  line-height: 1.45;
}

.toast p button {
  padding: 0;
  color: var(--blue-dark);
  font-weight: 650;
  background: transparent;
  border: 0;
  cursor: pointer;
}

.toast-close {
  position: absolute;
  top: 6px;
  right: 7px;
  width: 30px;
  height: 30px;
  padding: 0;
  color: #7b8792;
  font-size: 20px;
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.toast-close:hover {
  background: #f3f5f7;
}

.author-copyright {
  position: absolute;
  z-index: 700;
  bottom: 8px;
  left: 12px;
  padding: 4px 8px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 6px;
  box-shadow: 0 1px 4px rgba(30, 45, 60, 0.12);
  backdrop-filter: blur(5px);
}

.author-copyright a {
  color: #3f5f7e;
  text-decoration: none;
}

.author-copyright a:hover {
  text-decoration: underline;
}

.modal-backdrop {
  position: fixed;
  z-index: 3000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(21, 32, 43, 0.56);
  visibility: hidden;
  opacity: 0;
  backdrop-filter: blur(3px);
  transition:
    opacity 0.18s ease,
    visibility 0s linear 0.18s;
}

.modal-backdrop.open {
  visibility: visible;
  opacity: 1;
  transition-delay: 0s;
}

.certificate-modal-card {
  width: min(600px, 100%);
  max-height: calc(100vh - 44px);
  padding: 26px 28px 24px;
  overflow-y: auto;
  background: #fff;
  border-radius: 18px;
  box-shadow: 0 24px 80px rgba(9, 22, 35, 0.32);
  transform: translateY(10px) scale(0.98);
  transition: transform 0.18s ease;
}

.modal-backdrop.open .certificate-modal-card {
  transform: translateY(0) scale(1);
}

.certificate-symbol {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  margin-bottom: 13px;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 14px;
}

.certificate-symbol svg {
  width: 29px;
  height: 29px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.browser-status {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 8px;
  color: #5c6976;
  font-size: 10px;
  font-weight: 700;
  background: #f1f4f7;
  border-radius: 6px;
}

.browser-status.yandex {
  color: #236f47;
  background: #e8f7ef;
}

.certificate-modal-card h2 {
  max-width: 520px;
  margin: 0 0 14px;
  font-size: 23px;
  line-height: 1.25;
  letter-spacing: -0.3px;
}

.certificate-modal-card p {
  margin: 0 0 11px;
  color: #4b5865;
  font-size: 13px;
  line-height: 1.58;
}

.modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 21px;
}

.primary-button,
.link-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 18px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  border-radius: 10px;
  cursor: pointer;
}

.primary-button {
  color: #fff;
  background: var(--blue);
  border: 0;
}

.primary-button:hover {
  background: #1262bd;
}

.link-button {
  color: var(--blue-dark);
  background: #eef5fd;
  border: 1px solid #d6e5f5;
}

.link-button:hover {
  background: #e2effd;
}

.scrim,
.mobile-only,
.mobile-map-header {
  display: none;
}

@media (max-width: 760px) {
  :root {
    --sidebar-width: min(89vw, 358px);
  }

  .mobile-only {
    display: flex;
  }

  .sidebar {
    position: fixed;
    z-index: 1800;
    top: 0;
    bottom: 0;
    left: 0;
    height: 100dvh;
    transform: translateX(-105%);
    transition: transform 0.22s ease;
  }

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

  .sidebar-header {
    min-height: 74px;
    padding: 14px 14px 14px 18px;
  }

  .sidebar-header .icon-button {
    margin-left: auto;
  }

  .brand-mark {
    flex-basis: 39px;
    width: 39px;
    height: 39px;
  }

  .brand-copy h1 {
    font-size: 16px;
  }

  .objects-scroll {
    padding-bottom: env(safe-area-inset-bottom);
  }

  .map-area {
    width: 100%;
    height: 100dvh;
  }

  .mobile-map-header {
    position: absolute;
    z-index: 800;
    top: calc(10px + env(safe-area-inset-top));
    left: 10px;
    align-items: center;
    max-width: calc(100% - 78px);
    min-height: 48px;
    padding: 5px 13px 5px 6px;
    background: rgba(255, 255, 255, 0.97);
    border-radius: 13px;
    box-shadow: var(--small-shadow);
  }

  .menu-button {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 39px;
    margin-right: 5px;
  }

  .menu-button span {
    display: block;
    width: 18px;
    height: 2px;
    background: #3c4a58;
    border-radius: 2px;
  }

  .mobile-map-header strong,
  .mobile-map-header > div > span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-map-header strong {
    font-size: 13px;
  }

  .mobile-map-header > div > span {
    margin-top: 2px;
    color: var(--muted);
    font-size: 10px;
  }

  .scrim {
    position: fixed;
    z-index: 1700;
    inset: 0;
    display: block;
    background: rgba(17, 28, 39, 0.44);
    visibility: hidden;
    opacity: 0;
    transition:
      opacity 0.2s ease,
      visibility 0s linear 0.2s;
  }

  .scrim.open {
    visibility: visible;
    opacity: 1;
    transition-delay: 0s;
  }

  .leaflet-control-zoom {
    display: none;
  }

  .map-tools {
    top: calc(12px + env(safe-area-inset-top));
    right: 12px;
  }

  .map-tool-button:not(.icon-only) {
    width: 44px;
    padding: 0;
  }

  .map-tool-button:not(.icon-only) span {
    display: none;
  }

  .map-tool-button:not(.icon-only) svg {
    margin: 0;
  }

  .map-tool-button.icon-only {
    display: none;
  }

  .layers-card {
    top: auto;
    right: 10px;
    bottom: calc(52px + env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-height: min(68vh, 590px);
    transform: translateY(10px) scale(0.99);
    transform-origin: bottom center;
  }

  .layers-card.open {
    transform: translateY(0) scale(1);
  }

  .leaflet-control-attribution {
    max-width: calc(100vw - 104px);
    margin-right: 6px !important;
    margin-bottom: calc(6px + env(safe-area-inset-bottom)) !important;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .leaflet-control-scale {
    display: none;
  }

  .author-copyright {
    bottom: calc(7px + env(safe-area-inset-bottom));
    left: 7px;
    max-width: 98px;
    overflow: hidden;
    font-size: 9px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .toast {
    right: 10px;
    bottom: calc(51px + env(safe-area-inset-bottom));
    width: calc(100% - 20px);
  }

  .details-panel {
    position: fixed;
    z-index: 2000;
    top: auto;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom));
    left: 8px;
    width: auto;
    height: min(68dvh, 600px);
    max-height: calc(100dvh - 24px - env(safe-area-inset-top));
    border-radius: 17px;
    box-shadow: 0 18px 65px rgba(18, 31, 43, 0.28);
    transform: translateY(110%);
    transition:
      transform 0.22s ease,
      visibility 0s linear 0.22s;
  }

  .details-panel.open {
    transform: translateY(0);
    transition-delay: 0s;
  }

  .details-toolbar {
    min-height: 52px;
  }

  .details-content {
    padding: 18px 18px 27px;
  }

  .details-content > h2 {
    font-size: 21px;
  }

  .certificate-modal-card {
    padding: 22px 20px 19px;
    border-radius: 16px;
  }

  .certificate-modal-card h2 {
    font-size: 20px;
  }

  .modal-actions {
    flex-direction: column;
  }

  .primary-button,
  .link-button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .summary-row {
    gap: 7px;
  }

  .summary-card {
    padding: 7px 8px;
    font-size: 11px;
  }

  .summary-number {
    margin-right: 6px;
    font-size: 18px;
  }
}

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