:root {
  --tsa-blue: #1f4f9a;
  --tsa-light-blue: #8faee0;
  --tsa-red: #d71920;
  --tsa-white: rgba(255,255,255,0.94);
  --tsa-shadow: 0 6px 18px rgba(0,0,0,0.28);
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: Arial, sans-serif;
}

#map {
  height: 100vh;
  width: 100%;
  background: #e9eef2;
}

.coord-box {
  background: var(--tsa-white);
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 5px solid var(--tsa-blue);
  font-family: monospace;
  font-size: 16px;
  line-height: 1.45;
  color: #102a4c;
  box-shadow: var(--tsa-shadow);
}



.map-image-control img {
  width: 150px;
  border-radius: 8px;
  background: white;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.map-image-control-2 img {
  width: 150px;
  border-radius: 8px;
  background: #0E355A;
  padding: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaflet-top.leaflet-left {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.leaflet-top.leaflet-left .leaflet-control {
  margin-top: 10px;
}

.leaflet-control-layers {
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaflet-control-layers label:hover {
  color: var(--tsa-blue);
}

.leaflet-control-scale {
  font-size: 16px;
}

.leaflet-control-scale-line {
  border: 2px solid black;
  border-top: none;
  background: rgba(255,255,255,0.9);
  color: black;
  font-weight: bold;
  font-size: 16px;

  padding: 4px 8px;
  width: auto !important;
  height: auto !important;
  min-width: 50px;

  border-radius: 4px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.leaflet-control-layers {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 10px 12px;
  border: none;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
  font-family: "Segoe UI", sans-serif;
}

.leaflet-control-layers label {
  font-size: 14px;
  color: #222;
  margin: 6px 0;
}

.leaflet-control-layers input {
  accent-color: #d71920;
  transform: scale(1.1);
  margin-right: 8px;
}

.leaflet-top.leaflet-right {
  top: 20px;
  right: 20px;
}


.leaflet-control-layers {
  background: var(--tsa-white);
  border-radius: 12px;
  padding: 12px 14px;
  border-top: 5px solid var(--tsa-blue);
  box-shadow: var(--tsa-shadow);
  font-family: Arial, sans-serif;
}

.leaflet-container {
    cursor: default !important;
}

.leaflet-grab {
    cursor: default !important;
}

.leaflet-dragging .leaflet-grab,
.leaflet-dragging .leaflet-container {
    cursor: default !important;
}

.layers-title {
  color: var(--tsa-blue);
  font-weight: 700;
  cursor: pointer;
  user-select: none;

  display: flex;
  justify-content: space-between;
  align-items: center;

  padding-bottom: 8px;
  margin-bottom: 8px;
  border-bottom: 2px solid var(--tsa-light-blue);
}

.layers-toggle {
  font-size: 12px;
}

.layers-content {
  overflow: hidden;
  transition: max-height 0.25s ease;
  max-height: 300px;
}

.layers-content.collapsed {
  max-height: 0;
  margin-top: 0;
}


.measure-control {
  background: var(--tsa-white);
  color: var(--tsa-blue);
  padding: 10px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: var(--tsa-shadow);
  border-left: 5px solid var(--tsa-blue);
}

.measure-control:hover {
  background: white;
}

.measure-control.active {
  background: var(--tsa-blue);
  color: white;
}

.leaflet-container.measuring {
  cursor: crosshair !important;
}

.measure-tooltip {
  background: #ffe600;
  color: #111;
  border: 2px solid #222;
  border-radius: 4px;
  font-weight: 700;
  padding: 4px 8px;
}

.measure-result-box {
  background: var(--tsa-white);
  color: #102a4c;
  padding: 10px 14px;
  border-radius: 8px;
  border-left: 5px solid var(--tsa-blue);
  font-family: Arial, sans-serif;
  font-size: 15px;
  line-height: 1.4;
  box-shadow: var(--tsa-shadow);
}

.layers-title {
  font-weight: bold;
  cursor: pointer;
  padding: 6px 4px;
  user-select: none;
}

.layers-toggle {
  float: right;
}

.layers-content {
  padding-left: 14px;
}

.layers-content.collapsed {
  display: none;
}

.date-list {
    margin-left: 15px;
}

.date-list.collapsed {
    display: none;
}

.project-title {
    cursor: pointer;
    font-weight: bold;
    padding: 4px 0;
    display: flex;
    justify-content: space-between;
    user-select: none;
}

.layers-toggle {
    margin-left: 10px;
}

@media (max-width: 600px) {
  .map-image-control,
  .map-image-control-2,
  .coord-box {
    display: none !important;
  }
}

@media (max-width: 768px) {
  .map-title {
    font-size: 18px;
    padding: 8px 14px;
  }
}


/* --------------------
   Background map switcher
   Small preview windows in the top-right corner
-------------------- */
.background-switcher-control {
  display: flex;
  gap: 8px;
  background: rgba(255, 255, 255, 0.92);
  padding: 8px;
  border-radius: 10px;
  box-shadow: var(--tsa-shadow);
  border: 1px solid rgba(0,0,0,0.25);
}

.background-switcher-item {
  position: relative;
  width: 82px;
  height: 58px;
  padding: 0;
  border: 3px solid #000;
  border-radius: 6px;
  overflow: hidden;
  cursor: pointer;
  background-size: cover;
  background-position: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35);
}

.background-switcher-item:hover {
  transform: translateY(-1px);
}

.background-switcher-label {
  position: absolute;
  top: 4px;
  left: 4px;
  right: 4px;
  background: rgba(255,255,255,0.88);
  color: #111;
  border-radius: 4px;
  padding: 2px 4px;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.1;
  text-align: center;
}

.background-switcher-checkmark {
  display: none;
  position: absolute;
  left: 5px;
  bottom: 5px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #111;
  color: #fff;
  border: 2px solid #fff;
  font-size: 15px;
  font-weight: 900;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 2px 5px rgba(0,0,0,0.45);
}

.background-switcher-item.active .background-switcher-checkmark {
  display: block;
}

@media (max-width: 768px) {
  .background-switcher-control {
    display: none !important;
  }
}






/* --------------------
   Compact icon-only tool launcher below Loftmynd/Kort
-------------------- */
.map-tool-launcher {
  display: flex;
  gap: 6px;
  background: rgba(255, 255, 255, 0.92);
  padding: 6px;
  border-radius: 10px;
  box-shadow: var(--tsa-shadow);
  border: 1px solid rgba(0,0,0,0.22);
}

.map-tool-launcher-btn {
  width: 42px;
  height: 42px;
  border: 2px solid #102a4c;
  border-radius: 8px;
  background: white;
  color: #102a4c;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: Arial, sans-serif;
  font-weight: 900;
  box-shadow: 0 2px 5px rgba(0,0,0,0.22);
}

.map-tool-launcher-btn:hover {
  transform: translateY(-1px);
  background: #f6f8fc;
  border-color: var(--tsa-blue);
  color: var(--tsa-blue);
}

.map-tool-launcher-icon {
  font-size: 23px;
  line-height: 1;
}

.tool-panel-close {
  border: none;
  border-radius: 5px;
  background: var(--tsa-red, #d71920);
  color: white;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  line-height: 20px;
  width: 24px;
  height: 24px;
  padding: 0;
}

.tool-panel-close:hover {
  filter: brightness(1.08);
}

.tool-panel-title-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

@media (max-width: 700px) {
  .map-tool-launcher {
    display: none !important;
  }
}


.map-tool-draw .map-tool-launcher-icon {
  font-size: 22px;
}


/* DXF launcher button text variant */
.map-tool-launcher-text-icon {
  font-size: 13px !important;
  font-weight: 900;
  letter-spacing: 0.03em;
}


/* KML launcher button */
.map-tool-kml .map-tool-launcher-text-icon {
  font-size: 12px !important;
}

/* --------------------
   Phone/tablet lockout: hide feature buttons and floating controls
   Works in both portrait and landscape.
-------------------- */
@media (pointer: coarse), (hover: none), (max-width: 900px), (max-height: 520px) {
  .map-tool-launcher,
  .background-switcher-control,
  .map-image-control,
  .map-image-control-2,
  .coord-box,
  .measurement-panel,
  .drawing-panel,
  .kml-layer-panel,
  .dxf-export-panel,
  .time-travel-panel,
  #time-travel-divider,
  .lidar-open-control,
  .lidar-panel,
  .video-panel {
    display: none !important;
    pointer-events: none !important;
  }
}
