.pilot-menu {
  position: relative;
  z-index: 3;
}

.pilot-menu .pilot-control {
  max-width: 24rem;
  text-align: left;
}

.pilot-menu .pilot-copy {
  min-width: 0;
}

.pilot-menu .pilot-copy > span:first-child {
  display: block;
  max-width: 18rem;
  overflow: hidden;
  color: rgba(var(--theme-rgb), .74);
  font: 300 clamp(.68rem, .72vw, .86rem)/1 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: .32em;
  text-shadow:
    0 0 4px rgba(var(--theme-rgb), .48),
    0 0 12px rgba(var(--theme-rgb), .24);
  text-overflow: ellipsis;
}

.pilot-chevron {
  display: inline-grid;
  flex: 0 0 auto;
  width: 1.05rem;
  height: 1.05rem;
  place-items: center;
  margin: -.24rem 0 -.22rem .02rem;
  color: rgba(var(--theme-rgb), .88);
  font: 400 1.15rem/1 Consolas, monospace;
  letter-spacing: 0;
  filter: drop-shadow(0 0 4px rgba(var(--theme-rgb), .45));
  text-shadow: 0 0 7px rgba(var(--theme-rgb), .42);
  transform: rotate(-90deg);
  transition: transform .18s ease, color .18s ease;
}

.pilot-menu.is-open .pilot-chevron {
  color: var(--ink);
  transform: rotate(90deg);
}

.pilot-panel {
  position: absolute;
  top: calc(100% + .42rem);
  left: .2rem;
  z-index: 122;
  display: none;
  width: 17rem;
  border: 1px solid rgba(var(--theme-rgb), .42);
  background:
    repeating-linear-gradient(0deg, transparent 0 4px, rgba(var(--theme-rgb), .018) 5px),
    rgba(1, 10, 12, .97);
  box-shadow: inset 0 0 28px rgba(var(--theme-rgb), .055), 0 18px 45px rgba(0, 0, 0, .72), 0 0 20px rgba(var(--theme-rgb), .12);
}

.pilot-panel::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: 100%;
  left: 0;
  height: .45rem;
}

.pilot-menu.is-open .pilot-panel {
  display: grid;
}

.pilot-panel header {
  display: grid;
  gap: .24rem;
  padding: .78rem .82rem;
  border-bottom: 1px solid rgba(var(--theme-rgb), .22);
  background: rgba(var(--theme-rgb), .035);
}

.pilot-panel header span {
  color: var(--ink);
  font: 600 .76rem/1 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: .16em;
}

.pilot-panel header small {
  color: rgba(var(--theme-rgb), .48);
  font: 600 .49rem/1 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: .13em;
}

.pilot-panel a {
  display: grid;
  grid-template-columns: 1.7rem 1fr;
  align-items: center;
  min-height: 2.2rem;
  padding: .56rem .78rem;
  border-bottom: 1px solid rgba(var(--theme-rgb), .1);
  color: rgba(220, 240, 235, .78);
  font: 600 .64rem/1 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  letter-spacing: .13em;
  text-decoration: none;
  cursor: url("/assets/icons/pandora-action-04.svg") 12 5, pointer;
}

.pilot-panel a * { cursor: inherit; }

.pilot-panel a span {
  color: rgba(var(--theme-rgb), .48);
  font-size: .5rem;
}

.pilot-panel a em[data-pandora-esi-warning]{display:block;grid-column:2;color:#ff9798;font:600 .52rem/1.35 "Consolas",monospace;font-style:normal;margin-top:.3rem;letter-spacing:.05em}
.pilot-panel a em[data-pandora-esi-warning][hidden]{display:none}

.pilot-panel a:hover,
.pilot-panel a:focus-visible {
  outline: none;
  background: rgba(var(--theme-rgb), .08);
  color: var(--ink);
  box-shadow: inset 2px 0 var(--cyan);
}

.pilot-panel-divider {
  display: block;
  height: 1px;
  margin: .28rem .75rem;
  background: linear-gradient(90deg, transparent, rgba(var(--theme-rgb), .38), transparent);
}

.pilot-panel .pilot-logout { color: #ffad98; }
.pilot-panel .pilot-logout:hover,
.pilot-panel .pilot-logout:focus-visible { background: rgba(237, 118, 83, .08); box-shadow: inset 2px 0 #ed7653; }

.pilot-login {
  position: relative;
  display: flex;
  align-items: center;
  gap: .7rem;
  min-width: 15.8rem;
  height: 2.7rem;
  padding: .2rem .75rem .2rem .45rem;
  overflow: hidden;
  border: 0;
  color: rgba(var(--theme-rgb), .9);
  cursor: url("/assets/icons/pandora-action-04.svg") 12 5, pointer;
  text-decoration: none;
  background:
    linear-gradient(90deg, rgba(var(--theme-rgb), .46), transparent 82%) top / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(var(--theme-rgb), .3), transparent 82%) bottom / 100% 1px no-repeat,
    linear-gradient(90deg, rgba(var(--theme-rgb), .075), transparent 78%);
  box-shadow: inset 1px 0 rgba(var(--theme-rgb), .48);
}

.pilot-login > svg {
  position: relative;
  z-index: 3;
  width: 1.55rem;
  height: 1.55rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pilot-login > span { position: relative; z-index: 3; display: grid; gap: .28rem; }
.pilot-login strong { color: var(--ink); font: 600 .82rem/1 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif; letter-spacing: .15em; }
.pilot-login small { color: rgba(var(--theme-rgb), .52); font: 600 .5rem/1 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif; letter-spacing: .15em; }
.pilot-login:hover,
.pilot-login:focus-visible { outline: none; color: var(--ink); filter: drop-shadow(0 0 7px rgba(var(--theme-rgb), .42)); }

/* Keep the central header trace clear of the fullscreen control. */
.utility-controls::before { right: 19.3rem !important; }

.pilot-login-sweeps {
  position: absolute;
  z-index: 1;
  inset: 0;
  pointer-events: none;
}

.pilot-login-sweeps::before,
.pilot-login-sweeps::after {
  content: "";
  position: absolute;
  top: -35%;
  bottom: -35%;
  width: 16%;
  background: linear-gradient(90deg, transparent, rgba(237, 118, 83, .42), transparent);
  filter: drop-shadow(0 0 4px rgba(237, 118, 83, .45));
}

.pilot-login-sweeps::before {
  left: -25%;
  transform: skewX(-16deg);
  animation: pilot-login-intercept-left 2.8s ease-in-out infinite;
}

.pilot-login-sweeps::after {
  right: -25%;
  transform: skewX(16deg);
  animation: pilot-login-intercept-right 2.8s ease-in-out infinite;
}

.pilot-login-alert {
  position: absolute;
  z-index: 4;
  top: .25rem;
  right: .4rem;
  width: 4.65rem;
  color: #ff9275;
  font: 600 .56rem/1.04 "Bahnschrift SemiCondensed", "Arial Narrow", sans-serif;
  font-style: normal;
  letter-spacing: .15em;
  opacity: 1;
  text-align: right;
  white-space: normal;
  text-shadow: 0 0 5px rgba(237, 118, 83, .48);
}

@keyframes pilot-login-intercept-left {
  0%, 18% { left: -25%; opacity: 0; }
  34% { opacity: 1; }
  64% { left: 42%; opacity: .9; }
  76%, 100% { left: 42%; opacity: 0; }
}

@keyframes pilot-login-intercept-right {
  0%, 18% { right: -25%; opacity: 0; }
  34% { opacity: 1; }
  64% { right: 42%; opacity: .9; }
  76%, 100% { right: 42%; opacity: 0; }
}

@media (max-width: 760px) {
  .pilot-menu .pilot-control { min-width: 2.2rem; width: 2.2rem; }
  .pilot-panel { position: fixed; top: 7.1rem; left: .75rem; width: min(17rem, calc(100vw - 1.5rem)); }
  .pilot-login { min-width: 2.2rem; width: 2.2rem; height: 2.2rem; padding: .2rem; border: 0; background: transparent; box-shadow: none; }
  .pilot-login > svg { width: 1.35rem; height: 1.35rem; }
  .pilot-login > span { display: none; }
  .pilot-login-alert { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pilot-chevron { transition: none; }
  .pilot-login-sweeps,
  .pilot-login-sweeps::before,
  .pilot-login-sweeps::after { animation: none; display: none; }
}
