:root { --ink: #1d232a; --muted: #6b7480; --line: #d9dee4; --bg: #f6f7f9; --card: #fff; --accent: #0b5cad; --bad: #b00020; --good: #116329; }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; font: 14px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; color: var(--ink); background: var(--bg); }
header { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; padding: 10px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
/* ANC's logo (part 2F, Z, 23 Nov 2026): in the header, and centred on the sign-in card and on the printed
   container list */
.brand { display: flex; }
.brand img { display: block; height: 28px; width: auto; }
.logo-big { display: block; height: 56px; width: auto; margin: 0 auto 8px; }
.logo-big + h1 { text-align: center; }
.print-logo { display: block; height: 40px; width: auto; margin: 0 auto 8px; }
/* Part 2N (Z, 25 Nov 2026): a ship's BCs printed together, each on a page of its own; on screen a dashed line between */
.bc-page + .bc-page { border-top: 2px dashed var(--line); margin-top: 24px; padding-top: 16px; }
.bc-page table.print th:first-child { width: 4em; }   /* "No.", next to the container numbers */
header nav { display: flex; flex-wrap: wrap; gap: 4px; flex: 1; }
header nav a, .tabs a { padding: 6px 10px; border-radius: 6px; color: var(--ink); text-decoration: none; }
header nav a.here, .tabs a.here { background: var(--accent); color: #fff; }
.tabs { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 8px; }
main { padding: 16px; max-width: 1600px; margin: 0 auto; }
h1 { font-size: 22px; margin: 4px 0 12px; }
h2 { font-size: 17px; margin: 20px 0 8px; }
h3 { font-size: 15px; margin: 8px 0; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 12px 16px; margin: 12px 0; }
.narrow { max-width: 380px; margin: 40px auto; }
label { display: flex; flex-direction: column; gap: 4px; font-weight: 600; margin: 6px 0; }
label.check { flex-direction: row; align-items: center; font-weight: normal; }
input, select, button { font: inherit; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--ink); }
button, .button { background: var(--accent); color: #fff; border: 1px solid var(--accent); cursor: pointer; text-decoration: none; display: inline-block; padding: 6px 12px; border-radius: 6px; }
button:disabled { opacity: .5; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; }
.row > label { flex: 1 1 200px; }
input.count { width: 5em; }
input.wide { width: 100%; }
table { border-collapse: collapse; width: 100%; background: var(--card); }
th, td { border-bottom: 1px solid var(--line); padding: 5px 8px; text-align: left; vertical-align: top; }
th.sortable { cursor: pointer; white-space: nowrap; }
td.num { text-align: right; white-space: nowrap; }
td.edit { cursor: text; }
td.edit:hover { background: #eef4fb; }
.sheet { overflow-x: auto; }
table.grid { font-size: 13px; white-space: nowrap; }
tr.struck td, h1.struck { text-decoration: line-through; color: var(--bad); }
.tiles { display: flex; flex-wrap: wrap; gap: 10px; }
.tile { display: flex; flex-direction: column; align-items: flex-start; min-width: 170px; background: var(--card); color: var(--ink); border: 1px solid var(--line); }
.tile b { font-size: 26px; }
.bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 10px; }
/* Part 2L: the job list's "Columns" (jobs.js): a button that opens the columns to tick, across the bar */
details.columns summary { cursor: pointer; padding: 6px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
details.columns[open] { flex-basis: 100%; }
details.columns > div { display: flex; flex-wrap: wrap; gap: 0 14px; }
.muted { color: var(--muted); }
.error, .bad { color: var(--bad); }
.good { color: var(--good); }
#note { position: fixed; bottom: 16px; left: 16px; right: 16px; max-width: 640px; margin: 0 auto; padding: 10px 14px; border-radius: 8px; background: var(--card); border: 1px solid var(--line); box-shadow: 0 4px 16px rgba(0, 0, 0, .12); z-index: 10; } /* 2L: above the job list's sticky cells */
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
dl.facts dt { font-weight: 600; }
dl.facts dd { margin: 0; }
/* min-width 0 (part 2G): a box whose pickers hold long company names (who ANC bills) still fits a phone's screen */
fieldset { border: 1px solid var(--line); border-radius: 8px; margin: 10px 0; min-width: 0; }
.bk-cards { display: none; }
/* Part 2L (Z, 24 Nov 2026: "can i get all 22 columns?"): on a computer ANC's job list is a sheet in its own scroll box,
   as wide as the window and as high as what is left of it below the filter bar, so both scrollbars stay on screen; the
   header row and the open and JOB# columns stay in view (jobs.js measures the open column: --sheet-col1); long text
   wraps within its column (jobs.js, SHEET_WRAP: .w0-.w3), the rest stays on one line. A phone keeps it as it was, and
   a printout too. */
@media screen and (min-width: 641px) {
  body:has(.sheet) { display: flex; flex-direction: column; height: 100vh; }
  body:has(.sheet) > main { flex: 1 1 auto; min-height: 0; width: 100%; max-width: none; padding: 12px 8px; display: flex; flex-direction: column; }
  .sheet { flex: 0 1 auto; min-height: 240px; overflow: auto; width: fit-content; max-width: 100%; border: 1px solid var(--line); background: var(--card); }
  .sheet table.grid { width: max-content; border-collapse: separate; border-spacing: 0; font-size: 12px; line-height: 1.3; }
  .sheet th, .sheet td { padding: 2px; border-right: 1px solid var(--line); }
  .sheet thead th { position: sticky; top: 0; z-index: 2; background: #eef1f4; vertical-align: bottom; font-size: 11px; }
  .sheet tr > :nth-child(-n+2) { position: sticky; left: 0; z-index: 1; background: var(--card); }
  .sheet tr > :nth-child(2) { left: var(--sheet-col1, 14px); border-right-color: #aab3bd; }
  .sheet thead tr > :nth-child(-n+2) { z-index: 3; background: #eef1f4; }
  .sheet tr > :first-child { min-width: 14px; text-align: center; }
  .sheet td.edit:hover { background: #eef4fb; }
  .sheet .w0, .sheet .w1, .sheet .w2, .sheet .w3 { white-space: normal; }
  .sheet td .w1, .sheet td .w2, .sheet td .w3 { overflow-wrap: anywhere; }
  .sheet .w0 { max-width: 100px; min-width: min-content; }
  .sheet .w1 { max-width: 64px; }
  .sheet .w2 { max-width: 76px; }
  .sheet .w3 { max-width: 88px; }
  .sheet th div { min-width: min-content; }
  .sheet td input { padding: 1px 3px; font-size: inherit; }
}
/* A phone (640px wide or less): nothing wider than the screen, a lighter header, and no zoom when a box is tapped
   (an iPhone zooms in on a box whose text is smaller than 16px). */
@media (max-width: 640px) {
  main { padding: 10px; }
  .card { padding: 10px 12px; }
  .tile { min-width: 46%; }
  header { gap: 4px 12px; padding: 8px 10px; }
  header strong { display: none; }
  .brand img { height: 24px; }
  header nav { order: 2; flex-basis: 100%; }
  header nav a { padding: 6px 8px; }
  #who { flex: 1; }
  #logout { background: none; border: 0; color: var(--accent); padding: 6px 0; }
  input, select { font-size: 16px; max-width: 100%; }
  label { min-width: 0; }
  /* Bookings: a short card each (core.js, bookingTable) */
  table.list.bk-table { display: none; }  /* must outrank "table.list { display: block; }" below */
  .bk-cards { display: block; }
  .bk { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; margin: 0 0 8px; }
  .bk-top { display: flex; justify-content: space-between; gap: 8px; }
  .bk-top a { font-weight: 600; }
  .bk.struck { text-decoration: line-through; color: var(--bad); }
  .bk-more { margin-top: 6px; }
  .bk-more .button { display: block; text-align: center; padding: 10px; }
  /* Other lists: a card per row, each value after its column's name (core.js, table) */
  table.list, table.list tbody, table.list tr, table.list td { display: block; }
  table.list { background: none; }
  table.list thead { display: none; }
  table.list tr { background: var(--card); border: 1px solid var(--line); border-radius: 8px; padding: 6px 12px; margin: 0 0 8px; }
  table.list td { border: 0; padding: 2px 0; text-align: left; white-space: normal; overflow-wrap: anywhere; }
  table.list td:empty { display: none; }
  table.list td[data-label]::before { content: attr(data-label) ": "; color: var(--muted); }
  .card .bk, .card table.list tr { border-width: 1px 0 0; border-radius: 0; margin: 0; padding: 8px 0; }
  /* The booking form's sailing rows stay a table, sized to fit */
  table.fit th, table.fit td { padding: 4px; }
  table.fit input.count { width: 3.6em; }
}
/* Part 2B: the relay's banner for ANC */
.banner { background: #fff4e5; color: #7a4100; border-bottom: 1px solid #f0c48a; padding: 8px 16px; font-weight: 600; }
/* Part 2D: the loading team's container list (home.js, VIEWS.print) prints alone, on white */
@media print {
  header, .banner, #note, .noprint, button, .button { display: none !important; }
  body, table { background: #fff; color: #000; }
  main { padding: 0; max-width: none; }
  h1 { font-size: 18px; }
  table.print { font-size: 12px; }
  table.print th, table.print td { border-bottom: 1px solid #999; padding: 3px 6px; }
  .bc-page + .bc-page { break-before: page; border: 0; margin: 0; padding: 0; }
}
