/* The desktop instrument panel uses the reference chassis at its original aspect ratio.
   The openings expose live controls. Only the narrow metal surround sits above them. */
body { padding: 0; background: #0c0c0c; }
.console-cradle, .console { width: 100%; max-width: none; margin: 0; }
.console-cradle { filter: none; }
.console { padding: 0; clip-path: none; background: #111111; box-shadow: none; }
.console > footer, .flightdeck .head { margin: 0; }
.console > footer {
  display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center;
  direction: ltr; column-gap: 8px;
}
footer .rights { grid-column: 2; justify-self: center; text-align: center; }
footer .copyright { grid-column: 3; justify-self: end; white-space: nowrap; }
@media (max-width: 760px) {
  .console > footer { grid-template-columns: 1fr auto 1fr; row-gap: 7px; }
  footer nav { grid-column: 1 / -1; }
  footer .rights, footer .copyright { grid-row: 2; }
}
@media (max-width: 480px) {
  .console > footer { column-gap: 0; }
  footer .rights,footer .copyright { font-size: clamp(10px,2.65vw,12px); }
}
.flightdeck, .aft-housing { position: relative; isolation: isolate; }
.flightdeck { z-index: 3; }
.upper-casing, .aft-casing { display: none; pointer-events: none; }
.wordmark img { filter: drop-shadow(0 1px 1px #090909) drop-shadow(0 0 3px #e6e6e640); }

/* The input itself fills the aperture. The submit key shares its right end. */
.search-case { padding: 0; }
.search-case form {
  --glass-left: clamp(36px, 4vw, 70px);
  --route-key: clamp(158px, 18vw, 292px);
  position: relative;
  display: grid;
  grid-template-columns: var(--glass-left) minmax(0, 1fr) var(--route-key);
  align-items: stretch;
  width: 100%;
  min-height: 40px;
  margin: 0;
  padding: 0;
  gap: 0;
  border: 0;
  background: linear-gradient(180deg, #171717, #1a1a1a 66%, #232323);
  box-shadow: inset 0 0 0 1px #818181, inset 0 0 14px #0a0a0a;
}
#query {
  grid-area: 1 / 1 / 2 / -1;
  width: 100%;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  padding: 0 calc(var(--route-key) + 12px) 0 var(--glass-left);
  font-size: clamp(16px, 1.46vw, 28px);
  color: #f6f6f6;
}
#query::placeholder { color: #f1f1f1; opacity: 1; }
#query:focus-visible { outline-offset: -3px; }
.search-case .lens { grid-area: 1 / 1; place-self: center; margin: -3px 3px 0 0; pointer-events: none; z-index: 1; }
#plot {
  grid-area: 1 / 3;
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .55em;
  height: 100%;
  min-width: 0;
  padding: 1px 9px;
  border: 0;
  border-inline-start: 1px solid #5a5a5a;
  border-radius: 5px;
  background: linear-gradient(118deg, #3f3f3f, #1f1f1f 44%, #272727 90%);
  box-shadow: inset 0 1px 0 #b4b4b455, inset 0 -1px 1px #a7a7a775;
  font-size: clamp(13px, 1.13vw, 20px);
  line-height: 1.15;
}
#plot svg { width: 1.55em; height: 1.55em; flex: none; color: #f0f0f0; }
#plot:hover { color: #ececec; box-shadow: inset 0 0 12px #c0c0c056; }
.channel { background-image: url("skin/channel-key.webp?v=bw1"); }
.channel[aria-pressed="true"] { background-image: url("skin/channel-on.webp?v=bw1"); filter: none; color: #fcfcfc; }
.channel[aria-pressed="true"]::before { content: none; }
.service-key::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: url("skin/service-halo.svg?v=bw1") center / 100% 100% no-repeat;
  opacity: 0; transition: opacity 120ms ease-out;
}
@media (hover: hover) {
  .service-key:hover:not(:active)::after { opacity: 1; filter: brightness(1.3) drop-shadow(0 0 3px #dadada); }
  .channel:hover:not(:active) { filter: brightness(1.24) drop-shadow(0 0 4px #dcdcdc); }
}
.service-key:focus-visible:not(:active)::after { opacity: 1; filter: brightness(1.3) drop-shadow(0 0 3px #dadada); }

.billboard {
  --banner-native: 2816;
  --rail-x: clamp(13px, 2.474vw, 48px);
  --rail-y: clamp(7px, .912vw, 17px);
  position: relative;
  box-sizing: border-box;
  padding: var(--rail-y) var(--rail-x);
  background: #131313;
}
.billboard::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-style: solid;
  border-color: transparent;
  border-width: var(--rail-y) var(--rail-x);
  border-image: url("skin/advert-rim.webp?v=bw1") 28 58 / calc(var(--rail-y) * 2) calc(var(--rail-x) * 1.5263) stretch;
}
.billboard a, .billboard picture, .billboard img { display: block; width: 100%; }
.billboard a { overflow: hidden; }
.billboard a:focus-visible { outline-offset: -4px; }
.billboard picture { container-type: inline-size; }
.billboard img {
  --edge: max(1px, calc(300cqi / var(--banner-native)));
  --cut: max(8px, calc(3500cqi / var(--banner-native)));
  height: auto; object-fit: contain;
  clip-path: polygon(var(--cut) var(--edge),calc(100% - var(--cut)) var(--edge),
    calc(100% - var(--edge)) var(--cut),calc(100% - var(--edge)) calc(100% - var(--cut)),
    calc(100% - var(--cut)) calc(100% - var(--edge)),var(--cut) calc(100% - var(--edge)),
    var(--edge) calc(100% - var(--cut)),var(--edge) var(--cut));
}
@media (max-width: 1100px) { .billboard { --banner-native: 1736; } }
@media (max-width: 520px) { .billboard { --banner-native: 716; } }
.billboard a:hover img { filter: brightness(1.08); }

.library {
  --rim: url("skin/bank-rim.webp?v=bw1");
  --aperture: url("skin/bank-opening.png?v=bw1");
  --cuts: 34 54 31 58;
  --corners: clamp(16px, 2.2vw, 40px) clamp(17px, 3.52vw, 64px) clamp(15px, 2.02vw, 36px) clamp(18px, 3.78vw, 70px);
  --bt: clamp(8px, .92vw, 18px);
  --be: clamp(12px, 2.3vw, 43px);
  --bb: clamp(8px, .94vw, 19px);
  --bs: clamp(13px, 2.56vw, 48px);
  --plane: linear-gradient(155deg,#282828, #1b1b1b 42%, #1a1a1a 86%,#292929);
}
.library .deck-head h2 { color: #f3f3f3; }
.deck-head { flex-wrap: nowrap; }
.library .deck-controls { display: flex; gap: clamp(5px, .8vw, 14px); margin-inline-start: auto; }
.deck-controls .filters { gap: 3px; }
.deck-controls .site-link {
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  white-space: nowrap; padding: 5px 9px; color: #eeeeee;
  border: 1px solid #737373; border-radius: 7px; font-size: 14px; font-weight: 600;
  background: linear-gradient(145deg,#303030,#1a1a1a);
}
.deck-controls .site-link:hover { border-color: #e9e9e9; color: white; }
.site-link b { font: inherit; font-size: 1.15em; line-height: .8; }
.library .deck-grid {
  width: 100%; min-width: 0; align-content: start; padding: 4px 3px 7px;
  grid-template-columns: repeat(var(--bank-cols), minmax(0, 1fr));
}
.record-sleeves { display: grid; gap: clamp(10px,1.2vw,21px); padding: 4px 3px 7px; }
.sleeve-row { display: grid; gap: clamp(10px,1.2vw,21px); grid-template-columns: repeat(var(--cols), minmax(0,1fr)); }
#books .tile { container-type: inline-size; }
#books .artwork {
  height: calc(100cqw / 1.22 + clamp(48px, 5vw, 60px));
  aspect-ratio: auto;
  flex: none;
}
#books .artwork img { padding: 2px; object-fit: contain; }
#books .legend { flex: none; justify-content: start; padding-block: 6px 8px; gap: 3px; }
#books .legend strong { -webkit-line-clamp: 2; }
.file-layout:has(.file-cover.books) { grid-template-columns: minmax(0,1fr) minmax(0,1fr); }
.file-cover.books img { padding: 0; }
@media (max-width: 570px) {
  .record-sleeves,.sleeve-row { gap: 9px; }
  .file-layout:has(.file-cover.books) { grid-template-columns: minmax(110px,.84fr) minmax(0,1fr); }
  .file-cover.books { height: clamp(162px, 44vw, 205px); }
}
.map-directory { max-height: clamp(170px, 19.5vw, 440px); min-height: 0; display: flex; flex-direction: column; gap: 9px; color: var(--ink); }
.map-directory h3 { font-size: clamp(18px,1.8vw,32px); line-height: 1.1; }
.map-directory ul { list-style:none; margin:0; padding:0; overflow:auto; scrollbar-width:thin; }
.map-directory button {
  display: flex; width: 100%; justify-content: space-between; align-items: center; gap: 12px;
  padding: 7px 4px; border-bottom: 1px solid #6d6d6d6e; color: #e9e9e9; text-align: start;
}
.map-directory button:hover { color: var(--focus); }
.map-directory button small { color: #b4b4b4; }
.map-node.leaf { display: grid; align-content: center; }
.map-wire .wire-hit { pointer-events: stroke; fill: none; stroke: transparent; stroke-width: 15; vector-effect: non-scaling-stroke; cursor: pointer; }
.map-wire .traveller { pointer-events: none; }
.map-wire .cable { pointer-events: stroke; cursor: pointer; }
.map-wire:hover .cable { stroke: #eeeeee; opacity: 1; filter: drop-shadow(0 0 4px #c7c7c7); }
.map-node.on { border-color: #ececec; box-shadow: inset 0 0 9px #e0e0e052, 0 0 8px #d0d0d09c; }
.map-node.leaf.terminal {
  display: flex; align-items: stretch; justify-content: space-between; padding: 0;
  max-height: 30%; text-align: start;
}
.file-select, .map-open {
  color: inherit; background: transparent; box-shadow: none; font: inherit; border: 0;
  min-width: 0; cursor: pointer;
}
.file-select { flex: 1; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; padding: 4px 6px; text-align: start; overflow-wrap: anywhere; }
.map-open { flex: 0 0 clamp(23px, 1.85vw, 32px); display: grid; place-items: center; border-inline-start: 1px solid #97979765; color: #e9e9e9; font-size: 1.05em; }
.file-select:hover,.map-open:hover { background: #5b5b5b67; }
.file-select:focus-visible,.map-open:focus-visible { outline-offset: -2px; }
.dense .file-select { display: block; white-space: nowrap; text-overflow: ellipsis; padding-block: 3px; }
.diagram.dense .terminal { max-height: 17%; }
.map-foot #map-list { padding: 3px 8px; font: inherit; color: #f4f4f4; background: #222222; border: 1px solid #777777; border-radius: 5px; }
.map-foot #map-list:hover { border-color: var(--focus); }
#map-counter { white-space: nowrap; font-variant-numeric: tabular-nums; }
.route-list button { text-align: start; }
.map-player { width: 100%; min-width: 0; }
.map-player .video-embed { display: block; width: 100%; height: auto; aspect-ratio: 16/9; }
.player-actions { display: flex; justify-content: space-between; gap: 8px; margin-top: 6px; }
.player-actions > * { color: #f1f1f1; font: inherit; font-size: clamp(12px,1vw,16px); padding: 3px; }
.trail nav a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.trail nav a:hover { color: var(--focus); text-decoration: underline; }
.trail nav a::before { content: "›"; margin-inline-end: .45em; color:#b2b2b2; }
.trail nav a:last-child { color: var(--focus); }
.aft-housing { background: #171717; }

@media (min-width: 981px) {
  .flightdeck { aspect-ratio: 1536 / 614; container-type: inline-size; background: #171717; }
  .upper-casing, .aft-casing {
    display: block;
    position: absolute;
    inset: 0;
    z-index: 3;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 100% 100%;
  }
  .upper-casing { background-image: url("skin/tower.webp?v=bw1"); }
  .flightdeck .trim, .flightdeck .rack, .flightdeck .inspect, .aft-housing .trail { border: 0; border-image: none; margin: 0; }
  .flightdeck .trim::before, .flightdeck .rack::before, .flightdeck .inspect::before, .aft-housing .trail::before { content: none; }
  .flightdeck .head {
    position: absolute; left: 1.75%; right: 1.55%; top: .9772%; height: 8.697%;
    min-height: 0; padding: 0 .8% 0 2.95%; gap: 1.55cqw;
    background: linear-gradient(105deg,#141414,#282828 48%,#171717);
  }
  .wordmark img { width: 16.6cqw; }
  .head h1 { font-size: 2.04cqw; }
  .head-keys { height: 75%; }
  .head-keys > *, .head .enter { height: 100%; min-height: 0; padding-block: 0; }
  .head .enter { min-width: 9.5cqw; }
  .flightdeck .quick {
    position: absolute; left: 1.55%; right: 1.37%; top: 12.215%; height: 10.847%;
    min-height: 0; grid-template-columns: repeat(8,minmax(0,1fr)) minmax(0,1.12fr);
    gap: 0; padding: 0; background: #171717;
  }
  .quick .service-key { min-height: 0; min-width: 0; height: 100%; font-size: clamp(14px,1.24cqw,25px); }
  .quick #all-quick { font-size: clamp(13px,1.06cqw,22px); }
  .flightdeck .search-case {
    position: absolute; z-index: 4; left: 4.65%; right: 4.05%; top: 25.43%; height: 8.35%;
    min-height: 0; padding: 0; background: none;
  }
  .search-case form {
    min-height: 0; height: 100%; border-radius: 8px;
    clip-path: polygon(.82% 0,98.84% 0,100% 36%,100% 63%,99.03% 100%,.73% 100%,0 79%,0 25%);
  }
  #plot { padding-inline-end: 1.25cqw; }
  .lens { width: 1.3cqw; height: 1.3cqw; }
  .flightdeck .navigator { display: block; position: absolute; inset: 35.83% 0 0; min-height: 0; padding: 0; background: #1a1a1a; }
  .channels { position: absolute; inset: 0; display: block; padding: 0; z-index: 2; pointer-events: none; }
  .channel {
    position: absolute; left: 1.63%; background-size: 100% 100%;
    min-height: 0; padding: 0 0 0 1.42cqw; gap: .83cqw; pointer-events: auto;
    line-height: 1.12; font-size: clamp(13px,1.2cqw,24px);
  }
  .channel:nth-child(1) { top: 11.15%; width: 11.27%; height: 16.24%; }
  .channel:nth-child(2) { top: 28.15%; width: 11.55%; height: 16.24%; }
  .channel:nth-child(3) { top: 44.9%; width: 11.9%; height: 16.7%; }
  .channel:nth-child(4) { top: 62.18%; width: 12.5%; height: 17.0%; }
  .channel:nth-child(5) { top: 79.68%; width: 12.74%; height: 16.95%; }
  .navigator .map {
    position: absolute; left: 11.8%; width: 54.5%; top: .4%; bottom: 1.2%;
    min-height: 0; margin: 0; border: 0; border-radius: 0; clip-path: none;
    padding: .7cqw 4.15cqw .65cqw 4.6cqw;
    background-color: #191919;
  }
  .navigator .map h2 { margin-inline-start: -1.55cqw; padding: .36cqw 0 0; font-size: clamp(17px,1.56cqw,32px); line-height: 1.15; }
  .diagram { min-height: 0; margin: 1.2cqw 0 .4cqw; }
  .map-foot { padding: 0; min-height: 23px; }
  .map-node { font-size: clamp(12px,1.02cqw,19px); }
  .map-node.root { font-size: clamp(16px,1.47cqw,30px); }
  .map-node.leaf { font-size: clamp(12px,.99cqw,19px); }
  .navigator .inspect {
    position: absolute; left: 61.39%; right: 0; top: -1%; bottom: 0;
    display: grid; align-content: center; min-height: 0;
    padding: 1.9cqw 2.65cqw 2.25cqw 5.2cqw;
    background: radial-gradient(ellipse at 74% 25%,#2c2c2c 3%,#1b1b1b 54%,#1a1a1a 84%);
    clip-path: polygon(16% 5%,90% 6%,100% 16%,100% 90%,94% 98%,12% 98%,3% 80%,7% 15%);
  }
  .file-layout { grid-template-columns: minmax(0,.83fr) minmax(0,1.05fr); gap: 1.45cqw; }
  .file-cover { height: 19.5cqw; max-height: 100%; }
  .file-info h3 { line-height: 1.05; }
  .file-info p { font-size: clamp(14px,1.25vw,24px); }
  .file-info .action { padding: .78vw .24vw; font-size: clamp(13px,1.1vw,21px); }
  .file-info .save { padding: .65vw .24vw; font-size: clamp(12px,.95vw,20px); }
  .aft-housing { aspect-ratio: 1536 / 210; container-type: inline-size; }
  .aft-casing { background-image: url("skin/lower-hull.webp?v=bw1"); }
  .campaigns { position: absolute; inset: 1.8% 2.14% 52.7% 2.25%; padding: 0; gap: 1.1%; }
  .campaign { min-height: 0; border: 0; border-radius: 0; }
  .campaign strong { padding-inline: 2.18cqw; }
  .aft-housing .trail {
    position: absolute; left: 3.65%; right: 3.85%; top: 59.5%; height: 28.3%;
    padding: 0; gap: 2.85cqw; background: linear-gradient(105deg,#242424,#181818 92%); flex-wrap: nowrap;
  }
  .trail nav { padding-inline-start: .45cqw; flex-wrap: nowrap; min-width: 0; overflow: hidden; }
  .trail nav span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .trail .key { min-height: 0; padding-block: .48cqw; }
  .trail #back { width: 9.4cqw; flex: none; border: 0; background: none; box-shadow: none; }
  .trail #saved { margin-inline-end: 1.6cqw; }
}

@media (max-width: 980px) {
  .flightdeck, .aft-housing {
    padding-inline: clamp(3px, .65vw, 7px);
    background: url("skin/rail-left.webp?v=bw1") left top / clamp(4px,.86vw,10px) 240px repeat-y,
                url("skin/rail-right.webp?v=bw1") right top / clamp(4px,.86vw,10px) 240px repeat-y, #2f2f2f;
  }
  .search-case { --bs: 6px; --be: 6px; --corners: 14px 15px 15px 19px; }
  .search-case form { min-height: 48px; }
}
@media (max-width: 600px) {
  .search-case form { --glass-left: 36px; --route-key: 46px; min-height: 50px; }
  #plot { padding: 0; }
  #plot-label { display: none; }
  #plot svg { width: 23px; height: 23px; }
  .library .deck-head { flex-wrap: wrap; }
  .deck-controls .site-link { font-size: 12px; padding: 5px 6px; }
  .trail nav { flex-wrap: wrap; }
}
