/* Logbook Converter — direction A "Fleet List" (planespotters-led), applied 2026-10-27.
   Open Sans throughout, navy title bar, ruled uppercase section headings, bordered
   table with pale-blue zebra rows and tinted key columns. See design/DESIGN.md. */

:root {
  --sans: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: var(--sans);
  --bg: #ffffff; --panel: #ffffff; --ink: #1f2a37; --muted: #5d6b7c;
  --line: #e1e7ee; --line-strong: #c9d3de; --stripe: #dce6f2; --stripe2: #f2f2f2; --key: #e4ecf5; --key-stripe: #dce6f1;
  --accent: #1c5fa8; --accent-ink: #ffffff; --nav: #1d2733; --nav-ink: #ffffff;
  --bad-bg: #fde3e3; --bad-ink: #9d1b1b; --ok-bg: #e4f3e8; --ok-ink: #1d6b35; --warn-bg: #fff4d6; --warn-ink: #7a5300;
  /* master logbook header: Excel accent1 #4F81BD at -25% (day) and -50% (night) tint, white text */
  --hdr-day: #3b618e; --hdr-night: #28415f; --hdr-ink: #ffffff;
  --night-stripe: #e8edf4; --night-stripe-alt: #dfe6ef; --night-key: #d8e1ec; --night-key-alt: #cfdae8;
  --r: 3px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f141a; --panel: #141a21; --ink: #e4e9ef; --muted: #96a3b3;
    --line: #243040; --line-strong: #324256; --stripe: #161e27; --stripe2: #1a2028; --key: #1b2634; --key-stripe: #1f2c3c;
    --accent: #5aa2ea; --accent-ink: #0b1220; --nav: #0a0f15; --nav-ink: #ffffff;
    --bad-bg: #3b1818; --bad-ink: #ff9b9b; --ok-bg: #163021; --ok-ink: #8fd9a8; --warn-bg: #3a2f10; --warn-ink: #ffd27a;
    --night-stripe: #121a24; --night-stripe-alt: #0f161e; --night-key: #172231; --night-key-alt: #131d2a;
  }
}
:root[data-theme="dark"] {
  --bg: #0f141a; --panel: #141a21; --ink: #e4e9ef; --muted: #96a3b3;
  --line: #243040; --line-strong: #324256; --stripe: #161e27; --stripe2: #1a2028; --key: #1b2634; --key-stripe: #1f2c3c;
  --accent: #5aa2ea; --accent-ink: #0b1220; --nav: #0a0f15; --nav-ink: #ffffff;
  --bad-bg: #3b1818; --bad-ink: #ff9b9b; --ok-bg: #163021; --ok-ink: #8fd9a8; --warn-bg: #3a2f10; --warn-ink: #ffd27a;
  --night-stripe: #121a24; --night-stripe-alt: #0f161e; --night-key: #172231; --night-key-alt: #131d2a;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font: 14.5px/1.5 var(--sans); padding: 0 0 56px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 16px; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); font-weight: 400; }
.hidden { display: none !important; }

/* title bar */
.bar { background: var(--nav); color: var(--nav-ink); }
.bar-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; height: 54px; }
.brand { margin: 0; font-weight: 400; letter-spacing: .12em; font-size: 17px; text-transform: uppercase; white-space: nowrap; }
.brand b { font-weight: 800; }
.bar-meta { font-size: 12px; letter-spacing: .06em; text-transform: uppercase; opacity: .78; text-align: right; }
.sub { margin: 14px 0 0; color: var(--muted); font-size: 14px; }

/* ruled section headings */
h2.rule, .panel > summary { font: 700 13.5px/1 var(--sans); text-transform: uppercase; letter-spacing: .05em; margin: 30px 0 12px; padding-bottom: 10px; border-bottom: 1px solid var(--ink); display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 12px; color: var(--ink); }
.count, .panel > summary .muted { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13.5px; color: var(--muted); }
.panel > summary { cursor: pointer; list-style: none; }
.panel > summary::-webkit-details-marker { display: none; }
.panel > summary::before { content: "▸"; font-size: 11px; color: var(--muted); margin-right: 2px; }
.panel[open] > summary::before { content: "▾"; }

/* drop zone */
.drop { position: relative; border: 1.5px dashed var(--line-strong); border-radius: 4px; background: var(--panel); padding: 30px 20px; text-align: center; cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop:focus-visible, .drop.over { border-color: var(--accent); background: var(--stripe); outline: none; }
.drop input { position: absolute; inset: 0; opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.drop-title { font-size: 17px; font-weight: 600; }
.drop-hint { color: var(--muted); margin-top: 6px; font-size: 13px; }

.message { margin: 14px 0; padding: 10px 14px; border-radius: var(--r); background: var(--panel); border: 1px solid var(--line-strong); }
.message.ok { background: var(--ok-bg); color: var(--ok-ink); border-color: transparent; }
.message.warn { background: var(--warn-bg); color: var(--warn-ink); border-color: transparent; }

.summary { margin: 16px 0 0; display: grid; gap: 4px; font-size: 14px; }
.summary .file.bad { color: var(--bad-ink); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px 16px; align-items: center; justify-content: flex-end; margin: 0 0 12px; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.opt { color: var(--muted); font-size: 13px; display: inline-flex; gap: 6px; align-items: center; margin-right: 6px; }
button, .btn { font: inherit; font-size: 13.5px; font-weight: 600; padding: 7px 14px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--panel); color: var(--ink); cursor: pointer; }
button:hover, .btn:hover { border-color: var(--accent); color: var(--accent); }
button:disabled { opacity: .45; cursor: default; border-color: var(--line-strong); color: var(--ink); }
button.primary { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
button.primary:hover { color: var(--accent-ink); filter: brightness(1.08); }
button.ghost { background: transparent; border-color: transparent; color: var(--muted); font-weight: 400; }

/* table */
.table-wrap { overflow-x: auto; border: 1px solid var(--line-strong); background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 8px 6px; border-bottom: 1px solid var(--line); text-align: center; white-space: nowrap; vertical-align: middle; }
thead { position: sticky; top: 0; z-index: 1; }
th { background: var(--hdr-day); color: var(--hdr-ink); font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .03em; border-bottom: 1px solid rgba(255,255,255,.18); border-left: 1px solid rgba(255,255,255,.18); }
th.night { background: var(--hdr-night); }
th.key { background: var(--hdr-day); }
/* body cells carry no fill of their own; the master's table style stripes whole rows:
   accent-blue at +80 % then white at -5 %, nothing by column or by value */
tbody tr:nth-child(odd) td { background: var(--stripe); }
tbody tr:nth-child(even) td { background: var(--stripe2); }
tr:last-child td { border-bottom: 0; }
td.c, th.c { width: 30px; text-align: center; }
.num { text-align: center; font-variant-numeric: tabular-nums; }
td.bad { background: var(--bad-bg) !important; color: var(--bad-ink); }
td small { display: block; color: var(--muted); font-size: 10.5px; font-weight: 400; line-height: 1.2; }
tr.excluded td { opacity: .42; text-decoration: line-through; }
tr.excluded td.c { opacity: 1; text-decoration: none; }
td.notes { white-space: normal; color: var(--muted); font-size: 12.5px; min-width: 150px; text-align: left; }
.hint { color: var(--muted); font-size: 12.5px; margin: 10px 2px 0; }

/* registrations and ignored rows */
.panel { margin-top: 6px; }
.fins { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 8px; margin: 10px 0 12px; }
.fin { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--panel); }
.fin.missing { border-color: var(--bad-ink); background: var(--bad-bg); }
.fin span { min-width: 34px; font-weight: 700; }
.fin input { flex: 1; min-width: 0; font: inherit; padding: 4px 6px; border-radius: var(--r); border: 1px solid var(--line-strong); background: var(--bg); color: var(--ink); text-transform: uppercase; letter-spacing: .02em; }
.fin input:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.fin small { color: var(--muted); }
.skipped { margin: 8px 0 4px; padding-left: 18px; font-size: 13px; color: var(--muted); }

@media (max-width: 640px) {
  .bar-inner { height: auto; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 0; }
  .bar-meta { text-align: left; }
  th, td { padding: 7px 8px; }
  .toolbar { justify-content: flex-start; }
}

/* master-order header tiers */
tr.letters th { font-size: 11px; font-weight: 600; color: var(--muted); text-align: center; padding: 5px 6px; letter-spacing: .06em; background: var(--key); border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); }
tr.letters th.c, tr.letters th.notes-h, tr.letters th.helper-h { background: var(--panel); color: var(--ink); vertical-align: bottom; text-align: left; border-left: 1px solid var(--line-strong); }
tr.letters th.c { text-align: center; }
tr.letters th.notes-h small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
tr.groups th, tr.daynight th { font-size: 11px; font-weight: 700; text-align: center; padding: 5px 4px; letter-spacing: .06em; white-space: nowrap; }
tr.groups th:first-child { border-left: 0; }
tr.names th { padding-top: 7px; padding-bottom: 7px; vertical-align: middle; font-weight: 500; }
/* blank columns are formatted exactly like filled ones: same width, padding and header look as the master */
th.blank, td.blank, tr.names th.vert, td.num.key { width: 38px; min-width: 38px; max-width: 38px; padding-left: 4px; padding-right: 4px; text-align: center; }
tr.names th.blank, tr.names th.vert { writing-mode: vertical-rl; transform: rotate(180deg); text-align: center; vertical-align: middle; height: 76px; padding: 6px 0; font-size: 10.5px; letter-spacing: .04em; white-space: nowrap; line-height: 1; }
tr.names th.vert.key { background: var(--hdr-day); }
tr.names th.vert.key.night { background: var(--hdr-night); }
/* the sideways names of I–Z all share one look, whether the column is filled or blank */
tr.names th.blank, tr.names th.vert { color: var(--hdr-ink); font-weight: 600; }
td.dim { color: var(--muted); }

/* departure-time helper column */
td.helper { padding-top: 4px; padding-bottom: 4px; border-left: 1px solid var(--line-strong); }
input.dep { width: 66px; font: inherit; font-size: 12.5px; padding: 3px 6px; border: 1px solid var(--line-strong); border-radius: var(--r); background: var(--bg); color: var(--ink); text-align: center; }
input.dep:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
input.dep.bad { border-color: var(--bad-ink); background: var(--bad-bg); color: var(--bad-ink); }
td.helper { white-space: nowrap; }
td.helper small.daymark { display: inline; margin-left: 4px; font-size: 10px; color: var(--muted); }

th.blank.night { background: var(--hdr-night); }

/* helper columns on the left (✓, PF, Dep UTC) stay put while the A–AL block scrolls */
th.c, td.c, th.helper-h, td.helper { position: sticky; z-index: 2; background: var(--panel); }
thead th.c, thead th.helper-h { z-index: 3; }
th.c, td.c { left: 0; }
th.helper-h:nth-child(2), td.helper.pf { left: 31px; }
th.helper-h:nth-child(2) { min-width: 58px; }
th.helper-h:nth-child(3), td.helper.dep { left: 89px; border-right: 1px solid var(--line-strong); }
/* the helper columns are not part of the master, so they stay white outside the stripe scheme */
tbody tr:nth-child(odd) td.c, tbody tr:nth-child(odd) td.helper, tbody tr:nth-child(even) td.c, tbody tr:nth-child(even) td.helper { background: var(--panel); }
table.no-helpers th.c, table.no-helpers td.c, table.no-helpers th.helper-h, table.no-helpers td.helper { display: none; }
td.helper.pf { width: 58px; min-width: 58px; text-align: center; border-left: 0; }
td.helper.dep { width: 100px; min-width: 100px; }
tr.letters th.helper-h { vertical-align: bottom; }
th.helper-h small { display: block; font-size: 10px; font-weight: 400; letter-spacing: 0; text-transform: none; color: var(--muted); }
.conv .opt input[type=number] { width: 56px; font: inherit; padding: 2px 4px; border: 1px solid var(--line-strong); border-radius: var(--r); }
td.count { font-variant-numeric: tabular-nums; }
tr.names th.blank, th.vert { height: 104px; }

/* top-bar Settings button and dialog */
.bar-right { display: flex; align-items: center; gap: 14px; }
.bar-btn { font: 600 12px/1 var(--sans); letter-spacing: .08em; text-transform: uppercase; color: var(--nav-ink); background: transparent; border: 1px solid rgba(255,255,255,.45); border-radius: var(--r); padding: 7px 12px; cursor: pointer; }
.bar-btn:hover, .bar-btn:focus-visible { background: rgba(255,255,255,.12); border-color: rgba(255,255,255,.8); outline: none; }
.about { width: min(720px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0; border: 0; border-radius: 6px; background: var(--panel); color: var(--ink); box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.about::backdrop { background: rgba(15, 20, 26, .55); }
.about-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; background: var(--nav); color: var(--nav-ink); position: sticky; top: 0; }
.about-head h2 { margin: 0; font: 700 14px/1 var(--sans); text-transform: uppercase; letter-spacing: .08em; }
.about-head .ghost { color: var(--nav-ink); background: transparent; border-color: rgba(255,255,255,.45); padding: 4px 9px; }
.about-body { padding: 6px 22px 22px; font-size: 14px; line-height: 1.55; }
.about-body h3 { margin: 20px 0 6px; font: 700 12.5px/1 var(--sans); text-transform: uppercase; letter-spacing: .06em; color: var(--ink); border-bottom: 1px solid var(--line-strong); padding-bottom: 7px; }
.about-body p, .about-body ul { margin: 0 0 8px; color: var(--ink); }
.about-body ul { padding-left: 20px; }
.about-body li { margin: 3px 0; }
@media (max-width: 720px) { .bar-right { width: 100%; justify-content: space-between; } }

.about-body .set { padding: 14px 0 16px; border-bottom: 1px solid var(--line-strong); }
.about-body .set:last-child { border-bottom: 0; }
.about-body .set h3 { margin: 0 0 10px; border: 0; padding: 0; display: flex; gap: 10px; align-items: baseline; }
.about-body .set h3 .muted { font-weight: 400; text-transform: none; letter-spacing: 0; font-size: 13px; }
.about-body .set .actions { margin-top: 8px; }
.about-body .fins { max-height: 260px; overflow: auto; }

/* faint column lines between body cells, as the master's table style draws them (white at -15 %) */
tbody td { border-left: 1px solid var(--line); }
tbody td:first-child { border-left: 0; }
td.helper.pf { border-left: 1px solid var(--line); }

/* every value in the A–AL block reads in the body ink, counts included */
tbody td.num { color: var(--ink); }

/* the Fetch button in the Dep UTC header */
button.mini { display: block; margin: 6px auto 0; padding: 3px 9px; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; border-radius: var(--r); border: 1px solid var(--accent); color: var(--accent); background: var(--panel); }
button.mini:disabled { opacity: .4; border-color: var(--line-strong); color: var(--muted); }
.message.info { border-color: var(--accent); }
