/* Overhead. Colours follow avionics convention: magenta for the active flight,
   cyan for selected values, amber for attention, green for normal. */
@font-face { font-family: "B612"; font-weight: 400; src: url(fonts/b612-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "B612"; font-weight: 700; src: url(fonts/b612-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "B612 Mono"; font-weight: 400; src: url(fonts/b612-mono-latin-400-normal.woff2) format("woff2"); }
@font-face { font-family: "B612 Mono"; font-weight: 700; src: url(fonts/b612-mono-latin-700-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 500; src: url(fonts/barlow-condensed-latin-500-normal.woff2) format("woff2"); }
@font-face { font-family: "Barlow Condensed"; font-weight: 700; src: url(fonts/barlow-condensed-latin-700-normal.woff2) format("woff2"); }

:root {
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --text: "B612", "Helvetica Neue", Arial, sans-serif;
  --mono: "B612 Mono", ui-monospace, monospace;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-l: env(safe-area-inset-left, 0px); --safe-r: env(safe-area-inset-right, 0px);
}
body.live {
  --bg: #08111D; --panel: #10213A; --ink: #EAF2F8; --mute: #8FA6BC; --line: rgba(234, 242, 248, .2);
  --amber: #FFB000; --cyan: #57D4FF; --mag: #FF4D8D; --green: #5BE38F; --on-sky: #fff;
  --sky-top: #0E4A9E; --sky-mid: #2F78C8; --sky-bot: #5CA3DE;
}
body.live.ph-dawn { --sky-top: #24427A; --sky-mid: #C97C6E; --sky-bot: #F2B66B; }
body.live.ph-dusk { --sky-top: #16214F; --sky-mid: #7F4477; --sky-bot: #E8794F; }
body.live.ph-twilight { --sky-top: #0A1330; --sky-mid: #1E2A5C; --sky-bot: #4A4578; }
body.live.ph-night { --sky-top: #040914; --sky-mid: #091730; --sky-bot: #10264A; }
body.paper {
  --bg: #E9EAE4; --panel: #DCDDD5; --ink: #161616; --mute: #57584F; --line: rgba(22, 22, 22, .32);
  --amber: #D8A600; --cyan: #24479A; --mag: #C4342B; --green: #3A7648; --on-sky: #161616;
  --sky-top: #E9EAE4; --sky-mid: #E9EAE4; --sky-bot: #E9EAE4;
}
body.paper.night {
  --bg: #1B1B19; --panel: #262624; --ink: #E6E4DA; --mute: #A3A196; --line: rgba(230, 228, 218, .3);
  --amber: #E2B93B; --cyan: #8FA9EA; --mag: #E8736A; --green: #7FBF8E; --on-sky: #E6E4DA;
  --sky-top: #1B1B19; --sky-mid: #1B1B19; --sky-bot: #1B1B19;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; background: #08111D; }
body { font-family: var(--text); color: var(--ink); background: var(--bg); -webkit-user-select: none; user-select: none; -webkit-text-size-adjust: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input { font: inherit; color: inherit; -webkit-user-select: text; user-select: text; }
small { font-size: .5em; font-weight: 400; margin-left: .25em; letter-spacing: 0; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }
#stage { position: fixed; top: 0; right: 0; bottom: 0; left: 0; touch-action: none; }
.view { position: absolute; top: 0; right: 0; bottom: 0; left: 0; overflow: hidden; background: var(--bg); color: var(--ink);
  padding: calc(5vmin + var(--safe-t)) calc(5vmin + var(--safe-r)) calc(5vmin + var(--safe-b)) calc(5vmin + var(--safe-l)); }
.sky { background: linear-gradient(var(--sky-top), var(--sky-mid) 55%, var(--sky-bot)); color: var(--on-sky); }
.skyart { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; pointer-events: none; }
.sky > * { position: relative; }
.sky > .skyart { position: absolute; }
.none { color: var(--mute); font-size: 3.6vmin; padding: 4vmin 0; }

/* Shared pieces */
.plane { width: 100%; }
.plane svg { display: block; width: 100%; height: auto; transform: rotate(var(--tilt, 0deg)); transition: transform 1.2s ease; overflow: visible; }
.plane.west { transform: scaleX(-1); }
body.live .plane svg { filter: drop-shadow(0 1.2vmin 1.6vmin rgba(0, 10, 30, .35)); }
.rt { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 3.5vmin; }
.rt .ap b { display: block; font: 700 12vmin/0.86 var(--display); letter-spacing: .01em; }
.rt .ap span { display: block; font-size: 3vmin; margin-top: 1vmin; opacity: .85; max-width: 34vmin; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rt .ap.r { text-align: right; }
.rt-line { position: relative; height: 2px; align-self: start; margin-top: 5vmin;
  background: repeating-linear-gradient(90deg, currentColor 0 1.2vmin, transparent 1.2vmin 2.2vmin); opacity: .9; }
.rt-line i { position: absolute; top: 50%; width: 2.6vmin; height: 2.6vmin; margin: -1.3vmin; border-radius: 50%; background: var(--mag); box-shadow: 0 0 0 .6vmin rgba(255, 255, 255, .25); transition: left 2s linear; }
.rt.compact .ap b { font-size: 8vmin; } .rt.compact .ap span { font-size: 2.5vmin; } .rt.compact .rt-line { margin-top: 3.4vmin; }
.rt.none { display: block; font-size: 3.4vmin; opacity: .8; }
.stats { display: flex; flex-wrap: wrap; gap: 2vmin 5.5vmin; }
.stat span { display: block; font-size: 2.5vmin; opacity: .8; margin-bottom: .4vmin; }
.stat b { font: 700 7vmin/1 var(--display); white-space: nowrap; }
.type { font-size: 3vmin; }
.type span { font-family: var(--mono); margin-left: 1.2em; opacity: .85; }

/* Quiet sky */
.v-quiet { display: flex; align-items: flex-end; }
.quiet h1 { font: 700 15vmin/0.9 var(--display); margin-bottom: 2vmin; }
.quiet p { font-size: 3.8vmin; line-height: 1.4; max-width: 34em; }
.quiet .last { font-size: 3vmin; opacity: .8; margin-top: 1.4vmin; }
.quiet .clock { font: 500 9vmin/1 var(--display); margin-top: 4vmin; opacity: .9; }

/* Poster */
.v-poster { display: grid; grid-template: "head" auto "hero" 1fr "lower" auto / 1fr; }
.v-poster header { grid-area: head; }
.v-poster .airline { font-size: 4.2vmin; font-weight: 700; }
.v-poster h1 { font: 700 25vmin/0.84 var(--display); letter-spacing: -.005em; margin-top: 1vmin; white-space: nowrap; }
.v-poster .hero { grid-area: hero; display: flex; align-items: center; min-height: 0; }
.v-poster .hero .plane { margin: 0 -2vmin; width: calc(100% + 4vmin); }
.v-poster .lower { grid-area: lower; display: grid; gap: 3.2vmin; }
.v-poster .lower::before { content: ""; position: absolute; inset: -12vmin -5vmin -5vmin -5vmin; z-index: -1; background: linear-gradient(transparent, rgba(4, 12, 26, .5) 40%); }
body.paper .v-poster .lower::before { display: none; }
body.paper.port .v-poster .lower { border-top: 2px solid var(--ink); padding-top: 3vmin; }
.v-poster .where { font-size: 3.8vmin; font-weight: 700; }
.vs-climb b { color: var(--green); } .vs-desc b { color: var(--amber); }
body.paper .vs-climb b, body.paper .vs-desc b { color: inherit; }
body.land .v-poster { grid-template: "head hero" auto "lower hero" 1fr / 46% 1fr; column-gap: 4vmin; }
body.land .v-poster h1 { font-size: 23vmin; }
body.land .v-poster .lower { align-self: end; }
body.land .v-poster .lower::before { inset: -8vmin -4vmin -5vmin -5vmin; background: none; }
body.land .v-poster .rt .ap b { font-size: 10.5vmin; }

/* Duo */
.v-duo { display: grid; grid-template-rows: 1fr 1fr; gap: 0; padding-top: calc(3vmin + var(--safe-t)); padding-bottom: calc(3vmin + var(--safe-b)); }
body.land .v-duo { grid-template: 1fr / 1fr 1fr; }
.duo-card { display: grid; grid-template-rows: auto 1fr auto auto auto; gap: 1.8vmin; min-height: 0; padding: 2vmin 0; }
.duo-card + .duo-card { border-top: 2px solid var(--line); padding-top: 3vmin; }
body.land .duo-card { padding: 0 4vmin 0 0; }
body.land .duo-card + .duo-card { border-top: 0; border-left: 2px solid var(--line); padding: 0 0 0 4vmin; }
.duo-card header { display: flex; align-items: baseline; gap: 3vmin; }
.duo-card h2 { font: 700 13vmin/0.86 var(--display); white-space: nowrap; }
.duo-card header p { font-size: 3.2vmin; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.duo-card .hero { display: flex; align-items: center; justify-content: center; min-height: 0; }
.duo-card .hero .plane { max-width: 74vmin; }
body.port .duo-card .hero .plane { max-width: min(86vw, 34vh); }
.duo-card .stat b { font-size: 5.4vmin; } .duo-card .type { font-size: 2.6vmin; }
.duo-card.empty { display: flex; align-items: center; justify-content: center; font-size: 3.4vmin; opacity: .7; }

/* Tower: paper flight strips in a bay. Buff descending, blue climbing, pink overflying. */
.v-tower { background: #121A17; color: #EAF2F8; display: grid; grid-template-rows: auto 1fr; gap: 3vmin; }
body.paper .v-tower { background: var(--bg); color: var(--ink); }
.v-tower header { display: flex; justify-content: space-between; align-items: baseline; gap: 4vmin; }
.v-tower h1 { font: 700 7vmin/1 var(--display); }
.v-tower header p { font-size: 3vmin; opacity: .8; } .v-tower header span { margin-left: 1.2em; }
.bay { display: grid; align-content: start; gap: 1.4vmin; min-height: 0; }
.strip { display: grid; grid-template-columns: 1.7fr 1fr 1fr .9fr 1.1fr 1.2fr; color: #14202B; background: #F4E3A4; border-left: 2.2vmin solid #C9A227; }
.strip .cs b, .strip .sq b, .strip .rte { font-family: var(--mono); }
.strip.s-climb { background: #C3DEF5; border-left-color: #2F78C8; }
.strip.s-level { background: #F4CCD8; border-left-color: #C4577C; }
.strip.s-ground { background: #DADDD6; border-left-color: #7C8479; }
.strip.emerg { background: #FFD0C4; border-left-color: #D62B1F; }
.strip.focus { box-shadow: 0 0 0 .7vmin var(--mag); }
.strip .c { padding: 1.5vmin 1.6vmin; border-left: 1px solid rgba(20, 32, 43, .35); min-width: 0; }
.strip .c:first-child { border-left: 0; }
.strip b { display: block; font-size: 3.5vmin; white-space: nowrap; overflow: hidden; }
.strip .cs b { font-size: 4.4vmin; }
.strip span { display: block; font-size: 2.3vmin; margin-top: .5vmin; white-space: nowrap; overflow: hidden; opacity: .85; }
body.port .strip { grid-template-columns: 1.6fr 1fr 1fr .9fr 1.2fr; }
body.port .strip .sq { display: none; }
body.port .strip b { font-size: 3.7vw; } body.port .strip .cs b { font-size: 4.6vw; } body.port .strip span { font-size: 2.45vw; }
body.port .strip .c { padding: 1.5vmin 1.2vmin; }

/* Radar */
.v-radar { display: grid; grid-template-rows: auto 1fr; gap: 2vmin; padding: var(--safe-t) var(--safe-r) calc(4vmin + var(--safe-b)) var(--safe-l); }
.v-radar .scope { width: 100vw; height: min(100vw, 62vh); }
body.land .v-radar { grid-template: 1fr / auto 1fr; padding: var(--safe-t) calc(4vmin + var(--safe-r)) var(--safe-b) var(--safe-l); }
body.land .v-radar .scope { width: min(100vh, 62vw); height: 100vh; }
.v-radar canvas { display: block; width: 100%; height: 100%; }
.v-radar aside { padding: 0 5vmin; min-width: 0; align-self: start; }
body.land .v-radar aside { padding: 0; align-self: center; }
.v-radar h1 { font: 700 7vmin/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-radar aside p { font-size: 2.8vmin; color: var(--mute); margin: 1vmin 0 2.5vmin; } .v-radar aside p span { margin-left: 1.2em; }
.v-radar ul { list-style: none; }
.v-radar li { display: grid; grid-template-columns: 1.1fr 1.1fr 1fr 1.3fr; gap: 2vmin; padding: 1.5vmin 0; border-top: 1px solid var(--line); font-size: 2.8vmin; align-items: baseline; white-space: nowrap; }
.v-radar li b { font: 700 4.6vmin/1 var(--display); } .v-radar li i { font-style: normal; font-size: 2.5vmin; text-align: right; color: var(--mute); }
.v-radar li.focus b { color: var(--mag); } .v-radar li.none { display: block; color: var(--mute); }

/* Departure board */
.v-board { background: #0B0B0B; color: #F2E8C9; font-size: var(--fs); padding: calc(4vmin + var(--safe-t)) calc(2.5vw + var(--safe-r)) calc(3vmin + var(--safe-b)) calc(2.5vw + var(--safe-l)); }
body.paper .v-board { background: var(--bg); color: var(--ink); }
.v-board header { display: flex; align-items: baseline; gap: 1em; margin-bottom: .7em; }
.v-board h1 { font: 700 1.25em/1 var(--display); }
.v-board header p { font-size: .5em; opacity: .7; flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.v-board time { font: 700 1.25em/1 var(--display); color: #FFB000; }
body.paper .v-board time { color: var(--ink); }
.bhead, .brow { display: flex; white-space: nowrap; }
.bhead .cell { font-size: .4em; opacity: .7; margin-right: calc(var(--fs) * .9); overflow: hidden; padding-bottom: .6em; }
.brow { margin-bottom: .32em; }
.brow .cell { margin-right: .9em; display: flex; }
.brow i { font: 700 1em/1.56 var(--mono); font-style: normal; width: .78em; height: 1.56em; margin-right: .08em; text-align: center; border-radius: .08em;
  background: linear-gradient(#262626 0 48%, #000 48% 52%, #1C1C1C 52%); color: #F2E8C9; overflow: hidden; }
.brow.focus i { color: #FFB000; } .brow.emerg i { color: #FF6A5A; } .brow.blank { opacity: .55; }
body.paper .brow i { background: linear-gradient(#262626 0 48%, #000 48% 52%, #1C1C1C 52%); color: #F1F0E8; }
body.paper .brow.focus i { color: #F2CF4A; }

/* Runway */
.v-runway { display: grid; grid-template-rows: auto 1fr auto auto; padding-bottom: calc(4vmin + var(--safe-b)); }
.v-runway h1 { font: 700 10vmin/0.95 var(--display); }
.v-runway header p { font-size: 3.4vmin; font-weight: 700; margin-top: 1.4vmin; }
.v-runway .air { position: relative; min-height: 0; margin: 3vmin 0 0; }
.ladder { position: absolute; top: 0; right: 0; bottom: 0; left: 0; list-style: none; }
.ladder li { position: absolute; left: 0; right: 0; border-top: 1px dashed currentColor; opacity: .5; }
.ladder span { position: absolute; left: 0; top: .5vmin; font-size: 2.3vmin; }
.craft { position: absolute; left: 24%; right: 0; display: flex; align-items: center; gap: 3vmin; transform: translateY(-50%); transition: top 2s linear; }
.craft .plane { width: min(48vmin, 55%); flex: none; }
.craft p { background: rgba(4, 12, 26, .38); padding: 1.4vmin 2.2vmin; border-radius: 1.6vmin; }
body.paper .craft p { background: var(--bg); border: 1.5px solid var(--ink); }
.craft p b { display: block; font: 700 8vmin/1 var(--display); white-space: nowrap; } .craft p span { font-size: 3vmin; white-space: nowrap; }
.craft .path { position: absolute; left: -40%; width: 60%; top: 50%; border-top: 2px dashed currentColor; opacity: .7; transform-origin: 100% 50%; transform: rotate(var(--slope)); }
.v-runway footer { order: 3; padding-bottom: 3vmin; }
.v-runway .ground { order: 4; height: 13vh; margin: 0 -5vmin calc(-4vmin - var(--safe-b)); border-top: 2px solid currentColor; background: rgba(6, 20, 14, .45); }
body.paper .v-runway .ground { background: var(--panel); }
.ground svg { display: block; width: 100%; height: 100%; }
.ground .tar { fill: #1D242B; } .ground .mk { fill: #F2F2F2; } .ground .edge { stroke: #F2F2F2; stroke-width: 1; fill: none; }
body.paper .ground .tar { fill: #3A3A38; }
.v-runway footer { display: flex; flex-wrap: wrap; align-items: end; gap: 2vmin 6vmin; padding-top: 3vmin; }
.v-runway footer p { font-size: 2.8vmin; flex: 1 1 100%; }
body.land .v-runway footer p { flex: 1; text-align: right; }
body.land .v-runway .stat b { font-size: 6vmin; }

/* Route map */
.v-route { padding: 0; }
.v-route canvas { position: absolute; top: 0; right: 0; bottom: 0; left: 0; width: 100%; height: 100%; }
.v-route aside { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: var(--bg); border-top: 2px solid var(--line);
  padding: 3.5vmin calc(5vmin + var(--safe-r)) calc(3.5vmin + var(--safe-b)) calc(5vmin + var(--safe-l)); display: grid; align-content: space-between; gap: 1.6vmin; }
body.land .v-route aside { right: auto; top: 0; height: auto; width: 36%; border-top: 0; border-right: 2px solid var(--line); padding-top: calc(5vmin + var(--safe-t)); align-content: center; gap: 3vmin; }
.v-route .airline { font-size: 3vmin; font-weight: 700; }
.v-route h1 { font: 700 13vmin/0.86 var(--display); }
.v-route .bar { height: 1.2vmin; background: var(--line); border-radius: 1vmin; overflow: hidden; }
.v-route .bar i { display: block; height: 100%; background: var(--mag); transition: width 2s linear; }
.v-route .stat b { font-size: 5vmin; } .v-route .type { font-size: 2.5vmin; color: var(--mute); }
.v-route .note { font-size: 2.9vmin; line-height: 1.4; color: var(--mute); }
body.port .v-route h1 { font-size: 10vmin; } body.port .v-route .rt.compact .ap b { font-size: 7vmin; }

/* Blueprint */
.v-blueprint { background-color: #0C3767; color: #EAF4FF; padding: calc(3vmin + var(--safe-t)) calc(3vmin + var(--safe-r)) calc(3vmin + var(--safe-b)) calc(3vmin + var(--safe-l));
  background-image: linear-gradient(rgba(234, 244, 255, .09) 1px, transparent 1px), linear-gradient(90deg, rgba(234, 244, 255, .09) 1px, transparent 1px); background-size: 4vmin 4vmin; }
body.paper .v-blueprint { background-color: #EEF0EA; color: #1F3F8F; background-image: linear-gradient(rgba(31, 63, 143, .14) 1px, transparent 1px), linear-gradient(90deg, rgba(31, 63, 143, .14) 1px, transparent 1px); }
.v-blueprint .sheet { height: 100%; border: 2px solid currentColor; outline: 1px solid currentColor; outline-offset: -1.4vmin; padding: 3.4vmin; display: grid; grid-template: "top" 1.5fr "side" 1fr "title" auto / 1fr; gap: 2vmin; }
body.land .v-blueprint .sheet { grid-template: "top side" 1fr "top title" auto / 44% 1fr; column-gap: 4vmin; }
.v-blueprint figure { min-height: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: 1vmin; }
.v-blueprint .top { grid-area: top; } .v-blueprint .side { grid-area: side; }
.v-blueprint figure svg { width: 100%; height: 100%; min-height: 0; }
.v-blueprint .dim path { stroke: currentColor; stroke-width: .8; fill: none; }
.v-blueprint figcaption { font: 400 2.5vmin var(--mono); display: flex; gap: 1.2em; align-items: baseline; }
.v-blueprint figcaption b { font: 700 4.4vmin/1 var(--display); }
.v-blueprint .title { grid-area: title; border-collapse: collapse; width: 100%; font: 400 2.4vmin var(--mono); }
.v-blueprint .title td, .v-blueprint .title th { border: 1px solid currentColor; padding: .9vmin 1.4vmin; text-align: left; }
.v-blueprint .title th { font: 700 4.6vmin/1.1 var(--display); }
.v-blueprint .title td:first-child { width: 36%; opacity: .8; }
.v-blueprint .title td:last-child { font-family: var(--text); }
.v-blueprint .stamp { position: absolute !important; right: 6vmin; top: 5.5vmin; font: 400 2.2vmin var(--mono); opacity: .75; }

/* Spotter card */
.v-spotter { display: grid; place-items: center; background: var(--panel); }
.v-spotter .card { width: 100%; max-height: 100%; background: var(--bg); border: 2px solid var(--ink); border-top: 2.4vmin solid var(--c1); border-radius: 2.4vmin; overflow: hidden; display: grid; grid-template-rows: auto 1fr; }
body.land .v-spotter .card { grid-template: 1fr / 56% 1fr; height: 100%; }
.v-spotter .pic { background: var(--panel); aspect-ratio: 3 / 2; overflow: hidden; }
body.land .v-spotter .pic { aspect-ratio: auto; height: 100%; }
.v-spotter .pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.noimg { height: 100%; display: grid; align-content: center; justify-items: center; gap: 2vmin; padding: 5vmin; }
.noimg p { font-size: 2.4vmin; color: var(--mute); }
.v-spotter .body { padding: 4vmin; display: grid; gap: 2vmin; align-content: start; min-height: 0; }
.v-spotter h1 { font: 700 13vmin/0.86 var(--mono); letter-spacing: -.03em; font-family: var(--display); }
.v-spotter .type { font-size: 3.4vmin; font-weight: 700; }
dl { display: grid; grid-template-columns: auto 1fr; gap: 1vmin 3vmin; font-size: 2.7vmin; }
dt { color: var(--mute); } dd { text-align: right; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v-spotter .stat b { font-size: 5.4vmin; }
.credit { font-size: 2vmin; color: var(--mute); }

/* Boarding pass */
.v-pass { display: grid; place-items: center; }
.pass { width: 100%; max-width: 150vh; background: #FBFAF5; color: #17212B; border-radius: 3vmin; display: grid; grid-template-columns: 1fr 26%; overflow: hidden; box-shadow: 0 2vmin 5vmin rgba(0, 10, 30, .35); }
body.paper .pass { border: 2px solid #161616; box-shadow: none; }
body.port .pass { grid-template: auto auto / 1fr; }
.pass .main { padding: 0 0 4vmin; }
.pass header { background: var(--c1); color: #fff; padding: 2.4vmin 4vmin; display: flex; justify-content: space-between; align-items: baseline; gap: 3vmin; }
.pass header b { font: 700 5vmin/1 var(--display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 0 2px rgba(0, 0, 0, .5); }
.pass header span { font-size: 2.3vmin; white-space: nowrap; text-shadow: 0 0 2px rgba(0, 0, 0, .5); }
.legs { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 3.5vmin 4vmin 2.5vmin; }
.legs b { display: block; font: 700 15vmin/0.86 var(--display); } .legs span { font-size: 2.8vmin; color: #55636F; }
.legs .r { text-align: right; } .legs .mid { width: 11vmin; transform: rotate(90deg); color: var(--c1); } .legs .mid svg { display: block; width: 100%; }
.pass .grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 2.4vmin 2vmin; padding: 0 4vmin; }
body.port .pass .grid { grid-template-columns: repeat(2, 1fr); }
.fld span { display: block; font-size: 2.1vmin; color: #55636F; margin-bottom: .5vmin; }
.fld b { font-size: 3vmin; display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pass .stub { border-left: 2px dashed #9AA5AE; padding: 3vmin; display: grid; align-content: space-between; gap: 2vmin; }
body.port .pass .stub { border-left: 0; border-top: 2px dashed #9AA5AE; grid-template-columns: auto 1fr; align-items: center; }
.pass .stub b { font: 700 8vmin/1 var(--display); } .pass .stub span { font-size: 2.3vmin; }
.pass .stub svg { width: 100%; height: 9vmin; fill: #17212B; }
body.port .pass .stub svg { grid-column: 1 / -1; }

/* Cockpit */
.v-cockpit { background: #14181D; color: #EAF2F8; padding: calc(3vmin + var(--safe-t)) calc(3vmin + var(--safe-r)) calc(3vmin + var(--safe-b)) calc(3vmin + var(--safe-l)); }
body.paper .v-cockpit { background: var(--bg); color: var(--ink); }
.panel6 { height: 100%; display: grid; grid-template: repeat(3, 1fr) / repeat(2, 1fr); gap: 2.4vmin; }
body.land .panel6 { grid-template: repeat(2, 1fr) / repeat(3, 1fr); }
.dial { min-height: 0; min-width: 0; display: grid; grid-template-rows: 1fr auto; justify-items: center; gap: .8vmin; }
.dial svg { height: 100%; width: 100%; min-height: 0; }
.dial figcaption { display: flex; gap: 1em; align-items: baseline; font-size: 2.3vmin; white-space: nowrap; }
.dial figcaption span { opacity: .7; } .dial figcaption b { font: 700 4.6vmin/1 var(--display); }
.bezel { fill: #2A3038; stroke: #060809; stroke-width: 2; } .face { fill: #06090C; }
.tick { stroke: #EAF2F8; stroke-width: 1.2; } .tick.big { stroke-width: 2.6; }
.dial text { fill: #EAF2F8; font: 700 15px var(--text); text-anchor: middle; }
.needle, .card, .horizon { transform-origin: 100px 100px; transition: transform 1.5s ease; }
.needle path { fill: #FFB000; } .needle.short path { fill: #EAF2F8; } .hub { fill: #2A3038; stroke: #EAF2F8; stroke-width: 1.5; }
.att-sky { fill: #2F78C8; } .att-gnd { fill: #7A5230; } .att-line { stroke: #fff; stroke-width: 1.6; fill: none; } .att-ref { stroke: #FFB000; stroke-width: 4; fill: none; stroke-linecap: round; }
.lubber { fill: #FFB000; } .mini path { fill: #FFB000; }
body.paper .bezel { fill: #C9CAC2; stroke: #161616; } body.paper .face { fill: #F6F6F1; stroke: #161616; }
body.paper .tick { stroke: #161616; } body.paper .dial text { fill: #161616; } body.paper .needle path, body.paper .lubber, body.paper .mini path { fill: #C4342B; }
body.paper .needle.short path { fill: #161616; } body.paper .att-sky { fill: #C9D6F2; } body.paper .att-gnd { fill: #B9A888; } body.paper .att-line { stroke: #161616; } body.paper .att-ref { stroke: #C4342B; } body.paper .hub { fill: #F6F6F1; stroke: #161616; }
.idbox { align-self: center; min-width: 0; padding: 0 1vmin; display: grid; gap: 1.4vmin; }
.idbox p { font-size: 2.6vmin; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.idbox h1 { font: 700 11vmin/0.86 var(--display); color: #FFB000; }
body.paper .idbox h1 { color: var(--ink); }
.idbox .rt.compact .ap b { font-size: 6vmin; } .idbox .rt .ap span { max-width: 18vmin; }
.idbox .sq { font-family: var(--mono); opacity: .8; }

/* Logbook */
.v-logbook { display: grid; grid-template-rows: auto auto 1fr; gap: 3vmin; }
.v-logbook h1 { font: 700 11vmin/0.9 var(--display); }
.v-logbook header p { font-size: 3vmin; color: var(--mute); margin-top: 1vmin; }
.v-logbook .stat b { color: var(--cyan); }
.v-logbook table { width: 100%; border-collapse: collapse; font-size: 2.6vmin; align-self: start; }
.v-logbook th { text-align: left; font-weight: 400; color: var(--mute); padding: 0 1.6vmin 1.4vmin 0; border-bottom: 2px solid var(--ink); white-space: nowrap; }
.v-logbook td { padding: 1.5vmin 1.6vmin 1.5vmin 0; border-bottom: 1px solid var(--line); white-space: nowrap; }
.v-logbook td b { font: 700 4.2vmin/1 var(--display); }
.v-logbook tr.now td b { color: var(--mag); }
.v-logbook td:nth-last-child(-n+2), .v-logbook th:nth-last-child(-n+2) { text-align: right; padding-right: 0; padding-left: 1.6vmin; }
body.port .v-logbook td:nth-child(3), body.port .v-logbook th:nth-child(3), body.port .v-logbook td:nth-child(6), body.port .v-logbook th:nth-child(6) { display: none; }
body.port .v-logbook table { font-size: 3vw; } body.port .v-logbook td b { font-size: 5vw; }

/* Weather */
.v-weather { display: grid; gap: 3vmin; grid-template: "head" auto "now" auto "wind" auto "stats" auto "spot" auto "hours" auto "over" 1fr / 1fr; align-content: start; }
body.land .v-weather { grid-template: "head head" auto "now wind" auto "stats stats" auto "spot over" auto "hours over" 1fr / 1.2fr 1fr; column-gap: 6vmin; }
.v-weather header { grid-area: head; display: flex; justify-content: space-between; font-size: 3.2vmin; font-weight: 700; }
.v-weather time { font-weight: 400; }
.v-weather .now { grid-area: now; display: flex; align-items: center; gap: 4vmin; }
.wx { width: 26vmin; flex: none; }
.v-weather h1 { font: 700 22vmin/0.82 var(--display); } .v-weather h1 small { font-size: .35em; vertical-align: top; }
.v-weather .now p { font-size: 4vmin; font-weight: 700; margin-top: 1vmin; } .v-weather .now .feels { font-size: 2.8vmin; font-weight: 400; color: var(--mute); }
.v-weather .wind { grid-area: wind; display: flex; align-items: center; gap: 4vmin; }
.v-weather .wind svg { width: 22vmin; flex: none; }
.v-weather .wind > div { display: grid; gap: 2vmin; }
.wind .ring { fill: none; stroke: var(--line); stroke-width: 2; } .wind text { fill: var(--mute); font: 700 11px var(--text); text-anchor: middle; } .wind .arrow { fill: var(--cyan); }
.v-weather > .stats { grid-area: stats; padding: 2.5vmin 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.v-weather .stat b { font-size: 5.4vmin; }
.v-weather .spot { grid-area: spot; font-size: 3.4vmin; line-height: 1.35; max-width: 30em; }
.hours { grid-area: hours; list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); gap: 1vmin; align-self: start; }
.hours li { text-align: center; font-size: 2.3vmin; display: grid; justify-items: center; gap: .6vmin; color: var(--mute); }
.hours .wx { width: 8vmin; } .hours b { font: 700 4.4vmin/1 var(--display); color: var(--ink); }
.over { grid-area: over; align-self: start; } .over h2 { font-size: 2.8vmin; font-weight: 400; color: var(--mute); margin-bottom: 1vmin; }
.over ul { list-style: none; } .over li { display: flex; justify-content: space-between; align-items: baseline; padding: 1.2vmin 0; border-top: 1px solid var(--line); font-size: 2.8vmin; }
.over li b { font: 700 5vmin/1 var(--display); } .over li.none { color: var(--mute); font-family: var(--text); }
body.port .v-weather .over { display: none; }
@media (min-aspect-ratio: 1/2) and (orientation: portrait) { .v-weather .hours { display: none; } }

/* Kids */
.v-kids { display: grid; grid-template-rows: 1fr auto; gap: 3vmin; }
body.live .v-kids { --sky-top: #2D9BF0; --sky-mid: #6EC1FF; --sky-bot: #B8E4FF; color: #10233A; }
body.live.night .v-kids { --sky-top: #101A4A; --sky-mid: #2B2F7A; --sky-bot: #5B4A9E; color: #fff; }
body.land .v-kids { grid-template: 1fr / 1.1fr 1fr; align-items: center; }
.v-kids .hero { display: flex; align-items: center; min-height: 0; }
.v-kids .talk { background: #fff; color: #10233A; border: .8vmin solid #10233A; border-radius: 5vmin; padding: 4vmin 5vmin; display: grid; gap: 1.8vmin; }
.v-kids h1 { font: 700 9.5vmin/0.95 var(--display); }
.v-kids p { font-size: 4vmin; line-height: 1.3; }
.v-kids .wave { font: 700 6vmin/1 var(--display); color: #E0002B; }
.v-kids > .talk:only-child { align-self: center; }
body.land .v-kids h1 { font-size: 8vmin; } body.land .v-kids p { font-size: 3.4vmin; } body.land .v-kids .talk { padding: 3.5vmin 4.5vmin; gap: 1.4vmin; }

/* First run */
.v-welcome { display: grid; place-items: center; overflow-y: auto; background: radial-gradient(120vmax 80vmax at 50% -20%, #12305A, #08111D 70%); color: #EAF2F8; }
.welcome { width: min(100%, 34rem); display: grid; gap: 1rem; }
.welcome .mark { width: 5.5rem; }
.welcome h1 { font: 700 clamp(2.6rem, 11vmin, 4.6rem)/0.92 var(--display); }
.welcome > p { font-size: 1.05rem; line-height: 1.45; color: #B5C6D6; }

/* Forms, shared by the welcome screen and the panels */
.search { display: flex; gap: .5rem; }
.search input, .filter { flex: 1; min-width: 0; height: 3.2rem; padding: 0 1rem; border: 2px solid var(--line); border-radius: .7rem; background: rgba(127, 127, 127, .12); font-size: 1.05rem; width: 100%; }
.search input:focus, .filter:focus { border-color: var(--cyan); outline: none; }
.search button, .wide { height: 3.2rem; padding: 0 1.3rem; border-radius: .7rem; background: var(--amber); color: #14181D; font-weight: 700; white-space: nowrap; }
.wide { width: 100%; display: flex; align-items: center; justify-content: center; gap: .6rem; background: transparent; color: inherit; border: 2px solid var(--line); margin-top: .6rem; }
.wide.quiet { border-color: transparent; color: var(--mute); font-weight: 400; }
.wide svg { width: 1.3rem; height: 1.3rem; }
svg[viewBox="0 0 24 24"] { fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.msg { min-height: 1.3rem; font-size: .92rem; color: var(--amber); }
.results { display: grid; gap: .4rem; }
.result { text-align: left; padding: .8rem 1rem; border-radius: .6rem; background: rgba(127, 127, 127, .14); line-height: 1.3; font-size: .95rem; }
.link { color: var(--cyan); text-decoration: underline; text-underline-offset: .2em; padding: .6rem 0; text-align: left; justify-self: start; }

/* Overlay controls: appear on tap, fade on their own */
#chrome { position: fixed; top: 0; right: 0; bottom: 0; left: 0; pointer-events: none; opacity: 0; transition: opacity .25s; display: flex; flex-direction: column; justify-content: space-between; color: #EAF2F8; }
body.chrome-on #chrome { opacity: 1; }
body.chrome-on #chrome .bar, body.chrome-on #chrome .chips { pointer-events: auto; }
#chrome .bar { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding: calc(.7rem + var(--safe-t)) calc(.9rem + var(--safe-r)) 2.2rem calc(.9rem + var(--safe-l)); background: linear-gradient(rgba(4, 9, 18, .94), rgba(4, 9, 18, .8) 60%, transparent); }
#chrome .place { display: flex; align-items: center; gap: .6rem; text-align: left; min-width: 0; }
#chrome .place svg { width: 1.5rem; height: 1.5rem; flex: none; color: var(--amber); }
#chrome .place span { min-width: 0; display: grid; }
#chrome .place b { font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chrome .st { font-style: normal; font-size: .78rem; color: #A9BCCD; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#chrome .st-offline { color: #FFB000; }
#chrome .tools { display: flex; gap: .2rem; flex: none; }
#chrome .tools button { display: grid; justify-items: center; gap: .2rem; min-width: 4.2rem; padding: .4rem .3rem; font-size: .68rem; border-radius: .6rem; }
#chrome .tools svg { width: 1.6rem; height: 1.6rem; }
#chrome .chips { display: flex; gap: .5rem; overflow-x: auto; padding: 2.4rem calc(.9rem + var(--safe-r)) calc(.9rem + var(--safe-b)) calc(.9rem + var(--safe-l)); background: linear-gradient(transparent, rgba(4, 9, 18, .8) 40%, rgba(4, 9, 18, .94)); scrollbar-width: none; }
#chrome .chips::-webkit-scrollbar { display: none; }
.chip { flex: none; height: 2.6rem; padding: 0 1rem; border-radius: 1.3rem; border: 1.5px solid rgba(234, 242, 248, .35); font-size: .92rem; white-space: nowrap; background: rgba(8, 17, 29, .5); }
.chip.on { background: #FFB000; border-color: #FFB000; color: #14181D; font-weight: 700; }
.chips.wrap { display: flex; flex-wrap: wrap; gap: .5rem; }
.chips.wrap .chip { border-color: var(--line); background: transparent; }
#trackchip { position: fixed; left: 50%; transform: translateX(-50%); top: calc(.6rem + var(--safe-t)); z-index: 2; max-width: 94vw; transition: top .25s; }
body.chrome-on #trackchip { top: calc(5rem + var(--safe-t)); }
.tchip { display: flex; align-items: center; gap: .8rem; background: rgba(4, 9, 18, .86); color: #EAF2F8; border: 1.5px solid var(--mag); border-radius: 2rem; padding: .35rem .4rem .35rem 1rem; font-size: .82rem; }
.tchip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tchip.missing { border-color: #FFB000; } .tchip.missing span { white-space: normal; }
.tchip button { flex: none; height: 2rem; padding: 0 .8rem; border-radius: 1rem; background: rgba(234, 242, 248, .16); font-size: .78rem; white-space: nowrap; }

/* Panels */
#sheet { position: fixed; top: 0; right: 0; bottom: 0; left: 0; z-index: 5; background: rgba(2, 6, 12, .6); display: flex; justify-content: flex-end; }
#sheet[hidden] { display: none; }
.panel { position: relative; width: min(100%, 30rem); height: 100%; background: var(--bg); color: var(--ink); border-left: 1px solid var(--line); }
.panel .scroll { height: 100%; overflow-y: auto; padding: calc(1.2rem + var(--safe-t)) calc(1.2rem + var(--safe-r)) calc(2rem + var(--safe-b)) 1.2rem; -webkit-overflow-scrolling: touch; }
.panel .x { position: absolute; right: calc(.6rem + var(--safe-r)); top: calc(.7rem + var(--safe-t)); width: 2.8rem; height: 2.8rem; z-index: 1; display: grid; place-items: center; border-radius: 50%; background: var(--panel); }
.panel .x svg { width: 1.3rem; height: 1.3rem; }
.panel h2 { font: 700 2.4rem/1 var(--display); margin: .2rem 3rem 1rem 0; }
.panel h3 { font-size: .82rem; font-weight: 700; color: var(--mute); margin: 1.8rem 0 .2rem; padding-bottom: .5rem; border-bottom: 1px solid var(--line); }
.panel p { font-size: .95rem; line-height: 1.45; color: var(--mute); margin-bottom: .9rem; }
.panel .fine { font-size: .82rem; }
.row { padding: .85rem 0; border-bottom: 1px solid var(--line); display: grid; gap: .55rem; }
.row .lab { font-size: .95rem; } .row .lab small { display: block; font-size: .78rem; color: var(--mute); margin: .15rem 0 0; }
.seg { display: flex; flex-wrap: wrap; gap: .4rem; }
.seg button { min-height: 2.5rem; padding: .3rem .85rem; border-radius: .6rem; border: 1.5px solid var(--line); font-size: .88rem; }
.seg button.on { background: var(--cyan); border-color: var(--cyan); color: #08111D; font-weight: 700; }
body.paper .seg button.on { color: #fff; } body.paper.night .seg button.on { color: #161616; }
.row .link { padding: 0; }
.hlist { display: grid; margin: .8rem 0; }
.hrow { display: grid; grid-template-columns: 6.2rem 1fr auto; gap: .8rem; align-items: center; text-align: left; padding: .7rem 0; border-bottom: 1px solid var(--line); }
.hrow b { font: 700 1.5rem/1 var(--display); letter-spacing: .01em; }
.hrow span { font-size: .88rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow small { display: block; font-size: .76rem; color: var(--mute); margin: .1rem 0 0; }
.hrow i { font-style: normal; font: 400 .85rem var(--mono); color: var(--mute); }
.hcard img, .hcard .noimg { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: .8rem; background: var(--panel); display: grid; }
.hcard h2 { margin: 1rem 0 .2rem; font-size: 3rem; }
.hcard dl { font-size: .92rem; gap: .5rem 1rem; margin: 1rem 0; }
.back { display: block; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
