#clear-tracks-btn,
#file-selection-popup,
#upload-controls-overlay,
#altitude-filter {
  display: none !important;
}

.flightmap-hidden-control {
  display: none;
}

.flightmap-light {
  --flightmap-surface: rgba(255, 255, 255, 0.96);
  --flightmap-surface-strong: rgba(255, 255, 255, 0.98);
  --flightmap-surface-muted: rgba(248, 250, 252, 0.92);
  --flightmap-panel: rgba(15, 23, 42, 0.88);
  --flightmap-panel-alt: rgba(30, 41, 59, 0.92);
  --flightmap-border: rgba(148, 163, 184, 0.22);
  --flightmap-shadow: 0 18px 38px rgba(15, 23, 42, 0.18);
  --flightmap-text: #0f172a;
  --flightmap-text-muted: #64748b;
  --flightmap-text-inverse: #f8fafc;
  --flightmap-accent: #aedb34;
  --flightmap-accent-strong: #9ac32d;
}

.flightmap-map-panel {
  flex: 1;
  position: relative;
  min-width: 0;
}

.ol-map-view-switch {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 6500;
  display: inline-flex;
  gap: 4px;
  padding: 4px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.24);
  backdrop-filter: blur(8px);
}

.flightmap-light .ol-map-view-switch {
  right: auto;
  left: 14px;
}

.ol-map-view-switch__button {
  min-width: 42px;
  border: 0;
  border-radius: 999px;
  padding: 7px 11px;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.ol-map-view-switch__button.is-active,
.ol-map-view-switch__button[aria-pressed="true"] {
  background: #ffffff;
  color: #0f172a;
}

.ol-map-3d {
  position: relative;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  contain: layout size paint;
  background: #0f172a;
}

.ol-map-3d[hidden] {
  display: none !important;
}

.ol-map-3d .cesium-viewer,
.ol-map-3d .cesium-viewer-cesiumWidgetContainer,
.ol-map-3d .cesium-widget,
.ol-map-3d .cesium-widget canvas {
  width: 100%;
  min-height: 0;
  height: 100%;
  display: block;
}

.ol-map-3d .cesium-viewer-bottom,
.ol-map-3d .cesium-credit-logoContainer {
  display: none !important;
}

.ol-map-3d .cesium-widget-credits {
  right: 0.65rem;
  bottom: 0.5rem;
  font-size: 0.68rem;
  opacity: 0.72;
}

.ol-map-3d-status {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 6600;
  transform: translate(-50%, -50%);
  max-width: min(320px, calc(100% - 32px));
  padding: 10px 14px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.28);
}

.ol-map-3d-status.is-error {
  background: rgba(127, 29, 29, 0.92);
}

.map-wrapper.is-3d-mode #ol-info-box,
.map-wrapper.is-3d-mode #ol-feature-boxes-overlay {
  display: none !important;
}

.map-wrapper.map-scroll-mode .ol-map-3d {
  pointer-events: none;
}

.flightmap-info-box {
  display: none;
}

.flightmap-altitude-canvas {
  cursor: crosshair;
}

.flightmap-aircraft-other {
  display: none;
}

.flightmap-selected-files--hidden {
  display: none;
}

.flightmap-email-row {
  margin: 15px 0;
  padding: 12px;
  border-radius: 18px;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.flightmap-email-label {
  display: block;
  font-size: 0.95em;
}

.flightmap-email-help {
  font-size: 0.85em;
  color: #667085;
}

.flightmap-email-input {
  width: 100%;
  margin-top: 8px;
  font-size: 16px;
}

.flightmap-email-remember-row {
  margin-top: 8px;
}

.flightmap-email-remember {
  font-size: 0.9em;
  cursor: pointer;
}

#clear-tracks-btn,
.light-advanced-view-btn {
  width: calc(100% - 32px) !important;
  margin: 0 16px !important;
  padding: 0.95rem 1rem !important;
  min-height: 48px;
  border-radius: 16px !important;
  border: none !important;
  background: linear-gradient(135deg, var(--flightmap-accent) 0%, #8ac116 100%) !important;
  color: #1f2a0c !important;
  font-weight: 600 !important;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
  text-align: center;
  box-shadow: 0 14px 34px rgba(174, 219, 52, 0.26);
  line-height: 1.35;
}

.light-advanced-view-btn--replay {
  background: linear-gradient(135deg, #334155 0%, #0f766e 100%) !important;
  color: #fff !important;
  font-weight: 700 !important;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
}

.light-advanced-view-btn--replay:hover,
.light-advanced-view-btn--replay:focus-visible {
  background: linear-gradient(135deg, #1f2937 0%, #0f766e 100%) !important;
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.22) !important;
}

.light-advanced-view-btn--flight {
  background: #ffffff !important;
  border: 1px solid rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  font-weight: 700 !important;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1) !important;
}

.light-advanced-view-btn--flight:hover,
.light-advanced-view-btn--flight:focus-visible {
  background: #f8fafc !important;
  color: #0f172a !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.14) !important;
}

#clear-tracks-btn:hover,
.light-advanced-view-btn:hover {
  background: linear-gradient(135deg, #b9e94c 0%, var(--flightmap-accent-strong) 100%) !important;
  color: #16200b !important;
  transform: translateY(-1px);
}

#file-selection-popup .popup-content {
  width: min(100%, 760px);
  max-height: min(88vh, 920px);
  overflow: auto;
  border-radius: 28px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 30px 80px rgba(15, 23, 42, 0.28);
}

#file-selection-popup .popup-title,
#file-selection-popup .popup-subtitle {
  overflow-wrap: anywhere;
}

#file-selection-popup input,
#file-selection-popup select,
#file-selection-popup textarea,
#file-selection-popup button {
  font-size: 16px;
}

#flightmap-color-legend {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 10;
  max-width: 264px;
}

#flightmap-color-legend .legend-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: none;
  background: var(--flightmap-panel);
  color: var(--flightmap-text-inverse);
  padding: 0.65rem 0.95rem;
  border-radius: 999px;
  font-size: 0.85em;
  cursor: pointer;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.28);
  backdrop-filter: blur(8px);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

#flightmap-color-legend .legend-toggle-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.34);
}

#flightmap-color-legend .legend-panel {
  margin-top: 8px;
  background: var(--flightmap-surface-strong);
  border-radius: 18px;
  box-shadow: 0 18px 38px rgba(15, 23, 42, 0.22);
  padding: 12px;
  display: none;
  min-width: 220px;
  border: 1px solid rgba(226, 232, 240, 0.9);
}

#flightmap-color-legend .legend-panel.is-open {
  display: block;
}

#flightmap-color-legend .color-legend-title {
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--flightmap-text);
}

#flightmap-color-legend #legend-content {
  max-height: 260px;
  overflow-y: auto;
  color: var(--flightmap-text);
}

#violation-analysis-card,
#flight-activity-card,
#continuous-phases-card,
#thermal-quality-card,
#weather-data-card {
  display: none !important;
}

.light-view-actions {
  margin: 10px 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.light-view-actions__brand {
  width: 100%;
  margin: 0;
  padding: 9px 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(248, 250, 252, 0.98);
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.16);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.light-view-actions__brand:hover,
.light-view-actions__brand:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(174, 219, 52, 0.5);
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.2);
}

.light-view-actions__brand picture,
.light-view-actions__brand img {
  display: block;
}

.light-view-actions__brand img {
  width: min(214px, 100%);
  height: auto;
}

.light-view-actions__links {
  display: grid;
  gap: 9px;
}

.light-view-actions .light-view-action {
  width: 100% !important;
  min-height: 50px;
  margin: 0 !important;
  padding: 0.82rem 0.95rem !important;
  display: flex !important;
  align-items: center;
  justify-content: flex-start;
  gap: 0.72rem;
  border-radius: 12px !important;
  border: 1px solid rgba(148, 163, 184, 0.25) !important;
  background: rgba(15, 23, 42, 0.56) !important;
  color: #f8fafc !important;
  box-shadow: 0 9px 22px rgba(2, 6, 23, 0.16) !important;
  font-weight: 700 !important;
  line-height: 1.22;
  text-align: left;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.light-view-actions .light-view-action i {
  width: 1.25rem;
  flex: 0 0 1.25rem;
  color: #b8f04a;
  text-align: center;
  font-size: 1rem;
}

.light-view-actions .light-view-action:hover,
.light-view-actions .light-view-action:focus-visible {
  transform: translateY(-1px);
  border-color: rgba(174, 219, 52, 0.46) !important;
  background: rgba(15, 23, 42, 0.7) !important;
  color: #ffffff !important;
  box-shadow: 0 13px 28px rgba(2, 6, 23, 0.22) !important;
}

.light-view-actions .light-view-action--flight {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(15, 23, 42, 0.12) !important;
  color: #0f172a !important;
  box-shadow: 0 8px 18px rgba(2, 6, 23, 0.12) !important;
}

.light-view-actions .light-view-action--flight i {
  color: #0f766e;
}

.light-view-actions .light-view-action--flight:hover,
.light-view-actions .light-view-action--flight:focus-visible {
  background: #f8fafc !important;
  color: #0f172a !important;
}

.light-view-actions .light-view-action--replay {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.72) 0%, rgba(15, 118, 110, 0.86) 100%) !important;
}

.light-view-actions .light-view-action--stats {
  background: linear-gradient(135deg, rgba(154, 195, 45, 0.95) 0%, rgba(74, 124, 29, 0.94) 100%) !important;
  color: #10210a !important;
  border-color: rgba(218, 255, 122, 0.46) !important;
  box-shadow: 0 10px 24px rgba(124, 171, 36, 0.22) !important;
}

.light-view-actions .light-view-action--stats i {
  color: #10210a;
}

.light-view-actions .light-view-action--stats:hover,
.light-view-actions .light-view-action--stats:focus-visible {
  background: linear-gradient(135deg, rgba(174, 219, 52, 0.98) 0%, rgba(92, 145, 33, 0.98) 100%) !important;
  color: #10210a !important;
}

.flightmap-light .display-settings-fullscreen-btn {
  display: none;
}

.light-view-actions__hint {
  margin: 10px 0 0 0;
  padding: 0.85rem 1rem;
  border-radius: 16px;
  background: var(--flightmap-surface-muted);
  border: 1px solid rgba(226, 232, 240, 0.84);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
  font-size: 0.85em;
  color: var(--flightmap-text-muted);
  line-height: 1.4;
}

.flightmap-light .left-wrapper {
  overflow: visible !important;
  gap: 20px !important;
  padding: 18px 0 !important;
  padding-inline: 16px !important;
  max-width: 100%;
  min-width: 0;
}

.flightmap-light .left-wrapper > * {
  min-width: 0;
}

.flightmap-light #enhanced-track-info {
  overflow: visible;
  max-height: none;
  padding: 0;
}

.flightmap-light .map-wrapper {
  min-height: 46vh;
  box-shadow: var(--flightmap-shadow);
}

.flightmap-light #left-panel-content .track-coloring-options label {
  font-size: 1.35em !important;
}

.flightmap-light #display-settings-content {
  font-size: 0.85em !important;
  background: linear-gradient(135deg, #34495e 0%, #2c3e50 100%) !important;
  border-color: rgba(255, 255, 255, 0.18) !important;
  box-shadow: 0 6px 14px rgba(17, 24, 39, 0.22) !important;
}

.flightmap-light #display-settings-content #color-legend {
  background: rgba(255, 255, 255, 0.08);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.9);
}

.flightmap-settings-card {
  margin: 0;
  overflow: hidden;
}

.flightmap-settings-card .accordion-content {
  display: block;
}

.flightmap-settings-card.is-collapsed .accordion-content {
  display: none;
}

.flightmap-settings-card .card-body {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.9) 100%) !important;
  border-radius: 0 0 18px 18px !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
  padding: 0.7rem 0.8rem !important;
}

.flightmap-settings-card .display-settings-content {
  background: transparent;
  font-size: 0.86rem;
  display: block;
}

.flightmap-settings-card .display-settings-content > * + * {
  margin-top: 0.5rem;
}

.flightmap-settings-card .display-settings-divider {
  display: block;
  height: 1px;
  margin: 0.05rem 0;
  background: linear-gradient(90deg, rgba(148, 163, 184, 0) 0%, rgba(148, 163, 184, 0.58) 18%, rgba(148, 163, 184, 0.58) 82%, rgba(148, 163, 184, 0) 100%);
}

.flightmap-settings-card .display-settings-divider:has(+ [hidden]),
.flightmap-settings-card .display-settings-divider:last-child {
  display: none;
}

.flightmap-competitions-card {
  margin: 0 0 18px 0;
  overflow: hidden;
}

.flightmap-competitions-card .accordion-content {
  display: block;
}

.flightmap-competitions-card.is-collapsed .accordion-content {
  display: none;
}

.flightmap-competitions-card .card-body {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.88) 0%, rgba(30, 41, 59, 0.88) 100%) !important;
  color: #f8fafc;
  border-radius: 0 0 18px 18px !important;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.flightmap-competitions-card .display-settings-content {
  background: transparent;
  padding: 0;
}

.flightmap-competitions-card .display-settings-group,
.flightmap-competitions-card .checkbox-row label,
.flightmap-competitions-card .display-settings-hint {
  color: #f8fafc;
}

.flightmap-competitions-card select {
  width: 100%;
  margin-top: 6px;
}

.flightmap-competitions-card input[type="checkbox"],
.flightmap-competitions-card select {
  accent-color: #aedb34;
}

.flightmap-settings-card .display-settings-group h4,
.flightmap-settings-card .display-settings-label,
.flightmap-settings-card .checkbox-row label {
  color: #f8fafc;
  font-size: 0.86rem;
  line-height: 1.22;
}

.flightmap-settings-card .display-settings-group h4,
.flightmap-settings-card .display-settings-label {
  margin: 0 0 0.32rem;
}

.flightmap-settings-card .display-settings-layer-group {
  display: grid;
  gap: 0.35rem;
}

.flightmap-settings-card .display-settings-layer-title {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  min-height: 1.65rem;
  padding: 0.25rem 0.55rem;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.12);
  color: #f8fafc;
  font-size: 0.83rem;
  font-weight: 700;
  line-height: 1;
}

.flightmap-settings-card .display-settings-layer-title i {
  width: 1em;
  color: #d9f99d;
  text-align: center;
}

.flightmap-settings-card .track-coloring-options label {
  color: #f8fafc;
  min-height: 28px;
  padding: 3px 4px;
  line-height: 1.18;
}

.flightmap-settings-card select,
.flightmap-settings-card input[type="checkbox"],
.flightmap-settings-card input[type="radio"] {
  accent-color: #aedb34;
}

.flightmap-settings-card select {
  min-height: 34px;
  padding: 0.34rem 0.45rem;
  font-size: 0.86rem;
}

.flightmap-settings-card .checkbox-row {
  min-height: 28px;
  gap: 5px;
}

.flightmap-light .display-settings-hint {
  color: #0f172a;
  overflow-wrap: anywhere;
}

.flightmap-light .checkbox-row--nested {
  margin-left: 18px;
}

.flightmap-light .checkbox-row--nested.is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.flightmap-light .interactive-details-container {
  margin-top: 0;
  transition: margin 0.25s ease;
  border-radius: 16px;
  box-shadow: 0 14px 30px rgba(15, 23, 42, 0.08);
}

.flightmap-light .interactive-details-container.is-expanded {
  margin-top: 16px;
}

.flightmap-light .buddy-card {
  background: var(--flightmap-surface);
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: 18px;
  box-shadow: 0 18px 34px rgba(15, 23, 42, 0.1);
}

.flightmap-light .buddy-card__body {
  background: var(--flightmap-surface-strong);
}

.flightmap-light .buddy-card__section-header,
.flightmap-light .buddy-card__message strong {
  color: var(--flightmap-text);
}

.flightmap-light .buddy-card__message {
  color: var(--flightmap-text-muted);
}

body.dark-mode .flightmap-email-row {
  background: rgba(127, 29, 29, 0.28);
  border-color: rgba(248, 113, 113, 0.26);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

body.dark-mode .flightmap-email-label {
  color: #e5eefb;
}

body.dark-mode .flightmap-email-help,
body.dark-mode .light-view-actions__hint,
body.dark-mode .flightmap-light .display-settings-hint {
  color: #94a3b8;
}

body.dark-mode #clear-tracks-btn,
body.dark-mode .light-advanced-view-btn {
  background: linear-gradient(135deg, #b8f04a 0%, #8cc91f 100%) !important;
  color: #16200b !important;
  box-shadow: 0 14px 34px rgba(140, 201, 31, 0.25);
}

body.dark-mode #clear-tracks-btn:hover,
body.dark-mode .light-advanced-view-btn:hover {
  background: linear-gradient(135deg, #c6f56a 0%, #9fda36 100%) !important;
  color: #12190a !important;
}

body.dark-mode .light-advanced-view-btn--replay {
  background: linear-gradient(135deg, #334155 0%, #0f766e 100%) !important;
  color: #f8fafc !important;
  box-shadow: 0 12px 28px rgba(2, 6, 23, 0.32) !important;
}

body.dark-mode .light-advanced-view-btn--replay:hover,
body.dark-mode .light-advanced-view-btn--replay:focus-visible {
  background: linear-gradient(135deg, #1e293b 0%, #0f766e 100%) !important;
  color: #ffffff !important;
}

body.dark-mode .light-advanced-view-btn--flight {
  background: rgba(15, 23, 42, 0.86) !important;
  border-color: rgba(148, 163, 184, 0.42) !important;
  color: #e2e8f0 !important;
  box-shadow: 0 10px 24px rgba(2, 6, 23, 0.26) !important;
}

body.dark-mode #file-selection-popup .popup-content {
  background: #0f172a;
  border-color: rgba(71, 85, 105, 0.8);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.66);
}

body.dark-mode #flightmap-color-legend .legend-toggle-button {
  background: rgba(2, 6, 23, 0.88);
  color: #e5eefb;
  box-shadow: 0 10px 28px rgba(2, 6, 23, 0.48);
}

body.dark-mode #flightmap-color-legend .legend-panel {
  background: rgba(15, 23, 42, 0.96);
  border-color: rgba(71, 85, 105, 0.85);
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.55);
}

body.dark-mode #flightmap-color-legend .color-legend-title,
body.dark-mode #flightmap-color-legend #legend-content {
  color: #e5eefb;
}

body.dark-mode .light-view-actions__hint {
  background: rgba(15, 23, 42, 0.78);
  border-color: rgba(71, 85, 105, 0.75);
}

body.dark-mode .flightmap-light .map-wrapper {
  box-shadow: 0 20px 42px rgba(2, 6, 23, 0.42);
}

body.dark-mode .flightmap-light .interactive-details-container {
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.32);
}

body.dark-mode .flightmap-light .buddy-card {
  background: rgba(15, 23, 42, 0.9);
  border-color: rgba(71, 85, 105, 0.78);
  box-shadow: 0 18px 38px rgba(2, 6, 23, 0.34);
}

body.dark-mode .flightmap-light .buddy-card__body {
  background: rgba(15, 23, 42, 0.84);
}

body.dark-mode .flightmap-light .buddy-card__section-header,
body.dark-mode .flightmap-light .buddy-card__message strong {
  color: #f8fafc;
}

body.dark-mode .flightmap-light .buddy-card__message {
  color: #cbd5e1;
}

body.dark-mode #left-panel-toggle {
  background: linear-gradient(180deg, rgba(30, 64, 175, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  color: #e5eefb;
}

body.dark-mode #left-panel-toggle:hover {
  background: linear-gradient(180deg, rgba(56, 189, 248, 0.9) 0%, rgba(15, 23, 42, 0.95) 100%);
}

body.dark-mode .map-touch-toggle {
  background: rgba(2, 6, 23, 0.88);
  color: #e5eefb;
  border: 1px solid rgba(71, 85, 105, 0.72);
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.45);
}

body.dark-mode .map-wrapper.map-scroll-mode .map-touch-toggle {
  background: rgba(30, 64, 175, 0.94);
}

#fullscreen-mode-toggle,
.flightmap-light .left-wrapper button,
.flightmap-light .left-wrapper select,
.flightmap-light .left-wrapper input {
  font-size: 16px;
}

.analysis-layout {
  grid-template-columns: 1fr;
  grid-template-areas:
    "map-column"
    "chart-panel";
}

.right-panel-toggle,
.right-panel {
  display: none !important;
}

.flightmap-light .xc-flightcheck-layout.is-fullscreen .analysis-layout {
  /* grid-template-columns: minmax(0, 1fr) var(--right-toggle-width, 0) var(--right-panel-width, 0); */
  grid-template-areas:
    "map-column right-toggle right-panel"
    "chart-panel chart-panel chart-panel";
  grid-template-rows: minmax(0, 60vh) minmax(0, 40vh);
}

@media (max-width: 900px) {
  .analysis-layout {
    gap: 14px;
  }

  .flightmap-light #xc-flightcheck-layout {
    gap: 14px;
  }

  #file-selection-popup .popup-content {
    width: min(100%, calc(100vw - 24px));
    border-radius: 22px;
  }

  #flightmap-color-legend {
    top: auto;
    right: 12px;
    bottom: 12px;
    left: 12px;
    max-width: none;
  }

  #flightmap-color-legend .legend-toggle-button {
    width: 100%;
    justify-content: space-between;
  }

  #flightmap-color-legend .legend-panel {
    max-height: 40vh;
  }

  .flightmap-light .left-wrapper {
    gap: 14px !important;
    padding: 14px 0 !important;
    padding-inline: 12px !important;
  }

  .light-view-actions {
    gap: 10px;
  }

  .flightmap-light .map-wrapper {
    border-radius: 18px;
    overflow: hidden;
  }

  .flightmap-light .ol-map-view-switch {
    top: 10px;
    right: 10px;
    left: auto;
    padding: 3px;
  }

  .ol-map-view-switch__button {
    min-width: 38px;
    padding: 7px 9px;
    font-size: 0.74rem;
  }

  .flightmap-settings-card .card-body,
  .flightmap-competitions-card .card-body {
    padding: 0.85rem;
  }

  .flightmap-settings-card .display-settings-content,
  .flightmap-competitions-card .display-settings-content {
    display: grid;
    gap: 0.85rem;
  }

  .flightmap-light .interactive-details-container.is-expanded {
    margin-top: 12px;
  }

  .flightmap-light .buddy-card__header,
  .flightmap-light .buddy-card__section,
  .flightmap-light .buddy-entry,
  .flightmap-light .buddy-card__message {
    padding-inline: 14px;
  }
}

@media (max-width: 640px) {
  .flightmap-light .map-wrapper {
    min-height: 52vh;
  }

  .analysis-layout {
    gap: 10px;
  }

  #file-selection-popup .popup-content {
    width: min(100%, calc(100vw - 16px));
    max-height: calc(100vh - 16px);
    border-radius: 18px;
  }

  #clear-tracks-btn,
  .light-advanced-view-btn,
  .light-view-actions__brand,
  .light-view-action {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 12px !important;
  }

  .light-view-actions {
    display: grid;
    gap: 10px;
  }

  .flightmap-light .left-wrapper {
    padding-top: 10px !important;
  }

  #fullscreen-mode-toggle {
    min-height: 44px;
  }

  #left-panel-toggle,
  .map-touch-toggle {
    border-radius: 999px;
  }

  #flightmap-color-legend {
    bottom: 8px;
    left: 8px;
    right: 8px;
  }

  #flightmap-color-legend .legend-panel {
    padding: 10px;
    border-radius: 14px;
  }

  #flightmap-color-legend #legend-content {
    max-height: 34vh;
  }

  .flightmap-settings-card .checkbox-row--nested {
    margin-left: 14px;
  }

  .flightmap-light #left-panel-content .track-coloring-options label {
    font-size: 1rem !important;
  }

  .light-view-actions__hint {
    font-size: 0.8em;
    padding: 0.75rem 0.85rem;
  }
}

@media (max-width: 420px) {
  .flightmap-light .left-wrapper {
    padding-inline: 8px !important;
  }

  .flightmap-light .map-wrapper {
    min-height: 56vh;
  }

  #clear-tracks-btn,
  .light-advanced-view-btn,
  .light-view-action {
    padding: 0.85rem 1rem !important;
    font-size: 0.95rem !important;
  }

  #file-selection-popup .popup-content {
    width: calc(100vw - 12px);
    max-height: calc(100vh - 12px);
    border-radius: 16px;
  }

  #flightmap-color-legend .legend-toggle-button {
    padding: 0.55rem 0.8rem;
    font-size: 0.8rem;
  }

  .flightmap-email-row {
    padding: 0.85rem;
    border-radius: 16px;
  }

  .flightmap-light .buddy-card {
    border-radius: 16px;
  }

  #flightmap-color-legend .legend-panel {
    max-height: 30vh;
  }
}

/* Compact shell overrides for the light flightmap workspace */
.flightmap-light {
  --flightmap-radius-shell: 8px;
  --flightmap-radius-map: 4px;
  --flightmap-shell-gap: 8px;
}

.flightmap-light .left-wrapper {
  gap: var(--flightmap-shell-gap) !important;
  padding: 10px 0 !important;
  padding-inline: 10px !important;
}

.flightmap-light .map-wrapper {
  min-height: 58vh;
  border-radius: var(--flightmap-radius-map);
  overflow: hidden;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
}

.flightmap-light .map-wrapper .leaflet-container,
.flightmap-light .map-wrapper .leaflet-pane,
.flightmap-light .map-wrapper canvas {
  border-radius: var(--flightmap-radius-map);
}

#file-selection-popup .popup-content {
  border-radius: 12px;
  box-shadow: 0 20px 40px rgba(15, 23, 42, 0.18);
}

#flightmap-color-legend {
  top: 10px;
  right: 10px;
  max-width: 220px;
}

#flightmap-color-legend .legend-toggle-button {
  padding: 0.48rem 0.72rem;
  border-radius: 10px;
  gap: 5px;
}

#flightmap-color-legend .legend-panel {
  border-radius: 10px;
  padding: 8px;
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.16);
}

.light-view-actions {
  margin: 8px 0;
  gap: 8px;
}

.light-view-actions__hint {
  margin-top: 6px;
  padding: 0.58rem 0.7rem;
  border-radius: 8px;
  font-size: 0.8rem;
  line-height: 1.35;
}

.flightmap-settings-card .card-body,
.flightmap-competitions-card .card-body {
  border-radius: 0 0 10px 10px !important;
}

.flightmap-light .interactive-details-container {
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.flightmap-light .interactive-details-container.is-expanded {
  margin-top: 8px;
}

.flightmap-light .interactive-details-toggle {
  min-height: 34px;
  gap: 8px;
  padding: 7px 10px;
  font-size: 0.84rem;
}

.flightmap-light .interactive-details-toggle__icon {
  width: 22px;
  height: 22px;
}

.flightmap-light .interactive-details-toggle__icon::before {
  width: 7px;
  height: 7px;
}

.flightmap-light .interactive-details-panel {
  padding-inline: 10px;
}

.flightmap-light .interactive-details-panel > * {
  padding-top: 8px;
  padding-bottom: 8px;
}

.flightmap-light .interactive-details-wrapper {
  gap: 8px;
}

.flightmap-light .interactive-details-summary {
  font-size: 0.84rem;
  line-height: 1.25;
}

.flightmap-light .interactive-details-grid {
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 6px;
  margin: 4px 0;
}

.flightmap-light .interactive-detail-card {
  gap: 3px;
  padding: 6px 8px;
}

.flightmap-light .interactive-detail-label {
  font-size: 0.64rem;
  letter-spacing: 0.04em;
}

.flightmap-light .interactive-detail-value {
  font-size: 0.92rem;
  line-height: 1.2;
}

.flightmap-light .interactive-details-multipilot-wrapper {
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  margin-top: 4px;
}

.flightmap-light .interactive-details-multipilot-card {
  gap: 5px;
  padding: 8px 10px;
}

.flightmap-light .interactive-details-multipilot-card__row {
  padding-top: 4px;
  margin-top: 2px;
}

.flightmap-light .interactive-details-multipilot-card__label {
  font-size: 0.66rem;
  letter-spacing: 0;
}

.flightmap-light .interactive-details-multipilot-card__value {
  font-size: 0.92rem;
  line-height: 1.2;
}

.flightmap-light .buddy-card {
  border-radius: 10px;
  box-shadow: 0 10px 20px rgba(15, 23, 42, 0.08);
}

.flightmap-light .buddy-card__header {
  gap: 8px;
  min-height: 34px;
  padding: 7px 10px;
}

.flightmap-light .buddy-card__header--interactive {
  cursor: pointer;
}

.flightmap-light .buddy-card__heading {
  min-width: 0;
}

.flightmap-light .buddy-card__header-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.flightmap-light .buddy-card__bulk-toggle {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.flightmap-light .buddy-card__bulk-toggle.tra-admin-switch {
  --switch-on: #38bdf8;
}

.flightmap-light .buddy-card__collapse {
  width: 26px;
  height: 26px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.14);
  color: inherit;
  cursor: pointer;
}

.flightmap-light .buddy-card__collapse:hover {
  background: rgba(255, 255, 255, 0.22);
}

.flightmap-light .buddy-card__title {
  font-size: 0.92rem;
}

.flightmap-light .buddy-card__subtitle,
.flightmap-light .buddy-entry__stats {
  font-size: 0.78rem;
}

.flightmap-light .buddy-card__body {
  padding: 0;
}

.flightmap-light .buddy-card__section {
  padding: 0;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.flightmap-light .buddy-card__section:last-child {
  border-bottom: none;
}

.flightmap-light .buddy-card__section-header {
  min-height: 28px;
  margin: 0;
  padding: 5px 10px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.06);
  background: rgba(248, 250, 252, 0.96);
  color: #0f172a;
  font-size: 0.78rem;
}

.flightmap-light .buddy-card__empty,
.flightmap-light .buddy-card__message {
  padding: 10px;
  font-size: 0.82rem;
}

.flightmap-light .buddy-card__table {
  display: grid;
}

.flightmap-light .buddy-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 54px;
  padding: 6px 10px 6px 22px;
  background: #ffffff;
}

.flightmap-light .buddy-entry::before {
  top: 0;
  bottom: 0;
  width: 12px;
  border-radius: 0;
}

.flightmap-light .buddy-entry__toggle input {
  width: 16px;
  height: 16px;
}

.flightmap-light .buddy-entry__toggle {
  justify-content: center;
  gap: 6px;
}

.flightmap-light .buddy-entry__toggle.tra-admin-switch {
  --switch-on: var(--buddy-color, #0ea5e9);
  width: 38px;
  gap: 0;
  min-height: 22px;
}

.flightmap-light .buddy-entry__toggle .tra-admin-switch__track {
  flex: 0 0 38px;
}

.flightmap-light .buddy-entry__toggle .buddy-entry__color {
  display: none;
}

.flightmap-light .buddy-entry__content {
  display: grid;
  grid-template-columns: minmax(150px, 1.05fr) minmax(180px, 1.2fr) minmax(126px, 0.7fr);
  gap: 2px 10px;
  align-items: center;
}

.flightmap-light .buddy-entry__pilot {
  min-width: 0;
  flex-wrap: wrap;
  gap: 4px;
  font-size: 0.86rem;
}

.flightmap-light .buddy-entry__profile-link {
  color: inherit;
  text-decoration: none;
}

.flightmap-light .buddy-entry__profile-link:hover,
.flightmap-light .buddy-entry__profile-link:focus-visible,
.flightmap-light .buddy-entry__username:hover,
.flightmap-light .buddy-entry__username:focus-visible {
  color: #0369a1;
  text-decoration: underline;
}

.flightmap-light .buddy-entry__route-distance {
  gap: 4px;
  white-space: nowrap;
}

.flightmap-light .buddy-entry__route-icon {
  width: 14px;
  height: 14px;
}

.flightmap-light .buddy-entry__stats {
  grid-column: 2;
  grid-row: 1;
  gap: 8px;
  margin-top: 0;
  font-size: 0.75rem;
}

.flightmap-light .buddy-entry__glider,
.flightmap-light .buddy-entry__coverage,
.flightmap-light .buddy-entry__launch {
  margin-top: 0;
  min-width: 0;
  overflow: hidden;
  color: #334155;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flightmap-light .buddy-entry__glider {
  display: flex;
  align-items: center;
  gap: 5px;
  grid-column: 1;
  grid-row: 2;
}

.flightmap-light .buddy-entry__flag {
  width: 16px;
  height: 11px;
  border-radius: 2px;
  object-fit: cover;
  flex: 0 0 auto;
  line-height: 1;
}

.flightmap-light .buddy-entry__username {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: inherit;
  text-decoration: none;
}

.flightmap-light .buddy-entry__manufacturer,
.flightmap-light .buddy-entry__manufacturer-logo {
  flex: 0 0 auto;
}

.flightmap-light .buddy-entry__manufacturer {
  color: #0f172a;
  font-weight: 700;
}

.flightmap-light .buddy-entry__manufacturer-logo {
  width: 52px;
  height: 18px;
  object-fit: contain;
}

.flightmap-light .buddy-entry__coverage {
  grid-column: 2;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flightmap-light .buddy-entry__coverage-track {
  height: 5px;
  min-width: 44px;
  flex: 1 1 auto;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.3);
}

.flightmap-light .buddy-entry__coverage-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--buddy-color, #0ea5e9);
}

.flightmap-light .buddy-entry__coverage-label {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.flightmap-light .buddy-entry__launch {
  grid-column: 1 / span 2;
  grid-row: 3;
}

.flightmap-light .buddy-entry__timeline {
  grid-column: 3;
  grid-row: 1;
  margin-top: 0;
  color: #475569;
  font-size: 0.74rem;
  white-space: nowrap;
}

.flightmap-light .buddy-entry__route-controls {
  grid-column: 3;
  grid-row: 2;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 0;
}

.flightmap-light .buddy-entry__route-option {
  gap: 4px;
  font-size: 0.72rem;
  white-space: nowrap;
}

.flightmap-light .buddy-entry__route-option input {
  width: 13px;
  height: 13px;
}

.flightmap-light .buddy-entry__badge {
  margin-left: 4px;
  padding: 2px 7px;
  font-size: 0.62rem;
  letter-spacing: 0;
  white-space: nowrap;
}

.flightmap-light .buddy-entry__links {
  align-items: flex-end;
  gap: 3px;
  min-width: 58px;
  font-size: 0.74rem;
}

.flightmap-light .buddy-entry__state {
  grid-column: 1 / -1;
  margin-top: 2px;
  font-size: 0.74rem;
}

body.dark-mode .flightmap-light .buddy-entry {
  background: rgba(15, 23, 42, 0.88);
}

body.dark-mode .flightmap-light .buddy-card__section-header {
  border-color: rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.88);
  color: #e2e8f0;
}

body.dark-mode .flightmap-light .buddy-entry__glider,
body.dark-mode .flightmap-light .buddy-entry__coverage,
body.dark-mode .flightmap-light .buddy-entry__launch,
body.dark-mode .flightmap-light .buddy-entry__timeline {
  color: #cbd5e1;
}

body.dark-mode .flightmap-light .buddy-entry__manufacturer {
  color: #f8fafc;
}

@media (max-width: 900px) {
  .flightmap-light .buddy-entry {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 6px;
    min-height: 0;
    padding: 7px 8px 7px 22px;
  }

  .flightmap-light .buddy-entry__content {
    grid-template-columns: minmax(0, 1fr);
    gap: 2px;
  }

  .flightmap-light .buddy-entry__pilot,
  .flightmap-light .buddy-entry__stats,
  .flightmap-light .buddy-entry__glider,
  .flightmap-light .buddy-entry__coverage,
  .flightmap-light .buddy-entry__launch,
  .flightmap-light .buddy-entry__timeline,
  .flightmap-light .buddy-entry__route-controls {
    grid-column: 1;
    grid-row: auto;
  }

  .flightmap-light .buddy-entry__stats {
    gap: 6px;
  }

  .flightmap-light .buddy-entry__route-controls {
    justify-content: flex-start;
  }

  .flightmap-light .buddy-entry__coverage {
    max-width: 260px;
  }

  .flightmap-light .buddy-entry__links {
    align-items: flex-end;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .flightmap-light .buddy-card__header,
  .flightmap-light .buddy-card__section-header {
    padding-inline: 8px;
  }

  .flightmap-light .buddy-card__header {
    flex-wrap: wrap;
  }

  .flightmap-light .buddy-card__header-controls {
    order: 3;
    width: 100%;
    margin-left: 0;
    flex-wrap: wrap;
  }

  .flightmap-light .buddy-entry {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .flightmap-light .buddy-entry__links {
    grid-column: 2;
    flex-direction: row;
    justify-self: start;
    margin-top: 2px;
  }

  .flightmap-light .buddy-entry__badge {
    padding-inline: 5px;
  }
}

body.dark-mode .flightmap-light .map-wrapper {
  box-shadow: 0 14px 30px rgba(2, 6, 23, 0.3);
}

body.dark-mode .flightmap-light .interactive-details-container {
  box-shadow: 0 14px 26px rgba(2, 6, 23, 0.26);
}

body.dark-mode .flightmap-light .buddy-card {
  box-shadow: 0 14px 28px rgba(2, 6, 23, 0.28);
}

.flightmap-email-row {
  margin: 8px 0;
  padding: 10px;
  border-radius: 10px;
}

#clear-tracks-btn,
.light-advanced-view-btn {
  width: calc(100% - 20px) !important;
  margin: 0 10px !important;
  padding: 0.78rem 0.9rem !important;
  min-height: 44px;
  border-radius: 10px !important;
  box-shadow: 0 10px 24px rgba(174, 219, 52, 0.22);
}

.light-advanced-view-btn--replay {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18) !important;
}

.light-advanced-view-btn--flight {
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1) !important;
}

@media (max-width: 900px) {
  .flightmap-light .left-wrapper {
    gap: 8px !important;
    padding-inline: 8px !important;
  }

  .flightmap-light .map-wrapper {
    border-radius: 8px;
    min-height: 54vh;
  }
}

@media (max-width: 640px) {
  .flightmap-light .left-wrapper {
    gap: 8px !important;
    padding-top: 8px !important;
  }

  #clear-tracks-btn,
  .light-advanced-view-btn,
  .light-view-action,
  .light-view-actions__brand {
    width: 100% !important;
    margin: 0 !important;
    border-radius: 8px !important;
  }

  #file-selection-popup .popup-content {
    border-radius: 10px;
  }

  #flightmap-color-legend .legend-panel {
    border-radius: 8px;
  }
}

@media (max-width: 420px) {
  .flightmap-light .left-wrapper {
    padding-inline: 6px !important;
  }

  .flightmap-light .map-wrapper {
    min-height: 0;
    border-radius: 4px;
  }
}

@media (max-width: 900px) {
  body.page--flightmap .tra-aktivierung-reiter {
    padding: 0.42rem 0.65rem;
    font-size: 0.84rem;
    line-height: 1.25;
  }

  .flightmap-light.xc-flightcheck-layout {
    gap: 8px;
  }

  .flightmap-light .center-panel {
    order: 2;
  }

  .flightmap-light .left-panel {
    order: 1;
  }

  .flightmap-light .analysis-layout {
    gap: 8px;
  }

  .flightmap-light .map-wrapper {
    min-height: 0;
    flex-direction: column;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .flightmap-light #ol-map {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    height: clamp(340px, 52dvh, 500px);
    min-height: clamp(340px, 52dvh, 500px);
    border-radius: 8px;
    overflow: hidden;
    background: #eef1f5;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  }

  .flightmap-light .ol-map-3d {
    order: 1;
    flex: 0 0 auto;
    width: 100%;
    height: clamp(340px, 52dvh, 500px);
    min-height: clamp(340px, 52dvh, 500px);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 22px rgba(15, 23, 42, 0.12);
  }

  #flightmap-color-legend {
    position: static;
    order: 2;
    width: 100%;
    margin-top: 6px;
    max-width: none;
    z-index: 1;
  }

  #flightmap-color-legend .legend-toggle-button {
    width: 100%;
    justify-content: space-between;
    min-height: 38px;
    padding: 0.48rem 0.65rem;
    border-radius: 8px;
    font-size: 0.8rem;
  }

  #flightmap-color-legend .legend-panel {
    max-height: min(42dvh, 280px);
    overflow-y: auto;
  }

  .flightmap-light .left-wrapper {
    gap: 7px !important;
    padding-block: 6px 10px !important;
  }

  .light-view-actions {
    margin: 6px 0;
    gap: 6px;
  }

  .light-view-actions__brand {
    display: none;
  }

  .light-view-actions .light-view-action,
  #clear-tracks-btn,
  .light-advanced-view-btn {
    min-height: 40px;
    padding: 0.62rem 0.72rem !important;
    font-size: 0.88rem !important;
    line-height: 1.2;
  }

  .flightmap-settings-card .card-body,
  .flightmap-competitions-card .card-body {
    padding: 0.68rem !important;
  }

  .flightmap-settings-card .display-settings-content,
  .flightmap-competitions-card .display-settings-content {
    gap: 0.5rem;
  }
}

@media (max-width: 420px) {
  .flightmap-light .map-wrapper {
    min-height: 0;
  }

  .flightmap-light #ol-map {
    height: clamp(320px, 50dvh, 460px);
    min-height: clamp(320px, 50dvh, 460px);
  }

  .flightmap-light .ol-map-3d {
    height: clamp(320px, 50dvh, 460px);
    min-height: clamp(320px, 50dvh, 460px);
  }

  .light-view-actions .light-view-action,
  #clear-tracks-btn,
  .light-advanced-view-btn {
    font-size: 0.84rem !important;
  }
}
