/* Compatibility for the current Vue components and the retained platform theme.
   Keep this after theme-adapt.css; component chunks may load later. */
:root {
  --wy-font-size-xs: 12px;
  --wy-font-size-sm: 14px;
  --wy-font-size-md: 16px;
  --wy-font-size-lg: 20px;
  --wy-font-size-kpi-lg: 28px;
  --wy-font-weight-regular: 400;
  --wy-font-weight-medium: 500;
  --wy-font-weight-semibold: 600;
  --wy-line-height-xs: 20px;
  --wy-line-height-sm: 22px;
  --wy-line-height-md: 24px;
  --wy-line-height-lg: 28px;
  --wy-line-height-kpi-lg: 36px;
  --wy-body-color: #454b54;
  --wy-border: #dce0e7;
  --wy-divider: #eceef2;
  --wy-text-tertiary: #818996;
  --wy-management-gap: 9px;
}

/* Navigation needs room for its popovers as well as its links. */
.app-shell .global-nav {
  min-width: 0;
  overflow: visible;
}
.app-shell .global-nav .nav-item > a {
  min-width: 0;
  padding-inline: clamp(8px, 1vw, 14px);
}
.app-shell .global-nav .nav-dropdown a {
  height: auto;
  min-width: 0;
  border-radius: 0;
  padding: 10px 16px;
  font-size: 14px;
}
.app-shell .management-workspace {
  min-height: calc(100dvh - var(--wy-chrome-height));
  gap: var(--wy-management-gap);
}
.app-shell .management-sidebar { display: flex; }
.app-shell .management-sidebar .management-sidebar-toggle {
  left: auto;
  right: -18px;
  top: calc((100dvh - var(--wy-chrome-height) - 22px) * .41);
  z-index: 6;
  cursor: pointer;
}
.app-shell .management-sidebar .management-sidebar-toggle:hover {
  background: #fff;
  color: #0075ed;
}
.app-shell .management-sidebar .management-sidebar-toggle:focus-visible {
  outline: 2px solid #1677ff;
  outline-offset: 2px;
}
.app-shell .management-sidebar.is-collapsed {
  width: 18px;
  min-width: 18px;
  padding: 0;
  background: transparent;
}
.app-shell .management-sidebar.is-collapsed > nav { display: none; }
.app-shell .management-sidebar.is-collapsed .management-sidebar-toggle { right: 0; }
.app-shell .console-view {
  height: calc(100dvh - var(--wy-header-height));
  min-height: 0;
}
.app-shell .console-view .overview-panel { overflow-y: auto; }
.app-shell .console-view .map-stage { height: 100%; min-height: 0; }
.app-shell .management-main,
.app-shell .data-panel,
.app-shell .prototype-page,
.app-shell .logs-page,
.app-shell .catalog-layout,
.app-shell .resource-workspace {
  min-height: calc(100dvh - var(--wy-chrome-height) - 22px);
  min-width: 0;
}
.app-shell .management-page-heading h1,
.app-shell .logs-heading h1 {
  margin: 0;
  font-size: 20px;
  line-height: 28px;
}
.app-shell .logs-results-heading h2 {
  font-size: 16px;
  line-height: 24px;
}
.app-shell .management-main > .page-heading {
  display: flex;
  padding: 20px 24px 0;
  margin: 0 0 20px;
}
.app-shell .management-main > .page-heading h1 { font-size: 20px; margin: 0; }
.app-shell .expanded-device table :is(th, td) {
  border: 0;
  border-bottom: 1px solid var(--wy-divider);
  padding: 10px 12px;
  font-size: 14px;
  text-align: left;
}
.app-shell .expanded-device table th { background: #f7f8fa; }
.app-shell .expanded-device table tbody tr:last-child td { border-bottom: 0; }

/* ManagementPage's new wrappers were absent from the retained stylesheet. */
.app-shell .management-page.prototype-page {
  padding: 0;
  gap: var(--wy-management-gap);
  background: transparent;
}
.management-page-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}
.management-filter-card,
.management-results {
  min-width: 0;
  padding: 20px 24px;
  border-radius: 8px;
  background: #fff;
}
.management-results {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 320px;
  padding-bottom: 8px;
}
.management-main .prototype-filters {
  min-height: 0;
  padding: 0;
  margin: 0;
  border: 0;
  flex-wrap: wrap;
  gap: 16px 24px;
}
.management-main .filter-fields {
  flex: 1 1 560px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr));
  gap: 16px 24px;
}
.management-main .filter-fields input,
.management-main .filter-fields select {
  height: 36px;
  min-height: 36px;
  border: 1px solid var(--wy-border);
  border-radius: 6px;
  background: #fff;
  padding: 6px 10px;
}
.management-main .filter-fields .date-range {
  min-width: 0;
  flex: 1;
  gap: 6px;
}
.management-main .filter-buttons {
  margin-left: auto;
  flex-wrap: wrap;
  gap: 12px;
}
.management-results .table-toolbar {
  margin: 0 0 20px;
  padding: 0;
  border: 0;
  flex-wrap: wrap;
  gap: 12px;
}
.management-results .table-toolbar:empty { display: none; }
.app-shell .management-main .table-scroll {
  max-width: 100%;
  overflow-x: auto;
}
.app-shell .data-table-comfortable > table > :is(thead, tbody) > tr > :is(th, td) {
  padding: 12px 16px;
  height: 48px;
  border: 0;
  border-bottom: 1px solid var(--wy-divider);
  font-size: 14px;
  line-height: 22px;
}
.app-shell .data-table-comfortable .table-actions {
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px 12px;
  min-width: 120px;
}
.app-shell .table-pagination {
  flex-wrap: wrap;
  gap: 12px;
  padding: 20px 0 8px;
}
.app-shell .table-pagination select {
  height: 32px;
  border: 1px solid var(--wy-border);
  border-radius: 5px;
}
.floating-row-menu {
  position: fixed;
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 6px;
  min-width: 120px;
  background: #fff;
  color: var(--wy-body-color);
  border: 1px solid var(--wy-divider);
  border-radius: 6px;
  box-shadow: 0 6px 20px #26324a24;
}
.floating-row-menu button {
  padding: 6px 10px;
  text-align: left;
  border-radius: 4px;
}
.floating-row-menu button:hover { background: #edf3ff; color: #1677ff; }

/* Fullscreen editors own their height and inherit a consistent dark palette. */
dialog.modal.route-planner-modal {
  --ink: #e7e9ed;
  --muted: #a5adb7;
  --wy-text-tertiary: #a5adb7;
  color-scheme: dark;
}
dialog.route-planner-modal .modal-inner,
dialog.route-planner-modal .modal-content {
  height: 100%;
  max-height: none;
  padding: 0;
  color: #e7e9ed;
  overflow: hidden;
}
dialog.route-planner-modal .modal-heading { display: none; }
dialog.route-planner-modal .route-planner-title strong { color: #e7e9ed; }
dialog.route-planner-modal .route-planner-tools { flex-wrap: nowrap; }
dialog.route-planner-modal .planner-route-metrics strong { white-space: nowrap; }
dialog.route-planner-modal .map-waypoint-toolbar { flex-wrap: wrap; }
dialog.route-planner-modal .route-planner-status { min-width: 0; }
dialog.route-planner-modal .route-planner-status > span {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
dialog.route-planner-modal .planner-map-flight-controls {
  /* Leave the map zoom controls reachable beside the instrument panel. */
  right: 62px;
}

@media (max-width: 1200px) {
  :root { --wy-header-height: 96px; }
  .app-shell .global-header {
    height: var(--wy-header-height);
    padding: 8px 16px 0;
    gap: 4px 12px;
    flex-wrap: wrap;
  }
  .app-shell .global-tools { height: 40px; margin-left: auto; }
  .app-shell .global-nav {
    order: 3;
    flex: 0 0 100%;
    height: 44px;
    justify-content: space-between;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .app-shell .global-nav .nav-dropdown {
    position: fixed;
    top: var(--wy-header-height);
    left: 16px;
    right: 16px;
    max-height: calc(100dvh - var(--wy-header-height) - 16px);
    overflow: auto;
  }
}

@media (max-width: 1100px) {
  .app-shell .management-sidebar { width: 128px; min-width: 128px; }
  .app-shell .management-sidebar nav a { padding-left: 20px; }
  .app-shell .management-page.prototype-page { padding: 0; }
  .management-filter-card, .management-results { padding-inline: 16px; }
  dialog.route-planner-modal .route-planner-body {
    grid-template-columns: 210px minmax(0, 1fr) 220px;
  }
}

/* A short window needs scrolling inside panels, not clipped map actions. */
@media (max-height: 720px) and (min-width: 901px) {
  dialog.route-planner-modal .map-action-palette { top: 64px; bottom: auto; }
  dialog.route-planner-modal .map-action-rail { gap: 5px; }
  dialog.route-planner-modal .map-action-rail > button { min-height: 30px; }
  dialog.route-planner-modal .map-action-rail i { width: 30px; height: 30px; }
  dialog.route-planner-modal .map-action-more { top: 0; bottom: auto; max-height: 200px; }
}

@media (max-width: 900px) {
  .app-shell:has(.route-library-workspace) .management-workspace {
    height: auto;
    overflow: visible;
  }
  .app-shell:has(.route-library-workspace) .management-main { height: auto; overflow: visible; }
  .app-shell .route-library-workspace {
    height: auto;
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(320px, 48dvh) minmax(320px, 48dvh);
  }
  .app-shell .management-main > .route-library-workspace {
    grid-template-rows: auto minmax(320px, 48dvh) minmax(320px, 48dvh);
  }
  dialog.route-planner-modal .route-planner-body {
    grid-template-columns: 220px minmax(0, 1fr);
    grid-template-rows: minmax(540px, 1fr) 340px;
    overflow: auto;
  }
  dialog.route-planner-modal .route-waypoint-inspector { grid-column: 1 / -1; max-height: none; }
  dialog.route-planner-modal .route-planner-sidebar,
  dialog.route-planner-modal .route-planner-map { min-height: 540px; }
  dialog.route-planner-modal .route-planner-title > span { display: none; }
  dialog.route-planner-modal .map-action-palette { bottom: auto; top: 70px; }
  .app-shell .catalog-layout,
  .app-shell .resource-workspace { flex-direction: column; }
  .app-shell .organization-tree,
  .app-shell .revision-resource-categories { width: 100%; min-height: 0; }
  .app-shell .revision-resource-categories { flex-direction: row; flex-wrap: wrap; }
  .app-shell .revision-resource-categories > button { width: auto; }
  .app-shell .revision-resource-categories .storage { position: static; }
}

@media (max-width: 640px) {
  .app-shell .brand strong { font-size: 14px; }
  .app-shell .global-header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-rows: 40px 44px;
    padding-inline: 12px;
    gap: 4px 8px;
  }
  .app-shell .brand { overflow: hidden; }
  .app-shell .brand svg { flex-shrink: 0; }
  .app-shell .brand strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .app-shell .global-nav { grid-column: 1 / -1; width: 100%; }
  .app-shell .global-tools { gap: 8px; }
  .app-shell .user-button > span { display: none; }
  .app-shell .global-nav .nav-item > a { padding-inline: 12px; }
  .app-shell .management-workspace { flex-direction: column; padding: 0; gap: 0; }
  .app-shell .management-sidebar { display: block; width: 100%; min-width: 0; padding: 8px 12px; }
  .app-shell .management-sidebar nav { flex-direction: row; overflow-x: auto; gap: 6px; }
  .app-shell .management-sidebar nav a { flex-shrink: 0; padding: 0 12px; border-radius: 4px; }
  .app-shell .management-sidebar { padding-right: 30px; }
  .app-shell .management-sidebar .management-sidebar-toggle { right: 0; top: 0; height: 100%; }
  .app-shell .management-sidebar.is-collapsed { width: 100%; min-width: 0; height: 24px; min-height: 24px; }
  .app-shell .management-sidebar.is-collapsed .management-sidebar-toggle { width: 100%; height: 24px; border-radius: 0 0 8px 8px; }
  .app-shell .breadcrumb { padding-inline: 12px; }
  .app-shell .logs-page,
  .app-shell .management-page.prototype-page { padding: 0; }
  .app-shell .logs-filters,
  .app-shell .logs-results { padding: 16px 12px; }
  .app-shell .logs-filter-row { align-items: stretch; }
  .app-shell .logs-date-field,
  .app-shell .logs-category-field,
  .app-shell .logs-more-filters label { flex-direction: column; align-items: stretch; width: 100%; gap: 6px; }
  .app-shell .logs-date-range input { flex: 1; width: 0; }
  .app-shell .logs-category-field select,
  .app-shell .logs-more-filters input { width: 100%; }
  .app-shell .logs-filter-actions { margin-left: 0; justify-content: flex-start; }
  .app-shell .logs-results .table-scroll > table { min-width: 720px; }
  .app-shell .table-pagination { justify-content: center; gap: 8px; }
  .app-shell .filter-fields label { flex-wrap: wrap; gap: 6px; }
  .app-shell .filter-fields label > span { width: 100%; }
  .app-shell .management-main > .settings-grid { grid-template-columns: minmax(0, 1fr); margin: 16px 12px; }
  .modal .form-grid { grid-template-columns: minmax(0, 1fr); }
  .modal .form-grid .span-2 { grid-column: auto; }
  dialog.route-planner-modal .route-planner-toolbar { height: auto; min-height: 90px; flex-wrap: wrap; padding: 8px; }
  dialog.route-planner-modal .route-planner-title { order: 3; flex: 1 0 100%; justify-content: flex-start; }
  dialog.route-planner-modal .route-planner-title > span { display: flex; }
  dialog.route-planner-modal .route-planner-body {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: 560px 320px 340px;
  }
  dialog.route-planner-modal .route-planner-map { grid-row: 1; min-height: 560px; }
  dialog.route-planner-modal .map-flight-instruments {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
  dialog.route-planner-modal .map-coordinate-fields { grid-column: 1 / -1; }
  dialog.route-planner-modal .route-planner-sidebar { grid-row: 2; min-height: 0; }
  dialog.route-planner-modal .route-waypoint-inspector { grid-row: 3; }
  dialog.route-planner-modal .route-planner-status { padding-inline: 8px; gap: 8px; }
  dialog.route-planner-modal .route-planner-status > span:nth-child(2) { display: none; }
  dialog.route-planner-modal .modal-feedback { left: 8px; right: 8px; }
  dialog .geo-editor { grid-template-columns: minmax(0, 1fr); }
}

/* Page names already appear in the breadcrumb. Cards share the main area's
   outer edges; their own padding still provides spacing for form/table content. */
.app-shell .management-main { background: transparent; }
.app-shell .management-main .management-page-heading > h1,
.app-shell .management-main .route-heading-title > h1,
.app-shell .management-main .route-heading-title > svg,
.app-shell .management-main > .page-heading,
.app-shell .management-main .logs-heading {
  display: none;
}
.app-shell .management-main .management-page-heading:not(:has(button, a, input, select)) {
  display: none;
}
.app-shell .management-main .management-page-heading:has(button, a, input, select) {
  justify-content: flex-end;
}
.app-shell .management-main .route-heading-title > span {
  border-left: 0;
  padding-left: 0;
}
.app-shell .management-main .logs-page {
  padding: 0;
  gap: var(--wy-management-gap);
  background: transparent;
}
/* Only filters and results are cards. Their wrappers must not paint an extra
   panel below short lists, and results end after their pagination. */
.app-shell .management-main .management-page.prototype-page,
.app-shell .management-main .logs-page {
  min-height: 0;
}
.app-shell .management-main .management-results,
.app-shell .management-main .logs-results {
  flex: 0 0 auto;
  min-height: 0;
}
.app-shell .management-main > .settings-grid { margin: 0; }
.app-shell:has(.route-library-workspace) .management-workspace {
  padding-top: 13px;
  padding-bottom: 9px;
}
@media (max-width: 640px) {
  .app-shell:has(.route-library-workspace) .management-workspace {
    padding-top: 0;
    padding-bottom: 0;
  }
}

/* Cover only the right-hand card workspace. Bounds are measured from the
   management main area so the header, breadcrumb, and sidebar stay visible. */
html:has(dialog.task-planner-modal[open]),
body:has(dialog.task-planner-modal[open]) {
  overflow: hidden;
  overscroll-behavior: none;
}
.management-main:has(dialog.task-planner-modal[open]) {
  visibility: hidden;
}
dialog.modal.task-planner-modal {
  visibility: visible;
  position: fixed;
  inset: auto;
  left: var(--task-workspace-left, 0px);
  top: var(--task-workspace-top, 0px);
  margin: 0;
  width: var(--task-workspace-width, 0px) !important;
  height: var(--task-workspace-height, 0px);
  max-width: none;
  max-height: none;
  padding: 0;
  border: 0;
  border-radius: 0;
  overflow: hidden;
  background: #fff;
}
dialog.modal.task-planner-modal::backdrop { background: transparent; }
dialog.modal.task-planner-modal .modal-inner,
dialog.modal.task-planner-modal .modal-content {
  height: 100%;
  min-height: 0;
  max-height: none;
  padding: 0;
}
dialog.modal.task-planner-modal .task-planner-form {
  overscroll-behavior: contain;
}

/* Home quick flight: one preflight form, matching the supplied reference. */
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-heading {
  min-height: 76px;
  padding: 22px 52px;
}
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-heading > div { text-align: center; }
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-heading h2 { font-size: 20px; }
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-heading > .icon-button:last-child { top: 20px; }
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-content { padding: 20px 40px 0; }
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-footer {
  border-top: 0;
  padding: 20px 40px 28px;
}
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-footer .button {
  min-width: 100px;
  height: 36px;
  border-radius: 8px;
  border-color: #0078ff;
  color: #0078ff;
  font-size: 16px;
}
dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-footer .button.primary {
  background: #0077ed;
  border-color: #0077ed;
  color: #fff;
}
.quick-flight-form { color: #262626; font-size: 16px; }
.quick-flight-warning {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid #df7900;
  background: #fff3e5;
  color: #d77500;
  padding: 14px 20px;
  border-radius: 9px;
  margin-bottom: 16px;
  font-size: 14px;
}
.quick-flight-warning svg { flex-shrink: 0; }
.quick-section { padding: 0 8px 14px; margin-bottom: 16px; border-bottom: 1px solid #e4e4e4; }
.quick-section h3 { margin: 0 0 8px; color: #939393; font-size: 15px; font-weight: 400; }
.quick-field { display: flex; justify-content: space-between; align-items: center; min-height: 42px; gap: 16px; }
.quick-field > span { flex-shrink: 0; }
.quick-inline { display: flex; align-items: center; gap: 10px; }
.quick-number {
  display: flex; align-items: center; width: 90px; height: 34px;
  border: 1px solid #c6c6c6; border-radius: 9px; overflow: hidden; background: #fff;
}
.quick-number input {
  min-width: 0; width: 100%; height: 100%; border: 0; border-radius: 0;
  padding: 4px 10px; background: transparent; color: inherit; font-size: 15px;
  appearance: textfield;
}
.quick-number input::-webkit-inner-spin-button { appearance: none; }
.quick-number > span { padding-right: 10px; font-size: 14px; }
.quick-number:focus-within { outline: 2px solid #1677ff44; border-color: #1677ff; }
.quick-number:has(input:disabled) { opacity: .45; background: #f5f5f5; }
.quick-field > select {
  width: 90px; height: 34px; padding: 4px 8px; border: 1px solid #c6c6c6;
  border-radius: 9px; color: #999; background: #f5f6f6; font-size: 15px;
}
.quick-flight-form input.quick-switch {
  appearance: none; width: 28px; min-width: 28px; height: 16px; min-height: 0;
  border: 0; border-radius: 10px; background: #bfbfbf; padding: 0; margin: 0;
  position: relative; cursor: pointer; flex-shrink: 0;
}
.quick-flight-form input.quick-switch::after {
  content: ""; position: absolute; width: 10px; height: 10px;
  top: 3px; left: 3px; border-radius: 50%; background: #fff; transition: transform .15s;
}
.quick-flight-form input.quick-switch:checked { background: #262626; }
.quick-flight-form input.quick-switch:checked::after { transform: translateX(12px); }
.quick-flight-form input.quick-switch:focus-visible { outline: 2px solid #1677ff; outline-offset: 3px; }
.quick-advanced { border-bottom: 0; padding-bottom: 0; margin-bottom: 18px; }
.quick-advanced-toggle {
  display: flex; justify-content: space-between; align-items: center; width: 100%;
  padding: 0 0 8px; color: #939393; background: transparent; font-size: 15px;
}
.quick-coordinates { display: flex; align-items: center; gap: 8px; min-width: 0; }
.quick-coordinates > input {
  width: 120px; min-width: 0; height: 34px; padding: 4px 10px;
  border: 1px solid #c6c6c6; border-radius: 9px; font-size: 14px; appearance: textfield;
}
.quick-coordinates > input::-webkit-inner-spin-button { appearance: none; }
.quick-field .quick-inline svg { color: #d77500; }
.quick-map-button { display: grid; place-items: center; padding: 4px; background: transparent; }
.quick-safety-confirmation {
  display: flex; align-items: center; gap: 8px; padding: 16px 24px;
  border: 1px solid #aaa; border-radius: 5px; background: #f5f5f5;
  font-size: 16px; font-weight: 600; cursor: pointer;
}
.quick-safety-confirmation input { width: 16px; height: 16px; accent-color: #777; margin: 0; }
.quick-destination-map { position: relative; height: 250px; margin-top: 12px; border-radius: 8px; overflow: hidden; }
.quick-destination-map > p {
  position: absolute; z-index: 800; left: 8px; top: 8px; margin: 0;
  padding: 6px 10px; border-radius: 4px; background: #fffffff2; font-size: 13px;
}
.quick-destination-map > .leaflet-map { height: 100%; }
@media (max-width: 640px) {
  dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-content { padding: 16px 16px 0; }
  dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-footer { padding: 16px; }
  .quick-flight-warning { padding: 10px 12px; }
  .quick-field { gap: 8px; }
  .quick-advanced .quick-field { flex-wrap: wrap; gap: 8px; }
  .quick-coordinates { width: 100%; }
  .quick-coordinates > input { flex: 1; width: 0; }
}

@media (max-height: 850px) {
  dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-heading { min-height: 60px; padding-block: 16px; }
  dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-heading > .icon-button:last-child { top: 14px; }
  dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-content { padding-top: 14px; }
  dialog.modal.quick-flight-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-footer { padding-block: 16px; }
  .quick-flight-warning { padding-block: 10px; margin-bottom: 12px; }
  .quick-section { padding-bottom: 10px; margin-bottom: 12px; }
  .quick-field { min-height: 38px; }
  .quick-safety-confirmation { padding-block: 12px; }
}

/* Tenant onboarding: reuse the application modal and controls. */
.tenant-create-steps { display:flex; justify-content:center; gap:32px; margin:0 0 26px; padding:0; list-style:none; }
.tenant-create-steps li { display:flex; align-items:center; gap:8px; color:#8b93a3; white-space:nowrap; }
.tenant-create-steps li > span { display:grid; place-items:center; width:25px; height:25px; border-radius:50%; background:#edf0f5; font-family:Arial,sans-serif; font-size:13px; }
.tenant-create-steps li.active { color:#007bff; }
.tenant-create-steps li.active > span { color:white; background:#007bff; }
.tenant-fields { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:20px 24px; }
.tenant-fields[hidden] { display:none; }
.tenant-field { min-width:0; display:flex; flex-direction:column; gap:8px; }
.tenant-field-wide { grid-column:1/-1; }
.tenant-field-label { color:#394451; font-weight:500; }
.tenant-required { color:#e75858; margin-right:4px; }
.tenant-create-form input:not([type=checkbox]):not([type=file]), .tenant-create-form select { box-sizing:border-box; width:100%; min-width:0; height:40px; padding:8px 12px; background:white; border:1px solid #dce1ea; border-radius:6px; color:#364453; font:inherit; }
.tenant-create-form input::placeholder { color:#a2a9b4; }
.tenant-create-form input:focus-visible, .tenant-create-form select:focus-visible { outline:2px solid #91caff; outline-offset:1px; }
.tenant-pair { display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:24px; }
.tenant-date-range { display:flex; align-items:center; gap:12px; }
.tenant-date-range input { flex:1; }
.tenant-date-range > span { color:#8b93a3; }
.tenant-logo-field { display:flex; align-items:center; gap:12px; min-height:72px; }
.tenant-logo-field small { color:#8b93a3; font-size:12px; line-height:1.6; }
.tenant-logo-upload { position:relative; flex:0 0 72px; width:72px; height:72px; display:grid; place-items:center; border:1px dashed #c6d4e3; border-radius:8px; background:#f5f9fe; color:#007bff; overflow:hidden; cursor:pointer; }
.tenant-logo-upload img { width:100%; height:100%; object-fit:contain; }
.tenant-logo-upload input { position:absolute; inset:0; width:100%; height:100%; opacity:0; cursor:pointer; }
.tenant-logo-upload:focus-within { outline:2px solid #91caff; }
.tenant-text-button { display:block; padding:4px 0 0; color:#007bff; background:transparent; }
.tenant-status { display:flex; align-items:center; gap:10px; min-height:32px; width:max-content; cursor:pointer; }
.tenant-status input { appearance:none; width:36px; height:20px; margin:0; border-radius:12px; background:#b7bec7; position:relative; cursor:pointer; }
.tenant-status input::after { content:''; position:absolute; width:14px; height:14px; border-radius:50%; background:#fff; top:3px; left:3px; transition:transform .15s; }
.tenant-status input:checked { background:#007bff; }
.tenant-status input:checked::after { transform:translateX(16px); }
.tenant-section-title { margin:0 0 16px; font-size:16px; font-weight:600; }
.tenant-advanced-toggle { display:flex; align-items:center; justify-content:space-between; width:100%; padding:22px 0 16px; margin-top:6px; background:transparent; color:#394451; font-weight:600; }
.tenant-weather { display:flex; flex-direction:column; gap:10px; }
.tenant-provider { display:flex; width:max-content; border:1px solid #007bff; border-radius:5px; overflow:hidden; }
.tenant-provider button { min-width:58px; padding:5px 12px; color:#007bff; background:white; }
.tenant-provider button.active { background:#007bff; color:white; }
.tenant-provider button:focus-visible { outline:2px solid #394451; outline-offset:-3px; }
.tenant-error { margin:16px 0 0; padding:10px 12px; border-radius:5px; background:#fff2f0; color:#c64036; }
.tenant-completion { padding:8px 0 12px; text-align:center; }
.tenant-success-icon { display:grid; place-items:center; width:50px; height:50px; border-radius:50%; margin:0 auto 16px; color:#16a36c; background:#e9f8f0; }
.tenant-completion h3 { font-size:20px; margin:0 0 8px; }
.tenant-completion > p { margin:8px 0 20px; color:#738194; }
.tenant-credentials { display:grid; grid-template-columns:auto minmax(0,1fr); gap:18px 28px; max-width:500px; margin:24px auto; padding:24px; background:#f6f8fb; border:1px solid #e6ebf2; border-radius:8px; text-align:left; }
.tenant-credentials dt { color:#738194; }
.tenant-credentials dd { margin:0; color:#26394c; font-family:ui-monospace,SFMono-Regular,Consolas,monospace; overflow-wrap:anywhere; user-select:all; }
.tenant-copy { display:inline-flex; gap:8px; align-items:center; justify-content:center; min-width:150px; }
.tenant-completion > .tenant-copy-hint { font-size:13px; margin:12px 0; }
.tenant-demo-note { display:block; font-size:12px; color:#949eaa; }
@media (max-width:640px) {
  .tenant-create-steps { gap:14px; font-size:13px; margin-bottom:20px; }
  .tenant-create-steps li { gap:4px; }
  .tenant-create-steps li > span { width:22px; height:22px; }
  .tenant-fields { grid-template-columns:minmax(0,1fr); gap:16px; }
  .tenant-pair { grid-template-columns:minmax(0,1fr); gap:10px; }
  .tenant-date-range { gap:5px; }
  .tenant-create-form .tenant-date-range input { padding:8px 5px; }
  .tenant-credentials { gap:16px 12px; padding:18px 12px; font-size:14px; }
  dialog.modal.tenant-create-modal:not(.task-planner-modal):not(.route-planner-modal) .modal-content { padding:16px; }
}
.tenant-region-control { display:flex; align-items:center; gap:8px; min-width:0; }
.tenant-region-trigger { display:flex; align-items:center; justify-content:space-between; gap:8px; flex:1; min-width:0; height:40px; padding:8px 12px; border:1px solid #dce1ea; border-radius:6px; background:white; color:#364453; text-align:left; }
.tenant-region-trigger > span { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.tenant-region-trigger > .placeholder { color:#a2a9b4; }
.tenant-region-trigger svg { flex-shrink:0; }
.tenant-map-trigger { width:36px; height:40px; display:grid; place-items:center; background:#f0f7ff; color:#007bff; border:1px solid #d8e9ff; border-radius:6px; }
.tenant-region-panel { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:12px 16px; margin-top:12px; padding:16px; background:#f7f9fc; border:1px solid #e1e7ef; border-radius:8px; }
.tenant-region-level { display:flex; flex-direction:column; gap:7px; min-width:0; font-size:13px; }
.tenant-region-note { grid-column:1/-1; display:block; color:#8a95a4; line-height:1.6; padding-top:6px; }
.tenant-region-panel > button { justify-self:end; grid-column:1/-1; }
.tenant-address-validation { display:flex; align-items:center; gap:10px; font-size:12px; color:#81909f; margin-top:10px; min-height:22px; }
.tenant-address-validation > span { flex:1; line-height:1.6; }
.tenant-address-validation > button { flex-shrink:0; padding:0; }
.tenant-address-validation > .tenant-address-error { color:#c64036; }
.tenant-address-map { position:relative; height:300px; margin-top:14px; border:1px solid #dce1ea; border-radius:8px; overflow:hidden; }
.tenant-address-map .map-scene { height:100%; min-height:0; }
.tenant-map-hint { position:absolute; top:10px; left:10px; z-index:700; margin:0; max-width:calc(100% - 20px); border-radius:4px; background:#fffffff0; color:#364453; padding:7px 10px; font-size:12px; pointer-events:none; }
.tenant-edit-copy { margin-right:auto; }
@media(max-width:640px) {
  .tenant-region-panel { grid-template-columns:minmax(0,1fr); padding:12px; }
  .tenant-address-validation { flex-wrap:wrap; }
  .tenant-address-validation > span { flex-basis:100%; }
  dialog.tenant-create-modal .modal-footer { flex-wrap:wrap; }
}

/* Cockpit: reserve room for all controls and keep panels within the viewport. */
.cockpit-route { height:100dvh; overflow:hidden; }
.cockpit-route .workspace { height:100%; min-height:0; padding:0; overflow:hidden; }
.cockpit-route .workspace > main { height:100%; min-height:0; min-width:0; padding:0; }
.cockpit-route .prototype-cockpit { --cockpit-controls-height:182px; height:100dvh; min-height:0; width:100%; overflow:hidden; }
.cockpit-route .cockpit-topbar { height:56px; min-height:56px; padding:0 20px; }
.cockpit-route .cockpit-topbar-leading { min-width:220px; gap:14px; }
.cockpit-route .cockpit-topbar-leading h1 { font-size:19px; }
.cockpit-route .telemetry-strip { flex:0 0 30px; min-height:30px; height:30px; overflow-x:auto; overflow-y:hidden; scrollbar-width:thin; gap:16px; font-size:10px; }
.cockpit-route .telemetry-strip > * { flex-shrink:0; }
.cockpit-route .flight-workspace { display:grid; grid-template-columns:minmax(260px,31fr) minmax(0,69fr); flex:1; height:auto; min-height:0; overflow:hidden; }
.cockpit-route .flight-map-column, .cockpit-route .flight-main { width:auto; min-width:0; min-height:0; }
.cockpit-route .flight-map-column { border-right:1px solid #38434c; }
.cockpit-route .flight-main { display:grid; grid-template-rows:minmax(0,1fr) 48px var(--cockpit-controls-height); }
.cockpit-route .flight-camera { min-width:0; min-height:0; }
.cockpit-route .flight-map-column .flight-map { min-height:0; }
.cockpit-route .flight-aux-preview { flex:0 0 var(--cockpit-controls-height); height:var(--cockpit-controls-height); min-height:0; }
.cockpit-route .aux-tabs { height:32px; gap:22px; font-size:12px; }
.cockpit-route .aux-image { height:calc(100% - 32px); }
.cockpit-route .camera-mode { position:absolute; top:44px; left:16px; gap:8px; z-index:4; }
.cockpit-route .camera-mode select, .cockpit-route .camera-mode > span { box-sizing:border-box; display:flex; align-items:center; width:auto; min-width:88px; height:32px; min-height:32px; padding:5px 12px; line-height:22px; white-space:nowrap; font-size:12px; }
.cockpit-route .camera-mode > span { align-self:flex-start; min-width:64px; justify-content:center; height:26px; min-height:26px; line-height:16px; }
.cockpit-route .camera-zoom { position:absolute; top:50%; transform:translateY(-50%); right:12px; gap:3px; padding:8px; border-radius:10px; max-height:calc(100% - 90px); overflow-y:auto; }
.cockpit-route .camera-zoom button { min-height:23px; line-height:23px; padding:0 8px; white-space:nowrap; }
.cockpit-route .camera-zoom > span { white-space:nowrap; margin-top:4px; font-size:10px; }
.cockpit-route .flight-payload-bar { box-sizing:border-box; height:48px; min-height:0; padding:7px 10px; gap:6px; overflow-x:auto; overflow-y:hidden; }
.cockpit-route .flight-payload-bar > button { flex:0 0 auto; width:34px; min-width:34px; height:32px; padding:0; line-height:32px; white-space:nowrap; border-radius:4px; }
.cockpit-route .flight-payload-bar > button:nth-of-type(5), .cockpit-route .flight-payload-bar > button:nth-of-type(6) { width:auto; min-width:70px; padding:0 9px; font-size:12px; }
.cockpit-route .flight-payload-bar > .filter-spacer { flex:1; min-width:4px; }
.cockpit-route .flight-bottom { box-sizing:border-box; display:grid; grid-template-columns:minmax(88px,1fr) minmax(125px,1.15fr) minmax(164px,1.4fr) minmax(128px,1.1fr) 96px; gap:8px; height:var(--cockpit-controls-height); min-height:0; padding:8px; background:#29323a; overflow:hidden; border-top:1px solid #404b55; }
.cockpit-route .flight-bottom > * { width:auto; min-width:0; min-height:0; border-radius:5px; }
.cockpit-route .infrared-preview { display:flex; flex-direction:column; background:#171d22; }
.cockpit-route .infrared-preview > div { height:28px; flex:0 0 28px; background:#3c4650; color:#e1e7ee; font-size:12px; padding:6px 9px; }
.cockpit-route .infrared-preview img { display:block; flex:1; min-height:0; height:0; width:100%; object-fit:cover; }
.cockpit-route .flight-task-info { padding:6px 8px; font-size:11px; overflow-y:auto; background:#222b33; }
.cockpit-route .flight-state { display:block; color:#91caff; font-size:11px; margin-bottom:6px; }
.cockpit-route .flight-task-info small { font-size:11px; line-height:16px; margin:0 0 3px; color:#a7b4c0; }
.cockpit-route .flight-task-info strong { font-size:12px; line-height:18px; margin:0 0 10px; white-space:normal; overflow-wrap:anywhere; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.cockpit-route .flight-task-info p { font-size:10px; gap:4px; line-height:16px; margin:5px 0; }
.cockpit-route .flight-task-info p b { white-space:nowrap; font-weight:500; }
.cockpit-route .flight-instrument { background:#1a2229; display:grid; grid-template-columns:40px minmax(70px,1fr) 34px; align-items:center; gap:4px; padding:8px; }
.cockpit-route .flight-instrument .instrument-speed { order:0; }
.cockpit-route .flight-instrument .compass { order:1; }
.cockpit-route .flight-instrument .instrument-alt { order:2; }
.cockpit-route .instrument-alt, .cockpit-route .instrument-speed { position:static; font-size:19px; line-height:24px; min-width:0; text-align:center; }
.cockpit-route .instrument-alt small, .cockpit-route .instrument-speed small { font-size:8px; line-height:16px; white-space:nowrap; }
.cockpit-route .compass { width:clamp(70px,7vw,100px); height:clamp(70px,7vw,100px); border-width:7px; max-width:100%; aspect-ratio:1; font-size:10px; }
.cockpit-route .compass i { font-size:30px; line-height:32px; }
.cockpit-route .gimbal-control { border:0; background:#222b33; padding:6px; display:flex; flex-direction:column; gap:10px; }
.cockpit-route .gimbal-control h3 { font-size:12px; line-height:24px; background:#3b4650; margin:0; padding:0 6px; border-radius:3px; white-space:nowrap; }
.cockpit-route .gimbal-arrows { margin:2px 0; gap:3px; }
.cockpit-route .gimbal-arrows button { flex:0 0 24px; border-color:#b6c5d2; color:#e5edf4; width:24px; height:24px; min-width:0; font-family:Arial,sans-serif; font-size:11px; }
.cockpit-route .gimbal-presets { grid-template-columns:repeat(3,minmax(0,1fr)); gap:5px; padding:0; }
.cockpit-route .gimbal-presets button { background:#3b4956; color:#e7edf4; border:1px solid #506170; height:27px; padding:0 2px; font-size:11px; white-space:nowrap; border-radius:3px; }
.cockpit-route .gimbal-control button:disabled { opacity:.55; cursor:not-allowed; }
.cockpit-route .flight-command-buttons { display:grid; grid-template-rows:repeat(5,minmax(0,1fr)); gap:5px; width:auto; padding:0; }
.cockpit-route .flight-command-buttons button { height:auto; min-height:0; line-height:22px; padding:0 5px; font-size:11px; white-space:nowrap; color:#e7eef5; background:#3b4956; border:1px solid #546372; border-radius:4px; }
.cockpit-route .flight-command-buttons button:last-child { border-color:#2589e8; color:#badaff; background:#163d61; }
.cockpit-route .flight-command-buttons button:disabled { opacity:.45; }
.cockpit-route .cockpit-map-options { top:16px; left:52px; right:8px; gap:4px; flex-wrap:wrap; }
.cockpit-route .cockpit-map-options button { padding:7px 8px; border-radius:4px; font-size:11px; white-space:nowrap; box-shadow:0 1px 5px #0002; }
.cockpit-route .control-owner { height:auto; min-height:34px; padding:5px 8px; gap:6px; font-size:10px; }
.cockpit-route .control-owner > span { min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.cockpit-route .control-owner > button { flex-shrink:0; white-space:nowrap; padding:4px 8px; }
@media (max-width:1100px) and (min-width:801px) {
  .cockpit-route .prototype-cockpit { --cockpit-controls-height:210px; }
  .cockpit-route .flight-workspace { grid-template-columns:minmax(245px,29fr) minmax(0,71fr); }
  .cockpit-route .flight-bottom { grid-template-columns:minmax(78px,.8fr) minmax(110px,1fr) minmax(160px,1.3fr) minmax(118px,1fr); grid-template-rows:minmax(0,1fr) 32px; gap:6px; }
  .cockpit-route .flight-command-buttons { grid-column:1/-1; grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:1fr; }
  .cockpit-route .flight-task-info { padding:5px; }
  .cockpit-route .flight-task-info p { font-size:9px; }
  .cockpit-route .gimbal-control { padding:4px; }
  .cockpit-route .cockpit-topbar-tools { gap:18px; }
}
@media (max-width:800px) {
  .cockpit-route { height:auto; min-height:100dvh; overflow:auto; }
  .cockpit-route .workspace, .cockpit-route .workspace > main { height:auto; overflow:visible; }
  .cockpit-route .prototype-cockpit { height:auto; min-height:100dvh; overflow:visible; }
  .cockpit-route .cockpit-topbar { padding:0 12px; }
  .cockpit-route .cockpit-topbar-leading { min-width:0; flex:1; gap:6px; }
  .cockpit-route .cockpit-topbar-leading h1 { font-size:17px; }
  .cockpit-route .cockpit-topbar-tools { flex:0; gap:2px; }
  .cockpit-route .cockpit-topbar-tools button { width:30px; }
  .cockpit-route .cockpit-online { width:18px; height:18px; margin-left:8px; }
  .cockpit-route .flight-workspace { display:flex; flex-direction:column; overflow:visible; }
  .cockpit-route .flight-main { order:0; display:grid; grid-template-rows:minmax(270px,46dvh) 48px auto; }
  .cockpit-route .flight-map-column { order:1; display:grid; grid-template-columns:minmax(0,1fr); grid-template-rows:300px 160px; border-right:0; }
  .cockpit-route .flight-map-column .flight-map { min-height:300px; }
  .cockpit-route .flight-aux-preview { height:160px; }
  .cockpit-route .flight-bottom { height:auto; overflow:visible; grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:176px 170px 36px; }
  .cockpit-route .flight-command-buttons { grid-column:1/-1; grid-template-rows:1fr; grid-template-columns:repeat(5,minmax(0,1fr)); }
  .cockpit-route .flight-command-buttons button { font-size:10px; padding:0 2px; }
  .cockpit-route .camera-zoom { gap:0; top:50%; max-height:calc(100% - 44px); }
  .cockpit-route .camera-zoom button { min-height:20px; line-height:20px; }
}
.cockpit-route .flight-command-buttons { grid-template-columns:minmax(0,1fr); }
@media (max-width:1100px) { .cockpit-route .flight-command-buttons { grid-template-columns:repeat(5,minmax(0,1fr)); } }

/* The cockpit uses the same platform navigation as every other page. */
.app-shell.cockpit-route { display:flex; flex-direction:column; }
.app-shell.cockpit-route .global-header { display:flex; flex:0 0 var(--wy-header-height); }
.app-shell.cockpit-route .workspace { flex:1; height:auto; min-height:0; }
.app-shell.cockpit-route .workspace > main { height:100%; min-height:0; }
.app-shell.cockpit-route .prototype-cockpit { height:100%; min-height:0; }
.app-shell.cockpit-route .cockpit-topbar { display:none; }
@media (max-width:640px) { .app-shell.cockpit-route .global-header { display:grid; } }
@media (max-width:800px) {
  .app-shell.cockpit-route .workspace, .app-shell.cockpit-route .workspace > main { height:auto; flex:initial; }
  .app-shell.cockpit-route .prototype-cockpit { height:auto; }
}

/* Playback surfaces are always 16:9. Letterbox inside differently sized panels. */
.app-shell video { display:block; width:100%; height:auto; aspect-ratio:16 / 9; object-fit:contain; background:#080b0e; }
.app-shell .feature-player video.replay-frame { height:auto; aspect-ratio:16 / 9; object-fit:contain; }
.app-shell .feature-player .scene-preview { height:auto; min-height:0; aspect-ratio:16 / 9; background:#080b0e; }
.app-shell .feature-player .scene-preview > svg { aspect-ratio:16 / 9; width:100%; height:100%; min-height:0; }
.cockpit-route .camera-scene { container-type:size; display:grid; place-items:center; background:#080b0e; }
.cockpit-route .camera-scene .scene-preview { width:min(100cqw, calc(100cqh * 16 / 9)); height:auto; min-height:0; max-height:none; aspect-ratio:16 / 9; border-radius:0; }
.cockpit-route .camera-scene .scene-preview > svg { display:block; width:100%; height:100%; min-height:0; aspect-ratio:16 / 9; }
.cockpit-route .aux-image { container-type:size; display:grid; place-items:center; background:#080b0e; }
.cockpit-route .aux-image > img { width:min(100cqw, calc(100cqh * 16 / 9)); height:auto; min-height:0; aspect-ratio:16 / 9; object-fit:cover; }
.cockpit-route .infrared-preview { background:#080b0e; }
.cockpit-route .infrared-preview > img { flex:0 0 auto; width:100%; height:auto; min-height:0; aspect-ratio:16 / 9; object-fit:cover; margin-block:auto; }
.app-shell .fullscreen-preview { container-type:size; align-items:center; justify-content:center; background:#080b0e; }
.app-shell .fullscreen-preview .scene-preview { flex:0 0 auto; width:min(100cqw, calc((100cqh - 50px) * 16 / 9)); height:auto; min-height:0; aspect-ratio:16 / 9; }
.app-shell .fullscreen-preview .scene-preview > svg { width:100%; height:100%; aspect-ratio:16 / 9; }

/* Prototype composition: full-width ownership strip, map/auxiliary left,
   main image over a single task/instrument/control row on the right. */
.cockpit-route .prototype-cockpit { --cockpit-controls-height:182px; }
.cockpit-route .control-owner { position:static; flex:0 0 30px; min-height:30px; width:100%; height:30px; display:flex; align-items:center; justify-content:center; gap:24px; padding:3px 16px; border-radius:0; background:#d3832e; font-size:12px; }
.cockpit-route .control-owner > button { background:#b95f08; border:1px solid #f4b876; border-radius:14px; padding:2px 20px; font-size:12px; }
.cockpit-route .flight-workspace { grid-template-columns:clamp(240px,27vw,410px) minmax(0,1fr); }
.cockpit-route .flight-map-column { display:flex; container-type:inline-size; }
.cockpit-route .flight-map-column .flight-map { position:relative; flex:1; min-height:0; }
.cockpit-route .flight-aux-preview { flex:0 0 auto; height:calc(100cqw * 3 / 4 + 33px); min-height:0; }
.cockpit-route .aux-image { height:calc(100% - 32px); }
.cockpit-route .aux-image > img { width:100%; height:100%; object-fit:contain; }
.cockpit-route .flight-map .telemetry-strip { position:absolute; top:0; left:0; right:0; z-index:700; min-height:28px; height:28px; padding:0 8px; gap:10px; background:#18252ccc; font-size:9px; pointer-events:none; scrollbar-width:none; }
.cockpit-route .flight-map .telemetry-strip > :nth-child(n+7) { display:none; }
.cockpit-route .flight-map-tools { top:42px; }
.cockpit-route .cockpit-map-options { top:42px; }
.cockpit-route .flight-route-unavailable { top:85px; bottom:auto; }
.cockpit-route .flight-main { position:relative; grid-template-rows:minmax(0,1fr) var(--cockpit-controls-height); }
.cockpit-route .flight-camera { grid-row:1; }
.cockpit-route .flight-payload-bar { position:absolute; z-index:5; left:0; right:0; bottom:var(--cockpit-controls-height); height:42px; padding:5px 10px; background:#111b; }
.cockpit-route .camera-mock-label { display:none; }
.cockpit-route .flight-bottom { grid-row:2; grid-template-columns:minmax(312px,1.95fr) minmax(150px,1fr) minmax(134px,.9fr) 78px; grid-template-rows:minmax(0,1fr); gap:6px; padding:6px; }
.cockpit-route .flight-task-info { padding:0; display:flex; flex-direction:column; overflow:hidden; }
.cockpit-route .task-summary-heading { display:flex; align-items:center; justify-content:space-between; gap:8px; flex:0 0 32px; padding:0 10px; border-bottom:1px solid #4b565f; background:#3b4650; }
.cockpit-route .task-summary-heading strong { display:block; margin:0; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; font-size:12px; line-height:20px; }
.cockpit-route .task-summary-heading .flight-state { margin:0; flex-shrink:0; font-size:10px; }
.cockpit-route .task-summary-columns { display:grid; grid-template-columns:minmax(110px,.85fr) minmax(0,1.65fr); flex:1; min-height:0; }
.cockpit-route .task-summary-columns dl { margin:0; padding:8px; min-width:0; display:grid; grid-template-rows:repeat(4,minmax(0,1fr)); gap:4px 12px; }
.cockpit-route .task-summary-telemetry { grid-template-columns:repeat(2,minmax(0,1fr)); border-left:1px solid #47525c; }
.cockpit-route .task-metric { display:flex; align-items:center; justify-content:space-between; gap:4px; min-width:0; }
.cockpit-route .task-metric dt { color:#aab7c3; font-size:10px; white-space:nowrap; }
.cockpit-route .task-metric dd { margin:0; min-width:0; color:#edf3f8; font-size:10px; white-space:nowrap; }
.cockpit-route .task-summary-telemetry .task-metric { flex-wrap:wrap; align-content:center; column-gap:4px; row-gap:2px; }
.cockpit-route .task-summary-telemetry .task-metric dt, .cockpit-route .task-summary-telemetry .task-metric dd { font-size:9px; }
.cockpit-route .task-metric .task-algorithm { max-width:65%; overflow:hidden; text-overflow:ellipsis; padding:3px 5px; border-radius:4px; background:#364652; }
.cockpit-route .flight-command-buttons { grid-column:auto; grid-template-columns:minmax(0,1fr); grid-template-rows:repeat(5,minmax(0,1fr)); }
.cockpit-route .flight-instrument { grid-template-columns:32px minmax(62px,1fr) 30px; padding:5px; }
.cockpit-route .compass { width:clamp(70px,7vw,106px); height:auto; }
.cockpit-route .gimbal-control { gap:8px; }
@media (min-width:1400px) {
  .cockpit-route .task-summary-columns { grid-template-columns:minmax(128px,1fr) minmax(0,1.6fr); }
  .cockpit-route .task-summary-columns dl { padding:10px; }
  .cockpit-route .task-metric dt, .cockpit-route .task-metric dd { font-size:11px; }
  .cockpit-route .task-summary-telemetry .task-metric dt, .cockpit-route .task-summary-telemetry .task-metric dd { font-size:10px; }
}
@media (min-width:801px) and (max-width:999px) {
  .cockpit-route .prototype-cockpit { --cockpit-controls-height:240px; }
  .cockpit-route .flight-bottom { grid-template-columns:minmax(150px,1fr) minmax(134px,1fr) 78px; grid-template-rows:124px minmax(0,1fr); }
  .cockpit-route .flight-task-info { grid-column:1/-1; }
  .cockpit-route .task-summary-columns { grid-template-columns:1fr 2fr; }
}
@media (max-width:800px) {
  .cockpit-route .flight-workspace { display:flex; flex-direction:column; }
  .cockpit-route .flight-main { grid-template-rows:minmax(240px,56.25vw) auto; }
  .cockpit-route .flight-payload-bar { top:calc(max(240px,56.25vw) - 42px); bottom:auto; }
  .cockpit-route .flight-bottom { grid-template-columns:repeat(2,minmax(0,1fr)); grid-template-rows:170px 162px 34px; height:auto; }
  .cockpit-route .flight-task-info { grid-column:1/-1; }
  .cockpit-route .flight-command-buttons { grid-column:1/-1; grid-template-columns:repeat(5,minmax(0,1fr)); grid-template-rows:1fr; }
  .cockpit-route .flight-map-column { display:flex; flex-direction:column; }
  .cockpit-route .flight-map-column .flight-map { min-height:300px; flex:0 0 300px; }
  .cockpit-route .flight-aux-preview { height:calc(100cqw * 3 / 4 + 33px); }
  .cockpit-route .control-owner { gap:12px; font-size:10px; }
}

/* A fixed 4:3 canvas is independent of intrinsic stream dimensions and controls. */
.cockpit-route .flight-camera { container-type:size; display:grid; place-items:center; background:#000; overflow:hidden; }
.cockpit-route .cockpit-player-canvas { position:relative; width:min(100cqw,calc(100cqh * 4 / 3)); height:auto; min-width:0; min-height:0; aspect-ratio:4 / 3; background:#000; overflow:hidden; isolation:isolate; }
.cockpit-route .cockpit-player-canvas .camera-scene { display:block; container-type:normal; background:#000; }
.cockpit-route .cockpit-player-canvas .camera-scene::after { display:none; }
.cockpit-route .cockpit-player-canvas .scene-preview { width:100%; height:100%; min-height:0; max-height:none; aspect-ratio:auto; background:#000; }
.cockpit-route .cockpit-player-canvas .scene-preview > svg,
.cockpit-route .cockpit-player-canvas .camera-scene video,
.cockpit-route .cockpit-player-canvas .camera-scene img { display:block; width:100%; height:100%; min-height:0; max-height:none; aspect-ratio:auto; object-fit:contain; object-position:center; background:#000; }
.cockpit-route .video-annotations { position:absolute; z-index:2; left:var(--content-x,0px); top:var(--content-y,0px); width:var(--content-width,0px); height:var(--content-height,0px); overflow:hidden; pointer-events:none; visibility:var(--content-ready,hidden); }
.cockpit-route .video-annotations .thermal-region { pointer-events:none; box-sizing:border-box; }
.cockpit-route .aux-image > img { aspect-ratio:auto; object-fit:contain; background:#000; }
.cockpit-route .aux-image { background:#000; }
.cockpit-route .aux-image::after { display:none; }
.cockpit-route .aux-box { visibility:var(--content-ready,hidden); max-width:calc(var(--content-width) * .38); overflow:hidden; white-space:nowrap; }
.cockpit-route .aux-box-one { left:calc(var(--content-x) + var(--content-width) * .36); top:calc(var(--content-y) + var(--content-height) * .35); }
.cockpit-route .aux-box-two { left:calc(var(--content-x) + var(--content-width) * .58); top:calc(var(--content-y) + var(--content-height) * .58); }
/* Real media always keeps its own aspect ratio; its parent owns the canvas. */
.app-shell video { aspect-ratio:auto; object-fit:contain; object-position:center; background:#000; }
.app-shell .feature-player video.replay-frame { aspect-ratio:4 / 3; object-fit:contain; background:#000; }
@media (max-width:800px) {
  .cockpit-route .flight-main { grid-template-rows:max(280px,75vw) auto; }
  .cockpit-route .flight-payload-bar { top:calc(max(280px,75vw) - 42px); }
}

/* Camera controls sit outside the media canvas; only annotations use its offsets. */
.cockpit-route .camera-controls-overlay { position:absolute; inset:0; z-index:4; pointer-events:none; }
.cockpit-route .camera-controls-overlay button,
.cockpit-route .camera-controls-overlay select,
.cockpit-route .camera-controls-overlay input { pointer-events:auto; }
.cockpit-route .camera-controls-overlay .camera-mode { top:16px; left:16px; }
.cockpit-route .camera-controls-overlay .flight-payload-bar { top:auto; bottom:0; height:42px; }
.cockpit-route .camera-controls-overlay .camera-zoom { right:16px; top:50%; display:flex; flex-direction:column; align-items:center; gap:6px; padding:10px 8px; max-height:calc(100% - 106px); overflow:hidden; border-radius:8px; background:#111d; }
.cockpit-route .camera-controls-overlay .camera-zoom input { writing-mode:vertical-lr; direction:rtl; height:clamp(90px,20vh,170px); width:20px; min-height:60px; flex:1 1 auto; padding:0; margin:0; accent-color:#419bff; cursor:pointer; }
.cockpit-route .camera-controls-overlay .camera-zoom .camera-zoom-limit { margin:0; font-size:10px; }
.cockpit-route .camera-controls-overlay .camera-zoom output { font-size:12px; font-variant-numeric:tabular-nums; color:#8dc9ff; min-width:38px; text-align:center; }
.cockpit-route .camera-controls-overlay :focus-visible { outline:2px solid #8dc9ff; outline-offset:3px; }
.cockpit-route .camera-scene .scene-label,
.cockpit-route .camera-scene .scene-demo { display:none; }
.cockpit-route .flight-camera.thermal-mode { filter:none; }
.cockpit-route .flight-camera.thermal-mode .camera-scene { filter:sepia(.65); }
.cockpit-route .thermal-region span { top:0; left:0; padding:2px 4px; background:#0009; }

/* Compact, fixed-height instruments remain siblings of the player region. */
@media (min-width:1000px) {
  .cockpit-route .prototype-cockpit { --cockpit-controls-height:156px; }
  .cockpit-route .task-summary-heading { flex-basis:28px; }
  .cockpit-route .task-summary-columns dl { padding:6px 8px; gap:2px 8px; }
  .cockpit-route .gimbal-control { gap:5px; padding:5px; }
  .cockpit-route .gimbal-presets button { height:25px; }
}
@media (min-width:801px) and (max-width:999px) {
  .cockpit-route .prototype-cockpit { --cockpit-controls-height:224px; }
  .cockpit-route .flight-bottom { grid-template-rows:108px minmax(0,1fr); }
  .cockpit-route .gimbal-control { gap:2px; padding:3px; }
  .cockpit-route .gimbal-control h3 { line-height:20px; }
  .cockpit-route .gimbal-presets { grid-template-columns:repeat(6,minmax(0,1fr)); gap:2px; }
  .cockpit-route .gimbal-presets button { height:22px; font-size:9px; }
}
@media (max-width:800px) {
  .cockpit-route .flight-bottom { grid-template-rows:156px 144px 30px; }
  .cockpit-route .camera-controls-overlay .camera-mode { top:12px; left:12px; }
  .cockpit-route .camera-controls-overlay .camera-zoom { right:12px; }
}
