.gis-page {
  color: #1f2937;
}

.gis-heading {
  display: flex;
  align-items: center;
  gap: 42px;
  margin-bottom: 14px;
}

.gis-heading h1 {
  color: #b40000;
  font-size: 30px;
  font-weight: 600;
  line-height: 1.15;
  text-transform: uppercase;
}

.gis-breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #6b7280;
  font-size: 14px;
  font-weight: 500;
}

.gis-breadcrumb span:last-child {
  color: #b40000;
}

.gis-filter {
  display: grid;
  grid-template-columns: 1fr 1.05fr 1.05fr 1.08fr minmax(220px, 1.65fr) auto;
  gap: 18px;
  align-items: end;
  margin-bottom: 9px;
  border: 1px solid #ffd5d5;
  border-radius: 8px;
  background: #fff;
  padding: 18px 20px;
  box-shadow: 0 4px 15px rgba(15, 23, 42, 0.04);
}

.gis-filter label {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.gis-filter span {
  color: #111827;
  font-size: 14px;
  font-weight: 600;
}

.gis-filter select,
.gis-filter input {
  height: 44px;
  width: 100%;
  border: 1px solid #d8dee8;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.gis-filter select {
  padding: 0 36px 0 14px;
}

.gis-filter input {
  padding: 0 42px 0 14px;
}

.search-wrap {
  position: relative;
  display: block;
}

.search-wrap svg {
  position: absolute;
  right: 13px;
  top: 50%;
  color: #111827;
  transform: translateY(-50%);
}

.advanced-btn {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 1px solid #d40000;
  border-radius: 6px;
  background: #fff;
  padding: 0 20px;
  color: #d00000;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.advanced-btn:hover {
  background: #fff5f5;
}

.gis-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 15px;
}

.map-shell {
  position: relative;
  min-height: calc((100vh - 260px) * 0.81);
  overflow: hidden;
  border: 1px solid #e1e6ee;
  border-radius: 8px;
  background: #e8f1e7;
}

.map-canvas {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(30deg, transparent 0 47%, rgba(245, 187, 81, 0.55) 48% 49%, transparent 50%),
    linear-gradient(145deg, transparent 0 46%, rgba(245, 187, 81, 0.5) 47% 48%, transparent 49%),
    radial-gradient(circle at 75% 38%, #b8dcff 0 12%, transparent 13%),
    radial-gradient(circle at 86% 64%, #a9d2ff 0 17%, transparent 18%),
    radial-gradient(circle at 30% 22%, rgba(63, 164, 81, 0.18), transparent 18%),
    radial-gradient(circle at 38% 76%, rgba(63, 164, 81, 0.18), transparent 14%),
    #edf4ea;
}

.map-canvas::before {
  content: "tp. Ninh Bình";
  position: absolute;
  left: 33%;
  top: 41%;
  color: #111827;
  font-size: 23px;
  font-weight: 600;
  opacity: 0.9;
}

.map-canvas::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(90deg, rgba(59, 130, 246, 0.15) 1px, transparent 1px),
    linear-gradient(rgba(59, 130, 246, 0.12) 1px, transparent 1px);
  background-size: 92px 92px, 92px 92px;
  opacity: 0.36;
  pointer-events: none;
}

.map-fallback-note {
  position: absolute;
  left: 50%;
  top: 12px;
  z-index: 1;
  display: grid;
  gap: 2px;
  width: max-content;
  max-width: min(460px, calc(100% - 40px));
  border: 1px solid #bfd7ff;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px 12px;
  color: #075ee4;
  font-size: 12px;
  text-align: center;
  transform: translateX(-50%);
}

.map-fallback-note strong {
  color: #111827;
  font-size: 13px;
  font-weight: 600;
}

.map-shell.map-loaded .map-fallback-note {
  display: none;
}

.map-shell.map-loaded .map-canvas::before,
.map-shell.map-loaded .map-canvas::after {
  display: none;
}

.map-toolbar {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 5;
  display: grid;
  gap: 10px;
}

.map-toolbar button {
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid #dfe5ed;
  border-radius: 6px;
  background: #fff;
  color: #111827;
  box-shadow: 0 5px 12px rgba(15, 23, 42, 0.12);
}

.map-toolbar button:hover {
  color: #c90000;
}

.map-legend {
  position: absolute;
  left: 16px;
  bottom: 16px;
  z-index: 5;
  display: grid;
  gap: 13px;
  width: 300px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.95);
  padding: 17px 18px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.map-legend h2,
.gis-side-card h2 {
  color: #9e0000;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.25;
  text-transform: uppercase;
}

.map-legend div {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #253041;
  font-size: 14px;
  font-weight: 500;
}

.marker-dot {
  display: inline-grid;
  width: 27px;
  height: 27px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  flex: 0 0 auto;
}

.marker-dot.green { background: #22a447; }
.marker-dot.yellow { background: #f4b400; }
.marker-dot.gray { background: #777d86; }
.marker-dot.orange { background: #ff7a16; }
.marker-dot.red { background: #e60012; }
.marker-dot.purple { background: #8752dc; }

.facility-popup {
  position: absolute;
  z-index: 6;
  width: 345px;
  border: 1px solid #e2e7ef;
  border-radius: 8px;
  background: #fff;
  padding: 18px 18px 20px;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.2);
}

.facility-popup::after {
  content: "";
  position: absolute;
  width: 28px;
  height: 28px;
  background: #fff;
  transform: rotate(45deg);
}

.facility-popup.anchor-right {
  left: calc(50% + 20px);
  top: 50%;
  transform: translateY(-50%);
}

.facility-popup.anchor-right::after {
  left: -10px;
  top: 50%;
  border-left: 1px solid #e2e7ef;
  border-bottom: 1px solid #e2e7ef;
  box-shadow: -5px 5px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-50%) rotate(45deg);
}

.facility-popup.anchor-left {
  right: calc(50% + 20px);
  top: 50%;
  transform: translateY(-50%);
}

.facility-popup.anchor-left::after {
  right: -10px;
  top: 50%;
  border-right: 1px solid #e2e7ef;
  border-top: 1px solid #e2e7ef;
  box-shadow: 5px -5px 12px rgba(15, 23, 42, 0.06);
  transform: translateY(-50%) rotate(45deg);
}

.facility-popup.anchor-top {
  left: 50%;
  top: calc(50% - 30px);
  transform: translate(-50%, -100%);
}

.facility-popup.anchor-top::after {
  left: 50%;
  bottom: -10px;
  border-right: 1px solid #e2e7ef;
  border-bottom: 1px solid #e2e7ef;
  box-shadow: 5px 5px 12px rgba(15, 23, 42, 0.06);
  transform: translateX(-50%) rotate(45deg);
}

.popup-close {
  position: absolute;
  right: 12px;
  top: 12px;
  display: grid;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 6px;
}

.popup-close:hover {
  background: #f3f4f6;
}

.facility-popup h2 {
  padding-right: 32px;
  color: #111827;
  font-size: 21px;
  font-weight: 600;
  text-transform: uppercase;
}

.popup-status {
  display: inline-flex;
  margin-top: 8px;
  border-radius: 999px;
  background: #e8f8ec;
  padding: 4px 11px;
  color: #238341;
  font-size: 13px;
  font-weight: 600;
}

.facility-popup dl {
  display: grid;
  gap: 13px;
  margin: 17px 0 18px;
}

.facility-popup dl div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 7px;
}

.facility-popup dt {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: #1f2937;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
}

.facility-popup dd {
  display: flex;
  align-items: flex-start;
  gap: 7px;
  margin: 0;
  color: #1f2937;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
}

.green-text {
  color: #249447 !important;
}

.popup-detail {
  position: relative;
  z-index: 1;
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  margin-left: 91px;
  border: 1px solid #e60012;
  border-radius: 6px;
  padding: 0 22px;
  color: #e60012;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.gis-side {
  display: grid;
  gap: 12px;
  align-content: start;
}

.gis-side-card {
  border: 1px solid #ffd5d5;
  border-radius: 8px;
  background: #fff;
  padding: 17px 16px;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.045);
}

.side-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.side-title a,
.side-title button {
  color: #c90000;
  font-size: 13px;
  font-weight: 600;
}

.stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid #edf1f6;
  border-radius: 8px;
  overflow: hidden;
}

.stat-grid div {
  display: grid;
  grid-template-columns: 34px 1fr;
  column-gap: 10px;
  align-items: center;
  min-height: 74px;
  border-right: 1px solid #edf1f6;
  border-bottom: 1px solid #edf1f6;
  padding: 12px;
}

.stat-grid div:nth-child(2n) {
  border-right: 0;
}

.stat-grid div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.stat-grid strong {
  color: #111827;
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}

.stat-grid em {
  grid-column: 2;
  color: #374151;
  font-size: 13px;
  font-style: normal;
  font-weight: 500;
}

.nearby-list {
  display: grid;
}

.nearby-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) 12px;
  gap: 10px;
  align-items: center;
  width: 100%;
  border-bottom: 1px solid #edf1f6;
  min-height: 58px;
  padding: 8px 0;
  text-align: left;
}

.nearby-item:last-child {
  border-bottom: 0;
}

.nearby-item .marker-dot {
  display: inline-grid;
  align-self: center;
  justify-self: start;
  place-items: center;
  margin-top: 0;
}

.nearby-item > span:nth-child(2) {
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: center;
  align-self: center;
}

.nearby-item strong {
  display: block;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.25;
}

.nearby-item > span:nth-child(2) > span {
  display: block;
  margin-top: 2px;
  color: #374151;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.35;
}

.nearby-status {
  display: block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
  align-self: center;
  justify-self: end;
  margin-top: 0;
}

.layer-card {
  display: grid;
  gap: 11px;
}

.layer-card label {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 500;
}

.layer-card input {
  width: 18px;
  height: 18px;
  accent-color: #d00000;
}

@media (max-width: 1380px) {
  .gis-filter {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .gis-layout {
    grid-template-columns: 1fr;
  }

  .gis-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .gis-heading,
  .gis-side {
    align-items: flex-start;
    grid-template-columns: 1fr;
  }

  .gis-filter {
    grid-template-columns: 1fr;
  }

  .map-shell {
    min-height: 502px;
  }
}

@media (max-width: 640px) {
  .facility-popup {
    width: auto;
  }

  .map-legend {
    width: auto;
    right: 16px;
  }
}

/* GIS command-center layout */
.legacy-filter {
  display: none;
}

.gis-layout {
  position: relative;
  display: block;
}

.map-shell {
  min-height: calc(100vh - 150px);
  border-radius: 6px;
}

.map-search-bar {
  position: absolute;
  left: 16px;
  top: 16px;
  z-index: 8;
  display: flex;
  align-items: center;
  gap: 10px;
  width: min(780px, calc(100% - 430px));
}

.map-search-input {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1 1 auto;
  min-width: 240px;
  height: 48px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  padding: 0 15px;
  color: #111827;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.map-search-input input {
  min-width: 0;
  width: 100%;
  border: 0;
  background: transparent;
  color: #111827;
  font-size: 14px;
  font-weight: 500;
  outline: none;
}

.map-filter-btn,
.risk-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 48px;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  padding: 0 14px;
  color: #111827;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.14);
}

.map-filter-btn {
  color: #c90000;
}

.risk-toggle input {
  width: 17px;
  height: 17px;
  accent-color: #c90000;
}

.map-toolbar {
  top: 78px;
}

.map-legend {
  width: auto;
  min-width: 0;
  padding: 0;
  gap: 0;
  overflow: visible;
}

.legend-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 126px;
  height: 42px;
  padding: 0 14px;
  color: #9e0000;
  font-size: 13px;
  font-weight: 700;
}

.legend-content {
  display: none;
  gap: 11px;
  width: min(320px, calc(100vw - 32px));
  padding: 0 18px 17px;
}

.map-legend.is-open .legend-content {
  display: grid;
}

.legend-content h2 {
  margin-top: 2px;
}

.map-legend .legend-content > div {
  display: grid;
  grid-template-columns: 27px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  white-space: normal;
  width: 100%;
  font-size: 13px;
  line-height: 1.25;
}

.gis-side {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 7;
  display: grid;
  width: 360px;
  max-height: calc(100% - 112px);
  overflow: auto;
  gap: 12px;
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 12px;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.18);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

.gis-side.is-collapsed {
  transform: translateX(calc(100% + 10px));
  opacity: 0.04;
  pointer-events: none;
}

.floating-panel-toggle {
  position: sticky;
  top: 0;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  border: 1px solid #f2caca;
  border-radius: 7px;
  background: #fff7f7;
  color: #b40000;
  font-size: 13px;
  font-weight: 700;
}

.floating-panel-restore {
  position: absolute;
  right: 16px;
  top: 16px;
  z-index: 8;
  display: none;
  width: 46px;
  height: 46px;
  place-items: center;
  border: 1px solid #e4e9f1;
  border-radius: 8px;
  background: #fff;
  color: #b40000;
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.16);
}

.gis-layout.panel-collapsed .floating-panel-restore {
  display: grid;
}



.gis-footer-stats {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 12px;
  overflow-x: auto;
  border: 1px solid #e6ebf2;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.96);
  padding: 10px 14px;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.15);
}

.footer-stat-item {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex: 0 0 auto;
  color: #1f2937;
  font-size: 13px;
  font-weight: 600;
}

.footer-stat-item strong {
  color: #111827;
  font-size: 15px;
}

.facility-tooltip {
  left: 50%;
  top: 50%;
  width: 260px;
  padding: 14px;
  transform: translate(-50%, -50%);
}

.facility-tooltip::after,
.facility-tooltip dl {
  display: none;
}

.facility-tooltip h2 {
  padding-right: 30px;
  font-size: 16px;
}

.tooltip-type {
  margin-top: 8px;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
}

.facility-tooltip .popup-detail {
  width: 100%;
  margin: 12px 0 0;
}

.facility-detail-sheet,
.filter-drawer {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 11;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  height: 100%;
  border-left: 1px solid #e5eaf2;
  background: #fff;
  box-shadow: -22px 0 48px rgba(15, 23, 42, 0.22);
  transform: translateX(105%);
  transition: transform 0.24s ease;
}

.facility-detail-sheet.is-open,
.filter-drawer.is-open {
  transform: translateX(0);
}

.detail-sheet-head,
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #edf1f6;
  padding: 18px;
}

.detail-sheet-head button,
.drawer-head button {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 7px;
  color: #374151;
}

.detail-sheet-head button:hover,
.drawer-head button:hover {
  background: #f3f4f6;
}

.sheet-kicker,
.drawer-head span {
  color: #b40000;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.detail-sheet-head h2,
.drawer-head strong {
  display: block;
  margin-top: 4px;
  color: #111827;
  font-size: 20px;
  font-weight: 700;
  line-height: 1.25;
}

.facility-detail-content,
.drawer-body {
  display: grid;
  gap: 14px;
  overflow: auto;
  padding: 18px;
}

.detail-section {
  display: grid;
  gap: 10px;
  border: 1px solid #edf1f6;
  border-radius: 8px;
  padding: 14px;
}

.detail-section h3 {
  color: #9e0000;
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
}

.detail-row {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 10px;
  color: #374151;
  font-size: 13px;
  font-weight: 500;
}

.detail-row strong {
  color: #111827;
}

.drawer-body label {
  display: grid;
  gap: 8px;
}

.drawer-body label span {
  color: #111827;
  font-size: 14px;
  font-weight: 700;
}

.drawer-body select {
  height: 44px;
  border: 1px solid #d8dee8;
  border-radius: 7px;
  background: #fff;
  padding: 0 12px;
  color: #111827;
  font-size: 14px;
  outline: none;
}

.drawer-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid #edf1f6;
  padding: 16px 18px;
}

.drawer-primary,
.drawer-secondary {
  display: inline-flex;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 7px;
  padding: 0 18px;
  font-size: 14px;
  font-weight: 700;
}

.drawer-primary {
  flex: 1;
  background: #c90000;
  color: #fff;
}

.drawer-secondary {
  border: 1px solid #d8dee8;
  color: #374151;
}

.map-overlay-backdrop {
  position: absolute;
  inset: 0;
  z-index: 10;
  background: rgba(15, 23, 42, 0.18);
}

.nearby-item.is-highlighted {
  background: #fff7f7;
}

.risk-ping {
  position: absolute;
  width: 48px;
  height: 48px;
  pointer-events: none;
  transform: translate(-50%, -50%);
}

.risk-ping::before,
.risk-ping::after {
  content: "";
  position: absolute;
  inset: 5px;
  border: 2px solid rgba(135, 82, 220, 0.7);
  border-radius: 999px;
  animation: riskPing 1.8s ease-out infinite;
}

.risk-ping::after {
  animation-delay: 0.7s;
}

@keyframes riskPing {
  from {
    opacity: 0.9;
    transform: scale(0.35);
  }
  to {
    opacity: 0;
    transform: scale(1.25);
  }
}

@media (max-width: 1180px) {
  .map-search-bar {
    width: calc(100% - 32px);
    flex-wrap: wrap;
  }

  .gis-side {
    top: 84px;
    max-height: calc(100% - 180px);
  }
}

@media (max-width: 760px) {
  .gis-page {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }

  .map-shell {
    min-height: calc(100vh - 128px);
  }

  .map-search-bar {
    left: 10px;
    right: 10px;
    top: 10px;
    width: auto;
  }

  .map-search-input {
    flex-basis: 100%;
  }

  .map-toolbar {
    left: 10px;
    top: 126px;
  }

  .gis-side,
  .facility-detail-sheet,
  .filter-drawer {
    width: 100%;
  }

  .gis-side {
    left: 10px;
    right: 10px;
    width: auto;
  }

  .map-legend {
    left: 10px;
    bottom: 76px;
  }

  .gis-footer-stats {
    left: 10px;
    right: 10px;
    bottom: 10px;
  }
}

/* Hard override for compact legend; keep this after legacy .map-legend rules. */
.map-legend {
  bottom: 72px;
  display: block;
  width: max-content;
  max-width: calc(100vw - 32px);
}

.map-legend .legend-content {
  display: none !important;
  width: 320px;
  max-width: calc(100vw - 32px);
  padding: 0 14px 14px;
}

.map-legend.is-open .legend-content {
  display: block !important;
}

.map-legend .legend-content h2 {
  display: block;
  width: 100%;
  margin: 2px 0 10px;
  white-space: nowrap;
}

.map-legend .legend-content > div {
  display: flex !important;
  align-items: center;
  width: 100%;
  min-height: 30px;
  gap: 10px;
  margin-top: 8px;
  white-space: normal;
}

.map-legend .legend-content > div .marker-dot {
  width: 27px;
  height: 27px;
  flex: 0 0 27px;
}

@media (max-width: 760px) {
  .map-legend {
    bottom: 84px;
  }
}

/* Public digital map: restore a clean two-column layout for index.html. */
#map-view.public-map-page {
  overflow-x: hidden;
}

#map-view .public-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 380px);
  gap: 18px;
  align-items: start;
}

#map-view .public-map-shell {
  min-height: min(760px, calc(100vh - 210px));
  border: 1px solid #dfe6ef;
  border-radius: 8px;
}

#map-view .gis-side {
  position: static;
  z-index: auto;
  width: auto;
  max-height: none;
  overflow: visible;
  display: grid;
  gap: 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  padding: 0;
  box-shadow: none;
  transform: none;
  opacity: 1;
}

#map-view .gis-side-card:first-of-type {
  display: block;
}

#map-view .gis-side-card {
  min-width: 0;
  border-color: #ffcaca;
  padding: 18px;
}

#map-view .nearby-list {
  display: grid;
  gap: 0;
}

#map-view .nearby-item {
  grid-template-columns: 32px minmax(0, 1fr) 14px;
  gap: 10px;
  min-height: 56px;
  padding: 9px 0;
}

#map-view .nearby-item strong,
#map-view .nearby-item > span:nth-child(2) > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#map-view .nearby-status {
  width: 11px;
  height: 11px;
}

#map-view .map-layer-menu {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 8;
  display: grid;
  justify-items: end;
  gap: 8px;
}

#map-view .map-layer-toggle {
  display: inline-flex;
  height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid #dfe5ed;
  border-radius: 7px;
  background: #fff;
  padding: 0 14px;
  color: #9e0000;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.15);
}

#map-view .map-layer-toggle:hover,
#map-view .map-layer-toggle[aria-expanded="true"] {
  border-color: #f3b4b4;
  background: #fff7f7;
}

#map-view .map-layer-panel {
  width: 286px;
  border: 1px solid #ffcaca;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  padding: 16px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}

#map-view .gis-side > .layer-card {
  display: none;
}

#map-view .layer-card {
  gap: 12px;
}

#map-view .layer-card h2 {
  margin: 0 0 2px;
}

#map-view .layer-card label {
  min-height: 24px;
  align-items: center;
  line-height: 1.35;
}

#map-view .layer-card input {
  flex: 0 0 16px;
  width: 16px;
  height: 16px;
  margin: 0;
}

#map-view .map-legend {
  bottom: 16px;
  display: grid;
  width: 300px;
  max-width: calc(100% - 32px);
  gap: 13px;
  padding: 17px 18px;
}

@media (max-width: 1180px) {
  #map-view .public-layout {
    grid-template-columns: 1fr;
  }

  #map-view .gis-side {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  #map-view .gis-side {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  #map-view .public-map-shell {
    min-height: 560px;
  }

  #map-view .map-legend {
    right: 12px;
    bottom: 12px;
    left: 12px;
    width: auto;
  }

  #map-view .map-layer-menu {
    top: 12px;
    right: 12px;
    left: 12px;
  }

  #map-view .map-layer-toggle,
  #map-view .map-layer-panel {
    width: 100%;
  }
}

#mapLayerPanel[hidden] {
  display: none !important;
}
