/* Correct header placement and portal the operations menu outside clipped cards. */
.flight-card--optimized .flight-card__top {
  grid-template-columns: minmax(0, 1fr) auto 36px !important;
  align-items: start;
}

.flight-card__menu-button {
  margin: 0 !important;
  justify-self: end;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.flight-card__menu {
  display: none !important;
}

.mobile-safe-flight-operations[hidden] {
  display: none !important;
}

.mobile-safe-flight-operations {
  position: fixed;
  z-index: 10000;
  inset: 0;
  pointer-events: none;
}

.mobile-safe-flight-operations__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  pointer-events: auto;
}

.mobile-safe-flight-operations__panel {
  position: fixed;
  top: var(--operations-top, 80px);
  left: var(--operations-left, 12px);
  z-index: 1;
  width: min(270px, calc(100vw - 24px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 16px;
  background: #171b22;
  color: #f4f6f8;
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.44);
  pointer-events: auto;
}

.mobile-safe-flight-operations__heading {
  display: grid;
  gap: 2px;
  padding: 13px 14px 10px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.mobile-safe-flight-operations__heading span {
  color: #9aa5b4;
  font-size: 0.67rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-safe-flight-operations__heading strong {
  color: #fff;
  font-size: 0.95rem;
  font-weight: 950;
}

.mobile-safe-flight-operations__actions {
  display: grid;
  gap: 3px;
  padding: 7px;
}

.mobile-safe-flight-operations__actions button,
.mobile-safe-flight-operations__cancel {
  width: 100%;
  min-height: 44px;
  padding: 11px 12px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: #f4f6f8;
  font: inherit;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.mobile-safe-flight-operations__actions button:hover,
.mobile-safe-flight-operations__actions button:focus-visible,
.mobile-safe-flight-operations__cancel:hover,
.mobile-safe-flight-operations__cancel:focus-visible {
  background: rgba(255, 255, 255, 0.09);
  outline: none;
}

.mobile-safe-flight-operations__reset {
  margin-top: 4px;
  border-top: 1px solid rgba(255, 255, 255, 0.12) !important;
  border-radius: 0 0 10px 10px !important;
  color: #ffb8b8 !important;
}

.mobile-safe-flight-operations__cancel {
  display: none;
}

#priority-pass-override-dialog [data-priority-current] {
  margin: 0;
  color: #b7c0cc;
}

@media (max-width: 620px) {
  body.flight-operations-menu-open {
    overflow: hidden;
  }

  .flight-card--optimized .flight-card__top {
    grid-template-columns: minmax(0, 1fr) auto 34px !important;
    gap: 6px;
  }

  .flight-card__menu-button {
    width: 34px;
    height: 34px;
  }

  .mobile-safe-flight-operations__backdrop {
    background: rgba(4, 7, 11, 0.56);
    backdrop-filter: blur(2px);
  }

  .mobile-safe-flight-operations__panel {
    top: auto;
    right: 10px;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: auto;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    border-radius: 20px;
  }

  .mobile-safe-flight-operations__heading {
    padding: 15px 15px 11px;
  }

  .mobile-safe-flight-operations__actions {
    padding: 8px;
  }

  .mobile-safe-flight-operations__actions button {
    min-height: 52px;
    padding: 14px;
    font-size: 1rem;
  }

  .mobile-safe-flight-operations__cancel {
    display: block;
    min-height: 50px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0;
    color: #cbd5e1;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .flight-card--optimized .flight-card__top {
    grid-template-columns: minmax(0, 1fr) minmax(0, auto) 32px !important;
  }

  .flight-card__menu-button {
    width: 32px;
    height: 32px;
  }
}
