:root {
  --brand: #0f7fd6;
  --brand-deep: #0a5aa7;
  --accent: #3ea7ff;
  --paper: #f6f4ef;
  --ink: #1a2a27;
  --muted: #5b6f6a;
  --card: rgba(255, 255, 255, 0.86);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: "Source Sans 3", "Segoe UI", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(70vw 40vh at 10% 0%, #d7e9fb 0%, transparent 70%),
    radial-gradient(80vw 40vh at 100% 0%, #f1ead2 0%, transparent 72%),
    var(--paper);
}

.app-shell {
  height: 100vh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
}

.top-header {
  position: relative;
  z-index: 1000;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid rgba(10, 90, 167, 0.2);
  background:
    radial-gradient(circle at top left, rgba(98, 197, 255, 0.24), transparent 28%),
    linear-gradient(120deg, var(--brand-deep), var(--brand));
  color: #fff;
  box-shadow: 0 6px 24px rgba(9, 62, 119, 0.28);
  overflow: hidden;
}

.header-left {
  min-width: 0;
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px 10px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0.03));
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.brand-logo-wrap {
  flex-shrink: 0;
  width: 74px;
  height: 74px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0.1));
  border: 1px solid rgba(255, 255, 255, 0.3);
  box-shadow: 0 10px 22px rgba(4, 38, 77, 0.28);
  backdrop-filter: blur(6px);
}

.brand-logo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: drop-shadow(0 3px 8px rgba(7, 35, 71, 0.35));
}

.brand-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.kicker {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  opacity: 0.88;
}

.title {
  margin: 0;
  font-family: "Sora", sans-serif;
  font-size: clamp(18px, 2.2vw, 26px);
  font-weight: 800;
  line-height: 1.08;
  text-wrap: balance;
}

.title-emphasis {
  color: #ffe680;
  text-shadow: 0 2px 10px rgba(18, 50, 92, 0.28);
}

.title-separator {
  margin: 0 6px;
  opacity: 0.72;
}

.subtitle {
  margin: 0;
  color: #eaf4ff;
  font-size: 14px;
}

.header-badges {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.26);
  font-size: 13px;
  white-space: nowrap;
  backdrop-filter: blur(3px);
}

.badge-button {
  border: 1px solid rgba(255, 255, 255, 0.26);
  color: #ffffff;
  cursor: pointer;
  font-family: inherit;
  font-weight: 700;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #72f3ff;
  box-shadow: 0 0 0 6px rgba(114, 243, 255, 0.22);
  animation: pulse 1.9s infinite;
}

.map-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
}

.tools-dock {
  position: relative;
  z-index: 950;
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  background: #ffffff;
  border-right: 1px solid #dce3ec;
  box-shadow: 6px 0 22px rgba(26, 45, 72, 0.12);
}

.map-stage {
  position: relative;
  flex: 1 1 auto;
  min-width: 0;
  min-height: 0;
  display: flex;
}

.map-side-panels {
  position: absolute;
  z-index: 1190;
  top: 16px;
  right: 16px;
  max-height: calc(100% - 32px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: flex-end;
}

.selection-panel {
  position: relative;
  width: min(360px, calc(100vw - 32px));
  padding: 12px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(10, 90, 167, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(5px);
  box-shadow: 0 14px 32px rgba(9, 62, 119, 0.22);
}

.selection-panel[hidden] {
  display: none !important;
}

.selection-panel.compact .fields-title,
.selection-panel.compact .fields-list {
  display: none;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.panel-close {
  display: none;
  width: 32px;
  height: 32px;
  border: 1px solid #c5d9f0;
  border-radius: 999px;
  background: #f4f8ff;
  color: #1f4d76;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.legend-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.legend-title {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 700;
  color: #244e77;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.legend-item {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #1e3d5f;
  font-weight: 600;
  font-size: 14px;
}

.legend-swatch {
  flex-shrink: 0;
  width: 22px;
  height: 13px;
  border-radius: 3px;
}

.mobile-action-bar {
  display: none;
  gap: 8px;
  margin-top: 6px;
}

.mobile-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 9px 12px;
  border: 1px solid rgba(255, 255, 255, 0.26);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.18s ease, transform 0.18s ease;
}

.mobile-action-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.filter-panel,
.selection-panel {
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.mobile-backdrop {
  position: absolute;
  inset: 0;
  z-index: 1180;
  background: rgba(15, 33, 56, 0.32);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

.mobile-backdrop.active {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transition-delay: 0s;
}

.mobile-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(-12px);
}


.legend-swatch--lotes {
  background: #ffe14d;
  border: 2px solid #111827;
}

.legend-swatch--manzanas {
  background: rgba(121, 184, 245, 0.35);
  border: 2px solid #0b4f8a;
}

.legend-swatch--selected {
  background: #ffe14d;
  border: 3px solid #0a5aa7;
  box-shadow: 0 0 0 2px rgba(10, 90, 167, 0.12);
}

.fields-title {
  margin: 10px 0 8px;
  font-size: 13px;
  font-weight: 700;
  color: #244e77;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.fields-list {
  max-height: 280px;
  overflow: auto;
  border: 1px solid #d6e5f6;
  border-radius: 10px;
  background: #fcfdff;
  padding: 6px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 8px;
}

.field-row:nth-child(odd) {
  background: #f3f8ff;
}

.field-key {
  font-weight: 700;
  color: #1f4d76;
  word-break: break-word;
}

.field-value {
  color: #243746;
  word-break: break-word;
  text-align: right;
}

#map {
  flex: 1 1 auto;
  min-width: 0;
  height: 100%;
  border-top: 3px solid var(--accent);
}

.leaflet-control-zoom a {
  background: #fff;
  color: var(--brand-deep);
  border: 1px solid rgba(10, 90, 167, 0.32);
}

/* ── Filter Panel ─────────────────────────────────────────────────────────── */
.filter-panel {
  position: relative;
  width: min(240px, calc(100vw - 32px));
  max-height: min(68vh, 520px);
  padding: 14px 14px 12px;
  overflow-y: auto;
  overflow-x: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(10, 90, 167, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(5px);
  box-shadow: 0 14px 32px rgba(9, 62, 119, 0.22);
}

.admin-panel {
  position: fixed;
  z-index: 1300;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(280px, calc(100vw - 32px));
  padding: 14px;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(10, 90, 167, 0.2);
  border-radius: 14px;
  backdrop-filter: blur(5px);
  box-shadow: 0 14px 32px rgba(9, 62, 119, 0.22);
  max-height: min(80vh, 620px);
  overflow: auto;
}

.admin-box {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.admin-box-hidden {
  display: none;
}

.admin-note {
  min-height: 14px;
  font-size: 12px;
  color: #4b6784;
}

.admin-close-inline {
  margin-top: 10px;
  width: 100%;
}

.admin-layers-list {
  max-height: 220px;
  overflow: auto;
  border: 1px solid #d6e5f6;
  border-radius: 10px;
  background: #fcfdff;
  padding: 6px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.admin-layer-item {
  border: 1px solid #d7e3ef;
  border-radius: 8px;
  padding: 8px;
  background: #ffffff;
}

.admin-layer-name {
  font-size: 13px;
  font-weight: 700;
  color: #1f4d76;
}

.admin-layer-actions {
  display: flex;
  gap: 6px;
  margin-top: 6px;
}

.filter-title {
  margin: 0 0 12px;
  font-size: 13px;
  font-weight: 700;
  color: #244e77;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.filter-fields {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.filter-label {
  display: block;
  font-size: 11px;
  font-weight: 700;
  color: #1f4d76;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-top: 6px;
  margin-bottom: 2px;
}

.filter-label:first-child {
  margin-top: 0;
}

.filter-input {
  width: 100%;
  padding: 6px 10px;
  border: 1px solid #c5d9f0;
  border-radius: 8px;
  font-size: 13px;
  font-family: inherit;
  color: var(--ink);
  background: #f8fbff;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.filter-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 2px rgba(15, 127, 214, 0.15);
  background: #fff;
}

.filter-select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%230f7fd6' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
  cursor: pointer;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 12px;
}

.btn-search {
  flex: 1;
  padding: 7px 0;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-search:hover {
  background: var(--brand-deep);
}

.btn-clear {
  padding: 7px 12px;
  background: #edf2fa;
  color: #1f4d76;
  border: 1px solid #c5d9f0;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s;
}

.btn-clear:hover {
  background: #dde8f5;
}

.filter-status {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--muted);
  min-height: 16px;
}

.filter-status.error {
  color: #c0392b;
}

.filter-status.success {
  color: #1a7a4a;
}

.tools-dock,
.map-tools-sidebar {
  display: flex;
}

.map-tools-sidebar {
  flex: 0 0 auto;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  width: 76px;
  padding: 12px 8px;
  background: #f8fafc;
  overflow-y: auto;
  scrollbar-width: none;
}

.map-tools-sidebar::-webkit-scrollbar {
  display: none;
}

.map-tools__icon-btn {
  --tool-accent: #3b82f6;
  position: relative;
  width: 60px;
  min-height: 58px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: #53657a;
  cursor: pointer;
  outline: none;
  transition:
    background-color 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

.map-tools__icon-btn::before {
  content: "";
  position: absolute;
  top: 9px;
  bottom: 9px;
  left: -8px;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--tool-accent);
  opacity: 0;
  transform: scaleY(0.45);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.map-tools__icon-btn[data-tool="home"] { --tool-accent: #2563eb; }
.map-tools__icon-btn[data-tool="layers"] { --tool-accent: #0f9f75; }
.map-tools__icon-btn[data-tool="search"] { --tool-accent: #7c3aed; }
.map-tools__icon-btn[data-tool="legend"] { --tool-accent: #e07716; }
.map-tools__icon-btn[data-tool="services"] { --tool-accent: #0284c7; }
.map-tools__icon-btn[data-tool="measure"] { --tool-accent: #db2777; }
.map-tools__icon-btn[data-tool="print"] { --tool-accent: #0891b2; }
.map-tools__icon-btn[data-tool="clear"] { --tool-accent: #dc3545; }
.map-tools__icon-btn[data-tool="theme"] {
  --tool-accent: #d08a00;
  margin-top: auto;
  border-top: 1px solid #e1e7ee;
  border-radius: 0 0 8px 8px;
}

.map-tools__icon-btn:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--tool-accent) 24%, transparent);
}

.map-tools__icon-btn:hover {
  color: var(--tool-accent);
  background: color-mix(in srgb, var(--tool-accent) 9%, white);
  transform: translateY(-2px);
}

.map-tools__icon-btn.active {
  color: var(--tool-accent);
  background: color-mix(in srgb, var(--tool-accent) 12%, white);
  box-shadow: 0 5px 14px color-mix(in srgb, var(--tool-accent) 16%, transparent);
}

.map-tools__icon-btn.active::before {
  opacity: 1;
  transform: scaleY(1);
}

.map-tools__icon {
  display: grid;
  place-items: center;
  line-height: 1;
}

.map-tools__icon svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-tools__icon-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0;
}

.map-tools-panel {
  width: 264px;
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 18px;
  overflow-y: auto;
  background: #ffffff;
  border-left: 1px solid #e5eaf0;
  box-shadow: 8px 0 18px rgba(38, 55, 78, 0.08);
  transition: width 0.22s ease, opacity 0.18s ease;
}

.map-tools-panel.collapsed {
  display: none;
}

.map-tools__title {
  font-size: 12px;
  font-weight: 700;
  color: #25364c;
  text-transform: none;
  letter-spacing: 0.01em;
  padding-bottom: 12px;
  margin-bottom: 8px;
  border-bottom: 1px solid #e6ebf1;
}

.map-tools__section {
  display: none;
  flex-direction: column;
  gap: 8px;
}

.map-tools__label {
  font-size: 10px;
  font-weight: 700;
  color: #596b80;
  text-transform: uppercase;
  letter-spacing: 0.07em;
}

.map-tools__label--sub {
  margin-top: 6px;
}

.map-tools__select {
  min-width: 150px;
  border: 1px solid #c7ddf5;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 12px;
  color: #1f4d76;
  background: #f8fbff;
  outline: none;
}

.map-tools__extra-layers {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-tools__extra-toggle {
  border: 1px solid #c5d9f0;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 11px;
  font-weight: 700;
  font-family: inherit;
  text-align: left;
  cursor: pointer;
  background: #edf2fa;
  color: #1f4d76;
}

.map-tools__extra-toggle.active {
  background: #dcecff;
  border-color: #9cc4eb;
  color: #0a4f92;
}

.map-tools__extra-empty {
  font-size: 11px;
  color: #6a7e94;
}

.map-tools__legend {
  margin-top: 4px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #d6e0eb;
  border-radius: 10px;
  background: #fff;
}

.legend-card__header {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: #183e5f;
  background: #eef6fd;
  border-bottom: 1px solid #d6e5f2;
}

.legend-card__header strong,
.legend-card__header small,
.legend-item__copy strong,
.legend-item__copy small {
  display: block;
}

.legend-card__header strong {
  font-size: 12px;
}

.legend-card__header small {
  margin-top: 2px;
  color: #667a8e;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.3;
}

.legend-card__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  color: #147ac2;
  background: #fff;
  box-shadow: 0 2px 7px rgba(31, 77, 118, 0.12);
}

.legend-card__icon svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.legend-card__list {
  display: grid;
  padding: 4px 10px;
}

.map-tools__legend .legend-item {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  padding: 10px 2px;
  border-bottom: 1px solid #edf1f5;
}

.map-tools__legend .legend-item:last-child {
  border-bottom: 0;
}

.map-tools__legend .legend-swatch {
  width: 28px;
  height: 18px;
  border-radius: 3px;
}

.legend-item__copy strong {
  color: #293f55;
  font-size: 11px;
}

.legend-item__copy small {
  margin-top: 2px;
  color: #718196;
  font-size: 9px;
  font-weight: 400;
  line-height: 1.25;
}

.legend-card__note {
  display: flex;
  gap: 7px;
  margin: 0;
  padding: 9px 11px;
  color: #64768a;
  background: #f8fafc;
  border-top: 1px solid #e6ecf2;
  font-size: 9px;
  line-height: 1.35;
}

.legend-card__note > span {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid #89a8c2;
  border-radius: 50%;
  color: #2872ad;
  font-size: 9px;
  font-weight: 800;
}

.map-services {
  display: grid;
  gap: 10px;
}

.map-services__card {
  display: grid;
  gap: 7px;
  padding: 11px;
  border: 1px solid #d9e3ee;
  border-radius: 10px;
  background: #f8fafc;
}

.map-services__card-title {
  color: #263a52;
  font-size: 12px;
  font-weight: 700;
}

.map-services__layer {
  display: block;
  overflow: hidden;
  color: #526a84;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-services__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 32px;
  align-items: center;
  gap: 7px;
}

.map-services__service-info {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid #d9e3ee;
  border-radius: 7px;
  background: #fff;
}

.map-services__type {
  display: block;
  color: #0879b1;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.map-services__url {
  display: block;
  overflow: hidden;
  color: #64748b;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-services__copy {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px solid #cbd9e8;
  border-radius: 7px;
  color: #0879b1;
  background: #fff;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.map-services__copy:hover {
  color: #fff;
  background: #0879b1;
  transform: translateY(-1px);
}

.map-services__copy svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-services__status {
  min-height: 16px;
  color: #64748b;
  font-size: 10px;
}

.map-services__status.success {
  color: #15803d;
}

.map-services__status.error {
  color: #b42318;
}

.measure-control__intro {
  margin: 0;
  color: #607086;
  font-size: 12px;
  line-height: 1.45;
}

.measure-control__modes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.measure-control__button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 11px;
  border: 1px solid #d6dee9;
  border-radius: 8px;
  color: #34465d;
  background: #fff;
  text-align: left;
  font-family: inherit;
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, box-shadow 0.18s ease;
}

.measure-control__button:hover {
  border-color: #7bb7ed;
  background: #f7fbff;
}

.measure-control__button.active {
  border-color: #147ac2;
  color: #075b9c;
  background: #eef7ff;
  box-shadow: 0 0 0 2px rgba(20, 122, 194, 0.12);
}

.measure-control__button strong,
.measure-control__button small {
  display: block;
}

.measure-control__button strong {
  font-size: 13px;
  font-weight: 700;
}

.measure-control__button small {
  margin-top: 2px;
  color: #6e7e91;
  font-size: 10px;
  font-weight: 400;
}

.measure-control__mode-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 7px;
  color: #147ac2;
  background: #e7f3fd;
}

.measure-control__mode-icon svg,
.measure-control__actions svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.measure-control__readout {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 12px;
  border-left: 4px solid #147ac2;
  border-radius: 6px;
  color: #173b59;
  background: #f0f7fd;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}

.measure-control__hint {
  position: relative;
  padding-left: 20px;
  color: #5f7085;
  font-size: 11px;
  line-height: 1.4;
}

.measure-control__hint::before {
  content: "i";
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 14px;
  height: 14px;
  border: 1px solid #7da7cb;
  border-radius: 50%;
  color: #2872ad;
  font-size: 9px;
  font-weight: 800;
}

.measure-control__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding-top: 4px;
}

.measure-control__secondary,
.measure-control__clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 7px 9px;
  border: 1px solid #c9d5e2;
  border-radius: 6px;
  color: #334b63;
  background: #fff;
  font-family: inherit;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
}

.measure-control__clear {
  color: #a83232;
}

.measure-control__secondary:disabled,
.measure-control__clear:disabled {
  opacity: 0.42;
  cursor: not-allowed;
}

.export-action-btn {
  display: block;
  grid-template-columns: 1fr;
  width: 100%;
  padding: 8px;
  border: 0;
  background: var(--brand);
  color: #fff;
  text-align: center;
}

.print-filter {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid #d8e1eb;
  border-radius: 9px;
  background: #f8fafc;
}

.print-filter__label {
  margin-top: 3px;
  color: #53677d;
  font-size: 10px;
  font-weight: 700;
}

.print-filter__input {
  width: 100%;
  min-width: 0;
  padding: 8px 9px;
  border: 1px solid #cbd7e4;
  border-radius: 6px;
  color: #25384d;
  background: #fff;
  font: inherit;
  font-size: 12px;
  outline: none;
}

.print-filter__input:focus {
  border-color: #2985c7;
  box-shadow: 0 0 0 2px rgba(41, 133, 199, 0.13);
}

.print-filter__select {
  cursor: pointer;
}

.print-filter__search {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 36px;
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #197aba;
  border-radius: 6px;
  color: #fff;
  background: #147ac2;
  font-family: inherit;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}

.print-filter__search svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.export-action-btn:disabled {
  color: #7c8b9c;
  background: #e1e7ee;
  cursor: not-allowed;
  opacity: 0.75;
}

.export-status {
  min-height: 16px;
  font-size: 11px;
  color: #4b6784;
  line-height: 1.25;
}

.export-status.success {
  color: #1a7a4a;
}

.export-status.error {
  color: #c0392b;
}

#map.is-measuring {
  cursor: crosshair;
}

.measurement-display {
  position: absolute;
  z-index: 1100;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  pointer-events: none;
  opacity: 1;
  transition: opacity 0.18s ease;
}

.measurement-display--hidden {
  opacity: 0;
  pointer-events: none;
}

.measurement-display__content {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  background: linear-gradient(145deg, rgba(15, 127, 214, 0.95), rgba(15, 127, 214, 0.88));
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(9, 62, 119, 0.32);
  backdrop-filter: blur(6px);
}

.measurement-display__readout {
  font-size: 16px;
  font-weight: 800;
  color: #ffffff;
  letter-spacing: 0.02em;
  text-shadow: 0 2px 4px rgba(7, 35, 71, 0.3);
}

.leaflet-bottom.leaflet-left .base-map-control {
  margin-left: 6px;
  margin-bottom: 14px;
  padding: 8px;
  border-radius: 10px;
  border: 1px solid rgba(10, 90, 167, 0.28);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 8px 18px rgba(9, 62, 119, 0.18);
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 210px;
}

.base-map-control__label {
  font-size: 10px;
  font-weight: 800;
  color: #0a5aa7;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.base-map-control__select {
  border: 1px solid #c7ddf5;
  border-radius: 7px;
  padding: 6px 8px;
  font-size: 12px;
  color: #1f4d76;
  background: #f8fbff;
  outline: none;
  font-family: inherit;
}

.leaflet-parcel-tooltip {
  background: transparent;
  border: none;
  box-shadow: none;
}

.leaflet-parcel-tooltip .leaflet-tooltip-content {
  margin: 0;
}

.parcel-tooltip {
  min-width: 190px;
  padding: 10px 12px;
  border-radius: 12px;
  background: linear-gradient(145deg, rgba(255,255,255,0.98), rgba(241,248,255,0.96));
  border: 1px solid rgba(15, 127, 214, 0.24);
  box-shadow: 0 12px 28px rgba(7, 48, 92, 0.22);
  color: #18324d;
}

.parcel-tooltip__title {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 800;
  color: #0a5aa7;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.parcel-tooltip__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 4px 0;
  border-top: 1px solid rgba(15, 127, 214, 0.08);
}

.parcel-tooltip__row:first-of-type {
  border-top: none;
}

.parcel-tooltip__label {
  font-size: 12px;
  font-weight: 700;
  color: #456785;
}

.parcel-tooltip__value {
  font-size: 12px;
  font-weight: 700;
  color: #0f2741;
  text-align: right;
}

@keyframes pulse {
  0% { transform: scale(1); opacity: 1; }
  70% { transform: scale(1.15); opacity: 0.78; }
  100% { transform: scale(1); opacity: 1; }
}

@media (max-width: 1100px) {
  .top-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .brand-row {
    align-items: flex-start;
    padding: 6px 8px;
  }

  .brand-logo-wrap {
    width: 56px;
    height: 56px;
    border-radius: 16px;
  }

  .title {
    font-size: clamp(16px, 4.4vw, 22px);
  }

  .subtitle {
    font-size: 13px;
  }

  .header-badges {
    display: none !important;
    visibility: hidden;
  }

  .mobile-action-bar {
    display: flex;
    flex-wrap: wrap;
  }

  .panel-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .map-side-panels {
    position: absolute;
    inset: 0;
    top: 0;
    right: 0;
    z-index: 1190;
    pointer-events: none;
  }

  .filter-panel,
  .selection-panel {
    position: absolute;
    width: min(360px, calc(100vw - 24px));
    max-width: none;
    left: 50%;
    right: auto;
    top: 50%;
    bottom: auto;
    border-radius: 18px;
    max-height: min(76vh, 560px);
    overflow: auto;
    opacity: 0;
    pointer-events: none;
    transform: translate(-50%, calc(-50% + 20px));
  }

  .filter-panel.mobile-open,
  .selection-panel.mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }

  .admin-panel {
    width: min(360px, calc(100vw - 24px));
    max-height: min(80vh, 620px);
  }

  .admin-panel.mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%);
  }

  .field-row {
    grid-template-columns: 1fr;
  }

  .field-value {
    text-align: left;
  }

  #map {
    border-top: none;
  }

  .tools-dock {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 950;
  }

  .map-tools-sidebar {
    width: 64px;
    padding: 8px 4px;
  }

  .map-tools__icon-btn {
    width: 54px;
    min-height: 54px;
  }

  .map-tools__icon svg {
    width: 24px;
    height: 24px;
  }

  .map-tools-panel {
    position: absolute;
    left: 64px;
    top: 0;
    bottom: 0;
    width: min(264px, calc(100vw - 64px - 12px));
    box-shadow: 10px 0 24px rgba(6, 26, 48, 0.26);
  }

  .leaflet-bottom.leaflet-left .base-map-control {
    min-width: 180px;
    margin-bottom: 10px;
  }
}

.base-map-control__toggle {
  display: none;
  min-width: 44px;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 7px 9px;
  border: 0;
  color: #245273;
  background: transparent;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.base-map-control__toggle svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.base-map-control__content {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.map-tools__panel-close {
  display: none;
  position: absolute;
  z-index: 2;
  top: 8px;
  right: 8px;
  width: 44px;
  height: 44px;
  border: 1px solid #d5dfe8;
  border-radius: 12px;
  color: #42596f;
  background: #f5f8fa;
  font: inherit;
  font-size: 24px;
  cursor: pointer;
}

.filter-panel.filter-panel--docked {
  position: static;
  width: 100%;
  max-height: none;
  padding: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.filter-panel--docked .panel-close {
  display: none;
}

.filter-panel--docked .panel-head {
  margin-bottom: 6px;
}

.filter-panel--docked .filter-title {
  color: #34618b;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

html[data-theme="dark"] body {
  color: #e7edf5;
  background: #111827;
}

html[data-theme="dark"] .tools-dock,
html[data-theme="dark"] .map-tools-sidebar {
  background: #151d29;
  border-color: #2d3949;
}

html[data-theme="dark"] .tools-dock {
  box-shadow: 6px 0 24px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .map-tools__icon-btn {
  color: #9eacc0;
}

html[data-theme="dark"] .map-tools__icon-btn:hover,
html[data-theme="dark"] .map-tools__icon-btn.active {
  color: var(--tool-accent);
  background: color-mix(in srgb, var(--tool-accent) 16%, #151d29);
}

html[data-theme="dark"] .map-tools__icon-btn[data-tool="theme"] {
  border-color: #303c4d;
}

html[data-theme="dark"] .map-tools-panel {
  color: #dce5f0;
  background: #1c2634;
  border-color: #303c4d;
  box-shadow: 8px 0 20px rgba(0, 0, 0, 0.24);
}

html[data-theme="dark"] .map-tools__title {
  color: #f1f5f9;
  border-color: #344153;
}

html[data-theme="dark"] .map-tools__label,
html[data-theme="dark"] .filter-panel--docked .filter-title {
  color: #aebdd0;
}

html[data-theme="dark"] .map-tools__select,
html[data-theme="dark"] .filter-input {
  color: #e5edf6;
  background: #111a26;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .map-tools__extra-toggle {
  color: #c3cfdd;
  background: #263344;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .map-tools__extra-toggle.active {
  color: #8cc8ff;
  background: #173657;
  border-color: #356b9d;
}

html[data-theme="dark"] .map-tools__legend,
html[data-theme="dark"] .fields-list {
  color: #dce5f0;
  background: #121b27;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .legend-card__header {
  color: #dceeff;
  background: #17324a;
  border-color: #344b61;
}

html[data-theme="dark"] .legend-card__header small,
html[data-theme="dark"] .legend-item__copy small {
  color: #9eacc0;
}

html[data-theme="dark"] .legend-card__icon {
  color: #73c1fa;
  background: #102236;
}

html[data-theme="dark"] .map-tools__legend .legend-item {
  border-color: #293748;
}

html[data-theme="dark"] .legend-item__copy strong {
  color: #dce5f0;
}

html[data-theme="dark"] .legend-card__note {
  color: #9eacc0;
  background: #16202d;
  border-color: #344153;
}

html[data-theme="dark"] .map-services__card,
html[data-theme="dark"] .map-services__service-info {
  color: #dce5f0;
  background: #121b27;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .map-services__card-title {
  color: #e5edf6;
}

html[data-theme="dark"] .map-services__layer,
html[data-theme="dark"] .map-services__url,
html[data-theme="dark"] .map-services__status {
  color: #9eacc0;
}

html[data-theme="dark"] .map-services__type {
  color: #6ec7f4;
}

html[data-theme="dark"] .map-services__copy {
  color: #6ec7f4;
  background: #263344;
  border-color: #45556a;
}

html[data-theme="dark"] .map-services__copy:hover {
  color: #0f172a;
  background: #6ec7f4;
}

html[data-theme="dark"] .map-services__status.success {
  color: #6ee7a2;
}

html[data-theme="dark"] .map-services__status.error {
  color: #ff8b82;
}

html[data-theme="dark"] .selection-panel,
html[data-theme="dark"] .filter-panel:not(.filter-panel--docked),
html[data-theme="dark"] .measurement-display__content {
  color: #dce5f0;
  background: rgba(28, 38, 52, 0.97);
  border-color: #3b4a5e;
}

html[data-theme="dark"] .legend-title,
html[data-theme="dark"] .fields-title,
html[data-theme="dark"] .field-key,
html[data-theme="dark"] .filter-title,
html[data-theme="dark"] .filter-label {
  color: #9fc9ef;
}

html[data-theme="dark"] .field-row:nth-child(odd) {
  background: #1c2a3b;
}

html[data-theme="dark"] .field-value,
html[data-theme="dark"] .filter-status,
html[data-theme="dark"] .measure-control__hint,
html[data-theme="dark"] .export-status {
  color: #c3cfdd;
}

html[data-theme="dark"] .measure-control__intro {
  color: #a8b6c8;
}

html[data-theme="dark"] .measure-control__button {
  color: #d7e1ec;
  background: #172230;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .measure-control__button:hover,
html[data-theme="dark"] .measure-control__button.active {
  color: #8dceff;
  background: #17324a;
  border-color: #3d8ec9;
}

html[data-theme="dark"] .measure-control__button small {
  color: #9eacc0;
}

html[data-theme="dark"] .measure-control__mode-icon {
  color: #73c1fa;
  background: #173657;
}

html[data-theme="dark"] .measure-control__readout {
  color: #dceeff;
  background: #142b40;
  border-color: #4da6e4;
}

html[data-theme="dark"] .measure-control__secondary,
html[data-theme="dark"] .measure-control__clear {
  color: #c3cfdd;
  background: #172230;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .measure-control__clear {
  color: #ff9a94;
}

html[data-theme="dark"] .print-filter {
  background: #16202d;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .print-filter__label {
  color: #aebdd0;
}

html[data-theme="dark"] .print-filter__input {
  color: #e5edf6;
  background: #111a26;
  border-color: #3b4a5e;
}

html[data-theme="dark"] .leaflet-bottom.leaflet-left .base-map-control {
  color: #dce5f0;
  background: rgba(28, 38, 52, 0.96);
  border-color: #3b4a5e;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.32);
}

html[data-theme="dark"] .leaflet-bottom.leaflet-left .base-map-control__label {
  color: #aebdd0;
}

html[data-theme="dark"] .leaflet-bottom.leaflet-left .base-map-control__select {
  color: #e5edf6;
  background: #111a26;
  border-color: #3b4a5e;
  color-scheme: dark;
}

html[data-theme="dark"] .base-map-control__select option {
  color: #e5edf6;
  background: #111a26;
}

html[data-theme="dark"] .map-tools__panel-close,
html[data-theme="dark"] .base-map-control__toggle {
  color: #dce5f0;
  background: #263344;
  border-color: #45556a;
}

/* Responsive application shell */
@media (min-width: 1025px) and (max-width: 1100px) {
  .leaflet-left {
    left: 68px;
  }
}

@media (min-width: 1025px) {
  .map-tools__panel-close {
    display: none;
  }

  .map-tools__icon-btn {
    min-width: 44px;
    min-height: 52px;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .leaflet-left {
    left: 68px;
  }

  .tools-dock {
    width: 60px;
  }

  .map-tools-sidebar {
    width: 60px;
    padding: 8px 3px;
  }

  .map-tools__icon-btn {
    width: 54px;
    min-width: 48px;
    min-height: 50px;
  }

  .map-tools__icon-label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
  }

  .map-tools-panel {
    left: 60px;
    width: min(300px, calc(100vw - 76px));
    padding: 18px;
    border-radius: 0 14px 14px 0;
    box-shadow: 12px 0 30px rgba(14, 39, 64, 0.2);
  }

  .map-tools__panel-close {
    display: grid;
    place-items: center;
  }

  .map-tools__title {
    min-height: 42px;
    padding-right: 44px;
    font-size: 13px;
  }

  .map-tools__label,
  .filter-label,
  .filter-title,
  .measure-control__hint,
  .export-status {
    font-size: 12px;
  }

  .filter-input,
  .map-tools__select,
  .measure-control__button,
  .print-filter__input {
    min-height: 44px;
    font-size: 13px;
  }

  .leaflet-bottom.leaflet-left .base-map-control {
    position: relative;
    min-width: 0;
    max-width: none;
    padding: 3px;
    overflow: visible;
    transition: background-color 200ms ease;
  }

  .leaflet-bottom.leaflet-left .base-map-control.is-collapsed {
    transform: none;
  }

  .leaflet-bottom.leaflet-left .base-map-control__content {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0;
    width: min(220px, calc(100vw - 166px));
    padding: 10px;
    border: 1px solid rgba(10, 90, 167, 0.28);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.97);
    box-shadow: 0 10px 26px rgba(9, 42, 75, 0.24);
  }

  .leaflet-bottom.leaflet-left .base-map-control__select {
    width: 100%;
    max-width: none;
  }

  .base-map-control__toggle {
    display: inline-flex;
  }

  .base-map-control.is-collapsed .base-map-control__content {
    display: none;
  }

  html[data-theme="dark"] .leaflet-bottom.leaflet-left .base-map-control__content {
    background: rgba(28, 38, 52, 0.98);
    border-color: #3b4a5e;
  }

  .map-side-panels {
    inset: 0;
  }

  .selection-panel,
  .selection-panel.mobile-open {
    top: 12px;
    right: 12px;
    bottom: 12px;
    left: auto;
    width: min(360px, calc(100vw - 88px));
    max-height: none;
    border-radius: 14px;
    transform: translateX(calc(100% + 24px));
  }

  .selection-panel.mobile-open {
    transform: translateX(0);
  }

  .panel-close {
    min-width: 44px;
    min-height: 44px;
  }
}

@media (max-width: 767px) {
  app-header {
    display: block;
    flex: 0 0 60px;
    min-height: 60px;
  }

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

  .map-stage {
    position: absolute;
    inset: 0 0 calc(64px + env(safe-area-inset-bottom));
    display: block;
    width: auto;
    height: auto;
    min-width: 0;
    min-height: 0;
  }

  #map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
  }

  .leaflet-top.leaflet-left {
    right: max(10px, env(safe-area-inset-right));
    left: auto;
  }

  .leaflet-top.leaflet-left .leaflet-control {
    margin-right: 0;
    margin-left: 0;
  }

  .tools-dock {
    position: fixed;
    inset: 0;
    z-index: 1200;
    width: auto;
    background: transparent;
    border: 0;
    box-shadow: none;
    pointer-events: none;
  }

  html[data-theme="dark"] .tools-dock {
    background: transparent;
    border: 0;
    box-shadow: none;
  }

  .map-tools-sidebar {
    display: none;
  }

  .map-tools-panel,
  .map-tools-panel.collapsed {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    top: auto;
    width: auto;
    max-height: min(70dvh, 590px);
    display: flex;
    padding: 16px;
    padding-top: 14px;
    overflow-y: auto;
    border: 1px solid #d7e1ea;
    border-radius: 14px;
    box-shadow: 0 18px 48px rgba(10, 34, 58, 0.26);
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
    transition: transform 200ms ease, opacity 200ms ease;
  }

  .map-tools-panel.collapsed {
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 88px));
  }

  .map-tools__panel-close {
    display: grid;
    place-items: center;
  }

  .map-tools__title {
    min-height: 44px;
    padding-right: 48px;
    font-size: 14px;
  }

  .map-tools__section {
    gap: 10px;
  }

  .map-tools__label,
  .filter-label,
  .filter-title,
  .measure-control__hint,
  .measure-control__intro,
  .export-status,
  .map-services__status,
  .map-tools__extra-empty,
  .legend-card__header small,
  .legend-item__copy small,
  .legend-card__note,
  .map-services__layer,
  .map-services__url,
  .map-services__type {
    font-size: 12px;
  }

  .filter-input,
  .map-tools__select,
  .measure-control__button,
  .measure-control__secondary,
  .measure-control__clear,
  .print-filter__input,
  .print-filter__search,
  .export-action-btn,
  .btn-search,
  .btn-clear {
    min-height: 44px;
    font-size: 13px;
  }

  .map-side-panels {
    position: fixed;
    inset: 0;
    z-index: 1210;
    max-height: none;
    pointer-events: none;
  }

  .selection-panel,
  .selection-panel.mobile-open {
    position: fixed;
    right: max(8px, env(safe-area-inset-right));
    bottom: calc(70px + env(safe-area-inset-bottom));
    left: max(8px, env(safe-area-inset-left));
    top: auto;
    width: auto;
    max-height: min(70dvh, 590px);
    padding: 14px;
    border-radius: 14px;
    opacity: 0;
    pointer-events: none;
    transform: translateY(calc(100% + 88px));
    transition: transform 200ms ease, opacity 200ms ease;
  }

  .selection-panel.mobile-open {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .panel-close {
    display: inline-grid;
    place-items: center;
    min-width: 44px;
    min-height: 44px;
  }

  .field-row {
    grid-template-columns: minmax(96px, 0.8fr) minmax(0, 1.2fr);
    font-size: 12px;
  }

  .field-value {
    text-align: right;
  }

  .mobile-backdrop {
    position: fixed;
    inset: 0 0 calc(64px + env(safe-area-inset-bottom));
  }

  .leaflet-bottom.leaflet-left .base-map-control {
    display: none;
  }

  .leaflet-bottom {
    bottom: 4px;
  }

  .leaflet-control-attribution {
    max-width: calc(100vw - 16px);
    font-size: 10px;
    white-space: normal;
  }

  .measurement-display {
    top: 8px;
    width: min(calc(100vw - 20px), 420px);
  }

  .measurement-display__content {
    padding: 10px 12px;
  }

  .measurement-display__readout {
    font-size: 13px;
    text-align: center;
  }

  html[data-theme="dark"] .map-tools__panel-close {
    color: #dce5f0;
    background: #263344;
    border-color: #45556a;
  }
}

@media (max-width: 767px) and (orientation: landscape) {
  app-header {
    flex-basis: 56px;
    min-height: 56px;
  }

  .map-tools-panel,
  .map-tools-panel.collapsed,
  .selection-panel,
  .selection-panel.mobile-open {
    max-height: min(66dvh, 390px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-tools__icon-btn,
  .map-tools__icon-btn::before,
  .map-tools-panel,
  .selection-panel,
  .base-map-control {
    transition: none;
  }
}

