/* The dark theme is a soft graphite, not black: easier to read for long.
   EFB Ansat Office, in the colours of HeliDrive Zim: a cool ink grey taken
   from the navy of its logo, and its red, kept for the one thing that waits
   for someone (a flight to approve, the count of them, the menu item open).
   Tail numbers, release numbers and UTC times in mono, as on the release.
   Design pass after "unslop" by Damir Sokolovsky (@heydamir), CC BY 4.0. */
:root {
  --bg: #f5f7fa; --side: #eef1f5; --solid: #ffffff; --paper: #ffffff; --raised: #eceff4; --field: #ffffff;
  --fg: #111827; --fg2: #4b5565; --muted: #6b7487;
  --line: rgba(17, 24, 39, .09); --line2: rgba(17, 24, 39, .16);
  --accent: #d4343a; --accent-ink: #b42329; --on-accent: #ffffff; --soft: rgba(212, 52, 58, .08);
  --warn: #8a5a00; --warn-soft: #fbf1dc; --bad: #c62828; --bad-soft: #fbe9e9; --ok: #16794a; --ok-soft: #e6f4ec;
  --shadow: 0 1px 2px rgba(17, 24, 39, .05); --float: 0 8px 24px rgba(17, 24, 39, .08);
  --sans: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --ease: cubic-bezier(.22, 1, .36, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1f2229; --side: #1a1d23; --solid: #2a2e36; --paper: #262a31; --raised: #31363f; --field: #1c1f25;
    --fg: #e3e6eb; --fg2: #b4bac5; --muted: #8d95a4;
    --line: rgba(227, 230, 235, .1); --line2: rgba(227, 230, 235, .18);
    --accent: #d4343a; --accent-ink: #f0686c; --on-accent: #ffffff; --soft: rgba(240, 104, 108, .12);
    --warn: #e8be72; --warn-soft: rgba(232, 190, 114, .1); --bad: #f0686c; --bad-soft: rgba(240, 104, 108, .1);
    --ok: #4cc38a; --ok-soft: rgba(76, 195, 138, .1);
    --shadow: 0 1px 2px rgba(0, 0, 0, .18); --float: 0 8px 24px rgba(0, 0, 0, .35);
  }
}
:root[data-theme="dark"] {
  --bg: #1f2229; --side: #1a1d23; --solid: #2a2e36; --paper: #262a31; --raised: #31363f; --field: #1c1f25;
  --fg: #e3e6eb; --fg2: #b4bac5; --muted: #8d95a4;
  --line: rgba(227, 230, 235, .1); --line2: rgba(227, 230, 235, .18);
  --accent: #d4343a; --accent-ink: #f0686c; --on-accent: #ffffff; --soft: rgba(240, 104, 108, .12);
  --warn: #e8be72; --warn-soft: rgba(232, 190, 114, .1); --bad: #f0686c; --bad-soft: rgba(240, 104, 108, .1);
  --ok: #4cc38a; --ok-soft: rgba(76, 195, 138, .1);
  --shadow: 0 1px 2px rgba(0, 0, 0, .18); --float: 0 8px 24px rgba(0, 0, 0, .35);
}
:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { color-scheme: dark; } }
* { box-sizing: border-box; }
body { margin: 0; color: var(--fg); background: var(--bg); font: 400 14px/20px var(--sans); min-height: var(--vh); }
a { color: var(--fg); text-decoration: underline; text-decoration-color: var(--line2); text-underline-offset: 3px; transition: text-decoration-color .15s var(--ease); }
@media (hover: hover) { a:hover { text-decoration-color: currentColor; } }

/* The tail numbers, release numbers and UTC times: as on the paper */
.reg, .mono, .token, .src { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.reg { font-size: 13px; letter-spacing: .02em; }

/* Panels: solid, with a hairline */
.box, .card, .combined, .signoff, dialog { background: var(--paper); border: 1px solid var(--line); box-shadow: var(--shadow); }

/* The menu down the left */
.shell { display: grid; grid-template-columns: 248px minmax(0, 1fr); min-height: var(--vh); }
.side { position: sticky; top: 0; height: var(--vh); background: var(--side); border-right: 1px solid var(--line); padding: 16px 12px; display: flex; flex-direction: column; gap: 16px; overflow-y: auto; }
.side .brand { position: relative; display: grid; gap: 8px; padding: 4px 8px 12px; border-bottom: 1px solid var(--line); }
.side .logo { display: block; width: 132px; height: auto; }
.side .logo.on-dark { display: none; }
:root[data-theme="dark"] .side .logo.on-light { display: none; }
:root[data-theme="dark"] .side .logo.on-dark { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .side .logo.on-light { display: none; }
  :root:not([data-theme="light"]) .side .logo.on-dark { display: block; }
}
.side .brand b { display: block; font-size: 14px; font-weight: 500; }
.side .brand small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.side nav { display: grid; gap: 2px; }
.side nav a { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 8px; height: 34px; padding: 0 12px; border-radius: 8px; color: var(--fg2); text-decoration: none; transition: background-color .15s var(--ease), color .15s var(--ease); }
@media (hover: hover) { .side nav a:hover { background: var(--raised); color: var(--fg); } }
.side nav a.on { background: var(--raised); color: var(--fg); font-weight: 500; }
.side nav a.on::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--accent); }
.side .foot { margin-top: auto; display: grid; gap: 12px; padding: 12px 4px 0; border-top: 1px solid var(--line); }
.side .foot .row { display: flex; gap: 8px; align-items: center; justify-content: space-between; }
.side .me b { display: block; font-size: 14px; font-weight: 500; }
.side .me small { color: var(--muted); font-size: 12px; }
button.wide { width: 100%; }
main { max-width: 1440px; width: 100%; padding: 24px 32px 48px; display: grid; gap: 20px; align-content: start; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; border-right: 0; border-bottom: 1px solid var(--line); }
  .side .brand { border-bottom: 0; padding-bottom: 4px; }
  .side nav { display: flex; flex-wrap: wrap; flex: 1 1 100%; order: 3; }
  .side .foot { margin: 0 0 0 auto; display: flex; align-items: center; border-top: 0; padding-top: 0; }
  .side .me { display: none; }
  main { padding: 16px 16px 40px; }
}
h1 { margin: 0; font-size: 28px; line-height: 32px; font-weight: 500; letter-spacing: -.01em; }
h2 { margin: 0 0 12px; font-size: 16px; line-height: 24px; font-weight: 500; }
.period { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.period label { display: grid; gap: 4px; font-size: 12px; line-height: 16px; color: var(--muted); }

/* Fields and buttons */
input, select, textarea { font: inherit; color: var(--fg); background: var(--field); border: 1px solid var(--line2); border-radius: 8px; padding: 0 12px; height: 36px; transition: border-color .15s var(--ease), box-shadow .15s var(--ease); }
textarea { height: auto; padding: 8px 12px; }
input[type="checkbox"], input[type="radio"] { height: auto; accent-color: var(--accent); }
input[type="file"] { height: auto; padding: 6px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--fg2); box-shadow: 0 0 0 3px var(--line); }
button, a.btn, label.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 36px; font: inherit; font-weight: 500; color: var(--fg); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 0 16px; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color .15s var(--ease), border-color .15s var(--ease), transform .12s var(--ease); }
@media (hover: hover) { button:hover, a.btn:hover, label.btn:hover { border-color: var(--line2); background: color-mix(in srgb, var(--raised) 70%, var(--fg) 6%); } }
button:active, a.btn:active { transform: scale(.98); }
button:focus-visible, a:focus-visible { outline: 2px solid var(--fg2); outline-offset: 2px; }
button.primary, button.sign { background: var(--accent); color: var(--on-accent); border-color: transparent; }
@media (hover: hover) { button.primary:hover, button.sign:hover { background: color-mix(in srgb, var(--accent) 88%, #000); } }
button.icon { width: 36px; height: 36px; padding: 0; flex: none; }
button.icon svg { width: 18px; height: 18px; }
.field button.icon { width: 28px; height: 28px; border: 0; background: transparent; color: var(--muted); }
button.quiet { color: var(--muted); background: transparent; }
@media (hover: hover) { button.quiet:hover { color: var(--bad); background: var(--bad-soft); } }

/* The figures of the period: one readout, hairlines between */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); overflow: hidden; }
.cards .card { background: none; border: 0; border-left: 1px solid var(--line); border-radius: 0; box-shadow: none; margin-left: -1px; padding: 16px 20px; }
.card { border-radius: 12px; padding: 16px 20px; min-width: 0; }
.card b { display: block; font-size: 30px; line-height: 36px; font-weight: 500; font-variant-numeric: tabular-nums; }
.card span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.box { border-radius: 12px; padding: 20px 24px; min-width: 0; }
.cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(360px, 1fr)); gap: 20px; }
.scroll { overflow-x: auto; }

/* Tables */
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th:first-child, td:first-child { padding-left: 0; }
th:last-child, td:last-child { padding-right: 0; }
th { color: var(--muted); font-size: 12px; line-height: 16px; font-weight: 500; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td.n, th.n { text-align: right; white-space: nowrap; }
.nowrap { white-space: nowrap; }
.barcell { width: 40%; }
.meter { height: 6px; margin-top: 7px; background: var(--raised); border-radius: 3px; overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: 3px; background: var(--fg2); }
.tag { display: inline-block; padding: 0 8px; border-radius: 4px; font-size: 12px; line-height: 20px; font-weight: 500; background: var(--raised); color: var(--fg2); white-space: nowrap; }
.tag.high { background: var(--warn-soft); color: var(--warn); }
.tag.veryhigh { background: var(--bad-soft); color: var(--bad); }
.note { color: var(--muted); font-size: 13px; }
.msg { background: var(--raised); border: 1px solid var(--line); border-radius: 8px; padding: 8px 16px; }
.token { word-break: break-all; background: var(--warn-soft); padding: 8px 12px; border-radius: 8px; }
form.inline { display: inline; }
.login { max-width: 360px; margin: 12vh auto; display: grid; gap: 12px; }
.err { color: var(--bad); }
table.papers td { vertical-align: middle; }
/* The buttons of a row: the cell stays a table cell, so the line under the row runs straight through it;
   the buttons side by side, all of one size. */
td.acts { text-align: right; white-space: nowrap; }
td.acts > form { display: inline-block; vertical-align: top; }
td.acts > * + * { margin-left: 8px; }
td.acts button, td.acts a.btn { min-width: 112px; }
td.acts button.info { min-width: 0; vertical-align: middle; }
/* A long column name over short values ("Рабочее время" over 3:42) may take two lines */
th.wrap { white-space: normal; }
details > summary { cursor: pointer; font-weight: 500; color: var(--fg); padding: 4px 0; }
@media (hover: hover) { details > summary:hover { color: var(--fg2); } }
details.mail { margin-top: 12px; }
details.mail form, details.danger form { display: grid; gap: 12px; max-width: 560px; margin-top: 12px; }
details.mail label, details.danger label { display: grid; gap: 4px; font-size: 13px; color: var(--muted); }
.ticks { display: flex; gap: 16px; flex-wrap: wrap; }
.ticks label { display: flex !important; gap: 8px; align-items: center; color: var(--fg) !important; font-size: 14px !important; }
details.danger summary { color: var(--bad); }
button.bad { background: var(--bad-soft); color: var(--bad); border-color: transparent; justify-self: start; }
.msg.err { background: var(--bad-soft); color: var(--bad); border-color: transparent; }
@media (max-width: 640px) { td.acts { text-align: left; white-space: normal; } td.acts > * { margin: 0 8px 8px 0; } table.papers tr { display: grid; } }
.combined { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; border-radius: 12px; }
.combined .note { display: block; }
.combined .acts { display: flex; gap: 8px; flex-wrap: wrap; }
details.separate { margin-top: 12px; }
details.mail label.tick { display: flex; gap: 8px; align-items: center; color: var(--fg); font-size: 14px; }
.crumbs { margin: 0; font-size: 14px; }
table.lib td { vertical-align: middle; }
table.lib form { display: inline; }
.uploads { display: flex; gap: 8px; flex-wrap: wrap; margin: 8px 0; }
form.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
form.row input { flex: 1; min-width: 160px; }
ul.err { margin: 4px 0 0; padding-left: 16px; font-size: 13px; }
.grow { flex: 1; }
.switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--field); }
.switch a { padding: 4px 12px; font-size: 12px; line-height: 20px; font-weight: 500; color: var(--muted); text-decoration: none; }
.switch a.on { background: var(--raised); color: var(--fg); }
button.theme { width: 32px; height: 32px; padding: 0; color: var(--fg2); background: transparent; }
button.theme svg { width: 16px; height: 16px; }
button.theme .sun { display: none; }
:root[data-theme="dark"] button.theme .sun { display: block; }
:root[data-theme="dark"] button.theme .moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) button.theme .sun { display: block; }
  :root:not([data-theme="light"]) button.theme .moon { display: none; }
}

/* Flight log */
.toolbar { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.toolbar .grow { min-width: 8px; }
table.log { font-size: 13px; }
table.log th, table.log td { padding: 4px 8px; }
table.log td.route { min-width: 220px; }
@media (hover: hover) { table.log tr.edit:hover td { background: var(--raised); cursor: pointer; } }
table.log tr.total td { font-weight: 500; border-top: 1px solid var(--fg2); }
.src { font-size: 11px; color: var(--muted); }
dialog { border-radius: 16px; background: var(--solid); color: var(--fg); padding: 24px; width: min(680px, calc(100vw - 32px)); box-shadow: var(--float); }
dialog::backdrop { background: rgba(7, 8, 13, .5); }
form.grid { margin-top: 12px; align-items: end; }
form.grid, dialog form.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
form.grid label, dialog form.grid label { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
dialog form.grid label.wide { grid-column: 1 / -1; }
form.grid label.wide { grid-column: span 2; }
dialog .acts { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
details.codes { font-size: 13px; }
details.codes .cols3 { columns: 3 220px; margin-top: 8px; }
details.codes .cols3 div { break-inside: avoid; }
table.log th, table.log td { white-space: nowrap; }
table.log a.edit { display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--line); text-decoration: none; }
@media (hover: hover) { table.log a.edit:hover { background: var(--raised); } }
table.log tr.hit td { background: var(--soft); }
table.log tr.edited td:first-child { box-shadow: inset 2px 0 0 var(--warn); }
form.logline { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
form.logline .acts { grid-column: 1 / -1; display: flex; gap: 8px; }

/* The fleet: one chip per helicopter */
nav.fleet { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 16px; }
nav.fleet .chip { display: inline-flex; align-items: baseline; gap: 8px; height: 36px; padding: 8px 16px; border-radius: 8px; border: 1px solid var(--line); background: var(--paper); color: var(--fg); text-decoration: none; font-family: var(--mono); font-weight: 500; transition: border-color .15s var(--ease), background-color .15s var(--ease); }
nav.fleet .chip small { color: var(--muted); font-family: var(--sans); font-weight: 400; font-size: 12px; }
@media (hover: hover) { nav.fleet .chip:hover { border-color: var(--line2); } }
nav.fleet .chip.on { background: var(--raised); border-color: var(--fg2); }
nav.fleet .chip.on small { color: var(--fg2); }
nav.fleet .chip.empty { opacity: .55; }
.viewer { margin-bottom: 24px; scroll-margin-top: 12px; }
.viewer-bar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.viewer-bar .title { display: flex; gap: 12px; align-items: baseline; font-size: 18px; }
.viewer-bar .acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.viewer-bar button.nav { width: 36px; height: 36px; padding: 0; font-size: 20px; line-height: 1; }
.viewer-bar button.nav:disabled { opacity: .35; cursor: default; }
.viewer .sheet { touch-action: pan-y; }
table.log tr.blank td { height: 28px; }
.print-only { display: none; }
@media print {
  @page { size: A4 landscape; margin: 10mm; }
  :root, :root[data-theme="dark"] { --bg: #fff; --paper: #fff; --fg: #000; --fg2: #000; --muted: #333; --line: #999; --soft: #fff; --raised: #fff; --accent: #000; color-scheme: light; }
  body { font-size: 10px; background: #fff; }
  .noprint, header, .period { display: none !important; }
  .shell { display: block; }
  .box, .card { box-shadow: none; }
  .print-only { display: block; }
  main { max-width: none; padding: 0; gap: 6px; }
  .box { border: 0; padding: 0; }
  .scroll { overflow: visible; }
  table.log { font-size: 9px; }
  table.log th, table.log td { padding: 2px 3px; border: 1px solid #999; }
  table.log thead { display: table-header-group; }
  table.log tr { break-inside: avoid; }
  .viewer .sheet[hidden] { display: none !important; }
  a { color: #000; text-decoration: none; }
}

.box.waiting { border-color: color-mix(in srgb, var(--warn) 40%, transparent); background: var(--warn-soft); }
.box.waiting input { min-width: 180px; }

/* The chief pilot's signature on a release */
.signoff { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; margin-bottom: 12px; border-radius: 12px; }
.signoff .note { display: block; }
.signoff.none, .signoff.stale { background: var(--bad-soft); border-color: transparent; }
.signoff.stale b, .signoff.none b { color: var(--bad); }
.signoff.signed { background: var(--ok-soft); border-color: transparent; }
.signoff .acts { display: flex; gap: 8px; }
button.sign { padding: 0 20px; }
.tosign { margin-bottom: 0; }
.tosign h2 .count { display: inline-block; margin-left: 8px; min-width: 20px; padding: 0 6px; border-radius: 4px; background: var(--raised); color: var(--fg2); font: 500 12px/20px var(--mono); text-align: center; vertical-align: 2px; }
/* What waits for the chief pilot: the one place the red is on */
#approve { border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
#approve h2 .count { background: var(--accent); color: var(--on-accent); }
#approve a.btn { background: var(--accent); color: var(--on-accent); border-color: transparent; }
@media (hover: hover) { #approve a.btn:hover { background: color-mix(in srgb, var(--accent) 88%, #000); } }
.sigpic { display: grid; place-items: center; min-height: 160px; margin-bottom: 12px; border: 1px dashed var(--line2); border-radius: 8px; background: #fff; }
.sigpic img { max-width: 100%; max-height: 220px; }

/* The live count of what waits for the chief pilot */
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font: 500 12px/20px var(--mono); display: inline-grid; place-items: center; }
.badge[hidden] { display: none; }
.badge.soft { background: var(--raised); color: var(--fg2); }
a.bell { position: absolute; top: 4px; right: 4px; width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; color: var(--fg2); text-decoration: none; transition: background-color .15s var(--ease); }
@media (hover: hover) { a.bell:hover { background: var(--raised); } }
a.bell svg { width: 18px; height: 18px; }
a.bell .badge { position: absolute; top: -4px; right: -8px; min-width: 18px; height: 18px; font-size: 11px; line-height: 18px; }
.live-toast { position: fixed; right: 24px; bottom: 24px; z-index: 50; display: flex; gap: 12px; align-items: center; max-width: 440px; padding: 12px 16px; border-radius: 12px; background: var(--solid); border: 1px solid var(--line); border-left: 2px solid var(--accent); box-shadow: var(--float); }
.live-toast[hidden] { display: none; }
.live-toast b { display: block; font-weight: 500; }
.live-toast .d { color: var(--muted); font-size: 13px; font-family: var(--mono); }
.live-toast .close { width: 32px; height: 32px; color: var(--muted); background: transparent; border: 0; }
button.allow-alerts { font-size: 13px; height: 32px; padding: 0 12px; }

/* The open list of a select, in the colours of the theme */
select { background-color: var(--field); }
select option, select optgroup { background-color: var(--solid); color: var(--fg); }

/* A form with a field to put right: marked in red, the hint under it */
form.adduser { display: grid; gap: 8px; }
form.adduser label { display: grid; gap: 4px; }
form.adduser label.bad input { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
form.adduser .hint { color: var(--bad); font-size: 13px; padding-left: 12px; }

/* ---- Easier to read: the menu in groups with icons, the Overview calm ---- */
.ic { width: 16px; height: 16px; flex: none; color: var(--muted); }
.side nav a .ic { transition: color .15s var(--ease); }
@media (hover: hover) { .side nav a:hover .ic, .side nav a.on .ic { color: var(--fg); } }
.side nav a { justify-content: flex-start; gap: 10px; }
.side nav .group { margin: 16px 12px 4px; font-size: 12px; line-height: 16px; color: var(--muted); }
/* The period: small, at the top right of the page, over its title */
@media (min-width: 1400px) {
  /* Beside the page title, where the title comes right after it (on a
     smaller screen it is a row of its own above the title) */
  /* (not the long one with a search field: Releases, the log) */
  main > form.period:has(+ h1):not(:has(input[name="q"])) { justify-self: end; margin-bottom: -56px; position: relative; z-index: 1; }
  main > form.period:not(:has(input[name="q"])) + h1 { min-height: 36px; display: flex; align-items: center; }
}
form.period label { grid-auto-flow: column; align-items: center; gap: 8px; }
form.period input[type="date"] { height: 32px; padding: 0 8px; }
form.period button { height: 32px; }
h3 { margin: 16px 0 8px; font-size: 13px; line-height: 20px; font-weight: 500; color: var(--fg2); display: flex; align-items: center; gap: 8px; }
h2 + h3 { margin-top: 0; }
h3 .count { min-width: 20px; padding: 0 6px; border-radius: 4px; background: var(--accent); color: var(--on-accent); font: 500 12px/20px var(--mono); text-align: center; }
h3 .count.soft { background: var(--raised); color: var(--fg2); }
.boxhead { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.boxhead h2 { margin: 0; }
.boxhead a { font-size: 13px; color: var(--fg2); }
/* What waits for the chief pilot */
.todo { border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.todo.calm { border-color: var(--line); padding: 16px 24px; }
.allclear { display: flex; gap: 12px; align-items: center; }
.allclear .ic { width: 24px; height: 24px; color: var(--ok); }
.allclear b { display: block; font-weight: 500; }
ul.items { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.items li { display: flex; align-items: center; gap: 16px; padding: 12px 16px; border: 1px solid var(--line); border-radius: 8px; background: var(--bg); }
ul.items .reg { min-width: 64px; font-size: 14px; font-weight: 500; }
ul.items .what { flex: 1; min-width: 0; display: grid; }
ul.items .what b { font-weight: 500; }
ul.items a.btn.go { background: var(--accent); color: var(--on-accent); border-color: transparent; }
@media (hover: hover) { ul.items a.btn.go:hover { background: color-mix(in srgb, var(--accent) 88%, #000); } }
#approve a.btn:not(.go) { background: var(--raised); color: var(--fg); border-color: var(--line); }
@media (max-width: 640px) { ul.items li { flex-wrap: wrap; } }
/* The figures: label above, figure below */
.cards .card span { margin: 0 0 4px; }
/* Top lists: a name, a figure, a thin bar under */
ul.bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
ul.bars li { display: grid; grid-template-columns: 1fr auto; gap: 4px 12px; }
ul.bars .meter { grid-column: 1 / -1; margin: 0; height: 4px; }
ul.bars li:first-child .meter i { background: var(--accent); }
@media (min-width: 1400px) { main > form.period { flex-wrap: nowrap; } }
.side .logo { width: 112px; }
.side nav .group { margin-top: 12px; }
.side { gap: 12px; }
/* The whole menu on one screen */
.side { padding: 12px 12px; }
.side .logo { width: 96px; }
.side .brand { gap: 4px; padding-bottom: 8px; }
.side nav { gap: 0; }
.side nav a { height: 32px; }
.side nav .group { margin: 12px 12px 4px; }
.side .foot { gap: 8px; padding-top: 8px; }
.side .foot .who { display: flex; align-items: center; gap: 8px; }
.side .foot .who .me { flex: 1; min-width: 0; }
.side .foot .who .me b, .side .foot .who .me small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side .foot .who button { width: 32px; height: 32px; padding: 0; color: var(--fg2); background: transparent; }
.side .foot .who button svg { width: 16px; height: 16px; }
.side nav .group { margin-top: 8px; }
/* Folded parts: opened when needed */
details.fold > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; cursor: pointer; }
details.fold > summary::-webkit-details-marker, details.add > summary::-webkit-details-marker, details.help > summary::-webkit-details-marker { display: none; }
details.fold > summary h2 { margin: 0; }
details.fold > summary::after { content: ""; width: 8px; height: 8px; border-right: 1.5px solid var(--muted); border-bottom: 1.5px solid var(--muted); transform: rotate(45deg); transition: transform .15s var(--ease); }
details.fold[open] > summary::after { transform: rotate(-135deg); }
details.fold[open] > summary { margin-bottom: 12px; }
details.add, details.help { margin-top: 12px; }
details.add > summary, details.help > summary { list-style: none; display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--fg2); }
details.add > summary::before { content: "+"; display: inline-grid; place-items: center; width: 20px; height: 20px; border-radius: 4px; background: var(--raised); color: var(--fg); font-weight: 400; }
details.help > summary::before { content: "i"; display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line2); color: var(--muted); font: 500 11px/1 var(--mono); }
details.add[open] > summary, details.help[open] > summary { margin-bottom: 8px; }
details.help p { max-width: 72ch; margin: 0; }
button.showall { margin-top: 12px; }
.note { max-width: 96ch; }
td.note, .note td { max-width: none; }
/* The auto-approval switch */
form.autoapp { display: flex; align-items: center; gap: 12px; padding-bottom: 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.todo.calm form.autoapp { padding-bottom: 12px; margin-bottom: 12px; }
label.toggle { display: flex; align-items: center; gap: 12px; cursor: pointer; }
label.toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
label.toggle .track { position: relative; flex: none; width: 40px; height: 24px; border-radius: 12px; background: var(--raised); border: 1px solid var(--line2); transition: background-color .15s var(--ease), border-color .15s var(--ease); }
label.toggle .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: var(--fg2); transition: transform .18s var(--ease), background-color .15s var(--ease); }
label.toggle input:checked + .track { background: var(--ok); border-color: transparent; }
label.toggle input:checked + .track::after { transform: translateX(16px); background: #fff; }
label.toggle input:focus-visible + .track { outline: 2px solid var(--fg2); outline-offset: 2px; }
label.toggle b { display: block; font-weight: 500; }
label.toggle .note { display: block; }

/* The pages of a section: tabs at the top, the one open underlined in red */
nav.tabs { display: flex; gap: 4px; flex-wrap: wrap; border-bottom: 1px solid var(--line); margin: -8px 0 4px; }
nav.tabs a { position: relative; padding: 8px 12px 10px; color: var(--fg2); text-decoration: none; font-weight: 500; border-radius: 8px 8px 0 0; transition: color .15s var(--ease), background-color .15s var(--ease); }
@media (hover: hover) { nav.tabs a:hover { color: var(--fg); background: var(--raised); } }
nav.tabs a.on { color: var(--fg); }
nav.tabs a.on::after { content: ""; position: absolute; left: 8px; right: 8px; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); }

/* The usual periods, one click each, before the two dates */
.period .presets { display: inline-flex; padding: 2px; gap: 2px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
.period .presets a { height: 26px; display: inline-flex; align-items: center; padding: 0 10px; border-radius: 6px; font-size: 13px; color: var(--fg2); text-decoration: none; white-space: nowrap; }
@media (hover: hover) { .period .presets a:hover { color: var(--fg); } }
.period .presets a.on { background: var(--paper); color: var(--fg); box-shadow: var(--shadow); font-weight: 500; }

/* The Overview: other things waiting, then what the office does most */
ul.attention { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
ul.attention a { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; background: var(--soft); border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent); color: var(--fg); text-decoration: none; font-weight: 500; }
ul.attention a .go { margin-left: auto; color: var(--accent-ink); }
nav.quick { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 12px; }
nav.quick a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); color: var(--fg); text-decoration: none; transition: border-color .15s var(--ease), transform .12s var(--ease); }
@media (hover: hover) { nav.quick a:hover { border-color: var(--line2); } }
nav.quick a:active { transform: scale(.99); }
nav.quick svg { flex: none; width: 36px; height: 36px; padding: 8px; border-radius: 8px; background: var(--raised); color: var(--fg2); }
nav.quick b { display: block; font-weight: 500; }
nav.quick small { display: block; color: var(--muted); font-size: 12px; line-height: 16px; }
.cards a.card { color: inherit; text-decoration: none; transition: background-color .15s var(--ease); }
@media (hover: hover) { .cards a.card:hover { background: var(--raised); } }

/* Rows that open their own page: the whole row is the link */
tr[data-href] { cursor: pointer; }
@media (hover: hover) { tr[data-href]:hover td { background: var(--raised); } }
/* Long lists: the box scrolls on its own, the column names stay in view */
.box.scroll.tall { max-height: calc(var(--vh) - 220px); overflow: auto; padding-top: 0; }
.box.scroll.tall thead th { position: sticky; top: 0; z-index: 1; background: var(--paper); padding-top: 16px; box-shadow: inset 0 -1px 0 var(--line); }
@media print { .box.scroll.tall { max-height: none; overflow: visible; } }
table.log a.src { text-decoration: none; color: var(--accent-ink); }

h1 .count { display: inline-block; margin-left: 6px; padding: 0 8px; border-radius: 6px; background: var(--raised); color: var(--fg2); font: 500 14px/24px var(--mono); vertical-align: 5px; letter-spacing: 0; }
/* ---- Screens from an iPad mini on its side to a 27" monitor ---- */
/* The logo of the app, sharper; the button that folds the menu */
.side .logo { width: 120px; }
.side .brand { grid-template-columns: 1fr auto; align-items: start; }
.side .brand .logo, .side .brand > span { grid-column: 1; }
.side .brand .fold { grid-column: 2; grid-row: 1; width: 32px; height: 32px; padding: 0; color: var(--muted); background: transparent; border-color: transparent; }
@media (hover: hover) { .side .brand .fold:hover { color: var(--fg); background: var(--raised); } }
.side .brand .fold svg { width: 18px; height: 18px; }
.side .brand:has(a.bell) .fold { grid-row: 2; }
.side .brand a.bell { position: static; grid-column: 2; grid-row: 1; }
/* A big screen: the page in the middle, wider */
@media (min-width: 1700px) {
  .shell { grid-template-columns: 264px minmax(0, 1fr); }
  main { max-width: 1680px; justify-self: center; padding: 32px 48px 56px; }
}
/* A low screen (iPad on its side): the whole menu still on it */
@media (max-height: 820px) and (min-width: 901px) {
  .side .logo { width: 88px; }
  .side .brand > span { display: none; }
  .side nav a { height: 30px; }
}
/* The narrow menu: icons only, the name as a tip */
@media (min-width: 901px) {
  .shell { transition: grid-template-columns .2s var(--ease); }
  :root[data-side="mini"] .shell { grid-template-columns: 64px minmax(0, 1fr); }
  :root[data-side="mini"] .side { padding: 12px 8px; align-items: center; }
  :root[data-side="mini"] .side .brand { grid-template-columns: 1fr; justify-items: center; padding: 0 0 8px; width: 100%; }
  :root[data-side="mini"] .side .brand .logo { width: 48px; height: 22px; object-fit: cover; object-position: top; }
  :root[data-side="mini"] .side .brand > span { display: none; }
  :root[data-side="mini"] .side .brand .fold, :root[data-side="mini"] .side .brand a.bell { grid-column: 1; grid-row: auto; }
  :root[data-side="mini"] .side .brand .fold svg { transform: scaleX(-1); }
  :root[data-side="mini"] .side nav { width: 100%; gap: 2px; }
  :root[data-side="mini"] .side nav a { justify-content: center; height: 40px; padding: 0; }
  :root[data-side="mini"] .side nav a .grow { display: none; }
  :root[data-side="mini"] .side nav a .ic { width: 20px; height: 20px; }
  :root[data-side="mini"] .side nav a .badge { position: absolute; top: 2px; right: 2px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; }
  :root[data-side="mini"] .side .foot { width: 100%; padding: 8px 0 0; justify-items: center; }
  :root[data-side="mini"] .side .foot .row { flex-direction: column; }
  :root[data-side="mini"] .side .switch { flex-direction: column; }
  :root[data-side="mini"] .side .switch a { padding: 2px 8px; }
  :root[data-side="mini"] .side .foot .who .me, :root[data-side="mini"] button.allow-alerts { display: none; }
}
/* A narrow screen (an iPad upright, a phone): the menu a row at the top */
@media (max-width: 900px) {
  /* The menu as high as it is; a short page does not stretch it. */
  .shell { grid-template-rows: auto 1fr; }
  .side { padding: 8px 12px; gap: 8px; align-content: flex-start; }
  .side .brand { display: flex; align-items: center; gap: 12px; padding: 0; }
  .side .brand .logo { width: 56px; }
  .side .brand .fold { display: none; }
  .side nav { flex-wrap: nowrap !important; overflow-x: auto; scrollbar-width: none; gap: 2px; }
  .side nav a { flex: none; }
  nav.tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  nav.tabs a { flex: none; }
}
/* The finish: calmer panels, a clearer title, hovered rows a shade */
h1 { font-weight: 600; letter-spacing: -.015em; }
.box, nav.quick a, .cards { border-radius: 14px; }
.box h2 { font-weight: 600; }
:root[data-theme="dark"] .box, :root[data-theme="dark"] .cards { border-color: rgba(227, 230, 235, .07); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .box, :root:not([data-theme="light"]) .cards { border-color: rgba(227, 230, 235, .07); } }
@media (hover: hover) { nav.quick a:hover, .cards a.card:hover { border-color: var(--line2); background: color-mix(in srgb, var(--paper) 85%, var(--raised)); } }
/* A switch between two views of one page (PIN / Dispatch System): the look
   of the period presets, not of the tabs of the section */
nav.seg { display: inline-flex; justify-self: start; padding: 2px; gap: 2px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; }
nav.seg a { height: 30px; display: inline-flex; align-items: center; padding: 0 14px; border-radius: 6px; color: var(--fg2); text-decoration: none; font-weight: 500; white-space: nowrap; }
@media (hover: hover) { nav.seg a:hover { color: var(--fg); } }
nav.seg a.on { background: var(--paper); color: var(--fg); box-shadow: var(--shadow); }
button:disabled { opacity: .45; cursor: default; transform: none; }
/* A name and its button side by side, apart */
form.rename { display: flex; gap: 8px; align-items: center; }
form.rename input { width: 10em; min-width: 0; }
/* The page never wider than the screen: a wide table scrolls in its box */
main { grid-template-columns: minmax(0, 1fr); }
/* The pages open to a person: by the role, or ticked */
dialog.access { width: min(760px, calc(100vw - 32px)); }
dialog.access form { display: grid; gap: 16px; }
dialog.access h2 { margin: 0; }
.seg.modes { display: inline-flex; flex-wrap: wrap; padding: 2px; gap: 2px; background: var(--raised); border: 1px solid var(--line); border-radius: 8px; justify-self: start; }
.seg.modes label { display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 6px; cursor: pointer; color: var(--fg2); }
.seg.modes label:has(input:checked) { background: var(--paper); color: var(--fg); box-shadow: var(--shadow); font-weight: 500; }
.seg.modes input { margin: 0; }
.pagegrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.pagegrid fieldset { margin: 0; padding: 10px 14px 12px; border: 1px solid var(--line); border-radius: 10px; display: grid; gap: 6px; align-content: start; }
.pagegrid legend { padding: 0 4px; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
.pagegrid label { display: flex; align-items: center; gap: 8px; cursor: pointer; }
dialog.access.byrole .pagegrid label { color: var(--fg2); cursor: default; }
dialog.access.byrole .pagegrid input { opacity: .6; }
dialog.access .acts { display: flex; gap: 8px; }
tr.off td { color: var(--muted); }
/* A page's own filter (a day, a kind): the names beside the fields, in one
   line with the title and the buttons, as the period has them */
form.filters { display: flex; gap: 8px 12px; align-items: center; flex-wrap: wrap; }
form.filters label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--muted); white-space: nowrap; }
form.filters input, form.filters select, form.filters button { height: 32px; }
.toolbar:has(form.filters) > a.btn, .toolbar:has(form.filters) > button { height: 32px; }
.toolbar > h1 { margin-right: 8px; }
dialog.access .who { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
dialog.access .who label, form.adduser label.role { display: grid; gap: 4px; font-size: 12px; color: var(--muted); }
dialog.access h3 { margin: 0; }
ul.chosen { margin: 8px 0; padding-left: 18px; font-size: 13px; color: var(--fg2); display: grid; gap: 2px; }
/* Bigger on a big screen, in steps by its width: the same page as on a
   laptop, only larger (a 27" monitor about 1.4 times); a laptop and a
   tablet as they are. Media queries go by the real width, so the steps
   and the folding of the menu are not moved by it. */
/* --vh: the height of the window in the page's own (zoomed) pixels */
:root { --z: 1; --vh: calc(100vh / var(--z)); }
/* The height the browser really shows: on an iPad or a phone 100vh reaches under Safari's bar */
@supports (height: 100dvh) { :root { --vh: calc(100dvh / var(--z)); } }
@media (min-width: 1680px) { :root { --z: 1.1; } }
@media (min-width: 1920px) { :root { --z: 1.2; } }
@media (min-width: 2240px) { :root { --z: 1.3; } }
@media (min-width: 2500px) { :root { --z: 1.4; } }
@media (min-width: 3200px) { :root { --z: 1.6; } }
html { zoom: var(--z); }
@media print { :root { --z: 1; } }
/* The logo in the middle of the menu, the name under it in one line; the
   fold and the bell in its corners */
@media (min-width: 901px) {
  :root:not([data-side="mini"]) .side .brand { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0 12px; }
  :root:not([data-side="mini"]) .side .brand .fold { position: absolute; top: 0; left: 0; }
  :root:not([data-side="mini"]) .side .brand a.bell { position: absolute; top: 0; right: 0; }
}
.side .brand .name { display: block; text-align: center; white-space: nowrap; font-size: 13px; }
.side .brand .name b, .side .brand .name small { display: inline; font-size: 13px; }
.side .brand .name small { color: var(--muted); }
@media (max-width: 900px) { .side .brand .name { text-align: left; } }

/* Overview: the name of the site on frosted glass, the logo at the right.
   The logo keeps its size (150 x 120); the glass keeps clear of it; the
   letters follow the banner's width; a narrow banner has no logo (the menu
   has one) and the glass goes all across. */
header.hero { position: relative; overflow: hidden; border-radius: 18px; min-height: 150px; padding: 24px;
  display: flex; align-items: center; gap: 24px; color: #fff; container-type: inline-size; container-name: hero;
  background: radial-gradient(120% 140% at 85% 20%, #2f4675 0%, #1c2a47 55%, #141d33 100%); }
header.hero::after { content: ""; position: absolute; left: -10%; bottom: -60%; width: 60%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 52, 58, .35), transparent 65%); pointer-events: none; }
header.hero .mark { flex: none; order: 2; margin-left: auto; margin-right: 4px; width: 150px; height: 120px; position: relative; z-index: 1;
  background: url("/static/helidrive_on_dark.png") center / contain no-repeat; opacity: .92; }
header.hero .glass { position: relative; z-index: 1; min-width: 0; padding: 18px 26px; border-radius: 14px;
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .2), 0 8px 24px rgba(0, 0, 0, .18); }
header.hero .eyebrow { display: block; font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .7); }
header.hero h1 { margin: 2px 0 4px; font-size: clamp(20px, 3.3cqi, 34px); line-height: 1.18; font-weight: 600; letter-spacing: .05em;
  text-transform: uppercase; color: #fff; }
header.hero h1 .nw { white-space: nowrap; }
header.hero h1 em { font-style: normal; color: #f0686c; }
header.hero p { margin: 0; font-size: 13px; color: rgba(255, 255, 255, .75); }
@media (max-width: 900px) { header.hero { min-height: 120px; padding: 16px; } }
@container hero (max-width: 640px) {
  header.hero .mark { display: none; }
  header.hero .glass { flex: 1; }
  header.hero h1 { font-size: clamp(20px, 5cqi, 30px); }
}
/* The period of the Overview: under the banner, at the right */
main > form.period:has(+ header.hero) { order: 1; justify-self: end; }
main > header.hero { order: 0; }
main > header.hero ~ * { order: 2; }
/* The bell's window: beside the menu, at the top */
.bellbox { position: fixed; z-index: 70; top: 12px; left: 256px; width: 360px; max-height: calc(var(--vh) - 24px); overflow: auto;
  background: var(--solid); color: var(--fg); border: 1px solid var(--line2); border-radius: 14px; box-shadow: var(--float); padding: 8px; }
.bellbox[hidden] { display: none; }
@media (min-width: 1700px) { .bellbox { left: 272px; } }
@media (min-width: 901px) { :root[data-side="mini"] .bellbox { left: 72px; } }
@media (max-width: 900px) { .bellbox { top: 64px; left: 12px; right: 12px; width: auto; } }
.bellbox .bellhead { padding: 8px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.bellbox ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.bellbox li a { display: grid; grid-template-columns: 28px 1fr auto; gap: 10px; align-items: start; padding: 10px; border-radius: 10px; color: var(--fg); text-decoration: none; }
@media (hover: hover) { .bellbox li a:hover { background: var(--raised); } }
.bellbox li i { font-style: normal; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-size: 14px; background: var(--raised); color: var(--fg2); }
.bellbox li a.k-approve i { background: var(--accent); color: #fff; }
.bellbox li a.k-review i { background: var(--warn-soft); color: var(--warn); }
.bellbox li b { display: block; font-weight: 500; }
.bellbox li small { display: block; color: var(--muted); font-family: var(--mono); font-size: 12px; }
.bellbox li time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.bellbox .empty { margin: 0; padding: 14px 10px; }

/* "i": a small window with what is less needed (when changed, by whom) */
button.info { width: 26px; height: 26px; padding: 0; border-radius: 50%; font: italic 600 13px/1 Georgia, serif; color: var(--fg2); flex: none; }
.infopop { position: fixed; z-index: 50; max-width: min(320px, 90vw); padding: 10px 12px; border-radius: 10px; color: var(--fg); border: 1px solid var(--line2); box-shadow: 0 10px 28px rgba(0, 0, 0, .45); font-size: 13px; line-height: 18px; white-space: pre-line;
  /* Solid and frosted: what lies under it does not show through the text. */
  background: color-mix(in srgb, var(--solid) 88%, #000); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); }
:root[data-theme="light"] .infopop { background: var(--solid); }
/* Buttons of a row as icons: the name in the tip */
.iconbtns { display: inline-flex; gap: 6px; align-items: center; justify-content: flex-end; }
.iconbtns form { display: inline; margin: 0; }
.iconbtns .icon, .iconbtns a.icon { width: 34px; height: 34px; padding: 0; }
a.btn.icon { padding: 0; width: 34px; }
.iconbtns svg { width: 17px; height: 17px; }
button.icon.bad { color: var(--bad); }
td.tight, th.tight { width: 1%; white-space: nowrap; }

/* A narrow panel (an iPad upright with the menu open): the columns that
   matter least are left out; the flight page shows them all. */
.box.scroll { container-type: inline-size; }
@container (max-width: 940px) { .wide-only { display: none; } }
@container (max-width: 640px) { td .tag { white-space: normal; } }
/* A narrow panel: the cells a little closer, so a table of eight columns fits */
@container (max-width: 760px) { th, td { padding-left: 8px; padding-right: 8px; } }

/* People, Edit: the new password under the pages */
dialog.access form.pwform { gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.pwform .pwrow { display: flex; flex-wrap: wrap; gap: 8px; }
.pwform .pwrow input { flex: 1 1 150px; min-width: 0; }
/* Touch: a tablet or a phone should feel like an app, not a page in a browser.
   No grey flash on a tap (the press shows itself), no zoom on a double tap,
   no text selected by a long press on a button or a menu item. */
html { -webkit-tap-highlight-color: transparent; }
a, button, label, summary, select, input[type=checkbox], input[type=radio] { touch-action: manipulation; }
button, a.btn, label.btn, .side nav a, nav.tabs a, nav.quick a, nav.seg a, .switch a, details > summary { -webkit-user-select: none; user-select: none; }
.side nav a:active, tr[data-href]:active td, .bellbox li a:active, nav.tabs a:active { background: var(--raised); }
/* A phone zooms into a field with text under 16px and does not zoom back */
@media (pointer: coarse) and (max-width: 900px) { input, select, textarea { font-size: 16px; } }

/* Windows that open: they come in fast and from where they belong.
   The modal from the middle, the bell's window from the bell, the "i" from its button. */
dialog { transition: opacity .2s var(--ease), transform .2s var(--ease), overlay .2s allow-discrete, display .2s allow-discrete; }
dialog:not([open]) { opacity: 0; transform: scale(.96); }
@starting-style { dialog[open] { opacity: 0; transform: scale(.96); } }
dialog::backdrop { transition: opacity .2s var(--ease), overlay .2s allow-discrete, display .2s allow-discrete; }
dialog:not([open])::backdrop { opacity: 0; }
@starting-style { dialog[open]::backdrop { opacity: 0; } }
.bellbox { transform-origin: top left; transition: opacity .15s var(--ease), transform .15s var(--ease); }
@starting-style { .bellbox { opacity: 0; transform: scale(.97); } }
@media (max-width: 900px) { .bellbox { transform-origin: top right; } }
.infopop { transform-origin: top right; transition: opacity .125s var(--ease), transform .125s var(--ease); }
.infopop.up { transform-origin: bottom right; }
@starting-style { .infopop { opacity: 0; transform: scale(.97); } }
.live-toast { transition: opacity .3s var(--ease), transform .3s var(--ease); }
@starting-style { .live-toast { opacity: 0; transform: translateY(8px); } }
/* Less motion asked for: the same windows only fade, nothing moves or grows */
@media (prefers-reduced-motion: reduce) {
  dialog, dialog:not([open]), .bellbox, .infopop, .live-toast { transform: none !important; }
  @starting-style { dialog[open], .bellbox, .infopop, .live-toast { transform: none !important; } }
  button:active, a.btn:active, nav.quick a:active { transform: none; }
  .shell, details.fold > summary::after, label.toggle .track::after { transition: none !important; }
}

/* Opened from the Home Screen as an app: iOS 26 blurs a band under the status
   bar (its "scroll edge effect", not ours, and not to be turned off). The bell,
   the tabs and the title start below that band; in a browser nothing moves. */
:root[data-app] main { padding-top: 64px; }
:root[data-app] .side { padding-top: 56px; }
@media (max-width: 900px) { :root[data-app] main { padding-top: 16px; } :root[data-app] .side { padding-top: 48px; } }
