#pilot-guide-open:not([hidden]) {
    display: flex;
    width: max-content;
    align-items: center;
    gap: 7px;
    min-height: 44px;
    margin-block-end: 7px;
    margin-left: 0;
    margin-right: auto;
    padding: 0 12px 0 3px;
    border: 1px solid #6bbab39e;
    border-radius: 4px;
    background: #0b2530ed;
    color: #dafff9;
    font: 680 .9rem/1.15 var(--sans);
}
#pilot-guide-open img {
    width: 37px;
    height: 40px;
    object-fit: cover;
    object-position: top;
}
#pilot-guide-open:hover { border-color: #9bf1e5; }
.hangar-concourse.compact #pilot-guide-open { margin-block-end: 5px; }

#pilot-guide-flight:not([hidden]) {
    position: absolute;
    z-index: 3;
    left: clamp(14px, 5.3vw, 76px);
    bottom: clamp(102px, 21.4%, 161px);
    width: clamp(96px, 12.2vw, 176px);
    height: clamp(120px, 23.3dvh, 209px);
    padding: 0;
    border: 0;
    background: transparent;
    isolation: isolate;
    color: #d7fffa;
}
.window:has(#flight-guide:not([hidden])) #pilot-guide-flight { bottom: max(194px, 28%); }
.pilot-guide-projection {
    position: absolute;
    left: 2%;
    bottom: 18%;
    width: 86%;
    opacity: .84;
    filter: drop-shadow(0 0 11px #59e6d668);
    mask-image: linear-gradient(to bottom,#000 0 74%,#000d 86%,transparent 100%);
    pointer-events: none;
}
.pilot-guide-projection img { display: block; width: 100%; height: auto; }
.pilot-guide-rays {
    position: absolute;
    left: 4%;
    bottom: 8%;
    width: 81%;
    height: 56%;
    opacity: .86;
    background: conic-gradient(from -36deg at 50% 100%,transparent 0deg,#61ead348 7deg,transparent 9deg,#6effe760 15deg,
        #5fe6cd17 19deg,#64f4df88 27deg,#a0fff762 31deg,#60ecdb27 34deg,#83ffedb6 36deg,#59eed560 38deg,
        #55dbc42d 45deg,#56f5dd77 53deg,transparent 59deg,#66dbd650 65deg,transparent 72deg);
    mask-image: linear-gradient(to top,#000,#000c 25%,transparent 100%);
    filter: drop-shadow(0 0 5px #2bd8b9);
}
.pilot-guide-projector {
    position: absolute;
    bottom: 3%;
    left: 24.5%;
    width: 44%;
    height: 11%;
    border-radius: 50%;
    border: 1px solid #88806c;
    background: radial-gradient(ellipse at 50% 44%,#e0fff9 0 11%,#53d7cc 12% 23%,#1b6665 25% 36%,
        #141f25 39% 54%,#6c6554 57% 60%,#151b20 64%);
    box-shadow: 0 4px 0 #171819,0 6px 0 #080b0d,0 9px 16px #000b,0 0 19px #37d6c454;
}
#pilot-guide-flight strong {
    position: absolute;
    left: 80%;
    top: 30%;
    padding: 4px 10px;
    border: 1px solid #5abdac9c;
    border-radius: 4px;
    background: #0d292ce8;
    white-space: nowrap;
    font: 650 .88rem/1.25 var(--sans);
}
#pilot-guide-flight:is(:hover,:focus-visible) strong { border-color: #a8f7ea; }
#pilot-guide-dialog[data-answering] .window-heading { border-block-end-color: #88d8cb; }
#pilot-guide-flight[data-answering] .pilot-guide-projector {
    box-shadow: 0 4px 0 #171819,0 6px 0 #080b0d,0 9px 16px #000b,0 0 23px #63f2df8c;
}

@media (prefers-reduced-motion: no-preference) {
    .pilot-guide-projection {
        transform-origin: 52% 88%;
        animation: luma-appear .45s ease-out, luma-breathe 5.8s ease-in-out infinite;
    }
    .pilot-guide-projection::after {
        content: "";
        position: absolute;
        inset: 0;
        background: url("/galaxy9-art/luma-guide.webp") center / 100% 100% no-repeat;
        filter: brightness(1.7) saturate(.7);
        opacity: 0;
        animation: luma-tracking 6.7s linear infinite;
    }
    .pilot-guide-rays {
        transform-origin: 50% 100%;
        animation: luma-rays 4.7s ease-in-out infinite;
    }
    #pilot-guide-flight[data-answering] .pilot-guide-rays {
        animation: luma-signal 1.9s ease-in-out infinite;
    }
    #pilot-guide-dialog[open] .window-heading img {
        transform-origin: 50% 92%;
        animation: luma-portrait 5.5s ease-in-out infinite;
    }
    #pilot-guide-dialog[open][data-answering] .window-heading img {
        animation: luma-portrait 5.5s ease-in-out infinite, luma-portrait-signal 1.9s ease-in-out infinite;
    }
    #pilot-guide-open[data-answering] img {
        animation: luma-portrait-signal 1.9s ease-in-out infinite;
    }
}

@keyframes luma-appear {
    from { opacity: .18; }
    to { opacity: .84; }
}
@keyframes luma-breathe {
    0%, 100% { transform: none; }
    48% { transform: translateY(-1px) scale(1.003,1.009); }
}
/* A scan line drifts down the image. Later, a few rows briefly lose horizontal sync. */
@keyframes luma-tracking {
    0%, 28% { opacity: 0; clip-path: inset(16% 0 82%); transform: translateX(0); }
    31% { opacity: .48; clip-path: inset(21% 0 77%); }
    45% { opacity: .44; clip-path: inset(68% 0 30%); transform: translateX(.8px); }
    48%, 74% { opacity: 0; clip-path: inset(75% 0 23%); }
    75% { opacity: .62; clip-path: inset(43% 0 53%); transform: translateX(2px); }
    78% { opacity: .28; clip-path: inset(47% 0 51%); transform: translateX(-1px); }
    80%, 100% { opacity: 0; clip-path: inset(48% 0 50%); transform: translateX(0); }
}
@keyframes luma-rays {
    0%, 100% { opacity: .86; transform: scaleX(1); }
    45% { opacity: .61; transform: scaleX(.9); }
    75% { opacity: .77; transform: scaleX(1.04); }
}
@keyframes luma-signal {
    0%, 100% { opacity: .7; transform: scaleX(.94); }
    50% { opacity: 1; transform: scaleX(1.09); }
}
@keyframes luma-portrait {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-1px) rotate(-2deg); }
}
@keyframes luma-portrait-signal {
    0%, 100% { opacity: .72; }
    50% { opacity: 1; }
}

@media (max-width: 790px), (max-height: 540px) {
    #pilot-guide-open:not([hidden]) { min-height: 44px; margin-block-end: 5px; }
    #pilot-guide-flight:not([hidden]) {
        left: max(12px, env(safe-area-inset-left));
        bottom: clamp(62px, 14%, 94px);
        width: 70px;
        height: 96px;
    }
    #pilot-guide-flight strong { left: 70%; padding: 3px 6px; font-size: .75rem; }
    .window:has(#flight-guide:not([hidden])) #pilot-guide-flight { bottom: max(134px, 31%); }
}
#pilot-guide-dialog {
    position: fixed;
    width: min(25rem, calc(100vw - 16px));
    margin: 0;
    max-height: 80dvh;
    padding: 0;
    color: var(--ink);
    background: #12242c;
    border: 1px solid #6bbab39e;
    border-radius: 5px;
    overflow: hidden;
}
#pilot-guide-dialog[open] { display: flex; flex-direction: column; }
#pilot-guide-dialog::backdrop { background: #030d162b; }
#pilot-guide-dialog .window-heading { justify-content: start; }
#pilot-guide-dialog .window-heading img { width: 36px; height: 44px; object-fit: cover; object-position: top; }
#pilot-guide-dialog .window-heading button { margin-inline-start: auto; }
#pilot-guide-dialog [role=log] {
    display: grid;
    min-height: 0;
    gap: 8px;
    padding: 12px;
    overflow: auto;
    overscroll-behavior: contain;
}
#pilot-guide-dialog [role=log] p {
    width: fit-content;
    max-width: 94%;
    margin: 0;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    padding: 8px 10px;
    border: 1px solid #527d8090;
    background: #0c1c25;
}
#pilot-guide-dialog .pilot-guide-question { justify-self: end; border-color: #7de5d299; }
#pilot-guide-dialog [role=status]:not(:empty) { padding: 0 12px 8px; color: var(--muted); }
#pilot-guide-dialog form { display: flex; gap: 8px; padding: 10px 12px; border-top: 1px solid #456069; }
#pilot-guide-dialog input {
    flex: 1;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #557078;
    border-radius: 4px;
    background: #0b171e;
    color: var(--ink);
    font-size: max(16px, 1em);
}
#pilot-guide-dialog form button { min-height: 44px; max-width: 42%; overflow-wrap: anywhere; }
#pilot-guide-keys { margin-block-start: 5px; color: #bbfff2; }
