/* ProcessWise WMS — styles.
   Brand from the ProcessWise Flutter theme (processWise1648 lib/main.dart):
   seed green #355E24, teal #0F766E, amber; font Inter.
   Revised 28 Nov: green is the brand, not the paper. The app bar carries the
   ProcessWise green; pages sit on neutral surfaces so the state colours read:
   green = done / matches, teal = information and links, amber = waiting for
   someone, red = a difference. Each status also has a glyph and words.
   Themes: System (default), Light, Dark — the switch in the app bar sets
   data-theme on <html> and remembers it per browser (app.js applyTheme).
   Layout: a work area with one primary panel per task, dense tables for the
   desk, large targets at the dock. */

:root {
  --brand: #2F5A1F;
  --brand-ink: #FFFFFF;
  --appbar: #1F3B15;
  --appbar-ink: #EEF5E8;
  --appbar-muted: #B9CCAD;
  --appbar-active: #FFFFFF;
  --appbar-active-ink: #1F3B15;
  --bg: #F5F6F3;
  --surface: #FFFFFF;
  --surface-2: #F0F2EE;
  --head: #ECEFE9;          /* panel and card header / footer band: a step darker than the body */
  --fg: #171C16;
  --muted: #5B6459;
  --outline: #E0E4DD;
  --outline-strong: #C3CABF;
  --accent: #0E6F67;
  --accent-soft: #E3F3F0;
  --accent-ink: #08433E;
  --amber: #A34E06;
  --amber-soft: #FDF1E1;
  --amber-line: #F0C891;
  --danger: #B3261E;
  --danger-soft: #FCEBE9;
  --ok: #2E6B1F;
  --ok-soft: #E9F4E3;
  --focus: #0E6F67;
  --shadow: 0 1px 2px rgba(23, 28, 22, .05), 0 1px 6px rgba(23, 28, 22, .04);
  --font: "Inter", "Noto Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Consolas, monospace;
  --r: 10px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --brand: #8DCB72; --brand-ink: #0D1F07; --appbar: #15201A; --appbar-ink: #E3EBDF; --appbar-muted: #93A38E;
    --appbar-active: #26362B; --appbar-active-ink: #FFFFFF;
    --bg: #0F1211; --surface: #171B19; --surface-2: #1E2320; --head: #121614; --fg: #E5E9E3; --muted: #9AA49A;
    --outline: #2A302C; --outline-strong: #3D453F; --accent: #5CCFC3; --accent-soft: #123A36; --accent-ink: #CDF5EF;
    --amber: #F0B465; --amber-soft: #33240F; --amber-line: #6B4C1C; --danger: #F2A9A3; --danger-soft: #3A1916;
    --ok: #93CF7B; --ok-soft: #1A2B15; --focus: #5CCFC3; --shadow: 0 1px 2px rgba(0, 0, 0, .45); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --brand: #8DCB72; --brand-ink: #0D1F07; --appbar: #15201A; --appbar-ink: #E3EBDF; --appbar-muted: #93A38E;
  --appbar-active: #26362B; --appbar-active-ink: #FFFFFF;
  --bg: #0F1211; --surface: #171B19; --surface-2: #1E2320; --head: #121614; --fg: #E5E9E3; --muted: #9AA49A;
  --outline: #2A302C; --outline-strong: #3D453F; --accent: #5CCFC3; --accent-soft: #123A36; --accent-ink: #CDF5EF;
  --amber: #F0B465; --amber-soft: #33240F; --amber-line: #6B4C1C; --danger: #F2A9A3; --danger-soft: #3A1916;
  --ok: #93CF7B; --ok-soft: #1A2B15; --focus: #5CCFC3; --shadow: 0 1px 2px rgba(0, 0, 0, .45); color-scheme: dark;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--fg); font: 14px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
a { color: var(--accent); text-underline-offset: 2px; }
h1, h2, h3 { margin: 0; text-wrap: balance; line-height: 1.25; }
h1 { font-size: 1.45rem; font-weight: 700; letter-spacing: -.01em; }
h2 { font-size: 1.05rem; font-weight: 650; }
h3 { font-size: .95rem; font-weight: 650; }
p { margin: 0; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
.num, td.num, .tabular { font-variant-numeric: tabular-nums; }
.mono { font-family: var(--mono); font-size: .92em; }
.muted { color: var(--muted); }
.nowrap { white-space: nowrap; }
/* Long identifiers (ProcessWise itemId) shortened in tables; full value on hover. */
.clip { max-width: 16ch; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.small { font-size: .85rem; }
.label { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; }

/* App bar */
.appbar { position: sticky; top: 0; z-index: 20; background: var(--appbar); color: var(--appbar-ink); border-bottom: 1px solid var(--outline); }
.appbar-inner { display: flex; align-items: center; gap: 20px; min-height: 56px; padding-inline: max(16px, env(safe-area-inset-left, 0px)) max(16px, env(safe-area-inset-right, 0px)); flex-wrap: wrap; }
.brand { display: flex; align-items: baseline; gap: 10px; font-weight: 700; color: var(--appbar-ink); text-decoration: none; white-space: nowrap; }
.brand .mark { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 7px; background: var(--appbar-ink); color: var(--appbar); font-size: .8rem; letter-spacing: .02em; align-self: center; }
.brand small { font-weight: 600; color: var(--appbar-muted); font-size: .72rem; letter-spacing: .08em; }
.nav { display: flex; gap: 2px; flex-wrap: wrap; flex: 1; }
.nav a { color: var(--appbar-muted); text-decoration: none; padding: 0 12px; height: 34px; border-radius: 7px; font-weight: 550; }
.nav a:hover { color: var(--appbar-ink); background: color-mix(in srgb, var(--appbar-ink) 10%, transparent); }
.nav a[aria-current="page"] { background: var(--appbar-active); color: var(--appbar-active-ink); font-weight: 650; }
.who { display: flex; align-items: center; gap: 10px; font-size: .85rem; color: var(--appbar-muted); }
.who b { font-weight: 600; color: var(--appbar-ink); }
/* Buttons on the dark app bar */
.appbar .btn { background: transparent; color: var(--appbar-ink); border-color: color-mix(in srgb, var(--appbar-ink) 28%, transparent); }
.appbar .btn:hover { background: color-mix(in srgb, var(--appbar-ink) 10%, transparent); }
.appbar .searchbtn { color: var(--appbar-muted); min-width: 200px; justify-content: flex-start; }
.appbar .searchbtn kbd { margin-left: auto; background: transparent; color: var(--appbar-muted); border-color: color-mix(in srgb, var(--appbar-ink) 28%, transparent); }
.themebtn { width: 36px; padding: 0 !important; font-size: 1rem; }
/* Phone: two rows — brand, search, account; then the nav, scrolling sideways. */
@media (max-width: 760px) {
  .appbar-inner { gap: 8px; padding-block: 8px; min-height: 0; }
  .brand { order: 1; margin-right: auto; }
  .brand small { display: none; }
  .appbar .searchbtn { order: 2; min-width: 0; width: 36px; padding: 0; }
  .appbar .searchbtn .lbl, .appbar .searchbtn kbd { display: none; }
  .who { order: 3; gap: 6px; }
  .who > span { display: none; }
  .nav { order: 4; flex: 1 0 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: -4px; }
  .nav a { flex: none; }
}

/* Page */
.page { max-width: 1320px; margin: 0 auto; padding-block: 24px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head > div { display: grid; gap: 4px; min-width: 0; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Panels and cards share one anatomy: a header on a slightly darker band, a
   body, and a footer where one applies (actions, status, links). */
.panel { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; overflow: hidden; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 16px; background: var(--head); border-bottom: 1px solid var(--outline); flex-wrap: wrap; }
.panel-body { padding: 16px; display: grid; gap: 14px; min-width: 0; }
.panel-foot, .card-foot { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--outline); background: var(--head); }
.card-foot { justify-content: flex-start; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 2.6fr) minmax(0, 1fr); gap: 20px; align-items: start; }
@media (max-width: 900px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }

/* Facts: label/value pairs */
.facts { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px 20px; }
.facts > div { display: grid; gap: 2px; min-width: 0; }
.facts dd, .facts .v { margin: 0; font-weight: 550; overflow-wrap: anywhere; }

/* Summary strip: plain figures, no ornaments */
.strip { display: flex; flex-wrap: wrap; gap: 0; border: 1px solid var(--outline); border-radius: var(--r); background: var(--surface); }
.strip > div { padding: 12px 18px; display: grid; gap: 2px; border-right: 1px solid var(--outline); min-width: 120px; flex: 1; }
.strip > div:last-child { border-right: 0; }
.strip .fig { font-size: 1.35rem; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Buttons and inputs */
/* Two control heights only: 36px at the desk, 48px (.big) at the dock and for
   the main search. Every button and input of one size is exactly that tall. */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; min-height: 36px; padding: 0 16px; border-radius: 7px; border: 1px solid var(--outline-strong);
  background: var(--surface); color: var(--fg); font: inherit; font-size: .9rem; font-weight: 600; line-height: 1; cursor: pointer; text-decoration: none; white-space: nowrap; box-sizing: border-box; }
.btn:hover { background: var(--surface-2); border-color: var(--muted); }
.btn.primary { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { background: color-mix(in srgb, var(--brand) 88%, var(--fg)); border-color: color-mix(in srgb, var(--brand) 88%, var(--fg)); }
.btn.accent { background: var(--accent); border-color: var(--accent); color: var(--surface); }
.btn.danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 45%, var(--outline)); }
.btn.big { height: 48px; min-height: 48px; font-size: 1rem; padding: 0 20px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; filter: none; }
.btn.link { border: 0; background: none; color: var(--accent); padding: 0 4px; height: auto; min-height: 0; }
/* A column of row actions (Today, lists): one width so the buttons line up. */
.act-btn { min-width: 112px; }
input, select, textarea { font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--outline-strong); border-radius: 7px; padding: 0 10px; height: 36px; min-height: 36px; min-width: 0; box-sizing: border-box; }
textarea { height: auto; padding: 8px 10px; }
input[type="checkbox"], input[type="radio"] { height: auto; min-height: 0; }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: transparent; }
.field { display: grid; gap: 4px; min-width: 0; }
.field > span { font-size: .8rem; font-weight: 600; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: end; flex-wrap: wrap; }
.row > .field { flex: 1 1 160px; }
.search { display: flex; gap: 10px; }
.search input { flex: 1; height: 48px; font-size: 1rem; padding-inline: 14px; }
.search select { height: 48px; }
.search .btn { height: 48px; min-height: 48px; padding: 0 20px; font-size: 1rem; }

/* Tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th { text-align: left; font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; padding: 9px 12px; border-bottom: 1px solid var(--outline); white-space: nowrap; background: var(--head); }
td { padding: 10px 12px; border-bottom: 1px solid var(--outline); vertical-align: top; }
tr:last-child > td { border-bottom: 0; }
td.num, th.num { text-align: right; white-space: nowrap; }
tr.clickable { cursor: pointer; }
tr.clickable:hover > td { background: var(--surface-2); }
tr.sub > td { background: var(--surface-2); padding: 0; }
.expander { border: 0; background: none; color: var(--muted); cursor: pointer; width: 28px; height: 28px; border-radius: 6px; font-size: .9rem; }
.expander:hover { background: var(--outline); color: var(--fg); }
.qty { font-weight: 650; }
.unit { color: var(--muted); font-size: .85em; margin-left: 4px; }

/* Pills carry state by glyph and colour */
.pill { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 999px; font-size: .78rem; font-weight: 600; border: 1px solid transparent; white-space: nowrap; line-height: 1.5; }
.pill .g { font-weight: 800; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.pill.warn { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-line); }
.pill.bad { background: var(--danger-soft); color: var(--danger); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.pill.info { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.pill.plain { background: var(--surface-2); color: var(--muted); border-color: var(--outline); border-style: dashed; }
.ref { display: inline-flex; gap: 6px; align-items: baseline; padding: 2px 8px; border: 1px solid var(--outline); border-radius: 6px; background: var(--surface-2); font-size: .82rem; max-width: 100%; }
.ref .t { font-size: .68rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; }
.ref .i { color: var(--muted); }
.ref.hit { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); }
.refs { display: flex; flex-wrap: wrap; gap: 6px; }

/* Site block inside an expanded article */
.sites { display: grid; gap: 0; }
.site { padding: 12px 16px 14px 44px; display: grid; gap: 8px; border-top: 1px solid var(--outline); }
.site:first-child { border-top: 0; }
.site-head { display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.site-head b { font-size: .95rem; }

/* Receiving line (dock: large targets) */
.line { border: 1px solid var(--outline); border-radius: var(--r); background: var(--surface); box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; padding: 0 16px 16px; overflow: hidden; }
.line-head { grid-column: 1 / -1; margin-inline: -16px; padding: 10px 16px; background: var(--head); border-bottom: 1px solid var(--outline); display: grid; gap: 4px; }
.line.state-no_match { border-left: 4px solid var(--danger); }
.line.state-match { border-left: 4px solid var(--ok); }
.line.state-not_counted { border-left: 4px dashed var(--outline-strong); }
.line .expect { font-size: 1.6rem; font-weight: 750; font-variant-numeric: tabular-nums; line-height: 1.1; }
.line-actions { display: grid; gap: 8px; align-content: start; min-width: 220px; }
.count-form { grid-column: 1 / -1; display: grid; gap: 12px; padding: 14px; background: var(--surface-2); border-radius: var(--r); border: 1px solid var(--outline); }
.count-form .qty-input { font-size: 1.4rem; font-weight: 700; width: 9ch; min-height: 48px; text-align: right; }
.verdicts { display: flex; gap: 8px; flex-wrap: wrap; }
.verdicts .btn { min-height: 48px; flex: 1 1 140px; font-size: 1rem; }
.verdicts .btn[aria-pressed="true"].v-match { background: var(--ok); color: var(--surface); border-color: var(--ok); }
.verdicts .btn[aria-pressed="true"].v-no { background: var(--danger); color: var(--surface); border-color: var(--danger); }
@media (max-width: 640px) { .line { grid-template-columns: minmax(0, 1fr); } .line-actions { min-width: 0; } }

/* History list */
.timeline { list-style: none; margin: 0; padding: 0; display: grid; gap: 0; }
.timeline li { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-top: 1px solid var(--outline); }
.timeline li:first-child { border-top: 0; }
@media (max-width: 560px) { .timeline li { grid-template-columns: minmax(0, 1fr); gap: 2px; } }

.notice { padding: 12px 14px; border-radius: var(--r); border: 1px solid var(--outline); background: var(--surface-2); display: grid; gap: 4px; }
.notice.warn { background: var(--amber-soft); border-color: color-mix(in srgb, var(--amber) 35%, transparent); }
.notice.bad { background: var(--danger-soft); border-color: color-mix(in srgb, var(--danger) 35%, transparent); }
.notice.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); }
.empty { padding: 28px 16px; text-align: center; color: var(--muted); }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--outline); flex-wrap: wrap; }
.tabs button { border: 0; background: none; font: inherit; font-weight: 600; color: var(--muted); padding: 10px 14px; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button[aria-selected="true"] { color: var(--fg); border-bottom-color: var(--brand); }

#toast { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 8px; z-index: 50; max-width: min(440px, calc(100vw - 32px)); }
#toast > div { background: var(--fg); color: var(--bg); padding: 10px 14px; border-radius: 8px; box-shadow: var(--shadow); font-weight: 550; }
#toast > div.bad { background: var(--danger); color: #fff; }

/* Sign-in */
.signin { max-width: 760px; margin: 0 auto; padding-block: 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; gap: 20px; }
#signin { display: grid; gap: 14px; }
.identities { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.identities button { text-align: left; display: grid; gap: 2px; padding: 12px 14px; border: 1px solid var(--outline); border-radius: var(--r); background: var(--surface); cursor: pointer; font: inherit; color: var(--fg); }
.identities button:hover { border-color: var(--brand); }
.identities button b { font-weight: 650; }

/* App bar additions: Today badge, search */
.nav a { display: inline-flex; align-items: center; gap: 6px; }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--amber); color: var(--surface); font-size: .72rem; font-weight: 800; }
.searchbtn { gap: 8px; color: var(--muted); }
.searchbtn kbd { font: 600 .7rem var(--mono); border: 1px solid var(--outline); border-bottom-width: 2px; border-radius: 4px; padding: 0 5px; color: var(--muted); background: var(--surface-2); }
@media (max-width: 700px) { .searchbtn kbd { display: none; } }

/* Search everything */
.palette-back { position: fixed; inset: 0; z-index: 60; background: color-mix(in srgb, var(--fg) 30%, transparent); display: grid; justify-items: center; align-items: start;
  padding: calc(10vh + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px)); }
.palette { width: min(680px, 100%); background: var(--surface); border: 1px solid var(--outline); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .25); padding: 14px; display: grid; gap: 8px; }
.palette input { min-height: 48px; font-size: 1.05rem; }
.palette ul { list-style: none; margin: 0; padding: 0; max-height: 55vh; overflow-y: auto; display: grid; gap: 2px; }
.palette li { display: flex; gap: 10px; align-items: flex-start; padding: 9px 10px; border-radius: 8px; cursor: pointer; }
.palette li[aria-selected="true"], .palette li:hover { background: var(--accent-soft); }
.palette .pr-main { display: grid; gap: 1px; min-width: 0; }
.palette .pill { margin-top: 2px; }

/* Pack silhouettes: derived from the package code, never authored */
.packicon { display: inline-flex; color: var(--accent); flex: none; }
.packicon svg { display: block; }
.withicon { display: flex; gap: 10px; align-items: center; min-width: 0; }
.withicon > div { min-width: 0; }
.page-head > .withicon { display: flex; gap: 14px; align-items: center; }

/* Home */
.today { list-style: none; margin: 0; padding: 0; display: grid; }
.today li { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--outline); }
.today li:first-child { border-top: 0; }
.today li:hover { background: color-mix(in srgb, var(--surface-2) 60%, transparent); }
.today li > .btn { min-width: 112px; }
.today .glyph { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; font-weight: 800; background: var(--surface-2); color: var(--muted); }
.today li.act .glyph { background: var(--amber-soft); color: var(--amber); }
.today li.info .glyph { background: var(--accent-soft); color: var(--accent-ink); }
.today .t { display: grid; gap: 2px; min-width: 0; }
.today .t b { font-weight: 650; }
@media (max-width: 560px) { .today li { grid-template-columns: 30px minmax(0, 1fr); } .today li > a.btn { grid-column: 2; justify-self: start; } }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
/* Card: header band, body (every child between head and foot), footer. */
.card { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--r); box-shadow: var(--shadow); padding: 0 0 14px; display: flex; flex-direction: column; gap: 12px; color: inherit; text-decoration: none; min-width: 0; overflow: hidden; }
.card > * { margin-inline: 16px; }
.card > .card-head { margin: 0; padding: 10px 16px; min-height: 48px; background: var(--head); border-bottom: 1px solid var(--outline); }
.card > .card-foot { margin: auto 0 -14px; }
a.card { transition: border-color .12s, box-shadow .12s; }
a.card:hover { border-color: var(--outline-strong); box-shadow: 0 2px 10px rgba(0, 0, 0, .08); }
a.card:hover .card-head h3 { color: var(--accent); }
.card-head { display: flex; justify-content: space-between; gap: 10px; align-items: center; flex-wrap: wrap; }
.card-head h3 { overflow-wrap: anywhere; font-size: 1rem; }
.figs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 14px; }
.figs > div { display: grid; gap: 1px; min-width: 0; }
.figs .v { font-weight: 650; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.hero { display: grid; gap: 6px; }
.hero h1 { font-size: 1.7rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }

/* A receipt as its owner follows it: arrived -> counting -> received */
.steps { list-style: none; margin: 0; padding: 0; display: flex; gap: 0; flex-wrap: wrap; }
.steps li { display: flex; align-items: center; gap: 8px; padding: 4px 14px 4px 0; color: var(--muted); font-weight: 600; font-size: .85rem; }
.steps li::before { content: ""; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--outline-strong); background: var(--surface); }
.steps li.done { color: var(--fg); }
.steps li.done::before { background: var(--ok); border-color: var(--ok); }
.steps li.now { color: var(--fg); }
.steps li.now::before { border-color: var(--accent); background: var(--accent-soft); }
.steps li.attention { color: var(--fg); }
.steps li.attention::before { border-color: var(--amber); background: var(--amber-soft); }
.question { border-left: 4px solid var(--amber); padding: 8px 12px; background: var(--amber-soft); border-radius: 0 var(--r) var(--r) 0; margin: 0 0 12px; }
.qty-input { width: 96px; text-align: right; }
/* Requests board: one column per who holds the ball. */
.board { display: grid; grid-template-columns: repeat(6, minmax(190px, 1fr)); gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.board-col { background: var(--surface-2); border: 1px solid var(--outline); border-radius: var(--r); min-width: 0; display: grid; grid-template-rows: auto 1fr; }
.board-col > header { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 12px; background: var(--head); border-bottom: 1px solid var(--outline); border-radius: var(--r) var(--r) 0 0; font-weight: 700; font-size: .85rem; }
.board-col > header small { color: var(--muted); font-weight: 600; }
.board-col ol { list-style: none; margin: 0; padding: 8px; display: grid; gap: 8px; align-content: start; }
.board-card { display: grid; gap: 4px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--outline); border-radius: 7px; color: inherit; text-decoration: none; }
.board-card:hover { border-color: var(--muted); }
.board-card .who { font-weight: 700; }
.board-card.attention { border-left: 4px solid var(--amber); }
@media (max-width: 760px) { .board { grid-template-columns: minmax(0, 1fr); } }
.cmp { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.cmp > div { border: 1px solid var(--outline); border-radius: 8px; padding: 10px 12px; display: grid; gap: 4px; background: var(--surface-2); min-width: 0; }
@media (max-width: 560px) { .cmp { grid-template-columns: minmax(0, 1fr); } }

.count-form details > summary.btn { min-height: 48px; width: 100%; font-size: 1rem; list-style: none; }
.count-form details > summary::-webkit-details-marker { display: none; }
.count-form details[open] > summary.btn { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
details > summary { cursor: pointer; }

/* Portions editor at the dock */
.portions { display: grid; gap: 8px; }
.portion { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 8px; align-items: end; }
.portion .rm { min-height: 48px; }
.portions > .portion:only-child .rm { visibility: hidden; }
.portion .newname { grid-column: 1 / -1; }
@media (max-width: 560px) { .portion { grid-template-columns: minmax(0, 1fr) auto; } .portion .rm { grid-column: 1 / -1; justify-self: start; } }
.tally { font-weight: 650; font-variant-numeric: tabular-nums; }
.tally.ok { color: var(--ok); }
.tally.bad { color: var(--danger); }
.tally.warn { color: var(--amber); }

/* ── Release: order wizard, tracker, hand-over, release note ────────────── */
.stepper { list-style: none; margin: 0; padding: 0; display: flex; gap: 6px; flex-wrap: wrap; }
.stepper li { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px 0 8px; border-radius: 999px; border: 1px solid var(--outline); background: var(--surface); color: var(--muted); font-weight: 600; font-size: .88rem; }
.stepper li .n { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--surface-2); font-size: .75rem; font-weight: 800; }
.stepper li.done { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 35%, var(--outline)); }
.stepper li.done .n { background: var(--ok); color: var(--surface); }
.stepper li.now { color: var(--fg); border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.stepper li.now .n { background: var(--brand); color: var(--brand-ink); }
.wizard { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
@media (max-width: 960px) { .wizard { grid-template-columns: minmax(0, 1fr); } }
.wizard aside { position: sticky; top: 72px; }
.choices { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 12px; }
.choice { text-align: left; display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r); border: 2px solid var(--outline); background: var(--surface); color: var(--fg); font: inherit; cursor: pointer; }
.choice:hover { border-color: var(--outline-strong); }
.choice[aria-pressed="true"] { border-color: var(--brand); background: color-mix(in srgb, var(--brand) 7%, var(--surface)); }
.choice b { font-size: 1rem; }
.qtyrow { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--outline); }
.qtyrow:first-child { border-top: 0; }
.qtyrow.err { background: color-mix(in srgb, var(--danger-soft) 60%, transparent); }
.stepq { display: inline-flex; align-items: center; gap: 6px; }
.stepq input { width: 9ch; text-align: right; font-weight: 700; }
.stepq .btn { width: 36px; padding: 0; }
@media (max-width: 640px) { .qtyrow { grid-template-columns: minmax(0, 1fr); } }
.sumlist { display: grid; gap: 6px; }
.sumlist > div { display: flex; justify-content: space-between; gap: 10px; }
.sumlist > div > span:first-child { color: var(--muted); }
.wizard-nav { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.wizard-nav .hint { flex: 1; color: var(--muted); font-size: .88rem; }
tr.blocked > td { color: var(--muted); }
tr.selected > td { background: color-mix(in srgb, var(--brand) 6%, transparent); }

.release-note { background: var(--surface); color: var(--fg); border: 1px solid var(--outline); border-radius: var(--r); padding: 22px; display: grid; gap: 16px; font-size: .9rem; }
.rn-head { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-bottom: 12px; border-bottom: 3px solid var(--brand); }
.rn-title { font-size: 1.15rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--brand); }
.rn-no { font: 700 1rem var(--mono); }
.rn-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 10px; }
.rn-box { background: var(--head); border: 1px solid var(--outline); border-radius: 8px; padding: 10px 12px; display: grid; gap: 2px; min-width: 0; overflow-wrap: anywhere; }
.rn-sigs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.rn-sigs > div { border-top: 1px solid var(--muted); padding-top: 6px; font-size: .8rem; color: var(--muted); }
@media (max-width: 560px) { .rn-sigs { grid-template-columns: minmax(0, 1fr); } }
@media print {
  /* Paper is white whatever the screen theme: these selectors match the dark
     ones' specificity and come later, so they win. */
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    --bg: #fff; --surface: #fff; --surface-2: #f3f3f3; --head: #f3f3f3; --fg: #000; --muted: #444;
    --outline: #bbb; --outline-strong: #888; --brand: #2F5A1F; --accent: #0E6F67; color-scheme: light;
  }
  body { background: #fff; color: #000; }
  .appbar, .no-print, #toast { display: none !important; }
  .page { padding: 0; max-width: none; }
  .page > :not(.print-area) { display: none !important; }
  .release-note { border: 0; padding: 0; }
  .release-note + .release-note { break-before: page; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* Small figures in a row (integration health). */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 12px; }
.kpi { display: grid; gap: 2px; padding: 10px 12px; border: 1px solid var(--outline); border-radius: 7px; background: var(--surface); }
.kpi b { font-size: 1.4rem; font-variant-numeric: tabular-nums; }

/* The floor: zones of bins drawn from data, filled by what is placed. */
.zone { display: grid; gap: 8px; }
.bins { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; }
.bin { display: grid; gap: 4px; align-content: start; min-height: 88px; padding: 8px 10px; border: 1px solid var(--outline); border-radius: 7px; background: var(--surface); color: inherit; text-align: left; cursor: pointer; font: inherit; }
.bin:hover, .bin[aria-pressed="true"] { border-color: var(--brand); box-shadow: inset 0 0 0 1px var(--brand); }
.bin .code { font-weight: 700; font-variant-numeric: tabular-nums; }
.bin.empty { background: var(--surface-2); color: var(--muted); }
.bin .fill { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; }
.bin .fill > span { display: block; height: 100%; background: var(--ok); }
.bin .fill.high > span { background: var(--amber); }
.bin .fill.full > span { background: var(--danger); }
.bin .owners { font-size: .75rem; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.scanbox { display: grid; gap: 6px; }
.scanbox input { height: 56px; font-size: 1.25rem; font-weight: 600; letter-spacing: .02em; }
.pending { position: sticky; top: 0; z-index: 5; }
