:root {
  color-scheme: dark;
  --bg: #06070a;
  --panel: #0c0f14;
  --panel-2: #151922;
  --text: #f4f7fb;
  --muted: #9ca7b4;
  --line: rgba(255, 255, 255, 0.16);
  --accent: #ffb000;
  --alert: #ff4d2f;
  --presence: #56d7ff;
  --tech-font: "Aptos Narrow", "Arial Narrow", "Roboto Condensed", "Bahnschrift", "DIN Alternate", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

*,
*::before,
*::after {
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

html,
body {
  width: 100%;
  max-width: 100%;
  height: 100%;
  margin: 0;
  position: relative;
  overscroll-behavior-x: none;
  overflow-x: hidden;
  overflow-x: clip;
}

body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 100%;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.04), transparent 140px),
    radial-gradient(circle at 78% 14%, rgba(255, 176, 0, 0.16), transparent 28%),
    var(--bg);
  color: var(--text);
  font-family: var(--tech-font);
}

button,
select,
[role="button"],
.leaflet-control a,
.leaflet-control button,
.map-type-button,
.module-button,
.gps-button,
.settings-button,
.measurement-button {
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  touch-action: manipulation;
}

.app-header {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 68px;
  padding: 10px 18px 10px 16px;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 176, 0, 0.12), transparent 30%),
    linear-gradient(180deg, #151923, #080a0f);
  border-bottom: 1px solid rgba(255, 255, 255, 0.2);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.42);
}

.app-header::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent) 0%, #fff 38%, var(--alert) 62%, #1775f8 100%);
  content: "";
}

.brand-block {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
  gap: 16px;
}

.brand-mark {
  display: grid;
  width: 210px;
  height: 58px;
  place-items: center;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 2px;
  background: #05070a;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.05), 0 8px 22px rgba(0, 0, 0, 0.32);
}

.brand-mark img {
  width: 184px;
  max-width: 88%;
  max-height: 42px;
  display: block;
}

.kicker {
  margin: 0 0 4px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  font-family: var(--tech-font);
  font-size: 26px;
  line-height: 1.1;
  font-weight: 650;
  color: var(--text);
  text-transform: uppercase;
}

.module-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
}

.module-button {
  display: inline-grid;
  min-width: 46px;
  height: 40px;
  place-items: center;
  padding: 0 14px;
  border: 1px solid rgba(86, 215, 255, 0.36);
  border-radius: 2px;
  background: rgba(16, 20, 28, 0.92);
  color: #dbe5ef;
  font-size: 14px;
  font-weight: 900;
  font-family: inherit;
  text-decoration: none;
  text-transform: uppercase;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  cursor: pointer;
}

.module-button:hover,
.module-button:focus-visible,
.module-button.active {
  border-color: rgba(255, 176, 0, 0.86);
  background: linear-gradient(180deg, #ffe07a, var(--accent));
  color: #090a0d;
}

.back-button {
  min-width: 92px;
}

.status-panel {
  position: relative;
  z-index: 1;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 9px;
  min-height: 48px;
  padding: 6px 8px 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.42);
  color: #dfe7ee;
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.status-symbol {
  width: 25px;
  height: 25px;
  object-fit: contain;
}

.gps-button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 2px;
  background: linear-gradient(180deg, #f8fbff, #bcc4ce);
  color: #07090d;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45), 0 5px 14px rgba(0, 0, 0, 0.35);
}

.gps-button.active {
  background: linear-gradient(180deg, #58f08b, #158949);
  border-color: rgba(98, 255, 150, 0.72);
  color: #041107;
}

.gps-button.waiting {
  background: linear-gradient(180deg, #ffe272, var(--accent));
  border-color: rgba(255, 224, 96, 0.82);
  color: #120d00;
}

.gps-button.error {
  background: linear-gradient(180deg, #ff7a5f, var(--alert));
  border-color: rgba(255, 94, 64, 0.82);
  color: #fff;
}

.map-shell {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.06), transparent 1px) 0 0 / 34px 34px,
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), transparent 1px) 0 0 / 34px 34px,
    #05070a;
}

.map-settings {
  position: absolute;
  top: 22px;
  right: 22px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  pointer-events: none;
}

.measurement-active .map-settings,
.measurement-page .map-settings {
  top: 20px;
  right: 20px;
}

.settings-button {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  background: rgba(10, 13, 19, 0.9);
  color: var(--text);
  font-size: 19px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.36);
  pointer-events: auto;
}

.settings-button.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #080a0f;
}

.settings-panel {
  min-width: 172px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(8, 10, 15, 0.94);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.48);
  color: var(--text);
  pointer-events: auto;
}

.settings-title {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.settings-title-secondary {
  margin-top: 10px;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.14);
}

.settings-panel label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 30px;
  font-size: 14px;
  cursor: pointer;
}

.settings-panel input {
  width: 16px;
  height: 16px;
  margin: 0;
}

.map-home-slot {
  flex: 1;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
}

.measurement-active .map-home-slot {
  display: none;
}

#map {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-width: 0;
  overflow: hidden;
  contain: layout paint;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: #05070a;
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.05),
    0 18px 42px rgba(0, 0, 0, 0.45);
}

#map .leaflet-container {
  overflow: hidden !important;
  contain: layout paint;
}

#map .leaflet-container,
#map .leaflet-pane,
#map .leaflet-map-pane,
#map .leaflet-tile-pane,
#map .leaflet-overlay-pane,
#map .leaflet-marker-pane,
#map .leaflet-shadow-pane {
  max-width: none;
}

#map .leaflet-tile,
#map .leaflet-marker-icon,
#map .leaflet-marker-shadow {
  max-width: none;
}

.leaflet-control-zoom a,
.leaflet-control-attribution {
  background: rgba(8, 10, 15, 0.88) !important;
  color: #eef4ff !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  cursor: pointer;
}

.leaflet-control-zoom a:hover {
  background: var(--accent) !important;
  color: #07090d !important;
}

.fieldpos-map-info {
  border: 1px solid rgba(255, 255, 255, 0.28) !important;
  border-radius: 6px;
  background: rgba(96, 101, 108, 0.68) !important;
  box-shadow: 0 2px 9px rgba(0, 0, 0, 0.25);
  color: #eef4ff !important;
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.28;
  padding: 6px 8px;
  backdrop-filter: blur(3px);
}

.map-info-title {
  margin-bottom: 2px;
  font-weight: 900;
}

.leaflet-control-scale {
  margin-left: 10px !important;
  margin-bottom: 10px !important;
}

.leaflet-control-scale-line {
  position: relative;
  min-width: 72px;
  height: 18px;
  padding: 0 7px 4px;
  border-top: 0 !important;
  border-right: 2px solid rgba(3, 6, 10, 0.88) !important;
  border-bottom: 3px solid rgba(3, 6, 10, 0.88) !important;
  border-left: 2px solid rgba(3, 6, 10, 0.88) !important;
  background: rgba(255, 255, 255, 0.84) !important;
  box-shadow: 0 1px 4px rgba(255, 255, 255, 0.7), 0 1px 7px rgba(0, 0, 0, 0.18);
  color: #020407 !important;
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  line-height: 15px;
  text-align: center;
  text-shadow: none;
}

body[data-base-map="satellite"] .leaflet-control-scale-line {
  border-right-color: rgba(255, 255, 255, 0.92) !important;
  border-bottom-color: rgba(255, 255, 255, 0.92) !important;
  border-left-color: rgba(255, 255, 255, 0.92) !important;
  background: rgba(8, 10, 15, 0.55) !important;
  box-shadow: 0 1px 7px rgba(0, 0, 0, 0.45);
  color: #fff !important;
}

.measurement-active #map,
.measurement-page #map {
  aspect-ratio: 1;
  height: auto;
}

.measurement-panel {
  flex: 1 1 auto;
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(8, 10, 15, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.measurement-form {
  display: grid;
  grid-template-rows: auto auto 1fr auto auto;
  gap: 7px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  height: 100%;
  padding: 8px;
}

.measurement-heading,
.measurement-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.measurement-kicker {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.measurement-heading h2 {
  margin: 0;
  font-size: 16px;
  font-weight: 650;
  text-transform: uppercase;
}

.measurement-top {
  display: grid;
  grid-template-columns: minmax(0, 0.82fr) minmax(0, 1.18fr);
  gap: 8px;
  min-height: 0;
  min-width: 0;
}

.measurement-side-fields {
  display: grid;
  gap: 5px;
  min-height: 0;
}

.measurement-map-slot {
  width: 100%;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
}

.measurement-side-fields label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.measurement-side-fields input {
  width: 100%;
  min-width: 0;
  height: 26px;
  padding: 0 7px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  background: rgba(5, 7, 10, 0.84);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.measurement-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  min-height: 0;
}

.measurement-grid label {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.measurement-grid input,
.measurement-grid textarea,
.measurement-output {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 2px;
  background: rgba(5, 7, 10, 0.84);
  color: var(--text);
  font: inherit;
  font-size: 12px;
}

.measurement-grid input {
  height: 28px;
  padding: 0 7px;
}

.measurement-grid input[readonly],
.measurement-side-fields input[readonly] {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(110, 119, 130, 0.24);
  color: rgba(244, 247, 251, 0.72);
}

.measurement-grid textarea,
.measurement-output {
  resize: vertical;
  padding: 6px 7px;
}

.checkbox-field {
  align-content: end;
  grid-template-columns: auto 1fr;
  min-height: 40px;
}

.checkbox-field input {
  width: 18px;
  height: 18px;
  align-self: center;
}

.wide-field {
  grid-column: span 2;
}

.measurement-button {
  min-height: 32px;
  border: 1px solid rgba(86, 215, 255, 0.36);
  border-radius: 2px;
  background: rgba(16, 20, 28, 0.92);
  color: #dbe5ef;
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
  cursor: pointer;
}

.measurement-button.primary {
  border-color: rgba(255, 176, 0, 0.86);
  background: linear-gradient(180deg, #ffe07a, var(--accent));
  color: #090a0d;
}

.measurement-output {
  min-height: 42px;
  max-height: 54px;
}

@media (min-width: 900px) {
  body:not(.measurement-active) .map-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 172px;
    grid-template-rows: minmax(0, 1fr);
    align-items: stretch;
  }

  body:not(.measurement-active) .map-settings {
    right: 204px;
  }

  body:not(.measurement-active) .map-home-slot {
    grid-column: 1;
    grid-row: 1;
  }

  body:not(.measurement-active) .map-type-dock {
    grid-column: 2;
    grid-row: 1;
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) auto;
    min-height: 0;
  }

  body:not(.measurement-active) .map-type-buttons {
    order: 1;
    grid-template-columns: 1fr;
    align-content: end;
  }

  body:not(.measurement-active) .map-type-buttons::before {
    grid-row: 5;
  }

  body:not(.measurement-active) .dock-logo {
    order: 2;
    min-height: 120px;
  }

  body:not(.measurement-active) .dock-logo img {
    width: 150px;
    max-height: 96px;
  }

  .measurement-panel {
    overflow: auto;
  }

  .measurement-form {
    grid-template-rows: auto auto auto auto auto;
    min-height: 100%;
    height: auto;
  }

  .measurement-top {
    grid-template-columns: minmax(220px, 320px) minmax(220px, 220px);
    justify-content: center;
    align-items: start;
  }

  .measurement-map-slot {
    max-width: 220px;
    justify-self: end;
  }

  .measurement-active #map,
  .measurement-page #map {
    max-height: 220px;
  }

  .measurement-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .measurement-output {
    min-height: 38px;
    max-height: 42px;
  }
}

.placeholder-panel {
  flex: 1;
}

.map-type-dock {
  display: grid;
  grid-template-columns: minmax(0, 300px) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 148px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.08), transparent),
    rgba(8, 10, 15, 0.96);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.dock-logo {
  width: 100%;
  height: 100%;
  min-height: 132px;
}

.dock-logo img {
  width: 288px;
  max-width: 94%;
  max-height: 104px;
}

.map-type-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
}

.map-type-buttons::before {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: center;
  height: 2px;
  margin: 2px 0;
  background: linear-gradient(90deg, transparent, rgba(255, 77, 47, 0.92), transparent);
  box-shadow: 0 0 8px rgba(255, 77, 47, 0.34);
  content: "";
}

.map-type-button,
.client-focus-select {
  min-width: 0;
  min-height: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 2px;
  background: rgba(16, 20, 28, 0.9);
  color: #dbe5ef;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0;
  cursor: pointer;
}

.client-focus-select {
  width: 100%;
  padding: 0 8px;
  appearance: none;
  text-align: center;
  text-align-last: center;
}

.client-focus-select:disabled {
  color: rgba(219, 229, 239, 0.46);
  cursor: default;
}

.map-action-button {
  border-color: rgba(86, 215, 255, 0.44);
}

.map-type-button.active {
  border-color: rgba(255, 176, 0, 0.86);
  background: linear-gradient(180deg, #ffe07a, var(--accent));
  color: #090a0d;
  box-shadow: 0 0 18px rgba(255, 176, 0, 0.24);
}

.map-type-button:focus-visible,
.client-focus-select:focus-visible,
.measurement-button:focus-visible,
.gps-button:focus-visible,
.settings-button:focus-visible,
.module-button:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 2px;
}

.fieldpos-marker,
.fieldpos-own-marker,
.fieldpos-measurement-marker {
  background: transparent;
  border: 0;
  overflow: visible;
}

.marker-dot {
  position: relative;
  width: 15px;
  height: 15px;
  border-radius: 999px;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px rgba(255, 176, 0, 0.36), 0 0 16px rgba(255, 176, 0, 0.48), 0 2px 7px rgba(0, 0, 0, 0.35);
}

.marker-dot.own {
  background: var(--accent);
}

.marker-dot.presence {
  background: var(--presence);
  border-width: 2px;
  box-shadow: 0 0 0 2px rgba(86, 215, 255, 0.26), 0 0 16px rgba(86, 215, 255, 0.44), 0 2px 7px rgba(0, 0, 0, 0.35);
}

.marker-dot.measurement {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  overflow: visible;
  border: 1px solid #071018;
  border-radius: 3px;
  background: #fff;
  color: #071018;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.72), 0 0 14px rgba(255, 176, 0, 0.52), 0 2px 7px rgba(0, 0, 0, 0.38);
}

.measurement-symbol {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 2px;
  object-fit: cover;
}

.marker-label {
  position: absolute;
  top: var(--label-offset, 23px);
  left: 50%;
  transform: translateX(-50%);
  max-width: 160px;
  padding: 3px 7px;
  border-radius: 7px;
  background: rgba(5, 7, 10, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.15;
}

.marker-label.presence-label {
  top: auto;
  bottom: calc(100% + var(--label-offset, 8px));
}

.marker-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.place-name-label {
  display: grid;
  place-items: center;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: rgba(3, 6, 10, 0.9);
  font-family: "Arial Narrow", "Roboto Condensed", Arial, sans-serif;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  text-align: center;
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.78);
  white-space: nowrap;
}

body[data-base-map="satellite"] .place-name-label {
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.72);
}

.place-name-label span {
  display: block;
  background: transparent !important;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.place-name-label.major {
  color: rgba(0, 0, 0, 0.96);
  font-size: 13px;
  text-transform: uppercase;
}

.place-name-label.medium {
  color: rgba(3, 6, 10, 0.92);
  font-size: 12px;
}

.place-name-label.small {
  color: rgba(3, 6, 10, 0.84);
  font-size: 11px;
  font-weight: 700;
}

.place-name-label.tiny {
  color: rgba(3, 6, 10, 0.72);
  font-size: 10px;
  font-weight: 700;
}

body[data-base-map="satellite"] .place-name-label.major {
  color: rgba(255, 255, 255, 0.96);
}

body[data-base-map="satellite"] .place-name-label.medium {
  color: rgba(235, 246, 255, 0.92);
}

body[data-base-map="satellite"] .place-name-label.small {
  color: rgba(230, 240, 246, 0.84);
}

body[data-base-map="satellite"] .place-name-label.tiny {
  color: rgba(224, 234, 238, 0.72);
}

.marker-measurement {
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--accent);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
}

.marker-label.measurement-point {
  top: var(--label-offset, 28px);
  max-width: 190px;
  border-color: rgba(255, 176, 0, 0.44);
  background: rgba(5, 7, 10, 0.92);
}

.measurement-popup {
  width: 100%;
  min-width: 0;
  max-width: 100%;
  color: #071018;
  font-family: var(--tech-font);
}

.measurement-popup strong {
  display: block;
  margin-bottom: 7px;
  font-size: 13px;
  text-transform: uppercase;
}

.measurement-popup dl {
  display: grid;
  gap: 4px;
  margin: 0;
}

.measurement-popup-row {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 8px;
  padding-top: 4px;
  border-top: 1px solid rgba(7, 16, 24, 0.12);
}

.measurement-popup dt,
.measurement-popup dd {
  margin: 0;
  font-size: 11px;
  line-height: 1.25;
}

.measurement-popup dt {
  color: rgba(7, 16, 24, 0.64);
  font-weight: 900;
  text-transform: uppercase;
}

.measurement-popup dd {
  overflow-wrap: anywhere;
  font-weight: 700;
}

.measurement-detail-sheet {
  position: fixed;
  inset: 0;
  z-index: 5000;
  display: grid;
  place-items: end center;
  padding: 12px;
  overflow: hidden;
}

.measurement-detail-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.48);
}

.measurement-detail-panel {
  position: relative;
  z-index: 1;
  width: min(520px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  max-height: min(76vh, 620px);
  overflow: auto;
  overscroll-behavior: contain;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 4px;
  background: #f7fafc;
  color: #071018;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.5);
}

.measurement-detail-header {
  position: sticky;
  top: -10px;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: -10px -10px 8px;
  padding: 9px 10px;
  background: #f7fafc;
  border-bottom: 1px solid rgba(7, 16, 24, 0.12);
}

.measurement-detail-header strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  text-transform: uppercase;
}

.measurement-detail-close {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border: 1px solid rgba(7, 16, 24, 0.22);
  border-radius: 2px;
  background: #fff;
  color: #071018;
  font: inherit;
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.measurement-detail-panel .measurement-popup > strong {
  display: none;
}

@media (min-width: 900px) {
  .measurement-detail-sheet {
    place-items: start end;
    padding: 78px 10px 10px;
    pointer-events: none;
  }

  .measurement-detail-backdrop {
    background: transparent;
    pointer-events: auto;
  }

  .measurement-detail-panel {
    width: min(360px, calc(100vw - 24px));
    max-height: calc(100vh - 88px);
    pointer-events: auto;
  }
}

@media (max-width: 620px) {
  .app-header {
    flex-wrap: nowrap;
    min-height: 54px;
    padding: 7px 8px;
    gap: 6px;
  }

  .brand-block {
    flex: 1 1 auto;
    gap: 6px;
    min-width: 0;
  }

  h1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 15px;
  }

  .module-nav {
    flex: 0 0 auto;
    gap: 4px;
    margin-left: 0;
  }

  .module-button {
    min-width: 31px;
    height: 34px;
    padding: 0 7px;
    font-size: 11px;
  }

  .back-button {
    min-width: 62px;
  }

  .kicker {
    display: none;
  }

  .status-panel {
    flex: 0 0 auto;
    justify-content: flex-end;
    min-width: 0;
    min-height: 36px;
    padding: 3px 4px;
    gap: 4px;
    font-size: 10px;
  }

  .status-symbol {
    display: none;
  }

  #status-text {
    max-width: 42px;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .gps-button {
    width: 34px;
    height: 34px;
    font-size: 14px;
  }

  .map-settings {
    top: 20px;
    right: 20px;
  }

  .settings-panel {
    min-width: 160px;
  }

  .measurement-active #map,
  .measurement-page #map {
    width: 100%;
    min-height: 0;
  }

  .measurement-form {
    padding: 7px;
    gap: 5px;
  }

  .measurement-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px 6px;
  }

  .wide-field {
    grid-column: span 2;
  }

  .measurement-heading h2 {
    font-size: 14px;
  }

  .map-type-dock {
    min-height: 120px;
    grid-template-columns: minmax(136px, 1.15fr) minmax(132px, 1fr);
    gap: 8px;
  }

  .dock-logo {
    min-height: 104px;
  }

  .dock-logo img {
    width: 210px;
    max-width: 94%;
    max-height: 86px;
  }

  .map-type-buttons {
    gap: 6px;
  }

  .map-type-button,
  .client-focus-select {
    font-size: 12px;
  }
}
