/* LN-RVX – "Hangar" theme */
:root {
  --bg: #0d141b;
  --panel: #151f29;
  --panel-2: #1c2834;
  --line: #2a3846;
  --text: #e6edf3;
  --muted: #8b9aab;
  --alu: #c9d1d9;
  --accent: #ff7a1a;          /* safety orange */
  --accent-soft: rgba(255,122,26,.14);
  --ok: #3fb950;              /* signed off / complete */
  --warn: #e3b341;            /* awaiting inspection */
  --danger: #f85149;
  --info: #58a6ff;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, sans-serif; }
a { color: inherit; text-decoration: none; }
a.link, .prose a { color: var(--accent); }
a.link:hover { text-decoration: underline; }
.mono { font-family: var(--mono); }
.muted { color: var(--muted); }
h1 { font-size: 28px; margin: 0 0 6px; letter-spacing: -.01em; }
h2 { font-size: 18px; margin: 0; }
hr { border: 0; border-top: 1px solid var(--line); margin: 20px 0; }

/* ---------- Top bar ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 20px;
  height: 60px; padding: 0 20px; background: rgba(13,20,27,.94); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-family: var(--mono); font-weight: 700; font-size: 20px; letter-spacing: .06em; white-space: nowrap; }
.brand .reg { flex: none; padding: 2px 8px; border: 2px solid var(--alu); border-radius: 4px; }
/* The site logo: the tail-fin badge inside the registration-style box. */
.brand .reg.logo { display: inline-flex; align-items: center; gap: 7px; padding-left: 5px; }
.logo-mark { width: 24px; height: 24px; flex: none; color: var(--text); }
/* A long make and model is cut short rather than pushing the buttons out of the bar. */
.brand small { min-width: 0; max-width: 280px; overflow: hidden; text-overflow: ellipsis; font: 500 12px Inter, sans-serif; color: var(--muted); letter-spacing: 0; }
.reg.placeholder { border-style: dashed; color: var(--muted); }
.topbar .actions { flex: none; }
/* The aircraft's menu is a row of its own under the top bar; if it ever is wider than the window, it scrolls. */
.mainnav { display: flex; gap: 2px; padding: 0 20px; border-bottom: 1px solid var(--line); background: rgba(13,20,27,.94);
  overflow-x: auto; scrollbar-width: none; }
.mainnav::-webkit-scrollbar { display: none; }
.mainnav a { white-space: nowrap; padding: 10px 12px; border-radius: 6px; color: var(--muted); font-weight: 500; }
.mainnav a:hover { color: var(--text); background: var(--panel-2); }
.mainnav a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); border-radius: 0; }
.spacer { flex: 1; }
.topbar .search { width: 190px; }
.topbar .actions { display: flex; gap: 8px; align-items: center; }
/* Inside an aircraft: the Firstflight mark, back to the front page. */
.home-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px;
  border: 1px solid var(--line); border-radius: 8px; color: var(--text); }
.home-btn:hover { border-color: var(--accent); }
.home-btn svg { width: 22px; height: 22px; }
.menu-toggle { display: none; background: none; border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 6px 10px; font-size: 18px; cursor: pointer; }
.usermenu { position: relative; }
.usermenu summary { list-style: none; cursor: pointer; }
.usermenu summary::-webkit-details-marker { display: none; }
.usermenu .drop { position: absolute; right: 0; top: 42px; min-width: 200px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 8px; padding: 6px; box-shadow: 0 12px 30px rgba(0,0,0,.45); }
.usermenu .drop a, .usermenu .drop button { display: block; width: 100%; text-align: left; padding: 8px 10px; border-radius: 6px; color: var(--text); background: none; border: 0; font: inherit; cursor: pointer; }
.usermenu .drop a:hover, .usermenu .drop button:hover { background: var(--panel); }
.usermenu .drop a.current { color: var(--accent); }
.usermenu .menu-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.usermenu .who { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--line); margin-bottom: 4px; }

/* ---------- Buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; border-radius: 6px; font-weight: 600; border: 1px solid var(--line); background: var(--panel-2); color: var(--text); cursor: pointer; font: 600 14px Inter, system-ui, sans-serif; white-space: nowrap; }
.btn:hover { border-color: var(--muted); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #1b0d00; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #04210b; }
.btn.danger { border-color: var(--danger); color: var(--danger); background: transparent; }
.btn.small { padding: 4px 10px; font-size: 13px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea {
  width: 100%; background: var(--bg); border: 1px solid var(--line); color: var(--text); border-radius: 6px; padding: 8px 10px; font: inherit; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
textarea { min-height: 220px; resize: vertical; line-height: 1.55; }
input[type=file] { color: var(--muted); }
label { display: block; font-size: 13px; font-weight: 600; color: var(--alu); margin-bottom: 5px; }
.field { margin-bottom: 16px; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 500; }
.check input { width: 16px; height: 16px; accent-color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 0 16px; }
/* Browsers give a fieldset the width of its widest content; this lets it shrink with the page like any box. */
fieldset { min-width: 0; }
fieldset.panel { margin: 0 0 16px; }
label.check { overflow-wrap: anywhere; }
fieldset.panel legend { padding: 0 6px; font-weight: 600; }
.field-validation-error, .text-danger { color: var(--danger); font-size: 13px; }
.validation-summary-errors ul { margin: 0 0 14px; padding: 10px 14px 10px 30px; border: 1px solid var(--danger); border-radius: 8px; background: rgba(248,81,73,.08); color: var(--danger); }
.input-validation-error { border-color: var(--danger) !important; }

/* ---------- Phase strip ---------- */
.phases { display: flex; padding: 10px 20px; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 13px; overflow-x: auto; }
.phase { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 0; color: var(--muted); white-space: nowrap; }
.phase::after { content: ""; width: 28px; height: 1px; background: var(--line); margin-left: 6px; }
.phase:last-child::after { display: none; }
.phase .dot { width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--muted); }
.phase.done .dot { background: var(--ok); border-color: var(--ok); }
.phase.current { color: var(--text); font-weight: 600; }
.phase.current .dot { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }

/* ---------- Shell ---------- */
.shell { display: grid; grid-template-columns: 280px minmax(0, 1fr); min-height: calc(100vh - 106px); }
.shell.no-sidebar { grid-template-columns: minmax(0, 1fr); }
.shell.no-sidebar aside.sidebar { display: none; }
aside.sidebar { border-right: 1px solid var(--line); padding: 18px 12px; background: var(--bg); }
aside.sidebar h4 { margin: 4px 8px 10px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.mobile-only, .backdrop { display: none; }
main.content { padding: 24px 28px 60px; max-width: 1200px; width: 100%; }
.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 14px; display: flex; gap: 6px; flex-wrap: wrap; }
.crumbs a:hover { color: var(--text); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-head p { margin: 0; color: var(--muted); }
.flash { padding: 10px 14px; border-radius: 8px; margin-bottom: 18px; border: 1px solid var(--ok); background: rgba(63,185,80,.1); color: var(--ok); }
.flash.warn { border-color: var(--warn, #d29922); background: rgba(210,153,34,.1); color: var(--text); }
footer.site { border-top: 1px solid var(--line); padding: 28px 28px 18px; font-size: 13px; color: var(--muted); background: var(--bg); }
.footer-cols { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 24px; max-width: 1200px; }
.footer-cols h3 { margin: 0 0 8px; font-size: 11px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }
.footer-about strong { color: var(--text); font-size: 14px; }
.footer-about p { margin: 6px 0 0; max-width: 360px; }
.footer-links, .footer-company { display: flex; flex-direction: column; gap: 6px; overflow-wrap: anywhere; }
footer.site a { color: var(--muted); }
footer.site a:hover { color: var(--text); }
.footer-bottom { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); max-width: 1200px; }
@media (max-width: 900px) { .footer-cols { grid-template-columns: repeat(2, minmax(0, 1fr)); } .footer-about { grid-column: 1 / -1; } }

/* Privacy policy, terms and the other legal pages. */
.legal { max-width: 760px; }
.legal > .muted { margin-top: -6px; }
.legal .prose h2 { margin-top: 28px; }
.legal .prose table { width: 100%; border-collapse: collapse; }
.legal .prose th, .legal .prose td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.company-block { font-style: normal; line-height: 1.7; }
.consent { margin: 4px 0 16px; }
.consent label.check { align-items: flex-start; font-size: 14px; }
.consent label.check a { color: var(--accent); }
.plan-note { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 14px; padding: 10px 14px; margin-bottom: 18px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0; background: var(--panel); font-size: 14px; }
/* Cookie consent banner: fixed at the bottom, above everything but dialogs. */
.consent-banner { position: fixed; z-index: 60; left: 16px; right: 16px; bottom: 16px; max-width: 760px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 16px 18px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 12px 40px rgba(0,0,0,.45); font-size: 14px; }
.consent-banner[hidden] { display: none; }
.consent-banner > div:first-child { flex: 1 1 320px; min-width: 0; }
.consent-banner p { margin: 4px 0 0; color: var(--muted); }
.consent-banner a { color: var(--accent); }
.consent-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.consent-actions .btn { min-width: 150px; justify-content: center; }
.btn.what-is { white-space: nowrap; }
.usermenu-name { max-width: 220px; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 380px) { .btn.what-is { padding-left: 10px; padding-right: 10px; font-size: 13px; } }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: var(--muted); cursor: pointer; text-decoration: underline; }
.link-button:hover { color: var(--text); }
.export-list { margin: 0 0 18px; padding-left: 18px; display: grid; gap: 6px; }
.export-group { border: 0; padding: 0; margin: 0 0 14px; min-width: 0; }
.export-group legend { padding: 0; margin-bottom: 6px; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.export-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.export-grid.chapters { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.export-choice { display: flex; align-items: flex-start; gap: 10px; margin: 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel-2); cursor: pointer; font-weight: 400; }
.export-choice:has(input:checked) { border-color: var(--accent); }
.export-choice input { width: 16px; height: 16px; margin: 2px 0 0; flex: none; accent-color: var(--accent); }
.export-choice span { display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.export-choice small { color: var(--muted); font-size: 12px; }
.export-choice.off, .export-group.off { opacity: .45; }
.export-choice.off { cursor: default; }
.danger-zone { border-color: rgba(248, 81, 73, .45); }

/* ---------- Section tree ---------- */
.tree details { margin-bottom: 2px; }
.tree summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: 1fr auto; gap: 4px 8px; padding: 8px; border-radius: 6px; }
.tree summary::-webkit-details-marker { display: none; }
.tree summary:hover { background: var(--panel); }
.tree summary .name { font-weight: 600; }
.tree details.active > summary .name { color: var(--accent); }
.tree summary .pct { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.bar { grid-column: 1 / -1; height: 4px; background: var(--panel-2); border-radius: 2px; overflow: hidden; }
.bar i { display: block; height: 100%; background: var(--accent); }
.bar i.full { background: var(--ok); }
.tree ul { list-style: none; margin: 2px 0 8px 14px; padding: 0 0 0 14px; border-left: 1px solid var(--line); }
.tree li a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: 4px; color: var(--muted); font-size: 14px; }
.tree li a:hover { color: var(--text); background: var(--panel); }
.tree li a.active { color: var(--accent); background: var(--accent-soft); }
.tree li a.optional { font-style: italic; }
.tree .all { font-size: 13px; }
.st { font-size: 11px; }
/* In service: operations links and the build log folded up. */
.side-links { display: flex; flex-direction: column; gap: 2px; margin-bottom: 18px; }
.side-links a { padding: 8px; border-radius: 6px; font-weight: 600; overflow-wrap: anywhere; }
.side-links a:hover { background: var(--panel); }
.side-links a.active { color: var(--accent); background: var(--accent-soft); }
.side-links.compact { margin: 2px 0 0; }
.side-links.compact a { padding: 5px 8px; font-weight: 400; font-size: 14px; color: var(--muted); }
.side-links.compact a:hover { color: var(--text); }
.side-links.compact a.active { color: var(--accent); }
.build-history summary { list-style: none; cursor: pointer; display: flex; align-items: baseline; justify-content: space-between; gap: 8px; border-radius: 6px; padding-right: 8px; }
.build-history summary::-webkit-details-marker { display: none; }
.build-history summary:hover { background: var(--panel); }
.build-history summary h4 { margin-bottom: 4px !important; }
.build-history summary h4::before { content: "▸ "; }
.build-history[open] summary h4::before { content: "▾ "; }
.build-history .pct { font-family: var(--mono); font-size: 12px; color: var(--muted); }
.st.ok { color: var(--ok); } .st.wip { color: var(--accent); } .st.insp { color: var(--warn); }

/* ---------- Panels, hero, gauges ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 18px; margin-bottom: 18px; }
.hero { display: grid; grid-template-columns: 1.1fr 1fr; gap: 24px; background: radial-gradient(ellipse at 70% 40%, #1d2b39 0%, var(--panel) 70%); border: 1px solid var(--line); border-radius: 12px; padding: 24px; margin-bottom: 24px; }
.hero h1 { font-size: 30px; }
.hero p { color: var(--muted); margin: 0 0 18px; }
/* As many tiles per row as fit; big numbers (e.g. costs) get a row of their own instead of spilling out. */
.gauges { display: grid; grid-template-columns: repeat(auto-fit, minmax(105px, 1fr)); gap: 12px; }
.gauges.money { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.gauge { min-width: 0; }
.gauge .v { overflow-wrap: anywhere; }
.gauges.four { grid-template-columns: repeat(4, 1fr); }
.gauge { background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; }
.gauge .v { font-family: var(--mono); font-size: 26px; font-weight: 700; }
.gauge .l { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.plane { display: flex; align-items: center; justify-content: center; }
.plane svg { width: 100%; max-width: 340px; height: auto; }
.plane .part { stroke: var(--alu); stroke-width: 1.2; transition: stroke .15s; }
.plane a:hover .part { stroke: var(--accent); stroke-width: 2; }
.legend { display: flex; gap: 14px; font-size: 12px; color: var(--muted); justify-content: center; margin-top: 8px; }
.legend span::before { content: ""; display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; background: var(--c); }

/* ---------- Entries ---------- */
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 8px 0 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.chip { padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; color: var(--muted); white-space: nowrap; }
.chip:hover { color: var(--text); }
.chip.on { border-color: var(--accent); color: var(--accent); }
.entry { display: grid; grid-template-columns: 140px minmax(0, 1fr) auto; gap: 18px; padding: 16px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); margin-bottom: 12px; }
.entry:hover { border-color: #3a4c5e; }
.entry .thumb { aspect-ratio: 4/3; border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(135deg, #223140 0 8px, #1b2733 8px 16px); display: grid; place-items: center; color: var(--muted); font-size: 11px; }
.entry .thumb img { width: 100%; height: 100%; object-fit: cover; }
.meta { font-size: 12px; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 4px; }
.tag { font-family: var(--mono); font-size: 12px; color: var(--alu); background: var(--panel-2); padding: 1px 6px; border-radius: 4px; text-transform: uppercase; }
.entry h3 { margin: 0 0 4px; font-size: 17px; }
.entry p { margin: 0; color: var(--muted); font-size: 14px; }
.entry .side { text-align: right; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.entry .hrs { font-family: var(--mono); font-size: 18px; color: var(--text); }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 999px; white-space: nowrap; }
.badge.ok { background: rgba(63,185,80,.15); color: var(--ok); }
.badge.insp { background: rgba(227,179,65,.15); color: var(--warn); }
.badge.bad { background: rgba(248,81,73,.15); color: var(--danger); }
.badge.wip { background: var(--accent-soft); color: var(--accent); }
.badge.none { background: var(--panel-2); color: var(--muted); }
.badge.count { background: var(--warn); color: #241a00; margin-left: 2px; }
.badge.count.late, .tasks-btn.late .badge.count { background: var(--danger); color: #fff; }
.badge.buy { background: rgba(88,166,255,.15); color: #58a6ff; }

/* ---------- Switch (notifications by e-mail) ---------- */
.email-switch { margin: 0; }
.switch-button { display: inline-flex; align-items: center; gap: 8px; background: none; border: 0; padding: 4px 0; color: var(--text); font: 500 13px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
/* In the bell menu, ".usermenu .drop button" would make it a full-width block and squash the track under the text. */
.usermenu .drop .switch-button { display: inline-flex; width: auto; padding: 4px 0; border-radius: 0; color: var(--text); }
.usermenu .drop .switch-button:hover { background: none; }
.switch-track { display: inline-block; position: relative; width: 34px; height: 20px; flex: none; border-radius: 999px; background: var(--panel-2); border: 1px solid var(--line); transition: background .15s; }
.switch-track span { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s, background .15s; }
.switch-button[aria-checked=true] .switch-track { background: var(--accent); border-color: var(--accent); }
.switch-button[aria-checked=true] .switch-track span { transform: translateX(14px); background: #fff; }
.switch-button:focus-visible .switch-track { outline: 2px solid var(--accent); outline-offset: 2px; }
.bell-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }

/* ---------- Busy while a form is sent (site.js) ---------- */
.btn.is-busy { cursor: progress; opacity: 1 !important; }
.btn:disabled { opacity: .6; cursor: not-allowed; }
.btn-spinner { width: 14px; height: 14px; flex: none; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
html.page-busy, html.page-busy * { cursor: progress; }
html.page-busy body::before { content: ""; position: fixed; z-index: 100; top: 0; left: 0; height: 3px; width: 40%; background: var(--accent); animation: busy-bar 1.1s ease-in-out infinite; }
@keyframes busy-bar { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) {
  .btn-spinner { animation-duration: 2s; }
  html.page-busy body::before { animation: none; width: 100%; opacity: .7; }
}

/* ---------- Drafts ---------- */
.drafts { margin-bottom: 18px; border-left: 3px solid var(--warn); }
.drafts h2 { font-size: 16px; margin: 0 0 8px; }
.drafts ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.drafts li { display: flex; align-items: center; gap: 10px; }
.drafts li > a:first-child { flex: 1; min-width: 0; display: flex; flex-direction: column; padding: 6px 8px; border-radius: 6px; overflow-wrap: anywhere; color: var(--text); }
.drafts li > a:first-child:hover { background: var(--panel-2); }
.drafts li .muted { font-size: 12px; }
.draft-note { border-left-color: var(--warn); }

/* ---------- YouTube video on a log entry ---------- */
.entry-video { margin: 20px 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; width: 100%; max-width: 820px; border-radius: 10px; overflow: hidden; background: #000; border: 1px solid var(--line); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-play { position: absolute; inset: 0; width: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; border: 0; background: radial-gradient(circle at center, #1c2733 0%, #0b0f14 70%); color: var(--text); cursor: pointer; font: 600 15px Inter, system-ui, sans-serif; }
.video-play .play-icon { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: #ff0033; color: #fff; font-size: 26px; padding-left: 4px; }
.video-play small { color: var(--muted); font-weight: 400; font-size: 12px; }
.video-play:hover .play-icon { transform: scale(1.06); }
.video-links { margin: 8px 0 0; font-size: 14px; }
.video-edit { margin-top: 10px; }
.video-edit summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.video-form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; max-width: 640px; }
.video-form input { flex: 1 1 260px; min-width: 0; }
.tag.video-tag { color: #ff6b81; }

/* ---------- Links from chapters and sections ---------- */
.external-links { margin: 0 0 22px; }
.external-links h2 { font-size: 15px; margin: 0 0 8px; }
.external-links ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; gap: 6px; }
.external-links li { display: flex; align-items: center; gap: 8px; }
.external-links li > a { flex: 1; min-width: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); overflow-wrap: anywhere; }
.external-links li > a:hover { border-color: var(--accent); }
.external-links .link-title { font-weight: 600; }
.external-links .link-host { font-size: 12px; color: var(--muted); }
.external-links li form { flex: none; }
.link-add summary { cursor: pointer; color: var(--muted); font-size: 14px; }
.link-add form { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.link-add input[type=url] { flex: 2 1 260px; min-width: 0; }
.link-add input[type=text] { flex: 1 1 200px; min-width: 0; }

/* ---------- Tasks ---------- */
.task-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.task { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); }
.task.overdue { border-color: rgba(248,81,73,.55); }
.task.done .task-title span:last-child { text-decoration: line-through; color: var(--muted); }
.task-check { flex: none; margin: 0; }
.task-check button, .task-check.static { width: 24px; height: 24px; display: grid; place-items: center; border: 2px solid var(--alu); border-radius: 6px; background: transparent; color: var(--ok); font-weight: 700; cursor: pointer; padding: 0; }
.task-check.static { cursor: default; opacity: .6; }
.task-check button:hover { border-color: var(--accent); }
.task.done .task-check button { border-color: var(--ok); }
.task-body { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.task-title { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.task-meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12px; color: var(--muted); margin-top: 2px; }
.task-meta .late { color: var(--danger); font-weight: 600; }
.task-edit { flex: none; }
.task-list.compact .task { padding: 6px 10px; }
.task-columns { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; }
.task-columns h2 { font-size: 16px; margin: 0 0 10px; }
.task-done summary { cursor: pointer; color: var(--muted); margin-bottom: 10px; }
.task-add { display: flex; flex-wrap: wrap; gap: 8px; }
.task-add input[type=text] { flex: 1 1 240px; min-width: 0; }
.task-add select, .task-add input[type=date] { flex: none; width: auto; }
.tasks-panel { margin-top: 24px; }
.tasks-panel .task-list { margin-bottom: 12px; }
.task-fieldset .task-list { margin-bottom: 12px; }
.task-line { display: flex; gap: 8px; margin-bottom: 8px; }
.task-line select { flex: none; width: auto; }
.task-line input { flex: 1; min-width: 0; }
.tasks-btn .badge.count { margin-left: 4px; }
.tasks-btn > span[aria-hidden] { line-height: 1; }
/* At the top of the sidebar. */
.side-tasks { margin: 0 0 18px; padding: 10px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: 0 8px 8px 0; background: var(--panel); }
.side-tasks h4 { display: flex; align-items: center; justify-content: space-between; margin: 0 0 6px !important; }
.side-tasks h4 a { color: inherit; }
.side-tasks ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.side-tasks li a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; padding: 4px 2px; font-size: 13px; color: var(--text); overflow-wrap: anywhere; }
.side-tasks li a:hover { color: var(--accent); }
.side-tasks li small { color: var(--muted); margin-left: auto; }
.side-tasks li.late small { color: var(--danger); font-weight: 600; }
.side-tasks p { margin: 0; font-size: 13px; }
.side-tasks .more { display: inline-block; margin-top: 6px; font-size: 12px; }
.empty { padding: 40px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 10px; }
.pager { display: flex; gap: 6px; justify-content: center; margin-top: 18px; }

/* Entry details */
.article { max-width: 820px; }
.article .lead-meta { display: flex; gap: 14px; flex-wrap: wrap; align-items: center; color: var(--muted); font-size: 13px; margin-bottom: 20px; }
.prose { font-size: 16px; line-height: 1.7; overflow-wrap: break-word; }
.prose p { margin: 0 0 1em; }
.prose h2 { font-size: 21px; margin: 1.4em 0 .5em; }
.prose h3 { font-size: 18px; margin: 1.2em 0 .4em; }
.prose ul, .prose ol { margin: 0 0 1em; padding-left: 1.4em; }
.prose li { margin: .2em 0; }
.prose blockquote { margin: 0 0 1em; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--alu); }
.prose table { border-collapse: collapse; margin: 0 0 1em; max-width: 100%; display: block; overflow-x: auto; }
.prose th, .prose td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.prose th { background: var(--panel-2); }
.prose img { max-width: 100%; height: auto; border-radius: 6px; }
.prose figure { margin: 0 0 1em; }
.prose figcaption { font-size: 13px; color: var(--muted); margin-top: 4px; }
.article img.featured { display: block; width: 100%; max-height: 480px; object-fit: cover; border-radius: 8px; margin-bottom: 20px; }
.featured-picker { display: flex; flex-wrap: wrap; gap: 8px; }
.featured-picker button { width: 96px; height: 72px; padding: 0; border: 2px solid var(--line); border-radius: 6px; background: var(--panel-2); color: var(--muted); font: inherit; font-size: 12px; cursor: pointer; overflow: hidden; }
.featured-picker button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.featured-picker button[aria-checked="true"] { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); color: var(--accent); }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; margin: 20px 0; }
.photos figure { margin: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.photos img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; }
.photos figcaption { padding: 6px 8px; font-size: 12px; color: var(--muted); }
.photos .del { display: flex; gap: 6px; align-items: center; padding: 6px 8px; font-size: 12px; color: var(--danger); }
.inspection { border-left: 3px solid var(--line); }
.inspection.ok { border-left-color: var(--ok); }
.inspection.insp { border-left-color: var(--warn); }
.inspection.bad { border-left-color: var(--danger); }

/* ---------- Section cards / tables ---------- */
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: block; }
a.card:hover { border-color: var(--accent); }
.card h3 { margin: 0 0 8px; font-size: 17px; display: flex; justify-content: space-between; }
.card h3 span { font-family: var(--mono); font-size: 13px; color: var(--muted); }
.card .bar { margin-bottom: 10px; }
table.data { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; font-size: 14px; }
table.data th, table.data td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
table.data th { font-size: 11px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); background: var(--panel-2); }
table.data tr:last-child td { border-bottom: 0; }
table.data td.num { font-family: var(--mono); text-align: right; }
.table-wrap { overflow-x: auto; }

/* ---------- Gallery ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.gallery a { position: relative; border-radius: 8px; overflow: hidden; border: 1px solid var(--line); background: var(--panel); }
.gallery img { width: 100%; aspect-ratio: 4/3; object-fit: cover; display: block; transition: transform .2s; }
.gallery a:hover img { transform: scale(1.03); }
.gallery .cap { position: absolute; inset: auto 0 0 0; padding: 18px 10px 8px; font-size: 12px; background: linear-gradient(transparent, rgba(0,0,0,.8)); }

/* ---------- Stats bars ---------- */
.hbars { display: grid; gap: 8px; }
.hbar { display: grid; grid-template-columns: 180px 1fr 70px; gap: 12px; align-items: center; font-size: 14px; }
.hbar .track { height: 10px; background: var(--panel-2); border-radius: 5px; overflow: hidden; }
.hbar .track i { display: block; height: 100%; background: var(--accent); border-radius: 5px; }
.hbar .v { font-family: var(--mono); text-align: right; color: var(--muted); }
.vbars { display: flex; align-items: flex-end; gap: 6px; height: 180px; padding-top: 10px; }
.vbars .col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.vbars .col i { width: 100%; max-width: 36px; background: var(--accent); border-radius: 4px 4px 0 0; min-height: 2px; }
.vbars .col span { font-size: 10px; color: var(--muted); font-family: var(--mono); white-space: nowrap; }

/* ---------- Inventory ---------- */
.toolbar { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.toolbar > input[type=search] { max-width: 280px; }
.toolbar > select { width: auto; }
.toolbar .check { margin: 0 0 8px; }
.line-grid { display: grid; grid-template-columns: 1fr 2fr 110px 120px; gap: 0 12px; }
.line-grid .wide { grid-column: span 2; }
.add-summary { cursor: pointer; font-weight: 600; color: var(--accent); }
table.data tr.row-ok td { background: rgba(63,185,80,.06); }
table.data tr.row-bad td { background: rgba(248,81,73,.08); }
table.data td input, table.data td select { padding: 5px 8px; }
.qty { display: flex; gap: 6px; }
.qty input { width: 90px; }

/* Landing page. The site-wide pages (no aircraft) are centred. */
.shell.no-sidebar main.content { margin: 0 auto; max-width: 1240px; }
.landing-hero { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 32px; align-items: center;
  background: radial-gradient(ellipse at 80% 20%, #2a4258 0%, #16222d 55%, var(--panel) 100%); border: 1px solid var(--line);
  border-radius: 16px; padding: 44px 40px; margin-bottom: 28px; overflow: hidden; }
.landing-hero .eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 12px; }
.landing-hero h1 { font-size: 40px; line-height: 1.12; margin: 0 0 16px; letter-spacing: -.01em; }
.landing-hero .lead { color: #b9c6d2; font-size: 17px; line-height: 1.65; margin: 0 0 24px; max-width: 600px; }
.hero-stats { display: flex; gap: 28px; flex-wrap: wrap; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.hero-stats div { display: grid; }
.hero-stats strong { font-family: var(--mono); font-size: 26px; color: var(--text); }
.hero-stats span { font-size: 12px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.hero-photo { position: relative; display: block; border-radius: 12px; overflow: hidden; aspect-ratio: 4/3; border: 1px solid var(--line);
  box-shadow: 0 24px 60px rgba(0,0,0,.45); transform: rotate(1.2deg); transition: transform .2s; }
.hero-photo:hover { transform: rotate(0); }
.hero-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero-photo .caption { position: absolute; inset: auto 0 0 0; padding: 28px 14px 12px; color: #fff; font-weight: 600; font-size: 14px;
  background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.reg-tag { font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: .06em; padding: 1px 6px; border: 1px solid var(--alu); border-radius: 3px; margin-right: 4px; }
.landing-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; align-items: start; }
.landing-side { position: sticky; top: 76px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 18px; }
.landing-side h2 { font-size: 16px; margin: 0 0 12px; }
.latest-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.latest-list a { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 10px; padding: 8px; border-radius: 8px; color: var(--text); }
.latest-list a:hover { background: var(--panel-2); }
.latest-list .thumb { width: 56px; height: 56px; border-radius: 6px; overflow: hidden; background: repeating-linear-gradient(135deg, #223140 0 6px, #1b2733 6px 12px); }
.latest-list .thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.latest-list .text { display: grid; gap: 2px; font-size: 13px; line-height: 1.35; }
.latest-list .text strong { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.latest-list .text .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.latest-list .meta { color: var(--muted); font-size: 12px; }
.features { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; margin-bottom: 24px; }
.feature { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
.feature h3 { margin: 0 0 6px; font-size: 16px; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; line-height: 1.5; }
.access ol { margin: 8px 0 0; padding-left: 1.2em; display: grid; gap: 8px; line-height: 1.55; }
@media (max-width: 1100px) {
  .landing-grid { grid-template-columns: minmax(0, 1fr); }
  .landing-side { position: static; }
}
@media (max-width: 900px) {
  .landing-hero { grid-template-columns: minmax(0, 1fr); padding: 30px 24px; }
  .hero-photo { transform: none; }
}
@media (max-width: 640px) {
  .landing-hero { padding: 24px 18px; }
  .landing-hero h1 { font-size: 28px; }
  .hero-stats { gap: 18px; }
}

/* Plans (Free / Pro) */
.plans-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; max-width: 860px; }
.promo-form { display: flex; flex-wrap: wrap; gap: 8px; max-width: 460px; }
.promo-form input { flex: 1 1 200px; min-width: 0; }
.billing-prices input { min-width: 150px; width: 100%; }
.pricing-page { max-width: 1100px; }
.pricing-page h1 { margin-bottom: 10px; }
.plans-grid.three { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); max-width: 1100px; }
.plan { display: flex; flex-direction: column; margin: 0; }
.plan h2 { margin: 0 0 4px; }
.plan .price { font-family: var(--mono); font-size: 20px; margin: 0 0 12px; }
.plan .price .muted { font-size: 13px; }
/* The list fills the card so the buttons line up at the bottom, but its rows stay together at the top: without
   align-content the grid spread the spare height between the bullets of a shorter card. */
.plan ul { margin: 0 0 16px; padding-left: 1.1em; display: grid; gap: 4px; flex: 1; align-content: start; }
.plan.pro { border-color: var(--accent); }
.plan.current { box-shadow: 0 0 0 2px var(--accent-soft); }
.upgrade .eyebrow, .plan .eyebrow { color: var(--accent); font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .14em; margin: 0 0 8px; }

/* Aircraft cards on the front page */
.aircraft-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.aircraft-card { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; color: var(--text); transition: border-color .15s, transform .15s; }
.aircraft-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.aircraft-card .photo { aspect-ratio: 16/9; display: grid; place-items: center; font-size: 34px; color: var(--line);
  background: repeating-linear-gradient(135deg, #223140 0 8px, #1b2733 8px 16px); }
.aircraft-card .photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.aircraft-card .body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; }
.aircraft-card .head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.aircraft-card .reg { font-family: var(--mono); font-weight: 700; font-size: 18px; letter-spacing: .06em; padding: 1px 8px; border: 2px solid var(--alu); border-radius: 4px; }
/* No registration yet: the example registration, dashed, as in the top bar. */
.aircraft-card .reg.placeholder, .reg-tag.placeholder { border-style: dashed; color: var(--muted); }
.aircraft-card .type { font-weight: 600; }
.aircraft-card .tagline { font-size: 13px; }
.aircraft-card .bar { height: 6px; background: var(--bg); border-radius: 3px; overflow: hidden; margin-top: 4px; }
.aircraft-card .bar span { display: block; height: 100%; background: var(--accent); }
.aircraft-card .stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--muted); }
.switch { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .track { flex: none; width: 40px; height: 22px; border-radius: 11px; background: var(--line); position: relative; transition: background .15s; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--text); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 2px solid var(--accent); outline-offset: 2px; }
.wizard-steps { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; font-size: 12px; text-transform: uppercase; letter-spacing: .08em; }
.wizard-steps span { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.wizard-steps .on { border-color: var(--accent); color: var(--accent); }
.wizard-steps .done { color: var(--text); }
.template-choice { border: 0; padding: 0; margin: 0 0 16px; display: grid; gap: 8px; }
.template-choice legend { font-weight: 600; margin-bottom: 6px; }
.choice { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--accent); }
.choice input { margin-top: 4px; }
.choice > span { display: grid; gap: 2px; }
.choice .muted { font-size: 13px; }
.slug-field { display: flex; align-items: center; gap: 4px; }
.slug-field span { white-space: nowrap; font-size: 13px; }
.addresses { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.addresses li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
/* Generated addresses are one long word; let them break anywhere instead of widening the page. */
.addresses .mono { overflow-wrap: anywhere; min-width: 0; }

/* Search-as-you-type suggestions under an input (site.js). */
.combo { position: relative; }
.combo-list { position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; right: 0; max-height: 280px; overflow-y: auto;
  margin: 0; padding: 4px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.combo-list li { padding: 8px 10px; border-radius: 6px; cursor: pointer; overflow-wrap: anywhere; }
.combo-list li:hover, .combo-list li[aria-selected=true] { background: var(--accent-soft); color: var(--accent); }
.combo-list li.none { cursor: default; color: var(--muted); font-size: 13px; }
.combo-list li.none:hover { background: none; color: var(--muted); }

/* Name / value rows for the facts on "The aircraft". */
.spec-rows { display: grid; gap: 8px; margin-bottom: 10px; }
.spec-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) auto; gap: 8px; align-items: center; }
.spec-row > span { grid-column: 1 / -1; }
.spec-row input { min-width: 0; }
.spec-row input:first-child { font-weight: 600; }
@media (max-width: 640px) {
  .spec-row { grid-template-columns: minmax(0, 1fr) auto; }
  .spec-row input:nth-child(2) { grid-column: 1 / -1; grid-row: 2; }
  .spec-row { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
}

/* The facts table on "The aircraft". */
.facts { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.facts th, .facts td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.facts th { width: 35%; color: var(--muted); font-weight: 500; }
.facts td { overflow-wrap: anywhere; }

/* An admin signed in as a user: a red bar above everything, and a red frame around the window, on every page. */
.impersonation-bar { position: relative; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 14px; padding: 8px 16px; background: #b91c1c; color: #fff; font-size: 14px; text-align: center; }
.impersonation-bar form { margin: 0; }
.impersonation-bar .btn { background: #fff; color: #b91c1c; border-color: #fff; font-weight: 700; }
body.impersonating::after { content: ""; position: fixed; inset: 0; border: 4px solid #b91c1c; pointer-events: none; z-index: 1001; }
/* Still in view when the bar has scrolled away. */
body.impersonating::before { content: "Impersonating"; position: fixed; left: 50%; bottom: 0; transform: translateX(-50%); z-index: 1001;
  padding: 3px 12px; background: #b91c1c; color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; border-radius: 6px 6px 0 0; pointer-events: none; }

/* A demo aircraft seen by a visitor: a bar above everything says it is the owner's view, read-only. */
.demo-bar { position: relative; z-index: 30; display: flex; flex-wrap: wrap; align-items: center; justify-content: center;
  gap: 8px 14px; padding: 9px 16px; background: #1d4ed8; color: #fff; font-size: 14px; text-align: center; }
.demo-bar .demo-tag { padding: 2px 8px; border: 1px solid #fff; border-radius: 4px; font-size: 12px; font-weight: 700;
  letter-spacing: .1em; text-transform: uppercase; }
.demo-bar .btn { background: #fff; color: #1d4ed8; border-color: #fff; font-weight: 700; }

/* The next maintenance deadlines on the front page of an aircraft in service. */
.deadline-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.deadline-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 2px 10px; align-items: baseline;
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; }
.deadline-list .title { font-weight: 600; overflow-wrap: anywhere; }
.deadline-list .when { grid-column: 2; font-size: 12px; }

/* Modal dialogs (open with data-dialog="id", close with data-close): centred above everything, always inside the window. */
dialog.modal { width: min(460px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); overflow: auto; margin: auto; padding: 22px;
  background: var(--panel-2); color: var(--text); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 24px 60px rgba(0,0,0,.6);
  text-align: left; white-space: normal; overflow-wrap: anywhere; }
dialog.modal::backdrop { background: rgba(0,0,0,.6); }
dialog.modal h2 { margin: 0 0 8px; font-size: 18px; }
dialog.modal p { margin: 0 0 14px; color: var(--muted); font-size: 14px; line-height: 1.5; }
dialog.modal label { display: block; font-size: 13px; margin-bottom: 6px; }
dialog.modal input { margin-bottom: 14px; }
dialog.modal .btn-row { justify-content: flex-end; }

/* ---------- Tools ---------- */
.tool-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.tool-card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.tool-card:hover { border-color: var(--accent); }
.tool-card .img { aspect-ratio: 4/3; display: grid; place-items: center; color: var(--muted); font-size: 11px; background: repeating-linear-gradient(135deg, #223140 0 8px, #1b2733 8px 16px); }
.tool-card .img img { width: 100%; height: 100%; object-fit: cover; }
.tool-card .body { padding: 12px 14px 14px; }
.tool-card h3 { margin: 6px 0 4px; font-size: 16px; }

/* ---------- Tabs ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 18px; overflow-x: auto; scrollbar-width: none; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; background: none; border: 0; border-bottom: 2px solid transparent; margin-bottom: -1px; color: var(--muted); font: 600 15px Inter, system-ui, sans-serif; cursor: pointer; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.tab:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 6px 6px 0 0; }
.tab-count { font: 600 11px var(--mono); padding: 1px 7px; border-radius: 999px; background: var(--panel-2); color: var(--muted); }
.tab-count.bad { background: rgba(248,81,73,.18); color: var(--danger); }
.tab-count.ok { background: rgba(63,185,80,.15); color: var(--ok); }
.tab-panel .comments { margin-top: 24px; }

/* ---------- Notifications ---------- */
.bell-btn { position: relative; padding: 7px 10px; }
.bell-btn .badge.count { position: absolute; top: -6px; right: -6px; margin: 0; background: var(--accent); color: #1b0d00; }
.bell-drop { width: 340px; max-width: calc(100vw - 24px); }
/* Five fit without scrolling; a longer list of unread ones scrolls inside the panel, with the head and foot in place. */
.bell-list { max-height: min(340px, 55vh); overflow-y: auto; overscroll-behavior: contain; }

/* Pilot log: many small time fields, as many per row as fit; a fieldset must be allowed to shrink. */
.pilot-form fieldset { min-width: 0; }
.pilot-form .grid-4 { grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); }
.time-input { display: flex; gap: 6px; align-items: center; }
.time-input input { min-width: 0; flex: 1; }
.time-input .btn { flex: none; white-space: nowrap; }
.recency { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.recency li { padding-left: 18px; position: relative; }
.recency li::before { content: ""; position: absolute; left: 0; top: 7px; width: 9px; height: 9px; border-radius: 50%; background: var(--warn, #d29922); }
.recency li.ok::before { background: var(--ok); }
.data.totals th { font-weight: 500; color: var(--muted); }
/* App prompt (install and push), for signed-in users. */
.app-prompt { position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 900;
  width: min(560px, calc(100vw - 24px)); display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; padding: 12px 14px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45); }
.app-prompt[hidden] { display: none; }
.app-prompt img { border-radius: 10px; flex: none; }
.app-prompt p { margin: 0; flex: 1 1 200px; font-size: 14px; }
.app-prompt-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-left: auto; }
.ios-steps { padding-left: 20px; display: grid; gap: 8px; }
.ios-steps svg { vertical-align: -3px; }

/* Flight map: OpenStreetMap toned down to the dark design; tracks glow where they cross. */
.flight-map-panel { margin-bottom: 18px; }
/* Its own stacking context: Leaflet's layers (z-index up to 1000) stay under the site's menus and dialogs. */
.flight-map { position: relative; z-index: 0; height: min(460px, 60vh); border-radius: 8px; border: 1px solid var(--line); background: var(--bg); overflow: hidden; }
.flight-map .leaflet-tile-pane { filter: invert(1) hue-rotate(180deg) brightness(.8) contrast(.85) saturate(.35); }
.flight-map .leaflet-container, .flight-map.leaflet-container { background: var(--bg); font: inherit; }
.flight-map .flight-track { mix-blend-mode: screen; }
.flight-map .leaflet-control-attribution { background: rgba(13,20,27,.75); color: var(--muted); }
.flight-map .leaflet-control-attribution a { color: var(--muted); }
.flight-map .leaflet-bar a { background: var(--panel); color: var(--text); border-color: var(--line); }
.flight-map .leaflet-tooltip { background: var(--panel); color: var(--text); border: 1px solid var(--line); box-shadow: none; }
.map-period { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 13px; }
.map-period label { display: flex; gap: 6px; align-items: center; color: var(--muted); }
.map-period input[type=date] { width: auto; padding: 4px 6px; }
.ratings { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.rating { border-left: 3px solid var(--ok); padding: 2px 0 2px 10px; }
.rating.due { border-left-color: var(--warn, #d29922); }
.rating.bad { border-left-color: var(--bad, #f85149); }
.rating-head { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rating-actions { margin-left: auto; display: flex; gap: 6px; }
.rating-history { list-style: none; margin: 4px 0 0; padding: 0; font-size: 13px; display: grid; gap: 2px; }
.rating-history li { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; }
.rating-history li::before { content: "•"; color: var(--muted); }
.rating-history li.current { font-weight: 600; }
.rating-history li.past, .rating-history li.past .muted { color: var(--muted); opacity: .7; font-weight: 400; }
.rating-history form { display: inline; margin: 0; }
.rating-history a { color: var(--muted); }
.checks { list-style: none; margin: 4px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 13px; }
.checks li::before { content: "○ "; color: var(--muted); }
.checks li.ok::before { content: "✔ "; color: var(--ok); }
[hidden] { display: none !important; }
.note { display: flex; flex-direction: column; gap: 2px; padding: 9px 10px; border-radius: 6px; font-size: 14px; color: var(--muted); }
.note.unread { color: var(--text); font-weight: 600; }
.note.unread::before { content: ""; float: left; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin: 6px 8px 0 0; }
.note:hover { background: var(--panel); }
.note small { font-weight: 400; font-size: 11px; }
.bell-foot { display: flex; justify-content: space-between; align-items: center; border-top: 1px solid var(--line); margin-top: 4px; padding: 6px 4px 0; font-size: 13px; }
.bell-foot a, .bell-foot button { width: auto !important; padding: 6px 8px !important; color: var(--accent) !important; }
.notes { display: grid; gap: 4px; max-width: 760px; }
.notes .note { background: var(--panel); border: 1px solid var(--line); }

/* ---------- Comments ---------- */
.comments { margin-top: 24px; }
.comment { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--panel); }
.comment.staff { border-left: 3px solid var(--accent); }
.comment .prose { font-size: 15px; }
.comment .prose p:last-child { margin-bottom: 0; }
.comment-form textarea { min-height: 90px; }
/* Profile pictures: a round thumbnail, or a generic silhouette in the site's colours. */
.avatar { display: inline-block; flex: none; border-radius: 50%; object-fit: cover; vertical-align: middle; border: 1px solid var(--line); background: var(--panel-2); }
.avatar.generic { display: inline-flex; align-items: flex-end; justify-content: center; overflow: hidden; color: var(--muted); }
.avatar.generic svg { width: 86%; height: 86%; }
.byline { display: inline-flex; align-items: center; gap: 6px; }
.comment .meta, .remark .meta { align-items: center; }
.avatar-edit { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; padding-bottom: 16px; border-bottom: 1px solid var(--line); }

/* Threads: a comment, its answers indented under a line, and the answer form folded away. */
.thread { margin-bottom: 12px; }
.thread > .comment { margin-bottom: 6px; }
.replies { margin-left: 22px; padding-left: 12px; border-left: 2px solid var(--line); }
.replies .comment { margin-bottom: 6px; }
.reply-box { margin-left: 34px; }
/* The answer button: a clear pill with a reply arrow, under each thread. */
.reply-box > summary { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; list-style: none;
  padding: 4px 12px; border: 1px solid var(--accent); border-radius: 999px; color: var(--accent); font-size: 13px; font-weight: 600; }
.reply-box > summary::-webkit-details-marker { display: none; }
.reply-box > summary:hover { background: var(--accent-soft); }
.reply-box[open] > summary { background: var(--accent); color: #fff; }
/* The form for a new comment, set apart from the threads. */
.new-comment { margin-top: 28px; padding-top: 18px; border-top: 1px solid var(--line); }
.new-comment h3 { margin: 0 0 4px; font-size: 16px; }
.reply-box .comment-form { margin-top: 6px !important; }
.reply-box .comment-form textarea { min-height: 70px; }
@media (max-width: 640px) { .replies { margin-left: 8px; } .reply-box { margin-left: 20px; } }
/* Likes */
.comment-actions { display: flex; gap: 10px; align-items: center; margin-top: 6px; min-height: 24px; }
.comment-actions form { margin: 0; }
.like { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px;
  background: transparent; color: var(--muted); font: inherit; font-size: 13px; cursor: pointer; text-decoration: none; }
.like:hover { color: var(--text); border-color: var(--muted); }
.like.on { color: #e11d48; border-color: #e11d48; }
.like.own { cursor: default; }
.like [data-count]:empty { display: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.comment-form .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Inspector review ---------- */
.review { border-left: 3px solid var(--line); }
.review.approved { border-left-color: var(--ok); }
.review .approval { padding: 10px 14px; border-radius: 8px; background: rgba(63,185,80,.08); margin-bottom: 12px; }
.remarks { list-style: none; margin: 8px 0 14px; padding: 0; }
.remark { padding: 10px 12px; border: 1px solid var(--line); border-radius: 8px; margin-bottom: 8px; background: var(--bg); }
.remark.open { border-color: rgba(248,81,73,.55); }
.remark.resolved { opacity: .75; }
.remark .prose { font-size: 15px; }
.remark .prose p:last-child { margin-bottom: 6px; }
.remark-form textarea, .approve-box textarea { min-height: 80px; margin-bottom: 8px; }
.review-request { padding: 10px 14px; border-radius: 8px; background: rgba(227,179,65,.1); border: 1px solid rgba(227,179,65,.4); margin: 4px 0 12px; }
.review-request-form { margin: 4px 0 12px; }
.review-request-form textarea { min-height: 70px; margin-bottom: 8px; }
.tasks { list-style: none; margin: 0; padding: 0; }
.tasks li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.tasks li:first-child { border-top: 0; }
.task-box { flex: none; width: 18px; height: 18px; border: 2px solid var(--muted); border-radius: 4px; }
.task-body { flex: 1; min-width: 0; }
.approve-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }

/* ---------- Plans ---------- */
.plans { margin-bottom: 22px; }
.plan-list { list-style: none; margin: 0; padding: 0; }
.plan-list li { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); flex-wrap: wrap; }
.plan-list li:first-child { border-top: 0; }
.plan-name { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 260px; }
.plan-name > span:last-child { overflow-wrap: anywhere; }
.plan-name small { display: block; font-size: 12px; }
.plan-name:hover { color: var(--accent); }
.plan-icon { flex: none; width: 42px; height: 50px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 4px; background: var(--panel-2); font: 700 11px var(--mono); color: var(--accent); }
.dropzone { position: relative; margin-top: 14px; border: 2px dashed var(--line); border-radius: 10px; background: var(--bg); transition: border-color .15s, background .15s; }
.dropzone input[type=file] { position: absolute; width: 1px; height: 1px; opacity: 0; }
.dropzone .dz-body { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 22px 16px; margin: 0; text-align: center; cursor: pointer; font-weight: 400; color: var(--text); }
.dropzone .dz-body strong { font-size: 15px; }
.dropzone .dz-body span { font-size: 13px; }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.dropzone input:focus-visible + .dz-body { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.dropzone.uploading .dz-body { display: none; }
.dropzone .dz-progress { padding: 18px 16px; }
.dropzone .dz-name { font-size: 13px; margin-bottom: 8px; overflow-wrap: anywhere; }
.dropzone .bar { height: 8px; }
.dropzone .bar i { width: 0; transition: width .2s; }
.plan-viewer { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.plan-viewer iframe { display: block; width: 100%; height: calc(100vh - 260px); min-height: 480px; border: 0; background: #525659; }
.plan-viewer img { display: block; max-width: 100%; height: auto; margin: 0 auto; }
.plan-viewer .mobile-hint { display: none; padding: 10px 14px; margin: 0; }

/* ---------- Auth ---------- */
.auth { max-width: 400px; margin: 40px auto; }
.auth .panel { padding: 26px; }

.head-gauges { min-width: 320px; }
.head-gauges.two { min-width: 240px; grid-template-columns: repeat(2, 1fr); }

/* ---------- Responsive ----------
   ≤1440  the top-bar search moves out (it is also on the Log page and in the drawer)
   ≤1200  menu drawer: the main menu, account links and section tree slide in from the left
   ≤900   single-column page layouts
   ≤640   phones: tables become cards, larger touch targets, 16px inputs (no iOS zoom) */
@media (max-width: 1440px) {
  .topbar .search { display: none; }
}

@media (max-width: 1200px) {
  .mainnav, .hide-sm { display: none !important; }
  .menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; padding: 0; }
  .brand small { display: none; }
  .shell, .shell.no-sidebar { grid-template-columns: minmax(0, 1fr); }
  aside.sidebar, .shell.no-sidebar aside.sidebar {
    display: block; position: fixed; z-index: 30; top: 60px; bottom: 0; left: 0;
    width: 320px; max-width: 86vw; overflow-y: auto; overscroll-behavior: contain;
    padding-bottom: calc(24px + env(safe-area-inset-bottom));
    border-right: 1px solid var(--line); transform: translateX(-100%); visibility: hidden;
    transition: transform .2s ease, visibility .2s; box-shadow: 8px 0 30px rgba(0,0,0,.5);
  }
  body.nav-open { overflow: hidden; }
  body.nav-open aside.sidebar { transform: none; visibility: visible; }
  .backdrop { display: block; position: fixed; inset: 60px 0 0 0; z-index: 25; background: rgba(0,0,0,.55); opacity: 0; pointer-events: none; transition: opacity .2s; }
  body.nav-open .backdrop { opacity: 1; pointer-events: auto; }
  .mobile-only { display: block; }
  .drawer-search { margin: 0 4px 14px; }
  .sidebar .mobile-nav { display: grid; gap: 2px; margin-bottom: 14px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
  .sidebar .mobile-nav a, .sidebar .mobile-nav button { display: flex; align-items: center; justify-content: space-between; min-height: 44px; padding: 8px 10px; border-radius: 6px; font: 600 15px Inter, system-ui, sans-serif; color: var(--text); background: none; border: 0; width: 100%; text-align: left; cursor: pointer; }
  .sidebar .mobile-nav a:hover, .sidebar .mobile-nav button:hover { background: var(--panel); }
  .sidebar .mobile-nav a.active { color: var(--accent); }
  .sidebar .mobile-nav .who { padding: 4px 10px 8px; font-size: 12px; color: var(--muted); overflow-wrap: anywhere; }
  .tree summary, .tree li a { min-height: 40px; align-items: center; }
}

@media (max-width: 900px) {
  main.content { padding: 18px 16px 50px; }
  .hero { grid-template-columns: 1fr; padding: 18px; }
  .gauges.four { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3, .line-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
  .line-grid .wide { grid-column: auto; }
  .hbar { grid-template-columns: 110px 1fr 56px; }
  .page-head > * { max-width: 100%; }
  .head-gauges, .head-gauges.two { min-width: 0; width: 100%; }
}

@media (max-width: 640px) {
  .topbar { gap: 10px; padding: 0 12px; }
  /* Dropdowns (bell and user menu) span the window under the top bar, whichever button opened them. */
  .usermenu .drop, .bell-drop { position: fixed; top: 60px; left: 8px; right: 8px; width: auto; min-width: 0; max-width: none; }
  .brand { font-size: 18px; }
  .hide-xs { display: none; }
  .plan-viewer iframe { height: 70vh; min-height: 360px; }
  .plan-viewer .mobile-hint { display: block; }
  h1 { font-size: 23px; overflow-wrap: anywhere; }
  .hero h1 { font-size: 24px; }
  .gauge { padding: 10px; }
  .gauge .v { font-size: 20px; }
  .gauge .l { font-size: 10px; }
  .phases { padding: 8px 12px; }
  .phase:not(.current) .label { display: none; }
  .phase::after { width: 14px; }
  .panel { padding: 14px; }
  main.content { padding: 14px 12px 40px; }
  footer.site { padding: 14px 12px calc(14px + env(safe-area-inset-bottom)); }

  /* Touch-friendly controls; 16px text stops iOS from zooming into fields. */
  input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=search], select, textarea { font-size: 16px; min-height: 44px; }
  .btn { min-height: 42px; }
  .btn.small { min-height: 36px; padding: 6px 12px; }
  .chip { padding: 7px 12px; }
  .section-head .filters { width: 100%; }
  .toolbar > * { flex: 1 1 100%; max-width: none !important; }
  .toolbar > select, .toolbar > .btn { width: 100%; }
  .page-head .btn-row { width: 100%; }
  .page-head .btn-row > .btn, .page-head .btn-row > form { flex: 1 1 auto; }
  .page-head .btn-row > form .btn { width: 100%; justify-content: center; }
  .page-head .btn-row .btn { justify-content: center; }

  /* Entry cards: small thumbnail beside the text. */
  .entry { grid-template-columns: 84px minmax(0, 1fr); gap: 12px; padding: 12px; }
  .entry .side { grid-column: 1 / -1; flex-direction: row; justify-content: space-between; align-items: center; text-align: left; }
  .entry h3 { font-size: 16px; }

  .gallery { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tool-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .tool-card .body { padding: 10px; }
  .photos { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hbar { grid-template-columns: 96px 1fr 48px; font-size: 13px; }
  .vbars .col span { writing-mode: vertical-rl; transform: rotate(180deg); }

  /* Tables marked .stack become one card per row; site.js labels each cell with its column. */
  table.stack { border: 0; background: none; }
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; margin-bottom: 10px; }
  table.stack tr.row-ok { border-color: rgba(63,185,80,.5); }
  table.stack tr.row-bad { border-color: rgba(248,81,73,.6); }
  table.data.stack tr.row-ok td, table.data.stack tr.row-bad td { background: none; }
  /* Label first, then the cell's content; content with several parts wraps onto full-width lines
     (a grid put the extra parts in the narrow label column, where they stuck out of the card). */
  table.stack td { display: flex; flex-wrap: wrap; align-items: baseline; column-gap: 10px; row-gap: 4px; padding: 6px 0; border: 0;
    text-align: left !important; overflow-wrap: anywhere; }
  table.stack td::before { flex: 0 0 min(35%, 130px); }
  table.stack td > * { min-width: 0; max-width: 100%; }
  table.stack td::before { content: attr(data-label); font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
  table.stack td:not([data-label])::before, table.stack td[data-label=""]::before { display: none; }
  table.stack td:empty { display: none; }
  table.stack td .btn-row { justify-content: flex-start !important; }
  table.stack td .qty input { width: 100%; }
}

