@font-face {
  font-family: "Manrope";
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/manrope-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2212, U+FEFF;
}
@font-face {
  font-family: "Manrope";
  font-weight: 400 800;
  font-display: swap;
  src: url("../assets/manrope-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1EFF, U+20A0-20AB, U+20AD-20C4;
}

:root {
  --ink: #102638;
  --muted: #5f6b79;
  --line: #d3dbe4;
  --paper: #eef2f6;
  --panel: #fff;
  --navy: #0a2a43;
  --navy-2: #12385a;
  --blue: #1f6f95;
  --gold: #b48745;
  --red: #b42318;
  --green: #1d7a46;
  --mono: "SF Mono", "Menlo", "Consolas", "Liberation Mono", monospace;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; font: 13px/1.35 "Manrope", Arial, sans-serif; color: var(--ink); background: var(--paper); }
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

/* top bar */
.bar { position: sticky; top: 0; z-index: 10; display: flex; flex-wrap: wrap; align-items: center; gap: 7px 22px; padding: 7px 18px; background: var(--navy); color: #fff; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; white-space: nowrap; }
.brand small { display: block; color: #c9a86d; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; }
.tabs { display: flex; gap: 4px; }
.tabs a { padding: 6px 12px; border-radius: 6px; color: #b8c7d6; font-weight: 700; }
.tabs a.is-active { color: #fff; background: var(--navy-2); }
.badge { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 9px; background: #2b5b84; color: #fff; font-size: 0.72rem; text-align: center; }
.bar-user { margin-left: auto; display: flex; align-items: center; gap: 10px; color: #b8c7d6; }

/* buttons */
.btn { padding: 7px 14px; border: 1px solid var(--navy); border-radius: 6px; background: var(--navy); color: #fff; font-weight: 700; cursor: pointer; white-space: nowrap; }
.btn:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; color: var(--navy); border-color: var(--line); }
.btn.ghost:hover { background: #fff; border-color: #a9b6c4; }
.btn.on-dark { color: #dfe8f1; border-color: #3a5d7e; }
.btn.on-dark:hover { background: var(--navy-2); color: #fff; }
.btn.primary { background: var(--blue); border-color: var(--blue); }
.btn.primary:hover { background: #185b7b; }
.btn.gold { background: var(--gold); border-color: var(--gold); }
.btn.big { padding: 10px 22px; font-size: 14px; }
.btn:disabled { opacity: 0.55; cursor: progress; }

/* sign-in */
.signin { display: grid; place-items: center; min-height: calc(100vh - 52px); }
.signin-card { width: min(420px, 92vw); padding: 32px; border: 1px solid var(--line); border-radius: 10px; background: #fff; text-align: center; }
.signin-card h1 { margin: 12px 0 6px; font-size: 1.4rem; color: var(--navy); }
.signin-card p { color: var(--muted); }
.signin-card label { display: block; margin: 12px 0; text-align: left; font-weight: 700; font-size: 0.8rem; color: var(--muted); }
.signin-card input { display: block; width: 100%; margin-top: 4px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 6px; }
.error { color: var(--red); }

/* dispatch form */
.app { padding: 14px 18px 24px; }
/* the flight in the middle (first in the document), the aircraft on the left, the map and the rest on the right */
.cols { display: grid; grid-template: "aircraft main side" / minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.col { display: grid; gap: 12px; min-width: 0; }
.col-main { grid-area: main; } .col-aircraft { grid-area: aircraft; } .col-side { grid-area: side; }
@media (max-width: 1250px) { .cols { grid-template: "main aircraft" "side side" / minmax(0, 1.1fr) minmax(0, 1fr); } .col-side { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; } }
@media (max-width: 820px) { .cols { grid-template: "main" "aircraft" "side" / minmax(0, 1fr); } .col-side { grid-template-columns: minmax(0, 1fr); } }
.panel.is-main { border-color: #9db8cc; box-shadow: 0 1px 6px rgba(10, 42, 67, 0.1); }
.map-box { padding-bottom: 8px; }
.dmap { aspect-ratio: 16 / 10; margin-top: 6px; overflow: hidden; border: 1px solid #aebccb; border-radius: 6px; background: #dfeaf3; }
.dmap svg { display: block; width: 100%; height: 100%; }
.dmap.is-empty { display: grid; place-items: center; padding: 10px; color: var(--muted); font-size: 0.8rem; text-align: center; }
/* blocks: a white header, the folded ones with Show / Hide Options and a line that says what is set inside */
.ph, .fold > summary { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; margin: -10px -14px 0; padding: 8px 14px; border-bottom: 1px solid var(--line); }
.ph { align-items: center; justify-content: space-between; }
.ph h3, .ph-t { margin: 0; color: var(--navy); font-size: 0.92rem; font-weight: 800; }
.fold > summary { cursor: pointer; list-style: none; }
.fold > summary::-webkit-details-marker { display: none; }
.fold > summary small { flex: 1 1 0; min-width: 0; overflow: hidden; color: var(--muted); font-size: 0.74rem; text-overflow: ellipsis; white-space: nowrap; }
.fold > summary small::before { content: "- "; }
.fold > summary::after { content: "Show Options ▾"; order: 1; margin-left: auto; padding: 2px 8px; border-radius: 4px; background: #4a535e; color: #fff; font-size: 0.68rem; font-weight: 700; white-space: nowrap; }
.fold[open] > summary::after { content: "Hide Options ▴"; }
.fold:not([open]) { padding-bottom: 0; }
.fold:not([open]) > summary { border-bottom: 0; }
.fold-note { order: 2; flex-basis: 100%; color: var(--blue); font-size: 0.74rem; font-weight: 600; }
.fold-note:empty, .fold[open] .fold-note { display: none; }
.more { margin-top: 10px; padding-top: 8px; border-top: 1px solid var(--line); }
.more > summary { cursor: pointer; color: var(--navy); font-size: 0.8rem; font-weight: 800; }
.more > summary small { color: var(--muted); font-weight: 600; }
.btn.mini { padding: 1px 7px; border-color: #4a535e; border-radius: 4px; background: #4a535e; font-size: 0.66rem; }
.btn.mini:hover { background: #333b44; }
.ub { padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; font-size: 0.62rem; font-weight: 600; }
.g-wide { grid-template-columns: minmax(0, 1fr) 120px; }
.span3 { grid-column: span 3; }
.clamp { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.clamp:hover { -webkit-line-clamp: unset; }
.lbl { color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.lbl > input { display: block; width: 100%; margin-top: 3px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; color: var(--ink); font-size: 0.86rem; font-weight: 600; }
.combo-box { position: relative; display: block; margin-top: 3px; }
.combo-box > input { width: 100%; padding: 5px 26px 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; color: var(--ink); font-size: 0.86rem; font-weight: 600; }
.combo-box > input:focus { outline: 2px solid rgba(31, 111, 149, 0.35); border-color: var(--blue); background: #fff; }
.combo-box::after { content: "▾"; position: absolute; top: 0; right: 0; bottom: 0; display: grid; width: 22px; place-items: center; border-left: 1px solid var(--line); color: var(--navy); font-size: 0.8rem; pointer-events: none; }
.combo-box > .combo { position: absolute; top: 1px; right: 1px; bottom: 1px; width: 22px; padding: 0; border: 0; background: transparent; color: transparent; appearance: none; cursor: pointer; }
.combo-box:hover::after, .combo-box:focus-within::after { background: #e4eef5; border-radius: 0 4px 4px 0; }
.combo-box > .combo option { color: var(--ink); }
.cr { display: grid; grid-template-columns: minmax(0, 1fr) 58px; gap: 4px; margin-top: 3px; }
.cr > *, .pair > input { width: 100%; min-width: 0; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; color: var(--ink); font-size: 0.86rem; font-weight: 600; }
.pair { display: grid; grid-template-columns: 1fr auto 1fr; gap: 5px; align-items: center; margin-top: 3px; }
.switches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 18px; margin-top: 12px; }
.sw { display: flex; align-items: center; gap: 8px; color: var(--ink); font-size: 0.8rem; cursor: pointer; }
.sw > span { flex: 1; }
.sw > input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.sw > i { flex: none; width: 34px; height: 18px; border-radius: 9px; background: #b9c3ce; transition: background 0.15s; }
.sw > i::after { content: ""; display: block; width: 14px; height: 14px; margin: 2px; border-radius: 50%; background: #fff; transition: transform 0.15s; }
.sw > input:checked + i { background: var(--green); }
.sw > input:checked + i::after { transform: translateX(16px); }
.sw > input:focus-visible + i { outline: 2px solid var(--blue); outline-offset: 2px; }
.sw.is-off { color: var(--muted); cursor: not-allowed; }
.sw.is-off small { font-size: 0.66rem; }
.alts { width: 100%; margin-top: 10px; border-collapse: collapse; font-size: 0.78rem; }
.alts th { padding: 2px 6px 2px 0; color: var(--muted); font-size: 0.7rem; text-align: left; white-space: nowrap; }
.alts td { padding: 2px 3px; }
.alts td:nth-child(2) { width: 27%; } .alts td:nth-child(3) { width: 18%; } .alts td:nth-child(4) { width: 16%; }
.alts td > input { width: 100%; min-width: 0; padding: 4px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; font-size: 0.8rem; font-weight: 600; }
.alts .combo-box { margin: 0; } .alts .combo-box > input { padding: 4px 20px 4px 6px; font-size: 0.8rem; }
textarea[data-auto="1"] { color: #6b7a89; font-style: italic; }
.sub-h { display: flex; align-items: baseline; gap: 8px; }
.sub-h b { color: var(--navy); font-size: 0.8rem; } .sub-h small { color: var(--muted); font-size: 0.72rem; font-weight: 600; } .sub-h .btn { margin-left: auto; }
.g-pair { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr) minmax(0, 1fr); }
.g-pair small { color: var(--muted); font-size: 0.64rem; font-weight: 600; }
.swap { align-self: end; width: 28px; height: 34px; margin-bottom: 1px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 1rem; cursor: pointer; }
.swap:hover { border-color: var(--blue); background: #e4eef5; }
.alts select { width: 100%; min-width: 0; padding: 4px 1px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; font-size: 0.76rem; font-weight: 600; }
.sugg { display: grid; grid-template-columns: minmax(0, 1fr); gap: 5px; margin: 6px 0; }
.sugg-item { padding: 5px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; text-align: left; cursor: pointer; }
.sugg-item:hover { border-color: var(--blue); background: #fff; }
.sugg-item b { color: var(--navy); font-size: 0.78rem; } .sugg-item i { color: var(--blue); font-size: 0.74rem; font-style: normal; font-weight: 700; }
.sugg-item span { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-family: var(--mono); font-size: 0.7rem; overflow-wrap: anywhere; }
.builder { width: min(860px, calc(100vw - 24px)); max-height: calc(100vh - 40px); padding: 0; border: 0; border-radius: 10px; box-shadow: 0 20px 60px rgba(10, 42, 67, 0.35); }
.builder::backdrop { background: rgba(10, 42, 67, 0.45); }
.builder form { display: flex; flex-direction: column; max-height: calc(100vh - 40px); }
.builder header, .builder footer { display: flex; align-items: center; gap: 12px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.builder footer { justify-content: flex-end; border: 0; border-top: 1px solid var(--line); }
.builder h3 { margin: 0; color: var(--navy); font-size: 1rem; }
.builder output { margin-left: auto; overflow-wrap: anywhere; color: var(--blue); font-family: var(--mono); font-weight: 700; }
.blc, .bl18 { padding: 10px 16px; overflow-y: auto; }
.blc { columns: 2; column-gap: 24px; }
.blc label { display: grid; grid-template-columns: auto 30px 1fr; gap: 6px; align-items: baseline; padding: 3px 0; break-inside: avoid; color: var(--ink); font-size: 0.8rem; cursor: pointer; }
.bl18 label { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 2px 8px; align-items: center; padding: 4px 0; color: var(--ink); }
.bl18 input { padding: 4px 7px; border: 1px solid var(--line); border-radius: 5px; font-size: 0.84rem; text-transform: uppercase; }
.bl18 small { grid-column: 2; color: var(--muted); font-weight: 600; }
@media (max-width: 620px) { .blc { columns: 1; } .switches { grid-template-columns: 1fr; } }
.panel { margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0; }
.panel legend { padding: 2px 8px; margin-left: -4px; border-radius: 4px; background: var(--navy); color: #fff; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.grid { display: grid; gap: 8px 10px; margin-top: 8px; align-items: end; }
.g1 { grid-template-columns: 1fr; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
label { display: block; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
label.wide { margin-top: 8px; }
label.check { display: flex; align-items: center; gap: 6px; margin-top: 10px; color: var(--ink); font-size: 0.82rem; }
label > input:not([type="checkbox"]), label > select, label > textarea { display: block; width: 100%; margin-top: 3px; padding: 5px 7px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; color: var(--ink); font-size: 0.86rem; font-weight: 600; }
label > input:focus, label > select:focus, label > textarea:focus { outline: 2px solid rgba(31, 111, 149, 0.35); border-color: var(--blue); background: #fff; }
input.up, textarea.up { text-transform: uppercase; }
input.up::placeholder, textarea.up::placeholder { text-transform: none; }
input.big { font-size: 1.05rem !important; letter-spacing: 0.06em; }
.mono, textarea.mono { font-family: var(--mono); font-size: 0.82rem !important; }
textarea { resize: vertical; }
.is-bad { border-color: var(--red) !important; background: #fff6f5 !important; }
.note { margin: 6px 0 0; color: var(--muted); font-size: 0.76rem; }
.note.warn { color: #8a4b00; }
.airport-names { min-height: 1.2em; margin: 4px 0 0; color: var(--navy); font-size: 0.78rem; font-weight: 600; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 10px; }
.route-status { color: var(--muted); font-size: 0.78rem; }
.route-status.ok { color: var(--green); }
.route-status.bad { color: var(--red); }
.unit-note { margin-left: auto; color: var(--muted); font-size: 0.76rem; }
.fuel-rows { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px 10px; margin-top: 10px; }
.fuel-cell { display: grid; gap: 3px; align-content: end; min-width: 0; }
.fl { display: flex; align-items: center; gap: 4px; min-height: 18px; color: var(--muted); font-size: 0.74rem; font-weight: 700; }
.fl select { padding: 0 2px; border: 1px solid var(--line); border-radius: 4px; background: #fff; font-size: 0.7rem; }
.fi { display: grid; grid-template-columns: minmax(0, 1fr) 56px; gap: 4px; }
.fi > * { width: 100%; min-width: 0; padding: 5px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; font-size: 0.84rem; font-weight: 600; }
.fi > select { padding: 5px 1px; font-size: 0.72rem; }

/* the dispatch actions in the top bar, over the flight column; the message under them on its own line */
.bar-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
@media (min-width: 1480px) { .bar-actions { position: absolute; top: 7px; left: 50%; transform: translateX(-50%); } } /* over the flight column */
.status { order: 9; flex: 0 0 calc(100% + 36px); margin: 0 -18px -7px; padding: 5px 18px; background: #e4eef5; color: var(--navy); font-size: 0.84rem; font-weight: 600; text-align: center; }
.status:empty, .bar.is-other .status:not(.bad) { display: none; }
.status.bad { background: #fdeceb; color: var(--red); }

/* briefings list */
.list-head { display: flex; align-items: center; gap: 16px; }
.list-head h2 { margin: 6px 0; color: var(--navy); }
.list-head input { margin-left: auto; width: 320px; padding: 6px 9px; border: 1px solid var(--line); border-radius: 6px; }
table.list { width: 100%; margin-top: 8px; border-collapse: collapse; background: #fff; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
table.list th, table.list td { padding: 7px 10px; border-bottom: 1px solid #e7ecf1; text-align: left; white-space: nowrap; }
table.list th { background: #f5f8fb; color: var(--muted); font-size: 0.74rem; text-transform: uppercase; letter-spacing: 0.04em; }
table.list tr:hover td { background: #f7fafc; }
table.list .r { text-align: right; font-variant-numeric: tabular-nums; }
table.list td b { color: var(--navy); }
table.list td .btn { padding: 4px 10px; font-size: 0.78rem; }

/* full-screen briefing */
.briefing { position: fixed; inset: 0; z-index: 50; display: flex; flex-direction: column; background: #dfe5ec; }
.briefing-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 18px; padding: 8px 16px; background: var(--navy); color: #fff; }
.briefing-bar .back { font-weight: 800; }
.briefing-title { min-width: 0; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.briefing-title small { display: block; color: #c9a86d; font-size: 0.7rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.briefing-tabs { display: flex; gap: 4px; }
.briefing-tabs button { padding: 6px 12px; border: 0; border-radius: 6px; background: transparent; color: #b8c7d6; font-weight: 700; cursor: pointer; }
.briefing-tabs button.is-active { background: #fff; color: var(--navy); }
.briefing-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.briefing-actions .close { font-size: 1rem; padding: 6px 11px; }
.briefing-body { flex: 1; min-height: 0; overflow: auto; }
.bpanel { padding: 18px; }
.sheet { width: max-content; max-width: 100%; margin: 8px auto; padding: 40px 48px 36px; background: #fff; border: 1px solid #c4ced8; box-shadow: 0 2px 12px rgba(10, 42, 67, 0.12); font: 12.5px/1.38 var(--mono); color: #111; white-space: pre; overflow-x: auto; }
.sheet b { color: #000; }
.sheet .hl { background: #fff3c4; }
.sheet .warn { color: var(--red); font-weight: 700; }
.fpl-box { max-width: 900px; margin: 0 auto; }
.sheet.fpl { width: auto; white-space: pre-wrap; word-break: break-all; font-size: 14px; }
.map-panel { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 14px; height: 100%; padding: 14px; }
.map-frame { min-height: 0; display: flex; align-items: center; justify-content: center; }
.map-frame svg { width: 100%; height: 100%; max-height: calc(100vh - 90px); border: 1px solid #aebccb; border-radius: 6px; background: #dfeaf3; }
.map-side { overflow: auto; padding: 12px 14px; background: #fff; border: 1px solid var(--line); border-radius: 8px; font-size: 0.82rem; }
.map-side h3 { margin: 4px 0 8px; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--navy); }
.map-side ol { margin: 0; padding-left: 20px; font-family: var(--mono); font-size: 0.78rem; }
.map-side .rc { display: inline-block; margin: 2px 3px 2px 0; padding: 1px 6px; border-radius: 4px; background: #eef3f7; }
.map-side .rc.is-block { background: #59595c; color: #fff; }
.map-side .rc.is-warn { background: #fbe7c4; }
@media (max-width: 1000px) { .map-panel { grid-template-columns: 1fr; } }
.rm-sea { fill: #dfeaf3; }
.rm-land { fill: #f7f4ec; stroke: #b9b3a5; stroke-width: 0.5; }
.rm-zone.is-block { fill: rgba(88, 92, 96, 0.55); stroke: rgba(60, 63, 66, 0.7); stroke-width: 0.8; }
.rm-zone.is-warn { fill: rgba(214, 137, 16, 0.16); stroke: rgba(214, 137, 16, 0.7); stroke-width: 0.6; stroke-dasharray: 3 2; }
.rm-route { fill: none; stroke: #0b3a66; stroke-width: 2.2; stroke-linejoin: miter; stroke-linecap: round; }
.rm-route.is-pos { stroke: #b42318; stroke-dasharray: 6 4; stroke-width: 1.6; }
.rm-fix { fill: #fff; stroke: #0b3a66; stroke-width: 1.2; }
.rm-fix.is-turn { stroke: #b42318; stroke-width: 1.6; }
.rm-port circle { fill: #c8962e; stroke: #0b3a66; stroke-width: 1.5; }
.rm-port text { font: 700 14px/1 system-ui, sans-serif; fill: #0b3a66; paint-order: stroke; stroke: #fff; stroke-width: 3px; }
.rm-label { font: 600 10px/1 system-ui, sans-serif; fill: #0b3a66; paint-order: stroke; stroke: #fff; stroke-width: 2.5px; }
.wx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(420px, 1fr)); gap: 14px; max-width: 1500px; margin: 0 auto; }
.wx-grid > .note { grid-column: 1 / -1; }
.wx-card { padding: 14px 16px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.wx-card h3 { margin: 0 0 8px; color: var(--navy); font-size: 0.95rem; }
.wx-card h3 small { color: var(--muted); font-weight: 600; margin-left: 6px; }
.wx-card pre { margin: 6px 0; padding: 8px 10px; background: #f4f7fa; border-radius: 5px; font: 12.5px/1.4 var(--mono); white-space: pre-wrap; }
.wx-card .cat { display: inline-block; padding: 1px 7px; border-radius: 4px; font-size: 0.72rem; font-weight: 800; color: #fff; }
.cat.VFR { background: #1d7a46; } .cat.MVFR { background: #1f5fae; } .cat.IFR { background: #b42318; } .cat.LIFR { background: #8a1fae; }
.backtest { max-width: 900px; margin: 0 auto; padding: 18px 22px; background: #fff; border: 1px solid var(--line); border-radius: 8px; }
.backtest table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.backtest th, .backtest td { padding: 8px 10px; border-bottom: 1px solid #e7ecf1; text-align: right; }
.backtest th:first-child, .backtest td:first-child { text-align: left; }
.backtest .good { color: var(--green); font-weight: 800; }
.backtest .off { color: var(--red); font-weight: 800; }

.ap-list { position: absolute; z-index: 60; margin: 0; padding: 4px 0; list-style: none; min-width: 320px; max-height: 300px; overflow: auto; background: #fff; border: 1px solid #a9b6c4; border-radius: 6px; box-shadow: 0 8px 22px rgba(10, 42, 67, 0.18); }
.ap-list li { display: flex; gap: 10px; padding: 6px 10px; cursor: pointer; font-size: 0.82rem; }
.ap-list li b { min-width: 74px; color: var(--navy); font-family: var(--mono); }
.ap-list li span { color: var(--muted); }
.ap-list li.is-on { background: #e8f1f7; }
.toast { position: fixed; left: 50%; bottom: 74px; z-index: 80; transform: translateX(-50%); padding: 9px 16px; border-radius: 7px; background: var(--navy); color: #fff; font-weight: 700; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2); }

@media print {
  @page { size: A4; margin: 18mm 12mm 14mm 20mm; } /* room at the top and on the binding side */
  body { background: #fff; }
  .bar, .app, .briefing-bar, .toast { display: none !important; }
  .briefing { position: static; display: block; background: #fff; }
  .briefing-body { overflow: visible; }
  .bpanel { padding: 0; }
  .bpanel[data-bpanel="fpl"], .bpanel[data-bpanel="wx"], .bpanel[data-bpanel="backtest"] { display: none !important; }
  .bpanel[data-bpanel="ofp"] { display: block !important; }
  .bpanel[data-bpanel="map"] { display: block !important; page-break-before: always; height: auto; }
  .map-side { display: none; }
  .map-frame svg { max-height: none; }
  .briefing[data-maps="none"] .bpanel[data-bpanel="map"] { display: none !important; }
  .sheet { width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; font-size: 8.7pt; line-height: 1.34; overflow: visible; } /* 96 columns fit 178 mm */
}

/* ---------- airframes page ---------- */
.af-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 14px; align-items: start; }
.af-side { position: sticky; top: 64px; display: grid; gap: 8px; }
.af-side input[type="search"], .af-new select { width: 100%; min-width: 0; padding: 6px 8px; border: 1px solid var(--line); border-radius: 5px; background: #fff; font-size: 0.84rem; }
.af-new { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px; }
.af-items { max-height: calc(100vh - 190px); margin: 0; padding: 0; overflow-y: auto; list-style: none; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.af-group { padding: 6px 10px; background: var(--paper); color: var(--muted); font-size: 0.7rem; font-weight: 800; }
.af-items .hint { padding: 6px 10px; color: var(--muted); font-size: 0.76rem; }
.af-item { display: grid; width: 100%; padding: 6px 10px; border: 0; border-top: 1px solid var(--paper); background: none; color: var(--ink); text-align: left; cursor: pointer; }
.af-item b { font-size: 0.84rem; }
.af-item span { color: var(--muted); font-size: 0.72rem; }
.af-item:hover { background: #f6f9fb; }
.af-item.is-active { background: #e4eef5; }
.af-cal { margin-left: 4px; padding: 0 5px; border-radius: 8px; background: var(--green); color: #fff; font-size: 0.62rem; font-style: normal; font-weight: 700; }
.af-main { min-width: 0; container-type: inline-size; }
.af-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.af-head h2 { margin: 0; font-size: 1.1rem; color: var(--navy); }
.af-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.af-actions .btn:disabled { cursor: not-allowed; }
.af-issues { margin: 6px 0 0; padding: 0; list-style: none; color: var(--red); font-size: 0.78rem; }
.af-issues .af-note { color: var(--muted); }
.afx { display: grid; gap: 12px; margin-top: 10px; }
.afx > .afx-banner { margin: 0; padding: 6px 12px; border-radius: 6px; background: #e4eef5; color: var(--navy); font-size: 0.8rem; }
@container (min-width: 900px) {
  .afx { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .afx > .afx-banner, .afx > .is-cal { grid-column: 1 / -1; }
}
.afx-block { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); min-width: 0; }
.afx-block > header { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; padding: 7px 12px; border-bottom: 1px solid var(--line); }
.afx-block h3 { margin: 0; color: var(--navy); font-size: 0.9rem; }
.afx-block header small { color: var(--muted); font-size: 0.74rem; }
.afx-grid { display: grid; flex: 1; gap: 8px 10px; align-content: start; padding: 10px 12px 12px; }
.afx-grid.c1 { grid-template-columns: minmax(0, 1fr); }
.afx-grid.c4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.afx-grid.c6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.afx-f { display: grid; gap: 3px; align-content: end; min-width: 0; }
.afx-f.s2 { grid-column: span 2; } .afx-f.s4 { grid-column: span 4; }
.afx-l { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; min-height: 20px; color: var(--muted); font-size: 0.7rem; font-weight: 700; }
.afx-t { min-width: 0; line-height: 1.2; text-align: center; overflow-wrap: anywhere; }
.afx-f.is-left .afx-t { text-align: left; }
.afx-f.is-left .afx-l { justify-content: flex-start; }
.afx-f input, .afx-f select, .afx-f textarea { width: 100%; min-width: 0; min-height: 28px; padding: 3px 6px; border: 1px solid var(--line); border-radius: 5px; background: #fbfcfd; color: var(--ink); font-size: 0.82rem; font-weight: 600; text-align: center; text-align-last: center; }
.afx-f textarea { min-height: 110px; text-align: left; text-align-last: left; font-family: var(--mono); text-transform: uppercase; }
.afx-f.is-upper input { text-transform: uppercase; }
.afx-f :disabled { background: var(--paper); opacity: 1; color: var(--ink); }
.afx-f input:focus, .afx-f select:focus, .afx-f textarea:focus { outline: 2px solid rgba(31, 111, 149, 0.35); border-color: var(--blue); }
.afx-t select { width: auto; min-height: 20px; padding: 0 2px; font-size: 0.68rem; }
.afx-badge { display: inline-block; padding: 0 4px; border: 1px solid var(--line); border-radius: 4px; color: var(--muted); font-size: 0.62rem; }
.afx-help { display: inline-grid; flex: none; place-items: center; width: 17px; height: 17px; padding: 0; border: 0; border-radius: 4px; background: #5b6470; color: #fff; font-size: 0.68rem; font-weight: 800; cursor: help; }
label > .afx-help, .fl .afx-help { width: 15px; height: 15px; margin-left: 2px; font-size: 0.6rem; vertical-align: 1px; }
.afx-help:hover, .afx-help:focus-visible { background: var(--blue); }
.afx-in { display: grid; grid-template-columns: minmax(0, 1fr) 62px; gap: 4px; }
.afx-in.is-wide { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.afx-cal { padding: 8px 12px 12px; overflow-x: auto; }
.afx-cal table { width: 100%; border-collapse: collapse; font-size: 0.8rem; }
.afx-cal th { padding: 4px 8px; color: var(--muted); font-size: 0.7rem; text-align: right; white-space: nowrap; }
.afx-cal td { padding: 4px 8px; border-top: 1px solid var(--line); text-align: right; font-variant-numeric: tabular-nums; }
.afx-pop { position: fixed; z-index: 60; padding: 8px 10px; border-radius: 6px; background: var(--navy); color: #fff; font-size: 0.78rem; line-height: 1.4; box-shadow: 0 6px 20px rgba(10, 42, 67, 0.3); pointer-events: none; }
@media (max-width: 900px) {
  .af-layout { grid-template-columns: minmax(0, 1fr); }
  .af-side { position: static; }
  .af-items { max-height: 220px; }
}
@media (max-width: 700px) {
  .bar { position: static; gap: 4px 10px; }
  .bar .tabs { order: 3; width: 100%; }
  .bar-actions { order: 4; width: 100%; margin-left: 0; padding-bottom: 4px; }
  .afx-grid.c4, .afx-grid.c6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .afx-f.s4 { grid-column: span 2; }
}

/* Calculate and Compare */
.compare { width: min(1180px, calc(100vw - 24px)); }
.compare header .x { border: 0; background: none; color: var(--navy); font-size: 1.4rem; line-height: 1; cursor: pointer; }
.compare output { font-size: 0.78rem; }
.cmp-body { padding: 6px 16px 14px; overflow: auto; }
.cmp-body h4 { margin: 12px 0 6px; color: var(--navy); font-size: 0.86rem; }
.cmp-cur { padding: 0 12px 10px; border: 1px solid var(--line); border-left: 5px solid var(--blue); border-radius: 6px; background: #f6fafc; }
.cmp-scroll { overflow-x: auto; }
.cmp { width: 100%; border-collapse: collapse; font-size: 0.84rem; }
.cmp th { padding: 5px 8px; border-bottom: 1px solid var(--line); color: var(--muted); font-size: 0.74rem; font-weight: 600; text-align: right; white-space: nowrap; }
.cmp th:nth-child(-n+2), .cmp td:nth-child(-n+2), .cmp th:last-child, .cmp-row td:last-child { text-align: left; }
.cmp th.sortable { cursor: pointer; } .cmp th.sortable:hover { color: var(--blue); }
.cmp-row td { padding: 7px 8px 2px; font-weight: 700; text-align: right; vertical-align: top; font-variant-numeric: tabular-nums; }
.cmp-row small { display: block; color: var(--muted); font-size: 0.72rem; font-weight: 600; }
.cmp .good { color: #1b7a43; } .cmp .worse { color: var(--red); }
.cmp-more > td { padding: 2px 8px 10px; border-bottom: 1px solid var(--line); text-align: left; }
.cmp tr:last-child > td { border-bottom: 0; }
.cmp-changes { margin: 4px 0; color: var(--muted); font-size: 0.78rem; } .cmp-changes b { margin-right: 8px; } .cmp-changes span { color: var(--navy); font-weight: 600; }
.cmp-chip { display: inline-block; padding: 1px 8px; border-radius: 9px; font-size: 0.72rem; white-space: nowrap; }
.cmp-chip.bad { background: #fdeceb; color: var(--red); } .cmp-chip.cut { background: #fdf3e0; color: #8a5a00; } .cmp-chip.ok { background: #e6f4ec; color: #1b7a43; } .cmp-chip.note { background: #e4eef5; color: var(--navy); cursor: help; }
.cmp-finds { margin: 4px 0 6px; padding-left: 18px; font-size: 0.8rem; font-weight: 600; } .cmp-finds .bad { color: var(--red); } .cmp-finds .cut { color: #8a5a00; }
.cmp-limits { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 8px 14px; margin: 8px 0; font-size: 0.76rem; }
.cmp-limits span { display: flex; justify-content: space-between; color: var(--muted); font-weight: 600; } .cmp-limits i { color: var(--ink); font-style: normal; font-variant-numeric: tabular-nums; }
.cmp-limits .meter { height: 6px; margin: 3px 0; border-radius: 3px; background: #dfe7ee; overflow: hidden; } .cmp-limits em { display: block; height: 100%; background: #1b7a43; }
.cmp-limits b { color: #1b7a43; } .cmp-limits .over b { color: var(--red); } .cmp-limits .over em { background: var(--red); }
.cmp-limits .full b { color: #8a5a00; } .cmp-limits .full em { background: #d99a1c; }
.cmp-slide { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 14px; align-items: center; margin: 4px 0 8px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.cmp-slide label { grid-column: 1 / -1; display: flex; gap: 10px; align-items: center; font-size: 0.78rem; white-space: nowrap; }
.cmp-slide input[type="range"] { flex: 1; width: 100%; height: 8px; margin: 0; padding: 0; border: 0; border-radius: 4px; background: linear-gradient(90deg, #8cc7a3 0 var(--max), #eaa9a4 var(--max) 100%); -webkit-appearance: none; appearance: none; cursor: pointer; }
.cmp-slide input[type="range"]::-webkit-slider-runnable-track { height: 8px; background: transparent; }
.cmp-slide input[type="range"]::-webkit-slider-thumb { width: 18px; height: 18px; margin-top: -5px; border: 2px solid #fff; border-radius: 50%; background: var(--navy); box-shadow: 0 1px 4px rgba(10, 42, 67, 0.4); -webkit-appearance: none; appearance: none; }
.cmp-slide input[type="range"]::-moz-range-thumb { width: 15px; height: 15px; border: 2px solid #fff; border-radius: 50%; background: var(--navy); }
.cmp-slide p { margin: 0; color: var(--navy); font-size: 0.78rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.cmp-slide-btn { display: flex; flex-wrap: wrap; gap: 6px; }
.cmp-slide-btn button { padding: 3px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 0.75rem; font-weight: 600; cursor: pointer; } .cmp-slide-btn button[hidden] { display: none; }
.cmp-slide-btn [data-c="slide-use"] { border-color: var(--navy); background: var(--navy); color: #fff; }
.cmp-route p { margin: 6px 0; padding: 7px 10px; border-left: 4px solid var(--navy); background: #eef2f6; font-family: var(--mono); font-size: 0.74rem; overflow-wrap: anywhere; } .cmp-route mark { padding: 0 2px; background: #d5dde6; color: inherit; } .cmp-route small { color: var(--muted); }
.cmp-tools { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.cmp-tools button { padding: 3px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: var(--navy); font-size: 0.75rem; font-weight: 600; cursor: pointer; } .cmp-tools button:hover { border-color: var(--blue); background: #e4eef5; }
.cmp-paper { max-height: 340px; margin: 8px 0 0; padding: 10px; overflow: auto; border: 1px solid var(--line); background: #fff; font-family: var(--mono); font-size: 0.72rem; }
.cmp-notes { margin: 4px 0; font-size: 0.78rem; } .cmp-notes summary { color: var(--navy); font-weight: 600; cursor: pointer; }
.cmp-wait { margin: 6px 0; color: var(--muted); font-size: 0.84rem; }
@media (max-width: 720px) {
  .cmp, .cmp tbody, .cmp-more, .cmp-more > td { display: block; }
  .cmp thead { display: none; }
  .cmp-slide { grid-template-columns: minmax(0, 1fr); }
  .cmp-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; }
  .cmp-row td { text-align: left; } .cmp-row td:first-child { display: none; }
  .cmp-row td::before { content: attr(data-label); display: block; color: var(--muted); font-size: 0.68rem; font-weight: 600; }
}

/* Users (admins) */
.users-grid { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: 12px; align-items: start; }
.users-grid h2 { margin: 2px 0 8px; font-size: 1rem; color: var(--navy); }
.users-form { display: grid; gap: 8px; }
.users-how { margin: 12px 0 0; padding-left: 18px; font-size: 0.8rem; color: var(--muted); display: grid; gap: 4px; }
.users-wrap { overflow-x: auto; }
.users-wrap td small { display: block; color: var(--muted); }
.user-acts { text-align: right; }
.user-acts .btn { margin-left: 4px; }
.user-acts .btn.danger { color: var(--red); }
.user-status { display: inline-block; padding: 1px 7px; border-radius: 9px; font-size: 0.72rem; font-weight: 700; background: var(--paper); }
.user-status.is-active { background: #e7f6ec; color: #067647; }
.user-status.is-invited { background: #fff4e5; color: #b54708; }
.user-status.is-off { background: #fdecea; color: var(--red); }
@media (max-width: 900px) { .users-grid { grid-template-columns: minmax(0, 1fr); } }
/* Activity of a user (owner) */
.act-panel { margin-top: 12px; }
.act-head { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.act-head h2 { flex: 1 1 220px; margin: 0; font-size: 1rem; color: var(--navy); }
.act-head label { width: 130px; }
.act-sum { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin: 10px 0; }
.act-sum div { padding: 8px 10px; border: 1px solid var(--line); border-radius: 6px; background: #f7fafc; }
.act-sum b { display: block; color: var(--navy); font-variant-numeric: tabular-nums; }
.act-sum span { font-size: 0.74rem; color: var(--muted); }
.act-list { max-height: 60vh; overflow: auto; }
.act-list td.act-more { white-space: normal; color: var(--muted); }
.act-day td { background: #f5f8fb; font-weight: 700; color: var(--navy); }
