/* COD2 map extension */
html.fctt-map-page-lock-root {
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

body.fctt-map-page-lock {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow-x: hidden;
  overflow-x: clip;
  overscroll-behavior-x: none;
  touch-action: pan-y;
}

@supports selector(html:has(body)) {
  html:has(body.fctt-map-page-lock) {
    overflow-x: hidden;
    overflow-x: clip;
    overscroll-behavior-x: none;
  }
}

body.fctt-map-page-lock .shell.map-page-lock-shell,
body.fctt-map-page-lock .shell.map-page-lock-shell > .phone,
body.fctt-map-page-lock .shell.map-page-lock-shell > .phone > .app.map-page-lock,
body.fctt-map-page-lock .map-content,
body.fctt-map-page-lock .terrain-map-panel {
  min-width: 0;
  max-width: 100%;
  overflow-x: hidden;
  overflow-x: clip;
}

body.fctt-map-page-lock .shell.map-page-lock-shell {
  width: 100%;
  max-width: 100vw;
  grid-template-columns: minmax(0, 1fr);
  justify-items: center;
  padding-left: 0;
  padding-right: 0;
}

body.fctt-map-page-lock .shell.map-page-lock-shell > .phone {
  width: min(430px, 100%);
}

body.fctt-map-page-lock .app.map-page-lock {
  width: 100%;
  overflow-y: auto;
  overscroll-behavior-x: none;
  overscroll-behavior-y: auto;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

body.fctt-map-page-lock .leaflet-map-frame,
body.fctt-map-page-lock .leaflet-map-frame .leaflet-container {
  touch-action: none;
}

.map-content {
  align-items: center;
  overflow-anchor: none;
}

.terrain-map-panel {
  width: min(100%, 720px);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.leaflet-map-frame {
  width: 100%;
  min-height: 420px;
  aspect-ratio: 1 / .9;
  overflow: hidden;
  border: 1px solid #b9c5d6;
  border-radius: 8px;
  background: #dce5ef;
  position: relative;
  touch-action: none;
}

.leaflet-map-frame .leaflet-container {
  width: 100%;
  height: 100%;
}

.terrain-route-selector {
  display: grid;
  gap: 5px;
}

.terrain-route-selector span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.terrain-route-selector select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 0 12px;
  font-size: 16px;
  font-weight: 900;
}

.terrain-route-meta {
  margin: -3px 2px 0;
  color: #647086;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.25;
  text-align: right;
}

.terrain-map-controls button,
.map-training-legend button {
  min-height: 48px;
}

.terrain-map-controls {
  display: grid;
  grid-template-columns: .8fr 1.35fr .8fr 1.55fr 2fr;
  gap: 8px;
}

.map-training-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.map-training-empty {
  margin: 0;
  border: 1px dashed #c8d2e0;
  border-radius: 8px;
  background: #f8fafc;
  color: var(--muted);
  padding: 12px;
  font-size: 14px;
  font-weight: 900;
  text-align: center;
}

.map-training-point-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
}

.map-training-legend button,
.map-popup-point {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.map-training-legend b,
.map-popup-point b {
  width: 28px;
  height: 28px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--sdis-gold);
  color: #fff;
  flex: 0 0 auto;
}

.map-training-point-main {
  justify-content: flex-start;
}

.map-training-point-main span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-training-point-delete {
  flex: 0 0 auto;
  border-color: #f1c7c7;
  background: #fff5f5;
  color: #b42318;
  font-size: 13px;
  padding: 0 10px;
}

.leaflet-training-point-wrap,
.leaflet-vehicle-heading-wrap,
.leaflet-route-start-wrap {
  background: transparent;
  border: 0;
}

.leaflet-route-start-wrap span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 10px;
  border: 2px solid #fff;
  border-radius: 999px;
  background: #172033;
  color: #fff;
  box-shadow: 0 2px 7px rgba(0, 0, 0, .28);
  font-size: 12px;
  font-weight: 900;
}

.map-popup-point {
  min-height: 30px;
  padding: 3px 7px 3px 3px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .95);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.leaflet-vehicle-heading {
  width: 34px;
  height: 34px;
  display: block;
  position: relative;
  transform-origin: center;
}

.leaflet-vehicle-heading::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 2px;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 24px solid #1b65c9;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .35));
  transform: translateX(-50%);
}

.leaflet-vehicle-heading::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 12px;
  width: 10px;
  height: 10px;
  border: 3px solid #fff;
  border-radius: 999px;
  transform: translateX(-50%);
}

.terrain-map-coords {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.map-point-photo-input {
  display: none;
}

@media (max-width: 520px) {
  .leaflet-map-frame {
    min-height: 360px;
  }

  .terrain-map-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-training-legend {
    grid-template-columns: 1fr;
  }
}
