/* Metal controls surround the canopy. Readouts use a cooler phosphor than the switches. */
:root {
    --optic: #a4f2ea;
    --optic-line: #609599;
    --alloy: #9aabb2;
    --deck-metal: linear-gradient(#30414a 0, #202f39 10%, #111c26 64%, #0a141c 100%);
    --switch-metal: linear-gradient(170deg,#31434a,#1b2932 38%,#111e28);
}
.topbar {
    background: linear-gradient(180deg,#34414a 0,#17232d 9%,#0e1821 83%,#24323a 97%);
    border-bottom-color: #506169;
    box-shadow: 0 2px 0 #091217, 0 4px 12px #02080c70;
}
.topbar .brand {
    position: relative; padding-inline-end: clamp(9px,1.5vw,22px);
    color: #f2ede1;
}
.brandmark { filter: drop-shadow(0 1px 2px #000); }
.navigation { align-items:center; gap: 3px; }
.navigation button {
    align-self:stretch; color:#a7b8c0;
    border-inline:1px solid transparent; font-family:var(--mono); font-size:.77rem;
}
.navigation button[aria-current=page] {
    color:#ffcc94; border-inline-color:#b5865550;
    background:linear-gradient(0deg,#a565283e, #79532b0c 80%);
}
.navigation button[aria-current=page]::after {
    left:18%; right:18%; bottom:2px; height:2px; background:#ffd39b;
    box-shadow:0 0 8px #ffb35f85;
}
.net i.live { box-shadow:0 0 5px #8eead269; }
.account .balance { color:#f1d1a3; }
.locale-picker { background:#101e27; border-color:#3e535e; }

/* A heading strip and target plate sit on the canopy glass, away from the sight. */
.heading-tape {
    position:absolute; z-index:1; pointer-events:none; top:clamp(12px,2vw,24px); left:50%;
    width:152px; transform:translateX(-50%); text-align:center;
    color:#d6f4ee; text-shadow:0 1px 3px #000;
}
.heading-tape output { font:600 .7rem var(--mono); letter-spacing:.13em; }
.heading-scale {
    position:relative; height:10px; margin-top:3px;
    background:
        repeating-linear-gradient(90deg,#bbe5df 0 1px, transparent 1px 20px) calc(50% + var(--tick-shift,0px)) 100% / 20px 7px repeat-x,
        repeating-linear-gradient(90deg,#91b9b9 0 1px, transparent 1px 4px) calc(50% + var(--tick-shift,0px)) 100% / 4px 3px repeat-x;
    mask-image:linear-gradient(90deg,transparent,#000 22% 78%,transparent);
}
.heading-tape::after {
    content:""; display:block; width:0; margin:2px auto 0;
    border:3px solid transparent; border-top:0; border-bottom:4px solid #f3c387;
}
.is-in-station .heading-tape,.is-docking .heading-tape,.is-jumping .heading-tape {display:none}
.scene-heading, .station-heading, .scene-bottom > div, .velocity {
    background:linear-gradient(100deg,#0a1b25e6,#0d252f9c 78%,#162b322e);
    border:0; border-inline-start:2px solid var(--optic-line);
    box-shadow:inset 0 1px #b4d9d21d;
}
.scene-heading, .station-heading { padding:7px 14px 7px 9px; }
.scene-heading svg {stroke:var(--optic)}
.scene-heading h1, .station-heading h1 {color:#e5f4ed}
.scene-bottom > div { padding:6px 14px 6px 9px; }
.scene-bottom .eyebrow {color:var(--optic);font-size:.6rem}
.scene-bottom .velocity {
    align-self:flex-end; padding:5px 9px 5px 14px; min-width:4ch;
    color:#e7f8ef; text-align:end; border-inline:0 solid var(--optic-line); border-inline-end-width:2px;
    background:linear-gradient(270deg,#0a1b25e8,#0d252fa3 70%,transparent);
    font-family:var(--mono); font-variant-numeric:tabular-nums;
}
.window-tools .icon-button { background:#0b1e29ce; border:1px solid #69898e9c; color:#bdd7d6; border-radius:2px; }
.velocity-controls { display:grid; flex:none; justify-items:end; gap:3px; }
.spin-rate { padding:2px 6px; color:#d9e8e5; background:#0a1b25e8; font:.68rem var(--sans); }
.spin-rate b { font-family:var(--mono); font-variant-numeric:tabular-nums; }
.flight-stop-actions { display:flex; gap:4px; }
.flight-stop-actions button {
    pointer-events:auto; touch-action:manipulation; min-height:32px; padding:4px 10px;
    border:1px solid var(--optic-line); border-radius:3px; background:#10232be8;
    color:#d9e8e5; font:600 .75rem var(--sans);
}
.flight-stop-actions kbd {
    margin-inline-start:4px; padding:1px 4px; border:1px solid currentColor;
    border-radius:2px; font:600 .7rem var(--mono); white-space:nowrap;
}
.flight-stop-actions :is([aria-pressed=true],[aria-busy=true]) { color:#082122; background:var(--optic); }
@media(max-width:600px) { .flight-stop-actions { flex-direction:column; align-items:stretch; } }
@media(pointer:coarse) { .flight-stop-actions button { min-height:42px; } }

/* A laminated edge and a translucent optical display keep the scene visible behind the drawer. */
.sidebar {
    --cut: 15px;
    isolation:isolate; padding:1px; border:0;
    -webkit-backdrop-filter:blur(3px); backdrop-filter:blur(3px);
    clip-path:polygon(var(--cut) 0,100% 0,100% calc(100% - var(--cut)),calc(100% - var(--cut)) 100%,0 100%,0 var(--cut));
    background:none;
    color:#e1f2f1;
    --dim:#a7c1c6; --muted:#bed0d2; --line:#54717a;
}
.sidebar::before, .sidebar::after {
    content:""; position:absolute; pointer-events:none; z-index:-1;
    clip-path:inherit;
}
.sidebar::before {
    inset:0;
    background:
        linear-gradient(135deg,transparent 9px,#a0c1c0 10px,#263e48 11px,transparent 12px) top left / 25px 25px no-repeat,
        linear-gradient(315deg,transparent 9px,#a0c1c0 10px,#263e48 11px,transparent 12px) bottom right / 25px 25px no-repeat,
        linear-gradient(112deg,#123039eb,#091d28ce 52%,#081720c4);
    border:1px solid #749295;
    box-shadow:inset 4px 0 #0a1c25, inset 5px 0 #77acaf5c, inset -3px -3px #12232b88;
}
.sidebar::after {
    inset:5px 8px;
    background:
        linear-gradient(var(--optic),var(--optic)) top left / 42px 2px no-repeat,
        repeating-linear-gradient(120deg,#bcd7c866 0 2px, transparent 2px 5px) bottom right / 30px 3px no-repeat;
}
.sidebar > .side-block.is-open {padding:13px 16px 14px 18px; background:none}
.sidebar .rail-heading {
    display:grid; grid-template-columns:31px minmax(0,1fr) auto; align-items:center; gap:0 9px;
    margin:0 0 10px; padding:0 42px 9px 0; min-height:43px;
    color:var(--optic); border-bottom:1px solid #759f9f73;
}
.sidebar .rail-heading > svg {
    width:31px; height:31px; padding:6px; color:var(--optic);
    border:1px solid #608c91; background:#183c42;
}
.sidebar .rail-heading h2 { font:600 .87rem/1.2 var(--sans); letter-spacing:.025em; }
.sidebar .rail-count {font:500 .8rem var(--mono);color:#d4ece8}
.sidebar .drawer-close {
    top:12px; right:12px; border-radius:1px; border-color:#536e79;
    background:var(--switch-metal); color:#c8dddb; box-shadow:inset 0 1px #b5cacf25;
}
.contact-scope {
    grid-column:1/-1; position:relative; margin:9px -42px 0 0; height:clamp(64px,11dvh,99px);
    border-block:1px solid #61868862; overflow:hidden;
    background:radial-gradient(ellipse at 50% 58%,#367a7040,transparent 74%),#05131c5c;
}
.contact-scope canvas { width:100%; height:100%; display:block }
.contact-scope span {
    position:absolute; bottom:5px; right:6px; color:#bbd8d7; font:500 .63rem var(--mono);
    text-transform:none; letter-spacing:0;
}
.sidebar .contact {padding:6px; border-radius:0; border-bottom:1px solid #789b9c31;}
.sidebar .contact:hover,.sidebar .contact:focus-visible {background:#3c62609c}
.sidebar .contact.sel {
    background:linear-gradient(90deg,#36736dd4,#29494957);
    border-left-color:#9ff1dc;
}
.sidebar .contact.sel.hostile { border-left-color:var(--red); }
.contact-icon { border:1px solid #7298946b; background:#0a202cd9; padding:2px 0; }
.sidebar .contact .range {color:#cfddd9}
.sidebar .log-line {position:relative; border-left:1px solid #668b92; padding:3px 0 7px 12px; margin:0; color:#d0e1e1}
.sidebar .log-line::before {content:"";position:absolute;left:-3px;top:8px;width:5px;height:5px;background:#8ac7be}
.sidebar .log-line time {color:var(--optic)}
.sidebar .station-berth dl div {border-color:#6684897a}
.sidebar .station-berth dd {color:#c6f0df}
.sidebar .secondary,.sidebar .terminal-pager button {background:#13313bc7;border-color:#62828b;color:#deeeeb;border-radius:2px}
@media(prefers-reduced-motion:no-preference) {
    .sidebar:not([hidden]) {animation:raise-display .18s ease-out both}
    @keyframes raise-display {from{opacity:0;transform:translateX(12px)}to{opacity:1;transform:translateX(0)}}
}
@media(prefers-reduced-transparency:reduce) {
    .sidebar {backdrop-filter:none;-webkit-backdrop-filter:none}
    .sidebar::before {background:#10232d}
}

/* Backlit switches sit above three recessed instrument bays. */
.flight-actions {
    position:relative; color:#d4dfdc; border-block:1px solid #52636a;
    background:var(--deck-metal); box-shadow:inset 0 1px #b9c7cc25, inset 0 -2px #071218;
}
.instrument-heading {color:#b0c5c8}
.deck-key, #flight-main, .station-services button {
    background:var(--switch-metal); border:1px solid #4c626a; border-radius:3px;
    box-shadow:inset 0 1px #b6ced123, inset 0 -2px #030a0e83;
}
.deck-key { color:#c6d3d4 }
.deck-key svg { color:#9fb5bb }
.deck-key[aria-expanded=true],.station-services button:hover {
    background:linear-gradient(160deg,#345653,#19383c 66%); color:#c3fff0; border-color:#77a49b;
    box-shadow:inset 0 -2px #78c7b7;
}
.deck-key[aria-expanded=true] svg { color:var(--optic) }
#flight-main {background:linear-gradient(#ffdb9e,#f3b575 64%,#dd955a);color:#271c15;border-color:#f5ce9d}
.console {
    position:relative; gap:clamp(3px,.6vw,10px);
    padding:6px max(8px,calc((100vw - 1460px) / 2)) max(7px,env(safe-area-inset-bottom));
    background:linear-gradient(#070e14 0,#34434a 3px,#202d34 6px,#15212a 80%,#2b383c);
}
.console .instrument {
    border:1px solid #44585e; border-top-color:#0b1218; border-radius:5px;
    background:
        radial-gradient(ellipse at 10% 0,#253f466e,transparent 64%),
        linear-gradient(#09191f,#102229);
    box-shadow:inset 0 2px 5px #02090caa, 0 1px #7381865c;
}
.instrument-heading {padding-bottom:3px;border-bottom:1px solid #50747a47;font-family:var(--mono)}
.level-value {color:#c6e4db}
.track {height:5px;border-radius:0;background:#243c44;}
.track i {background:repeating-linear-gradient(90deg,#91dac8 0 8px,#263e41 8px 10px)}
.track i.amber {background:repeating-linear-gradient(90deg,#e4b982 0 8px,#403b33 8px 10px)}
.steer-pad button,.throttle .fire {background:var(--switch-metal);border:1px solid #48616a;color:#ccdcd9;border-radius:2px}
.station-services {border-radius:3px;border-color:#8a9c9e91;background:linear-gradient(125deg,#1b3037e6,#0a1822dc);box-shadow:inset 0 1px #d3dfd036,0 4px 16px #02070877}
.station-services button svg {color:#d3b78a}
@media (max-width:690px) {
    .heading-tape {display:none}
    .navigation button {font-size:clamp(.6rem,2.6vw,.74rem)}
    .console {padding:4px;gap:3px}
    .console .instrument {border-radius:3px}
    .instrument-heading {padding-bottom:1px}
    .sidebar > .side-block.is-open {padding:10px 13px}
    .sidebar .drawer-close {top:8px;right:9px}
    .contact-scope {height:59px}
    .station-services button {padding-inline:6px}
}
@media(max-height:560px) {
    .contact-scope {display:none}
    .heading-tape {top:7px}
    .console {padding-block:3px}
}
@media(max-width:380px) {
    .topbar .brand {padding-inline-end:0}
    .action-buttons .deck-key {letter-spacing:-.02em}
}

/* The plot and its signed target readings share one instrument face. */
.radar-field, .contact-scope {
    display:grid; grid-template-columns:minmax(0,1fr) auto; align-items:center; gap:6px;
}
#radar {height:clamp(78px,12dvh,112px);cursor:crosshair;touch-action:manipulation}
.contact-scope {height:clamp(84px,14dvh,135px);grid-template-rows:minmax(0,1fr);padding:0 7px}
.contact-scope #scope-range {top:4px;left:6px;bottom:auto;right:auto;font-size:.62rem}
.contact-scope .echo-readout {margin:0;align-self:center;gap:4px}
.contact-scope #scope-radar {min-height:0}
#scope-radar {min-width:0;cursor:crosshair;touch-action:manipulation}
.echo-readout {display:grid;gap:8px;margin:0;min-width:55px;text-align:end;line-height:1.1}
.echo-readout dt {color:#a9c1c4;text-transform:uppercase;letter-spacing:.06em;font:500 .59rem var(--mono)}
.echo-readout dd {margin:3px 0 0;color:#d7f3e9;font:550 .78rem var(--mono);font-variant-numeric:tabular-nums;white-space:nowrap}
#target-tools:not(:empty) {border-top:1px solid #60848770; margin-top:5px}
.sidebar:has(#station-berth.is-open) {max-height:320px}
.sidebar:has(#ship-log.is-open) {max-height:410px}
@media(min-width:691px) and (min-height:561px) {
    .sidebar {margin-block:64px 61px;max-height:560px}
}
@media(max-width:690px) {
    .radar-field {display:block}
    #radar {height:67px}
    .radar-field .echo-readout {display:flex; justify-content:space-between;gap:2px; text-align:start}
    .radar-field .echo-readout dt {font-size:.53rem}
    .radar-field .echo-readout dd {margin-top:0;font-size:.65rem}
    .sidebar .contact-scope {height:90px}
}
@media(max-height:560px) {
    .sidebar .contact-scope {display:grid;height:62px;margin-top:3px;padding-bottom:0}
    #radar {height:64px}
    .sidebar .rail-heading {padding-bottom:4px;margin-bottom:4px}
    .contact-scope .echo-readout {gap:3px;margin-right:3px}
    .contact-scope #scope-range {left:4px;right:auto}
}

@media(max-width:690px) and (max-height:690px) {
    .flight > .sidebar {grid-row:1 / -1; margin-block:7px; max-height:none}
    .sidebar::before {background-color:#071621a6}
}
@media(max-height:560px) {
    .contact-scope .echo-readout dt {font-size:.54rem}
    .contact-scope .echo-readout dd {margin:0;font-size:.67rem}
}

.radar-line .echo-dial { display: none; }
@media (min-width: 800px) and (min-height: 421px) {
    .in-space:not([data-handheld]) .console:not([hidden]) .echo-dial {
        display: block;
        width: var(--dial-size);
        max-width: 100%;
        height: auto;
        margin: 0 auto clamp(4px, .45vw, 7px);
        padding: 1px;
        border: 1px solid #302f28;
        border-radius: 50%;
        background: conic-gradient(from 125deg, #554d40, #292c2a 18%, #716854 41%, #cab695 55%, #8b816d 66%, #3d413e 82%, #554d40);
        box-shadow: 0 -1px 2px 2px #131716, 0 1px 1px 2px #9e8c6d, inset 0 1px 0 #d6c29e99;
        pointer-events: none;
        fill: none;
        stroke-linejoin: round;
        stroke-linecap: round;
    }
    .echo-dial-scale { stroke: #55797d; stroke-width: 1; }
    .echo-dial-ship { fill: #638e8f2e; stroke: #abd2d0; stroke-width: 1.3; }
    .echo-dial-marker { fill: #ffbe68; stroke: #ffc988; stroke-width: .65; }
    .echo-dial-marker:not([transform]) { visibility: hidden; }
}
