:root {
  color-scheme: light dark;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #16191d;
  --muted: #5b6470;
  --line: #d5d9df;
  --accent: #0072b2;       /* Okabe-Ito blue */
  --accent-text: #ffffff;
  --ok-bg: #e3f2ec;  --ok-line: #009e73;
  --bad-bg: #fbe8de; --bad-line: #d55e00;
  --warn-bg: #fdf6d8; --warn-line: #8a7400;
  --canvas: #eef1f4;
  --radius: 10px;
  /* status colours for text (4.5:1 or better on panel and bg) */
  --ok-text: #00704f; --bad-text: #a8410a; --warn-text: #6b5a00;
  /* light red fill for the Claude Code / build data tool buttons */
  --tool-bg: #fde8e8; --tool-line: #d98c8c;
  /* Print buttons: Okabe-Ito bluish green, apart from the blue main actions. */
  --print-bg: #00704f; --print-text: #ffffff;
  /* Selected / current / pressed (page link, tab, filter chip, Mode, an open
     menu): in light mode a soft blue with a blue edge, so blue means "this
     one" or "act here" and cards stay white with grey edges. Dark mode keeps
     its light-on-dark fill (the same colours as --text and --bg there). */
  --sel-bg: #e6f1f7; --sel-text: #005a8c; --sel-line: #0072b2;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #121417; --panel: #1b1e23; --text: #e8eaed; --muted: #9aa3ad; --line: #333941;
    --accent: #56b4e9; --accent-text: #0b1620;
    --ok-bg: #12302a; --bad-bg: #3a2214; --warn-bg: #332d10; --warn-line: #f0e442;
    --canvas: #15181c;
    --ok-text: #3fd1a5; --bad-text: #ff9b5e; --warn-text: #f0e442;
    --tool-bg: #3b1d20; --tool-line: #8f4a50;
    --print-bg: #3fd1a5; --print-text: #0b1620;
    --sel-bg: #e8eaed; --sel-text: #121417; --sel-line: #e8eaed;
  }
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121417; --panel: #1b1e23; --text: #e8eaed; --muted: #9aa3ad; --line: #333941;
  --accent: #56b4e9; --accent-text: #0b1620;
  --ok-bg: #12302a; --bad-bg: #3a2214; --warn-bg: #332d10; --warn-line: #f0e442;
  --canvas: #15181c;
  --ok-text: #3fd1a5; --bad-text: #ff9b5e; --warn-text: #f0e442;
  --tool-bg: #3b1d20; --tool-line: #8f4a50;
  --print-bg: #3fd1a5; --print-text: #0b1620;
  --sel-bg: #e8eaed; --sel-text: #121417; --sel-line: #e8eaed;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 16px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
/* ------------------------------------------------------------ shared page header
   The page opens with the app name centred and the page button under it
   (since Nov 9, 2026 Quick Build is the only page). On a phone the buttons
   get smaller, they never wrap. A page may add a row of its own under the
   buttons (.app-util). */
.app-head {
  display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 10px 8px 8px; padding-top: calc(10px + env(safe-area-inset-top));
  background: var(--panel); border-bottom: 1px solid var(--line);
}
.app-title { margin: 0; font-size: 1.2rem; font-weight: 700; line-height: 1.25; }
/* The spacers centre the buttons; if they ever cannot fit (very large
   text), the row scrolls sideways instead of wrapping. */
.app-nav { display: flex; flex-wrap: nowrap; gap: 4px; width: 100%; overflow-x: auto; scrollbar-width: none; }
.app-nav::-webkit-scrollbar { display: none; }
.app-nav::before, .app-nav::after { content: ""; flex: 1 0 0px; }
.app-nav a {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-height: 44px;
  padding: 8px 16px; border: 1px solid transparent; border-radius: 8px;
  color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.app-nav a:hover { background: var(--bg); }
.app-nav a[aria-current="page"] { background: var(--sel-bg); color: var(--sel-text); border-color: var(--sel-line); }
.app-nav a:focus-visible { outline: 3px solid var(--accent); outline-offset: -3px; }
/* Until the server has said who this is, the role pages wait hidden. */
.app-nav[data-roles="pending"] a[data-role-link]:not([aria-current]) { display: none; }
/* Phones: the words and the space round them shrink with the screen, so
   four buttons stay on one row down to a 320 px phone. */
@media (max-width: 599px) {
  .app-nav { gap: 0; }
  .app-nav a { font-size: clamp(.78rem, calc(2.6vw + 4.2px), 1rem); padding-left: clamp(4px, calc(4vw - 8px), 16px); padding-right: clamp(4px, calc(4vw - 8px), 16px); }
}
.app-util { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 6px 12px; }
.app-util .theme-toggle { margin-left: 0; }
.app-util .who { display: inline; color: var(--muted); font-size: .8rem; }
/* Mode (Auto / Light / Dark) on a desktop: the header's top-right corner,
   clear of the centred name and page buttons. Phones and tablets keep each
   page's own Mode (under the page buttons on Quick Build, in the menu on
   the other pages). theme.js keeps every copy showing the same choice.
   64em is 1024px at the usual text size; with larger browser text the
   corner copy waits for a wider window, so it never sits over the page
   buttons. */
.app-head .app-mode { display: none; }
@media (min-width: 64em) {
  .app-head { position: relative; }
  .app-head .app-mode { display: inline-flex; position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 16px; margin: 0; }
  .app-head .app-mode button { min-height: 44px; }
  .theme-toggle:not(.app-mode) { display: none; }
}
/* An icon button (Refresh, Menu) shows its word next to the icon from
   tablet width up; on a phone the icon alone (the button keeps its label). */
.btn-word { display: none; }
@media (min-width: 601px) { .btn-word { display: inline; font-size: .9rem; } }
main { max-width: 1100px; margin: 0 auto; padding: 16px; display: grid; gap: 16px; }
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.panel h2 { margin: 0 0 12px; font-size: 1.05rem; }
label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 4px; }
input, textarea {
  font: inherit; color: var(--text); background: var(--bg);
  border: 1px solid var(--line); border-radius: 8px; padding: 10px; width: 100%;
}
input:focus, textarea:focus, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 1px; }
button {
  font: inherit; font-weight: 600; border-radius: 8px; padding: 10px 14px; cursor: pointer;
  border: 1px solid var(--line); background: var(--panel); color: var(--text); min-height: 44px;
}
button.primary { background: var(--accent); color: var(--accent-text); border-color: var(--accent); }
button.tool { background: var(--tool-bg); border-color: var(--tool-line); }
button:disabled { opacity: .5; cursor: not-allowed; }
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.muted { color: var(--muted); font-size: .9rem; }

/* order lines */
.lines { display: grid; gap: 10px; margin: 12px 0; }
.line { display: grid; grid-template-columns: 1fr 84px 44px; gap: 8px; align-items: start; }
.line .name { grid-column: 1 / -1; font-size: .85rem; color: var(--muted); margin-top: -4px; }
.line .name.bad { color: var(--bad-text); font-weight: 600; }
.line button.remove { padding: 0; width: 44px; }
details summary { cursor: pointer; font-weight: 600; min-height: 32px; }
details textarea { min-height: 110px; margin: 8px 0; font-family: ui-monospace, monospace; }

/* status banners: icon + words, never colour alone */
.banner { border: 2px solid; border-radius: var(--radius); padding: 12px 14px; }
.banner strong { font-size: 1.05rem; }
.banner.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.banner.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.banner.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.banner ul { margin: 6px 0 0; padding-left: 20px; }

/* results */
table.results { border-collapse: collapse; width: 100%; font-size: .95rem; }
table.results th, table.results td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.results th { color: var(--muted); font-weight: 600; width: 45%; }
.checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.checks li { display: grid; grid-template-columns: 28px 1fr; gap: 6px; }
.checks .mark { font-weight: 800; }
.checks .pass .mark { color: var(--ok-text); }
.checks .fail .mark { color: var(--bad-text); }
.checks .detail { grid-column: 2; font-size: .85rem; color: var(--muted); }
.cards { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.small { font-size: .8rem; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* build view */
#output { display: grid; gap: 16px; }
.build { display: grid; gap: 16px; min-width: 0; }
.tabs { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; }
.tabs button[aria-selected="true"] { background: var(--sel-bg); color: var(--sel-text); border-color: var(--sel-line); }
.tab-body { min-width: 0; }
.pallet-view { display: grid; gap: 16px; }
@media (min-width: 900px) { .pallet-view { grid-template-columns: 3fr 2fr; align-items: start; } }
.row.between { justify-content: space-between; }
.viewer-panel h2 { margin: 0; }
.canvas-wrap { position: relative; margin: 12px -16px 0; }
.canvas-wrap canvas { display: block; width: 100%; height: min(62vh, 520px); touch-action: none; }
.canvas-help { position: absolute; right: 8px; top: 6px; color: var(--muted); background: var(--panel); border-radius: 6px; padding: 2px 6px; opacity: .85; }
.stepper { display: grid; grid-template-columns: 1fr auto 1fr; gap: 10px; align-items: center; margin-top: 12px; }
.stepper .next { justify-self: end; }
.step-count { font-size: 1.05rem; text-align: center; }
.step-range { width: 100%; margin-top: 10px; padding: 0; accent-color: var(--accent); }
.step-panel h2 { margin: 0 0 8px; }
.step-panel h3, .results-panel h3, .panel h3 { font-size: .95rem; margin: 16px 0 8px; }
.instruction { font-size: 1.1rem; display: flex; gap: 10px; align-items: center; margin: 0 0 10px; }
.swatch { display: inline-flex; align-items: center; justify-content: center; min-width: 28px; height: 28px; padding: 0 4px; border-radius: 6px; border: 2px solid #111; color: #111; font-weight: 800; flex: none; }
.swatch.big { min-width: 40px; height: 40px; font-size: 1.2rem; }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.legend li { display: flex; gap: 8px; align-items: center; }
.turn { display: grid; gap: 8px; }
.turn svg { max-width: 100%; height: auto; }
.edge-key { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.edge-key li { display: flex; gap: 10px; align-items: center; }
.actions .row { gap: 12px; }
.banner.review { position: sticky; top: 0; z-index: 5; }

/* status pills: icon + word */
.pill { display: inline-flex; align-items: center; gap: 4px; border: 2px solid; border-radius: 999px; padding: 1px 10px; font-weight: 700; font-size: .85rem; white-space: nowrap; color: var(--text); }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-line); }
.pill.bad { background: var(--bad-bg); border-color: var(--bad-line); }
.pill.warn { background: var(--warn-bg); border-color: var(--warn-line); }
.counts { display: flex; flex-wrap: wrap; gap: 8px 4px; align-items: center; }

/* upload */
.drop { position: relative; display: grid; place-items: center; gap: 4px; padding: 28px 16px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; text-align: center; font-weight: 400; }
.drop.over, .drop:focus-within { border-color: var(--accent); outline: 3px solid var(--accent); }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; }
.drop-main { font-weight: 700; font-size: 1.05rem; color: var(--accent); }
.wh-group h2 { margin-bottom: 0; }
.orders { list-style: none; margin: 8px 0 0; padding: 0; }
.order-item { display: grid; gap: 6px; padding: 12px 0; border-top: 1px solid var(--line); }
.order-head { display: flex; gap: 10px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.order-no { font-weight: 700; font-size: 1.05rem; font-variant-numeric: tabular-nums; }
.flagline { color: var(--warn-text); font-weight: 600; }
.order-item button { justify-self: start; }
#detail #back { margin-bottom: 4px; }

/* Quick Build results, overview first (build-overview.js): the shipment in
   four tiles, then a card per handling unit with its figures, a 3D picture
   of the finished pallet and the way into its steps. Same white cards, grey
   edges and tiles as the dashboards; every colour is a token. Cards stack
   on a phone; a card with room puts the picture beside the figures. */
.qb-overview, .qb-pallet, .qb-pallet-body { display: grid; gap: 16px; min-width: 0; }
.qb-summary h2 { margin-bottom: 10px; }
/* Two by two on a phone, one row of four from 700 px: never three and one. */
.qb-stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (min-width: 700px) { .qb-stats { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.qb-stat { display: grid; gap: 2px; align-content: start; padding: 10px 12px; min-height: 72px; min-width: 0; background: var(--panel); border: 2px solid var(--line); border-radius: var(--radius); }
.qb-stat .n { font-size: clamp(1.25rem, 5.5vw, 1.6rem); font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.qb-stat .t { font-size: .9rem; font-weight: 600; }
.qb-stat .sub { color: var(--muted); font-size: .8rem; }
.qb-double-note { margin: 10px 0 0; }
.qb-summary .print-row { margin-top: 12px; }
.qb-cards { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 330px), 1fr)); }
/* Each card fills its row, its button at the bottom, so the buttons of a
   row line up whatever the length of the product list. */
.qb-card { display: grid; grid-template-rows: auto 1fr; gap: 10px; container-type: inline-size; }
.qb-card-head { display: flex; flex-wrap: wrap; gap: 2px 10px; align-items: baseline; justify-content: space-between; }
.qb-card-head h3 { margin: 0; font-size: 1.1rem; }
.qb-base { color: var(--muted); }
.qb-card-body { display: grid; grid-template-rows: auto 1fr; gap: 12px; min-width: 0; }
.qb-preview { position: relative; aspect-ratio: 4 / 3; min-width: 0; background: var(--canvas); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.qb-preview canvas { display: block; width: 100%; height: 100%; cursor: grab; }
.qb-preview canvas:active { cursor: grabbing; }
.qb-preview-help { position: absolute; left: 8px; top: 6px; color: var(--muted); background: var(--panel); border-radius: 6px; padding: 2px 6px; opacity: .85; pointer-events: none; }
.qb-reset { position: absolute; right: 6px; bottom: 6px; min-width: 44px; min-height: 44px; padding: 0; font-size: 1.3rem; line-height: 1; opacity: .9; }
.qb-nogl { margin: 12px; }
.qb-facts { display: grid; grid-template-rows: auto auto 1fr; gap: 10px; min-width: 0; }
table.results.qb-fig th, table.results.qb-fig td { padding: 5px 8px; }
.qb-legend { font-size: .9rem; }
.qb-open { width: 100%; align-self: end; }
@container (min-width: 620px) { .qb-card-body { grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto; align-items: start; } .qb-facts { grid-template-rows: auto; } }
.qb-tech > summary, .qb-pallet-figures > summary { list-style: none; min-height: 44px; display: flex; align-items: center; gap: 8px; }
.qb-tech > summary::-webkit-details-marker, .qb-pallet-figures > summary::-webkit-details-marker { display: none; }
.qb-tech > summary::before, .qb-pallet-figures > summary::before { content: "▸"; font-size: 1.1rem; width: 1em; flex: none; }
.qb-tech[open] > summary::before, .qb-pallet-figures[open] > summary::before { content: "▾"; }
.qb-tech[open] > summary, .qb-pallet-figures[open] > summary { margin-bottom: 8px; }

/* type-ahead */
.line { position: relative; }
.ta-list { position: absolute; left: 0; right: 0; z-index: 30; margin: 0; padding: 4px 0; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 8px 24px rgba(0,0,0,.18); max-height: min(60vh, 420px); overflow-y: auto; }
.ta-list li { display: grid; gap: 2px; min-height: 48px; padding: 8px 12px; cursor: pointer; align-content: center; border-bottom: 1px solid var(--line); }
.ta-list li:last-child { border-bottom: 0; }
.ta-list li[aria-selected="true"], .ta-list li:hover { background: var(--bg); box-shadow: inset 4px 0 0 var(--accent); }
.ta-code { font-weight: 700; font-family: ui-monospace, monospace; letter-spacing: .08em; }
.ta-name { font-size: .9rem; color: var(--muted); }
.ta-flag { font-size: .85rem; font-weight: 600; color: var(--bad-text); }

/* results summary (shown once, collapsible) */
.results-panel > summary { list-style: none; cursor: pointer; display: grid; gap: 4px; padding-left: 28px; position: relative; min-height: 44px; }
.results-panel > summary::-webkit-details-marker { display: none; }
.results-panel > summary::before { content: "▸"; position: absolute; left: 4px; top: 0; font-size: 1.1rem; }
.results-panel[open] > summary::before { content: "▾"; }
.results-panel[open] > summary { margin-bottom: 12px; }
.sum-title { font-weight: 700; font-size: 1.05rem; }
.sum-line { font-variant-numeric: tabular-nums; }
.check-sum { font-weight: 700; }
.check-sum.pass { color: var(--ok-text); }
.check-sum.fail { color: var(--bad-text); }
.results-panel[open] .when-closed, .results-panel:not([open]) .when-open { display: none; }
#results, #detail { display: grid; gap: 16px; }

/* light / dark toggle: pressed option is filled and ticked, not colour alone */
.theme-toggle { display: inline-flex; align-items: center; gap: 2px; border: 1px solid var(--line); border-radius: 10px; padding: 2px; margin-left: auto; }
.theme-label { font-size: .8rem; color: var(--muted); padding: 0 6px 0 8px; }
.theme-toggle button { border: 0; background: transparent; min-height: 40px; padding: 6px 10px; font-size: .9rem; }
.theme-toggle button[aria-pressed="true"] { background: var(--sel-bg); color: var(--sel-text); box-shadow: inset 0 0 0 1px var(--sel-line); }
.theme-toggle button[aria-pressed="true"]::before { content: "✓ "; }

/* three sides: manager/warehouse lists */
#report, #orders, #list { display: grid; gap: 16px; }
#report:empty, #storage-note:empty { display: none; }
button.quiet { background: transparent; }
#add-panel [role="tabpanel"] { margin-top: 12px; }
.print-row { gap: 12px; }
button.print-action { background: var(--print-bg); color: var(--print-text); border-color: var(--print-bg); }
button.print-action:hover:not(:disabled) { filter: brightness(1.1); }

/* printing: only the prepared plan prints, always black on white */
#print-root { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root {
    display: block; color: #111; font-size: 10.5pt;
    --bg: #fff; --panel: #fff; --text: #111; --muted: #444; --line: #bbb; --canvas: #fff;
    --ok-bg: #fff; --bad-bg: #fff; --warn-bg: #fff;
    --ok-line: #00704f; --bad-line: #a8410a; --warn-line: #6b5a00;
    --ok-text: #00704f; --bad-text: #a8410a; --warn-text: #6b5a00;
  }
  #print-root * { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-root .panel { border: 1px solid #bbb; border-radius: 6px; padding: 8pt; margin: 6pt 0; }
  #print-root .results-panel > summary::before, #print-root .sum-hint { display: none; }
  #print-root .results-panel > summary { padding-left: 0; }
  .print-head h1 { font-size: 15pt; margin: 0 0 4pt; }
  .print-head p { margin: 0 0 4pt; }
  .print-warn { margin: 4pt 0; padding-left: 16pt; }
  .print-pallet { break-before: page; }
  .print-pallet h2 { font-size: 13pt; margin: 0 0 6pt; }
  .print-step { display: grid; grid-template-columns: 52% 1fr; gap: 10pt; padding: 8pt 0; border-top: 1px solid #bbb; break-inside: avoid; }
  .print-step img { width: 100%; border: 1px solid #ccc; }
  .print-step h2 { font-size: 12pt; margin: 0 0 4pt; }
  .print-step h3 { font-size: 10.5pt; margin: 6pt 0 2pt; }
  .print-foot { margin-top: 10pt; font-size: 9pt; color: #444; }
  /* compact so the results fit page 1 and two steps fit a page */
  #print-root table.results th, #print-root table.results td { padding: 2.5pt 4pt; font-size: 9.5pt; }
  #print-root .checks { gap: 1pt; font-size: 9.5pt; }
  #print-root .results-panel h3 { margin: 6pt 0 3pt; }
  #print-root .results-panel p { margin: 3pt 0; }
  #print-root .cards { gap: 6pt; }
  #print-root .instruction { font-size: 11pt; margin: 0 0 4pt; }
  #print-root .turn { display: flex; align-items: center; gap: 10pt; }
  #print-root .turn > svg { max-width: 105pt; height: auto; }
  #print-root .turn > p { display: none; }
  #print-root .edge-key { font-size: 9.5pt; }
  #print-root .legend { gap: 2pt; margin-bottom: 4pt; }
  .print-key { font-size: 9.5pt; margin: 2pt 0 6pt; }
  /* Print all builds of a warehouse: each build starts on a new page. */
  .print-cover + .print-order, .print-order + .print-order { break-before: page; }
  .print-cover h1 { font-size: 16pt; margin: 0 0 4pt; }
  .print-list { border-collapse: collapse; width: 100%; font-size: 10pt; margin-top: 8pt; }
  .print-list th, .print-list td { border: 1px solid #bbb; padding: 3pt 5pt; text-align: left; vertical-align: top; }
  .print-order-head { margin: 0 0 4pt; }
}
a { color: var(--accent); }
a:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

/* round 2: shared storage, release, history, activity, settings */
[hidden] { display: none !important; }
select { font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 10px; min-height: 44px; max-width: 100%; }
select:focus { outline: 3px solid var(--accent); outline-offset: 1px; }
button.danger { background: var(--bad-bg); border-color: var(--bad-line); color: var(--text); }
.who { display: block; }
.main-tabs { margin-bottom: 4px; }
.tab-panel { display: grid; gap: 16px; }
#history-list, #activity-list { display: grid; gap: 16px; }
.state-line { color: var(--ok-text); font-weight: 600; }
.item-actions { gap: 8px; }
.confirm-delete, .confirm-box { border: 2px solid var(--bad-line); background: var(--bad-bg); border-radius: 8px; padding: 10px 12px; }
.confirm-box { border-color: var(--accent); background: var(--bg); }
.confirm-delete p, .confirm-box p { margin: 0 0 8px; }
.filters { display: grid; gap: 10px; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); align-items: end; }
.filters label { margin-bottom: 4px; }
.filters select, .filters input { width: 100%; }
.filters-wide { grid-column: 1 / -1; }
.activity-list { list-style: none; margin: 0; padding: 0; }
.activity-row { display: grid; grid-template-columns: 170px 220px 1fr; gap: 10px; padding: 10px 0; border-top: 1px solid var(--line); align-items: start; }
.activity-row:first-child { border-top: 0; }
.act-who { overflow-wrap: anywhere; }
@media (max-width: 700px) { .activity-row { grid-template-columns: 1fr; gap: 2px; } }
.setting { margin-bottom: 14px; }
.setting select { min-width: 240px; }

/* round 2 review fixes */
.main-tabs { flex-wrap: wrap; overflow: visible; }
.confirm-buttons, .nophoto-buttons { gap: 8px; }
.link-button { display: inline-flex; align-items: center; min-height: 44px; }
.who-why { display: inline-block; vertical-align: middle; }
.who-why > summary { display: inline-flex; align-items: center; gap: 4px; min-height: 32px; font-weight: 400; list-style: none; }
.who-why > summary::-webkit-details-marker { display: none; }
.who-why[open] > span { display: block; max-width: 34ch; margin-top: 4px; }
.done-message:focus { outline: 3px solid var(--accent); outline-offset: 2px; }
/* Short results at the bottom of the screen (see manager.js toast) */
.toast { position: fixed; left: 16px; right: 16px; bottom: 16px; z-index: 50; display: flex; justify-content: center; pointer-events: none; }
.toast > .banner { pointer-events: auto; width: 100%; max-width: 640px; display: flex; gap: 8px; align-items: flex-start; justify-content: space-between; box-shadow: 0 6px 20px rgba(0, 0, 0, .3); }
.toast-close { flex: none; min-width: 44px; min-height: 44px; padding: 0; }
@media print { .toast { display: none; } }

/* Update Build Data */
.build-data-bar { gap: 12px; align-items: center; margin-bottom: 8px; }
.build-data { display: grid; gap: 16px; }
.bd-meta { display: grid; grid-template-columns: max-content 1fr; gap: 2px 12px; margin: 8px 0; }
.bd-meta dt { color: var(--muted); }
.bd-meta dd { margin: 0; }
.bd-table input { width: 100%; min-width: 80px; }
.bd-card textarea, .bd-card input[type=date], .bd-card input[type=file] { width: 100%; }
.bd-changed td, td.bd-changed { background: var(--warn-bg); }
.bd-test table { table-layout: fixed; width: 100%; }
.bd-test th:first-child, .bd-test td:first-child { width: 24%; }

/* Issue reports */
.badge { display: inline-block; min-width: 1.5em; padding: 0 6px; border-radius: 999px; background: var(--bad-line); color: #fff; font-size: .8rem; line-height: 1.5em; text-align: center; }
.issue-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.issue-card textarea, .report-form textarea, .report-form input[type=file] { width: 100%; }
.issue-photos { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.issue-photos img { width: 120px; height: 120px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.photo-list { list-style: none; padding: 0; margin: 8px 0; display: grid; gap: 8px; }
.photo-list li { display: flex; align-items: center; gap: 8px; }
.photo-list img { width: 64px; height: 64px; object-fit: cover; border-radius: 6px; }
.measure { border: 1px solid var(--line); border-radius: 8px; margin: 8px 0; padding: 8px; }
.measure-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.measure-row label { display: grid; gap: 4px; font-weight: 400; }
.measure-row input, .report-form input[type=number] { width: 100%; }
.report-box:empty { display: none; }
.report-box { margin-top: 12px; }
.issue-compare { table-layout: fixed; width: 100%; }
.issue-compare th:first-child { width: 22%; }

/* Order combining */
.combine-bar { position: sticky; top: 0; z-index: 4; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; border: 2px solid var(--accent); }
.pick { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; font-weight: 600; }
.pick input { width: 22px; height: 22px; }
.hint { color: var(--text); }
.combine-table { table-layout: fixed; width: 100%; }
.combine-table th:nth-child(1) { width: 24%; }
.combine-table th:nth-child(2) { width: 13%; }
.combine-table th:nth-child(3) { width: 36%; }
.combine-table td { overflow-wrap: anywhere; }

/* Issue fix status */
.fix-box { border-top: 1px solid var(--line); margin-top: 8px; padding-top: 8px; }
.fix-actions { gap: 8px; margin-top: 6px; }
.fix-form textarea { width: 100%; }
.bd-fix-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 4px; }
.bd-fix-list .pick { font-weight: 400; align-items: flex-start; }

/* Completion photos */
.photo-box:empty { display: none; }
.completion-photo { border: 2px solid var(--line); border-radius: var(--radius); padding: 12px; margin-bottom: 12px; }
.completion-photo h3 { margin: 0 0 4px; font-size: 1.05rem; }
.cp-buttons { gap: 8px; }
.cp-buttons .cp-camera { min-width: 160px; }
.cp-list, .cp-detail { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.cp-list li { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.cp-thumb { width: 56px; height: 56px; object-fit: cover; border-radius: 6px; border: 1px solid var(--line); }
.cp-later:empty { display: none; }
label.check { display: flex; gap: 8px; align-items: center; font-weight: 600; }
label.check input { width: 22px; height: 22px; }

/* Managers list */
.mgr-list { list-style: none; padding: 0; margin: 0 0 8px; display: grid; gap: 6px; }
.mgr-list li { display: flex; gap: 8px; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); padding: 4px 0; }

.build-data-hint { margin: -4px 0 12px; }

/* Times: the device's clock; hover or tap shows Eastern time (time.js). */
button.et-time { background: none; border: 0; padding: 8px 0; margin: -8px 0; border-radius: 0; min-height: 0; font: inherit; color: inherit; text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
.et-pop { display: inline-block; margin-left: 4px; padding: 0 6px; border: 1px solid var(--line); border-radius: 6px; background: var(--panel); color: var(--text); font-size: .85em; white-space: nowrap; }

/* Settings: warehouse addresses (origin of the bookings file). */
.table-scroll { overflow-x: auto; max-width: 100%; position: relative; }
.wa-table { border-collapse: collapse; margin-bottom: 8px; }
.wa-table th { text-align: left; font-size: .8rem; color: var(--muted); padding: 4px 6px 4px 0; white-space: nowrap; }
.wa-table td { padding: 2px 6px 2px 0; }
.wa-table input { width: auto; min-width: 0; margin: 0; }

/* Orders tab: the daily bookings file (docs/ltl-export.md). */
.bookings-bar { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.bookings-bar .bk-facts { flex: 1 1 280px; }

/* Settings > Clear test data (preview site only). */
.danger-zone { border-color: var(--bad-line); }
