/* Simulator onboarding: plane picker, spotlight tour, and the small controls
   that open them. Uses the simulator's own colour variables. */

/* ---------- "See all 14" next to Plane type, and the ? button ---------- */
.pf-browse {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 28px; padding: 0 9px; margin: -4px -4px -4px 0;
  border: 1px solid var(--line); border-radius: 7px; background: var(--panel);
  color: var(--ink); font: 500 12.5px/1 "IBM Plex Sans", system-ui, sans-serif; white-space: nowrap; cursor: pointer;
}
.pf-browse svg { width: 13px; height: 13px; flex: none; color: var(--muted); }
.pf-browse:hover { border-color: color-mix(in srgb, var(--muted) 55%, var(--line)); background: var(--panel-2); }
.pf-browse:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
.top .help-btn { width: 36px; padding: 0; justify-content: center; }
.top .help-btn svg { width: 18px; height: 18px; }

/* Phones: the toolbar row is tight, so the tour lives in the plane picker there */
@media (width <= 600px) {
  .top .help-btn { display: none; }
  .top .top-actions .btn { padding: 0 10px; }
  .top .plane-name { min-width: 88px; }
}
@media (width <= 380px) {
  .top .top-actions .btn { padding: 0 8px; font-size: 13.5px; }
}
.pg-tour {
  display: inline-flex; align-items: center; gap: 6px; margin-top: 10px; padding: 0;
  border: 0; background: none; color: var(--c2); font: 500 14px/1.3 "IBM Plex Sans", system-ui, sans-serif; cursor: pointer;
}
.pg-tour:hover { text-decoration: underline; text-underline-offset: 3px; }
.pg-tour:focus-visible { outline: 2px solid var(--c2); outline-offset: 3px; border-radius: 4px; }

/* A larger plane in the sidebar */
.side-preview .preview { height: 236px; }
@media (width <= 900px) { .side-preview .preview { height: 220px; } }

/* ---------- Picker ---------- */
html.pg-lock { overflow: hidden; }
.pg-modal {
  position: fixed; inset: 0; z-index: 900;
  display: grid; place-items: center; padding: 24px;
  background: #0a0e14a6;
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.pg-sheet {
  width: min(1060px, 100%); max-height: min(860px, calc(100dvh - 48px));
  display: flex; flex-direction: column; overflow: hidden;
  background: var(--panel); color: var(--ink);
  border-radius: 16px; box-shadow: 0 0 0 1px var(--line), 0 30px 80px -20px #00000080;
}
.pg-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding: 22px 24px 16px; border-bottom: 1px solid var(--line);
}
.pg-head h2 { margin: 0 0 4px; font: 650 26px/1.15 Fraunces, Georgia, serif; letter-spacing: -.01em; }
.pg-head p { margin: 0; color: var(--muted); font-size: 15px; text-wrap: pretty; }
.pg-x {
  flex: none; display: grid; place-items: center; width: 36px; height: 36px; margin: -4px -6px 0 0;
  border: 0; border-radius: 9px; background: none; color: var(--muted); cursor: pointer;
}
.pg-x svg { width: 20px; height: 20px; }
.pg-x:hover { background: var(--panel-2); color: var(--ink); }
.pg-body { overflow: auto; overscroll-behavior: contain; padding: 6px 24px 26px; }
.pg-group h3 {
  margin: 18px 0 10px; color: var(--muted);
  font: 600 12px/1 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase;
}
.pg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.pg-card {
  position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 3px;
  padding: 0 0 14px; overflow: hidden; text-align: start;
  border: 1px solid var(--line); border-radius: 12px; background: var(--panel);
  color: var(--ink); font: inherit; cursor: pointer;
}
.pg-art {
  display: block; margin-bottom: 9px; border-bottom: 1px solid var(--line-2);
  background: radial-gradient(ellipse at 50% 55%, var(--panel), var(--panel-2) 75%);
}
.pg-art svg { display: block; width: 100%; height: auto; aspect-ratio: 240 / 136; }
.pg-name { padding: 0 14px; font-weight: 600; font-size: 15.5px; }
.pg-blurb { padding: 0 14px; color: var(--muted); font-size: 13px; line-height: 1.4; text-wrap: pretty; }
.pg-badge {
  position: absolute; top: 10px; inset-inline-start: 10px;
  padding: 4px 8px; border-radius: 99px;
  background: var(--good); color: #fff; font-size: 11.5px; font-weight: 600; line-height: 1;
}
.pg-badge.pg-now { background: var(--ink); color: var(--panel); }
.pg-card:hover { border-color: color-mix(in srgb, var(--ink) 30%, var(--line)); box-shadow: 0 8px 22px -14px #0f182866; }
.pg-card[aria-pressed="true"] { border-color: var(--c2); box-shadow: 0 0 0 1px var(--c2); }
.pg-card:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }
.pg-card:active { transform: translateY(1px); }

/* plane faces: shaded paper, a slightly darker keel, a tinted elevator */
.pg-w { fill: hsl(212 22% var(--l)); }
.pg-k { fill: hsl(212 16% calc(var(--l) - 9%)); }
.pg-f { fill: hsl(210 70% calc(var(--l) - 4%)); }
.pg-art polygon { stroke: #4a5868; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.pg-shadow { fill: #1f2b3a; opacity: .1; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pg-art polygon { stroke: #0e141b; }
  :root:not([data-theme="light"]) .pg-shadow { fill: #000; opacity: .35; }
}
:root[data-theme="dark"] .pg-art polygon { stroke: #0e141b; }

@media (width <= 600px) {
  .pg-modal { padding: 0; place-items: end stretch; }
  .pg-sheet { max-height: calc(100dvh - 24px); border-radius: 16px 16px 0 0; }
  .pg-head { padding: 18px 16px 12px; }
  .pg-head h2 { font-size: 22px; }
  .pg-body { padding: 4px 16px calc(20px + env(safe-area-inset-bottom)); }
  .pg-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .pg-name { padding: 0 11px; font-size: 14.5px; }
  .pg-blurb { padding: 0 11px; font-size: 12.5px; }
  .pg-badge { top: 8px; inset-inline-start: 8px; font-size: 11px; }
}

/* ---------- Tour ---------- */
.pg-shade { position: fixed; inset: 0; z-index: 880; background: #0a0e1499; opacity: 0; }
.pg-ring {
  position: fixed; z-index: 881; pointer-events: none; opacity: 0;
  border-radius: 12px; box-shadow: 0 0 0 2px #8ab4ff, 0 0 0 6px #8ab4ff33;
}
.pg-shade.on, .pg-ring.on { opacity: 1; }
.pg-pop {
  position: fixed; z-index: 882; box-sizing: border-box; width: 340px; opacity: 0;
  padding: 14px 16px 14px; border-radius: 14px;
  background: #1b2129; color: #e3e9ef; border: 1px solid #ffffff17;
  box-shadow: 0 24px 60px -18px #000000b3, 0 4px 14px #00000040;
  font: 14.5px/1.5 Inter, "IBM Plex Sans", system-ui, sans-serif; -webkit-font-smoothing: antialiased;
}
.pg-pop.on { opacity: 1; }
.pg-pop-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pg-count { color: #8f9bab; font-size: 12px; font-weight: 600; letter-spacing: .04em; font-variant-numeric: tabular-nums; }
.pg-skip { border: 0; background: none; color: #a9b4c1; font: inherit; font-size: 13px; padding: 4px 6px; margin: -4px -6px; border-radius: 6px; cursor: pointer; }
.pg-skip:hover { color: #fff; background: #ffffff12; }
.pg-pop-t { margin: 0 0 4px; font: 600 17px/1.3 Inter, system-ui, sans-serif; color: #fff; }
.pg-pop-b { margin: 0; color: #bcc6d2; text-wrap: pretty; }
.pg-pop-nav { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.pg-pop-nav button {
  min-height: 36px; padding: 0 14px; border-radius: 9px; font: 500 14px/1 Inter, system-ui, sans-serif; cursor: pointer;
}
.pg-back { border: 1px solid #ffffff2e; background: none; color: #e3e9ef; }
.pg-back:hover { background: #ffffff12; }
.pg-pop-nav .pg-next { border: 0; background: #fff; color: #15191f; font-weight: 600; }
.pg-next:hover { background: #e7edf4; }
.pg-pop button:focus-visible { outline: 2px solid #8ab4ff; outline-offset: 2px; }
.pg-arrow {
  position: absolute; width: 12px; height: 12px; margin: -6px; background: inherit;
  border: inherit; border-width: 0; transform: rotate(45deg);
}
.pg-pop[data-side="right"] .pg-arrow { left: 0; border-left-width: 1px; border-bottom-width: 1px; }
.pg-pop[data-side="left"] .pg-arrow { left: 100%; border-right-width: 1px; border-top-width: 1px; }
.pg-pop[data-side="below"] .pg-arrow { top: 0; border-left-width: 1px; border-top-width: 1px; }
.pg-pop[data-side="above"] .pg-arrow { top: 100%; border-right-width: 1px; border-bottom-width: 1px; }
.pg-pop[data-side="sheet"] {
  left: 8px !important; right: 8px; top: auto !important; bottom: calc(8px + env(safe-area-inset-bottom));
  width: auto;
}
.pg-pop[data-side="sheet"] .pg-arrow { display: none; }

@media (prefers-reduced-motion: no-preference) {
  .pg-card { transition: border-color .15s ease, box-shadow .15s ease, transform .1s ease; }
  .pf-browse { transition: background-color .15s ease, border-color .15s ease; }
  .pg-modal { animation: pg-fade .18s ease-out; }
  .pg-sheet { animation: pg-rise .26s cubic-bezier(.2, .8, .2, 1); }
  .pg-shade, .pg-ring, .pg-pop { transition: opacity .2s ease; }
  .pg-shade { transition: opacity .2s ease, clip-path .32s cubic-bezier(.2, .8, .2, 1); }
  .pg-ring { transition: opacity .2s ease, left .32s cubic-bezier(.2, .8, .2, 1), top .32s cubic-bezier(.2, .8, .2, 1), width .32s cubic-bezier(.2, .8, .2, 1), height .32s cubic-bezier(.2, .8, .2, 1); }
  .pg-pop { transition: opacity .2s ease, left .32s cubic-bezier(.2, .8, .2, 1), top .32s cubic-bezier(.2, .8, .2, 1); }
}
@keyframes pg-fade { from { opacity: 0; } }
@keyframes pg-rise { from { opacity: 0; transform: translateY(14px) scale(.985); } }

/* ---------- Diagrams in the "?" tips (drawn by tips.js) ----------
   The tip is always dark. Amber = the setting itself, blue = air, forces and
   flight paths, grey = guides. */
#tip.has-art { box-sizing: border-box; width: 300px; padding: 8px 12px 11px; }
.tip-art { margin: 0 -4px 9px; padding: 8px 4px 5px; border-radius: 8px; background: #1e252e; }
.tip-art svg { display: block; width: 100%; height: auto; overflow: visible; }
.tip-art :is(line, polyline, path) { fill: none; stroke-linecap: round; stroke-linejoin: round; }
.tip-art circle:is(.gs, .gs2, .acb) { fill: none; }
.tip-art .pw, .tip-art .sheet { fill: #e6ecf2; }
.tip-art .pw2 { fill: #cdd6e0; }
.tip-art .pk { fill: #a3b0bf; }
.tip-art .pk2 { fill: #8796a7; }
.tip-art .pf { fill: #9cc3ea; }
.tip-art .edge { stroke: #1e252e; stroke-width: .8; stroke-linejoin: round; }
.tip-art .pe { stroke: #e6ecf2; stroke-width: 3.4; }
.tip-art .pke { stroke: #a3b0bf; stroke-width: 3.4; }
.tip-art .crease { stroke: #1e252e; stroke-width: 1.2; }
.tip-art .fold { stroke: #8796a7; stroke-width: 1; stroke-dasharray: 2.5 2.5; }
.tip-art .ac { stroke: #ffb547; stroke-width: 1.6; }
.tip-art .acb { stroke: #ffb547; stroke-width: 2.4; }
.tip-art .acb3 { stroke: #ffb547; stroke-width: 3; }
.tip-art .acw3 { stroke: #ffb547; stroke-width: 3.4; }
.tip-art .acf, .tip-art .acbf { fill: #ffb547; }
.tip-art .acw { fill: #ffb547; fill-opacity: .2; stroke: none; }
.tip-art .th { stroke-width: 1.2; }
.tip-art .air { stroke: #7cc4ff; stroke-width: 1.6; }
.tip-art .airb { stroke: #7cc4ff; stroke-width: 2.4; }
.tip-art .airf, .tip-art .airbf { fill: #7cc4ff; }
.tip-art .airp { stroke: #7cc4ff; stroke-width: 1.6; stroke-dasharray: 4 3.5; }
.tip-art .airfill { fill: #7cc4ff; fill-opacity: .85; }
.tip-art .gd { stroke: #64717f; stroke-width: 1; stroke-dasharray: 3 3; }
.tip-art .gd2 { stroke: #7d8a99; stroke-width: 1.4; stroke-dasharray: 4 3.5; }
.tip-art .gd2f, .tip-art .gsf { fill: #7d8a99; }
.tip-art .gs { stroke: #64717f; stroke-width: 1.3; }
.tip-art .gs2 { stroke: #7d8a99; stroke-width: 1.6; }
.tip-art .fl { stroke: #4d5866; stroke-width: 1.6; }
.tip-art .hatch { stroke: #3a4450; stroke-width: 1; }
.tip-art .ps { stroke: #9aa6b4; stroke-width: 2.6; }
.tip-art .psf { fill: #9aa6b4; }
.tip-art .psh { fill: #c3ccd6; }
.tip-art .cgo { fill: #1e252e; stroke: #e6ecf2; stroke-width: 1.3; }
.tip-art .cgf { fill: #e6ecf2; }
.tip-art .ghost { fill: none; stroke: #8796a7; stroke-width: 1.1; stroke-dasharray: 2 2; }
.tip-art .clip { stroke: #ffb547; stroke-width: 1.7; }
.tip-art .hit { stroke: #ff7a7a; stroke-width: 1.8; }
.tip-art .hitp { stroke: #ff7a7a; stroke-width: 1.6; stroke-dasharray: 4 3.5; }
.tip-art .roomf { fill: #252d37; }
.tip-art .sock { fill: #ff8a4c; }
.tip-art .sockw { fill: #f1f4f8; }
.tip-art .cloud { fill: #3a4654; }
.tip-art .mtn { fill: #313b47; }
.tip-art .snow { fill: #c9d3de; }
.tip-art .dot { fill: #7cc4ff; fill-opacity: .7; }
.tip-art .coldb { fill: #7cc4ff14; stroke: #7cc4ff; stroke-width: 1.3; }
.tip-art .cold { fill: #7cc4ff; }
.tip-art .warmb { fill: #ff8a6a14; stroke: #ff8a6a; stroke-width: 1.3; }
.tip-art .warm { fill: #ff8a6a; }
.tip-art .scale { fill: #313b47; }
.tip-art .scale2 { fill: #4a5666; }
.tip-art .screen { fill: #11161c; }
.tip-art .screenb { fill: #7d8a99; }
.tip-art .gauge { stroke: #313b47; stroke-width: 7; }
.tip-art .lost { fill: #ffb54726; stroke: #ffb547; stroke-width: 1.4; stroke-dasharray: 3 2.5; }
.tip-art .dotb { fill: #7cc4ff; }
.tip-art .dotl { fill: #b9dcfa; }
.tip-art .dotd { fill: #5a6676; }
.tip-art text { font: 500 11px/1 Inter, "IBM Plex Sans", system-ui, sans-serif; fill: #aeb9c6; }
.tip-art .sm { font-size: 9.5px; }
.tip-art .ta { fill: #ffc56e; font-weight: 600; }
.tip-art .tb { fill: #8fceff; font-weight: 600; }
.tip-art .tc { fill: #d5dde6; font-size: 11.5px; }
.tip-art .tl { font-weight: 700; }
.tip-art .tcold { fill: #8fceff; font-weight: 600; }
.tip-art .twarm { fill: #ff9f85; font-weight: 600; }
.tip-art svg svg polygon { stroke: #0e141b; stroke-width: 1; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.tip-art .pg-shadow { fill: #000; opacity: .35; }
.pg-h { fill: hsl(36 100% calc(var(--l) - 30%)); }

/* ---------- Make your own plane (maker.js) ---------- */
.pf-make {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 32px; margin-top: 8px; padding: 0 11px;
  border: 1px dashed color-mix(in srgb, var(--c2) 60%, var(--line)); border-radius: 8px;
  background: color-mix(in srgb, var(--c2) 7%, var(--panel)); color: var(--c2);
  font: 600 13px/1 "IBM Plex Sans", system-ui, sans-serif; cursor: pointer;
}
.pf-make svg { width: 14px; height: 14px; flex: none; }
.pf-make:hover { background: color-mix(in srgb, var(--c2) 13%, var(--panel)); border-style: solid; }
.pf-make:focus-visible { outline: 2px solid var(--c2); outline-offset: 2px; }

.pg-card.pg-make { border-style: dashed; }
.pg-mk-o { fill: color-mix(in srgb, var(--c2) 8%, transparent); stroke: var(--c2); stroke-width: 2; stroke-dasharray: 6 5; stroke-linejoin: round; }
.pg-mk-l { stroke: var(--c2); stroke-width: 1.4; stroke-dasharray: 3 4; }
.pg-mk-d { fill: #ff9f1c; stroke: var(--panel); stroke-width: 2.5; }

.mk-sheet { width: min(1120px, 100%); }
.mk-body {
  flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(320px, 1fr); gap: 20px;
  padding: 16px 24px 20px;
}
.mk-fig { margin: 0 0 12px; padding: 8px 10px 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel-2); }
.mk-fig figcaption, .mk-res-k {
  color: var(--muted); font: 600 11.5px/1 "IBM Plex Sans", system-ui, sans-serif; letter-spacing: .07em; text-transform: uppercase;
}
.mk-fig figcaption { margin: 2px 2px 6px; }
.mk-svg { display: block; width: 100%; height: auto; touch-action: none; user-select: none; -webkit-user-select: none; }
.mk-top { max-height: min(56dvh, 500px); }
.mk-svg :is(line, path, polygon) { vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-linecap: round; }
.mk-grid { stroke: var(--line); stroke-width: .8; }
.mk-scale { stroke: var(--muted); stroke-width: 1.4; fill: none; }
.mk-scale-t { fill: var(--muted); font: 500 12px/1 "IBM Plex Sans", system-ui, sans-serif; }
.mk-wing { fill: var(--panel); stroke: var(--ink); stroke-width: 1.5; }
.mk-flap { fill: color-mix(in srgb, var(--c2) 30%, var(--panel)); stroke: var(--ink); stroke-width: 1.5; }
.mk-wl { fill: none; stroke: var(--ink); stroke-width: 2.5; }
.mk-keel { stroke: var(--ink); stroke-width: 2; }
.mk-keelf { fill: color-mix(in srgb, var(--ink) 16%, var(--panel)); stroke: var(--ink); stroke-width: 1.5; }
.mk-wingline { stroke: var(--ink); stroke-width: 3; }
.mk-guide { stroke: #ff9f1c; stroke-width: 1.5; stroke-dasharray: 4 4; }
.mk-h { cursor: grab; }
.mk-hit { fill: transparent; }
.mk-dot { fill: #ff9f1c; stroke: var(--panel); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.mk-h:hover .mk-dot, .mk-h.on .mk-dot { transform: scale(1.3); }
.mk-modal.dragging, .mk-modal.dragging .mk-h { cursor: grabbing; }

.mk-panel { min-width: 0; }
.mk-3d { border: 1px solid var(--line); border-radius: 12px; background: radial-gradient(ellipse at 50% 55%, var(--panel), var(--panel-2) 75%); }
.mk-3d svg { display: block; width: 100%; height: auto; max-height: 190px; }
.mk-from, .mk-name { display: flex; align-items: center; gap: 10px; margin: 12px 0 4px; }
.mk-from > span, .mk-name > span { flex: none; font-weight: 600; font-size: 14px; }
.mk-from select { flex: 1; min-width: 0; }
.mk-name input { flex: 1; min-width: 0; min-height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--ink); font: inherit; }
.mk-name input:focus-visible { outline: 2px solid var(--c2); outline-offset: 1px; }
.mk-sliders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2px 18px; margin-top: 8px; }
.mk-row.pf { margin: 0; padding: 7px 0; }
.mk-val { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mk-note { margin: 6px 0 0; color: var(--muted); font-size: 12.5px; }
.mk-warn {
  margin: 10px 0 0; padding: 8px 11px; border-radius: 9px; font-size: 13px; line-height: 1.4;
  color: var(--warn); background: color-mix(in srgb, var(--warn) 11%, var(--panel)); border: 1px solid color-mix(in srgb, var(--warn) 35%, transparent);
}

.mk-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 24px; border-top: 1px solid var(--line); background: var(--panel);
}
.mk-res { display: flex; align-items: center; gap: 18px; min-width: 0; }
.mk-res-l { display: grid; gap: 4px; }
.mk-res-v { font: 650 26px/1 Fraunces, Georgia, serif; font-variant-numeric: tabular-nums; }
.mk-res-s { display: flex; gap: 8px; align-items: baseline; font-size: 13px; font-weight: 600; min-height: 16px; }
.mk-delta.up { color: var(--good); }
.mk-delta.down { color: var(--bad); }
.mk-res.busy .mk-res-v, .mk-res.busy .mk-prof { opacity: .55; }
.mk-prof { width: 200px; height: 56px; flex: none; }
.mk-ground { stroke: var(--line); stroke-width: 1; }
.mk-before { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 3 3; }
.mk-now { fill: none; stroke: var(--c2); stroke-width: 2.2; stroke-linejoin: round; }
.mk-acts { display: flex; gap: 8px; flex: none; }

@media (width <= 860px) {
  .mk-body { grid-template-columns: minmax(0, 1fr); gap: 4px; padding: 12px 16px 16px; }
  .mk-top { max-height: 46dvh; }
}
@media (width <= 600px) {
  .mk-sheet { max-height: calc(100dvh - 12px); }
  .mk-sliders { grid-template-columns: minmax(0, 1fr); }
  .mk-foot { flex-wrap: wrap; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  .mk-res { width: 100%; justify-content: space-between; }
  .mk-prof { width: 150px; height: 42px; }
  .mk-acts { width: 100%; }
  .mk-acts .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: no-preference) {
  .pf-make { transition: background-color .15s ease; }
  .mk-dot { transition: transform .12s ease; }
}
