:root {
  --ink: #0b0d09;
  --panel: #13160f;
  --panel-2: #1a1e14;
  --line: #2a2e22;
  --paper: #ecebe2;
  --muted: #9b9d8d;
  --amber: #dc8a26;
  --ok: #9dbb62;
  --bad: #e5593c;

  /* marks drawn on the white sheets */
  --trace: #e0321c;
  --guide: #1677d9;
  --trace-b: #0a8a4a; /* second route: sheet 4 read backwards for maximum gross weight */

  --display: "Michroma", "Eurostile", "Arial Black", sans-serif;
  --body: "Hanken Grotesk", system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--ink);
  color: var(--paper);
  font: 400 .95rem/1.5 var(--body);
  -webkit-font-smoothing: antialiased;
  display: flex;
  flex-direction: column;
}

h1, h2 { font-family: var(--display); font-weight: 400; margin: 0; }
h1 { font-size: .95rem; }
h2 { font-size: .8rem; color: var(--muted); }
p { margin: 0; }

:focus-visible { outline: 2px solid var(--amber); outline-offset: 2px; border-radius: 4px; }

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: .7em 1.25em;
  border-radius: 999px;
  border: 1px solid transparent;
  font: 500 .9rem/1.2 var(--body);
  cursor: pointer;
  white-space: nowrap;
  text-decoration: none;
}
.btn--amber { background: var(--amber); color: #1a1205; }
.btn--amber:hover { background: #eea03f; }
.btn--small { padding: .45em 1.1em; font-size: .85rem; }
.btn--ghost { background: none; border-color: #4a4e3f; color: var(--paper); }
.btn--ghost:hover { border-color: var(--paper); }

/* Top bar */

.bar {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  padding: 10px 24px;
  border-bottom: 1px solid var(--line);
}
.wordmark {
  font-family: var(--display);
  font-size: .95rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  color: inherit;
}
.bar__link {
  grid-column: 3;
  justify-self: end;
  padding: 8px 16px;
  border: 1px solid #4a4e3f;
  border-radius: 999px;
  color: var(--paper);
  font-size: .9rem;
  text-decoration: none;
}
.bar__link:hover { border-color: var(--paper); }
.bar__nav { display: flex; gap: 4px; }
.bar__nav svg, .bar__account svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.bar__nav svg, .nav__account, .bar__company { display: none; }
.bar__account {
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 1px solid #4a4e3f;
  border-radius: 50%;
  color: var(--paper);
}
.bar__account:hover, .bar__account[aria-current="page"] { border-color: var(--amber); color: var(--amber); }
.bar__nav a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--muted);
  text-decoration: none;
  font-size: .9rem;
}
.bar__nav a:hover { color: var(--paper); }
.bar__nav a[aria-current="page"] { background: var(--panel-2); color: var(--paper); }
.bar__end { justify-self: end; display: flex; align-items: center; gap: 20px; }
.bar__ship { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .85rem; }

select {
  padding: 8px 12px;
  border: 1px solid #3a3f30;
  border-radius: 10px;
  background: var(--ink);
  color: var(--paper);
  font: 500 .95rem var(--body);
}

.link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--amber);
  font: inherit;
  font-size: .85rem;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
  justify-self: start;
}
.link--bad { color: var(--bad); }
.is-ok { color: var(--ok); }
.is-bad { color: var(--bad); }

/* First aircraft quiz */

.quiz { flex: 1; display: grid; place-content: center; padding: 32px 16px; }
.quiz__card { width: min(34rem, 100vw - 32px); display: grid; gap: 14px; }
.quiz__progress { display: grid; gap: 8px; color: var(--muted); font-size: .85rem; margin-bottom: 12px; }
.quiz__bar { height: 4px; border-radius: 2px; background: var(--panel-2); overflow: hidden; }
.quiz__bar i { display: block; height: 100%; background: var(--amber); transition: width .25s ease-out; }
.quiz__hello { color: var(--muted); }
.quiz h1 { font-size: clamp(1.1rem, 2.4vw, 1.5rem); line-height: 1.35; }
.quiz .field__box input { font-size: 1.3rem; padding: 14px 16px; }
.quiz__choices { display: grid; gap: 8px; }
.quiz__choices label { position: relative; }
.quiz__choices input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.quiz__choices span {
  display: block;
  padding: 14px 16px;
  border: 1px solid #3a3f30;
  border-radius: 10px;
  background: var(--ink);
}
.quiz__choices input:checked + span { border-color: var(--amber); background: rgba(220, 138, 38, .14); }
.quiz__choices input:focus-visible + span { outline: 2px solid var(--amber); outline-offset: 2px; }
.quiz__actions { display: flex; justify-content: space-between; gap: 10px; margin-top: 8px; }
.quiz__actions .btn--amber { margin-left: auto; }
.quiz .form-error { margin-top: 0; }
.quiz .form-error:empty { display: none; }
.quiz__actions { margin-top: 16px; }
.auth.quiz { justify-items: center; gap: 20px; }
.auth.quiz .card h1 { font-size: 1.15rem; }
.auth.quiz .card .field__box input { font-size: 1.05rem; padding: 10px 12px; }
.auth__below { font-size: .85rem; }
.auth__below a { color: var(--amber); text-underline-offset: 3px; }

/* Layout */

.layout {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
}

.inputs, .results {
  padding: 24px;
  overflow-y: auto;
  background: var(--panel);
}
.inputs { border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 16px; }
.inputs h2 { margin-top: 12px; }
.shipcard {
  display: grid;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--panel-2);
}
.shipcard strong { font: 400 1.05rem var(--display); }
.shipcard dl { display: grid; gap: 6px; }
.shipcard dl div { display: flex; justify-content: space-between; gap: 12px; font-size: .9rem; }
.shipcard dt { color: var(--muted); }
.shipcard dd { font-weight: 600; font-variant-numeric: tabular-nums; }
.shipcard a { color: var(--amber); font-size: .85rem; }
.inputs .btn { margin-top: 12px; }
.results { border-left: 1px solid var(--line); }

/* Fields */

.field { display: grid; gap: 6px; border: 0; margin: 0; padding: 0; min-width: 0; }
.field > span:first-child, .field > label, .field legend { padding: 0; font-size: .85rem; color: var(--muted); }
.field legend { margin-bottom: 6px; }
.field__box {
  display: flex;
  align-items: center;
  background: var(--ink);
  border: 1px solid #3a3f30;
  border-radius: 10px;
  padding-right: 12px;
}
.field__box:focus-within { border-color: var(--amber); }
/* boxes fill their column and never push into the next one */
.field__box { min-width: 0; width: 100%; }
.field__box input { width: 100%; }
.field__box:has(select) { padding-right: 0; }
.field__box input {
  flex: 1;
  min-width: 0;
  padding: 10px 12px;
  border: 0;
  background: none;
  color: var(--paper);
  font: 500 1.05rem var(--body);
  font-variant-numeric: tabular-nums;
  outline: none;
  -moz-appearance: textfield;
  appearance: textfield;
}
.field__box input::-webkit-outer-spin-button,
.field__box input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.field__box i { font-style: normal; color: var(--muted); font-size: .85rem; }
.field__box input.caps { text-transform: uppercase; }
.hint { font-size: .8rem; color: var(--muted); min-height: 1.2em; }

.segmented {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  background: var(--ink);
  border: 1px solid #3a3f30;
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 6px;
}
.segmented--five { grid-template-columns: repeat(5, 1fr); margin-bottom: 0; }
.segmented label { position: relative; }
.segmented input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.segmented span {
  display: block;
  padding: 7px 2px;
  border-radius: 7px;
  text-align: center;
  font-size: .82rem;
  color: var(--muted);
}
.segmented input:checked + span { background: var(--amber); color: #1a1205; font-weight: 600; }
.segmented input:focus-visible + span { outline: 2px solid var(--paper); outline-offset: 1px; }

/* Sheet area */

.sheet {
  min-width: 0;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 16px 24px 20px;
  gap: 14px;
}

.tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.tabs button {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 14px 7px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: none;
  color: var(--muted);
  font: 500 .85rem var(--body);
  cursor: pointer;
}
.tabs button b {
  display: grid;
  place-items: center;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: var(--panel-2);
  font: 400 .65rem var(--display);
}
.tabs button:hover { color: var(--paper); }
.tabs button[aria-selected="true"] { border-color: var(--amber); color: var(--paper); }
.tabs button[aria-selected="true"] b { background: var(--amber); color: #1a1205; }
.tabs button.is-done:not([aria-selected="true"]) b { background: #3a4a22; color: var(--ok); }

.paper {
  position: relative;
  flex: 1;
  min-height: 320px;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
}
#chart { position: absolute; inset: 0; width: 100%; height: 100%; }
.paper__empty {
  position: absolute;
  inset: auto 16px 16px 16px;
  padding: 12px 16px;
  border-radius: 8px;
  background: rgba(11, 13, 9, .92);
  color: var(--paper);
}

/* Marks on the sheet. Sizes are in sheet pixels and scale with the sheet. */
.o-guide { fill: none; stroke: var(--guide); stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transition: opacity .4s; }
.o-guide.is-on { opacity: .75; }
.o-trace { fill: none; stroke: var(--trace); stroke-width: 6; stroke-linecap: round; stroke-linejoin: round; }
.o-trace--miss { stroke-dasharray: 14 14; opacity: .8; }
.o-dot { fill: var(--trace); stroke: #fff; stroke-width: 3; }
.o-halo { fill: var(--trace); opacity: .25; }
.o-trace.is-b { stroke: var(--trace-b); }
.o-dot.is-b, .o-halo.is-b { fill: var(--trace-b); }
.o-guide.is-b { stroke: var(--trace-b); stroke-dasharray: 4 14; }
.o-tag.is-b rect { fill: var(--trace-b); }
.o-tag { opacity: 0; transition: opacity .35s; }
.o-tag.is-on { opacity: 1; }
.o-tag rect { fill: #0b0d09; }
.o-tag text { fill: #fff; font: 600 30px var(--body); font-variant-numeric: tabular-nums; }

.sheet__foot { display: flex; gap: 20px; align-items: flex-start; justify-content: space-between; }
.work {
  list-style: none;
  counter-reset: w;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  min-height: 3em;
}
.work li {
  counter-increment: w;
  color: #6c6f60;
  font-size: .88rem;
  transition: color .25s;
}
.work li::before { content: counter(w) ". "; }
.work li.is-on { color: var(--paper); }
.work li b { font-weight: 600; color: inherit; }
.work li.is-on b { color: var(--amber); }
.work li.is-b.is-on b { color: var(--ok); }

/* Results */

.verdict {
  margin: 12px 0 20px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(157, 187, 98, .12);
  color: var(--ok);
  font-weight: 500;
}
.verdict.is-bad { background: rgba(229, 89, 60, .12); color: var(--bad); }
.verdict.is-idle { background: var(--panel-2); color: var(--muted); }

dl { margin: 0; }
dd { margin: 0; }

.big { display: grid; gap: 16px; margin-bottom: 28px; }
.big dt { font-size: .85rem; color: var(--muted); }
/* body face: Michroma's percent sign reads poorly */
.big dd { font: 600 1.9rem/1.25 var(--body); font-variant-numeric: tabular-nums; }
.big dd.is-bad { color: var(--bad); }
.big dd.is-ok { color: var(--ok); }

.trail { margin-top: 12px; border-top: 1px solid var(--line); }
.trail div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: .88rem;
}
.trail dt { color: var(--muted); }
.trail dd { font-weight: 600; font-variant-numeric: tabular-nums; }

.notes { list-style: none; margin: 16px 0 0; padding: 0; display: grid; gap: 8px; }
.notes li { padding: 10px 12px; border-radius: 8px; font-size: .85rem; background: rgba(220, 138, 38, .12); color: #f0b469; }
.notes li.is-bad { background: rgba(229, 89, 60, .12); color: var(--bad); }

.fine { margin-top: 20px; font-size: .78rem; color: var(--muted); }

/* Log in */

.auth { flex: 1; display: grid; place-content: center; padding: 32px 16px; }
.auth .card { width: min(24rem, 100vw - 32px); display: grid; gap: 16px; }
.auth h1 { font-size: 1.15rem; margin-bottom: 4px; }
.auth .form-error { margin-top: 0; }
.auth__links { display: flex; justify-content: space-between; gap: 16px; font-size: .85rem; }
.auth__links a { color: var(--amber); text-underline-offset: 3px; }
.auth .hint { min-height: 0; }

.page--narrow { max-width: 640px; }
.page--narrow .card { margin-bottom: 16px; }
.page--narrow .card__actions { margin-top: 16px; }
.account__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; }
.account__value { font: 600 1.15rem var(--body); overflow-wrap: anywhere; }
.account__lead { margin: -8px 0 16px; font-size: .9rem; }
.account__sub { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
#account-team .cards { margin-bottom: 16px; }
#account-team .card--row { background: var(--panel-2); margin-bottom: 0; }
.account__email { margin-bottom: 16px; font-weight: 600; overflow-wrap: anywhere; }
.account__seats { font: 600 1.3rem var(--body); margin-bottom: 8px; }
input[readonly] { color: var(--muted); }

/* Public page for a shared record */

.shared { flex: 1; width: 100%; max-width: 1040px; margin: 0 auto; padding: clamp(24px, 5vw, 56px) 20px 64px; display: grid; gap: clamp(24px, 4vw, 40px); align-content: start; }
.shared__hero { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: center; }
.shared__company { color: var(--amber); font-weight: 600; }
.shared__hero h1 { font-size: clamp(1.4rem, 3.4vw, 2.2rem); line-height: 1.25; margin: 6px 0 14px; }
.shared__when { color: var(--paper); }
.shared__conditions { color: var(--muted); max-width: 36rem; }
.shared__actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 24px; }
.shared__plate {
  display: grid;
  place-items: center;
  width: clamp(150px, 22vw, 230px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: var(--paper);
}
.shared__plate img { width: 72%; height: auto; }

.shared__numbers { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.shared__numbers div { padding: 18px 20px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.shared__numbers dt { color: var(--muted); font-size: .82rem; }
.shared__numbers dd { margin-top: 8px; font: 600 clamp(1.3rem, 2.6vw, 1.8rem) var(--body); font-variant-numeric: tabular-nums; }

.shared__sheets { display: grid; gap: 28px; }
.shared__sheets figure { margin: 0; }
.shared__sheets figcaption { margin-bottom: 10px; font: 400 .85rem var(--display); color: var(--muted); }
.shared__sheets img { display: block; width: 100%; height: auto; border-radius: 12px; background: #fff; }

.shared__close {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(28px, 5vw, 48px) 20px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  text-align: center;
}
.shared__close h2 { color: var(--paper); font-size: clamp(1.05rem, 2.4vw, 1.4rem); }
.shared__close p { color: var(--muted); max-width: 32rem; }
.shared__close .btn { margin-top: 8px; }
.shared__site a { color: var(--paper); font-weight: 600; }
.shared__fine { font-size: .8rem; }

@media (max-width: 760px) {
  .shared__hero { grid-template-columns: 1fr; }
  .shared__plate { order: -1; width: 120px; }
  .shared__numbers { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .shared__actions .btn { flex: 1; }
}

/* Load calculation: laid out like the paper form, on a paper-coloured sheet so the print matches */

.lc { background: #fff; color: #14160f; border-radius: 14px; overflow: hidden; font-size: .92rem; }
.lc__title { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 16px; padding: 18px 20px; border-bottom: 2px solid #14160f; }
.lc__title strong { font: 400 1rem var(--display); }
.lc__title span { color: #555; font-size: .85rem; }

.lc input, .lc select, .lc textarea {
  width: 100%;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid #c9c7b4;
  border-radius: 8px;
  background: #fffbe3; /* the yellow of the fill-in boxes on the form */
  color: #14160f;
  font: 600 1rem var(--body);
  font-variant-numeric: tabular-nums;
}
.lc input[readonly] { background: #f1f0e8; color: #14160f; }
.lc input:focus, .lc select:focus, .lc textarea:focus { outline: 2px solid var(--amber); outline-offset: 1px; }
.lc output { font: 600 1rem var(--body); font-variant-numeric: tabular-nums; }
.lc small { color: #555; font-weight: 400; }
.lc i { font-style: normal; color: #555; font-size: .8rem; }
.lc label > span, .lc__line > span { color: #333; font-size: .82rem; }

.lc__top { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; padding: 16px 20px; border-bottom: 1px solid #c9c7b4; }
.lc__top label { display: grid; gap: 4px; }

.lc__row { display: flex; align-items: end; gap: 12px; padding: 12px 20px; border-bottom: 1px solid #e3e1d2; }
.lc__row > b { width: 1.6rem; flex: none; padding-bottom: 9px; font: 400 .8rem var(--display); }
.lc__row label { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 6px; width: 7.5rem; }
.lc__row label > span { grid-column: 1 / -1; }
.lc__grow { flex: 1; min-width: 0; width: auto !important; }
.lc__line { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; }
.lc__line > span { font-size: .92rem; color: #14160f; }
.lc__line input { width: 8rem; margin-left: auto; }
.lc__line > output { margin-left: auto; }
.lc__line.lc__grow > i { flex: none; }
.lc__fuel label { display: flex; align-items: center; gap: 6px; width: auto; }
.lc__fuel label input { width: 5.2rem; }
.lc__fuel > span:first-child { margin-right: auto; }
.lc__fuel output { min-width: 5.5rem; text-align: right; }
.lc__row--total { background: #e9f6f8; }   /* the blue of the worked-out boxes on the form */
.lc__row--cargo { align-items: start; }
.lc__row--cargo > b { padding: 26px 0 0; }
.lc__note { padding: 6px 20px 10px 3.6rem; color: #555; font-size: .8rem; border-bottom: 1px solid #e3e1d2; }
.lc__note:empty { display: none; }
.lc__note .link { color: #9a5a00; margin-right: 10px; }

.lc__table { width: 100%; border-collapse: collapse; table-layout: fixed; border-top: 2px solid #14160f; border-bottom: 2px solid #14160f; }
.lc__table th, .lc__table td { padding: 8px; border: 1px solid #c9c7b4; }
.lc__table thead th { font-size: .8rem; font-weight: 600; text-align: center; background: #f1f0e8; }
.lc__table tbody th { width: 40%; text-align: left; font-weight: 600; font-size: .85rem; }
.lc__table tbody th b { font: 400 .75rem var(--display); margin-right: 4px; }
.lc__table tbody th small { display: block; font-size: .72rem; }
.lc__table td { text-align: center; }
.lc__table td input { text-align: center; padding: 6px 4px; }
.lc__table .is-calc td { background: #e9f6f8; }
.lc__table .is-result td output { font-size: 1.15rem; }
.lc__table output.is-bad { color: #c0351c; }

.lc__sign { display: grid; grid-template-columns: 1fr 1fr auto; gap: 12px 16px; padding: 16px 20px; }
.lc__sign label { display: grid; gap: 4px; }

@media (max-width: 760px) {
  .lc { font-size: .88rem; }
  .lc__title, .lc__top, .lc__row, .lc__sign { padding-inline: 12px; }
  .lc__top { gap: 10px; }
  .lc__row { flex-wrap: wrap; gap: 8px; }
  .lc__row--place .lc__grow { flex: 1 1 100%; order: -1; margin-left: 2.1rem; }
  .lc__row--place > b { order: -2; position: absolute; }
  .lc__row--place { position: relative; }
  .lc__row--place label:not(.lc__grow) { flex: 1; width: auto; margin-left: 0; }
  .lc__row--place label:not(.lc__grow):first-of-type { margin-left: 2.1rem; }
  .lc__line input { width: 6.5rem; }
  .lc__fuel { flex-wrap: wrap; }
  .lc__fuel label input { width: 4.2rem; }
  .lc__note { padding-left: 12px; }
  .lc__table th, .lc__table td { padding: 6px 4px; }
  .lc__table tbody th { width: 34%; font-size: .78rem; }
  .lc__table tbody th small { display: none; }
  .lc__table td input, .lc__table output { font-size: .88rem; }
  .lc__sign { grid-template-columns: 1fr; }
  .lc__row--cargo label:not(.lc__grow) { width: 100%; margin-left: 2.1rem; }
  #lc-print { width: 100%; }
}

/* History and aircraft pages */

.page {
  flex: 1;
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 32px 24px 64px;
  overflow-y: auto;
}
.page__head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px 24px;
  margin-bottom: 24px;
}
.page__head h1 { font-size: 1.3rem; }
.page__head p, .page__filter { color: var(--muted); font-size: .9rem; }
.page__filter { display: flex; align-items: center; gap: 10px; }
.field--wide { max-width: 26rem; margin-bottom: 24px; }
.field__box select { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 12px; font: 500 1.05rem var(--body); }
.empty-note { color: var(--muted); max-width: 34rem; }
.page__lead { color: var(--muted); max-width: 38rem; margin: -8px 0 24px; }
.card__email { font: 500 .95rem var(--body) !important; min-width: 0 !important; overflow-wrap: anywhere; }
.card__inline { display: flex; align-items: end; gap: 12px; }
.card__inline .field { flex: 1; max-width: 26rem; }
.hint:empty { display: none; }
.page > .hint { margin-bottom: 16px; font-size: .9rem; }
.field--wide { margin-bottom: 0; }

.cards { list-style: none; margin: 0 0 24px; padding: 0; display: grid; gap: 8px; }
.card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--panel);
}
.card--row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 24px;
  padding: 14px 18px;
  color: var(--muted);
  font-size: .9rem;
}
.card--row strong { min-width: 6.5rem; color: var(--paper); font: 400 .9rem var(--display); }
.card--link { text-decoration: none; }
.card.is-selected { border-color: var(--amber); }
.card__links { align-items: center; }
.page__head + .page__lead { margin-top: -8px; }
.card--link:hover { border-color: var(--amber); }
.card__links { margin-left: auto; display: flex; gap: 18px; }
.card h2 { color: var(--paper); margin-bottom: 18px; }
.card__grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.card__actions { display: flex; gap: 10px; margin-top: 20px; }
.form-error { margin-top: 12px; color: var(--bad); font-size: .9rem; }
.form-error:empty { display: none; }

/* Aircraft cards: the card opens the aircraft */

.search {
  display: block;
  width: 100%;
  max-width: 26rem;
  margin-bottom: 20px;
  padding: 11px 16px;
  border: 1px solid #3a3f30;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font: 400 .95rem var(--body);
  text-transform: uppercase;
}
.search::placeholder { text-transform: none; color: var(--muted); }

.ships {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr));
  gap: 16px;
}
.ship {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--panel);
  overflow: hidden;
}
.ship.is-selected { border-color: var(--amber); }
.ship__open {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 22px 22px 18px;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.ship__open:hover { background: var(--panel-2); }
.ship__top { display: flex; justify-content: space-between; align-items: center; gap: 12px; }
.ship__top strong { font: 400 1.5rem var(--display); }
.ship__tag {
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(220, 138, 38, .18);
  color: var(--amber);
  font-size: .8rem;
  font-weight: 600;
}
.ship__model { color: var(--muted); font-size: .9rem; }
.ship__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}
.ship__stats > span { display: grid; gap: 4px; padding-right: 12px; }
.ship__stats > span + span { padding-left: 14px; border-left: 1px solid var(--line); }
.ship__stats small { color: var(--muted); font-size: .78rem; }
.ship__stats b { font: 600 1.15rem var(--body); font-variant-numeric: tabular-nums; }
.ship__last { margin-top: 14px; color: var(--muted); font-size: .82rem; }
.ship__foot {
  display: flex;
  justify-content: flex-end;
  gap: 20px;
  padding: 10px 22px 14px;
  border-top: 1px solid var(--line);
}

.day h2 { margin: 28px 0 12px; }

/* The report is laid out as paper so the screen matches the PDF. */

.report__actions { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 8px; }
.report__buttons { display: flex; flex-wrap: wrap; gap: 8px; }
.report__buttons a { text-decoration: none; }
.report .hint { margin-bottom: 12px; }
.report__head, .report__nums, .report__sheet, .report__note, .report__fine { background: #fff; color: #14160f; }
.report__head {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 28px 32px 20px;
  border-radius: 14px 14px 0 0;
}
.report__logo { width: 104px; height: auto; flex: none; }
.report__brand { font: 400 .8rem var(--display); letter-spacing: .14em; text-transform: uppercase; }
.report__head h1 { font: 600 1.4rem/1.3 var(--body); margin: 2px 0; }
.report__head p:not(.report__brand) { color: #555; font-size: .9rem; }
.report__nums {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
  padding: 16px 32px 24px;
  border-top: 1px solid #ddd;
}
.report__nums dt { color: #555; font-size: .8rem; }
.report__nums dd { font: 600 1.35rem var(--body); font-variant-numeric: tabular-nums; }
.report__note { padding: 0 32px 12px; color: #9a5a00; font-size: .9rem; }
.report__sheet { margin: 0; padding: 20px 32px 28px; border-top: 1px solid #ddd; }
.report__sheet figcaption { margin-bottom: 12px; font-size: .95rem; }
.report__sheet svg { display: block; width: 100%; height: auto; max-height: 92vh; }
.report__fine { padding: 16px 32px 12px; border-top: 1px solid #ddd; color: #555; font-size: .8rem; }
.report__site { background: #fff; padding: 0 32px 28px; border-radius: 0 0 14px 14px; margin-bottom: 20px; }
.report__site a { color: #14160f; font-weight: 600; }

@media print {
  html, body { height: auto; background: #fff; display: block; }
  .no-print, .bar, #history-index { display: none !important; }
  .lc { border-radius: 0; font-size: 10pt; }
  .lc input, .lc select, .lc textarea { border-color: #999; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .lc__row--total, .lc__table .is-calc td, .lc__table thead th { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  body { padding-bottom: 0; }
  .page { padding: 0; max-width: none; overflow: visible; }
  .report__head, .report__nums, .report__sheet, .report__fine { border-radius: 0; padding-inline: 0; }
  .report__sheet { break-before: page; border-top: 0; }
  .report__sheet svg { max-height: 8.6in; }
  .report__sheet:first-of-type { break-before: auto; }
}

/* Narrow screens: stack, sheet first after the inputs */

@media (max-width: 1080px) {
  html, body { height: auto; }
  .layout { grid-template-columns: 1fr; }
  .inputs, .results { border: 0; overflow: visible; }
  .inputs { border-bottom: 1px solid var(--line); }
  .results { border-top: 1px solid var(--line); }
  .paper { flex: none; height: min(120vw, 80vh); }
  .sheet { padding: 16px; }
  .sheet__foot { flex-direction: column; }
  .bar { grid-template-columns: 1fr auto; padding: 10px 16px; }
  .bar__nav { grid-row: 2; grid-column: 1 / -1; overflow-x: auto; }
  .bar__link { grid-column: 2; }
  .card__grid, .report__nums { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .report__head, .report__nums, .report__sheet, .report__fine, .report__note { padding-inline: 16px; }
}

/* Phones: company name on top, one tab bar along the bottom, everything in a single column */

@media (max-width: 760px) {
  .bar { grid-template-columns: auto 1fr; padding: 14px 16px; }
  .bar__company { display: block; justify-self: end; color: var(--muted); font-size: .9rem; text-align: right; }
  .bar__end { display: none; }

  .bar__nav {
    position: fixed;
    inset: auto 0 0 0;
    z-index: 20;
    display: flex;
    justify-content: space-around;
    gap: 0;
    grid-row: auto;
    grid-column: auto;
    padding: 8px 6px calc(8px + env(safe-area-inset-bottom));
    background: var(--panel);
    border-top: 1px solid var(--line);
    overflow: visible;
  }
  .bar__nav a {
    flex: 1;
    display: grid;
    justify-items: center;
    gap: 3px;
    padding: 6px 2px;
    border-radius: 12px;
    font-size: .68rem;
  }
  .bar__nav a[hidden] { display: none; }
  .bar__nav svg { display: block; width: 24px; height: 24px; }
  .bar__nav a span { display: none; }
  .bar__nav a::after { content: attr(data-short); }
  .bar__nav a[aria-current="page"] { background: none; color: var(--amber); }
  .nav__account { display: grid; }
  body { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }

  .page { padding: 20px 16px 32px; }
  .page__head { margin-bottom: 16px; }
  .page__head h1 { font-size: 1.15rem; }
  #company-name { display: none; } /* already in the top bar */
  .search { max-width: none; }
  .ships { gap: 12px; }
  .ship__open { padding: 18px 18px 14px; }
  .ship__top strong { font-size: 1.3rem; }
  .ship__foot { padding: 8px 18px 12px; }
  #aircraft-add, #team-add { width: 100%; }
  .card { padding: 16px; }
  .card__grid { grid-template-columns: 1fr; }
  .card--row { gap: 4px 16px; }
  .card__links { margin-left: 0; width: 100%; }

  .inputs, .results { padding: 16px; }
  .sheet { padding: 12px; gap: 10px; }
  /* four sheet tabs on one line: numbers only, with the open sheet's name spelled out */
  .tabs { flex-wrap: nowrap; gap: 6px; }
  .tabs button { flex: none; padding: 7px 8px; }
  .tabs button span { display: none; }
  .tabs button[aria-selected="true"] { flex: 1; min-width: 0; padding-right: 12px; }
  .tabs button[aria-selected="true"] span { display: inline; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  /* the sheet fills the width at exactly the shape of the part shown, so nothing is cropped or letterboxed */
  .paper { flex: none; height: auto; min-height: 0; aspect-ratio: var(--sheet-ratio, 1 / 1); border-radius: 8px; }
  .sheet { scroll-margin-top: 8px; }
  .work { gap: 4px 16px; min-height: 0; font-size: .85rem; }
  .sheet__foot { gap: 12px; }
  #replay { width: 100%; }

  .report__actions { flex-direction: column; align-items: stretch; }
  .report__buttons .btn { flex: 1; }
  .report__head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .report__logo { width: 84px; }
  .report__nums dd { font-size: 1.15rem; }

  .quiz { place-content: start center; padding-top: 32px; }
}
