/* Approved midnight palette. */
:root {
  color-scheme: dark;
  --canvas:#0c1523; --surface:#152438; --field:#0f1c2c; --line:#2c4056;
  --text:#f1f6fc; --muted:#a8bed1; --blue:#99eaf2; --blue-deep:#99eaf2;
  --ice:#123342; --green:#9de3c2; --red:#ffb9b2; --amber:#ffd090; --navy:var(--text);
}
[hidden]{display:none!important}
:focus-visible{outline:3px solid var(--blue)}
.top,.side,.hero{background:var(--canvas)}
.side nav a,.side nav p,.eyebrow,.ck-edition,.ck-group-title,.cockpit-head .eyebrow{color:var(--muted)}
.side nav a:is(:hover,[aria-current]),.tool-tabs button[aria-selected=true]{background:var(--ice);color:var(--blue)}
.brand-mark{background:none;border-radius:0}
.brand strong,.connectivity{color:var(--blue)}
.connectivity{background:var(--ice);border-radius:99px;padding:.22rem .7rem;font-weight:650;font-size:.83rem}
.hero{min-height:0;padding:.3rem 0 .65rem;overflow:visible}
.hero::after,.hero .eyebrow{display:none}
.hero p,.hero-tag,.intro{color:var(--muted)}
.hero-tag strong{color:var(--text)}
.hub{max-width:50rem;display:grid;gap:.8rem}
.hub h1,.hub h2{margin:0;line-height:1.22;letter-spacing:-.035em}
.hub h1{font-size:clamp(1.7rem,4vw,2.55rem);margin:.5rem 0}
.hub h2{font-size:1.15rem;margin:.65rem 0 .1rem}
.aircraft-card,.nav-card{min-width:0;display:flex;align-items:center;gap:.85rem;text-decoration:none;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:14px;padding:1rem}
.aircraft-card{display:grid;grid-template-columns:1fr auto;gap:.3rem;margin-bottom:.3rem}
.aircraft-card .eyebrow,.aircraft-card strong,.aircraft-card small{grid-column:1}
.aircraft-card strong{font-size:1.3rem}
.hub small{display:block;color:var(--muted);line-height:1.4;font-size:.875rem}
.hub i{font-size:1.4rem;color:var(--blue);font-style:normal;margin-inline-start:auto}
.aircraft-card i{grid-column:2;grid-row:1/4}
.card-icon{width:2.4rem;height:2.4rem;background:var(--field);border-radius:8px;display:grid;place-items:center;color:var(--blue);font-size:1.4rem}
.performance-links{display:grid;grid-template-columns:1fr 1fr;gap:.7rem}
.performance-links .nav-card{display:grid;gap:.5rem;align-content:start}
.performance-links i{display:none}
.hub .nav-card:hover,.aircraft-card:hover{border-color:var(--blue)}
.top-actions{display:flex;flex-wrap:wrap;padding:1rem;background:var(--surface);border:1px solid var(--line);border-radius:12px}
.top-actions select{width:auto;max-width:100%}
.bottom-nav{display:none}
.panel,.kpi,.phase-card,.side-profile,.cg-dialog,.ck-index,.ck-sheet,.ck-about,.ck-speeds,.ck-reader,.ck-reader header,.ck-reader figcaption,.cockpit-original{background:var(--surface);color:var(--text);border-color:var(--line)}
.panel h2,.panel h3,.field-label,.phase-heading,.ck-heading h1,.ck-sheet-head h2,.side-profile strong{color:var(--text)}
.panel p,.panel .intro,.ck-edition,.ck-group-title{color:var(--muted)}
input:not([type=checkbox]),select,textarea,.fixed-value,.converter-group input.with-unit,.converter-group input:focus,.cg-phase,.side-profile,.empty,thead th,.load-panel .load-dock,.load-table .load-group th,.ck-sheet-head,.ck-progress,.ck-group > div,.ck-about,.cockpit-filters,.cg-empty span,.perf-optional,.travel-result,.converter-result,.tool-tabs,.converter-options,.cg-empty,.travel-triangle button,.load-table tbody tr:nth-child(even),.ck-step label:hover{background-color:var(--field);color:var(--text);border-color:var(--line)}
input::placeholder,textarea::placeholder{color:var(--muted)}
.primary,.primary:hover,.load-dock .primary{background:var(--blue);color:var(--canvas)}
.banner,.notice.warn,.chip.warn,.ck-warning{color:var(--amber);background:#32281f;border-color:#675039}
.banner a,.banner strong{color:var(--amber)}
.notice:not(.bad,.warn,.good),.chip,.cg-phase:hover,.converter-options button[aria-pressed=true],.travel-triangle button[aria-pressed=true]{background:var(--ice);color:var(--blue)}
.notice.bad,.chip.bad,.load-table tr:has(.load-status[data-state=bad]) td:last-child{background:#43292e;color:var(--red)}
.notice.good,.chip.good,.load-table tr:has(.load-status[data-state=good]) td:last-child{background:#153b34;color:var(--green)}
.quiet,.ck button,.ck-source,.cockpit-index ol button,.cockpit-index ol button:hover,.cockpit-original button,.table-entry button,.image-viewer button,.index-return,.cg-phase[aria-pressed=true],.perf-shortcuts button,.perf-edit{background:var(--field);color:var(--blue);border:1px solid var(--line)}
button:disabled{opacity:.52}
.ck{--ck-accent:var(--blue);--ck-dark:var(--text);--ck-tint:var(--ice);--ck-edge:var(--line)}
.ck-emergency{--ck-accent:var(--amber);--ck-tint:#32281f}
.ck-modes button{--mode-soft:var(--surface);--mode-color:var(--blue);--mode-line:var(--line);color:var(--muted);background:var(--surface)}
.ck-modes .ck-mode-emergency{--mode-color:var(--amber)}
.ck-modes button[aria-pressed=true]{color:var(--mode-color);background:var(--ck-tint);border-color:var(--mode-color)}
.ck-group summary,.ck-group button,.ck-steps,.ck-action,.ck-number,.perf-optional summary{color:var(--text)}
.ck-group button[aria-current=true],.cockpit-index ol button[aria-pressed=true],.cockpit-filters button[aria-pressed=true]{background:var(--ice);color:var(--blue)}
.ck-group button:hover,.ck-step:has(input:checked),.ck-step:has(input:checked) label{background:var(--ice)}
.ck-note{background:var(--field);color:var(--text)}
.ck-note.ck-warning,.ck-note.ck-condition{color:var(--amber);background:#32281f}
.ck-map small,.ck-progress output,.index-name small,.index-number{color:var(--muted)}
.ck-steps li{border-color:var(--line)}
.index-return{display:none}
.perf-page{--phase:var(--blue);--phase-soft:var(--ice)}
.perf-page.landing{--phase:var(--green);--phase-soft:#17352e}
.cockpit-index header [data-match-count],.cockpit-index ol button .index-number,.ck-map,.ck-source {color:var(--blue);background:var(--field)}
.cockpit-filters button{color:var(--muted)}
.table-entry{width:min(100%,860px);display:grid;justify-items:start;gap:.45rem}
.table-entry img{cursor:zoom-in}
.table-entry button,.cockpit-original button,.image-viewer button{min-height:44px}
.image-viewer{box-sizing:border-box;inset:0;width:100%;height:100%;height:100dvh;max-width:none;max-height:none;padding:0;margin:0;border:0;background:var(--canvas);color:var(--text)}
.image-viewer[open]{display:grid;grid-template-rows:auto minmax(0,1fr) auto}
.image-viewer header,.image-viewer footer{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;padding:.55rem .75rem;background:var(--surface)}
.image-viewer header{justify-content:space-between;flex-wrap:nowrap;padding-top:max(.55rem,env(safe-area-inset-top))}
.image-viewer header strong{font-size:1rem;line-height:1.25;max-height:4.1em;overflow:auto}
.image-viewer footer{justify-content:center;padding-bottom:max(.55rem,env(safe-area-inset-bottom))}
.image-viewer footer button{min-width:44px}
.image-viewer output{font-variant-numeric:tabular-nums;min-width:4ch;text-align:center}
.image-viewport{position:relative;min-height:0;overflow:hidden;touch-action:none;user-select:none;overscroll-behavior:contain}
.image-plane{position:absolute;left:50%;top:50%;width:0;height:0}
.image-plane img{display:block;position:absolute;max-width:none;max-height:none;pointer-events:none}
body:has(dialog[open]){overflow:hidden}
@media(max-width:800px){
  .top{padding:.75rem 1rem;min-height:60px;flex-wrap:nowrap}
  .top .brand{font-size:1.18rem}.brand small{display:none}
  .side{display:none}.layout{display:block}
  .work{padding:.65rem 1rem calc(6.4rem + env(safe-area-inset-bottom));min-width:0}
  .bottom-nav{display:grid;position:fixed;z-index:5;inset:auto 0 0;grid-template-columns:repeat(4,minmax(0,1fr));background:var(--canvas);border-top:1px solid var(--line);padding:.25rem .25rem max(.35rem,env(safe-area-inset-bottom))}
  .bottom-nav a{display:grid;gap:.13rem;place-items:center;align-content:center;text-decoration:none;color:var(--muted);font-size:.8rem;font-weight:650;min-height:52px}
  .bottom-nav svg{width:3rem;height:1.7rem;padding:.2rem .8rem;stroke:currentColor;fill:none;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}
  .bottom-nav a[aria-current]{color:var(--blue)}.bottom-nav a[aria-current] svg{background:var(--ice);border-radius:1rem}
  .hub h1{margin:.4rem 0}.hub{gap:.65rem}
  .balance-layout{display:flex;flex-direction:column}.balance-layout>*{width:100%}
  body[data-page=balance] .work>.v-stack{display:flex;flex-direction:column}
  .phase-summary{order:1}.balance-layout{order:0}#balance-result{order:2}
  .load-panel{display:flex;flex-direction:column}.load-panel .load-dock{order:1;position:static;margin-bottom:0}
  .load-panel .load-dock .primary{grid-column:1/-1;min-height:44px}
  .load-panel .load-dock{grid-template-columns:repeat(2,minmax(0,1fr))}
  .ck-select,.ck-grid .ck-index,.ck.show-index .ck-body {display:none}
  .ck.show-index .ck-grid .ck-index{display:block;border:0;padding:0;background:transparent}
  .ck-index h2{display:none}.ck-group{border-radius:10px;background:var(--surface);border:1px solid var(--line);margin-bottom:.55rem}
  .ck-group summary,.ck-group button{min-height:44px;padding:.65rem .8rem}
  .ck.show-index .ck-map{display:none}.index-return{display:block;min-height:44px;margin-bottom:.6rem}
  .ck-grid{display:block}
  .image-viewer footer button{font-size:1rem}
}
.card-icon svg{display:block;width:1.4rem;height:1.4rem;stroke:currentColor;fill:none;stroke-width:1.65;stroke-linejoin:round;stroke-linecap:round}
.route-legend div,.route-legend .route-landmark,.runway-figure,.perf-dock{background:var(--field);border-color:var(--line)}
.route-legend dd,.runway-title,.perf-dock strong{color:var(--text)}
.ck-reader figcaption,.ck-reader figcaption a{color:var(--blue)}
.cg-empty{background-image:none}
@media(max-width:800px){.perf-dock{position:static}.performance-links .card-icon{background:transparent}}

/* Regular for instructions, semibold for headings and the numerical readout. */
body, .ck-action { font-weight: 400; }
h1, h2, h3, .hero h1, .ck-heading h1, .ck-sheet-head h2,
.nav-card strong, .aircraft-card strong, .kpi strong, .load-total strong,
.load-table output, .phase-values dd, .converter-result strong, .travel-result strong {
  font-weight: 600;
}
table, output, .unit, .kpi, .phase-values, .cockpit-current, .index-number,
input[inputmode="decimal"], input[type="number"] { font-variant-numeric: tabular-nums; }
.load-table input[inputmode="decimal"] { text-align: end; }

#preferences {display:grid;grid-template-columns:1fr 1fr;gap:.4rem .7rem;padding:.7rem}
#preferences label{display:block;font-size:.85rem}
#preferences select{width:100%;min-width:0;min-height:44px;font-size:1rem}
#preferences label[for=units]{grid-column:2;grid-row:1}
#preferences #units{grid-column:2;grid-row:2}
#preferences #language{grid-column:1;grid-row:2}
.report-actions{display:flex;flex-wrap:wrap;gap:.55rem;margin-top:1rem}
.report-actions button{min-height:44px}
.report-status{width:100%;color:var(--muted)}

/* Quick access and the expandable converter share the app's cyan action color. */
#tools-shortcut {
  display: inline-flex; align-items: center; justify-content: center; gap: .55rem;
  min-height: 44px; padding: .6rem 1rem; border: 1px solid var(--blue);
  border-radius: 9px; background: var(--blue); color: var(--canvas); font-weight: 700;
}
#tools-shortcut::before, .balance-tools summary::before {
  content: ""; width: 1.1em; height: 1.35em; display: inline-block; box-sizing: border-box;
  border: 2px solid currentColor; border-radius: 3px;
  background: linear-gradient(currentColor, currentColor) center 22% / 65% 2px no-repeat,
    radial-gradient(circle, currentColor 1px, transparent 1.6px) left 50% top 70% / 5px 5px repeat-x;
}
details.balance-tools {
  border: 1px solid var(--blue); border-inline-start-width: 5px;
  border-radius: 12px; background: var(--ice); padding: 0;
}
.balance-tools > summary {
  display: grid; grid-template-columns: 2rem 1fr auto; align-items: center; gap: .15rem .5rem;
  padding: 1rem; list-style: none; color: var(--blue); cursor: pointer; font-size: 1.2rem; font-weight: 700;
}
.balance-tools > summary::-webkit-details-marker { display: none; }
.balance-tools > summary::before { grid-column: 1; grid-row: 1 / 3; }
.balance-tools > summary > small { grid-column: 2; grid-row: 2; font-size: .9rem; color: var(--text); font-weight: 400; }
.balance-tools > summary::after { content: ""; grid-column: 3; grid-row: 1 / 3; width: .55rem; height: .55rem; border: solid currentColor; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.balance-tools[open] > summary::after { transform: rotate(225deg); }
.balance-tools[open] { padding: 0 1rem 1rem; background: var(--surface); }
.balance-tools[open] > summary { margin-inline: -1rem; background: var(--ice); border-radius: 10px 10px 0 0; }
.manual-nav-icon { color: var(--blue); width: 1.3rem; text-align: center; }
.manual-panel { max-width: 66rem; }
.manual-panel header h1 { margin: 0 0 .4rem; }
.manual-panel header h2 { margin: 0; }
.manual-panel header p { margin: .25rem 0 .9rem; }
.manual-download { background: var(--blue); color: var(--canvas); text-decoration: none; border-radius: .55rem; padding: .65rem 1rem; font-weight: 700; display: inline-flex; min-height: 44px; align-items: center; }
.manual-status { display: inline; margin-inline-start: .55rem; }
.manual-reader { border-top: 1px solid var(--line); margin-top: 1.2rem; padding-top: 1rem; }
.manual-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; }
.manual-controls label { display: grid; gap: .25rem; font-size: .875rem; }
.manual-controls select { width: 100%; min-height: 44px; }
.manual-panel button:not(.manual-sheet) { border: 1px solid var(--line); background: var(--field); color: var(--blue); border-radius: .55rem; min-height: 44px; padding: .55rem .85rem; }
.manual-reader figure { margin: 1rem 0 0; }
.manual-sheet { display: block; cursor: zoom-in; background: var(--field); border: 1px solid var(--line); width: 100%; padding: .5rem; border-radius: .75rem; }
.manual-sheet img { display: block; width: 100%; height: auto; max-height: 65vh; object-fit: contain; }
.manual-reader figcaption { margin-top: .5rem; }

.header-actions { display:flex; align-items:center; gap:.55rem; margin-left:auto; }
.account-entry { display:flex; align-items:center; gap:.4rem; padding:.5rem .65rem; min-height:44px; border:1px solid var(--line); border-radius:10px; color:var(--blue); text-decoration:none; font-size:.94rem; }
.account-entry svg { width:22px; height:22px; fill:none; stroke:currentColor; stroke-width:1.7; }
.account-entry:hover { background:var(--ice); border-color:var(--blue); }
.settings-page { max-width:60rem; display:grid; gap:1rem; }
.settings-page>header { display:flex; align-items:center; justify-content:space-between; gap:1rem; flex-wrap:wrap; }
.settings-page h1 { margin:.3rem 0; }
.settings-page .panel { margin:0; }
.settings-page form { display:grid; gap:.8rem; max-width:32rem; margin:1rem 0; }
.settings-page label { display:grid; gap:.4rem; font-weight:600; }
.settings-page input,.settings-page select { width:100%; min-height:44px; }
.settings-page button { min-height:44px; border-radius:8px; padding:.65rem .9rem; border:1px solid var(--line); }
.settings-page button:not(.primary) { color:var(--blue); background:var(--field); }
.account-tabs { display:flex; gap:.6rem; flex-wrap:wrap; }
.account-tabs button[aria-pressed=true] { background:var(--ice); border-color:var(--blue); }
.account-info { color:var(--muted); font-size:.94rem; }
.account-message:empty { display:none; }
.account-message { border-left:3px solid var(--blue); padding:.8rem 1rem; background:var(--ice); margin:0; }
.account-message.error { border-color:var(--red); color:var(--red); }
.license-plans { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); gap:1rem; margin:1rem 0; }
.license-plans article { background:var(--field); border:1px solid var(--line); border-radius:12px; padding:1rem; }
.license-plans article>strong { font-size:1.9rem; color:var(--blue); }
.license-plans article h3 { margin:.1rem 0 .5rem; }
.account-devices { padding:0; list-style:none; }
.account-devices li { display:flex; justify-content:space-between; align-items:center; gap:1rem; padding:.7rem 0; border-bottom:1px solid var(--line); }
.account-devices small { display:block; color:var(--muted); }
.account-home { color:var(--blue); font-weight:600; text-decoration:none; padding:.6rem .85rem; border:1px solid var(--line); border-radius:10px; }
@media(max-width:600px) {
 .header-actions { gap:.4rem; } .header-actions .connectivity { font-size:.75rem; padding:.2rem .4rem; }
 .account-entry { padding:.5rem; } .account-entry span { display:none; }
 .license-plans { grid-template-columns:1fr; }
 .settings-page .account-devices li { align-items:start; flex-wrap:wrap; }
}
