/* ==========================================================
   3D DJI Mission Planner – Stylesheet

   INHALT
   01  Allgemeine Grundeinstellungen
   02  Hauptlayout
   03  Linke Seitenleiste
   04  Karten- und Diagrammbereich
   05  Rechter Informationsbereich
   06  Allgemeine Formularelemente
   07  Buttons
   08–10  Orbit-Grundelemente
   11  Rahmen- und Ellipsengriffe
   12  Aufklappbare Einstellungskarten
   13–16  Mission, Orbit, Kamera und Mission erstellen
   17  Programm-Header
   18  Informationskarten und Wegpunkttabelle
   19  Karten-Widgets rechts
   20  Leaflet-Kartenumschalter
   21  Programm-Footer
   22  Höhenprofil neben Wegpunkttabelle
   23  Orbitfarben
   24  Aktionen

   HINWEIS
   Spätere Zustandsregeln für #mapPanel und #chartPanel sind
   absichtlich an ihrer bisherigen Position geblieben, damit
   sich das aktuelle Layout und die CSS-Kaskade nicht verändern.
========================================================== */

/* ==========================================================
   01 – Allgemeine Grundeinstellungen
========================================================== */

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
}

/* ==========================================================
   02 – Hauptlayout
========================================================== */

.container {
  display: grid;

  grid-template-columns:
    420px
    minmax(460px, 1fr);

  width: 100%;
  height: calc(100vh - 48px - 30px);

  overflow: hidden;
}

/* ==========================================================
   03 – Linke Seitenleiste
========================================================== */

#panel {
  min-width: 0;

  padding: 12px;

  overflow-y: auto;
  overflow-x: hidden;

background: #c5ccd4;
}

/* ==========================================================
   04 – Karten- und Diagrammbereich
========================================================== */

#centerPanel {

  position: relative;
  display: grid;

  grid-template-rows:
    minmax(0, 1fr)
    0;

  min-width: 0;
  height: 100%;

  overflow: hidden;

  transition: grid-template-rows 0.25s ease;
}

#centerPanel.heightProfileOpen {
  grid-template-rows:
    minmax(0, 1fr)
    160px;
}

/* ==========================================================
   04.1 – Karte
========================================================== */

#mapPanel {
  min-width: 0;
  min-height: 0;

  overflow: hidden;
}

#map {
  width: 100%;
  height: 100%;
}

/* ==========================================================
   04.2 – Höhenprofil
========================================================== */

#chartPanel {
  min-width: 0;
  min-height: 0;

  height: 220px;

  overflow: hidden;

  background: white;
  border-top: 0 solid #999;

  opacity: 0;
  visibility: hidden;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

#centerPanel.heightProfileOpen #chartPanel {
  border-top-width: 1px;

  opacity: 1;
  visibility: visible;
}

#heightChart {
  display: block;

  width: 100%;
  height: 100%;
}

/* ==========================================================
   05 – Rechter Informationsbereich
========================================================== */

#rightPanel {
  min-width: 0;
  height: 100vh;

  padding: 12px;

  overflow-y: auto;
  overflow-x: hidden;

  background: #f7f7f7;
  border-left: 1px solid #999;
}

/* ==========================================================
   06 – Allgemeine Formularelemente
========================================================== */

input,
select {
  width: 150px;

  padding: 5px;

  font-family: inherit;
  font-size: 13px;
}

/* ==========================================================
   06.1 – Kompakte Eingabezeilen
========================================================== */

.formRow {
  display: flex;
  align-items: center;

  gap: 4px;

  margin-bottom: 10px;
}

.formRow label {
  width: 120px;

  flex: 0 0 74px;

  font-size: 13px;
}

/* ==========================================================
   06.2 – Eingabefeldgrößen
========================================================== */

.inputSmall {
  width: 50px;
  margin: 0;
}

.inputMedium {
  width: 120px;
  margin: 0;
}

.inputLarge {
  width: 260px;
  margin:0;
}

/* ==========================================================
   06.3 – Einheiten
========================================================== */

.unit {
  min-width: 35px;

  white-space: nowrap;
}

/* ==========================================================
   07 – Buttons
========================================================== */

button {
  padding: 6px 12px;

  font-family: inherit;
  font-size: 14px;

  cursor: pointer;
}

/* ==========================================================
   07.1 – Buttonleisten
========================================================== */

.buttonRow {
  display: flex;

  gap: 8px;

  margin-bottom: 5px;
}

.buttonPrimary {
  flex: 2;

  height: 30px;

  font-weight: bold;
}

.buttonSecondary {
  flex: 1;

  height: 30px;

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

  font-size: 13px;
}

/* ==========================================================
   08 – Orbit: Qualitätsanzeige
========================================================== */

.qualityIndicator {
  display: inline-block;

  width: 12px;
  height: 12px;

  margin-left: 8px;

  border: 1px solid #666;
  border-radius: 50%;

  vertical-align: middle;
}

.qualityGreen {
  background: #33aa33;
}

.qualityYellow {
  background: #ffcc00;
}

.qualityRed {
  background: #dd3333;
}
/* ==========================================================
   09 – Radio-Buttons
========================================================== */

.radioLabel {
  display: flex;

  align-items: center;

  gap: 4px;

  width: auto !important;

  flex: none !important;

  margin-right: 12px;

  cursor: pointer;
}

.radioLabel input {
  width: auto;

  margin: 0;
}


/* ==========================================================
   11 – Karte: Rahmen- und Ellipsengriffe
========================================================== */

.ellipseHandleIcon {
  width: 12px;

  height: 12px;

  background: #2d7dff;

  border: 2px solid white;

  border-radius: 2px;

  box-sizing: border-box;

  box-shadow: 0 0 3px rgba(0, 0, 0, 0.4);
}
.orbitAltitudeLabel {
  background: transparent !important;
  border: none !important;
}

.orbitAltitudeLabel div {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}
.orbitNumberLabel,
.leaflet-div-icon.orbitNumberLabel {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.orbitNumberLabel div {
  font-size: 16px;
  font-weight: normal;
  color: #555;
  white-space: nowrap;
}
.orbitStartMarker,
.leaflet-div-icon.orbitStartMarker {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
}

.orbitStartMarker div {
  width: 18px;
  height: 18px;

  background: white;
  border: 2px solid #d33;
  border-radius: 50%;

  color: #d33;
  font-size: 11px;
  font-weight: bold;

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

  box-sizing: border-box;
}
/* ==========================================================
   12 – Aufklappbare Einstellungskarten
========================================================== */

.settingsCard {
  margin-bottom: 8px;

  border: 1px solid #c7cbd1;
  border-radius: 8px;

 background: #f7f8fa;

  overflow: hidden;
}

.settingsCardHeader {
  position: relative;

  padding: 9px 34px 9px 11px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  user-select: none;

  list-style: none;
}

.settingsCardHeader::-webkit-details-marker {
  display: none;
}

.settingsCardHeader::after {
  content: "›";

  position: absolute;
  top: 50%;
  right: 12px;

  font-size: 20px;
  font-weight: normal;

  transform: translateY(-50%) rotate(90deg);
  transition: transform 0.18s ease;
}

.settingsCard:not([open]) .settingsCardHeader::after {
  transform: translateY(-50%) rotate(0deg);
}

.settingsCardContent {
  padding: 10px 11px 4px;

  border-top: 1px solid #e1e3e6;
}
/* ==========================================================
   13 – Mission-Karte
========================================================== */

.missionTypeRow {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.missionTypeRow > label:first-child {
  width: 72px;
  flex: 0 0 72px;
  margin-bottom: 0;
}

.missionTypeRow .radioLabel {
  margin-right: 3px;
  margin-left: 8px;
}

.missionTypeRow #orbitCount {
  width: 44px;
  margin-left: 8px;
}

.altitudeModeRow {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
}

.altitudeModeRow > label:first-child {
  width: 78px;
  flex: 0 0 78px;
  margin-bottom: 0;
}

.altitudeModeRow .radioLabel {
  margin-right: 4px;
  white-space: nowrap;
}

.objectHeightRow input {
  margin-left: 0px;
}

.addressRow {
  display: grid;

  grid-template-columns:
    72px
    minmax(0, 1fr)
    auto;

  gap: 5px;
}

.addressRow > label {
  width: auto;
  flex: none;
}

.addressRow #searchPlace {
  width: 100%;
  min-width: 0;
}

.orbitHeightField input {
  margin-left: 0;
}

.orbitSpeedField label {
  width: 110px;
  flex: 0 0 110px;
}

.orbitSpeedField input {
   margin-left: 0;
}

/* Helix – Gimbal: horizontale Abstände */

/* Breite von "Modus:" und "Ziel:" */
.helixGimbalModeRow > label:first-child,
.helixGimbalTargetRow > label:first-child {
  width: 80px;
  flex: 0 0 80px;
}

/* Abstand zwischen Bezeichnung und erster Auswahl */
.helixGimbalModeRow,
.helixGimbalTargetRow {
  gap: 4px;
}

/* Abstand zwischen Auto / Manuell bzw. Mitte / Oberkante / Boden */
.helixGimbalModeRow .radioLabel,
.helixGimbalTargetRow .radioLabel {
  margin-right: 5px;
}

.helixGimbalModeRow,
.helixGimbalTargetRow {
  gap: 5px;
}
/* ==========================================================
   15 – Kamera-Karte
========================================================== */

.cameraSelectRow select {
  width: 170px;
  min-width: 0;
}

.cameraFrontRow input,
.cameraSideRow input,
.cameraSpeedRow input {
  margin-left: 0;
}

.cameraSpeedRow label {
  line-height: 1.15;
}

/* ==========================================================
   16 – Mission erstellen
========================================================== */

.missionActionCard {
  margin-bottom: 0;
}

.missionOptionRow {
  display: flex;
  align-items: center;
  gap: 16px;

  margin-bottom: 10px;
}

.checkboxLabel {
  display: flex;
  align-items: center;
  gap: 5px;

  font-size: 13px;
  cursor: pointer;
}

.checkboxLabel input {
  width: auto;
  margin: 0;
}

.missionMainButtons {
  margin-bottom: 6px;
}

.missionMainButtons > *,
.missionActionButtons > * {
  flex: 1 1 0;
  min-width: 0;
  justify-content: center;
  align-items: center;
  white-space: nowrap;
}

.polygonCardContent .objectHeightRow > label {
  width: 110px;
  flex: 0 0 110px;
}

.polygonCardContent .objectHeightRow input {
  margin-left: var(--polygon-input-offset);
}

.missionFileButtons {
  margin-bottom: 0;
}
/* ==========================================================
   17 – Programm-Header
========================================================== */

#appHeader {
  display: flex;

  justify-content: space-between;

  align-items: center;

  height: 48px;

  padding: 0 18px;

  background: #2f3b52;

  color: white;

  border-bottom: 1px solid #c7cbd1;

  position: relative;
}

#appTitleLeft {
  font-size: 20px;

  font-weight: 700;

  letter-spacing: 1px;
}

#appTitleRight {
  position: absolute;

  left: 50%;
  top: 50%;

  transform: translate(-50%, -50%);

  font-size: 18px;
  font-weight: 500;

  white-space: nowrap;
}

/* ==========================================================
   18 – Informationskarten
========================================================== */

.hiddenPositionData {
  display: none;
}

.infoCard {
  margin-bottom: 8px;

  border: 1px solid #c7cbd1;
  border-radius: 8px;

  background: #ffffff;

  overflow: hidden;
}

.infoCardHeader {
  position: relative;

  padding: 10px 34px 10px 12px;

  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  user-select: none;

  list-style: none;
}

.infoCardHeader::-webkit-details-marker {
  display: none;
}

.infoCardHeader::after {
  content: "›";

  position: absolute;
  top: 50%;
  right: 12px;

  font-size: 20px;

  transform:
    translateY(-50%)
    rotate(0deg);

  transition: transform 0.18s ease;
}

.infoCard[open] .infoCardHeader::after {
  transform:
    translateY(-50%)
    rotate(90deg);
}

.infoCardContent {
  padding: 10px 12px 12px;

  border-top: 1px solid #e1e3e6;
}

/* ----------------------------------------------------------
   18.1 – Missionsinfo
---------------------------------------------------------- */

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

  gap: 12px;

  padding: 5px 0;

  font-size: 13px;

  border-bottom: 1px solid #eeeeee;
}

.missionInfoRow:last-of-type {
  border-bottom: none;
}

.missionInfoRow strong {
  text-align: right;
  white-space: nowrap;
}

.batteryWarningRow {
  margin: 5px 0;
  padding: 8px 9px;
  border: 1px solid #d97706;
  border-radius: 6px;
  background: #fff3cd;
}

.batteryWarningRow strong {
  width: 100%;
  color: #9a3412;
  text-align: left;
  white-space: normal;
}

.orbitInfoSection {
  margin-top: 10px;
  padding-top: 8px;

  border-top: 1px solid #d9dce1;
}

.orbitInfoSection h4 {
  margin: 0 0 6px;

  font-size: 13px;
}

#infoOrbits {
  font-size: 13px;
  line-height: 1.45;
}

/* ----------------------------------------------------------
   18.2 – Wegpunkttabelle
---------------------------------------------------------- */

.waypointCardContent {
  padding: 0;
}

.waypointTableWrapper {
  max-height: calc(100vh - 190px);

  overflow: auto;
}

#waypointTable {
  width: 100%;

  border-collapse: collapse;

  font-size: 12px;
}

#waypointTable th,
#waypointTable td {
  padding: 6px 7px;

  border: 1px solid #d8dbe0;

  text-align: right;
  white-space: nowrap;
}

#waypointTable th {
  position: sticky;
  top: 0;
  z-index: 1;

  background: #f1f3f6;

  font-weight: 600;
}

#waypointTable th:first-child,
#waypointTable td:first-child {
  text-align: center;
}


/* ----------------------------------------------------------
   19.1 – Gemeinsamer Aufbau der Widgets
   Linke Werkzeugleiste
---------------------------------------------------------- */

.mapSideWidget {
  position: absolute;

  left: 12px;
  right: auto;

  z-index: 1200;

  width: 36px;
  height: 36px;

  transition: width 0.25s ease;
}


/*
 * Links verankert:
 * Beim Öffnen bleibt der Button an seiner Position.
 * Das Panel öffnet sich nach rechts.
 */
.mapSideWidget.isOpen {
  width: 406px;
}


/* ----------------------------------------------------------
   19.2 – Position der Buttons
---------------------------------------------------------- */

/*
 * 16 px bleibt vorerst für "Mein Standort" reserviert.
 * Abstand zwischen den Buttons: 54 px
 */

.locationWidget {
  top: 16px;
}

#satelliteMapWidget {
  top: 62px;
}

#terrain3DMapWidget {
  top: 108px;
}

.missionInfoWidget {
  top: 154px;
}

.waypointWidget {
  top: 200px;
}

.heightProfileWidget {
  top: 246px;
}

.objectFrameWidget {
  top: 292px;
}
/* ==========================================================
   Kartenansicht – MapLibre
========================================================== */

.mapModeWidget {
  top: 230px;
  width: 38px;
}


/* Dropdown-Menü */

.mapModeMenu {
  position: absolute;

  top: 0;
  right: 48px;

  width: 150px;

  padding: 6px;

  background: #ffffff;

  border: 1px solid #bfc5ce;
  border-radius: 8px;

  box-shadow:
    0 4px 14px rgba(0, 0, 0, 0.18);

  box-sizing: border-box;

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  z-index: 50;
}

/* ==========================================================
   Kartenansicht – Vector / Terrain Schalter
========================================================== */

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

  gap: 16px;

  padding: 8px 6px;
}


.mapModeToggleLabel {
  font-size: 14px;
  font-weight: 600;

  white-space: nowrap;
}


.mapModeToggle {
  min-width: 52px;

  padding: 5px 10px;

  border: 1px solid #bfc5ce;
  border-radius: 14px;

  background: #e2e6eb;

  color: #333333;

  font-size: 12px;
  font-weight: 600;

  cursor: pointer;

  transition:
    background 0.2s ease,
    color 0.2s ease;
}


.mapModeToggle.isActive {
  background: #2d7dff;
  color: #ffffff;
}

/* Menü geöffnet */

.mapModeWidget.isOpen .mapModeMenu {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}


/* Einträge */

.mapModeOption {
  display: block;

  width: 100%;

  padding: 8px 10px;

  border: 0;
  border-radius: 5px;

  background: transparent;

  text-align: left;
  white-space: nowrap;

  cursor: pointer;
}


/* Mouseover */

.mapModeOption:hover {
  background: #eef1f5;
}


/* Aktive Karte */

.mapModeOption.isActive {
  font-weight: 600;
}

.objectFrameWidget {
  top: 292px;
}

#toggleObjectFrame.isActive {
  background: #2f3b52;
  color: #ffffff;
}

/* ----------------------------------------------------------
   19.3 – Aussehen der Widget-Buttons
---------------------------------------------------------- */

.mapSideToolButton {
  position: absolute;

  top: 0;
  left: 0;

  z-index: 2;

  width: 36px;
  height: 36px;

  padding: 0;

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

  border: 1px solid #52627a;
  border-radius: 9px;

  background: #44536a;
  color: #f2c94c;

  font-size: 17px;
  font-weight: 600;

  box-shadow:
    0 3px 8px rgba(0, 0, 0, 0.22);

  cursor: pointer;

  transition:
    background 0.18s ease,
    border-color 0.18s ease,
    transform 0.18s ease;
}

.mapSideToolButton:hover {
  background: #f1f3f6;
}

.mapSideWidget.isOpen .mapSideToolButton {
  background: #263247;
  color: #f2c94c;
  border-color: #73839b;
}

.mapSideToolButton.isActive {
  background: #263247;
  color: #f2c94c;
  border-color: #73839b;
}

/* ----------------------------------------------------------
   19.4 – Ausfahrende Karten
---------------------------------------------------------- */

.mapSidePanel {
  position: absolute;

  top: 0;
  left: 46px;

  width: 360px;

  border: 1px solid #bfc5cd;
  border-radius: 8px;

  background: #f7f7f7;

  box-shadow: -8px 0 24px rgba(0, 0, 0, 0.18);

  opacity: 0;
  visibility: hidden;
  pointer-events: none;

  transform: translateX(20px);

  transition:
    opacity 0.2s ease,
    transform 0.25s ease,
    visibility 0.25s ease;

  overflow: hidden;
}

.mapSideWidget.isOpen .mapSidePanel {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
  pointer-events: auto;
}

/* ----------------------------------------------------------
   19.5 – Missionsinfo als Karten-Overlay
---------------------------------------------------------- */

:root {
  --planner-sidebar-width: 420px;
  --map-toolbar-offset: 58px;
  --waypoint-overlay-width: 480px;
  --mission-overlay-width: 340px;
  --overlay-gap: 12px;
}

#missionInfoOverlayPanel {
  position: fixed;

  /* gleiche Oberkante wie Wegpunkttabelle */
  top: 82px;

  /* Abstand vom rechten Rand */
  right: 12px;

  left: auto;

  width: var(--mission-overlay-width);
  height: calc(100vh - 138px);
  max-height: calc(100vh - 138px);

  z-index: 1250;
}

/* ----------------------------------------------------------
   19.4 – Wegpunkttabelle als Karten-Overlay
---------------------------------------------------------- */

#waypointOverlayPanel {
  position: fixed;

  /* etwas Abstand nach oben */
  top: 82px;

  /* rechts neben Einstellungsspalte und Symbolleiste */
  left: calc(var(--planner-sidebar-width) + var(--map-toolbar-offset));

  width: var(--waypoint-overlay-width);

  /* unten deutlich mehr Luft */
  height: calc(100vh - 138px);

  max-height: none;

  z-index: 1250;
}

#waypointTable th:first-child,
#waypointTable td:first-child {
  min-width: 92px;
}

#waypointTable th:last-child,
#waypointTable td:last-child {
  min-width: 52px;
}

.mapOverlayHeader {
  padding: 13px 16px;

  border-bottom: 1px solid #d8dbe0;

  background: #ffffff;

  font-size: 15px;
  font-weight: 600;
}

.mapOverlayContent {
  max-height: calc(100vh - 270px);

  padding: 12px 14px;

  overflow: auto;
}

.mapSideWidget.isHidden {
  display: none;
}
/* ==========================================================
   20 – Leaflet-Kartenumschalter
========================================================== */

.leaflet-control-layers-toggle {
    width: 30px !important;
    height: 30px !important;

    background-size: 20px 20px !important;
    background-position: center !important;
}

/* ==========================================================
   21 – Programm-Footer
========================================================== */

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

  width: 100%;
  height: 30px;

  padding: 0 14px;

  background: #2f3b52;
  color: #d8dee8;

  border-top: 1px solid #c7cbd1;

  font-size: 12px;
}

.appFooterLeft,
.appFooterRight {
  white-space: nowrap;
}

#waypointOverlayPanel .mapOverlayContent {
  height: calc(100% - 46px);

  padding: 0;

  overflow: hidden;
}

#waypointOverlayPanel .waypointTableWrapper {
  width: 100%;
  height: 100%;
  max-height: none;

  overflow: auto;
}

/* ==========================================================
   22 – Höhenprofil neben Wegpunkttabelle
========================================================== */

#chartPanel {
  position: fixed;

  /* genau zwischen Wegpunkttabelle und Missionsinfo */
  left: calc(
    var(--planner-sidebar-width) +
    var(--map-toolbar-offset) +
    var(--waypoint-overlay-width) +
    var(--overlay-gap)
  );
  right: calc(
    var(--mission-overlay-width) +
    var(--overlay-gap) +
    var(--overlay-gap)
  );

  /* Abstand unten wie Wegpunkttabelle */
  bottom: 58px;

  top: auto;

  width: auto;

  height: 220px;

  min-width: 0;
  min-height: 0;

  overflow: hidden;

  background: #ffffff;

  border: 1px solid #999;
  border-radius: 8px;

  opacity: 0;
  visibility: hidden;

  z-index: 1240;

  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}



/* ==========================================================
   23 – Orbitfarben 1 bis 10
========================================================== */

.orbitSettingsCard {
  --orbit-color: #1f77ff;

  border-left: 5px solid var(--orbit-color);
}

.orbitSettingsCardHeader {
  display: flex;
  align-items: center;
  gap: 8px;

  color: var(--orbit-color);
}

.orbitColorDot {
  display: inline-block;

  width: 10px;
  height: 10px;

  flex: 0 0 10px;

  border-radius: 50%;
  background: var(--orbit-color);
}

.orbitColor1 { --orbit-color: #1f77ff; }
.orbitColor2 { --orbit-color: #2ca02c; }
.orbitColor3 { --orbit-color: #ff9800; }
.orbitColor4 { --orbit-color: #9c27b0; }
.orbitColor5 { --orbit-color: #00a6a6; }
.orbitColor6 { --orbit-color: #8d6e63; }
.orbitColor7 { --orbit-color: #d4a000; }
.orbitColor8 { --orbit-color: #607d8b; }
.orbitColor9 { --orbit-color: #e91e63; }
.orbitColor10 { --orbit-color: #7cb342; }

.orbitNumberLabel,
.leaflet-div-icon.orbitNumberLabel {
  width: 22px !important;
  height: 22px !important;
}

.orbitNumberLabel div {
  width: 22px;
  height: 22px;

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

  border: 2px solid #ffffff;
  border-radius: 50%;

  color: #ffffff;
  font-size: 11px;
  font-weight: 700;

  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

.orbitColorMarker1 div { background: #1f77ff; }
.orbitColorMarker2 div { background: #2ca02c; }
.orbitColorMarker3 div { background: #ff9800; }
.orbitColorMarker4 div { background: #9c27b0; }
.orbitColorMarker5 div { background: #00a6a6; }
.orbitColorMarker6 div { background: #8d6e63; }
.orbitColorMarker7 div { background: #d4a000; }
.orbitColorMarker8 div { background: #607d8b; }
.orbitColorMarker9 div { background: #e91e63; }
.orbitColorMarker10 div { background: #7cb342; }

/* ==========================================================
   24 – Aktionen
========================================================== */

#actionsContainer {
  display: flex;
  flex-direction: column;
  gap: 8px;

  margin-bottom: 8px;
}

.actionItem {
  padding: 8px;

  border: 1px solid #d8dbe0;
  border-radius: 7px;

  background: #fafbfc;
}

.actionTitle {
  display: flex;

  justify-content: space-between;

  align-items: center;

  margin-bottom: 6px;

  font-size: 13px;

  font-weight: 600;
}

.actionHeader {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 8px;

  margin-bottom: 3px;

  color: #5c6572;

  font-size: 11px;
}

.actionRow {
  display: grid;

  grid-template-columns:
    minmax(0, 1fr)
    minmax(0, 1fr);

  gap: 8px;

  margin-bottom: 7px;
}

.actionRow select {
  width: 100%;
  min-width: 0;
}

.actionAll {
  display: flex;
  align-items: center;

  gap: 5px;

  width: auto;

  font-size: 12px;
}

.actionAll input {
  width: auto;
  margin: 0;
}

.addActionButton {
  width: 32px;
  height: 32px;

  padding: 0;

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

  border: 1px solid #bfc5cd;
  border-radius: 6px;

  background: #ffffff;
  color: #2f3b52;

  font-size: 22px;
  line-height: 1;
}
.deleteActionButton {
  border: none;

  background: transparent;

  cursor: pointer;

  font-size: 15px;

  padding: 2px 4px;
}

.deleteActionButton:hover {
  transform: scale(1.15);
}
/* ==========================================================
   Missionsbuttons – gleiche Größe
========================================================== */

.missionActionRow > * {
  flex: 1 1 0;
  min-width: 0;
}

.missionActionLink {
  display: flex;
  align-items: center;
  justify-content: center;

  height: 30px;

  padding: 6px 12px;

  color: inherit;
  text-decoration: none;

  border: 2px outset buttonborder;
  background: buttonface;
}
/* =========================================================
   Wegpunktnummern – Kartenmarker
   ========================================================= */

.waypointNumberIcon {
    background: transparent;
    border: none;
}

.waypointNumberBubble {
    width: var(--wp-size);
    height: var(--wp-size);

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

    box-sizing: border-box;

    border:
        var(--wp-border-width)
        solid
        var(--wp-border-color);

    border-radius: 50%;

    background: var(--wp-background);
    color: var(--wp-text-color);

    font-family: Arial, sans-serif;
    font-size: var(--wp-font-size);
    font-weight: 700;
    line-height: 1;

    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.55);

    cursor: pointer;
    user-select: none;
}
/* =========================================================
   Polygon – Wegpunktnummern
   ========================================================= */

.polygonWaypointIcon {
    background: transparent;
    border: none;
}

.polygonWaypointNumber {
    min-width: 24px;
    height: 18px;

    color: #111;

    font-family: Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;

    background: transparent;
    border: none;

    pointer-events: none;
    user-select: none;
}
.polygonWaypointStart {
    width: 22px;
    height: 22px;

    border: 2px solid red;
    border-radius: 50%;

    box-sizing: border-box;
}
/* ==========================================================
   Höhenmodus – Mission
========================================================== */

.altitudeModeRow {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 5px;

  margin-top: 14px;
  margin-bottom: 14px;
}

.altitudeModeRow > label:first-child {
  width: 72px;
  min-width: 72px;
  flex: 0 0 72px;
  margin-bottom: 0;
}

.altitudeModeRow .radioLabel {
  width: auto;
  min-width: 0;
  margin-left: 10px;
  gap: 3px;
  white-space: nowrap;
}

.altitudeModeRow input[type="radio"] {
  margin: 0;
}

/* ==========================================================
   10 – Orbit-Karte: frei einstellbares Layout
========================================================== */


/* Grundeinstellung für jede Orbit-Zeile */
.orbitSettingRow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}


/* Grundeinstellung der Beschriftungen */
.orbitSettingLabel {
  width: 110px;
  flex: 0 0 110px;
}


/* Grundeinstellung der Eingabefelder */
.orbitSettingInput {
  width: 60px;
}


/* ----------------------------------------------------------
   Radius
---------------------------------------------------------- */

.orbitRadiusRow {
  margin-top: 0;
}

.orbitRadiusLabel {
  margin-left: 0;
}

.orbitRadiusInput {
  margin-left: 0;
}

.orbitRadiusUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Höhe
---------------------------------------------------------- */

.orbitHeightRow {
  margin-top: 0;
}

.orbitHeightLabel {
  margin-left: 0;
}

.orbitHeightInput {
  margin-left: 0;
}

.orbitHeightUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Geschwindigkeit
---------------------------------------------------------- */

.orbitSpeedRow {
  margin-top: 0;
}

.orbitSpeedLabel {
  margin-left: 0;
}

.orbitSpeedInput {
  margin-left: 0;
}

.orbitSpeedUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Wegpunkte
---------------------------------------------------------- */

.orbitWaypointsRow {
  margin-top: 0;
}

.orbitWaypointsLabel {
  margin-left: 0;
}

.orbitWaypointsInput {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Überlappung
---------------------------------------------------------- */

.orbitOverlapSection {
  margin-top: 14px;
  margin-bottom: 14px;
}

.orbitOverlapTitle {
  margin-bottom: 6px;
  font-size: 12px;
}

.orbitOverlapRow {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  font-size: 11px;
}

.orbitFrontDisplay {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.orbitSideDisplay {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
}

.orbitFrontDisplay span,
.orbitSideDisplay span {
  font-size: 11px;
}


/* ----------------------------------------------------------
   Gimbal
---------------------------------------------------------- */

.orbitGimbalRow {
  margin-top: 0;
}

.orbitGimbalLabel {
  margin-left: 0;
}

.orbitGimbalAuto {
  margin-left: 0;
}

.orbitGimbalManual {
  margin-left: 0;
}

.orbitGimbalInputBox {
  margin-left: 0;
}

/* ==========================================================
   15 – Helix-Karte: frei einstellbares Layout
========================================================== */


/* ----------------------------------------------------------
   Gemeinsame Grundeinstellungen
---------------------------------------------------------- */

.helixCardContent {
  /* Gemeinsame Position ALLER Eingabefelder */
  --helix-input-offset: 40px;
}


/* Grundeinstellung für jede Helix-Zeile */
.helixSettingRow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}


/* Grundeinstellung der Beschriftungen */
.helixSettingLabel {
  width: 110px;
  flex: 0 0 110px;
}


/* Grundeinstellung der Eingabefelder */
.helixSettingInput {
  width: 60px;
  margin-left: var(--helix-input-offset);
}


/* ----------------------------------------------------------
   Radius unten
---------------------------------------------------------- */

.helixRadiusBottomRow {
  margin-top: 0;
}

.helixRadiusBottomLabel {
  margin-left: 0;
}

.helixRadiusBottomUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Radius oben
---------------------------------------------------------- */

.helixRadiusTopRow {
  margin-top: 0;
}

.helixRadiusTopLabel {
  margin-left: 0;
}

.helixRadiusTopUnit {
  margin-left: 0;
}

/* ----------------------------------------------------------
   Punkte / Umlauf
---------------------------------------------------------- */

.helixPointsRow {
  margin-top: 0;
}

.helixPointsLabel {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Start
---------------------------------------------------------- */

.helixStartHeightRow {
  margin-top: 0;
}

.helixStartHeightLabel {
  margin-left: 0;
}


.helixStartHeightUnit {
  margin-left: 0;
}

/* ----------------------------------------------------------
   Ende
---------------------------------------------------------- */

.helixEndHeightRow {
  margin-top: 0;
}

.helixEndHeightLabel {
  margin-left: 0;
}


.helixEndHeightUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Umläufe
---------------------------------------------------------- */

.helixTurnsRow {
  margin-top: 0;
}

.helixTurnsLabel {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Geschwindigkeit
---------------------------------------------------------- */

.helixSpeedRow {
  margin-top: 0;
}

.helixSpeedLabel {
  margin-left: 0;
}

.helixSpeedUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Überlappung
---------------------------------------------------------- */

.helixOverlapSection {
  margin-top: 14px;
  margin-bottom: 14px;
}

.helixOverlapTitle {
  margin-bottom: 10px;
}

.helixFrontRow {
  display: flex;
  align-items: center;
  gap: 5px;
}

/*
.helixRadiusBottomInput {
  margin-left: 50px;
}
*/

/*
.helixRadiusTopInput {
  margin-left: 50px;
}
*/

/*
.helixPointsInput {
  margin-left: 50px;
}
*/

/*
.helixStartHeightInput {
  margin-left: 50px;
}
*/

/*
.helixEndHeightInput {
  margin-left: 50px;
}
*/

/*
.helixTurnsInput {
  margin-left: 50px;
}
*/

/*
.helixSpeedInput {
  margin-left: 50px;
}
*/

/* ==========================================================
   16 – Polygon-Karte: frei einstellbares Layout
========================================================== */


/* ----------------------------------------------------------
   Gemeinsame Grundeinstellungen
---------------------------------------------------------- */

.polygonCardContent {
  /* Gemeinsame horizontale Position aller Eingabefelder */
  --polygon-input-offset: 40px;
}


/* Grundeinstellung für Eingabezeilen */
.polygonSettingRow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}


/* Beschriftungen */
.polygonSettingLabel {
  width: 110px;
  flex: 0 0 110px;
}


/* Eingabefelder und Auswahlfelder */
.polygonSettingInput {
  width: 60px;
  margin-left: var(--polygon-input-offset);
}

/* Lange Kartierungsbezeichnungen vollständig anzeigen. */
#mappingSettings .mappingWideSelect {
  width: 170px;
  max-width: calc(100% - 150px);
}

.mappingActionRow {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

#mappingSetStart.isActive {
  outline: 2px solid #ff8a00;
  background: #fff3df;
}


/* ----------------------------------------------------------
   Starthöhe
---------------------------------------------------------- */

.polygonStartHeightRow {
  margin-top: 0;
}

.polygonStartHeightLabel {
  margin-left: 0;
}

.polygonStartHeightUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Endhöhe
---------------------------------------------------------- */

.polygonEndHeightRow {
  margin-top: 0;
}

.polygonEndHeightLabel {
  margin-left: 0;
}

.polygonEndHeightUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Polygone
---------------------------------------------------------- */

.polygonLevelsRow {
  margin-top: 0;
}

.polygonLevelsLabel {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Wegpunktabstand
---------------------------------------------------------- */

.polygonWaypointDistanceRow {
  margin-top: 0;
}

.polygonWaypointDistanceLabel {
  margin-left: 0;
}

.polygonWaypointDistanceUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Geschwindigkeit
---------------------------------------------------------- */

.polygonSpeedRow {
  margin-top: 0;
}

.polygonSpeedLabel {
  margin-left: 0;
}

.polygonSpeedUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Foto
---------------------------------------------------------- */

.polygonPhotoRow {
  margin-top: 0;
}

.polygonPhotoLabel {
  margin-left: 0;
}


/* ----------------------------------------------------------
   POI-Höhe
---------------------------------------------------------- */

.polygonPoiHeightRow {
  margin-top: 0;
}

.polygonPoiHeightLabel {
  margin-left: 0;
}

.polygonPoiHeightUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Gimbal
---------------------------------------------------------- */

.polygonGimbalModeRow {
  margin-top: 0;
}

.polygonGimbalModeLabel {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Manueller Gimbal
---------------------------------------------------------- */

.polygonManualGimbalRow {
  margin-top: 0;
}

.polygonManualGimbalLabel {
  margin-left: 0;
}

.polygonManualGimbalUnit {
  margin-left: 0;
}


/* ----------------------------------------------------------
   Info: Höhenabstand / Wegpunkte
---------------------------------------------------------- */

.polygonInfoRow {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 8px;
}

.polygonInfoLabel {
  width: 140px;
  flex: 0 0 140px;
}


/* ----------------------------------------------------------
   Überlappung
---------------------------------------------------------- */

.orbitDensityRow {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 3px;
}

.orbitDensitySelect {
  width: 220px;
  max-width: calc(100% - 92px);
}

.orbitDensityHint {
  margin: 0 0 9px;
  color: #5f6874;
  font-size: 11px;
  line-height: 1.25;
}

.polygonOverlapSection {
  margin-top: 14px;
  margin-bottom: 14px;
}

.polygonOverlapTitle {
  margin-bottom: 10px;
}

.polygonOverlapRow {
  display: flex;
  align-items: center;
  gap: 24px;
}

.polygonFrontDisplay,
.polygonSideDisplay {
  display: flex;
  align-items: center;
  gap: 5px;
}


/* ----------------------------------------------------------
   Polygon – Layout-Feinschliff
   Nur gezielte Breiten und Abstände
---------------------------------------------------------- */

/* Bearbeiten: "Polygon 10" / "Alle" vollständig sichtbar */
#polygonActiveLevel {
  width: 120px;
}

/* Höhe Polygon 1: Beschriftung darf nicht umbrechen */
.polygonStartHeightLabel {
  width: 110px;
  flex: 0 0 110px;
  white-space: nowrap;
}

/* Foto-Auswahl breit genug für "Auto Sekunden" */
#polygonPhotoMode {
  width: 118px;
}

/* Zahlenfeld Meter/Sekunden etwas kompakter */
#polygonPhotoInterval {
  width: 52px;
  margin-left: 4px;
}

/* Abstand Ebenen kompakt in einer Zeile */
.polygonHeightSpacingRow {
  margin-top: 4px;
  margin-bottom: 5px;

  flex-wrap: nowrap;
  white-space: nowrap;
}

.polygonHeightSpacingRow .polygonInfoLabel {
  width: 140px;
  flex: 0 0 140px;
}

#polygonHeightSpacing {
  white-space: nowrap;
}

/* Überlappung komplett in einer Zeile */
.polygonOverlapSection {
  display: flex;
  align-items: center;

  gap: 7px;

  margin-top: 8px;
  margin-bottom: 10px;

  white-space: nowrap;
}

.polygonOverlapTitle {
  margin: 0;

  font-size: 12px;
  flex: 0 0 auto;
}

.polygonOverlapRow {
  display: flex;
  align-items: center;

  gap: 7px;

  font-size: 12px;
  min-width: 0;
}

.polygonFrontDisplay,
.polygonSideDisplay {
  display: flex;
  align-items: center;

  gap: 2px;
}

.polygonOverlapSection .qualityIndicator {
  width: 10px;
  height: 10px;

  margin-left: 1px;
}

/* Aktiv-Zeile separat einstellbar */
.polygonActiveInfoRow {
  font-size: 13px;
}

/* ==========================================================
   Toolbar – SVG-Symbole
========================================================== */

.toolbarIcon {
  width: 23px;
  height: 23px;
  display: block;

  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.toolbarIconWhite {
  fill: none;
  stroke: #ffffff;
  stroke-width: 2;
}

.toolbarIconYellow {
  fill: none;
  stroke: #f2c94c;
  stroke-width: 2;
}

.toolbarIconYellowFill {
  fill: #f2c94c;
  stroke: none;
}
#missionDatabaseStatus {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 10020;
  max-width: min(440px, calc(100vw - 48px));
  padding: 12px 18px;
  border-radius: 8px;
  background: #173b68;
  color: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 0.18s ease, transform 0.18s ease;
}

#missionDatabaseStatus.visible {
  opacity: 1;
  transform: translateY(0);
}

#missionLibraryOverlay {
  position: fixed;
  inset: 0;
  z-index: 10010;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 19, 35, 0.58);
}

#missionLoadChoiceOverlay,
.missionChoiceOverlay {
  position: fixed;
  inset: 0;
  z-index: 10011;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(8, 19, 35, 0.58);
}

.missionLoadChoicePanel {
  width: min(430px, 100%);
  padding: 24px;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
  text-align: center;
}

.missionLoadChoicePanel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.missionLoadChoicePanel p {
  margin: 0 0 20px;
  color: #5e6c7c;
}

.missionLoadChoiceActions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.missionLoadChoiceActions button {
  padding: 12px 14px;
  border: 1px solid #2f67b2;
  border-radius: 6px;
  background: #2f67b2;
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.missionLoadChoiceCancel {
  margin-top: 15px;
  padding: 7px 12px;
  border: 0;
  background: transparent;
  color: #5e6c7c;
  cursor: pointer;
}

@media (max-width: 480px) {
  .missionLoadChoiceActions {
    grid-template-columns: 1fr;
  }
}

.missionLibraryPanel {
  width: min(850px, 100%);
  max-height: min(720px, calc(100vh - 48px));
  overflow: hidden;
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.38);
}

.missionLibraryHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  border-bottom: 1px solid #d9e0e8;
}

.missionLibraryHeader h2 {
  margin: 0;
  font-size: 21px;
}

.missionLibraryHeader button {
  border: 0;
  background: transparent;
  color: #33465c;
  font-size: 30px;
  cursor: pointer;
}

.missionLibraryList {
  max-height: calc(min(720px, 100vh - 48px) - 66px);
  overflow: auto;
  padding: 10px 20px 20px;
}

.missionLibraryRow {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #e6ebf0;
}

.missionLibraryInfo {
  min-width: 0;
}

.missionLibraryInfo strong,
.missionLibraryInfo small {
  display: block;
}

.missionLibraryInfo strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missionLibraryInfo small {
  margin-top: 4px;
  color: #6b7785;
}

.missionLibraryActions {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-end;
}

.missionLibraryActions button {
  min-width: 58px;
  padding: 7px 10px;
  border: 1px solid #2f67b2;
  border-radius: 5px;
  background: #fff;
  color: #2f67b2;
  font-weight: 700;
  cursor: pointer;
}

.missionLibraryActions button:first-child {
  background: #2f67b2;
  color: #fff;
}

.missionLibraryActions button:disabled {
  border-color: #c8d0da;
  color: #a1abb7;
  background: #f4f6f8;
  cursor: default;
}

/* In der Demo bleiben Datei- und Exportfunktionen sichtbar, aber gesperrt. */
.missionActionCard button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  filter: grayscale(0.8);
}

@media (max-width: 650px) {
  .missionLibraryRow {
    grid-template-columns: 1fr;
  }

  .missionLibraryActions {
    justify-content: flex-start;
  }
}
