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

[hidden] {
  display: none !important;
}

body {
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  overflow: hidden;
}

#map {
  width: 100%;
}

.mobile-header {
  display: none;
}

.top-left-controls,
.top-right-controls {
  position: absolute;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-left-controls {
  top: 20px;
  left: 20px;
}

.top-right-controls {
  top: 18px;
  right: 20px;
  transition: right 0.18s ease;
}

body.plot-open .top-right-controls {
  right: 380px;
}

.round-control,
.logo-control {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #30343b;
  background: rgba(238, 242, 244, 0.9);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
  cursor: pointer;
  font-size: 28px;
  line-height: 1;
  text-decoration: none;
}

.logo-control {
  background: #d6ffbf url("/assets/logo.svg") center / 34px 34px no-repeat;
}

.site-menu {
  position: absolute;
  z-index: 3;
  top: 74px;
  left: 0;
  width: 292px;
  max-height: calc(100vh - 74px);
  box-sizing: border-box;
  padding: 58px 22px 16px;
  overflow: auto;
  background: #fff;
  box-shadow: 4px 0 16px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease;
}

.site-menu.is-closed {
  transform: translateX(-312px);
}

.site-menu a {
  min-height: 38px;
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  color: #111;
  font-size: 15px;
  line-height: 1.25;
  text-decoration: none;
}

.site-menu a::before {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
  color: #111;
  content: "";
  background: center / contain no-repeat;
  font-size: 22px;
}

.site-menu a:nth-child(1)::before { background-image: url("/assets/ico_what_is.svg"); }
.site-menu a:nth-child(2)::before { background-image: url("/assets/ico_fight.svg"); }
.site-menu a:nth-child(3)::before { background-image: url("/assets/ico_forefinger.svg"); }
.site-menu a:nth-child(4)::before { background-image: url("/assets/ico_map_w.svg"); filter: invert(1); }
.site-menu a:nth-child(5)::before { background-image: url("/assets/ico_safety.svg"); }
.site-menu a:nth-child(6)::before { background-image: url("/assets/ico_admin.svg"); }
.site-menu a:nth-child(7)::before { background-image: url("/assets/ico_book.svg"); }
.site-menu a:nth-child(8)::before { background-image: url("/assets/ico_faq.svg"); }
.site-menu a:nth-child(9)::before { background-image: url("/assets/ico_sposob.svg"); }
.site-menu a:nth-child(10)::before { background-image: url("/assets/ico_about.svg"); }
.site-menu a:nth-child(11)::before { background-image: url("/assets/ico_region_3.svg"); }

.site-menu .menu-donate {
  justify-content: flex-start;
  margin-top: 20px;
  padding: 8px 12px;
  background: #d9ffd8;
  border-radius: 5px;
}

.site-menu .menu-donate::before {
  background-image: url("/assets/ico_sbor.svg");
}

.social-row {
  display: flex;
  justify-content: center;
  gap: 14px;
  margin: 22px 0;
  color: #1976d2;
  font-size: 13px;
  font-weight: 700;
}

.social-row span {
  width: 20px;
  height: 20px;
  overflow: hidden;
  color: transparent;
  background: center / contain no-repeat;
}

.social-row span:nth-child(1) { background-image: url("/assets/vk.svg"); }
.social-row span:nth-child(2) { background-image: url("/assets/tik-tok.svg"); }
.social-row span:nth-child(3) { background-image: url("/assets/telegram.svg"); }
.social-row span:nth-child(4) { background-image: url("/assets/youtube.svg"); }
.social-row span:nth-child(5) { background-image: url("/assets/ok.svg"); }

.site-menu small {
  display: block;
  color: #888;
  text-align: center;
}

.base-menu,
.map-tools {
  position: absolute;
  z-index: 4;
  top: 66px;
  right: 18px;
  width: 156px;
  transition: right 0.18s ease;
}

body.plot-open .base-menu,
body.plot-open .map-tools {
  right: 382px;
}

.base-menu {
  top: 66px;
}

.map-tools {
  top: 66px;
  width: 156px;
}

.map-popup {
  display: none;
}

.map-popup.is-open {
  display: block;
}

.maplibregl-popup-content {
  max-width: min(360px, calc(100vw - 28px));
  max-height: min(520px, calc(100vh - 112px));
  overflow: auto;
  border-radius: 8px;
  font: 14px/1.35 Arial, sans-serif;
}

.map-popup-card {
  display: grid;
  gap: 6px;
  width: min(300px, calc(100vw - 58px));
  max-height: min(490px, calc(100vh - 142px));
  overflow: auto;
  overflow-wrap: anywhere;
  word-break: normal;
}

.map-popup-card strong {
  font-size: 15px;
}

.map-popup-card a {
  color: #276900;
  font-weight: 700;
}

.popup-legend {
  display: flex;
  align-items: center;
  gap: 7px;
  color: #555;
}

.popup-legend span {
  width: 18px;
  height: 10px;
  border: 2px solid rgba(94, 94, 94, 0.75);
  background: rgba(94, 94, 94, 0.16);
}

.popup-legend.inat span {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 50%;
  background: #6f43d6;
}

.cadastre-panel {
  position: absolute;
  z-index: 6;
  top: 86px;
  right: 20px;
  width: min(360px, calc(100vw - 40px));
  max-height: calc(100vh - 132px);
  box-sizing: border-box;
  padding: 14px 16px 16px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 8px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.24);
}

.cadastre-panel-close {
  position: absolute;
  top: 6px;
  right: 8px;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}

.cadastre-panel .map-popup-card {
  width: auto;
  max-width: none;
  max-height: none;
  overflow: visible;
}

.plot-choice {
  display: grid;
  gap: 6px;
  min-width: 150px;
}

.plot-choice button {
  min-height: 30px;
  padding: 5px 8px;
  text-align: left;
  background: #eef8e8;
  border: 0;
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}

.tool-group {
  display: grid;
  overflow: hidden;
  margin-bottom: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 5px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
}

.tool-group button {
  min-height: 45px;
  display: grid;
  grid-template-columns: 24px 1fr 22px;
  align-items: center;
  gap: 6px;
  padding: 7px 6px 7px 10px;
  color: #222;
  font: inherit;
  font-size: 14px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

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

.tool-group button.active {
  color: #082100;
  font-weight: 400;
  background: #fff;
}

.base-menu .tool-group button {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 7px;
  align-items: center;
  min-height: 34px;
  padding: 8px 11px;
}

.base-menu .tool-group button::before,
.external-links a::before {
  width: 18px;
  height: 18px;
  display: block;
  content: "";
  background: center / contain no-repeat;
}

.base-menu [data-base="google"]::before { background-image: url("/assets/logo.svg"); }
.base-menu [data-base="bing"]::before { background: #6a8fbd; border-radius: 50%; }
.base-menu [data-base="esri"]::before { background: #7a9b77; border-radius: 50%; }
.base-menu [data-base="mapbox"]::before { background: #777; border-radius: 50%; }
.base-menu [data-base="osm"]::before { background: #6aad62; border-radius: 50%; }
.base-menu [data-base="outdoor"]::before { background: #a3a05e; border-radius: 50%; }

.base-menu .tool-group button.active {
  color: #082100;
  font-weight: 700;
  background: #9adf6b;
}

.checkmark {
  width: 19px;
  height: 19px;
  display: inline-block;
  box-sizing: border-box;
  background: #f6f6f6;
  border: 2px solid #d7d7d7;
  border-radius: 2px;
}

.tool-group button.active .checkmark {
  background: #fff;
  border-color: #d7d7d7;
  position: relative;
}

.tool-group button.active .checkmark::after {
  position: absolute;
  left: 4px;
  top: -2px;
  color: #0a9f18;
  content: "✓";
  font-size: 24px;
  font-weight: 700;
  line-height: 1;
}

.tool-group i {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  color: #555;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
  font-size: 14px;
  font-style: normal;
}

.external-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  padding: 8px 4px 3px;
  background: rgba(255, 255, 255, 0.92);
  border-top: 1px solid rgba(0, 0, 0, 0.08);
}

.external-links a {
  display: grid;
  gap: 4px;
  justify-items: center;
  color: #222;
  font-size: 10px;
  text-decoration: none;
}

.external-links a::before {
  opacity: 0.55;
}

.external-links [data-external="nspd"]::before { background-image: url("/assets/rr.svg"); }
.external-links [data-external="rgis"]::before { background-image: url("/assets/rgis.svg"); }
.external-links [data-external="yandex"]::before { background: #777; border-radius: 50%; }
.external-links [data-external="wiki"]::before { background-image: url("/assets/wikimapia.svg"); }

.search-panel {
  position: absolute;
  z-index: 4;
  top: 20px;
  left: 126px;
  width: min(420px, calc(100vw - 370px));
}

.search-form {
  display: grid;
  grid-template-columns: 1fr 76px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 21px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
}

.search-form input,
.search-form button {
  min-width: 0;
  height: 42px;
  box-sizing: border-box;
  border: 0;
  font: inherit;
  font-size: 15px;
}

.search-form input {
  padding: 0 16px;
  background: transparent;
  outline: none;
}

.search-form button {
  color: #123400;
  background: #9adf6b;
  cursor: pointer;
}

.search-results {
  overflow: hidden;
  margin-top: 8px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 7px;
  box-shadow: 0 1px 8px rgba(0, 0, 0, 0.24);
}

.search-results button {
  width: 100%;
  display: grid;
  gap: 3px;
  padding: 9px 12px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  cursor: pointer;
}

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

.search-results strong {
  font-size: 14px;
}

.search-results span,
.search-empty,
.muted {
  color: #666;
  font-size: 12px;
}

.search-empty {
  padding: 11px 12px;
}

.add-plot {
  position: absolute;
  z-index: 4;
  left: auto;
  right: 72px;
  bottom: 34px;
  height: 40px;
  padding: 0 18px;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 16px;
  transform: none;
  transition: right 0.18s ease, transform 0.18s ease;
}

.report-button {
  position: absolute;
  z-index: 4;
  right: 262px;
  bottom: 34px;
  height: 40px;
  padding: 0 18px;
  color: #333;
  background: rgba(255, 255, 255, 0.9);
  border: 0;
  border-radius: 20px;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.22);
  font: inherit;
  font-size: 16px;
  cursor: pointer;
  transition: right 0.18s ease;
}

body.plot-open .report-button {
  right: 702px;
}

.report-panel {
  position: absolute;
  z-index: 5;
  right: 20px;
  bottom: 86px;
  width: 340px;
  max-height: min(620px, calc(100vh - 130px));
  box-sizing: border-box;
  padding: 18px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border-radius: 7px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.24);
}

.report-panel.is-closed {
  display: none;
}

.report-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 26px;
  cursor: pointer;
}

.report-panel h2 {
  margin: 0 32px 14px 0;
  font-size: 20px;
}

.report-panel h3 {
  margin: 16px 0 8px;
  font-size: 14px;
}

.report-actions button {
  width: 100%;
  height: 34px;
  color: #123400;
  background: #9adf6b;
  border: 0;
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}

.report-actions {
  display: grid;
  gap: 8px;
}

.export-report {
  width: 100%;
  height: 34px;
  margin: 0 0 12px;
  color: #123400;
  background: #9adf6b;
  border: 0;
  border-radius: 5px;
  font: inherit;
  cursor: pointer;
}

.report-status {
  margin-top: 12px;
  color: #333;
  font-size: 14px;
}

.report-summary {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 7px 12px;
  margin: 14px 0 0;
  font-size: 13px;
}

.report-summary dt {
  color: #555;
}

.report-summary dd {
  margin: 0;
  font-weight: 700;
}

.report-content ul {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.report-content li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
}

.report-items {
  display: grid;
  gap: 6px;
}

.report-items button {
  display: grid;
  gap: 3px;
  padding: 7px 8px;
  color: #222;
  background: #f3f3f3;
  border: 0;
  border-radius: 5px;
  text-align: left;
  cursor: pointer;
}

.report-items span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-items b {
  font-size: 12px;
}

body.plot-open .add-plot {
  left: auto;
  right: 462px;
  transform: none;
}

.drawing-message {
  position: absolute;
  z-index: 6;
  right: 0;
  bottom: 0;
  left: 0;
  box-sizing: border-box;
  padding: 10px 18px;
  color: #111;
  background: #ffea84;
  font-size: 14px;
  text-align: center;
}

.drawing-message button {
  margin-left: 16px;
  padding: 3px 10px;
  color: #111;
  background: rgba(0, 0, 0, 0.12);
  border: 0;
  border-radius: 3px;
  font: inherit;
  cursor: pointer;
}

body.drawing-mode .add-plot,
body.drawing-mode .maplibregl-ctrl-bottom-left,
body.drawing-mode .maplibregl-ctrl-bottom-right {
  display: none;
}

.draw-vertex {
  width: 14px;
  height: 14px;
  box-sizing: border-box;
  background: #fff;
  border: 3px solid #ff9d00;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  cursor: grab;
}

.draw-vertex.is-first {
  width: 18px;
  height: 18px;
  border-color: #fff;
  background: #ff9d00;
}

.draw-vertex:active {
  cursor: grabbing;
}

.plot-form {
  position: absolute;
  z-index: 5;
  top: 0;
  right: 0;
  width: 430px;
  height: 100%;
  box-sizing: border-box;
  padding: 46px 26px 18px 20px;
  overflow: auto;
  background: #fff;
  box-shadow: -4px 0 16px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease;
}

.plot-form.is-closed {
  transform: translateX(455px);
}

.plot-close {
  position: absolute;
  top: 44px;
  right: 20px;
  padding: 0;
  color: #777;
  background: transparent;
  border: 0;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.plot-form h1 {
  margin: 0 36px 18px 0;
  color: #000;
  font-size: 24px;
  line-height: 1.1;
}

.plot-location {
  margin-bottom: 8px;
  color: #000;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
}

.plot-location span {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 400;
}

.plot-location input {
  width: 100%;
  box-sizing: border-box;
  padding: 8px 10px;
  background: #f7f7f7;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-weight: 700;
}

.plot-location input:focus,
#plotDescription:focus,
.percent-row input:focus {
  outline: 2px solid #222;
}

.plot-location input.is-readonly,
#plotDescription.is-readonly,
.percent-row input.is-readonly {
  cursor: pointer;
}

.plot-meta {
  margin-bottom: 14px;
  color: #707b85;
  font-size: 12px;
  line-height: 1.45;
}

.plot-status {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.plot-status button {
  min-height: 50px;
  padding: 7px 6px;
  color: #666;
  background: #fff;
  border: 2px solid #d2e7ce;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  line-height: 1.1;
}

.plot-status button[data-status="1"] {
  border-color: #ffaaa5;
}

.plot-status button.active {
  color: #000;
  background: #fff12d;
  border-color: #fff12d;
}

.percent-row {
  display: grid;
  grid-template-columns: 1fr 84px;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: #000;
  font-size: 16px;
  line-height: 1.1;
}

.percent-row input {
  width: 84px;
  height: 36px;
  box-sizing: border-box;
  color: #222;
  background: #e9e9e9;
  border: 0;
  border-radius: 5px;
  font: inherit;
  text-align: center;
}

#plotDescription {
  width: 100%;
  height: clamp(220px, calc(100vh - 610px), 360px);
  box-sizing: border-box;
  margin-bottom: 10px;
  padding: 12px;
  resize: none;
  color: #333;
  background: #e9e9e9;
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-size: 16px;
}

.plot-edit-actions {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin: -2px 0 10px;
}

.plot-edit-actions button {
  min-height: 32px;
  padding: 0 10px;
  background: #eee;
  border: 0;
  border-radius: 4px;
  color: #222;
  font: inherit;
  font-size: 14px;
  cursor: pointer;
}

.plot-edit-actions .delete-plot {
  color: #8a1c1c;
  background: #f7e9e9;
}

.plot-numbers {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 4px 12px;
  margin: 0 0 10px;
  font-size: 16px;
}

.plot-numbers dt {
  color: #000;
}

.plot-numbers dd {
  margin: 0;
  color: #99a0a7;
  line-height: 1.35;
}

.plot-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.plot-actions button {
  min-width: 99px;
  height: 31px;
  padding: 0 14px;
  background: #eee;
  border: 0;
  border-radius: 4px;
  font: inherit;
  font-size: 15px;
}

.plot-social {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.plot-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  margin-bottom: 10px;
}

.plot-tabs button,
.comment-form button,
.photo-form button,
.auth-actions button,
.logout-button,
.new-topic-toggle,
.topic-form button,
.forum-reply button,
.forum-login-note button,
.forum-message button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: #eee;
  font: inherit;
  cursor: pointer;
}

.plot-tabs button.active,
.comment-form button,
.photo-form button,
.auth-actions button.primary,
.new-topic-toggle,
.topic-form button,
.forum-reply button,
.forum-login-note button,
.forum-message button {
  color: #123400;
  background: #9adf6b;
}

.plot-comments,
.plot-photos,
.plot-events {
  display: grid;
  gap: 8px;
  margin-bottom: 10px;
}

.comment-item,
.event-item,
.forum-topic-item,
.forum-post {
  padding: 8px;
  background: #f4f4f4;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.35;
}

.comment-item b,
.event-item b,
.forum-topic-item b,
.forum-post b {
  display: block;
  margin-bottom: 3px;
}

.comment-form,
.photo-form,
.topic-form,
.forum-reply {
  display: grid;
  gap: 8px;
}

.comment-form textarea,
.photo-form input,
.auth-form input,
.topic-form input,
.topic-form textarea,
.topic-form select,
.forum-reply textarea {
  width: 100%;
  box-sizing: border-box;
  padding: 8px;
  border: 1px solid #ddd;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
}

.plot-photos {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.photo-item {
  display: grid;
  gap: 4px;
  font-size: 12px;
}

.photo-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 6px;
}

.auth-panel,
.forum-panel {
  position: absolute;
  top: 82px;
  right: 20px;
  width: 360px;
  max-height: calc(100vh - 110px);
  box-sizing: border-box;
  padding: 18px;
  overflow: auto;
  background: rgba(255, 255, 255, 0.97);
  border-radius: 7px;
  box-shadow: 0 2px 14px rgba(0, 0, 0, 0.24);
}

.auth-panel {
  z-index: 20;
}

.forum-panel {
  z-index: 6;
}

.auth-panel.is-closed,
.forum-panel.is-closed {
  display: none;
}

.auth-close,
.forum-close {
  position: absolute;
  top: 8px;
  right: 10px;
  border: 0;
  background: transparent;
  color: #555;
  font-size: 26px;
  cursor: pointer;
}

.auth-panel h2,
.forum-panel h2 {
  margin: 0 32px 14px 0;
  font-size: 20px;
}

.auth-form,
.auth-actions,
.forum-auth,
.forum-categories,
.forum-topics,
.forum-topic {
  display: grid;
  gap: 8px;
}

.auth-current,
.auth-message,
.forum-auth {
  margin-bottom: 10px;
  color: #555;
  font-size: 13px;
}

.forum-auth {
  grid-template-columns: 1fr 1fr;
  align-items: center;
}

.forum-auth button {
  min-height: 32px;
  border: 0;
  border-radius: 5px;
  background: #eee;
  font: inherit;
  cursor: pointer;
}

.forum-auth [data-forum-auth="register"] {
  color: #123400;
  background: #9adf6b;
}

.forum-auth [data-forum-logout] {
  justify-self: end;
  min-width: 78px;
  padding: 0 12px;
  color: #333;
  background: #eee;
}

.forum-category,
.forum-topic-item {
  width: 100%;
  text-align: left;
  border: 0;
  cursor: pointer;
}

.forum-category {
  padding: 7px 9px;
  border-radius: 5px;
  background: #eaf8e0;
  font: inherit;
}

.forum-category.active {
  background: #9adf6b;
}

.new-topic-toggle {
  width: 100%;
  margin: 8px 0;
}

.forum-message,
.forum-login-note {
  color: #555;
  font-size: 13px;
  line-height: 1.35;
}

.forum-message button,
.forum-login-note button {
  min-height: 26px;
  margin-left: 6px;
  padding: 0 9px;
}

.forum-topic-header {
  display: grid;
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 8px;
}

.forum-topic-header h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.forum-back {
  padding: 4px 8px;
  background: #eee;
  border: 0;
  border-radius: 5px;
  font: inherit;
  font-size: 13px;
  cursor: pointer;
}

.plot-actions .save {
  color: #fff;
  background: #1d7100;
}

.save-state {
  flex: 1 1 auto;
  color: #666;
  font-size: 13px;
  text-align: right;
}

.maplibregl-ctrl-bottom-right {
  right: 18px;
  bottom: 84px;
  transition: right 0.18s ease;
}

body.plot-open .maplibregl-ctrl-bottom-right {
  right: 382px;
}

.maplibregl-ctrl-group {
  border-radius: 20px;
  overflow: hidden;
}

.locate-control {
  border-radius: 50%;
}

.custom-geolocate {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  padding: 0;
  background: #fff;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}

.custom-geolocate::before,
.custom-geolocate::after {
  content: "";
  position: absolute;
  box-sizing: border-box;
}

.custom-geolocate::before {
  width: 22px;
  height: 22px;
  border: 3px solid #333;
  border-radius: 50%;
}

.custom-geolocate::after {
  width: 32px;
  height: 32px;
  border: solid #333;
  border-width: 3px 0 0 3px;
  transform: rotate(45deg);
}

.custom-geolocate.is-loading {
  opacity: 0.55;
}

.custom-geolocate.is-error {
  background: #ffe3e3;
}

.maplibregl-ctrl-attrib {
  position: fixed !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 3 !important;
  max-width: none !important;
  margin: 0 !important;
  background: rgba(255, 255, 255, 0.72) !important;
  border-radius: 0 !important;
}

@media (max-width: 900px) {
  .site-menu {
    display: none;
  }

  .top-right-controls {
    right: 14px;
  }

  .plot-form {
    width: 330px;
  }

  .map-tools,
  .base-menu,
  .maplibregl-ctrl-bottom-right {
    right: 12px;
  }

  .maplibregl-ctrl-bottom-right {
    bottom: 96px;
  }

  .add-plot {
    left: auto;
    right: 68px;
    bottom: 52px;
    height: 38px;
    transform: none;
  }

  .report-button {
    right: 248px;
    bottom: 52px;
    height: 38px;
  }

  .search-panel {
    left: 126px;
    width: min(340px, calc(100vw - 300px));
  }

  .maplibregl-ctrl-attrib {
    margin-bottom: 0;
    max-width: calc(100vw - 14px);
  }
}

@media (max-width: 520px) {
  :root {
    --mobile-header-height: 68px;
  }

  #map {
    position: absolute;
    top: var(--mobile-header-height);
    right: 0;
    bottom: 0;
    left: 0;
    height: auto;
  }

  .mobile-header {
    position: absolute;
    z-index: 4;
    top: 0;
    right: 0;
    left: 0;
    height: var(--mobile-header-height);
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 0 14px 0 62px;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  }

  .mobile-logo {
    width: 34px;
    height: 44px;
    flex: 0 0 auto;
    background: url("/assets/logo.svg") center / contain no-repeat;
  }

  .mobile-header strong {
    min-width: 0;
    flex: 1 1 auto;
    overflow: hidden;
    color: #161616;
    font-size: 19px;
    line-height: 1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-account {
    width: 38px;
    height: 38px;
    flex: 0 0 auto;
    border-radius: 50%;
    background: #eeeeee;
    position: relative;
  }

  .mobile-account::before,
  .mobile-account::after {
    position: absolute;
    left: 50%;
    content: "";
    transform: translateX(-50%);
    border: 2px solid #555;
  }

  .mobile-account::before {
    top: 10px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
  }

  .mobile-account::after {
    bottom: 9px;
    width: 20px;
    height: 11px;
    border-radius: 18px 18px 4px 4px;
    border-bottom: 0;
  }

  .site-menu {
    display: block;
    top: var(--mobile-header-height);
    width: min(272px, 82vw);
    max-height: calc(100vh - var(--mobile-header-height));
    padding: 18px 18px 14px;
  }

  .site-menu.is-closed {
    transform: translateX(calc(-100% - 12px));
  }

  .site-menu a {
    min-height: 34px;
    gap: 12px;
    margin-bottom: 9px;
    font-size: 14px;
  }

  .site-menu a::before {
    width: 26px;
    height: 26px;
  }

  .site-menu .menu-donate {
    display: none;
  }

  .social-row {
    margin: 14px 0;
  }

  .top-left-controls {
    top: 0;
    left: 0;
    width: 56px;
    height: var(--mobile-header-height);
    justify-content: center;
  }

  .top-right-controls {
    top: calc(var(--mobile-header-height) + 10px);
    right: 12px;
    left: auto;
    gap: 8px;
  }

  body.plot-open .top-right-controls {
    right: 12px;
  }

  .round-control,
  .logo-control {
    width: 38px;
    height: 38px;
    font-size: 23px;
  }

  .menu-toggle {
    width: 42px;
    height: 42px;
    color: #555;
    background: transparent;
    border-radius: 0;
    box-shadow: none;
    font-size: 36px;
    font-weight: 300;
  }

  .logo-control {
    display: none;
  }

  .base-menu,
  .map-tools,
  body.plot-open .base-menu,
  body.plot-open .map-tools {
    top: calc(var(--mobile-header-height) + 56px);
    right: 10px;
    width: 142px;
  }

  .search-panel {
    top: calc(var(--mobile-header-height) + 10px);
    left: 66px;
    width: calc(100vw - 236px);
  }

  .search-form {
    grid-template-columns: minmax(0, 1fr) 44px;
    border-radius: 18px;
  }

  .search-form input,
  .search-form button {
    height: 36px;
    font-size: 12px;
  }

  .search-form input {
    padding: 0 11px;
  }

  .search-form button {
    font-size: 12px;
  }

  .search-results {
    max-height: 42vh;
    overflow: auto;
  }

  .add-plot {
    left: 50%;
    right: auto;
    bottom: 42px;
    max-width: 182px;
    height: 34px;
    padding: 0 14px;
    border-radius: 17px;
    font-size: 14px;
    transform: translateX(-50%);
    white-space: nowrap;
  }

  body.plot-open .add-plot {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
  }

  .report-button {
    left: 12px;
    right: auto;
    bottom: 42px;
    width: 74px;
    height: 34px;
    padding: 0;
    font-size: 13px;
  }

  body.plot-open .report-button {
    right: auto;
  }

  .report-panel {
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 54vh;
    border-radius: 10px 10px 0 0;
  }

  .cadastre-panel {
    top: auto;
    right: 8px;
    bottom: 84px;
    left: 8px;
    width: auto;
    max-height: min(38vh, 320px);
    padding: 12px 14px 14px;
    border-radius: 10px;
    font-size: 12px;
  }

  .cadastre-panel .map-popup-card {
    gap: 5px;
  }

  .maplibregl-ctrl-bottom-right {
    right: 24px;
    bottom: 86px;
  }

  body.plot-open .maplibregl-ctrl-bottom-right {
    right: 24px;
  }

  .maplibregl-ctrl-bottom-left {
    bottom: 12px;
    left: 12px;
  }

  .maplibregl-ctrl-scale {
    height: 22px;
    min-width: 58px;
    box-sizing: border-box;
    padding: 2px 6px;
    color: #222;
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid rgba(0, 0, 0, 0.22);
    font-size: 12px;
    line-height: 16px;
  }

  .maplibregl-ctrl-attrib {
    right: 12px !important;
    bottom: 10px !important;
    left: auto !important;
    z-index: 3 !important;
    width: 34px !important;
    height: 34px !important;
    max-width: 34px !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    background: rgba(255, 255, 255, 0.9) !important;
    border-radius: 50% !important;
    font-size: 0 !important;
    line-height: 0 !important;
    padding: 0 !important;
    display: grid !important;
    place-items: center !important;
  }

  .maplibregl-ctrl-attrib a,
  .maplibregl-ctrl-attrib span,
  .maplibregl-ctrl-attrib details,
  .maplibregl-ctrl-attrib summary,
  .maplibregl-ctrl-attrib-button,
  .maplibregl-ctrl-attrib-inner {
    display: none !important;
  }

  .maplibregl-ctrl-attrib::after {
    content: "i";
    width: 22px;
    height: 22px;
    display: grid;
    place-items: center;
    color: #000;
    background: #fff;
    border: 3px solid #000;
    border-radius: 50%;
    font-size: 19px;
    font-family: Arial, Helvetica, sans-serif;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
  }

  .plot-form {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100%;
    height: min(35vh, 310px);
    padding: 24px 12px 10px;
    border-radius: 10px 10px 0 0;
    transform: translateY(0);
  }

  .plot-form.is-closed {
    transform: translateY(105%);
  }

  .plot-close {
    top: 3px;
    right: 10px;
    font-size: 24px;
  }

  .plot-form h1 {
    margin: 0 32px 8px 0;
    font-size: 16px;
  }

  .plot-status {
    gap: 5px;
    margin-bottom: 8px;
  }

  .plot-status button {
    min-height: 32px;
    padding: 3px 4px;
    font-size: 10px;
  }

  .percent-row {
    grid-template-columns: 1fr 64px;
    gap: 8px;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .percent-row input {
    width: 64px;
    height: 28px;
  }

  .plot-location {
    margin-bottom: 6px;
    font-size: 12px;
  }

  .plot-location span {
    margin-bottom: 4px;
    font-size: 11px;
  }

  .plot-location input {
    padding: 5px 7px;
  }

  .plot-meta {
    margin-bottom: 6px;
    font-size: 10px;
  }

  #plotDescription {
    height: 82px;
    margin-bottom: 8px;
    padding: 7px;
    font-size: 12px;
    resize: vertical;
  }

  .plot-numbers {
    grid-template-columns: 60px 1fr;
    margin-bottom: 8px;
    font-size: 12px;
  }

  .drawing-message {
    bottom: 0;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.25;
  }

  .drawing-message button {
    display: inline-flex;
    margin: 6px 0 0;
  }

  .plot-edit-actions,
  .plot-actions {
    gap: 6px;
  }

  .plot-edit-actions button,
  .plot-actions button {
    min-width: 0;
    height: 28px;
    font-size: 12px;
  }

  .save-state {
    font-size: 12px;
  }
}
