/* Look "D" (agreed 3 Nov 2026), loaded after theme.css. Less rigid than B3, same cockpit meanings.
 * Mix of three directions (canvas "Navlog GUI — less rigid", board D):
 *   - A: a progress line across the top (done = green tick, current = lime dot + lime name, to do = grey ring)
 *   - B: every step is a short checklist of soft panels; an item still open is outlined (amber = check,
 *        red = no-go, grey = to do) so it stands out; items that are done stay plain
 *   - C: limit bars: the value against the SOP limit (white tick), green within, red outside, with the
 *        numbers written next to the bar (never colour alone)
 * Softer shapes: 10 px on controls, 14 px on panels; space instead of lines between groups.
 * Rules: navlog-gui-rules skill (§7 colour, §8 shapes). Steps rebuilt so far: Weather & NOTAMs. */

:root { --r: 10px; --r-card: 14px; --ck-bg: var(--panel); --track: #2C333D; --ring: #5B6573; }
:root[data-theme=light] { --ck-bg: #FFFFFF; --track: #D9DDE3; --ring: #8A93A0; }

/* ---------- Progress line (every step, every screen) ---------- */
.phases { display: none !important; }
@media (min-width: 900px) { :root { --top-h: 133px; } .tb-steps .modebar { padding: 10px 28px 6px !important; } }
.steps, .tb-steps .steps { border: 0 !important; border-radius: 0; overflow: visible; background: none; position: relative; }
.steps button, .tb-steps .steps button {
  position: relative; flex-direction: column; flex-wrap: nowrap !important; justify-content: flex-start; align-content: center;
  row-gap: 6px; min-height: 60px; padding: 4px 2px 2px; border: 0 !important; background: transparent !important;
  box-shadow: none !important; color: var(--label2); font-weight: 400; z-index: 0;
}
/* the line: from the previous dot to this one, green once the previous step is done */
.steps button + button::before { content: ""; position: absolute; z-index: -1; top: 15px; height: 2px; left: calc(-50% + 16px); right: calc(50% + 16px); background: var(--track); }
.steps button.done + button::before { background: var(--ok); }
.steps .num, .tb-steps .steps .num {
  width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--ring); background: var(--bg); color: var(--label2);
  font-size: var(--fs-4); font-weight: 700; box-sizing: border-box; display: inline-flex; align-items: center; justify-content: center;
}
:root[data-theme=light] .steps button:not(.on):not(.done) .num { background: var(--panel); }
.steps button.done:not(.on) .num { background: var(--ok); border-color: var(--ok); color: transparent; font-size: 0; position: relative; }
.steps button.done:not(.on) .num::after { content: ""; position: absolute; left: 7px; top: 3.5px; width: 5px; height: 10px; border: solid #0E1114; border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); font-size: 0; }
.steps button.on .num { background: var(--tint); border-color: var(--tint); color: var(--on-tint); box-shadow: 0 0 0 4px color-mix(in srgb, var(--tint) 22%, transparent); }
.steps button.on { color: var(--tint-ink); font-weight: 700; }
:root[data-theme=light] .steps button.on { color: var(--navy); }
.steps button.done:not(.on) { color: var(--label); }
.steps .lbl { flex-basis: auto !important; }
/* a check / no-go sign only on steps you have reached; steps ahead show their number (nothing is wrong yet) */
.steps button.on ~ button .st { display: none !important; }
.steps button.on ~ button .num { display: inline-flex !important; }
.steps button:not(.on)[data-st=warn] .st, .steps button:not(.on)[data-st=bad] .st { background: var(--bg); border-radius: 50%; }
.steps .st svg { width: 24px; height: 24px; }
.steps button:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: var(--r); }
/* phones and the slim bar: dots on the line, only the current step named */
@media (max-width: 899px) {
  .steps, body.steps-mini .steps { grid-template-columns: repeat(6, minmax(0, 1fr)) !important; }
  .steps button, body.steps-mini .steps button { min-height: 48px; flex-direction: column; grid-column: auto !important; }
  .steps button:not(.on) .lbl { display: none; }
  .steps button.on .lbl { display: block; font-size: var(--fs-4); white-space: nowrap; }
  .steps button.on .lbl-x { display: none; }
  .steps button + button::before { top: 15px; }
  .plans-btn, .icon-btn.gear { min-height: 44px !important; border: 0 !important; background: transparent !important; box-shadow: none !important; }
  .steps button, body.steps-mini .steps button { min-width: 44px; padding-left: 0; padding-right: 0; }
}
@media (max-width: 520px) {
  .sheet .modebar { gap: 0 !important; padding-left: 6px !important; padding-right: 2px !important; }
  .steps, body.steps-mini .steps { flex: 1 1 auto; min-width: 264px; }
  .plans-btn { padding: 0 10px !important; }
  .icon-btn.gear { width: 44px !important; }
  .icon-btn.gear.on { color: var(--tint-ink); }
}

/* ---------- Softer controls ---------- */
.btn { border-radius: var(--r); }
.btn:not(.primary) { border-color: transparent; background: var(--fill2); }
.btn.ghost { background: transparent !important; border-color: transparent !important; }
.btn.primary { border-color: transparent; }
.topbar .btn, :root[data-theme=light] .topbar .btn { background: rgba(255, 255, 255, 0.12) !important; border-color: transparent !important; color: #FFFFFF !important; }
.field input, .field select { border-radius: 8px; }

/* ---------- Step head, look D: heading + task left, progress of the step right ---------- */
.dhead { display: flex; align-items: flex-end; gap: 20px; padding: 18px 0 12px; }
.dhead .grow { flex: 1; min-width: 0; }
.dhead h2 { margin: 2px 0 4px; font-size: var(--fs-1); line-height: 1.2; }
.dhead .step-task { margin: 0; }
.dhead .done-n { text-align: right; white-space: nowrap; }
.dhead .done-n b { font-size: var(--fs-1); font-variant-numeric: tabular-nums; }
.dhead .done-n span { font-size: var(--fs-2); color: var(--label2); }
.dhead .done-n small { display: block; font-size: var(--fs-4); color: var(--label2); }
@media (max-width: 899px) { .dhead { padding-top: 12px; } .dhead .step-task { display: none; } }

/* ---------- Checklist: one soft panel per item ---------- */
.cki-list { display: flex; flex-direction: column; gap: 10px; }
.cki { background: var(--ck-bg); border-radius: var(--r-card); border: 0 !important; }
:root[data-theme=light] .cki:not(.open-warn):not(.open-bad):not(.open-todo) { box-shadow: 0 0 0 1px var(--rule2); }
.cki.open-warn { box-shadow: inset 0 0 0 2px var(--warn); }
.cki.open-bad { box-shadow: inset 0 0 0 2px var(--bad); }
.cki.open-todo { box-shadow: inset 0 0 0 2px var(--ring); }
.cki-row { display: flex; align-items: center; gap: 10px; padding: 0 14px 0 0; }
.cki-tog { all: unset; box-sizing: border-box; flex: 1; min-width: 0; min-height: 60px; padding: 8px 4px 8px 16px; display: flex; align-items: center; gap: 14px; cursor: pointer; border-radius: var(--r-card); }
.cki-tog:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; }
@media (hover: hover) { .cki-tog:hover .cki-t { text-decoration: underline; text-underline-offset: 3px; } }
.cki-ic { width: 24px; height: 24px; flex: none; }
.cki-txt { flex: 1; min-width: 0; }
.cki-t { display: block; font-weight: 700; font-size: calc(var(--u) * 17 / 16); }
.cki-t.alt { color: var(--alt); }
.cki-s { display: block; font-size: var(--fs-3); color: var(--label2); overflow-wrap: anywhere; }
.cki-word { font-weight: 700; font-size: var(--fs-3); white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.cki-word.ok { color: var(--ok); } .cki-word.warn { color: var(--warn); } .cki-word.bad { color: var(--bad); } .cki-word.todo, .cki-word.info { color: var(--label2); }
.cki-word svg { width: 16px; height: 16px; }
.cki-chev { width: 20px; height: 20px; flex: none; color: var(--label2); transition: transform 160ms ease-out; }
.cki[data-open] .cki-chev { transform: rotate(90deg); }
.cki-row > .btn { flex: none; }
.cki-body { padding: 0 18px 16px 54px; display: flex; flex-direction: column; gap: 10px; }
.cki-body .mono { color: var(--label2); line-height: 1.5; overflow-wrap: anywhere; }
.cki-body .acts { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.cki-body .acts .src-line { margin-left: auto; }
.cki-body .src-line { font-size: var(--fs-4); color: var(--label2); }
.cki-body ul.cki-notes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.cki-body ul.cki-notes li { display: flex; gap: 8px; align-items: flex-start; font-size: var(--fs-3); }
.cki-body ul.cki-notes li svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.cki-body ul.cki-notes li.bad svg { color: var(--bad); } .cki-body ul.cki-notes li.warn svg { color: var(--warn); } .cki-body ul.cki-notes li.info svg { color: var(--label2); }
.cki-body .wxcharts, .cki-body .wx { border: 0 !important; padding: 0 !important; margin: 0 !important; }
.cki-body .field { width: 100%; }
@media (max-width: 899px) {
  .cki-row { padding-right: 10px; }
  .cki-tog { padding-left: 14px; gap: 12px; }
  .cki-body { padding: 0 14px 14px 14px; }
  .cki-chev { display: none; }
}
@media (prefers-reduced-motion: reduce) { .cki-chev { transition: none; } }

/* ---------- Limit bars: value against the SOP limit ---------- */
.lims { display: flex; flex-direction: column; gap: 2px; }
.lim { display: grid; grid-template-columns: 96px 1fr 136px; align-items: center; gap: 14px; min-height: 32px; }
.lim .k { font-size: var(--fs-3); font-weight: 400; color: var(--label2); }
.lim .bar { position: relative; height: 10px; border-radius: 5px; background: var(--track); }
.lim .bar i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 5px; background: var(--ok); }
.lim.bad .bar i { background: var(--bad); }
.lim.warn .bar i { background: var(--warn); } /* above a recommended maximum (P2008 headwind, Circular 26 03) */
.lim .bar b { position: absolute; top: -6px; bottom: -6px; width: 2px; margin-left: -1px; background: var(--label); }
.lim .v { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.lim.bad .v { color: var(--bad); }
.lim.warn .v { color: var(--warn); }
.lim .v span { font-weight: 400; color: var(--label2); }
.lim .w { display: none; }
.lim.bad .w, .lim.warn .w { display: block; grid-column: 2 / -1; font-size: var(--fs-4); color: var(--label2); margin-top: -2px; }
@media (max-width: 520px) { .lim { grid-template-columns: 74px 1fr 104px; gap: 10px; } .lim .v { font-size: var(--fs-3); } }

/* ---------- Weather step: full width, no chart, one centred column ---------- */
.sheet[data-mode=weather], .sheet[data-mode=weather] .sheet-body, .sheet[data-mode=weather] .action-bar { background: var(--bg) !important; }
:root[data-theme=light] .sheet[data-mode=weather], :root[data-theme=light] .sheet[data-mode=weather] .sheet-body,
:root[data-theme=light] .sheet[data-mode=weather] .action-bar { background: var(--bg) !important; }
@media (min-width: 900px) {
  body.full-panel .panel[data-panel=weather] { max-width: 920px; margin: 0 auto; }
  body.full-panel .panel[data-panel=weather] > .action-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}
.panel[data-panel=weather] > .action-bar { border-top: 0 !important; display: flex; align-items: center; gap: 12px; }
.panel[data-panel=weather] > .action-bar .grow { flex: 1; }
.panel[data-panel=weather] > .action-bar .open-n { font-size: var(--fs-3); color: var(--label2); }
.panel[data-panel=weather] > .action-bar .next-step { min-width: 220px; width: auto; }
.btn.back-text { background: transparent !important; padding: 0 10px 0 4px; gap: 4px; }
.btn.back-text svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
@media (max-width: 899px) {
  .panel[data-panel=weather] > .action-bar { display: grid !important; grid-template-columns: 52px 1fr; }
  .panel[data-panel=weather] > .action-bar .grow, .panel[data-panel=weather] > .action-bar .open-n { display: none; }
  .panel[data-panel=weather] > .action-bar .back-text { padding: 0; justify-content: center; background: var(--fill2) !important; }
  .panel[data-panel=weather] > .action-bar .back-text span { display: none; }
  .panel[data-panel=weather] > .action-bar .next-step { min-width: 0; width: 100%; }
}

/* ---------- Look E (3 Nov): one slim navy frame — plan + progress + Plans + Settings in one row ---------- */
.modebar { --track: #3A4F7A; --ring: #8FA0C0; --label2: #C9D3E6; --label: #FFFFFF; --bg: #00205D;
  --tint: #CCF003; --on-tint: #00205D; --tint-ink: #CCF003; background: #00205D !important; color: #FFFFFF; }
:root[data-theme=light] .modebar .steps button.on { color: #CCF003; }
:root[data-theme=light] .modebar .steps button:not(.on):not(.done) .num { background: #00205D; }
.modebar .steps button.done:not(.on) .num { border-color: var(--ok); }
.modebar .plans-btn, .modebar .icon-btn.gear { color: #FFFFFF !important; }
@media (min-width: 900px) {
  .topbar { grid-template-columns: minmax(150px, 230px) minmax(0, 1fr) auto auto !important; grid-template-rows: auto !important; column-gap: 14px !important;
    padding: var(--safe-t) 12px 0 20px !important; min-height: 64px; border-bottom: 0 !important; }
  .topbar .tb-plan { grid-column: 1; grid-row: 1; min-width: 0; }
  .topbar .tb-chips, .topbar .tb-grow { display: none !important; }
  .topbar #tbPlans { grid-column: 3; grid-row: 1; }
  .topbar #tbSettings { grid-column: 4; grid-row: 1; }
  .topbar .tb-steps { grid-column: 2; grid-row: 1; margin: 0 !important; background: transparent !important; min-width: 0; }
  .topbar .tb-steps .modebar { padding: 6px 0 4px !important; border: 0 !important; }
  .tb-steps .steps button { min-height: 54px; row-gap: 4px; font-size: var(--fs-4) !important; padding: 2px 0 0; }
  .tb-steps .steps .num { width: 22px; height: 22px; }
  .tb-steps .steps button + button::before { top: 12px; left: calc(-50% + 15px); right: calc(50% + 15px); }
  .tb-steps .steps button.done:not(.on) .num::after { left: 6.5px; top: 3px; }
  .tb-title { font-size: var(--fs-3) !important; overflow: hidden; text-overflow: ellipsis; }
  .tb-sub { font-size: var(--fs-4) !important; overflow: hidden; text-overflow: ellipsis; }
  .tb-sub .sig { font-size: var(--fs-4); gap: 4px; } .tb-sub .sig svg { width: 14px; height: 14px; }
  .tb-sub .sig.ok { color: #7FE0A0; } .tb-sub .sig.warn { color: #FFC34D; }
}
@media (min-width: 900px) and (max-width: 1100px) { .tb-steps .steps .lbl-x { display: none; } }
/* phones: the progress line sits in the same navy at the top of the sheet */
@media (max-width: 899px) { .sheet > .modebar { border-bottom: 0 !important; } }

/* ---------- Mission (look E) ---------- */
.ms-col { display: flex; flex-direction: column; gap: 12px; }
.ms-panel { background: var(--ck-bg); border-radius: var(--r-card); padding: 14px 18px; display: flex; flex-direction: column; gap: 10px; }
:root[data-theme=light] .ms-panel { box-shadow: 0 0 0 1px var(--rule2); }
.ms-panel h3 { margin: 0; font-size: var(--fs-2); font-weight: 700; display: flex; align-items: center; gap: 8px; }
.ms-panel h3 .grow { flex: 1; }
.ms-small { font-weight: 400; color: var(--label2); font-size: var(--fs-3); }
.ms-desc { margin: 0; font-size: var(--fs-3); color: var(--label2); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.ms-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; padding: 4px; border-radius: 12px; background: var(--ck-bg); }
.ms-seg button { min-height: 52px; border-radius: 9px; border: 0; background: transparent; color: var(--label2); font: 700 calc(var(--u) * 17 / 16) var(--font); cursor: pointer; }
.ms-seg button.on { background: var(--fill2); color: var(--label); box-shadow: inset 0 0 0 2px var(--tint); }
.ms-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.ms-chips button { min-height: 44px; padding: 0 16px 0 10px; border-radius: 22px; border: 0; background: var(--fill2); color: var(--label); font: 700 var(--fs-2) var(--font); display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.ms-chips button svg.tc-ic { width: 26px; height: 26px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ms-chips button.on { background: var(--tint); color: var(--on-tint); }
.ms-chips button.on .tc-ic .r, .ms-chips button.on .tc-ic .pt, .ms-chips button.on .tc-ic .ad, .ms-chips button.on .tc-ic .w, .ms-chips button.on .tc-ic .a { stroke: var(--on-tint); }
.ms-chips button.on .tc-ic .pt { fill: var(--on-tint); } .ms-chips button.on .tc-ic .ad { fill: none; }
.ms-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px 12px; }
.ms-grid.two { grid-template-columns: 1fr 1fr; }
.ms-grid .field { margin: 0; min-width: 0; }
.ms-two { display: grid; grid-template-columns: 1.2fr 1fr; gap: 12px; }
.ms-time { display: grid; grid-template-columns: 48px 1fr 48px; gap: 8px; align-items: stretch; }
.ms-time .btn { min-height: 52px; font-size: var(--fs-1); padding: 0; }
.ms-when { all: unset; box-sizing: border-box; cursor: pointer; border-radius: var(--r); background: var(--fill); padding: 6px 14px; display: flex; flex-direction: column; justify-content: center; min-height: 52px; }
.ms-when b { font-size: calc(var(--u) * 17 / 16); font-variant-numeric: tabular-nums; } .ms-when small { font-size: var(--fs-4); color: var(--label2); }
.ms-when:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.ms-more > summary { list-style: none; cursor: pointer; min-height: 44px; display: flex; align-items: center; gap: 8px; font-weight: 700; padding: 0 4px; }
.ms-more > summary::-webkit-details-marker { display: none; }
.ms-more > summary::before { content: "⋯"; font-size: 20px; color: var(--label2); }
.ms-more[open] { display: flex; flex-direction: column; gap: 10px; }
.solo-save.ms-panel { box-shadow: inset 0 0 0 2px var(--warn); }
@media (max-width: 760px) { .ms-two { grid-template-columns: 1fr; } }
@media (min-width: 900px) {
  body.full-panel .panel[data-panel=mission] { max-width: 920px; margin: 0 auto; }
  body.full-panel .panel[data-panel=mission] > .action-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}
.sheet[data-mode=mission], .sheet[data-mode=mission] .sheet-body, .sheet[data-mode=mission] .action-bar { background: var(--bg) !important; }
.panel[data-panel=mission] > .action-bar { border-top: 0 !important; display: flex; align-items: center; gap: 12px; }
.panel[data-panel=mission] > .action-bar .grow { flex: 1; }
.panel[data-panel=mission] > .action-bar .next-step { min-width: 260px; width: auto; }
/* "Start a new mission" (7 Nov): secondary button on the left, away from Next */
.panel[data-panel=mission] > .action-bar .ms-new { background: var(--fill2) !important; border: 0; min-height: 48px; gap: 8px; font-size: var(--fs-2); }
.panel[data-panel=mission] > .action-bar .ms-new svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.panel[data-panel=mission] > .action-bar .ms-new .short { display: none; }
@media (max-width: 599px) { .panel[data-panel=mission] > .action-bar .ms-new .long { display: none; } .panel[data-panel=mission] > .action-bar .ms-new .short { display: inline; } }
@media (max-width: 899px) { .sheet-body > .panel[data-panel=mission]:not([hidden]) > .action-bar { grid-template-columns: auto 1fr; } }
@media (max-width: 899px) { .panel[data-panel=mission] > .action-bar { display: grid !important; grid-template-columns: auto 1fr; } .panel[data-panel=mission] > .action-bar .grow { display: none; } .panel[data-panel=mission] > .action-bar .next-step { min-width: 0; width: 100%; } }

/* ---------- Route (look E): the mission's navlogs at the top ---------- */
.legs-box { display: flex; flex-direction: column; gap: 8px; padding: 6px 0 10px; }
.legs-k { font-size: var(--fs-4); font-weight: 700; color: var(--label2); }
.leg-chips { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.leg-chip { all: unset; box-sizing: border-box; cursor: pointer; min-height: 56px; border-radius: 12px; background: var(--fill2); padding: 6px 10px; display: flex; align-items: center; gap: 10px; }
.leg-chip .cki-ic { width: 20px; height: 20px; }
.leg-chip span { display: flex; flex-direction: column; min-width: 0; }
.leg-chip b { font-size: var(--fs-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.leg-chip small { font-size: var(--fs-4); color: var(--label2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* .leg-chip.on: the open navlog (user, 7 Nov): lime ring + lime shade, like the current step ("you are here"),
   plus the word "Open ·" (shape + colour + word). The 3 Nov "no highlight on legs" rule is about route legs on the chart. */
.leg-chip.on { background: var(--cur); box-shadow: inset 0 0 0 2px var(--tint); }
.leg-chip.on small { color: var(--label); }
.leg-chip:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.leg-line { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; }
.leg-line .field.cs { flex: 1 1 160px; margin: 0; }
.leg-line .btn.ghost { min-height: 44px; }
/* phones: steps that do not use the chart take the whole height (no chart strip, no time card above) */
@media (max-width: 899px) {
  body.panel-tall .sheet { border-radius: 0; padding-top: var(--safe-t); }
  body.panel-tall .timecard, body.panel-tall .rightcol, body.panel-tall #modeChip { visibility: hidden; }
  body.panel-tall .sheet .grabber { display: none; }
}
/* source tags ("SOP 2513 p.10") stay small text, with a 44 pt tap area around them */
.src-tag { position: relative; }
.src-tag::before { content: ""; position: absolute; inset: -14px -6px; }
/* phones: a button on a checklist row goes under the text, so the title keeps its width */
@media (max-width: 520px) {
  .cki-row { flex-wrap: wrap; }
  .cki-row > .btn, .cki-row > label.btn { margin: -4px 0 12px 50px; }
  .cki-row:has(> .btn) > .cki-tog, .cki-row:has(> label.btn) > .cki-tog { flex: 1 1 100%; }
}

/* ---------- Mission, look F: choices that open in place ---------- */
.ms-sec { display: flex; flex-direction: column; gap: 8px; }
.ms-sec > h3 { margin: 4px 4px 0; font-size: var(--fs-2); font-weight: 700; }
.ms-chips button { background: var(--panel); }
:root[data-theme=light] .ms-chips button { background: #FFFFFF; box-shadow: 0 0 0 1px var(--rule2); }
:root[data-theme=light] .ms-chips button.on { background: var(--tint); box-shadow: none; } /* was white on white: the light rule above hid the chosen type (fix 3 Nov) */
/* quiet "+" that reveals Single flight (7 Nov): no fill, faint outline, 44 pt target */
.ms-chips button.ms-more-type, :root[data-theme=light] .ms-chips button.ms-more-type { width: 44px; padding: 0; justify-content: center; background: transparent; box-shadow: inset 0 0 0 1px var(--rule2); color: var(--label3, var(--label2)); }
.ms-chips button.ms-more-type svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.ms-detail { box-shadow: inset 0 0 0 2px var(--tint) !important; }
.ms-dhead { display: flex; align-items: center; gap: 10px; font-size: calc(var(--u) * 17 / 16); }
.ms-dhead .tc-ic { width: 28px; height: 28px; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ms-detail .ms-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 220px)); }
/* who flies: the chosen option grows and shows its callsign; the other stays a full button */
.ms-who { display: flex; gap: 8px; align-items: stretch; }
.ms-opt { flex: 0.22 1 0; min-width: 92px; display: flex; align-items: center; gap: 14px; border-radius: 12px; background: var(--panel); transition: background 160ms; overflow: hidden; } /* no width animation: it wrapped the callsign fields for a moment (visual bug 1, 10 Nov) */
:root[data-theme=light] .ms-opt { background: #FFFFFF; box-shadow: 0 0 0 1px var(--rule2); }
.ms-opt.on { flex-grow: 1; background: var(--fill2); box-shadow: inset 0 0 0 2px var(--tint); padding-right: 14px; }
:root[data-theme=light] .ms-opt.on { background: #FFFFFF; box-shadow: inset 0 0 0 2px var(--tint); }
.ms-opt-b { all: unset; box-sizing: border-box; cursor: pointer; min-height: 64px; padding: 0 14px; display: flex; align-items: center; justify-content: center; gap: 10px; font-weight: 700; font-size: var(--fs-2); color: var(--label2); white-space: nowrap; flex: 1 0 auto; }
.ms-opt.on .ms-opt-b { color: var(--label); font-size: calc(var(--u) * 17 / 16); flex: 0 0 auto; cursor: default; }
.ms-opt-b:focus-visible { outline: 2px solid var(--tint); outline-offset: -2px; border-radius: 12px; }
.ms-dot { width: 18px; height: 18px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--ring); flex: none; }
.ms-opt.on .ms-dot { background: var(--tint); box-shadow: inset 0 0 0 4px var(--fill2); }
:root[data-theme=light] .ms-opt.on .ms-dot { box-shadow: inset 0 0 0 4px #FFFFFF; }
.ms-csbox { display: none; flex: 1 1 auto; min-width: 0; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 8px 0; }
.ms-opt.on .ms-csbox { display: flex; }
.ms-csbox .ms-cs { margin: 0; flex: 1 1 140px; min-width: 120px; max-width: 220px; }
.ms-next { font-size: var(--fs-4); color: var(--label2); white-space: nowrap; }
.ms-opt .short { display: none; }
@media (max-width: 620px) {
  .ms-opt { min-width: 92px; }
  .ms-opt:not(.on) .long { display: none; } .ms-opt:not(.on) .short { display: inline; }
  .ms-opt.on { flex-wrap: wrap; column-gap: 10px; padding: 4px 12px 12px 12px; }
  .ms-opt.on .ms-opt-b { padding: 0 2px; justify-content: flex-start; }
  .ms-opt.on .ms-opt-b { min-height: 48px; }
  .ms-csbox { flex-basis: 100%; padding: 0; }
  .ms-csbox .ms-cs { flex-basis: 100px; max-width: none; }
  .ms-next { flex-basis: 100%; white-space: normal; }
}
@media (prefers-reduced-motion: reduce) { .ms-opt { transition: none; } }
/* every step except Route: the whole screen, one centred column (Navlog keeps its wide table) */
@media (min-width: 900px) {
  body.full-panel .panel[data-panel=mb], body.full-panel .panel[data-panel=brief], body.full-panel .panel[data-panel=settings] { max-width: 920px; margin: 0 auto; }
}
@media (max-width: 520px) { .ms-detail .ms-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) {
  .ms-opt.on .ms-csbox { display: grid; grid-template-columns: 1fr 1fr; }
  .ms-opt.on .ms-csbox .ms-next { grid-column: 1 / -1; }
  .ms-opt.on .ms-csbox .ms-cs { min-width: 0; }
}

/* ---------- 3 Nov, 16:20 fixes ---------- */
/* ticks centred in the done dots (step bar, navy frame) */
.steps button.done:not(.on) .num::after, .tb-steps .steps button.done:not(.on) .num::after {
  left: 50% !important; top: 46% !important; width: 5px; height: 10px; transform: translate(-50%, -50%) rotate(45deg) !important; }
/* triangular: Base on the left, centred between the rows; trip A on top, trip B below */
.ms-tri { display: grid; grid-template-columns: repeat(3, minmax(0, 220px)); gap: 10px 12px; }
.ms-tri .tri-base { grid-row: 1 / 3; align-self: center; }
.ms-tri .field { margin: 0; min-width: 0; }
@media (max-width: 520px) { .ms-tri { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; } }
/* Fields on the new screens: label above, one 48 pt box (was label inside a ~66 pt box) */
.ms-panel .field, .ms-sec .field, .cki-body .field { display: flex; flex-direction: column; gap: 4px; padding: 0 !important; border: 0 !important; background: none !important; min-height: 0; }
/* the box is the input itself: no thin focus line around label + box (4 Nov, user: Mission callsign) — the input keeps its own focus ring */
.ms-panel .field:focus-within, .ms-sec .field:focus-within, .cki-body .field:focus-within { box-shadow: none !important; }
.ms-panel .field > span, .ms-sec .field > span, .cki-body .field > span { font-size: var(--fs-4); font-weight: 700; color: var(--label2); padding: 0 2px; }
.ms-panel .field input, .ms-panel .field select, .ms-sec .field input, .ms-sec .field select, .cki-body .field input {
  min-height: 48px; height: 48px; box-sizing: border-box; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--line); background: var(--fill);
  color: var(--label); font: 700 var(--fs-2) var(--font); width: 100%; }
.ms-panel .field select, .ms-sec .field select { -webkit-appearance: none; appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath d='M5 8l5 5 5-5' fill='none' stroke='%23AEB6C1' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 18px; }
.ms-panel .field input:focus-visible, .ms-panel .field select:focus-visible, .ms-sec .field input:focus-visible, .ms-sec .field select:focus-visible { outline: 2px solid var(--tint); outline-offset: 1px; }
/* who flies: thinner — the option is as tall as its content (button 52, field 48) */
.ms-opt-b { min-height: 52px; }
.ms-csbox { padding: 6px 0; }
@media (max-width: 620px) { .ms-opt.on { padding: 2px 12px 10px 12px; } .ms-opt.on .ms-opt-b { min-height: 44px; } }
.fa-card:focus { outline: none; }

/* Selection (bug fix 3 Nov): no highlight on legs, in the route list or on the chart. Only the selected
 * point is marked: its number dot gets the lime ring (navy in light mode), in the list and on the chart. */
.rt-table tbody tr.sel .wpn { box-shadow: 0 0 0 3px var(--tint); }
.wpt-marker.sel { box-shadow: 0 0 0 3px #CCF003, 0 0 0 5px #0E1114; }
:root[data-theme=light] .wpt-marker.sel { box-shadow: 0 0 0 3px #00205D, 0 0 0 5px #FFFFFF; }

/* ---------- Step 5 · M&B & performance and step 6 · Briefing in look D (3 Nov) ---------- */
.sheet[data-mode=mb], .sheet[data-mode=mb] .sheet-body, .sheet[data-mode=mb] .action-bar,
.sheet[data-mode=brief], .sheet[data-mode=brief] .sheet-body, .sheet[data-mode=brief] .action-bar { background: var(--bg) !important; }
@media (min-width: 900px) {
  body.full-panel .panel[data-panel=mb], body.full-panel .panel[data-panel=brief] { max-width: 920px; margin: 0 auto; }
  body.full-panel .panel:is([data-panel=mb], [data-panel=brief]) > .action-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; }
}
.panel:is([data-panel=mb], [data-panel=brief]) > .action-bar { border-top: 0 !important; display: flex; align-items: center; gap: 12px; }
.panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .grow { flex: 1; }
.panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .open-n { font-size: var(--fs-3); color: var(--label2); }
.panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .next-step { min-width: 220px; width: auto; }
@media (max-width: 899px) {
  .panel[data-panel=mb] > .action-bar { display: grid !important; grid-template-columns: 52px 1fr; }
  .panel[data-panel=brief] > .action-bar { display: grid !important; grid-template-columns: 52px 1fr 1.3fr; }
  .panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .grow, .panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .open-n { display: none; }
  .panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .back-text { padding: 0; justify-content: center; background: var(--fill2) !important; }
  .panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .back-text span { display: none; }
  .panel:is([data-panel=mb], [data-panel=brief]) > .action-bar .next-step, .panel[data-panel=brief] > .action-bar .btn { min-width: 0; width: 100%; }
}
/* hide the old M&B summary bar and hint above the panel: the step head carries the figures now */
.sheet[data-mode=mb] #mbSummary, .sheet[data-mode=mb] #mbHint { display: none !important; }
.mb-legs { margin: 0 0 12px; }
/* performance / loading fields: label above, 48 pt box, the source under it */
.pf-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.pf-grid.pf6 { grid-template-columns: repeat(auto-fill, minmax(116px, 1fr)); }
/* M&B · Aircraft: type names are long ("Tecnam P2008 JC"), so two wide fields; one above the other on phones */
.pf-grid.pf-ac { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); max-width: 560px; }
@media (max-width: 520px) { .pf-grid, .pf-grid.pf6 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .pf-grid.pf-ac { grid-template-columns: 1fr; } }
.cki-body .field.pf select { min-height: 48px; height: 48px; box-sizing: border-box; padding: 0 30px 0 12px; border-radius: var(--r); border: 1px solid var(--line); background-color: var(--fill); color: var(--label); font: 700 var(--fs-2) var(--font); width: 100%; }
.cki-body .field.pf input:disabled { opacity: 1; color: var(--label2); background: transparent; }
.field.pf > em { font-style: normal; font-size: var(--fs-4); color: var(--label2); padding: 0 2px; line-height: 1.35; }
.field > em.hint { font-style: normal; font-size: var(--fs-4); color: var(--label2); padding: 0 2px; line-height: 1.35; }
.field.pf.manual input, .field.pf.manual select { border-style: dashed !important; border-width: 2px !important; border-color: var(--label2) !important; }
.field.pf > em.man { color: var(--label); font-weight: 700; }
.field.pf .ins-pick { margin-top: 4px; min-height: 44px; }
.linkbtn { all: unset; cursor: pointer; color: var(--label); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; padding: 12px 2px; margin: -12px 0; display: inline-block; line-height: 20px; }
.linkbtn:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; border-radius: 4px; }
.pf-line { font-size: var(--fs-3); color: var(--label2); }
/* no METAR: the reason for "Check" in the same orange (user, 11 Nov) */
.pf-nomet { font-weight: 700; margin: 0 0 8px; }
.cki-s .sub-warn { color: var(--warn); font-weight: 700; }
.pf-line b { color: var(--label); }
.sec-k { font-size: var(--fs-4); font-weight: 700; color: var(--label2); margin-top: 4px; }
.mono.sheet-wx { font-size: var(--fs-3); }
.warn-text { color: var(--warn); font-size: var(--fs-3); }
/* C.G. bar: the band between the limits, the dot = the C.G. */
.lim.cg .bar em { position: absolute; top: 0; bottom: 0; border-radius: 5px; background: var(--ok); opacity: 0.45; }
.lim.cg.bad .bar em { background: var(--bad); }
.lim.cg .bar i.dot { position: absolute; top: 50%; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 2px var(--ck-bg); right: auto; bottom: auto; }
.lim.cg.bad .bar i.dot { background: var(--bad); }
.lim.cg .v { white-space: nowrap; line-height: 1.2; }
.lim.cg .v small { display: block; font-weight: 400; font-size: var(--fs-4); color: var(--label2); }
.lim { grid-template-columns: 112px 1fr 170px; }
@media (max-width: 520px) { .lim { grid-template-columns: 84px 1fr 118px; } }
/* the runway seen from above, next to the distance bars */
.rw-row { display: grid; grid-template-columns: 200px 1fr; gap: 20px; align-items: center; }
@media (max-width: 620px) { .rw-row { grid-template-columns: 1fr; justify-items: center; } .rw-figs { width: 100%; } }
svg.rwy { width: 200px; height: auto; display: block; }
svg.rwy .rose { fill: none; stroke: var(--rule, #2A313B); stroke-width: 1; }
svg.rwy .rose-t { stroke: var(--label2); stroke-width: 1.5; }
svg.rwy .rose-n { fill: var(--label); font: 700 13px var(--font); }
svg.rwy .asph { fill: #3A4049; }
:root[data-theme=light] svg.rwy .asph { fill: #4A515B; }
svg.rwy .cl { stroke: #FFFFFF; stroke-width: 1.4; stroke-dasharray: 7 6; opacity: .7; }
svg.rwy .rn { fill: var(--label); font: 700 13px var(--font); }
svg.rwy .ugr { fill: #3DB565; }
svg.rwy .u50 { fill: none; stroke: #3DB565; stroke-width: 2.4; }
svg.rwy .ugr.over { fill: var(--bad); } svg.rwy .u50.over { stroke: var(--bad); }
svg.rwy .rx { stroke: var(--bad); stroke-width: 3; stroke-linecap: round; fill: none; }
svg.rwy .dir { stroke: #FFFFFF; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.rw-figs { display: grid; gap: 6px; font-variant-numeric: tabular-nums; }
.rf { display: grid; grid-template-columns: 22px 1fr auto minmax(84px, max-content); align-items: baseline; gap: 8px; font-size: var(--fs-2, 1rem); }
.rf b { text-align: right; }
.rf-s { font-weight: 700; } .rf.ok .rf-s, .rf.ok .rf-w { color: #3DB565; } .rf.bad .rf-s, .rf.bad .rf-w { color: var(--bad); }
.rf-w { white-space: nowrap; font-size: var(--fs-4, .8125rem); color: var(--label2); }
.rf.avail { border-top: 1px solid var(--rule, #2A313B); padding-top: 6px; }
.rf-k { width: 16px; height: 10px; border-radius: 2px; background: #3A4049; align-self: center; }
.rf-src { font-size: var(--fs-4, .8125rem); color: var(--label2); line-height: 1.4; }
:root[data-theme=light] .rf.ok .rf-s, :root[data-theme=light] .rf.ok .rf-w, :root[data-theme=light] svg.rwy .ugr { color: #1E7A3E; fill: #1E7A3E; }
:root[data-theme=light] svg.rwy .u50 { stroke: #1E7A3E; }
svg.rwy .rw-wind line, svg.rwy .rw-wind path { stroke: var(--label2); stroke-width: 2; fill: none; stroke-linecap: round; }
/* "Sheet figures": one tap deeper, in place */
details.cki-more > summary { list-style: none; display: inline-flex; align-items: center; min-height: 44px; cursor: pointer; }
details.cki-more > summary::-webkit-details-marker { display: none; }
details.cki-more[open] > summary { margin-bottom: 8px; }
details.cki-more .nl-wrap { overflow-x: auto; }
/* downloads under the list */
/* Briefing: the Briefing List numbers as section labels between the items */
.br-sec { font-size: var(--fs-3); font-weight: 700; color: var(--label2); margin: 10px 2px -2px; }
.br-sec:first-child { margin-top: 0; }
.br-ad { display: flex; flex-direction: column; gap: 4px; }
.br-ad .alt-t, .alt-t { color: var(--alt); }
.br-foot { margin-top: 14px; }
.br-foot .refresh-card { background: var(--ck-bg); border-radius: var(--r-card); border: 0 !important; }
.cki.sep-made { margin-top: 12px; }
.br-src { margin: 10px 2px 0; font-size: var(--fs-4); color: var(--label2); }
.cki-body ul.issues { margin: 0; }
.br-foot .group { margin: 0 !important; border-radius: var(--r-card); padding: 4px 4px 4px 0; }
.br-foot .refresh-card .row { min-height: 60px; }
/* go / no-go items inside an open checklist item: plain rows, the sign carries the colour (no tinted fills) */
.cki-body ul.issues li { background: var(--fill) !important; border: 0 !important; }
.cki-body ul.issues li.bad .ic { color: var(--bad); } .cki-body ul.issues li.warn .ic { color: var(--warn); }
@media (max-width: 899px) {
  .sheet-body > .panel[data-panel=brief]:not([hidden]) > .action-bar { grid-template-columns: 52px minmax(0, 1fr) minmax(0, 1.4fr); }
  .sheet-body > .panel[data-panel=brief]:not([hidden]) > .action-bar .btn { min-width: 0; width: 100%; padding-left: 8px; padding-right: 8px; }
}
@media (max-width: 520px) { .wide-only { display: none; } }
.phone-only { display: none; }
@media (max-width: 520px) { .phone-only { display: inline; } }

/* Review fix 1 (4 Nov): "Fix leg N · name" — a leg with no ground speed (wind stronger than the TAS).
   Outlined red like an open no-go item; opens the point (wind, level, TAS) to fix it. */
.fix-legs { display: flex; flex-direction: column; gap: 8px; margin: 12px 0 4px; }
.btn.fix-leg { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; font-size: 16px; text-align: left; box-shadow: inset 0 0 0 2px var(--bad); color: var(--label); }
.btn.fix-leg svg { width: 20px; height: 20px; flex: none; color: var(--bad); }
.btn.fix-leg .go { margin-left: auto; color: var(--label2); }
.fix-panel { margin: 12px 0 16px; padding: 14px 16px; border-radius: 14px; box-shadow: inset 0 0 0 2px var(--bad); background: var(--fill2); }
.fix-head { display: flex; gap: 10px; align-items: flex-start; font-size: 16px; line-height: 1.4; color: var(--label); }
.fix-head .sig { flex: none; display: inline-flex; gap: 6px; align-items: center; color: var(--bad); font-weight: 700; } .fix-head .sig svg { width: 20px; height: 20px; }
.fix-panel .fix-legs { margin: 12px 0 0; }
.fix-panel .btn.fix-leg { box-shadow: none; background: var(--ctl); }

/* ---------- Tier 1 to-do fixes (7 Nov) ---------- */
/* #1 · the open screen's button is lit in the frame: Settings on Settings, Plans while its menu is open
   (lime = "you are here", the same as the current step) */
.topbar .btn.on, :root[data-theme=light] .topbar .btn.on,
.modebar .plans-btn.on, .modebar .icon-btn.gear.on { background: #CCF003 !important; color: #0E1114 !important; border-color: #CCF003 !important; }
.modebar .plans-btn.on, .modebar .icon-btn.gear.on { border-radius: 12px; }
/* #3 · content scrolling under the bottom bar fades out instead of being cut by a hard edge
   (light mode: the white Aircraft / Take-off boxes looked like they overlapped the bar) */
.panel:is([data-panel=mission], [data-panel=weather], [data-panel=mb], [data-panel=brief], [data-panel=settings]) > .action-bar::before {
  content: ""; position: absolute; left: 0; right: 0; top: -20px; height: 20px; pointer-events: none;
  background: linear-gradient(to bottom, transparent, var(--bg));
}
/* #4 · no chart flash before Mission on start-up: hidden until the first screen is laid out */
body.booting #map, body.booting .timecard, body.booting .rightcol, body.booting #modeChip,
body.booting #profileDock, body.booting .panel-toggle, body.booting .panel-resize, body.booting #sheet { visibility: hidden !important; }
body.booting { background: var(--bg); }
/* #5 · Full screen on the navlog sheet: icon + word */
.ss-bar .ss-full, .ss-bar .ss-ur { display: inline-flex; align-items: center; gap: 6px; }
.ss-bar .ss-full svg, .ss-bar .ss-ur svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
/* #6 · Mission checks reads as a button: shaded, outlined, with a chevron */
.leg-line .mchecks-btn { min-height: 48px; padding: 0 12px 0 14px; gap: 8px; display: inline-flex; align-items: center;
  background: var(--fill2) !important; border: 1px solid var(--rule) !important; border-radius: 12px; font-weight: 700; }
.leg-line .mchecks-btn .chev { font-size: 22px; line-height: 1; color: var(--label2); margin-left: 2px; }
.leg-line .mchecks-btn:active { filter: brightness(0.92); }
/* To do #17 · Mission checks: each navlog's own warnings, under a heading that opens that navlog */
#routeDlg .mchecks-k { margin: 16px 0 6px; }
#routeDlg .mchecks-leg { display: flex; width: 100%; min-height: 48px; align-items: center; justify-content: space-between; gap: 8px; margin: 10px 0 4px; padding: 0 12px 0 14px;
  background: var(--fill2) !important; border: 1px solid var(--rule) !important; border-radius: 12px; font-weight: 700; text-align: left; }
#routeDlg .mchecks-leg .chev { font-size: 22px; line-height: 1; color: var(--label2); }
/* Route (wide screens): Back / Next stay at the bottom of the panel even when the list is short
   (user, 7 Nov: "it should be locked at the bottom of that section"); long lists still scroll under it (sticky) */
@media (min-width: 900px) {
  .sheet[data-step=route] .sheet-body { display: flex; flex-direction: column; }
  .sheet[data-step=route] .sheet-body > .panel[data-panel=route]:not([hidden]) { flex: 1 0 auto; display: flex; flex-direction: column; }
  .sheet[data-step=route] .panel[data-panel=route] > .action-bar { margin-top: auto; }
}
/* To do #14 · the route being built: last point's row marked in the route colour, then a "next point" row */
.rt-table tbody tr.building td { background: color-mix(in srgb, var(--route) 14%, transparent); }
.rt-table tbody tr.building td.n { box-shadow: inset 4px 0 0 var(--route); }
.rt-table.alt tbody tr.building td { background: color-mix(in srgb, var(--alt) 14%, transparent); }
.rt-table.alt tbody tr.building td.n { box-shadow: inset 4px 0 0 var(--alt); }
.rt-table tbody tr.rt-next { cursor: default; }
.rt-table tbody tr.rt-next td { height: 48px; color: var(--label2); font-weight: 400; font-size: 14px; border-bottom: 1px dashed var(--rule); }
.rt-table tbody tr.rt-next td.p b { color: var(--label); font-weight: 700; }
.rt-table tbody tr.rt-next .wpn { background: transparent; border: 2px dashed var(--route); color: var(--label2); }
.rt-table.alt tbody tr.rt-next .wpn { border-color: var(--alt); }
/* To do #20 · live aircraft mass under the loading fields */
.mb-live { margin: 4px 0 8px; }
.mb-live .src-line { margin-top: 4px; }
/* To do #19 · "Just the M&B" card at the top of Mission */
.ms-mbonly { margin-bottom: 4px; }
.ms-mbcard { width: 100%; min-height: 64px; display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 14px; border: 1px solid var(--rule); background: var(--fill2); color: var(--label); font: inherit; text-align: left; cursor: pointer; }
.ms-mbcard svg.tc-ic { width: 30px; height: 30px; flex: none; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.ms-mbcard .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ms-mbcard b { font-size: var(--fs-2); }
.ms-mbcard small { font-size: var(--fs-3, 14px); color: var(--label2); }
.ms-mbcard .chev { font-size: 24px; color: var(--label2); }
.ms-mbcard.on { border: 2px solid var(--tint); }
/* To do #18 · Route: "Main route done" and "Now: alternate" */
.rt-stage { display: flex; align-items: center; gap: 10px; margin: 10px 0 6px; padding: 10px 14px; background: var(--fill2); border-radius: 0; }
.rt-stage .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-2); }
.rt-stage small { font-size: var(--fs-3); color: var(--label2); }
.rt-stage small .sig { display: inline-flex; vertical-align: -3px; }
.rt-stage.done { border-left: 4px solid var(--route); }
.rt-stage.now { border-left: 4px solid var(--alt); background: color-mix(in srgb, var(--alt) 12%, var(--fill2)); }
.rt-stage.now b { color: var(--alt); }
/* Bottom bar edges (user, 7 Nov, light mode): at some display scalings the card borders scrolling under the
   bar showed as thin lines at its left and right edges (the cards are exactly as wide as the bar, and the
   fractional pixel leaked). The bar's background (and its fade) now reaches 6 px past each side. */
.panel:is([data-panel=mission], [data-panel=weather], [data-panel=mb], [data-panel=brief], [data-panel=settings]) > .action-bar::before { left: -6px; right: -6px; }
.panel:is([data-panel=mission], [data-panel=weather], [data-panel=mb], [data-panel=brief], [data-panel=settings]) > .action-bar::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: -6px; right: -6px; background: var(--bg); z-index: -1; pointer-events: none;
}

/* Settings · Appearance: compact Dark / Light pair beside the title (user, 7 Nov); 44 pt targets kept */
.group-title .theme-seg { flex: 0 0 auto; min-width: 0; }
.group-title .theme-seg button { min-width: 72px; padding: 0 14px; }

/* Raw METAR / TAF (user, 7 Nov): their own box, a shade off the panel with a thin rule, so they stand out
   slightly from the limit bars and notes. Neutral colours only (no route / status meaning). */
.wx-raw { background: var(--fill2); border: 1px solid var(--rule2, var(--line)); border-radius: 10px; padding: 8px 12px; margin: 8px 0; }
.wx-raw-k { font-size: var(--fs-4); font-weight: 700; color: var(--label2); margin-top: 6px; }
.wx-raw-k:first-child { margin-top: 0; }
/* report times beside METAR / TAF (user, 9 Nov, AeroWeather-style but discreet) */
.wx-age { font-weight: 400; color: var(--label2); font-variant-numeric: tabular-nums; }
.wx-age.old { color: var(--warn-ink); font-weight: 600; }
.wx-age-b { display: block; font-size: var(--fs-4); margin-top: 2px; }
.cki-body .wx-raw .mono, .wx-raw .mono { color: var(--label); }

/* Step numbers (user, 7 Nov): B612 digits sit ~1 px high in the 24 px ring — nudge them to the optical centre */
.steps .num, .tb-steps .steps .num { line-height: 1; padding-top: 1px; }
.steps button.done:not(.on) .num { padding-top: 0; }

/* ---------- Settings in look D (7 Nov) ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; align-items: end; }
.set-grid .set-note { align-self: center; margin: 0; }
.set-note { margin: 0; font-size: var(--fs-4); color: var(--label2); line-height: 1.45; }
.set-sig-head { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.set-list .sig-pad { width: 100%; max-width: 560px; height: auto; aspect-ratio: 900 / 260; border-radius: var(--r); border: 1px dashed var(--line); background: #fff; touch-action: none; }
.set-ins { display: grid; grid-template-columns: minmax(0, 1fr) 120px auto; gap: 10px; align-items: end; }
.set-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.set-about { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: var(--fs-3); }
.set-list .cki-row > .theme-seg { flex: none; display: inline-flex; min-width: 0; }
.set-list .cki-row > .theme-seg button { min-width: 72px; padding: 0 14px; }
.set-list .help, .set-list .fb { display: flex; flex-direction: column; gap: 10px; }
.set-list .fb .row, .set-list .help .row { padding: 0; }
.set-list .fb-intro-row { align-items: flex-start; gap: 10px; }
.set-list .fb .field textarea { min-height: 120px; border-radius: var(--r); border: 1px solid var(--line); background: var(--fill); color: var(--label); font: 400 var(--fs-2) var(--font); padding: 10px 12px; width: 100%; box-sizing: border-box; }
.set-list .fb .field select { min-height: 48px; border-radius: var(--r); border: 1px solid var(--line); background: var(--fill); color: var(--label); font: 700 var(--fs-2) var(--font); padding: 0 12px; width: 100%; }
.set-kept { font-weight: 400; }
@media (max-width: 600px) {
  .set-grid { grid-template-columns: 1fr; }
  .set-ins { grid-template-columns: minmax(0, 1fr) 96px; }
  .set-ins .btn { grid-column: 1 / -1; justify-self: start; }
  .set-list .cki-row > .theme-seg { margin: -4px 0 12px 50px; }
  .set-kept { display: none; }
}

/* ---------- Feedback on actions (7 Nov): small, quick, never in the way ---------- */
/* a press is felt: buttons and tappable rows dip slightly while held */
.btn, .cki-tog, .leg-chip, .ms-chips button, .ms-mbcard, .type-card, .segmented button { transition: transform 90ms ease-out, filter 90ms ease-out, background-color 120ms ease-out; }
.btn:active:not(:disabled), .ms-chips button:active, .ms-mbcard:active, .leg-chip:active, .type-card:active { transform: scale(0.97); }
.cki-tog:active { filter: brightness(1.08); }
:root[data-theme=light] .cki-tog:active { filter: brightness(0.96); }
/* an item that has just turned done: its sign pops once */
.cki.just-done .cki-ic { animation: ckPop 420ms cubic-bezier(.2, 1.4, .4, 1); }
@keyframes ckPop { 0% { transform: scale(.6); } 60% { transform: scale(1.15); } 100% { transform: scale(1); } }
/* a step that has just been ticked on the step bar */
.just-done-step .ring, .just-done-step svg { animation: ckPop 420ms cubic-bezier(.2, 1.4, .4, 1); }
/* a toast that changes while shown pops again, so a new message is noticed */
.toast.again { animation: toastAgain 260ms ease-out; }
@keyframes toastAgain { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.05); } 100% { transform: translateX(-50%) scale(1); } }
/* a value that just changed (fuel, mass, times) flashes its background briefly */
.val-flash { animation: valFlash 700ms ease-out; border-radius: 4px; }
@keyframes valFlash { 0% { background: color-mix(in srgb, var(--tint) 35%, transparent); } 100% { background: transparent; } }
/* saved: a small tick next to "Saved on this device" */
.save-tick { display: inline-block; animation: ckPop 420ms cubic-bezier(.2, 1.4, .4, 1); color: var(--ok); }

/* ---------- PDF progress (7 Nov) ---------- */
.pdf-prog { position: fixed; left: 50%; bottom: calc(var(--safe-b, 0px) + 92px); transform: translateX(-50%); z-index: 2100; width: min(420px, 92vw);
  padding: 12px 16px 14px; border-radius: 16px; background: var(--panel); color: var(--label); box-shadow: 0 10px 30px rgba(0,0,0,.35), 0 0 0 1px var(--line);
  font: 700 var(--fs-3) var(--font); animation: ppIn 200ms ease-out; }
@keyframes ppIn { from { opacity: 0; transform: translate(-50%, 8px); } }
.pdf-prog .pp-top { display: flex; align-items: baseline; gap: 10px; }
.pdf-prog .pp-top span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pdf-prog .pp-top small { font-weight: 400; color: var(--label2); font-variant-numeric: tabular-nums; }
.pdf-prog .pp-bar { margin-top: 8px; height: 6px; border-radius: 3px; background: var(--fill2); overflow: hidden; }
.pdf-prog .pp-bar i { display: block; height: 100%; width: 0; border-radius: 3px; background: var(--tint); transition: width 240ms ease-out; }
.pdf-prog.done .pp-bar i { background: var(--ok); }
@media (prefers-reduced-motion: reduce) {
  .btn, .cki-tog, .leg-chip, .ms-chips button, .ms-mbcard, .type-card, .segmented button { transition: none; }
  .btn:active:not(:disabled), .ms-chips button:active, .ms-mbcard:active, .leg-chip:active, .type-card:active { transform: none; }
  .cki.just-done .cki-ic, .just-done-step .ring, .just-done-step svg, .toast.again, .val-flash, .save-tick, .pdf-prog { animation: none; }
  .pdf-prog .pp-bar i { transition: none; }
}

/* ---------- Separate files by leg (to do #25, 7 Nov) ---------- */
.cki.sep-made .sep-body { padding: 14px 18px; gap: 12px; }
.sep-head { display: flex; align-items: center; gap: 12px; }
.sep-head .grow { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.sep-group { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.sep-ghead { display: flex; align-items: center; gap: 10px; padding: 10px 0 4px; } .sep-ghead .grow { flex: 1; }
.sep-ghead b { font-size: var(--fs-2); }
.sep-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.sep-row + .sep-row { border-top: 1px solid var(--rule2, var(--line)); }
.sep-row .grow { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.sep-row .sep-name { color: var(--label2); font-size: var(--fs-4); overflow-wrap: anywhere; word-break: normal; }
@media (max-width: 600px) { .sep-head { flex-wrap: wrap; } .sep-head .btn { width: 100%; } }
/* Settings: same page and bottom bar as M&B / Briefing (7 Nov) */
.sheet[data-mode=settings], .sheet[data-mode=settings] .sheet-body, .sheet[data-mode=settings] .action-bar { background: var(--bg) !important; }
@media (min-width: 900px) { body.full-panel .panel[data-panel=settings] > .action-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; } }
.panel[data-panel=settings] > .action-bar { border-top: 0 !important; display: flex; align-items: center; gap: 12px; }
.panel[data-panel=settings] > .action-bar .grow { flex: 1; }
.panel[data-panel=settings] > .action-bar .open-n { font-size: var(--fs-3); color: var(--label2); white-space: nowrap; }
.set-sig-head b { flex: 1; }
@media (max-width: 899px) {
  .panel[data-panel=settings] > .action-bar .back-text { background: var(--fill2) !important; }
}
.set-list .fb .row, .set-list .help .row, .set-list .fb .fb-attach { border: 0 !important; }
.set-list .cki-body > .btn.small, .set-list .help-actions .btn { align-self: flex-start; width: auto; }
.set-list .cki-row:has(> .theme-seg) > .cki-tog { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) { .set-list .cki-row > .theme-seg { margin: 0; } .set-list .cki-row:has(> .theme-seg) { flex-wrap: nowrap; } }
@media (max-width: 600px) { .set-list .cki-row > .theme-seg button { min-width: 64px; padding: 0 12px; } }

/* ---- Vertical profile (7 Nov, #15 / #37): view tools, resizable box, 44 pt targets ---- */
.prof-tools { display: flex; gap: 6px; align-items: center; flex: none; }
.prof-tools .btn { min-height: 44px; min-width: 44px; padding: 0 12px; font-variant-numeric: tabular-nums; }
.prof-tools .btn.icon-only { padding: 0; font-size: 20px; line-height: 1; }
.prof-tools .btn[data-pact=span] { min-width: 112px; }
.prof-tools .btn:disabled { opacity: 0.38; }
.panel[data-panel=profile] .prof-tools { margin: 4px 0 10px; flex-wrap: wrap; }
.panel[data-panel=profile] .prof-tools .btn[data-pact=span] { flex: 1; }
.panel[data-panel=profile] .profile-panel { height: min(340px, 42vh); }
.prof-tall .panel[data-panel=profile] .profile-panel { height: min(460px, 58vh); }
.prof-help { color: var(--label2); }
.dock-grip { display: none; }
@media (min-width: 900px) {
  :root { --dock-open-h: 240px; --dock-h: var(--dock-open-h); }
  .profile-collapsed { --dock-h: 52px; }
  .profile-head { height: auto; min-height: 52px; padding: 4px 4px 0 12px; gap: 4px 8px; flex-wrap: wrap; }
  .profile-head .profile-title { order: 0; }
  .profile-head .prof-tools { order: 1; margin-left: auto; }
  .profile-head #altStepBtn { order: 2; min-height: 44px; }
  .profile-head .prof-tall-btn { order: 3; }
  .profile-head #profileToggle { order: 4; }
  .profile-head .profile-info { order: 5; flex: 1 0 100%; padding-bottom: 2px; }
  .profile-dock.collapsed .profile-info { display: none; }
  .profile-dock .icon-btn { width: 44px; height: 44px; }
  .profile-dock .prof-tall-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .prof-tall .profile-dock .prof-tall-btn { color: var(--tint); }
  :root[data-theme=light].prof-tall .profile-dock .prof-tall-btn { color: var(--route); }
  .profile-dock { overflow: visible; }
  .profile-body { overflow: hidden; border-radius: 0 0 var(--r) var(--r); }
  .dock-grip { display: block; position: absolute; left: 50%; top: -12px; transform: translateX(-50%); width: 120px; height: 24px; cursor: ns-resize; touch-action: none; z-index: 2; }
  .dock-grip::after { content: ''; position: absolute; left: 38px; right: 38px; top: 9px; height: 6px; border-radius: 3px; background: var(--label2); opacity: 0.7; }
  .dock-grip:hover::after, .dock-grip:focus-visible::after, body.resizing .dock-grip::after { background: var(--tint); opacity: 1; }
  .profile-dock.collapsed .dock-grip, .profile-dock.collapsed .prof-tools, .profile-dock.collapsed .prof-tall-btn,
  .profile-dock.no-route .prof-tools, .profile-dock.no-route .prof-tall-btn { display: none; }
}
@media (min-width: 900px) and (max-width: 1100px) {
  .profile-dock .prof-tools .btn[data-pact=out], .profile-dock .prof-tools .btn[data-pact=in] { display: none; }
}

/* ---- Profile, calmer (8 Nov, SkyDemon-like): quiet view buttons ---- */
.prof-tools .btn { background: transparent; border-color: transparent; box-shadow: none; color: var(--label2); }
.prof-tools .btn:not(:disabled):hover, .prof-tools .btn:not(:disabled):focus-visible { color: var(--label); background: var(--ctl); }
.prof-tools .btn[data-pact=span] { color: var(--label); border: 1px solid var(--rule); }
.profile-head .profile-info { color: var(--label2); }
.profile-head .profile-info.warn { color: var(--warn); }

/* ---- Profile, SkyDemon-like strip (8 Nov, user's reference): no header row, no info line ---- */
@media (min-width: 900px) {
  :root { --dock-open-h: 170px; }
  .profile-collapsed { --dock-h: 44px; }
  .profile-dock { overflow: visible; }
  .profile-body { position: relative; padding: 0; flex: 1; min-height: 0; border-radius: 0 0 var(--r) var(--r); overflow: hidden; }
  .profile-dock:not(.collapsed) .profile-head {
    /* a small tab on top of the strip's right corner, so nothing covers the profile itself */
    position: absolute; z-index: 3; bottom: calc(100% + 6px); right: 0; min-height: 0; height: auto; padding: 2px; gap: 2px; flex-wrap: nowrap;
    background: var(--bg); border: 1px solid var(--rule); border-radius: 12px;
  }
  .profile-dock:not(.collapsed) .profile-title, .profile-dock .profile-info { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .profile-dock .prof-tools .btn[data-pact=out], .profile-dock .prof-tools .btn[data-pact=in] { display: none; }
  .profile-dock .profile-head .btn, .profile-dock .profile-head .icon-btn { min-height: 40px; min-width: 40px; height: 40px; }
  .profile-dock .prof-tools .btn[data-pact=span] { min-width: 72px; }
  .profile-dock #altStepBtn { background: transparent; border-color: transparent; color: var(--label2); padding: 0 8px; }
  .profile-dock.collapsed .profile-head { height: 44px; min-height: 44px; padding: 0 4px 0 12px; }
  .profile-dock.collapsed .profile-body { display: none; }
}
@media (min-width: 900px) {
  /* map attribution / zoom controls sit above the profile's tab */
  html:not(.profile-collapsed) .leaflet-bottom { bottom: calc(var(--dock-h) + 66px); }
  html:not(.profile-collapsed) .chip { bottom: calc(var(--dock-h) + 72px + var(--safe-b)); }
  .profile-dock:not(.collapsed) .dock-grip { left: 40%; }
}

/* ---- Chart kept clear (8 Nov): time chip, hint only on an empty route, credits behind (i), profile buttons inside the box ---- */
/* Take-off time: one chip, top left of the chart; the picker opens on a tap */
.timecard {
  left: calc(var(--panel-x) + 12px); transform: none; width: auto;
  max-width: calc(100vw - var(--panel-x) - var(--rc-w, 76px) - 48px);
  padding: 0; gap: 0; border-radius: var(--r); border: 1px solid transparent;
}
.timecard.warn { border-color: var(--warn); }
.time-chip {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 14px 0 10px; max-width: 100%;
  background: none; border: 0; border-radius: var(--r); color: var(--label); font: inherit; cursor: pointer;
  white-space: nowrap; overflow: hidden; font-variant-numeric: tabular-nums;
}
.time-chip:focus-visible { outline: 2px solid var(--tint); outline-offset: 2px; }
.time-chip .cal { flex: none; width: 22px; height: 22px; fill: none; stroke: var(--tint); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme=light] .time-chip .cal { stroke: var(--route); }
.time-chip .time-main { font-size: var(--fs-2); font-weight: 700; }
.time-chip .time-sub { display: inline; font-size: var(--fs-3); color: var(--label2); }
.time-chip .time-warn { font-size: var(--fs-3); font-weight: 700; color: var(--warn); overflow: hidden; text-overflow: ellipsis; }
.time-chip .time-warn::before { content: '▲ '; }
.time-chip .time-warn[hidden] { display: none; }
@media (max-width: 899px) { .timecard { left: 12px; } }
@media (max-width: 520px) { .time-chip .time-sub { display: none; } .time-chip .time-warn { font-size: 0; } .time-chip .time-warn::before { font-size: var(--fs-3); } }
.td-sun { font-variant-numeric: tabular-nums; }

/* Map credits: shown at start, then behind the (i) button (OSMF Attribution Guidelines) */
#map:not(.credits-open) .leaflet-control-attribution { display: none; }
.credits-btn {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 0; padding: 0; margin: 0 6px 4px 0 !important; position: relative;
  font: 700 13px/1 'B612', sans-serif; font-style: italic; color: var(--label2);
}
.credits-btn::before {
  content: ''; position: absolute; inset: 10px; border-radius: 50%; z-index: -1;
  background: var(--bg); border: 1px solid var(--rule);
}
.credits-btn[aria-expanded=true] { color: var(--label); }
.leaflet-control-attribution { margin: 0 !important; }

@media (min-width: 900px) {
  /* profile view buttons: a row inside the box (title left, buttons right), nothing sticking out above it */
  .profile-dock:not(.collapsed) .profile-head {
    position: static; height: 40px; min-height: 40px; padding: 0 2px 0 12px; gap: 2px;
    background: none; border: 0; border-radius: 0; flex: none;
  }
  .profile-dock:not(.collapsed) .profile-title { position: static; width: auto; height: auto; overflow: visible; clip: auto; font-size: var(--fs-4); font-weight: 700; color: var(--label2); }
  .profile-dock .profile-head .btn, .profile-dock .profile-head .icon-btn { min-height: 40px; height: 40px; }
  /* the map's corner controls and the hint sit just above the box again */
  /* the box sits 12 px + the safe area above the bottom edge: clear all of it (open or collapsed), + 8 px */
  /* the box sits 12 px + the safe area above the bottom edge: clear all of it (open or collapsed), + 6 px */
  .leaflet-bottom, html:not(.profile-collapsed) .leaflet-bottom { bottom: calc(var(--dock-h) + 18px + var(--safe-b)); }
  html:not(.profile-collapsed) .chip { bottom: calc(var(--dock-h) + 28px + var(--safe-b)); }
}
/* phones / portrait: the credit and its (i) sit just above the sheet (they were hidden under it) */
@media (max-width: 899px) { .leaflet-bottom { bottom: calc(var(--sheet-h, 200px) + 8px); transition: bottom 280ms; } }
/* Profile open / collapse button: same place in both states, the far right of the box (user, 8 Nov).
   Collapsed: only "Profile" and that button (the 500 ft step does nothing while the profile is hidden). */
@media (min-width: 900px) {
  .profile-dock #profileToggle { margin-left: auto; }
  .profile-dock:not(.collapsed) .prof-tools ~ #profileToggle, .profile-dock:not(.collapsed) #profileToggle { margin-left: 0; }
  .profile-dock.collapsed #altStepBtn { display: none; }
  .profile-dock.collapsed .profile-head { padding-right: 2px; }
}
.ss-bar .ss-ur:disabled { opacity: .45; }
.ss-bar .ss-ur { min-width: 44px; justify-content: center; padding: 0 10px; }

/* ---------- #36 option A (8 Nov): the navlog sheet as its own screen under the navy frame ---------- */
.nl-sheet { width: 100vw !important; box-shadow: none; }
@media (min-width: 900px) { .nl-sheet { top: calc(64px + var(--safe-t, 0px)); padding-top: 0; } }
.ss-bar { flex-wrap: nowrap; gap: 8px; padding: 8px 14px; min-height: 60px; }
.ss-bar > b { white-space: nowrap; }
.ss-bar .ss-back { min-height: 44px; font-weight: 700; padding: 0 10px 0 4px; background: transparent !important; border-color: transparent !important; white-space: nowrap; }
.ss-key { font-size: var(--fs-4); color: var(--label2); white-space: nowrap; }
.ss-more-wrap { position: relative; }
.ss-menu { position: absolute; right: 0; top: calc(100% + 6px); z-index: 5; width: 260px; padding: 10px; background: #FFFFFF; border: 1px solid var(--rule2); border-radius: 12px; box-shadow: 0 8px 24px rgba(0,0,0,.18); }
.ss-menu .btn.danger { color: #C4170C !important; font-weight: 700; width: 100%; justify-content: center; min-height: 44px; }
.ss-menu p { margin: 8px 2px 0; font-size: var(--fs-4); color: var(--label2); line-height: 1.4; }
.ss-scroll { padding: 12px; background: var(--bg); }
.ss-form { transform-origin: 0 0; margin: 0 auto; }
.ss-form:not(.stack) .ss-halves { flex-wrap: nowrap; }
.ss-form.stack .ss-halves { flex-direction: column; }
.ss-grid tr.sel td { background: #E6EAF2; }
.ss-grid tr.sel td:first-child { box-shadow: inset 4px 0 0 #00205D; }
.ss-foot { display: flex; align-items: center; gap: 12px; padding: 8px 14px calc(8px + var(--safe-b, 0px)); background: #FFFFFF; border-top: 1px solid var(--rule2); min-height: 60px; }
.ss-foot .ss-sel { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ss-foot .grow { flex: 1; }
.ss-foot .ss-note { padding: 0; border: 0; background: none; font-size: var(--fs-4); color: var(--label2); text-align: right; max-width: 60ch; }
@media (max-width: 700px) { .ss-foot .ss-note { display: none; } .ss-bar > b { display: none; } }

@media (max-width: 1050px) { .ss-key { display: none; } }
@media (max-width: 899px) { .ss-bar > b { display: none; } }
@media (max-width: 520px) { .ss-bar { flex-wrap: wrap; } .ss-bar .segmented { order: 2; } }
.ss-form.stack .ss-head { min-width: 0; table-layout: fixed; } .ss-form.stack .ss-head td:not(.lb):not(.ttl) { min-width: 0; } .ss-form.stack .ss-head td.lb { white-space: normal; font-size: 11px; line-height: 1.1; }
.ss-form.stack .ss-grid { width: 100%; } .ss-form.stack .ss-halves > * { width: 100%; }

/* ---------- Wind on the Route map (8 Nov): a dark chip, readable on any map background ---------- */
.wind-chip { position: absolute; transform: translate(-50%, 18px); display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 6px;
  background: rgba(21, 26, 32, .94); color: #FFFFFF; border: 1.5px solid #FFFFFF; border-radius: 9px; box-shadow: 0 1px 4px rgba(0,0,0,.45);
  font: 700 13px/1 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none; }
.wind-chip svg { width: 20px; height: 20px; transform: rotate(var(--r)); fill: none; stroke: #FFFFFF; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.wind-chip span { font-weight: 400; color: #DDE3EA; }

/* ---------- Plans page (#35, 8 Nov): like Settings, one centred column of soft rows ---------- */
body.full-panel .panel[data-panel=plans] { max-width: 920px; margin: 0 auto; }
.sheet[data-mode=plans], .sheet[data-mode=plans] .sheet-body, .sheet[data-mode=plans] .action-bar { background: var(--bg) !important; }
@media (min-width: 900px) { body.full-panel .panel[data-panel=plans] > .action-bar { margin-left: 0; margin-right: 0; padding-left: 0; padding-right: 0; } }
.panel[data-panel=plans] > .action-bar { border-top: 0 !important; display: flex; align-items: center; gap: 12px; }
.panel[data-panel=plans] > .action-bar .grow { flex: 1; }
.panel[data-panel=plans] > .action-bar .open-n { font-size: var(--fs-3); color: var(--label2); }
@media (max-width: 899px) { .panel[data-panel=plans] > .action-bar .back-text { background: var(--fill2) !important; } }
.pl-tools { display: flex; align-items: center; gap: 10px; margin: 4px 0 14px; flex-wrap: wrap; }
.pl-tools .grow { flex: 1; }
.pl-tools .btn { min-height: 48px; }
.pl-count { font-size: var(--fs-2); }
.pl-search { margin-bottom: 10px; }
.pl-q { position: relative; display: block; }
.pl-q svg { position: absolute; left: 14px; top: 50%; width: 20px; height: 20px; transform: translateY(-50%); fill: none; stroke: var(--label2); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.pl-q input { width: 100%; min-height: 48px; padding: 0 14px 0 44px; border-radius: 10px; border: 1px solid var(--rule2, #3A424D); background: var(--ctl); color: var(--label); font: 400 var(--fs-2) var(--font); }
.pl-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.pl-chip { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1.5px solid transparent; background: var(--ctl); color: var(--label); font: 400 var(--fs-3) var(--font); cursor: pointer; }
.pl-chip.on { border-color: var(--label); font-weight: 700; background: var(--panel, #151A20); }
.pl-sort { margin-left: auto; }
.pl-list { display: grid; gap: 8px; }
.pl-item { position: relative; display: flex; align-items: stretch; background: var(--panel, #151A20); border-radius: 14px; }
:root[data-theme=light] .pl-item { border: 1px solid #CDD2DA; }
.pl-item.cur { box-shadow: inset 0 0 0 1.5px var(--label2); }
.pl-item.sel { box-shadow: inset 0 0 0 2px var(--bad); }
.pl-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 6px 10px 14px; background: none; border: 0; color: inherit; text-align: left; font: inherit; cursor: pointer; border-radius: 14px; }
.pl-main:disabled { cursor: default; opacity: .55; }
.pl-main:focus-visible { outline: 3px solid var(--focus, #CCF003); outline-offset: -3px; }
.pl-ico { flex: none; width: 40px; height: 40px; border-radius: 10px; background: var(--ctl); display: grid; place-items: center; font: 700 var(--fs-4) var(--font); color: var(--label2); }
.pl-ck { flex: none; width: 28px; height: 28px; margin: 0 6px; border-radius: 8px; border: 2px solid var(--label2); display: grid; place-items: center; }
.pl-ck.on { background: var(--bad); border-color: var(--bad); }
.pl-ck.off { border-style: dashed; }
.pl-ck svg { width: 18px; height: 18px; fill: none; stroke: #FFFFFF; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pl-txt { flex: 1; min-width: 0; display: grid; gap: 3px; }
.pl-txt b { font-size: 1.0625rem; font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pl-txt small { font-size: var(--fs-3); color: var(--label2); font-variant-numeric: tabular-nums; }
.pl-now { flex: none; font-size: var(--fs-4); font-weight: 700; color: var(--label2); padding: 4px 8px; border-radius: 8px; background: var(--ctl); }
.pl-more-wrap { position: relative; display: flex; align-items: center; padding-right: 6px; }
.pl-more { min-width: 48px; min-height: 48px; font-size: 22px; line-height: 1; letter-spacing: 1px; background: transparent !important; border-color: transparent !important; }
.pl-menu { position: absolute; right: 6px; top: calc(100% - 4px); z-index: 6; display: grid; gap: 6px; width: 200px; padding: 8px; border-radius: 12px; background: var(--raised, #1A2028); border: 1px solid var(--rule2, #3A424D); box-shadow: 0 10px 28px rgba(0,0,0,.35); }
.pl-menu .btn { justify-content: flex-start; min-height: 44px; width: 100%; }
.pl-menu .btn.danger { border-color: transparent; font-weight: 700; }
.pl-empty { padding: 24px 18px; border-radius: 14px; background: var(--panel, #151A20); }
.pl-empty p { margin: 6px 0 0; color: var(--label2); }
.btn.inline { display: inline; min-height: 0; padding: 0; text-decoration: underline; }
.pl-files { display: flex; flex-wrap: wrap; gap: 10px; }
.pl-files .btn { min-height: 48px; }
.btn.danger-fill { background: var(--bad) !important; border-color: var(--bad) !important; color: #FFFFFF !important; font-weight: 700; min-height: 48px; padding: 0 18px; }
.btn.danger-fill:disabled { opacity: .45; }
@media (max-width: 899px) {
  .panel:is([data-panel=plans], [data-panel=settings]) > .action-bar .back-text { padding: 0; justify-content: center; }
  .panel:is([data-panel=plans], [data-panel=settings]) > .action-bar .back-text span { display: none; }
}
.pl-now-s { display: none; }
@media (max-width: 600px) {
  .pl-now { display: none; }
  .pl-now-s { display: inline; font-weight: 700; color: var(--label); }
  .pl-main { gap: 10px; padding-left: 10px; }
  .pl-ico { width: 34px; height: 34px; }
}

/* ---- Profile: live level while dragging (visual bug 8, 10 Nov) — guide line + value beside the finger ---- */
.profile-panel, .profile-body { position: relative; }
.prof-read { position: absolute; inset: 0; pointer-events: none; z-index: 2; --c: var(--route); }
.prof-read.alt { --c: var(--alt); }
.prof-read[hidden] { display: none; }
.prof-read i { position: absolute; left: var(--l); right: var(--r); top: var(--y); height: 0; border-top: 1.5px solid var(--c); opacity: 0.9; }
.prof-read b { position: absolute; top: var(--y); transform: translate(-100%, -50%); padding: 4px 8px; border-radius: 8px; background: var(--c); color: #0C0F13; font: 700 var(--fs-2)/1.2 var(--font); font-variant-numeric: tabular-nums; white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.35); }
.prof-read b.right { transform: translate(0, -50%); }
:root[data-theme=light] .prof-read b { color: #fff; } /* contrast ≥ 4.5:1 on the darker light-mode route / alternate colours */

/* ---- Briefing · D: departure / arrival briefing reminders from the aircraft SOP (visual bug 12) ---- */
.br-ad.bt { gap: 6px; margin-bottom: 10px; }
.bt-when { font-size: var(--fs-3); color: var(--label2); }
.bt-part { margin-top: 2px; }
.bt-h { font-weight: 700; font-size: var(--fs-3); display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.bt-src { font-weight: 400; font-size: var(--fs-4); color: var(--label2); }
.bt ul { margin: 2px 0 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; line-height: 1.45; }
/* a blank for the student to prepare: an empty line with a quiet hint of what goes there */
.bt-blank { display: inline-block; min-width: 72px; padding: 0 4px; margin: 0 2px; border-bottom: 1.5px dashed var(--label2); color: var(--label2); font-size: var(--fs-4); line-height: 1.3; }
.bt-circ { display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 6px; border: 1px solid var(--warn); color: var(--warn); font-size: var(--fs-4); font-weight: 700; white-space: nowrap; }

/* ---- Route: adding-points mode (user, 10 Nov, SkyDemon-style) ---- */
/* tag above the last point: off = quiet, on = lime (what you are working on now) */
.add-tag { position: absolute; transform: translate(-50%, calc(-100% - 18px)); white-space: nowrap; padding: 3px 8px; border-radius: 8px; font: 700 13px/1.2 var(--font); background: rgba(255,255,255,0.95); color: #1a1f27; border: 1.5px solid var(--route); box-shadow: 0 1px 4px rgba(0,0,0,0.3); pointer-events: none; }
.add-tag.alt { border-color: var(--alt); }
.add-tag.on { background: #CCF003; color: #00205D; border-color: #00205D; }
:root[data-theme=light] .add-tag.on { background: #00205D; color: #fff; border-color: #00205D; }
#modeChip.adding { background: #CCF003 !important; color: #00205D; border-color: #00205D; } /* .glass sets the background with !important */
#modeChip.adding .dot { background: #00205D; }
:root[data-theme=light] #modeChip.adding { background: #00205D !important; color: #fff; }
:root[data-theme=light] #modeChip.adding .dot { background: #fff; }
#modeChip { max-width: min(560px, calc(100vw - 24px)); white-space: normal; height: auto; min-height: 34px; padding: 7px 14px; line-height: 1.3; text-align: center; }

/* ---- 10 Nov (v160): key figures beside the heading instead of a strip of boxes (user: "one number uses a
 * giant section"). Route on wide screens: totals beside "Route", tabs + Undo / Redo / More on one row (as
 * portrait and phones already do), "Main route done" on one line — the points list gets the height. ---- */
.step-head.has-side { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 12px; align-items: end; }
.step-head.has-side .step-task { grid-column: 1 / -1; }
.step-side { text-align: right; font-variant-numeric: tabular-nums; padding-bottom: 4px; }
.step-side b { display: block; font-size: calc(var(--u) * 17 / 16); white-space: nowrap; }
.step-side small { display: block; font-size: var(--fs-4); color: var(--label2); }
.step-side .ok { color: var(--ok); } .step-side .bad { color: var(--bad); }
.rt-stage.done { padding: 8px 14px; margin: 6px 0; }
.rt-stage.done > small { white-space: nowrap; }
@media (min-width: 900px) {
  .panel[data-panel=route] .rt-bar { flex-wrap: nowrap; padding: 10px 0 8px; }
  .panel[data-panel=route] .rt-tabs { flex: 1 1 auto; min-width: 0; }
  .panel[data-panel=route] .rt-tabs button { padding: 0 6px; gap: 6px; min-width: 0; }
  .panel[data-panel=route] .rt-tabs .long, .panel[data-panel=route] .rt-st .w, .panel[data-panel=route] .rt-tools .long { display: none; }
  .panel[data-panel=route] .rt-tabs .short { display: inline; }
  .panel[data-panel=route] .rt-tools { flex: none; gap: 6px; }
  .panel[data-panel=route] .rt-tools .grow { display: none; }
  .panel[data-panel=route] .rt-tools .btn[data-act=undo], .panel[data-panel=route] .rt-tools .btn[data-act=redo] { padding: 0; width: 44px; justify-content: center; }
}
/* Navlog & fuel: boxes on tablets and wider, one line on phones (upright or on their side) */
.nl-top .step-side { display: none; }
@media (max-width: 599px), (max-height: 500px) {
  .nl-top .step-side { display: block; }
  .nl-top > .figs { display: none; }
  .nl-top .step-head.has-side .step-ttl { grid-column: 1 / -1; }
  .nl-top .step-side { grid-column: 1 / -1; text-align: left; padding: 2px 0 0; }
  .nl-top .step-head .step-task { display: none; }
}
/* Phones: a long Next label ("Next: plan the alternate from LERJ →") ran 8 px off the screen — the column may
 * shrink and the label wraps inside the 52 pt button. */
@media (max-width: 899px) {
  /* Route only: the same rule for every panel (v160) took the Briefing bar's three columns and Mission's own (fixed v162) */
  .sheet-body > .panel[data-panel=route]:not([hidden]) > .action-bar:has(> .back-step) { grid-template-columns: 52px minmax(0, 1fr); }
  .action-bar .next-step { min-width: 0; white-space: normal; line-height: 1.2; }
}
/* ---- M&B files (to do #26, v160): one soft panel, a row per file (sign · title · result · word · PDF) ---- */
.mb-files { margin-top: 14px; padding: 12px 16px 14px; }
.mbf-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding-bottom: 6px; }
.mbf-head b { font-size: calc(var(--u) * 17 / 16); }
.mbf-head span { margin-left: auto; font-size: var(--fs-4); color: var(--label2); }
.mbf-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--rule); }
.mbf-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; font-size: var(--fs-2); }
.mbf-row .grow b.alt { color: var(--alt); }
.mbf-row small { font-size: var(--fs-3); color: var(--label2); }
.mbf-row .btn { flex: none; min-height: 44px; min-width: 64px; }
.mbf-row .sig { flex: none; }
.mbf-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding-top: 10px; border-top: 1px solid var(--rule); }
.mbf-foot .src-line { flex: 1 1 220px; font-size: var(--fs-4); color: var(--label2); }
.mbf-foot .btn { flex: none; min-height: 48px; margin-left: auto; }
@media (max-width: 599px) { .mbf-row .cki-word { display: none; } }
/* ---- Privacy page (to do #12, v160) ---- */
.pv-short { padding: 14px 18px; }
.pv-short b { font-size: calc(var(--u) * 17 / 16); }
.pv-p { margin: 6px 0 0 !important; font-size: var(--fs-3) !important; color: var(--label) !important; max-width: 70ch; }
.pv-list { margin: 8px 0 0; padding-left: 20px; font-size: var(--fs-3); line-height: 1.45; max-width: 70ch; }
.pv-list li { margin: 6px 0; }
.pv-list i { font-style: normal; color: var(--label2); }
.setup-priv { margin: 10px 0 0; font-size: var(--fs-4); color: var(--label2); text-align: center; }
/* ---- What is here: press-and-hold card (to do #43, v161). Information = white / grey; raised sheet. ---- */
.here-ring { position: absolute; left: -11px; top: -11px; width: 22px; height: 22px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 2px #0C0F13, inset 0 0 0 2px #0C0F13; pointer-events: none; }
.here-card { position: fixed; z-index: 4000; width: min(360px, calc(100vw - 16px)); overflow: auto; -webkit-overflow-scrolling: touch; background: var(--raised, var(--panel)); color: var(--label); border: 1px solid var(--rule); border-radius: 14px; padding: 10px 14px 12px; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35); font-size: var(--fs-2); }
.here-card.sheet-like { left: 0; right: 0; bottom: 0; width: auto; max-height: 62vh; border-radius: 14px 14px 0 0; padding-bottom: calc(12px + var(--safe-b, 0px)); }
.hc-head { display: flex; align-items: center; gap: 8px; }
.hc-head h3 { flex: 1; min-width: 0; margin: 0; font-size: calc(var(--u) * 17 / 16); line-height: 1.25; }
.hc-head .btn { flex: none; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
.hc-sub { font-size: var(--fs-4); color: var(--label2); font-variant-numeric: tabular-nums; padding-bottom: 6px; }
.hc-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px solid var(--rule); }
.hc-row .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.hc-row small { font-size: var(--fs-3); color: var(--label2); }
.hc-row small.hc-notam { color: var(--label); font-family: 'B612 Mono', ui-monospace, monospace; overflow-wrap: anywhere; }
.hc-freq { flex: none; font-weight: 700; font-variant-numeric: tabular-nums; }
.hc-you { flex: none; font-size: var(--fs-4); font-weight: 700; color: var(--route); border: 1.5px solid var(--route); border-radius: 8px; padding: 1px 6px; white-space: nowrap; }
.hc-sec { font-size: var(--fs-4); font-weight: 700; color: var(--label2); padding: 10px 0 4px; border-top: 1px solid var(--rule); }
.hc-sec + .hc-row { border-top: 0; padding-top: 0; }
.hc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px solid var(--rule); }
.hc-foot .src-line { flex: 1 1 160px; font-size: var(--fs-4); color: var(--label2); }
.hc-foot .btn { flex: none; min-height: 44px; margin-left: auto; }

/* Destination guide (11 Nov, mockups/M-dest-guide.png): tag at the target aerodrome, chip at the chart edge when it is off it */
.dest-tag { position: absolute; transform: translate(22px, -50%); white-space: nowrap; padding: 3px 8px; border-radius: 8px; font: 700 13px/1.2 var(--font); background: rgba(255,255,255,0.95); color: #1a1f27; border: 2px solid var(--route); box-shadow: 0 1px 4px rgba(0,0,0,0.35); pointer-events: none; }
.dest-tag.alt { border-color: var(--alt); }
.dest-chip { position: absolute; z-index: 800; min-height: 44px; padding: 0 14px; border-radius: 22px; border: 2px solid var(--route); background: #00205D; color: #fff; font: 700 14px/1 var(--font); white-space: nowrap; box-shadow: 0 2px 8px rgba(0,0,0,0.4); cursor: pointer; }
.dest-chip.alt { border-color: var(--alt); }
.dest-chip[hidden] { display: none; }
/* iPad / iPhone: the finished file waits here for the student's tap (12 Nov) */
.file-ready .pp-top { align-items: center; }
.file-ready .fr-close { min-height: 44px; }
.file-ready .fr-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; max-height: 50vh; overflow: auto; }
.file-ready .fr-row { display: flex; align-items: center; gap: 8px; }
.file-ready .fr-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 400; font-size: var(--fs-4); color: var(--label2); }
.file-ready .fr-row .btn { min-height: 44px; flex: none; }
