/* GG Card Engine design system.
   Hand-written, dependency-free, no build step — on purpose (see README):
   the whole look lives in this one file plus proxy_base.html's inline copy
   for customer pages. The staff console wears the Shopify Polaris look
   (ADR-0088): admin values, transcribed as tokens, no Polaris package.

   Staff surfaces are DESKTOP-density by default (owner correction
   2026-08-26). Only the pull-sheet family is phone-run at the shelves, and
   it keeps the big-target shelf scale through `main.shelf`. High contrast
   and printable pull sheets hold for both.

   Conventions:
   - Tokens up top; components reference tokens, never raw hex.
   - Colour tokens live in the two theme blocks; density tokens (--text-*,
     --pad-*) live once in :root and are swapped by `main.shelf`.
   - Semantic classes (ok/warn/badge states, ok-quote/over-quote tints) are
     asserted on by tests — restyle them freely, never rename them. */

/* Inter is the Polaris typeface, vendored (static/vendor/README.md) because
   this stylesheet has no CDN and no build step by design. One variable file
   covers the whole 100–900 range; `swap` paints in the system face first. */
@font-face {
  font-family: "InterVariable";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("vendor/InterVariable.2bf3d951bf9d.woff2") format("woff2");
}

:root {
  /* Staff component contract. These aliases are the one token source for new
     console components: pages may choose semantic components but do not pick
     arbitrary spacing, type, border, or focus values of their own. */
  --staff-space-1: .25rem;
  --staff-space-2: .5rem;
  --staff-space-3: .75rem;
  --staff-space-4: 1rem;
  --staff-space-5: 1.5rem;
  --staff-control-height: 2.5rem;
  --staff-focus-ring: 0 0 0 3px var(--accent-soft), 0 0 0 5px var(--accent);
  /* Palette — the Shopify Polaris look at GG Card Engine scale (ADR-0088): the
     admin's near-black ink, neutral greys, and interactive blue, transcribed
     as token VALUES only. No Polaris package and no build step; the dark
     block below swaps those values without forking the component stylesheet. */
  --ink: #303030;          /* near-black — text + topbar */
  --ink-soft: #4a4a4a;     /* secondary text — 8.86:1 on --surface */
  --muted: #616161;        /* 5.48:1 on --paper, 6.19:1 on --surface — WCAG-AA */
  --paper: #f1f1f1;        /* app background (neutral grey) */
  --surface: #ffffff;      /* cards, tables */
  --surface-alt: #f7f7f7;  /* raised-neutral fill: table head/foot, cond cells */
  --line: #e3e3e3;         /* hairline borders */
  --row-hover: #f7f7f7;    /* table row :hover fill */
  --row-inactive: #fafafa; /* inactive/disabled table row fill */
  --accent: #005bd3;       /* interactive blue — links, focus rings, info */
  --accent-soft: #eaf4ff;
  --hero-stop: #4a4a4a;    /* lighter stop of the .btn-hero hover gradient */
  --accent-hover: #004299; /* 9.38:1 on --surface, 8.30:1 on --paper */
  --brand-stop: #616161;   /* neutral chip behind the topbar brand mark */
  --on-accent: #ffffff;
  --panel-text: #ffffff;
  --on-alert: #ffffff;

  /* The link/button split (ADR-0088). Polaris shows one near-black primary
     action per page and quiet white secondaries, while links and focus rings
     take the interactive blue — so buttons and links stop sharing --accent.
     --btn-line is the secondary button's border; --btn-line-strong is the
     bottom-edge bevel that gives it its lip. */
  --btn-primary: #303030;
  --btn-primary-hover: #1a1a1a;
  --btn-line: #cfcfcf;
  --btn-line-strong: #999999;

  /* App chrome and interactive-control borders. The topbar is the admin's
     near-black bar; the dark block below swaps only tokens. */
  --chrome-start: #303030;
  --chrome-end: #1a1a1a;
  --chrome-text: #ffffff;
  --chrome-muted: #b5b5b5;  /* 8.49:1 on --chrome-end, 6.44:1 on --chrome-start */
  --chrome-hover: rgba(255, 255, 255, .08);
  --chrome-active: rgba(255, 255, 255, .14);
  --chrome-line: rgba(255, 255, 255, .12);
  --control-line: #8a8a8a;
  --control-line-hover: #616161;

  /* Status roles — a solid ink plus a light tint used for pill fills and the
     flash/panel washes. One vocabulary (info/ok/warn/amber/muted) site-wide. */
  --ok: #056e54;    --ok-soft: #cdfed4;      /* 5.56:1 on its tint, white on it 6.24:1 */
  --warn: #c70a24;  --warn-soft: #fee8eb;    /* 5.13:1 on its tint, white on it 6.00:1 */
  --info: var(--accent); --info-soft: var(--accent-soft);
  --amber: #4f4700; --amber-soft: #fff8db;   /* caution / flat / "look here" — 8.82:1 */
  --muted-soft: #ebebeb;                     /* neutral pill fill */
  --ok-hover: #045c46;
  --ok-border: #92fcac;
  --info-border: #a8d8ff;
  --warn-border: #fec1c7;
  --amber-border: #ffeb78;
  --error-text: #8e0b21;
  --warning-text: #4f4700;
  --success-text: #014b40;
  --ambiguous-text: #4f4700;
  --danger-strong: #8e0b21;

  /* Buylist grade-table row washes. Each row has a rest tint and a slightly
     deeper :hover tint; ok-quote = at/under today's price (green), over-quote
     = above it (red), picked = done (grey). Hoisted from hardcoded hex so a
     dark theme inverts them; the -rest values also back the .swatch legend. */
  --ok-wash-rest: #eefcf1;   --ok-wash: #ddf9e4;     /* ok-quote: rest / hover */
  --warn-wash-rest: #fef4f5; --warn-wash: #fee8eb;   /* over-quote: rest / hover */
  --picked-wash: #f3f3f3;                            /* picked row */

  --gold: #ffe600;                           /* unsaved-edits attention ring */

  /* Condition grades (NM→DM): colour == meaning on the shop floor. Solid ink
     for the grade code, matching tint for the cell wash, mid tint for the rim.
     LP/MP/HP inks darkened so the grade code clears 4.5:1 on its own wash. */
  --cond-nm: #1e7c44; --cond-nm-soft: #e7f6ec; --cond-nm-line: #c7e6d2;  /* green  — Near Mint */
  --cond-lp: #4a6e17; --cond-lp-soft: #eef6da; --cond-lp-line: #d8e6b8;  /* lime   — Lightly Played */
  --cond-mp: #7d550e; --cond-mp-soft: #fbf1d8; --cond-mp-line: #ecdcae;  /* amber  — Moderately Played */
  --cond-hp: #9c3e0a; --cond-hp-soft: #fdeadd; --cond-hp-line: #f2cdb0;  /* orange — Heavily Played */
  --cond-dm: #b03030; --cond-dm-soft: #fdecec; --cond-dm-line: #eec2c2;  /* red    — Damaged */

  /* Price movement: up is good (sells higher), down is a drop to eyeball. */
  --move-up: var(--ok);
  --move-down: var(--warn);
  --move-flat: var(--amber);

  /* Colored section-header panels: header colour encodes the section's role —
     info/product = blue, action-needed = amber, confirm/location = green.
     White 600 text rides the solid bar (see the .panel section below). */
  --panel-info: var(--accent);
  --panel-action: #8a6212;   /* darkened amber — white header text 5.47:1 */
  --panel-confirm: #047b5d;  /* white header text 5.25:1 */

  /* shape — Polaris radii and the two shadow steps it uses for resting and
     raised surfaces (shadow-100 / shadow-300), in neutral 26,26,26 alphas. */
  --radius: 12px;
  --radius-sm: 8px;
  --shadow: 0 1px 0 rgba(26, 26, 26, .07);
  --shadow-raised: 0 4px 6px -2px rgba(26, 26, 26, .20);
  --workspace-max: 112rem;
  /* Desktop workspaces keep about 10% breathing room on each side. Below
     64rem the inset collapses to the normal 1rem phone/tablet gutter, so the
     document never becomes wider than the viewport. */
  --workspace-inset: clamp(2rem, calc(100% - 64rem), 20%);
  --workspace-width: min(calc(100% - var(--workspace-inset)), var(--workspace-max));

  /* Density — scale, not colour, so these live once here and are NOT swapped
     per theme. Desktop is the default staff surface (owner correction
     2026-08-26, ADR-0088), so the console runs at Polaris admin density; the
     phone-run pull-sheet family swaps these same tokens back to the shelf
     scale through `main.shelf` below. Values are rem (root-relative), which
     is why swapping a token re-sizes a subtree without compounding. */
  --text-body: .8125rem;   /* 13px — Polaris admin body */
  --text-sm: .75rem;       /* muted text, badges, fine print */
  --text-h1: 1.25rem;
  --text-h2: .9375rem;
  --text-h3: .8125rem;
  --pad-cell: .35rem .5rem;      /* table th/td */
  --pad-card: 1rem;              /* card and panel bodies */
  --pad-control: .4rem .75rem;   /* buttons */
  --pad-field: .35rem .55rem;    /* text inputs, selects, textareas */

  /* Less-common component tokens, remapped with the rest of the palette so
     legacy pages pick up the Polaris look and stay dark-aware. */
  --empty-line: #cccccc;
  --neutral-fill: #ebebeb;
  --placeholder: #b5b5b5;
  --detail-border: #e3e3e3;
  --maintenance-border: #e3e3e3;
  --subnav-active: #eaf4ff;
  --subnav-active-line: #a8d8ff;
  --request-risk-line: #ffeb78;
  --request-severity-text: #4f4700;
  --ok-wash-line: #b7f0c4;
  --warn-wash-line: #fbd2d7;
  --chip-line: #d9d9d9;
  --attachment-fill: #ffffff;
  --maintenance-fill: #fafafa;
  --subnav-line: #d9d9d9;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  /* Polaris's dark scheme: the same neutral greys, inverted. The accent,
     status, wash, condition, and panel values below stay as they were — they
     are already WCAG-tuned — and only the navy-tinted neutrals move to grey
     at comparable lightness. */
  --ink: #e3e3e3;
  --ink-soft: #cccccc;     /* 9.42:1 on --surface */
  --muted: #b5b5b5;        /* 8.49:1 on --paper, 7.38:1 on --surface */
  --paper: #1a1a1a;
  --surface: #262626;
  --surface-alt: #303030;
  --line: #4a4a4a;
  --row-hover: #303030;
  --row-inactive: #212121;
  --accent: #91b9ff;
  --accent-soft: #233b62;
  --hero-stop: #3a3a3a;
  --accent-hover: #7daaff;
  --brand-stop: #4a4a4a;
  --on-accent: #1a1a1a;
  --on-alert: #1a1a1a;

  /* The dark primary button inverts to light-on-dark, as the admin's dark
     scheme does; its text is --on-accent. */
  --btn-primary: #e3e3e3;
  --btn-primary-hover: #ffffff;
  --btn-line: #4a4a4a;
  --btn-line-strong: #616161;

  --chrome-start: #212121;
  --chrome-end: #121212;
  --chrome-muted: #b5b5b5;  /* 9.14:1 on --chrome-end, 7.85:1 on --chrome-start */
  --chrome-hover: rgba(255, 255, 255, .10);
  --chrome-active: rgba(255, 255, 255, .18);
  --chrome-line: rgba(255, 255, 255, .16);
  --control-line: #616161;
  --control-line-hover: #8a8a8a;

  --ok: #78d69e;
  --ok-soft: #173527;
  --warn: #ff9a9a;
  --warn-soft: #42242a;
  --amber: #f0c56b;
  --amber-soft: #3c311e;
  --muted-soft: #303030;
  --ok-hover: #91e3af;
  --ok-border: #315f45;
  --info-border: #45648f;
  --warn-border: #71404a;
  --amber-border: #66532d;
  --error-text: #ffc1c1;
  --warning-text: #f6d992;
  --success-text: #a7e8bf;
  --ambiguous-text: #f4d07e;
  --danger-strong: #ff8a9f;

  --ok-wash-rest: #142d21;
  --ok-wash: #193827;
  --warn-wash-rest: #352027;
  --warn-wash: #42262d;
  --picked-wash: #2a2a2a;

  --cond-nm: #78d69e; --cond-nm-soft: #173527; --cond-nm-line: #315f45;
  --cond-lp: #b8dc77; --cond-lp-soft: #29361a; --cond-lp-line: #4c6630;
  --cond-mp: #f0c56b; --cond-mp-soft: #3c311e; --cond-mp-line: #66532d;
  --cond-hp: #f3a56f; --cond-hp-soft: #3f2a1d; --cond-hp-line: #70472e;
  --cond-dm: #ff9a9a; --cond-dm-soft: #42242a; --cond-dm-line: #71404a;

  --panel-info: #315f9f;
  --panel-action: #765817;
  --panel-confirm: #246940;
  --shadow: 0 1px 2px rgba(0, 0, 0, .28), 0 5px 16px rgba(0, 0, 0, .20);
  --shadow-raised: 0 3px 8px rgba(0, 0, 0, .32), 0 12px 30px rgba(0, 0, 0, .26);

  --empty-line: #616161;
  --neutral-fill: #303030;
  --placeholder: #8a8a8a;
  --detail-border: #4a4a4a;
  --maintenance-border: #4a4a4a;
  --subnav-active: #263d63;
  --subnav-active-line: #6f9ce3;
  --request-risk-line: #66532d;
  --request-severity-text: #f4d07e;
  --ok-wash-line: #315f45;
  --warn-wash-line: #71404a;
  --chip-line: #4a4a4a;
  --attachment-fill: #1a1a1a;
  --maintenance-fill: #212121;
  --subnav-line: #4a4a4a;
}

/* The shelf opt-out (ADR-0088). Pull work — and only pull work — runs on a
   phone in the aisles, so the pull-sheet family reverts to the large scale
   this stylesheet used everywhere before 2026-08-26. base.html sets `shelf`
   on <main> from the same path prefixes the navigation already groups as
   pull work. The class rides <main>, never <body> or <html>: hx-boost swaps
   body CONTENT on navigation, so a root-element class would go stale on a
   boosted hop. Density only — colour tokens are never redefined here. */
main.shelf {
  --text-body: 1rem;
  --text-sm: .92rem;
  --text-h1: 1.7rem;
  --text-h2: 1.15rem;
  --text-h3: 1rem;
  --pad-cell: .55rem .75rem;
  --pad-card: .9rem 1rem;
  --pad-control: .48rem .95rem;
  --pad-field: .45rem .6rem;
}

* { box-sizing: border-box; }

/* The root stays 16px/1.55 so every rem in this file means what it says and
   the density tokens can be swapped without compounding. Page density comes
   from --text-body on <main>, not from shrinking the root. */
body {
  margin: 0;
  font: 16px/1.55 InterVariable, Inter, -apple-system, BlinkMacSystemFont,
        "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

.staff-icon { width: 1.1em; height: 1.1em; flex: 0 0 auto; vertical-align: -.18em; }
.mark .staff-icon { width: 1.35rem; height: 1.35rem; vertical-align: middle; stroke-width: 1.55; }
.staff-icon-button {
  display: inline-grid; place-items: center; width: var(--staff-control-height);
  height: var(--staff-control-height); padding: 0;
}
.staff-eyebrow { margin: 0 0 var(--staff-space-1); color: var(--muted); font-size: var(--text-sm); font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.staff-page-header, .page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: var(--staff-space-3); flex-wrap: wrap; margin-bottom: var(--staff-space-4);
}
.staff-page-header__copy { min-width: 0; }
.staff-page-header h1, .page-header h1 { margin: 0 0 var(--staff-space-1); }
.staff-page-header__lead, .page-header .muted { max-width: 70ch; margin: 0; }
.staff-feedback { display: flex; gap: var(--staff-space-2); align-items: flex-start; padding: var(--staff-space-3); border: 1px solid var(--line); border-left: 4px solid var(--info); border-radius: var(--radius-sm); background: var(--surface-alt); }
.staff-feedback--warning { border-left-color: var(--amber); }
/* display:flex above would otherwise beat the hidden attribute and leave an
   empty amber box beside every buylist's action buttons (#1320). */
.staff-feedback[hidden] { display: none; }
.staff-feedback--danger { border-left-color: var(--warn); }

body > main {
  width: var(--workspace-width);
  max-width: none;
  margin: 0 auto;
  padding: 1.25rem 1rem 4rem;
  font-size: var(--text-body);
}

h1 { font-size: var(--text-h1); font-weight: 650; letter-spacing: -.02em; margin: .5rem 0 .35rem; }
h2 { font-size: var(--text-h2); letter-spacing: -.01em; margin: 2rem 0 .5rem; }
h3 { font-size: var(--text-h3); margin: 0 0 .35rem; }
h1 small { font-size: var(--text-h3); font-weight: 500; color: var(--muted); }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }

.muted { color: var(--muted); font-size: var(--text-sm); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.nowrap { white-space: nowrap; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
input.qty { width: 4.2rem; }
body > main.wide { width: var(--workspace-width); max-width: none; }
/* Buylist grading needs every column at once, so it keeps only 5% breathing
   room per side instead of the shared workspace inset. --workspace-width has
   to be redeclared alongside the retuned inputs: a custom property's var()
   references are substituted where it is DECLARED, so descendants inherit
   :root's already-resolved value and overriding only --workspace-inset would
   do nothing. It lands on <body> rather than <main> so the topbar and
   navigation — siblings of <main>, and users of the same token — stay lined up
   with the wider workspace instead of sitting inset from it. */
body:has(> main.review-wide) {
  --workspace-inset: 10%;
  --workspace-max: 175rem;
  --workspace-width: min(calc(100% - var(--workspace-inset)), var(--workspace-max));
}

/* Anchor styled as a button (never nest <button> inside <a>). The rules
   surfaces from UX pass 11 onward write class="button"; both spellings get
   the same look. */
a.btn, a.button { display: inline-block; text-decoration: none; text-align: center; }

/* ---- Topbar ---------------------------------------------------------- */

.topbar {
  display: flex; gap: 1.25rem; align-items: center; flex-wrap: wrap;
  padding: .55rem 1.1rem;
  background: linear-gradient(180deg, var(--chrome-start), var(--chrome-end));
  color: var(--chrome-text);
  position: sticky; top: 0; z-index: 40;
  box-shadow: 0 1px 0 rgba(255, 255, 255, .06) inset, 0 2px 10px rgba(26, 26, 26, .35);
}
.topbar .brand {
  font-weight: 700; letter-spacing: .02em; font-size: 1.05rem;
  display: inline-flex; align-items: center; gap: .5rem; color: var(--chrome-text);
  text-decoration: none;
}
.topbar .brand .mark {
  display: inline-grid; place-items: center;
  width: 1.55rem; height: 1.55rem; border-radius: .45rem;
  background: var(--brand-stop);   /* neutral chip: the admin bar carries no brand hue */
  font-size: .9rem;
}
.topbar:not(.grouped-topbar) > nav { display: flex; gap: .15rem; flex-wrap: wrap; }
.topbar:not(.grouped-topbar) > nav > a {
  color: var(--chrome-muted); text-decoration: none;
  padding: .3rem .65rem; border-radius: .5rem;
  transition: background .12s ease, color .12s ease;
}
.topbar:not(.grouped-topbar) > nav > a:hover {
  color: var(--chrome-text); background: var(--chrome-hover);
}
.topbar:not(.grouped-topbar) > nav > a.active {
  color: var(--chrome-text); background: var(--chrome-active); font-weight: 600;
}
@media (min-width: 64.01rem) {
  .topbar:not(.grouped-topbar) {
    padding-inline: max(1.1rem, calc(var(--workspace-inset) / 2 + 1rem));
  }
}

/* Grouped navigation: primary areas open native details menus, while the
   active area's pages stay visible in the second row. */
.grouped-topbar { display: block; padding: 0; }
.topbar-primary {
  display: flex; align-items: center; gap: .75rem 1rem;
  width: var(--workspace-width); min-height: 3.15rem;
  margin: 0 auto; padding: .5rem 1.1rem;
}
.grouped-nav {
  display: flex; align-items: center; flex-wrap: wrap; gap: .15rem;
  /* Grow into the free header space before wrapping to a second row. */
  flex: 1 1 auto; min-width: 0;
}
.nav-group { position: relative; }
/* An open menu must paint above the second row of group labels (#1322). */
.nav-group[open], .nav-group:hover, .nav-group:focus-within { z-index: 41; }
.nav-group summary {
  display: flex; align-items: center; gap: .35rem; list-style: none;
  padding: .35rem .6rem; border-radius: .5rem;
  color: var(--chrome-muted); cursor: pointer; user-select: none;
  transition: background .12s ease, color .12s ease;
}
.nav-group summary::-webkit-details-marker { display: none; }
.nav-group summary:hover,
.nav-group summary:focus-visible,
.nav-group[open] summary {
  color: var(--chrome-text); background: var(--chrome-hover);
}
.nav-group.active summary {
  color: var(--chrome-text); background: var(--chrome-active); font-weight: 650;
}
.staff-mobile-menu-button { display: none; }
.staff-drawer-scrim { position: fixed; inset: 0; z-index: 79; background: rgba(0, 0, 0, .52); }
.staff-drawer-scrim[hidden] { display: none; }
.staff-drawer {
  width: min(24rem, calc(100vw - 2rem)); max-width: none; height: 100dvh; max-height: none;
  margin: 0 0 0 auto; padding: 0; color: var(--ink); background: var(--surface);
  border: 0; border-left: 1px solid var(--line); box-shadow: var(--shadow-raised);
}
dialog.staff-drawer[open] { display: flex; flex-direction: column; }
.staff-drawer::backdrop { background: rgba(0, 0, 0, .52); }
.staff-drawer__header {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--staff-space-3);
  padding: var(--staff-space-4); border-bottom: 1px solid var(--line);
}
.staff-drawer__header h2 { margin: 0; font-size: var(--text-h2); }
.staff-mobile-nav { display: grid; gap: var(--staff-space-4); padding: var(--staff-space-4); overflow: auto; }
.staff-mobile-nav section { display: grid; gap: var(--staff-space-1); }
.staff-mobile-nav h3 { margin: 0; color: var(--muted); font-size: var(--text-sm); letter-spacing: .06em; text-transform: uppercase; }
.staff-mobile-nav ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.staff-mobile-nav a { display: flex; min-height: var(--staff-control-height); align-items: center; padding: var(--staff-space-2) var(--staff-space-3); color: var(--ink); border-radius: var(--radius-sm); text-decoration: none; }
.staff-mobile-nav a:hover, .staff-mobile-nav a:focus-visible, .staff-mobile-nav a[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.staff-drawer__account { display: grid; gap: var(--staff-space-2); margin-top: auto; padding: var(--staff-space-4); border-top: 1px solid var(--line); background: var(--surface-alt); }
.staff-drawer__account p { display: flex; align-items: center; gap: var(--staff-space-2); margin: 0; }
.staff-account-icon { display: grid; place-items: center; width: 2rem; height: 2rem; color: var(--accent); background: var(--accent-soft); border-radius: 50%; }
.staff-drawer__account form { margin: 0; }
/* The phone drawer's copy of the header light/dark switch (#1322): shown
   even where the header copy is hidden, styled like the footer links. */
.staff-drawer__account .theme-toggle-form { display: flex; margin: 0; }
.staff-drawer__account .theme-toggle { padding: 0; min-height: 2.1rem; border: 0; color: var(--ink-soft); background: transparent; font-weight: 500; }
.staff-drawer__account .theme-toggle:hover, .staff-drawer__account .theme-toggle:focus-visible, .staff-drawer__account .theme-toggle[aria-pressed="true"] { color: var(--ink); background: transparent; }
.staff-drawer__account .theme-toggle-status { color: var(--muted); }
/* The same look on <a> and <button>: "Report a problem" (a link) and "Sign out
   / switch user" (a button) sat side by side in the drawer footer at two
   sizes, one underlined and one bold (#1322 S5). */
.staff-link-button { display: inline-flex; align-items: center; gap: var(--staff-space-2); min-height: 2.1rem; padding: 0; color: var(--ink-soft); border: 0; background: transparent; box-shadow: none; font: inherit; font-size: var(--text-body); font-weight: 500; line-height: 1.3; text-decoration: none; cursor: pointer; }
.staff-link-button:hover, .staff-link-button:focus-visible { color: var(--accent); background: transparent; box-shadow: none; }
.staff-account-actions { display: flex; align-items: center; gap: .2rem; margin-left: auto; }
.staff-account-actions form { margin: 0; }
.staff-account-name { max-width: 12rem; overflow: hidden; color: var(--chrome-muted); font-size: var(--text-sm); text-overflow: ellipsis; white-space: nowrap; }
.staff-account-action { display: inline-flex; align-items: center; gap: .35rem; min-height: 2.1rem; padding: .3rem .45rem; color: var(--chrome-muted); border-color: var(--chrome-line); background: transparent; box-shadow: none; font-size: var(--text-sm); white-space: nowrap; }
.staff-account-action:hover, .staff-account-action:focus-visible { color: var(--chrome-text); background: var(--chrome-hover); box-shadow: none; }
html.staff-drawer-open, body.staff-drawer-open { overflow: hidden; }
.staff-confirm-dialog { width: min(30rem, calc(100vw - 2rem)); padding: var(--staff-space-4); color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-raised); }
.staff-confirm-dialog::backdrop { background: rgba(0, 0, 0, .52); }
.staff-confirm-dialog h2 { margin-top: 0; }
.staff-confirm-dialog p { white-space: pre-wrap; }
.staff-dialog-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--staff-space-2); margin-top: var(--staff-space-4); }
.nav-chevron { font-size: .72rem; line-height: 1; transition: transform .12s ease; }
.nav-group[open] .nav-chevron { transform: rotate(180deg); }
.nav-menu {
  display: none; position: absolute; top: 100%; left: 0; z-index: 40;
  min-width: 14rem; max-width: min(20rem, calc(100vw - 1rem));
  margin: 0; padding: .35rem; list-style: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: .65rem; box-shadow: var(--shadow-raised);
}
.nav-group:nth-last-child(-n+2) .nav-menu { left: auto; right: 0; }
.nav-group[open] > .nav-menu,
.nav-group:hover > .nav-menu,
.nav-group:focus-within > .nav-menu { display: grid; }
.nav-menu a {
  display: flex; align-items: center; min-height: 2.3rem;
  padding: .42rem .65rem; border-radius: .45rem;
  color: var(--ink); text-decoration: none;
}
.nav-menu a:hover, .nav-menu a:focus-visible { background: var(--row-hover); }
.nav-menu a.active { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
/* A page this login cannot open: muted, not a link, names the job (#1322). */
.nav-locked {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .45rem;
  min-height: 2.3rem; padding: .42rem .65rem; color: var(--muted); cursor: not-allowed;
}
.nav-locked small { font-size: var(--text-sm); }
.secondary-nav .nav-locked, .staff-mobile-nav .nav-locked { min-height: var(--staff-control-height); }
.secondary-nav {
  padding: .25rem 1.1rem .4rem;
  border-top: 1px solid var(--chrome-line);
  background: rgba(0, 0, 0, .12);
}
.secondary-nav ul {
  display: flex; flex-wrap: wrap; gap: .15rem;
  width: var(--workspace-width); margin: 0 auto; padding: 0 1.1rem; list-style: none;
}
.secondary-nav a {
  display: block; padding: .25rem .65rem; border-radius: .45rem;
  color: var(--chrome-muted); text-decoration: none; font-size: .9rem;
}
.secondary-nav a:hover, .secondary-nav a:focus-visible {
  color: var(--chrome-text); background: var(--chrome-hover);
}
.secondary-nav a.active {
  color: var(--chrome-text); background: var(--chrome-active); font-weight: 700;
}
.theme-toggle-form {
  display: flex; align-items: center; gap: .4rem;
  margin: 0 0 0 auto; flex: 0 0 auto;
}
.theme-toggle {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .32rem .6rem; border-color: var(--chrome-line);
  background: transparent; color: var(--chrome-muted); box-shadow: none;
  white-space: nowrap;
  transition: background-color .12s ease, color .12s ease, border-color .12s ease;
}
.theme-toggle:hover, .theme-toggle:focus-visible {
  color: var(--chrome-text); background: var(--chrome-hover); box-shadow: none;
}
.theme-toggle[aria-pressed="true"] {
  color: var(--chrome-text); background: var(--chrome-active);
}
.theme-toggle:disabled {
  cursor: wait; opacity: 1;
}
.theme-toggle-status {
  min-width: 3.2rem;
  color: var(--chrome-muted);
  font-size: .76rem;
  font-weight: 700;
  white-space: nowrap;
}
.theme-toggle-form[data-theme-state="saving"] [data-theme-icon] {
  animation: theme-toggle-spin .65s linear infinite;
}
.theme-toggle-form[data-theme-state="saved"] .theme-toggle-status {
  color: var(--chrome-text);
}
.theme-toggle-form[data-theme-state="error"] .theme-toggle-status {
  color: var(--warn);
}
@keyframes theme-toggle-spin {
  to { transform: rotate(360deg); }
}

@media (max-width: 900px) {
  .topbar-primary { flex-wrap: wrap; }
  .grouped-nav { order: 3; width: 100%; }
}
@media (max-width: 560px) {
  .grouped-nav, .secondary-nav, .theme-toggle-form, .staff-account-actions { display: none; }
  .topbar-primary { min-height: 3.5rem; flex-wrap: nowrap; justify-content: space-between; }
  .staff-mobile-menu-button { display: inline-flex; align-items: center; gap: .35rem; min-height: var(--staff-control-height); margin-left: auto; }
  .topbar-primary { padding-inline: .65rem; }
  .grouped-nav { gap: .05rem; }
  .nav-group summary { padding-inline: .48rem; }
  .secondary-nav { padding-inline: 0; }
  .secondary-nav ul { padding-inline: .65rem; }
}

/* htmx boosted-navigation progress: pure CSS, no build step */
@keyframes navpulse { 0% { transform: scaleX(.05); } 70% { transform: scaleX(.85); } 100% { transform: scaleX(.98); } }
body.htmx-request .topbar::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 100%;
  background: var(--gold); transform-origin: left;
  animation: navpulse 1.2s ease-out forwards;
}

/* Unsaved-edits bar (grading screen): appears fixed at the bottom when the
   form is dirty, so the Save button is reachable even mid-scroll on a phone */
#savebar {
  display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: .6rem .9rem; background: var(--chrome-end); color: var(--chrome-text);
  justify-content: space-between; align-items: center; gap: .8rem;
  box-shadow: 0 -4px 16px rgba(26, 26, 26, .3);
}
#savebar.show { display: flex; }
#savebar .grade-edit-actions { justify-content: flex-end; }
.grade-edit-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.grading-order-controls {
  display: flex; flex-wrap: wrap; align-items: center; gap: .65rem; margin: 0 0 .65rem;
}

/* Sticky pick bar (guided pick walk) — the #savebar pattern, always shown:
   the primary ✔ Pick must be reachable without scrolling on a phone, and
   "Not there" lives elsewhere on the page so a thumb can't hit it by
   accident (UX-A item 6). */
#pickbar {
  display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
  padding: .6rem .9rem; background: var(--chrome-end); color: var(--chrome-text);
  justify-content: space-between; align-items: center; gap: .8rem;
  box-shadow: 0 -4px 16px rgba(26, 26, 26, .3);
}
#pickbar form { margin: 0; }
/* Rendered before #pickbar so the last in-flow content stays clickable above
   the fixed bar — an explicit element, not :has() (older floor phones). */
.pickbar-spacer { height: 4.5rem; }

/* The quiet "Not there" expander on the pick walk. */
/* #1321 round 2: the per-login screen toggles live in one "Options"
   disclosure on the pick screens, so the bin and the card lead the page. */
/* ROCA/import row choices (Regular, Cold Foil, Change match, Exclude) stack
   full width on a phone instead of clipping off the table (#1321 round 2). */
@media (max-width: 46rem) {
  td.import-resolve-actions { display: grid; gap: .35rem; min-width: 9rem; }
  td.import-resolve-actions form, td.import-resolve-actions .btn,
  td.import-resolve-actions button { width: 100%; }
}
.floor-options { margin: .3rem 0 .8rem; }
.floor-options summary { cursor: pointer; display: inline-block; }
.floor-options-body { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .4rem; }
.short-details { margin: .8rem 0; }
.short-details summary { cursor: pointer; }
.short-details form { margin-top: .5rem; }

/* Inline styled confirm (grading screen dirty-guard) — buttons sit with the
   message, not a native confirm(). */
#dirty-confirm .actions, #discard-confirm .actions {
  display: inline-flex; gap: .5rem; margin-left: .6rem;
}

/* Pager rows under paginated history tables. */
.pager-row { display: flex; gap: .6rem; align-items: center; }

/* ---- Tables ----------------------------------------------------------- */

table {
  width: 100%; border-collapse: separate; border-spacing: 0;
  margin: .8rem 0 1.2rem;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
th, td { text-align: left; padding: var(--pad-cell); border-bottom: 1px solid var(--line); }
tbody tr:last-child td { border-bottom: none; }
thead th {
  font-size: .72rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase;
  color: var(--ink-soft); background: var(--surface-alt);
}
thead th a { color: var(--ink-soft); text-decoration: none; }
thead th a:hover { color: var(--accent); }
thead th a::after { content: " ↕"; opacity: .45; font-size: .85em; }
tbody tr { transition: background .1s ease; }
tbody tr:hover td { background: var(--row-hover); }
tfoot td { background: var(--surface-alt); border-top: 1px solid var(--line); }

tr.picked td { color: var(--muted); text-decoration: line-through; }
tr.short td { color: var(--warn); }
/* #1321 round 6: a not-there the replacement chain found elsewhere is not owed —
   struck and neutral like a picked row, never the red of an owed card. */
tr.rerouted td { color: var(--muted); }
.rerouted-note { color: var(--muted); text-decoration: line-through; }
.rerouted-note.is-pending { text-decoration: none; } /* still an instruction */
/* #1267: closed by Shopify — resolved, and not by a pick, so the row reads
   muted like any finished line but without the picked strike-through. */
tr.shopify td, tr.void td { color: var(--muted); }
tr.inactive td { color: var(--muted); background: var(--row-inactive); }

/* Horizontal scrolling is an exception for genuinely irreducible comparison
   data. Responsive screens should wrap/recompose first; when a legacy data
   table cannot, contain its scroll here so the page itself never pans. */
.table-scroll { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.table-scroll > table { margin: .8rem 0; }

@media (max-width: 720px) {
  body > main { padding: .9rem .6rem 3rem; }
}

/* ---- Panels / groups --------------------------------------------------- */

.container-group {
  margin-top: 1.4rem;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: var(--pad-card);
}
.container-group h2, .container-group h3 { margin-top: 0; font-size: var(--text-h3); }
.container-group table { box-shadow: none; margin-bottom: .25rem; }
.container-group .path { color: var(--muted); font-size: var(--text-sm); }

.container-group.unstored { border-left: 4px solid var(--warn); }

.storage-breadcrumbs {
  margin: 0 0 1.15rem;
  color: var(--muted);
  font-size: var(--text-sm);
}
.storage-breadcrumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
  margin: 0;
  padding: 0;
  list-style: none;
}
.storage-breadcrumbs li:not(:last-child)::after {
  content: "›";
  margin-left: .35rem;
  color: var(--muted);
}
.storage-breadcrumbs [aria-current="page"] { color: var(--ink); font-weight: 650; }

.suggestion {
  background: var(--ok-soft);
  border: 1px solid var(--ok-border); border-left: 4px solid var(--ok);
  padding: .55rem .8rem; border-radius: var(--radius-sm);
}

/* The physical habit the bin depths depend on (ADR-0078): new cards go behind,
   picks come off the front. Quieter than a warning — it is a reminder of how
   the floor already works, not a problem to fix. */
/* The audited index on a bin audit: a place in the pile is 1–2 digits, so the
   field is sized for that rather than stretching across the column. */
.depth-slot { width: 4.5rem; }
.floor-rule { font-size: .9rem; color: var(--muted); margin: .3rem 0 0; }
.floor-rule strong { color: var(--ink); }
.depth { font-size: .88rem; }

/* ---- Buttons & forms --------------------------------------------------- */

/* Polaris button hierarchy (ADR-0088). The default button is the quiet white
   secondary: surface fill, hairline border, and a bottom-edge bevel that
   gives it a physical lip. The one prominent action per screen is .btn-hero
   (see the hero section below); ok/warn/danger keep their semantic fills. */
button, .btn, .button {
  font: inherit; font-size: var(--text-body); font-weight: 600;
  padding: var(--pad-control); border-radius: var(--radius-sm);
  border: 1px solid var(--btn-line); background: var(--surface); color: var(--ink);
  cursor: pointer;
  transition: transform .06s ease, box-shadow .12s ease, background .12s ease;
  box-shadow: inset 0 -1px 0 var(--btn-line-strong), var(--shadow);
}
button:hover, a.btn:hover, a.button:hover { background: var(--row-hover); }
button:active, a.btn:active, a.button:active {
  transform: translateY(1px); background: var(--surface-alt); box-shadow: none;
}
/* One focus treatment site-wide: the interactive blue as a 2px ring just
   outside the control, so it reads on every fill and in both themes. */
button:focus-visible, a:focus-visible, input:focus-visible,
select:focus-visible, textarea:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 1px;
}
button.primary, a.btn.primary, a.button.primary {
  background: var(--accent); border-color: var(--accent); color: var(--on-accent);
}
button.primary:hover, a.btn.primary:hover, a.button.primary:hover { background: var(--accent-hover); }
button.ok { background: var(--ok); border-color: var(--ok); color: var(--on-accent); }
button.ok:hover { background: var(--ok-hover); }
button.warn { background: var(--surface); border-color: var(--warn); color: var(--warn); }
button.warn:hover { background: var(--warn-soft); }
/* .danger was used on staff buttons for months with NO rule anywhere in this
   stylesheet, so "Retire unit" rendered identically to a harmless button.
   Filled, not outlined, so destructive reads as more severe than .warn's
   cautionary outline. Both --danger-strong and --on-accent flip with the
   theme, so this stays legible in dark. */
button.danger { background: var(--danger-strong); border-color: var(--danger-strong); color: var(--on-accent); }
button.danger:hover { filter: brightness(1.12); }
button.attention { box-shadow: 0 0 0 3px var(--gold); } /* unsaved edits pending */
button:disabled { cursor: not-allowed; opacity: .52; box-shadow: none; }

/* date, time and password joined the list in #1322: the event form's date box
   rendered as the browser's bare 21px square beside 33px rounded inputs. */
input[type=text], input[type=search], input[type=number], input[type=email],
input[type=date], input[type=time], input[type=datetime-local], input[type=password],
input[type=url], input[type=tel], select, textarea {
  font: inherit; font-size: var(--text-body);
  padding: var(--pad-field);
  border: 1px solid var(--control-line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink);
  transition: border-color .12s ease;
}
input:hover, select:hover { border-color: var(--control-line-hover); }
form.inline { display: inline; }
form.actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.actions .push { margin-left: auto; }
form.stack { display: flex; flex-direction: column; gap: .5rem; align-items: flex-start;
             max-width: 28rem; }
form.stack input[type=text], form.stack select { width: 100%; }
form.searchbar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
form.searchbar input[type=search] { flex: 1 1 14rem; max-width: 26rem; }

/* Review-queue action cells: computed-price actions on one row, the
   custom-price box + its button on the next, everything aligned. */
form.stacked { display: inline-block; }
form.stacked .row { display: flex; gap: .35rem; align-items: center;
                    margin: .18rem 0; white-space: nowrap; }
form.stacked .row input[type=text] { width: 6.5rem; }
form.stacked .row button { flex: 1; }

/* ---- Grouped upward-price review --------------------------------------
   One printing owns one visual card, then finish and condition rows reflow
   inside it. No fixed-width table and no nested horizontal viewport: the
   same workflow remains usable in Shopify's narrower embedded workspace. */
.price-review-heading {
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between;
  gap: .75rem 1.25rem; margin-top: 1.6rem;
}
.price-review-heading h2, .price-review-heading p { margin-bottom: .35rem; }
.price-review-heading > div:first-child { flex: 1 1 32rem; min-width: 0; }
.price-review-bulk-actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.price-card-list { display: grid; gap: 1rem; margin: .9rem 0 1.6rem; }
.price-card-group {
  min-width: 0; overflow: hidden; container-type: inline-size;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.price-card-header {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: .8rem 1.25rem; padding: .85rem 1rem; background: var(--surface-alt);
  border-bottom: 1px solid var(--line);
}
.price-card-identity { display: flex; align-items: center; gap: .8rem; min-width: 0; }
.price-card-identity > div { min-width: 0; }
.price-card-identity h3, .price-card-identity p { margin: 0; overflow-wrap: anywhere; }
.price-card-identity p { color: var(--muted); }
.price-card-image {
  flex: 0 0 auto; width: 54px; max-height: 76px; object-fit: contain;
  border-radius: 4px; box-shadow: 0 1px 4px rgba(26, 26, 26, .24);
}
.price-finish-group { min-width: 0; padding: .75rem 1rem 1rem; }
.price-finish-group + .price-finish-group { border-top: 1px solid var(--line); }
.price-finish-group h4 {
  margin: 0 0 .55rem; font-size: .78rem; letter-spacing: .08em;
  text-transform: uppercase; color: var(--ink-soft);
}
/* Density pass (owner decision 2026-08-04): a reviewer works down a long
   queue, so a condition is one scannable line — condition, the move, its
   state, the controls — and everything explanatory sits behind the row's
   disclosure. The card header above is deliberately untouched; it is the
   thing you navigate by. */
/* Game bands: the reviewer's own game is a heading they can scan to, not a
   filter they have to remember to set. */
.price-game-group { display: grid; gap: .4rem; margin: 0 0 1rem; }
.price-game-heading {
  margin: 0; font-size: .95rem; display: flex; align-items: baseline; gap: .5rem;
  padding-bottom: .2rem; border-bottom: 2px solid var(--line);
}
.price-game-heading .muted { font-size: .78rem; font-weight: 400; }
.price-condition-list { display: grid; gap: .25rem; }
.price-condition-row {
  min-width: 0; display: grid;
  grid-template-columns: minmax(5.5rem, auto) minmax(10rem, 1fr) auto minmax(0, auto);
  gap: .15rem .6rem; align-items: center; padding: .3rem .5rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); font-size: .84rem;
}
/* The move reads as one sentence and never wraps mid-number. */
.price-move {
  margin: 0; min-width: 0; display: flex; align-items: baseline; gap: .3rem;
  flex-wrap: wrap; font-variant-numeric: tabular-nums;
}
.price-move .price-was { color: var(--muted); text-decoration: line-through; }
.price-row-badge { white-space: nowrap; }
/* Full width when open so the explanation has room without costing the
   closed row any height. */
.price-row-detail { grid-column: 1 / -1; font-size: .78rem; }
.price-row-detail > summary { color: var(--muted); cursor: pointer; padding: .1rem 0; }
.price-row-detail-body { display: grid; gap: .25rem; padding: .3rem 0 .1rem; }
.price-row-detail-body p { margin: 0; }
.price-condition-row.cond-nm { border-left: 4px solid var(--cond-nm); }
.price-condition-row.cond-lp { border-left: 4px solid var(--cond-lp); }
.price-condition-row.cond-mp { border-left: 4px solid var(--cond-mp); }
.price-condition-row.cond-hp { border-left: 4px solid var(--cond-hp); }
.price-condition-row.cond-dm { border-left: 4px solid var(--cond-dm); }
.price-condition-name { min-width: 0; display: grid; align-content: center; }
.price-condition-name > * { min-width: 0; overflow-wrap: anywhere; }
.price-sku { font-size: .75rem; }
.price-row-values {
  min-width: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem; margin: 0;
}
.price-row-values div { min-width: 0; }
.price-row-values dt {
  font-size: .68rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--muted);
}
.price-row-values dd { margin: 0; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.price-delivery-state { min-width: 0; display: grid; justify-items: start; gap: .2rem; }
.price-delivery-state small { color: var(--muted); overflow-wrap: anywhere; }
.price-action-form {
  min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .3rem .5rem;
}
.price-custom-field {
  min-width: 0; font-size: .72rem; color: var(--ink-soft);
  display: flex; align-items: center; gap: .25rem;
}
.price-custom-field > span { display: flex; align-items: center; gap: .2rem; }
.price-custom-field input { min-width: 0; width: 4.5rem; padding: .15rem .3rem; }
.price-row-actions { min-width: 0; display: flex; flex-wrap: wrap; gap: .25rem; }
.price-row-actions button {
  flex: 0 0 auto; white-space: nowrap; padding: .2rem .5rem; font-size: .78rem;
}
.price-row-error {
  grid-column: 1 / -1; margin: 0; color: var(--warn); font-size: .82rem;
}

@container (max-width: 980px) {
  .price-condition-row { grid-template-columns: minmax(8rem, .7fr) minmax(15rem, 1.3fr); }
  .price-delivery-state, .price-action-form { grid-column: auto; }
}
@container (max-width: 620px) {
  .price-condition-row { grid-template-columns: minmax(0, 1fr); }
  .price-row-values { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .price-action-form { grid-template-columns: minmax(0, 1fr); }
  .price-card-header > button { width: 100%; }
}
@media (max-width: 480px) {
  .price-row-values { grid-template-columns: minmax(0, 1fr); }
}

/* UX pass 07: bounded manual corrections and acknowledgement-only selection. */
.price-review-bulk-actions > form { display: inline-flex; }
.price-review-select {
  display: inline-flex; align-items: center; gap: .35rem; width: fit-content;
  color: var(--ink-soft); font-size: .82rem; font-weight: 600;
}
.price-why-held {
  margin: .35rem 0 0; padding: .45rem .55rem; border-left: 3px solid var(--amber);
  background: var(--amber-soft); color: var(--ink); border-radius: var(--radius-sm);
  font-size: .88rem; line-height: 1.4;
}
.manual-stock-adjustment-form { padding: 1rem; max-width: 36rem; }
.manual-stock-adjustment-form > label {
  display: grid; gap: .25rem; width: 100%; font-weight: 650;
}
.manual-stock-adjustment-form input[type="number"],
.manual-stock-adjustment-form select,
.manual-stock-adjustment-form textarea { width: 100%; }
.adjust-stock-card-art {
  width: min(180px, 34vw); height: auto; border-radius: .5rem; box-shadow: var(--shadow);
}
.manual-stock-adjustment-form .error { display: block; color: var(--error-text); }
.manual-adjustment-head {
  display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-start;
}
.manual-adjustment-head > div { flex: 1 1 18rem; min-width: 0; }

/* ---- Flash messages & badges ------------------------------------------ */

.flash {
  padding: .6rem .9rem; margin: .6rem 0;
  border-radius: var(--radius-sm);
  background: var(--accent-soft); border: 1px solid var(--info-border);
  border-left: 4px solid var(--accent);
}
.flash.error { background: var(--warn-soft); border-color: var(--warn-border); border-left-color: var(--warn); color: var(--error-text); }
/* Amber flows from the shared amber token(s), same as error/success route
   through --warn/--ok — one amber vocabulary. Border and text tokens swap
   with the active theme, mirroring the .error/.success siblings above. */
.flash.warning { background: var(--amber-soft); border-color: var(--amber-border); border-left-color: var(--amber); color: var(--warning-text); }
.flash.success { background: var(--ok-soft); border-color: var(--ok-border); border-left-color: var(--ok); color: var(--success-text); }

/* The pill: one small tinted shape for every status/set/finish/condition/
   location label. Light tint fill + solid same-hue text, 999px radius. Four
   canonical roles (info/ok/warn/muted); legacy state names alias onto them so
   templates and tests keep their existing classes. */
.badge {
  display: inline-flex; align-items: center; gap: .3rem;
  padding: .1rem .5rem; border-radius: 999px;
  font-size: var(--text-sm); font-weight: 600; letter-spacing: .02em; line-height: 1.55;
  background: var(--muted-soft); color: var(--ink-soft);
  white-space: nowrap;  /* a pill that wraps reads as a blob, never as a label */
}
.badge.info { background: var(--info-soft); color: var(--info); }
.badge.ok, .badge.good { background: var(--ok-soft); color: var(--ok); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.muted { background: var(--muted-soft); color: var(--ink-soft); }  /* --ink-soft: a pill is a label, not secondary text */
/* Legacy state names (used across templates, some test-asserted) → roles. */
.badge.open, .badge.unknown { background: var(--info-soft); color: var(--info); }
.badge.complete, .badge.stowed, .badge.picked, .badge.matched { background: var(--ok-soft); color: var(--ok); }
.badge.short, .badge.rejected { background: var(--warn-soft); color: var(--warn); }
/* #1267: a line or sheet Shopify closed — done, but not done by us, so it reads
   as neutral fact rather than a success or a warning. */
.badge.shopify, .badge.void { background: var(--muted-soft); color: var(--ink-soft); }
.badge.ambiguous, .badge.warning { background: var(--amber-soft); color: var(--ambiguous-text); }  /* darker amber → ≥5:1 on the pill tint */

/* Small numeric counter riding inside a button or heading ("Rule changes
   awaiting activation ⑤"). Referenced by the rules reading pages and the
   draft queue since UX pass 11; previously never defined, so the number
   rendered as bare text. */
.count-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.35rem; height: 1.35rem; padding: 0 .4rem;
  border-radius: 999px; background: var(--accent); color: var(--on-accent);
  font-size: .74rem; font-weight: 700; line-height: 1;
}
.projection-status-list { display: grid; gap: .45rem; padding-left: 1.25rem; }

/* ---- Buylist grading screen -------------------------------------------
   Graders think in names and margins, not SKUs. Row tint compares the
   customer's SUBMITTED price to what today's rules would pay ("Today ea"):
   red = submitted higher than today (double-check before honoring),
   green = at or below today's. Class names are test-asserted. */

/* The review table must fit the embedded Shopify workspace without a second
   horizontal viewport. Desktop uses bounded fixed columns; narrower app
   containers recompose each table row into labelled cells. */
.grade-review { max-width: 100%; container-type: inline-size; }
table.grade { table-layout: fixed; margin-bottom: 0; border-radius: var(--radius) var(--radius) 0 0; }
table.grade th, table.grade td {
  vertical-align: middle; white-space: normal; overflow-wrap: anywhere;
  padding: var(--pad-cell);
}
table.grade .grade-col-order { width: 5%; }
table.grade .grade-col-card { width: 14%; }
table.grade .grade-col-set { width: 7%; }
table.grade .grade-col-version { width: 15%; }
table.grade .grade-col-qty { width: 5%; }
table.grade .grade-col-submitted { width: 11%; }
table.grade .grade-col-staff { width: 8%; }
table.grade .grade-col-today { width: 11%; }
table.grade .grade-col-line { width: 6%; }
table.grade .grade-col-stock { width: 5%; }
table.grade .grade-col-sell { width: 6%; }
table.grade .grade-col-action { width: 7%; }
table.grade input, table.grade select { max-width: 100%; }
/* One line per card is the whole point of this screen: a grader compares many
   cards at once, so nothing in a row may claim a second block of its own. The
   number columns stop wrapping and the row collapses toward the height of its
   thumbnail — but only once the table is wide enough to hold them unwrapped,
   measured against the widths above (Today's price plus its rule link is the
   binding one, at 11%). Between 70rem and here the table still renders,
   wrapping as it always did: a taller row beats a clipped price. Column
   positions, not classes, because `col` cannot pass white-space down to cells:
   5 Qty · 7 We'll pay · 8 Today · 9 Line · 10 Stock · 11 Sell. */
@container (min-width: 79rem) {
  table.grade td:nth-child(5), table.grade td:nth-child(7),
  table.grade td:nth-child(8), table.grade td:nth-child(9),
  table.grade td:nth-child(10), table.grade td:nth-child(11) {
    white-space: nowrap; overflow: hidden;
  }
  /* Today's "current rule" link rides beside the price rather than under it.
     The JS requote path rebuilds this same wrapper div, so it matches too. */
  table.grade td:nth-child(8) > div { display: inline; }
  /* The drag handle rides beside the thumbnail, not above it: the thumb sets
     the row height, and stacking the handle on top taxed every row ~30px.
     Both fall back to their stacked block layout below this width, where the
     Order column is too narrow to hold the pair side by side. */
  table.grade td:nth-child(1) .drag-handle { display: inline-block; vertical-align: middle; margin-right: .2rem; }
  table.grade td:nth-child(1) img.thumb { display: inline-block; vertical-align: middle; }
}
table.grade td:nth-child(8) a { font-size: var(--text-sm); }
/* The name wraps to at most two lines and the Shopify link takes its own
   line: Lorcana subtitles ("Demona - Scourge of…") are what tell versions
   apart, and a one-line ellipsis cut them to ~10 characters (#1320). */
.grade-card-name { display: flex; flex-direction: column; align-items: flex-start; gap: .1rem; min-width: 0; }
.grade-card-name > .grade-card-title {
  min-width: 0; max-width: 100%; overflow: hidden; overflow-wrap: normal; word-break: normal;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2;
}
.grade-card-name > a:not(.grade-card-title) { flex: none; font-size: var(--text-sm); }
/* Buttons and numeric headers never break mid-word ("Rech-eck", "STO-CK"). */
table.grade thead th { overflow-wrap: normal; word-break: normal; hyphens: none; }
table.grade td[data-label="Action"] button { white-space: nowrap; overflow-wrap: normal; min-width: max-content; }
/* A removed line's old value, struck beside its $0.00. */
table.grade [data-line-was] { display: block; font-size: var(--text-sm); }
table.grade [data-line-was][hidden] { display: none; }
/* A chip whose grade has no locked price: the grader will type it. */
.condition-chip[data-needs-price] { border-style: dashed; }
.cell-oneline { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Price and its payout badge read as one line wherever the column can hold
   both, and drop the badge to a second line rather than truncate it — a
   half-shown "Store credi…" looks like a fault. Two lines here still fit the
   row: the condition chips next door set the height. */
.cell-value { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 0 .3rem; }
table.grade .badge { padding: .1rem .3rem; }
/* Row-level disclosure: evidence a grader wants occasionally (the submitted
   quote's arithmetic, a customer explanation) without a block per card. */
.cell-more { text-align: left; }
.cell-more > summary {
  cursor: pointer; color: var(--muted); font-size: var(--text-sm);
  list-style-position: inside;
}
.cell-more > summary:hover { color: var(--accent); }
.cell-more[open] > summary { margin-bottom: .2rem; }
.cell-more > :not(summary) { font-size: var(--text-sm); }
table.grade .drag-handle { margin: 0; }
table.grade td:last-child button { padding: .2rem .4rem; }
.grade-summary {
  display: flex; flex-wrap: wrap; justify-content: flex-end; align-items: center;
  gap: .75rem 1.25rem; margin: 0 0 1.2rem; padding: .7rem .75rem;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-top: 0; border-radius: 0 0 var(--radius) var(--radius);
}
.grade-summary .grade-edit-actions { justify-content: flex-end; }
/* Messages flow with the page, below the grading table and the add-card box.
   The grading columns need the whole width, so nothing reserves a sticky side
   column; the panel keeps a reading measure so its prose does not sprawl. */
.buylist-review-page--messages > * { min-width: 0; }
.buylist-messages { max-width: 60rem; }
.conversation-list {
  display: grid;
  gap: .65rem;
  margin: .75rem 0 1rem;
  padding: 0;
  list-style: none;
}
.conversation-message {
  padding: .7rem;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.conversation-message--staff,
.conversation-message--automatic { border-left: 4px solid var(--accent); }
.conversation-message--customer { border-left: 4px solid var(--amber); }
.conversation-message__meta {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem .75rem;
  margin: 0 0 .35rem;
  color: var(--ink-soft);
  font-size: .78rem;
}
.conversation-message__body { overflow-wrap: anywhere; white-space: normal; }
.conversation-reply { display: grid; gap: .45rem; }
.conversation-reply textarea { min-height: 7rem; resize: vertical; }
.quick-review-bar {
  position: sticky; top: .6rem; z-index: 20;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center;
  gap: .6rem 1rem; margin: 0 0 .75rem; padding: .65rem .75rem;
  color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-raised);
}
.quick-review-nav, .quick-review-guidance {
  min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .5rem .75rem;
}
.quick-review-guidance { justify-content: flex-end; }
.quick-review-bar [data-running-total] { font-variant-numeric: tabular-nums; }
/* One chip row per grading line, so all five conditions have to fit the Version
   column on a single line down to the narrowest width that still renders as a
   table (70rem of container — below that the stacked mode takes over). Wrapping
   stays enabled as the safety valve: two chip rows cost height, a chip pushed
   out of its column would be unreachable. */
.condition-chip-row { display: flex; flex-wrap: wrap; gap: .12rem; margin: .2rem 0; }
.condition-chip {
  min-width: 1.55rem; padding: .12rem .2rem; border-radius: 999px;
  font-size: var(--text-sm); line-height: 1.2; white-space: nowrap;
}
.condition-chip[aria-pressed="true"] {
  color: var(--on-accent); background: var(--accent); border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent);
}
[data-quick-review-ready] select[name^="cond_"] { position: absolute; left: -9999px; }
table.grade tr.quick-review-active { outline: 3px solid var(--accent); outline-offset: -3px; }
.grade-tooltip {
  position: relative; display: inline-grid; place-items: center;
  width: 1rem; height: 1rem; margin-left: .15rem; border-radius: 50%;
  color: var(--info); background: var(--info-soft);
  font-size: .7rem; font-weight: 800; text-transform: none; cursor: help;
}
.grade-tooltip::after {
  content: attr(data-tooltip); position: absolute; z-index: 50;
  left: 50%; top: calc(100% + .4rem); width: min(18rem, 70vw);
  padding: .5rem .6rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  color: var(--ink); background: var(--surface); box-shadow: var(--shadow-raised);
  font-size: .82rem; font-weight: 500; letter-spacing: normal;
  line-height: 1.35; text-align: left; text-transform: none;
  opacity: 0; pointer-events: none; transform: translateX(-50%);
}
.grade-tooltip:hover::after, .grade-tooltip:focus-visible::after { opacity: 1; }
.payout-cash { background: var(--ok-soft); color: var(--ok); }
/* Recheck expands one grading row into a full-width panel beneath it. It is a
   real table row so the card it belongs to is never in doubt; the controller
   keeps it directly under its line after a manual reorder or a sort. */
.recheck-panel-row > td {
  padding: .75rem; background: var(--surface-sunken);
  border-top: 2px solid var(--accent);
}
.recheck-panel { display: grid; gap: .55rem; }
.recheck-panel:focus { outline: none; }
.recheck-panel__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .5rem;
}
.recheck-panel h3 { margin: .2rem 0 0; font-size: var(--text-sm); }
.recheck-panel table { width: 100%; }
.recheck-panel table td, .recheck-panel table th { padding: .2rem .4rem; }
.recheck-panel tr.recheck-graded { background: var(--accent-soft); }
.recheck-panel__figures {
  display: flex; flex-wrap: wrap; gap: .4rem 1.5rem; margin: 0;
}
.recheck-panel__figures dt { font-size: var(--text-sm); color: var(--ink-muted); }
.recheck-panel__figures dd { margin: 0; font-variant-numeric: tabular-nums; }
.recheck-panel__outcomes { margin: 0; padding-left: 1.1rem; }
.recheck-panel .actions, .recheck-action { display: flex; flex-wrap: wrap; gap: .4rem; }
.payout-credit { background: var(--accent-soft); color: var(--accent); }
.updated-quote-preview {
  width: min(46rem, calc(100vw - 2rem)); max-height: min(52rem, calc(100vh - 2rem));
  padding: 1rem; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-raised);
}
.updated-quote-preview::backdrop { background: rgba(26, 26, 26, .66); }
.updated-quote-preview__head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
}
.updated-quote-preview__head h2, .updated-quote-preview__head p { margin-top: 0; }
.updated-quote-preview__meta {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem 1rem;
  padding: .75rem; background: var(--surface-alt); border-radius: var(--radius-sm);
}
.updated-quote-preview__meta div { min-width: 0; }
.updated-quote-preview__meta dt {
  color: var(--muted); font-size: .72rem; font-weight: 700;
  letter-spacing: .06em; text-transform: uppercase;
}
.updated-quote-preview__meta dd { margin: .15rem 0 0; overflow-wrap: anywhere; }
.updated-quote-preview__body {
  max-height: 25rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  padding: .75rem; color: var(--ink); background: var(--surface-alt);
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  font: inherit; font-size: .88rem; line-height: 1.45;
}
.updated-quote-preview > .actions { justify-content: flex-end; margin-top: .75rem; }
.drag-handle {
  cursor: grab; min-width: 2rem; padding: .2rem .45rem; margin: 0 0 .35rem;
  touch-action: none;
}
.drag-handle:active { cursor: grabbing; }
table.grade tr.dragging { opacity: .45; }
@keyframes newly-added-row {
  0%, 70% { outline: 3px solid var(--gold); outline-offset: -3px; }
  100% { outline-color: transparent; }
}
table.grade tr.newly-added { animation: newly-added-row 2.4s ease-out; }
/* Card thumbnails in any table cell (grading, inventory): small at rest,
   zoom on hover for a legibility check without leaving the row. */
td img.thumb {
  width: 44px; border-radius: 4px; display: block;
  box-shadow: 0 1px 3px rgba(26, 26, 26, .25);
  transition: transform .12s ease;
}
td img.thumb:hover { transform: scale(2.6); box-shadow: var(--shadow-raised); }
table.grade tr.ok-quote td { background: var(--ok-wash-rest); }
table.grade tr.over-quote td { background: var(--warn-wash-rest); }
table.grade tr.picked td { background: var(--picked-wash); }
table.grade tr.ok-quote:hover td { background: var(--ok-wash); }
table.grade tr.over-quote:hover td { background: var(--warn-wash); }
table.grade input, table.grade select { font-size: .92rem; padding: .3rem .4rem; }

@container (max-width: 70rem) {
  table.grade { display: block; border: 0; background: transparent; box-shadow: none; overflow: visible; }
  table.grade colgroup, table.grade thead { display: none; }
  table.grade tbody { display: grid; gap: .75rem; }
  table.grade tr {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
    border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow);
  }
  table.grade td { display: block; min-width: 0; text-align: left; }
  /* Cells are left-aligned blocks here, so the price/badge pair leads rather
     than trails. The one-line rules never reach this mode: they are gated on a
     container WIDER than the one that triggers it. */
  .cell-value { justify-content: flex-start; }
  table.grade td::before {
    content: attr(data-label); display: block; margin-bottom: .2rem;
    color: var(--ink-soft); font-size: .68rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
  }
  table.grade td:nth-child(2) { grid-column: span 2; }
  table.grade td:nth-last-child(-n+4) { border-bottom: 0; }
  .grade-summary { margin-top: 0; border-top: 1px solid var(--line); border-radius: var(--radius); }
}

@container (max-width: 42rem) {
  table.grade tr { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  table.grade td:nth-child(2) { grid-column: span 1; }
  table.grade td:nth-last-child(-n+4) { border-bottom: 1px solid var(--line); }
  table.grade td:nth-last-child(-n+2) { border-bottom: 0; }
}

@media (max-width: 600px) {
  .quick-review-bar { top: .35rem; }
  .quick-review-nav, .quick-review-guidance { width: 100%; justify-content: space-between; }
  .updated-quote-preview__meta { grid-template-columns: minmax(0, 1fr); }
}

.swatch { display: inline-block; width: .9rem; height: .9rem; border-radius: .25rem;
          vertical-align: -.12rem; }
.swatch.over { background: var(--warn-wash-rest); border: 1px solid var(--warn-wash-line); }
.swatch.ok { background: var(--ok-wash-rest); border: 1px solid var(--ok-wash-line); }

table.activity td { font-size: var(--text-body); }
/* Each event is a two-row tbody: the readable row, then a full-width
   disclosure row for the recorded codes and ids (#1322). */
table.activity .activity-detail-row td { padding-top: 0; border-top: 0; }
table.activity .activity-detail-row pre { max-width: none; }

/* Exact-printing picker under buylist grading. Native <select> options cannot
   carry thumbnails or a separate external link, so each result is one radio
   row: the label chooses it and View card opens the source printing. */
.sku-search-heading { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.sku-search-heading input { flex: 1 1 22rem; }
.sku-option-picker {
  display: grid; gap: .4rem; max-height: 28rem; overflow-y: auto;
  padding: .35rem; border: 1px solid var(--line); border-radius: var(--radius);
}
.sku-choice {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  gap: .6rem; align-items: center; padding: .45rem .55rem;
  border: 1px solid transparent; border-radius: var(--radius-sm);
}
.sku-choice:hover { background: var(--surface-alt); }
.sku-choice:has(input:checked) { background: var(--accent-soft); border-color: var(--accent); }
.sku-choice label { display: flex; gap: .65rem; align-items: center; cursor: pointer; min-width: 0; }
.sku-choice label > span { display: grid; min-width: 0; }
.sku-choice-thumb { width: 44px; border-radius: 4px; box-shadow: 0 1px 3px rgba(26, 26, 26, .25); }
.sku-option-picker.hide-thumbs .sku-choice-thumb { display: none; }
.sku-choice > a { white-space: nowrap; }
@media (max-width: 600px) {
  .sku-choice { grid-template-columns: auto minmax(0, 1fr); }
  .sku-choice > a { grid-column: 2; }
}

/* Price-move colours read as meaning, not decoration (see --move-* tokens). */
.delta-down { color: var(--move-down); font-weight: 600; }
.delta-up { color: var(--move-up); font-weight: 600; }
.delta-flat { color: var(--move-flat); font-weight: 600; }
td code { overflow-wrap: anywhere; font-size: .85em; }

/* ---- Price-rules form --------------------------------------------------- */

table.rule-form th { width: 8rem; font-weight: 600; vertical-align: top; padding-top: .8rem;
                     text-transform: none; letter-spacing: 0; font-size: .95rem;
                     position: static; background: transparent; }
table.rule-form input[type=text], table.rule-form input[type=number] { width: 6rem; }
table.rule-form select[multiple] { min-width: 18rem; }
table.rule-form ul { list-style: none; margin: 0; padding: 0; columns: 2; }

/* ---- Empty states ------------------------------------------------------ */

.empty {
  text-align: center; color: var(--muted);
  padding: 2.2rem 1rem; margin: .8rem 0;
  background: var(--surface); border: 1px dashed var(--empty-line); border-radius: var(--radius);
}
.empty strong { color: var(--ink-soft); }

/* ---- Print: pull sheets become paper pick lists ------------------------ */

@media print {
  .topbar, .flash, button, form { display: none !important; }
  body { background: #fff; font-size: 12px; }
  /* Paper sets its own size: the screen density tokens (--text-body, and the
     shelf override a pull sheet carries) must not follow the sheet to print. */
  body > main { width: 100%; max-width: none; padding: 0; font-size: 12px; }
  table, .container-group { box-shadow: none; border-color: #999; break-inside: avoid; }
  a { color: inherit; text-decoration: none; }
  /* the hand-checkable box replacing the Picked button (screen: hidden) */
  td .print-check { display: inline; }
  td .print-check::before { content: "☐"; font-size: 1.15rem; }
}
.print-check { display: none; }

/* The rule form's 4-column table linearizes on phones */
@media (max-width: 780px) {
  table.rule-form, table.rule-form tbody, table.rule-form tr,
  table.rule-form th, table.rule-form td { display: block; width: auto; }
  table.rule-form th { padding: .7rem 0 0; border: none; }
  table.rule-form td { border: none; padding: .15rem 0 .45rem; }
  table.rule-form select[multiple] { min-width: 0; width: 100%; }
}

/* ---- Dashboard (Phase C) — appended section ----------------------------
   KPI cards + action chips for /staff/. New styles get APPENDED as whole
   commented sections like this one, so concurrent edits to earlier
   sections never collide. */

.dash-grid {
  display: grid;
  /* Dashboard panels contain real data tables. A 21rem auto-fit admitted a
     third column before those tables could wrap, which made the whole staff
     page pan sideways around tablet/laptop widths. */
  grid-template-columns: repeat(auto-fit, minmax(min(32rem, 100%), 1fr));
  gap: 1rem;
  align-items: start;
}
.dash-grid .container-group { margin: 0; }

.kpi-row { display: flex; flex-wrap: wrap; gap: .8rem; margin: .4rem 0 .6rem; }
.kpi {
  display: flex; flex-direction: column; gap: .15rem;
  min-width: 10rem; padding: .6rem .9rem;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.kpi .kpi-value { font-size: 1.45rem; font-weight: 700; font-variant-numeric: tabular-nums; }
/* Optional micro-label under a value; money tiles can carry an accent so the
   dollar figures stand apart from plain counts. */
.kpi .kpi-label { font-size: .69rem; font-weight: 600; text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); }
.kpi.is-money .kpi-value { color: var(--ok); }
.kpi.is-accent .kpi-value { color: var(--accent); }

.chip-row { display: flex; flex-wrap: wrap; gap: .6rem; margin: .6rem 0 1rem; }
.chip {
  display: inline-flex; align-items: center; gap: .45rem;
  padding: .35rem .85rem; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--chip-line);
  color: var(--ink-soft); text-decoration: none; font-size: var(--text-body);
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip .count {
  font-weight: 700; font-variant-numeric: tabular-nums;
  padding: 0 .5rem; border-radius: 999px; background: var(--neutral-fill);
}
/* nonzero queue: pull the eye without shouting */
.chip.attn { border-color: var(--accent); }
.chip.attn .count { background: var(--accent-soft); color: var(--accent); }

.workboard { margin: 0 0 1rem; }
.workboard .section-heading h2 { margin-bottom: .2rem; }
.workboard .section-heading p { margin: 0 0 .7rem; }
.workboard-filters {
  display: flex; flex-wrap: wrap; align-items: center; gap: .45rem;
  margin: 0 0 .75rem;
}
.workboard-filters > strong { margin-right: .2rem; }
.workboard-filters .chip {
  cursor: pointer; font: inherit;
}
.workboard-filters .chip[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--accent);
}
.workboard-filter-status {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.workboard-list { display: grid; gap: .45rem; }
.workboard-row {
  display: grid;
  grid-template-columns: minmax(15rem, 1fr) 4.5rem 7rem 8rem auto;
  align-items: center; gap: .7rem;
  padding: .65rem .7rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.workboard-row[hidden] { display: none; }
.workboard-row.has-work { border-left: 4px solid var(--accent); background: var(--surface); }
.workboard-main, .workboard-stat { display: flex; flex-direction: column; gap: .08rem; min-width: 0; }
.workboard-main .muted { font-size: .86rem; }
.workboard-title { display: flex; align-items: center; gap: .4rem; }
.workboard-help { position: relative; flex: 0 0 auto; }
.workboard-help > summary {
  display: grid; place-items: center;
  width: 1.25rem; height: 1.25rem; border: 1px solid var(--chip-line);
  border-radius: 50%; color: var(--accent); background: var(--surface);
  cursor: pointer; font-size: .78rem; font-weight: 800; list-style: none;
}
.workboard-help > summary::-webkit-details-marker { display: none; }
.workboard-help > summary:hover,
.workboard-help > summary:focus-visible { border-color: var(--accent); }
.workboard-help__body {
  position: absolute; z-index: 20; left: 0; top: calc(100% + .4rem);
  width: min(28rem, calc(100vw - 3rem)); padding: .7rem .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow);
  font-size: .88rem; font-weight: 400; line-height: 1.45;
}
.workboard-label {
  color: var(--muted); font-size: .68rem; font-weight: 700;
  letter-spacing: .05em; text-transform: uppercase;
}
.workboard-stat strong { font-size: .9rem; font-variant-numeric: tabular-nums; }
.workboard-row > .btn { justify-self: end; white-space: nowrap; }

@media (max-width: 850px) {
  .workboard-row { grid-template-columns: repeat(3, 1fr); }
  .workboard-main { grid-column: 1 / -1; }
  .workboard-row > .btn { grid-column: 1 / -1; justify-self: stretch; text-align: center; }
  .workboard-help__body {
    position: fixed; left: 1rem; right: 1rem; top: auto; bottom: 1rem; width: auto;
  }
}

.report-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 19rem), 1fr));
  gap: 1rem;
}
.report-card { display: flex; flex-direction: column; margin: 0; }
.report-card__heading {
  display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem;
}
.report-card__heading h2 { margin: 0; }
.report-card > p:last-child { margin-top: auto; margin-bottom: 0; padding-top: .5rem; }

/* ---- Filter bars (Phase D: inventory browser + activity log) -----------
   Appended as a unit (same rule as the dashboard section above): one GET
   form holding a search box, dropdowns, range pairs, and toggles that wraps
   cleanly on phones. Reuses form.searchbar's flex layout. */

form.filterbar select { max-width: 11rem; }
form.filterbar input[type=number] { width: 5.2rem; }
form.filterbar input[type=date] { font: inherit; font-size: var(--text-body); padding: var(--pad-field);
  border: 1px solid var(--control-line); border-radius: .55rem; background: var(--surface); }
form.filterbar input.tiny { width: 4rem; }
form.filterbar .range { display: inline-flex; align-items: center; gap: .25rem;
  color: var(--muted); white-space: nowrap; }
form.filterbar label.toggle { display: inline-flex; align-items: center; gap: .35rem;
  color: var(--ink-soft); font-size: var(--text-sm); white-space: nowrap; }

/* CSV import preview verdicts (/staff/import/): matched = good to commit,
   ambiguous = commits with a caveat, unknown/rejected = never commits. These
   now share the single pill vocabulary — see the .badge role aliases above. */

/* ---- Inventory condition strip (review-1 item I6) ----------------------
   The inventory browser now shows one row per printing (card + finish +
   language) with its conditions inline, BinderPOS-style, instead of one row
   per condition. This is the compact per-condition qty/price cluster in that
   row's Conditions cell: one small stacked cell per condition IN STOCK
   (NM→DM), wrapping onto a second line on narrow phone screens. Appended as a
   whole unit, same rule as the sections above so concurrent edits never
   collide. */
.cond-strip { display: flex; flex-wrap: wrap; gap: .3rem; }
.cond {
  display: inline-flex; flex-direction: column; align-items: center;
  min-width: 3.1rem; padding: .12rem .35rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-alt); line-height: 1.2;
}
.cond .cond-code {
  font-size: .66rem; font-weight: 700; letter-spacing: .05em;
  text-transform: uppercase; color: var(--ink-soft);
}
.cond .cond-qty { font-weight: 700; font-variant-numeric: tabular-nums; }
.cond .cond-price { font-size: .82rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* Grade cells carry their semantic colour (NM green → DM red) so a bad-
   condition copy is spottable without reading the code. Template emits
   `class="cond cond-<code>"`, code lower-cased. */
.cond-nm { background: var(--cond-nm-soft); border-color: var(--cond-nm-line); }
.cond-nm .cond-code { color: var(--cond-nm); }
.cond-lp { background: var(--cond-lp-soft); border-color: var(--cond-lp-line); }
.cond-lp .cond-code { color: var(--cond-lp); }
.cond-mp { background: var(--cond-mp-soft); border-color: var(--cond-mp-line); }
.cond-mp .cond-code { color: var(--cond-mp); }
.cond-hp { background: var(--cond-hp-soft); border-color: var(--cond-hp-line); }
.cond-hp .cond-code { color: var(--cond-hp); }
.cond-dm { background: var(--cond-dm-soft); border-color: var(--cond-dm-line); }
.cond-dm .cond-code { color: var(--cond-dm); }

/* ── Signature components. Phase 2 wires .panel and .btn-hero into the
   chaos put-away walkthrough (templates/chaos/putaway.html + the
   intake_detail entry); Phase 3 (guided picking) reuses the same vocabulary.
   NB: never let a star-slash pair appear inside comment prose — ".panel*"
   followed by "/" once ended this comment early, and the resulting garbage
   made the parser drop the entire .panel rule that follows. ── */

/* ---- Colored section-header panels (Phase 1 redesign) ------------------
   The signature card: a solid tinted header bar (icon + label, white text)
   over a neutral body. Header colour encodes the section's role so staff read
   intent at a glance — info/product blue, action-needed amber, confirm/
   location green. Phases 2–3 build the put-away / pick flows from these, so
   the markup shape is fixed:
     <section class="panel">
       <div class="panel-head is-action"><span class="ico">⚑</span>Label</div>
       <div class="panel-body"> … </div>
     </section>
   Appended as a whole unit so concurrent edits to earlier sections never
   collide. */
.panel {
  margin-top: 1.4rem; overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.panel-head {
  display: flex; align-items: center; gap: .5rem;
  min-height: 36px; padding: .35rem .9rem;
  color: var(--panel-text); font-weight: 600; letter-spacing: .01em;
  background: var(--panel-info);   /* default role = info / blue */
}
.panel-head .ico { font-size: 1.05em; line-height: 1; opacity: .95; }
.panel-head.is-info { background: var(--panel-info); }
.panel-head.is-action { background: var(--panel-action); }
.panel-head.is-confirm { background: var(--panel-confirm); }
.panel-body { padding: var(--pad-card); }
.panel-body > :first-child { margin-top: 0; }
.panel-body table { box-shadow: none; }
.credit-merge-candidate {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(18rem, 1fr);
  gap: 1rem; align-items: start; padding: .9rem 0;
  border-top: 1px solid var(--line);
}
.credit-merge-candidate form { display: grid; gap: .5rem; }
@media (max-width: 760px) {
  .credit-merge-candidate { grid-template-columns: 1fr; }
}

/* ---- One hero CTA per screen -------------------------------------------
   Restraint is the point: at most one .btn-hero per screen for the primary
   action; everything else stays solid or ghost (button.primary, .btn). This
   is the Polaris primary (ADR-0088) — near-black with an inset top highlight
   in light, inverted to light-on-dark in the dark theme, as the admin does.
   Its text is --panel-text (white) in light and --on-accent in dark. */
.btn-hero {
  border: 0; color: var(--panel-text);
  background: linear-gradient(180deg, var(--btn-primary), var(--chrome-end));
  box-shadow: inset 0 1px 0 var(--chrome-hover), var(--shadow);
}
.btn-hero:hover {
  background: linear-gradient(180deg, var(--hero-stop), var(--btn-primary));
}
[data-theme="dark"] .btn-hero {
  color: var(--on-accent);
  background: var(--btn-primary);
  box-shadow: var(--shadow);
}
[data-theme="dark"] .btn-hero:hover { background: var(--btn-primary-hover); }

/* ---- Guided put-away walkthrough (Phase 2) -----------------------------
   Phone-first: staff run this one bin at a time on a handset, so the card
   image and confirm button want to be big and thumb-reachable. */
.putaway-progress { margin: .3rem 0 0; font-weight: 600; }
.putaway-slice { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.putaway-slice-body { flex: 1 1 16rem; min-width: 0; }
.card-shot {
  width: 8rem; max-width: 34vw; aspect-ratio: 5 / 7;
  object-fit: cover; border-radius: .5rem; background: var(--surface-alt);
  box-shadow: var(--shadow);
}
.card-shot.noshot { display: grid; place-items: center; color: var(--placeholder); font-size: 2.2rem; }
.putaway-cards { margin-top: .6rem; }
.putaway-cards summary { cursor: pointer; font-weight: 600; color: var(--accent); }
/* The one hero per screen: full-width tap target on phones. */
.putaway-confirm { display: block; width: 100%; padding-block: .7rem; margin-top: 1rem; }

/* ── Guided picking + batch print (Phase 3) ──────────────────────────────
   The pick walk reuses the .panel vocabulary (info product / confirm location /
   action pick) and .card-shot from put-away; only the progress bar, the order-
   slot emphasis, and the printed two-format batch sheet are new here. Appended
   as a whole unit so concurrent edits to earlier sections never collide. */
.pick-progress { margin: .3rem 0 .3rem; font-weight: 600; }
.progress-track {
  height: .5rem; border-radius: 999px; background: var(--surface-alt);
  border: 1px solid var(--line); overflow: hidden; margin-bottom: .4rem;
}
.progress-fill { height: 100%; background: var(--accent); transition: width .2s ease; }

.pick-card { display: flex; gap: 1rem; align-items: flex-start; flex-wrap: wrap; }
.pick-card-body { flex: 1 1 15rem; min-width: 0; }
.pick-meta { margin: 0 0 .3rem; }
.pick-qty { margin: 0; font-size: 1.1rem; }

/* The batch drop-slot: the pigeonhole number a picker drops the card into —
   big enough to read at arm's length on a phone. */
.slot-big { margin: 0 0 .6rem; font-size: 1.1rem; }
.slot-num {
  display: inline-block; padding: .1rem .6rem; border-radius: var(--radius-sm);
  background: var(--accent-soft); color: var(--accent); font-weight: 700;
}

/* ---- The printed pull sheet (Pulling v2 P4, docs/specs/pulling-v2.md §3).
   Two halves on one page. The alpha wall reproduces the Shopify "Picklist
   Printer" sheet staff already know cold — one bordered table, a centred
   set-name band per set, Order / Q / Item / Price columns — so the only new
   thing to learn is the chaos half below it, which adopts the same density
   with a real type hierarchy. Pen-and-paper only: no card images, nothing
   tappable. The screen rendering is the same layout, because this page
   doubles as the pre-print preview.

   Sizes are declared PER ELEMENT, never by scaling .pick-print as a whole:
   the old flat `font-size: 11px` is exactly what made the set line read as
   loud as the card name (owner complaint C). */
.batch-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1.2rem;
  padding: .7rem 1rem; margin-bottom: 1rem;
  border: 2px solid var(--ink); border-radius: var(--radius);
}
.batch-code { font-size: 1.8rem; font-weight: 800; letter-spacing: .04em; }
/* #1425: the header is one summary line ("Batch 2 · 30 orders · 309 cards"),
   longer than the bare name, so it steps down a size. */
.batch-summary { font-size: 1.4rem; }
/* #1425: the trailing Other Items table sits apart from the card sections. */
.print-other-items { margin-top: 1rem; }
.batch-identification { display: flex; align-items: center; gap: .6rem; }
.batch-qr { width: 64px; height: 64px; image-rendering: pixelated; }
.batch-reference { color: var(--ink-soft); font-size: .85rem; font-weight: 650; }
.batch-counts { display: flex; gap: 1rem; font-variant-numeric: tabular-nums; }
.slot-legend {
  flex: 1 1 100%; font-size: .85rem; color: var(--ink-soft);
  border-top: 1px dashed var(--line); padding-top: .4rem;
}
/* #1475: the walk's batch legend is a list, one order per line. Two grid
   columns shared by every line (subgrid): the order text, as wide as the
   longest one, then "Mark order picked" right after it — aligned, and close
   to the order it marks (staff, 2026-11-13: the far edge was too far). On a
   narrow phone the text column shrinks and wraps instead of overflowing. */
ul.slot-legend {
  list-style: none; margin: 0 0 .75rem; padding-left: 0;
  display: grid; grid-template-columns: minmax(0, max-content) max-content;
  column-gap: 1rem; row-gap: .4rem; align-items: center;
}
.slot-legend .slot-legend-item {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: center;
}

.print-section { margin-top: 1rem; }
/* A set band never separates from its rows, and a bin never splits: both are
   one <tbody>/<div> the page break must jump over. */
.set-group, .wms-bin { break-inside: avoid; margin-bottom: .7rem; }

/* Alpha wall — the Shopify picklist clone. Thin borders everywhere, compact
   rows, the price hard right. */
table.picklist { width: 100%; border-collapse: collapse; }
table.picklist th, table.picklist td {
  border: 1px solid var(--ink); padding: .25rem .45rem;
  vertical-align: middle; line-height: 1.25;
}
table.picklist thead th {
  text-align: left; font-size: .78rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .05em;
}
table.picklist .pl-order { width: 7rem; white-space: nowrap; }
table.picklist .pl-qty {
  width: 2.6rem; text-align: center; font-variant-numeric: tabular-nums;
}
table.picklist .pl-price {
  width: 5rem; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
table.picklist tr.set-band td {
  text-align: center; font-weight: 700; font-size: .95rem;
  background: var(--surface-alt);
}
/* #1398: the wall is filed game → set → card; a sheet spanning games gets a
   game band above its sets — heavier than a set band so the two never read
   alike. */
table.picklist tr.game-band td, table tr.game-band th {
  text-align: left; font-weight: 800; font-size: 1.05rem; text-transform: uppercase;
  letter-spacing: .04em; border-top: 3px solid var(--ink);
}
h2.game-band, h3.game-band {
  text-transform: uppercase; letter-spacing: .04em;
  border-bottom: 3px solid var(--ink); padding-bottom: .15rem;
}
table.picklist tr.pl-row td { height: 2.4em; }
/* Order Printer shades a quantity above one so a picker cannot read "2x"
   as "1x" at arm's length (#1276). */
table.picklist .pl-qty--multi { background: var(--surface-alt); font-weight: 700; }
.pl-item strong { font-weight: 700; }
.pl-item em { font-style: italic; }
/* #1406: every condition on every print row in italics, NM as much as LP. */
.pl-cond { font-style: italic; }
/* #1425 (owner, 2026-11-04): anything but Near Mint must jump off the page —
   bold and a size larger; a finish other than non-foil prints bold. Near Mint
   non-foil stays plain. */
.pl-cond--flag { font-weight: 700; font-size: 1.2em; }
.pl-finish--flag { font-weight: 700; }
.print-options { flex: 1 1 100%; display: flex; flex-wrap: wrap; gap: .4rem; margin: 0; }
.print-options .btn.current { font-weight: 700; }
.print-order-group { margin-top: 1.2rem; }
.print-order-head { border-bottom: 2px solid var(--ink); padding-bottom: .15rem; }

/* Chaos bins — same density family, but the card name is the dominant thing
   on the row and the set line sits under it, small and muted. */
table.wms { width: 100%; border-collapse: collapse; }
table.wms td {
  padding: .22rem .4rem; vertical-align: top;
  border-bottom: 1px solid var(--line);
}
.wms-check {
  display: inline-block; width: 1rem; height: 1rem;
  border: 1.5px solid var(--ink); border-radius: 2px;
}
.wms-check-cell { width: 1.7rem; }
.wms-qty {
  width: 2.6rem; text-align: right; white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* #1406: bold only when there is more than one copy to pull — a bold "×1" on
   every row made the rows that matter read like all the others. */
.wms-qty--multi { font-weight: 700; }
.wms-card { font-weight: 700; font-size: 1rem; line-height: 1.2; }
.wms-meta { font-size: .8rem; color: var(--muted); line-height: 1.25; }
.wms-aid { font-size: .8rem; line-height: 1.25; }
.wms-price {
  width: 5rem; text-align: right; white-space: nowrap;
  font-size: .8rem; font-variant-numeric: tabular-nums;
}
.slot-cell { font-weight: 700; white-space: nowrap; }
.wms-notes { margin: .1rem 0 .3rem; color: var(--muted); font-size: .85rem; }

@media print {
  .no-print { display: none !important; }
  .batch-head { border-color: #000; }
  /* The print type scale. Everything is black on white; the hierarchy is
     carried by size and weight, not by colour or a shaded band (browsers
     drop backgrounds by default when printing). */
  .pick-print { color: #000; }
  .pick-print .batch-code { font-size: 16px; }
  .pick-print .batch-qr { width: 54px; height: 54px; }
  .pick-print .batch-reference { font-size: 9px; color: #000; }
  .pick-print .batch-counts, .pick-print .claim-stamp { font-size: 10px; }
  .pick-print h2 { font-size: 12px; margin: .5rem 0 .25rem; }
  .pick-print h2 small, .pick-print h3 small { font-size: 9px; }
  .pick-print h3 { font-size: 12px; margin: .35rem 0 .15rem; }
  .pick-print .path { font-size: 9px; color: #000; }
  /* #1425 (owner, 2026-11-04): the row type is sized so about 20 rows fill
     a US Letter page at 100% — the density of the store's collated sheet. */
  .pick-print table.picklist th, .pick-print table.picklist td {
    border-color: #000; padding: .2rem .4rem; font-size: 15px;
  }
  .pick-print table.picklist thead th { font-size: 11px; }
  .pick-print table.picklist tr.set-band td { font-size: 14px; background: none; }
  .pick-print table.picklist .pl-price { font-size: 13px; }
  .pick-print table.wms td { border-bottom-color: #000; padding: .2rem .4rem; }
  .pick-print .wms-card { font-size: 15px; }
  .pick-print .wms-meta, .pick-print .wms-aid, .pick-print .wms-price,
  .pick-print .wms-notes { font-size: 12px; color: #000; }
  .pick-print .wms-qty, .pick-print .slot-cell { font-size: 14px; }
  .pick-print .wms-check { border-color: #000; }
  /* #1406 — the first page's blank space. The generic print rule above
     (`table, .container-group { break-inside: avoid }`) also caught the whole
     alpha-wall table, so a wall taller than what was left of page one under
     the batch header jumped to page two and left page one empty below the
     header. The table may break; each set (<tbody class="set-group">) and
     each bin still never splits, and the header row repeats on every page. */
  .pick-print table.picklist, .pick-print table.wms { break-inside: auto; }
  .pick-print table.picklist thead { display: table-header-group; }
  .pick-print h2 { break-after: avoid; }
}

/* ---- Print-time pick reservations (v0.18) — appended section ------------
   Claim stamp on the printed batch sheet, resolved-line markers (a reprint
   must not read as fresh work), and the walk's claim/void control strip.
   Appended as a whole unit so concurrent edits to earlier sections never
   collide. */
.claim-stamp { font-size: .85rem; font-weight: 600; color: var(--ink-soft); white-space: nowrap; }
.batch-claim-controls { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
/* #1475: these were <p>s, which a <form> inside cannot be; as <div>s they keep
   the paragraph spacing they had. */
.batch-claim-controls, .pull-desk-actions, .handoff-gift,
.handoff-ready { margin: 1em 0; }
.wms-done { display: inline-block; min-width: 1.05rem; text-align: center; font-weight: 700; }
tr.resolved td { color: var(--muted); text-decoration: line-through; }
tr.resolved td.wms-check-cell { text-decoration: none; }
@media print { .claim-stamp { color: #000; } }

/* ---- One-order pull-sheet print document (#94) -------------------------
   This is intentionally separate from the multi-order batch sheet above:
   Shopify's order Print menu needs one order, while the batch layout carries
   slots. Keep the print rules element-specific so a browser/PDF printer does
   not flatten the card, condition, and location hierarchy. */
.single-pull-print { max-width: 68rem; }
.single-pull-head {
  display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1.25rem;
  border: 2px solid var(--ink); border-radius: var(--radius); padding: .8rem 1rem;
}
.single-pull-head h1 { margin: 0; font-size: 1.8rem; }
/* D5 on paper: whose pile this is, beside the order number (#1276). */
.single-pull-customer { font-weight: 600; color: var(--ink-soft); }
.single-pull-kicker, .single-pull-subtitle { margin: 0; color: var(--ink-soft); }
.single-pull-kicker { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.single-pull-summary { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-left: auto; font-variant-numeric: tabular-nums; }
.print-attention { color: var(--danger); font-weight: 700; }
.single-pull-notice { margin: .7rem 0; color: var(--ink-soft); font-size: .88rem; }
.single-pull-section { margin-top: 1.1rem; break-inside: avoid; }
.single-pull-section h2 { margin: 0; font-size: 1.2rem; }
.single-pull-section h2 small { color: var(--muted); font-size: .78rem; font-weight: 500; }
.single-pull-section .path { margin: .15rem 0 .35rem; }
.single-pull-section--attention h2, .single-pull-warning { color: var(--danger); }
.single-pull-warning { margin: .3rem 0 .45rem; font-size: .87rem; }
table.single-pull-table { width: 100%; border-collapse: collapse; }
table.single-pull-table th, table.single-pull-table td { border: 1px solid var(--line); padding: .34rem .45rem; vertical-align: top; }
table.single-pull-table th { background: var(--surface-alt); font-size: .76rem; letter-spacing: .04em; text-align: left; text-transform: uppercase; }
table.single-pull-table tr { break-inside: avoid; }
.single-pull-state { width: 7.2rem; }
.single-pull-state small { color: var(--muted); }
.single-pull-check { display: inline-block; width: 1rem; height: 1rem; border: 1.5px solid var(--ink); border-radius: 2px; margin-right: .35rem; vertical-align: -.12rem; }
.single-pull-qty { width: 3.2rem; text-align: right; white-space: nowrap; }
.single-pull-qty--multi { font-weight: 700; }
.single-pull-card { font-size: 1rem; line-height: 1.2; }
.single-pull-meta { color: var(--ink-soft); font-size: .82rem; line-height: 1.3; }
.single-pull-location { min-width: 9rem; font-weight: 700; }
.single-pull-location .depth { color: var(--muted); font-size: .78rem; font-weight: 400; }

@media print {
  @page { margin: 10mm 9mm; }
  .single-pull-print { max-width: none; color: #000; }
  .single-pull-head { border-color: #000; border-radius: 0; padding: 5mm 6mm; }
  .single-pull-head h1 { font-size: 18px; }
  .single-pull-kicker { font-size: 8px; }
  .single-pull-subtitle, .single-pull-notice { color: #000; font-size: 9px; }
  .single-pull-summary { font-size: 10px; }
  /* #1406: the same blank-first-page cause as the batch sheet — a whole
     section held together (break-inside: avoid) jumped to page two whenever
     it was taller than the space left under the header. Sections may break;
     their set groups and table rows still never split. */
  .single-pull-section { margin-top: 6mm; break-inside: auto; }
  .single-pull-section h2 { break-after: avoid; }
  .single-pull-section h2 { font-size: 13px; }
  table.single-pull-table { page-break-inside: auto; }
  table.single-pull-table thead { display: table-header-group; }
  table.single-pull-table th, table.single-pull-table td { border-color: #000; padding: 2px 3px; }
  table.single-pull-table th { background: none; font-size: 8px; }
  table.single-pull-table td { font-size: 10px; }
  .single-pull-card { font-size: 12px; }
  .single-pull-meta, .single-pull-location .depth, .single-pull-state small { color: #000; font-size: 8px; }
  .single-pull-section--attention h2, .single-pull-warning, .print-attention { color: #000; }
  .single-pull-check { border-color: #000; }
  .single-pull-customer { color: #000; font-size: 15px; }
  /* The alphabetized wall's Order Printer table, at the same printed density
     as the batch picklist (#1276) — the .pick-print rules above are scoped to
     the batch sheet, so the one-order sheet needs its own copy. */
  .single-pull-print table.picklist { page-break-inside: auto; }
  .single-pull-print table.picklist thead { display: table-header-group; }
  .single-pull-print table.picklist th, .single-pull-print table.picklist td {
    border-color: #000; padding: .2rem .4rem; font-size: 15px;
  }
  .single-pull-print table.picklist thead th { font-size: 11px; background: none; }
  .single-pull-print table.picklist tr.set-band td { font-size: 14px; background: none; }
  /* The one shaded cell that must SURVIVE printing: it is the only
     difference between pulling one copy and pulling three. Explicit
     grey (not a theme token) plus print-color-adjust so a browser
     dropping background graphics keeps it. Every printed pick list —
     this one-order sheet and the batch sheet (#1483: its shading was
     dropped on paper) — shares the rule. */
  table.picklist .pl-qty--multi {
    background: #e2e2e2; -webkit-print-color-adjust: exact; print-color-adjust: exact;
  }
  .single-pull-print table.picklist .pl-price { font-size: 13px; }
  .screen-only { display: none; }
}

/* ---- Staff requests and safe Codex handoff queue (v0.31) --------------
   Requests are cards rather than a wide table: reports contain prose, flags,
   screenshots and actions that must reflow on phones without horizontal
   scrolling. The fixed launcher is intentionally modest but always reachable. */
.request-launcher {
  position: fixed; right: .8rem; bottom: .8rem; z-index: 38;
  padding: .55rem .8rem; border-radius: var(--radius);
  background: var(--chrome-end); color: var(--chrome-text); text-decoration: none;
  font-weight: 650; line-height: 1.15; box-shadow: var(--shadow-raised);
}
.request-launcher span { color: var(--chrome-muted); font-size: .78rem; font-weight: 500; }
.request-launcher:hover { color: var(--chrome-text); transform: translateY(-1px); }
/* Phones reach it from the Menu drawer instead (owner decision 11, #1322). */
@media (max-width: 560px) {
  .request-launcher.has-drawer-entry { display: none; }
}

.page-head {
  display: flex; flex-wrap: wrap; align-items: flex-start;
  justify-content: space-between; gap: .8rem; margin-bottom: 1rem;
}
.page-head h1 { margin-top: 0; }
.page-head .actions { margin-top: .15rem; }
.eyebrow {
  margin: 0; color: var(--accent); font-size: .78rem; font-weight: 750;
  letter-spacing: .08em; text-transform: uppercase;
}
.request-status { font-size: .9rem; }
.request-privacy, .request-risk-banner {
  margin: 1rem 0; padding: .8rem 1rem; border-radius: var(--radius);
  border: 1px solid var(--line); background: var(--accent-soft);
}
.request-risk-banner { background: var(--amber-soft); border-color: var(--request-risk-line); }

.request-form, .request-section {
  padding: 1rem; margin: 1rem 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.request-form-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .9rem;
}
.request-form-grid .full { grid-column: 1 / -1; }
.field label, .request-form label, .stack-form label { display: block; font-weight: 650; }
.field input:not([type="file"]), .field textarea, .field select,
.request-section textarea, .request-section input:not([type="checkbox"]),
.request-section select { width: 100%; max-width: 100%; }
.field textarea { resize: vertical; }
.help { margin: .2rem 0 0; }
.field-error { margin: .2rem 0; color: var(--warn); font-weight: 600; }

.request-filters { display: flex; flex-wrap: wrap; align-items: end; gap: .6rem; }
.request-filters label:not(.check) { display: grid; gap: .2rem; }
.request-filters .check { padding-bottom: .4rem; }
.request-list { display: grid; gap: .7rem; margin: 1rem 0; }
.request-card {
  display: grid; gap: .25rem; min-width: 0; padding: .85rem 1rem;
  color: var(--ink); text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.request-card:hover { box-shadow: var(--shadow-raised); text-decoration: none; }
.request-card.high-impact { border-left-color: var(--amber); }
.request-card-top {
  display: flex; flex-wrap: wrap; align-items: center;
  justify-content: space-between; gap: .45rem;
}
.request-ref { color: var(--accent); font-weight: 750; letter-spacing: .03em; }
.risk-pill {
  display: inline-flex; width: fit-content; padding: .12rem .45rem;
  border-radius: 999px; color: var(--request-severity-text); background: var(--amber-soft);
  font-size: .76rem; font-weight: 700;
}

.request-section > h2 { margin-top: 0; }
.admin-actions, .admin-actions form, .inline-form, .actions {
  display: flex; flex-wrap: wrap; align-items: end; gap: .55rem;
}
.admin-actions form { padding: .25rem 0; }
.claim-grid, .flag-grid, .attachment-grid, .context-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .7rem;
}
.claim-grid article, .flag-card, .attachment-card, .context-grid p,
.comment-list article, .handoff-card {
  min-width: 0; margin: 0; padding: .8rem;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--surface-alt); overflow-wrap: anywhere;
}
.claim-grid h3 { color: var(--ink-soft); }
.flag-card { border-left: 4px solid var(--amber); }
.flag-card.state-confirmed { border-left-color: var(--warn); }
.flag-card.state-dismissed { border-left-color: var(--muted); opacity: .75; }
.flag-evidence { padding: .5rem; border-radius: var(--radius-sm); background: var(--attachment-fill); }
.attachment-card { display: grid; gap: .4rem; align-content: start; }
.attachment-card img {
  display: block; width: 100%; max-height: 24rem; object-fit: contain;
  border-radius: var(--radius-sm); background: var(--attachment-fill);
}
.context-grid code { overflow-wrap: anywhere; white-space: normal; }
.admin-tool { margin-top: .8rem; }
.admin-tool summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.stack-form { display: grid; gap: .55rem; margin-top: .65rem; }
.stack-form p { margin: 0; }
.comment-list { display: grid; gap: .6rem; margin-bottom: 1rem; }
.comment-list p { margin-bottom: 0; }
.handoff-card { margin-bottom: .7rem; }
.handoff-card textarea {
  width: 100%; margin: .6rem 0; resize: vertical;
  font: .82rem/1.45 ui-monospace, SFMono-Regular, Menlo, monospace;
}
.history-list { display: grid; gap: .45rem; padding: 0; list-style: none; }
.history-list li {
  display: grid; grid-template-columns: 9rem 12rem minmax(0, 1fr); gap: .6rem;
  padding: .45rem .6rem; border-bottom: 1px solid var(--line);
}

/* ---- Friendly-language disclosure and storage lookup (UX pass 01) ---- */
.how-this-works {
  margin: -.2rem 0 1rem;
  color: var(--muted);
}
.how-this-works summary {
  width: fit-content;
  cursor: pointer;
  color: var(--accent);
  font-weight: 650;
}
.how-this-works__body {
  margin-top: .55rem;
  padding: .15rem .8rem;
  border-left: 3px solid var(--line);
}
.how-this-works__body > :first-child { margin-top: 0; }
.how-this-works__body > :last-child { margin-bottom: 0; }
.find-card-photo-cell { width: 5.5rem; }
.find-card-photo {
  display: block;
  width: 4.5rem;
  aspect-ratio: 5 / 7;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--surface-alt);
}
.field-help { margin: .45rem 0 .1rem; color: var(--muted); font-size: var(--text-sm); }
.bin-verification { min-height: 1.3rem; margin: .1rem 0 0; }
.cycle-count-start-grid {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem; align-items: start; margin: 1rem 0 1.5rem;
}
.cycle-count-start-grid .card { margin: 0; }
.cycle-count-start-grid .card > :first-child { margin-top: 0; }
.cycle-count-form {
  display: grid; grid-template-columns: minmax(8rem, .8fr) minmax(12rem, 1.2fr);
  gap: .4rem .65rem; align-items: center; margin-top: .8rem;
}
.cycle-count-form label { font-size: .88rem; font-weight: 700; color: var(--ink-soft); }
.cycle-count-form input, .cycle-count-form select { width: 100%; min-width: 0; }
.cycle-count-form button { grid-column: 2; justify-self: start; margin-top: .2rem; }
.cycle-audit-heading {
  display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between;
  gap: .75rem 1.5rem; margin-bottom: 1rem;
}
.cycle-audit-heading h1, .cycle-audit-heading p { margin-bottom: .25rem; }
.cycle-audit-progress { max-width: 42rem; }
.cycle-audit-progress > div:first-child {
  display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .45rem;
}
@media (max-width: 760px) {
  .cycle-count-start-grid { grid-template-columns: 1fr; }
  .cycle-count-form { grid-template-columns: 1fr; }
  .cycle-count-form button { grid-column: 1; }
}
.activity-raw-detail { margin-top: .25rem; color: var(--muted); font-size: .82rem; }
.activity-raw-detail summary { cursor: pointer; }
.activity-raw-detail pre {
  max-width: 34rem; max-height: 18rem; overflow: auto;
  margin: .35rem 0 0; padding: .55rem;
  background: var(--surface-alt); border: 1px solid var(--line);
  border-radius: var(--radius-sm); white-space: pre-wrap;
}
.activity-summary-section { margin: 1.25rem 0; }
.activity-summary-heading {
  display: flex; justify-content: space-between; align-items: end;
  gap: 1rem; flex-wrap: wrap;
}
.activity-summary-heading h2, .activity-summary-heading p { margin: 0; }
.activity-summary-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: .8rem; margin: .8rem 0 1.1rem;
}
.activity-summary-card {
  min-width: 0; padding: .85rem;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
}
.activity-summary-card.is-unusual { border-color: var(--warn-wash-line); }
.activity-summary-card header {
  display: flex; justify-content: space-between; align-items: start; gap: .65rem;
}
.activity-summary-card dl {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .55rem; margin: .8rem 0 0;
}
.activity-summary-card dl > div { min-width: 0; }
.activity-summary-card dt {
  min-height: 2.2em; color: var(--muted); font-size: .72rem;
  font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
}
.activity-summary-card dd {
  margin: .2rem 0 0; font-size: 1.25rem; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.activity-anomaly {
  margin: .75rem 0 0; padding: .65rem;
  color: var(--error-text); background: var(--warn-wash-rest);
  border: 1px solid var(--warn-wash-line); border-radius: var(--radius-sm);
}
.activity-system-breakdown { margin-top: .75rem; }
.activity-system-breakdown summary { cursor: pointer; color: var(--accent); }
.activity-system-breakdown ul { display: grid; gap: .4rem; padding-left: 1.1rem; }
.activity-system-breakdown li {
  display: flex; justify-content: space-between; gap: .75rem; flex-wrap: wrap;
}
.activity-system-breakdown li span { color: var(--muted); }

/* ---- Rules reading views and read-only card tester (UX pass 10) ---- */
.rules-reading-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(18rem, 22rem);
  align-items: start;
  gap: 1.2rem;
}
.rules-reading-layout > * { min-width: 0; }
.rules-precedence {
  margin: .7rem 0 1rem;
  color: var(--ink-soft);
}
.rule-game-section { margin: 1rem 0; }
.rule-reading-list { display: grid; gap: .65rem; }
.rule-reading-list.compact { margin-bottom: 1rem; }
.rule-reading-card {
  display: grid;
  grid-template-columns: 2.1rem minmax(0, 1fr);
  gap: .7rem;
  min-width: 0;
  padding: .8rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rule-reading-card.matched-rule {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-soft);
}
.rule-reading-card.inactive { opacity: .72; }
.rule-reading-card--bulk { grid-template-columns: minmax(0, 1fr); }
.rule-reading-order {
  display: grid;
  place-items: center;
  align-self: start;
  width: 2rem;
  min-height: 2rem;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: 999px;
  font-weight: 750;
}
.rule-reading-body { min-width: 0; }
.rule-reading-body > p { margin: .4rem 0 .55rem; overflow-wrap: anywhere; }
.rule-reading-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: .6rem;
}
.rule-reading-heading h3, .rule-reading-heading h4 { margin: 0; }
.rule-scope-chips {
  display: flex;
  flex-wrap: wrap;
  gap: .35rem;
}
.rule-scope-chips .filter-chip { cursor: default; }
.rule-ladder-row, .rule-flat-quantity {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .55rem;
  margin-top: .7rem;
}
.rule-ladder-sparkline {
  display: flex;
  align-items: end;
  gap: .2rem;
  height: 4rem;
  padding: .25rem .35rem .1rem;
  background: var(--surface-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rule-ladder-step {
  display: grid;
  grid-template-rows: 2.9rem .7rem;
  gap: .1rem;
  min-width: 1.45rem;
}
.rule-ladder-bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 2px;
  height: 2.9rem;
}
.rule-ladder-bar { width: .42rem; min-height: 0; border-radius: 2px 2px 0 0; }
.rule-ladder-bar.cash { background: var(--ink-soft); }
.rule-ladder-bar.credit { background: var(--accent); }
.rule-ladder-label {
  color: var(--muted);
  font-size: .62rem;
  line-height: .7rem;
  text-align: center;
}
.inactive-rule-list { margin-top: .8rem; }
.inactive-rule-list summary { cursor: pointer; color: var(--accent); font-weight: 650; }
.inactive-rule-list .rule-reading-card { margin-top: .55rem; }
.rules-test-panel {
  position: sticky;
  top: 7rem;
  min-width: 0;
  max-height: calc(100vh - 8rem);
  max-height: calc(100dvh - 8rem);
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.rules-test-panel h2 { margin-top: 0; }
.rules-test-panel:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}
.rules-test-panel input[type="search"],
.rules-test-panel select { width: 100%; }
.rule-test-choices {
  display: grid;
  gap: .35rem;
  max-height: 16rem;
  overflow-y: auto;
  margin: .55rem 0;
}
.rule-test-choice { grid-template-columns: auto minmax(0, 1fr); }
.rule-test-selectors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: .45rem;
  margin: .75rem 0;
}
.rule-test-result {
  margin-top: 1rem;
  padding-top: .8rem;
  border-top: 1px solid var(--line);
}
.rule-test-result:empty { display: none; }
.rule-test-result h3 { margin-top: 0; }
.rule-test-result dl { display: grid; gap: .45rem; }
.rule-test-result dl > div {
  display: grid;
  grid-template-columns: minmax(6.5rem, .8fr) minmax(0, 1.2fr);
  gap: .5rem;
  padding-bottom: .4rem;
  border-bottom: 1px solid var(--line);
}
.rule-test-result dt { color: var(--muted); font-size: .8rem; font-weight: 700; }
.rule-test-result dd { margin: 0; overflow-wrap: anywhere; }
.rule-game-picker {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
  gap: .7rem;
}
.rule-game-link {
  display: flex;
  justify-content: space-between;
  gap: .8rem;
  color: var(--ink);
  text-decoration: none;
}
.rule-game-link:hover { border-color: var(--accent); }

/* Buy-rules reading index (/staff/buylist/rules/): heading row with actions
   on the right, then one picker card per game. The template shipped against
   these classes in UX pass 11 but they were never defined, so the page
   rendered as a bare stack of inline links. */
.page-header {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: .75rem; flex-wrap: wrap; margin-bottom: .5rem;
}
.page-header h1 { margin-bottom: .25rem; }
.page-header .muted { margin: 0; }
.page-actions { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.game-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: .7rem;
}
.game-card {
  display: grid; gap: .15rem; align-content: start;
  margin-top: 0;  /* .container-group's stacking margin fights the grid gap */
  color: var(--ink); text-decoration: none;
}
.game-card h2 { font-size: 1.02rem; }
.game-card p { margin: 0; color: var(--muted); }
.game-card > span { color: var(--accent); font-weight: 600; font-size: .92rem; }
.game-card:hover { border-color: var(--accent); }

/* The draft queue reuses .workboard-row, whose five-column grid was sized
   for the Today workboard. A draft row has only title + status pill, so the
   pill landed in a 4.5rem column and wrapped into a circle. */
.draft-queue .workboard-row { grid-template-columns: minmax(0, 1fr) auto; }

@media (max-width: 980px) {
  .rules-reading-layout { grid-template-columns: minmax(0, 1fr); }
  .rules-test-panel {
    position: static;
    grid-row: 1;
    max-height: none;
    overflow-y: visible;
    overscroll-behavior: auto;
    scrollbar-gutter: auto;
  }
}

@media (max-width: 720px) {
  .request-form-grid, .claim-grid, .flag-grid, .attachment-grid, .context-grid {
    grid-template-columns: minmax(0, 1fr);
  }
  .request-form-grid .full { grid-column: auto; }
  .history-list li { grid-template-columns: 1fr; gap: .05rem; }
  .request-launcher { right: .5rem; bottom: .5rem; font-size: .86rem; }
  main { padding-bottom: 5rem; }
  .activity-summary-card dl { grid-template-columns: 1fr; }
  .activity-summary-card dt { min-height: 0; }
  .rule-test-selectors { grid-template-columns: minmax(0, 1fr); }
  .rule-reading-card { grid-template-columns: 1.8rem minmax(0, 1fr); padding: .65rem; }
  .rule-reading-order { width: 1.7rem; min-height: 1.7rem; }
  .rule-test-result dl > div { grid-template-columns: minmax(0, 1fr); gap: .1rem; }
}

/* UX pass 11 — guided rule drafts and Manager activation. */
.rules-authoring-toolbar,
.rule-editor-actions,
.rule-reading-actions,
.rule-editor-header,
.page-heading-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  flex-wrap: wrap;
}
.rules-authoring-toolbar { margin: 1rem 0 1.25rem; }
.rule-reading-actions { margin-top: .85rem; font-size: .92rem; }
.rule-editor-shell { max-width: 78rem; margin: 0 auto; }
.rule-editor-header,
.page-heading-row { justify-content: space-between; align-items: flex-start; }
.rule-guided-form { display: grid; gap: 1.25rem; }
.rule-guided-form fieldset {
  min-width: 0;
  margin: 0;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: .75rem;
}
.rule-guided-form legend { padding: 0 .4rem; font-weight: 800; }
.rule-editor-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
}
.rule-editor-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.rule-editor-field { min-width: 0; }
.rule-editor-field > label { display: block; margin-bottom: .35rem; font-weight: 700; }
.rule-editor-field input:not([type="checkbox"]),
.rule-editor-field select,
.rule-editor-field textarea { width: 100%; }
.rule-editor-field ul { list-style: none; margin: .35rem 0 0; padding: 0; }
.rule-editor-field ul label {
  display: flex;
  align-items: center;
  gap: .45rem;
  font-weight: 500;
}
.rule-editor-field.has-errors input,
.rule-editor-field.has-errors select,
.rule-editor-field.has-errors textarea { border-color: var(--danger-strong); }
.field-error { color: var(--danger-strong); margin: .3rem 0 0; font-weight: 700; }
.rule-scope-card-field { grid-column: span 2; }
.rule-scope-card-choices { max-height: 13rem; }
.rule-editor-test-panel {
  position: static;
  margin-top: 1.25rem;
  padding: 1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.rule-editor-test-panel h2 { margin-top: 0; }
.rule-editor-test-panel input[type="search"],
.rule-editor-test-panel select { width: 100%; }
.rule-step-editor { display: grid; gap: .7rem; }
.rule-step-row {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr .7fr;
  gap: .75rem;
  align-items: start;
  padding: .75rem;
  border-radius: .65rem;
  background: var(--surface-alt);
}
.rule-step-preview {
  display: flex;
  align-items: end;
  gap: .5rem;
  min-height: 5rem;
  margin-top: .8rem;
  padding: .55rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}
.rule-step-preview__step {
  display: grid;
  grid-template-rows: 3.5rem auto;
  gap: .2rem;
  min-width: 2.6rem;
  text-align: center;
  font-size: .75rem;
}
.rule-step-preview__bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: .18rem;
}
.rule-step-preview__bar {
  display: block;
  width: .65rem;
  min-height: 2px;
  border-radius: .2rem .2rem 0 0;
}
.rule-step-preview__bar.cash { background: var(--accent); }
.rule-step-preview__bar.credit { background: var(--ok); }
.rule-payload-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: .7rem 1rem;
}
.rule-payload-list > div {
  min-width: 0;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
}
.rule-payload-list dt {
  color: var(--muted);
  font-size: .8rem;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.rule-payload-list dd { margin: .25rem 0 0; overflow-wrap: anywhere; }

@media (max-width: 900px) {
  .rule-editor-grid,
  .rule-editor-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .rule-editor-grid,
  .rule-editor-grid.two,
  .rule-step-row,
  .rule-payload-list { grid-template-columns: minmax(0, 1fr); }
  .rule-scope-card-field { grid-column: auto; }
}

/* ---- Pull-sheets index: batch cards + labelled row cards (Pulling v2 P3) --
   D13: build, claim, walk and check off all have to work one-handed at 375px.
   The old index was two desktop tables inside .table-scroll, so on a phone the
   checkboxes and the Guided pick link were both off the side of the screen.

   `.rowcards` is the buylist grading table's stacked mode (`table.grade`
   under @container, further up this file) generalized: below the breakpoint a
   table stops being a table and each ROW becomes a card, with its column
   heading re-attached per cell from data-label. Same mechanics and the same
   uppercase micro-label; a media query rather than a container query because
   these tables sit directly in the page rather than inside a sized container.
   EVERY <td> in a `.rowcards` table must carry data-label, or that value
   loses its heading the moment the table recomposes. */
@media (max-width: 46rem) {
  table.rowcards {
    display: block; border: 0; background: transparent; box-shadow: none; overflow: visible;
  }
  table.rowcards thead { display: none; }
  table.rowcards tbody { display: grid; gap: .6rem; }
  table.rowcards tr {
    display: grid; gap: .35rem; padding: .7rem .8rem;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  table.rowcards tbody tr:hover td { background: none; }
  table.rowcards td {
    display: grid; grid-template-columns: 6.5rem minmax(0, 1fr);
    gap: .1rem .6rem; align-items: baseline;
    min-width: 0; padding: 0; border-bottom: 0; text-align: left;
    overflow-wrap: anywhere;
  }
  table.rowcards td::before {
    content: attr(data-label);
    color: var(--ink-soft); font-size: .68rem; font-weight: 700;
    letter-spacing: .07em; text-transform: uppercase;
  }
  /* A cell with nothing in it (no flags, no checkbox on a retrieval sheet)
     would otherwise print its heading over blank space, which reads as
     missing data rather than as "none". */
  table.rowcards td:empty { display: none; }
  /* #1321 round 2 (F8): every element in a cell belongs in the value column.
     Auto-placement put a cell's second child ("Open in Shopify", the
     customer name, a second button) back in the 6.5rem label column, under
     the ORDER heading. */
  table.rowcards td > * { grid-column: 2; }
  /* Round-3 walk S7 (#1322): a grid item stretches to the column, so a badge
     ("Not scheduling", "Tickets open soon") spread across the whole card —
     the look E10 fixed on the customer calendar. Badges keep their size. */
  table.rowcards td > .badge { justify-self: start; }
  /* Round 3 (F12): the tick-off list's qty cell keeps its desktop width
     rule otherwise, which squeezed the stacked card to 2.6rem. */
  table.rowcards td.wms-qty { width: auto; }
  /* The bin count's "In the bin?" tick (F2): thumb-sized, first on the card. */
  .count-present input[type=checkbox] { width: 1.4rem; height: 1.4rem; }
  /* The pool checkbox is the whole point of the row on a phone — thumb-sized
     rather than the browser's 13px default. */
  table.pull-pool input[type=checkbox] { width: 1.3rem; height: 1.3rem; }
}

/* The customer name beside the order number (D5). Its own line at phone
   widths so a long name never widens the row past the viewport. */
.order-customer { color: var(--muted); font-size: var(--text-sm); overflow-wrap: anywhere; }
@media (max-width: 46rem) { .order-customer { display: block; } }
.order-shopify { font-size: var(--text-sm); white-space: nowrap; margin-left: var(--staff-space-2); }
@media (max-width: 46rem) { .order-shopify { display: block; margin-left: 0; } }
/* #1407: pull queue — the customer-history link sits beside "Open in Shopify";
   the sort toggle and the bulk-select row wrap on a phone; the batch list's
   "Other items" reads as a plain list under its slot heading. */
.order-customer-history { font-size: var(--text-sm); white-space: nowrap; margin-left: var(--staff-space-2); }
@media (max-width: 46rem) { .order-customer-history { display: block; margin-left: 0; } }
.queue-sort { margin-top: 0; }
.bulk-select { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem 1rem; margin: .4rem 0 .8rem; }
.bulk-select input[type="number"] { width: 4.5rem; }
.other-items ul { margin: .2rem 0 .8rem; padding-left: 1.2rem; }

/* An in-progress batch is a card at every width: name, claim, progress,
   actions, and its member orders are more than one table row can hold
   without panning sideways. */
.batch-list { display: grid; gap: .75rem; }
.batch-card {
  padding: var(--pad-card);
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.batch-card__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .3rem .9rem;
}
.batch-card__name { margin: 0; font-size: var(--text-h3); }
.batch-card__meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .7rem; margin: 0;
}
.batch-card__actions {
  display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .6rem;
}
.batch-members { list-style: none; margin: .7rem 0 0; padding: 0; }
.batch-member {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .7rem;
  min-width: 0; padding: .45rem 0; border-top: 1px solid var(--line);
}
.batch-member__slot {
  flex: 0 0 auto; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap;
}
.batch-member__order { flex: 1 1 11rem; min-width: 0; overflow-wrap: anywhere; }
.batch-member__customer { color: var(--muted); font-size: var(--text-sm); margin-left: .4rem; }
.batch-member__progress { flex: 0 0 auto; white-space: nowrap; }
.batch-member__shopify { flex: 0 0 auto; font-size: var(--text-sm); white-space: nowrap; }
@media (max-width: 30rem) {
  .batch-member__customer { display: block; margin-left: 0; }
}

/* -- The pull run's three surfaces (Pulling v2 P6, docs/specs/pulling-v2.md
   §§3 and 6): the one-bin-per-screen walk, the tick-off list, and the handoff
   landing. Appended as a whole unit so concurrent edits to earlier sections
   never collide. */

/* Walk vs list: two plain links, the current one filled in. Nothing is
   remembered — the right answer changes with where the picker is standing. */
.mode-tabs { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 .4rem; }
.mode-tabs .btn.current {
  background: var(--accent); color: var(--on-accent); border-color: var(--accent);
}

/* One card per row inside the bin screen. The panel vocabulary already carries
   the colours; this only tightens the spacing so several rows fit a phone. */
.walk-line { margin-top: .7rem; }
.walk-line .panel-body { padding-block: .6rem; }
/* A line already resolved stays on the screen (it is part of this box) but
   recedes — it is context, not work. */
.walk-line-resolved { opacity: .62; }
/* The primary action, full width on a phone, with real distance under it
   before the collapsed "not there" disclosure (UX-A item 6). */
.walk-line-action { margin: .7rem 0 0; }
.walk-line-action .btn-hero { display: block; width: 100%; }

/* Handoff landing: one row per order slot, stacked so it reads on a phone. */
.handoff-list { list-style: none; margin: 1rem 0 0; padding: 0; }
.handoff-row {
  padding: var(--pad-card); margin-bottom: .7rem;
  background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.handoff-head {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; margin: 0;
  font-size: var(--text-h3);
}
.handoff-row p { margin: .45rem 0 0; }
.handoff-others em { font-style: normal; font-weight: 700; }
.handoff-ready { font-size: var(--text-sm); }

/* ---- Pulling report (Pulling v2 §7) — appended section -----------------
   Desk-read report: a per-person summary table plus a stack of day cards.
   Deliberately NOT a day-per-column grid — fourteen date columns pan a
   tablet sideways, which the staff console never does. */

.pull-report { width: 100%; }
.pull-report tfoot th, .pull-report tfoot td { font-weight: 700; border-top: 2px solid var(--line); }

/* The window presets read as a segmented control: the one you are looking at
   is marked, the rest are quiet. */
.filterbar .btn.is-current { border-color: var(--accent); color: var(--accent); font-weight: 600; }

.pull-report-days { margin-top: 1.2rem; }
.pull-report-day { margin: 0 0 .6rem; }
.pull-report-day.is-quiet { background: none; box-shadow: none; border-style: dashed; }
.pull-report-day__head {
  display: flex; flex-wrap: wrap; align-items: baseline;
  justify-content: space-between; gap: .3rem .9rem;
}
.pull-report-day__head h3 { margin: 0; font-size: var(--text-h3); }
.pull-report-day__totals {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .3rem .9rem; margin: 0;
}
.pull-report-day__people { list-style: none; margin: .5rem 0 0; padding: 0; }
.pull-report-day__people li {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: .25rem .7rem;
  min-width: 0; padding: .35rem 0; border-top: 1px solid var(--line);
}
.pull-report-day__name { flex: 1 1 10rem; min-width: 0; overflow-wrap: anywhere; }

/* Rewards staff edit forms (#1320): every editor used .stacked-form with no
   rule, so labels and inputs ran together as one line of text. */
/* Flex rather than grid so Save and Cancel sit side by side at the end while
   every field still takes the full width (#1322 S2). */
form.stacked-form {
  display: flex; flex-wrap: wrap; gap: .65rem .5rem; max-width: 36rem; align-items: flex-start;
}
form.stacked-form > * { flex: 1 1 100%; min-width: 0; }
form.stacked-form label { display: grid; gap: .25rem; font-weight: 600; }
form.stacked-form label .muted, form.stacked-form .helptext { font-weight: 400; }
form.stacked-form p { margin: 0; display: grid; gap: .25rem; }
form.stacked-form input:not([type=checkbox]):not([type=radio]), form.stacked-form select,
form.stacked-form textarea { width: 100%; }
form.stacked-form > button, form.stacked-form > .btn { flex: 0 0 auto; }
/* A checkbox reads as label then box on one line, not a box centred under
   its label (#1322 S2); help text wraps to its own line underneath. */
form.stacked-form p:has(> input[type=checkbox]) {
  display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .5rem;
}
form.stacked-form p:has(> input[type=checkbox]) > :not(label):not(input) { flex-basis: 100%; }
form.stacked-form label:has(> input[type=checkbox]) {
  display: flex; align-items: center; gap: .5rem;
}
/* ---- Staff floor and catalog fixes (#1321, 2026-10-25 walkthrough) --------
   Appended as a whole unit so concurrent edits to earlier sections never
   collide. */

/* A link inside a coloured panel head reads in the head's own text colour —
   the guided-pick card name was blue link text on the blue head (1:1). */
.panel-head a { color: var(--panel-text); }

/* Guided pick: the card photo beside each line, as put-away shows it. */
.walk-line-body { display: flex; gap: .8rem; align-items: flex-start; }
.walk-line-main { flex: 1 1 auto; min-width: 0; }
.walk-card-shot { width: 5rem; max-width: 24vw; flex: 0 0 auto; }

/* Shown only at phone widths — e.g. the pull-sheet desk list's "use Guided
   pick" hint (owner decision 8). */
.phone-only { display: none; }
@media (max-width: 46rem) { .phone-only { display: block; } }
.pull-desk-actions { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; }
.pull-desk-actions .btn-hero { width: auto; }

/* Bin count: the printing (condition · finish) leads; the SKU string is
   secondary evidence beneath it. */
.count-thumb { width: 2.6rem; aspect-ratio: 5 / 7; object-fit: cover; border-radius: .25rem; vertical-align: middle; margin-right: .4rem; }
.count-sku { display: block; font-size: .75rem; }
/* #1321 round 5: the scan box fills the row; at 390 it was narrower than its button. */
form.count-scan { display: flex; flex-wrap: wrap; gap: .5rem; }
form.count-scan input[name=sku_string] { flex: 1 1 12rem; min-width: 0; }

/* #1321 round 3 (F17): on a phone a bin count was one ~265px labelled card
   per copy — a 39-copy bin made an 11,300px page with Submit at the very
   bottom. Each copy is now one compact row: tick, small photo and name, and
   the index box inline; set and version sit underneath, unlabelled. The
   submit button rides a sticky bar so it is reachable from any copy. */
.count-submitbar {
  position: sticky; bottom: 0; z-index: 30;
  display: flex; justify-content: flex-end; gap: .6rem; align-items: center;
  margin: .8rem 0 0; padding: .55rem 0;
  background: var(--paper);
}
@media (max-width: 46rem) {
  table.rowcards.count-copies tr {
    grid-template-columns: auto minmax(0, 1fr) 4.2rem;
    align-items: center; gap: .2rem .6rem; padding: .45rem .6rem;
  }
  table.rowcards.count-copies td { display: block; }
  table.rowcards.count-copies td::before { content: none; }
  table.rowcards.count-copies td.count-copy-detail { grid-column: 1 / -1; font-size: .8rem; }
  table.rowcards.count-copies td.count-copy-detail .count-sku { display: inline; }
  table.rowcards.count-copies .count-thumb { width: 1.6rem; }
  table.rowcards.count-copies input.depth-slot { width: 100%; }
  .count-submitbar { padding-inline: .2rem; }
  .count-submitbar button { flex: 1 1 auto; }
}

/* #1321 round 3 (F5): the corrections row's live "Now" line sits apart from
   the drift report's snapshot figures above it. */
.drift-now { margin-top: .35rem; padding-top: .3rem; border-top: 1px dashed var(--line); }

/* #1321 round 3 (F16): the walk, list and desk rows are redirect anchors
   (#line-N, #unmatched-N). Without a margin the landed row's card-name head
   sat under the sticky top bar. */
.walk-line, [id^="line-"], [id^="unmatched-"] { scroll-margin-top: 4.5rem; }

/* Held price rows: the why-held sentence and the price evidence span the
   whole row, as the Technical details disclosure does. */
.price-condition-row > .price-why-held,
.price-condition-row > .price-market-evidence { grid-column: 1 / -1; margin: .1rem 0 0; }

/* ---- Staff money desk, round-2 check (#1320, 2026-10-25) ------------------
   Appended as a whole unit so concurrent edits to earlier sections never
   collide. */

/* Adjust credit: one choice per line — inline radios broke mid-label (M9). */
.adjust-credit-direction label { display: flex; gap: .4rem; align-items: baseline; margin: .2rem 0; font-weight: 400; }

/* A removed grading row strikes through the card and its numbers, never the
   explanation the customer will read, its label, or the "Pending removal"
   note (M7). An inline-block box stops the cell's line-through from
   propagating into it. */
table.grade tr.picked td[data-label="Action"] { text-decoration: none; }
table.grade tr.picked .cell-more { display: inline-block; max-width: 100%; color: var(--ink); }
/* The read-only explanation on an awaiting-approval or finalized buylist is
   what staff read out at hand-back, so it stays unstruck too (round 3, M7). */
table.grade tr.picked .grade-customer-explanation { display: inline-block; max-width: 100%; }

/* The visible key for a condition chip's "*" (M8). */
.condition-chip-key { display: block; font-size: var(--text-sm); margin-top: .15rem; }

/* Buylist History on a phone: each entry stacks (when · who, then what)
   instead of squeezing the event column to one letter per line (M5). */
@media (max-width: 46rem) {
  table.buylist-history, table.buylist-history tbody,
  table.buylist-history tr, table.buylist-history td { display: block; width: auto; }
  table.buylist-history tr { padding: .45rem 0; border-top: 1px solid var(--line); }
  table.buylist-history td { border: 0; padding: .05rem 0; }
  table.buylist-history td.buylist-history-when,
  table.buylist-history td.buylist-history-actor { display: inline; }
  table.buylist-history td.buylist-history-actor::before { content: " · "; }
}

/* The credit ledger on a phone: each entry stacks (when · by, then kind and
   amount, then reference and note) instead of a seven-column table whose
   reference, note and staff name sat off-screen (round 3, M13). */
@media (max-width: 46rem) {
  table.credit-ledger, table.credit-ledger tbody { display: block; width: auto; }
  table.credit-ledger thead { display: none; }
  /* Round-6 walk (#1320): a hold row's code-status chip sat beside the kind
     and the stored "customer:88001" sat beside the date, widening each card
     to ~471px in a 339px box. The chip now gets its own row and every cell
     may shrink and wrap. */
  table.credit-ledger tr {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; column-gap: .5rem;
    grid-template-areas: "when by amount" "kind kind kind" "status status status" "ref ref ref" "note note note";
    padding: .45rem 0; border-top: 1px solid var(--line);
  }
  table.credit-ledger td { border: 0; padding: .05rem 0; min-width: 0; overflow-wrap: anywhere; }
  table.credit-ledger td.credit-ledger-when { grid-area: when; white-space: nowrap; color: var(--muted); }
  table.credit-ledger td.credit-ledger-by { grid-area: by; }
  table.credit-ledger td.credit-ledger-by::before { content: "· "; }
  table.credit-ledger td.credit-ledger-amount { grid-area: amount; font-weight: 600; }
  table.credit-ledger td.credit-ledger-kind { grid-area: kind; }
  table.credit-ledger td.credit-ledger-status { grid-area: status; }
  /* The longest code statuses ("Partially used (remainder returned)") are
     wider than a phone card's value column; on this page they wrap inside
     the pill rather than push the card off-screen. */
  table.credit-ledger .badge, table.credit-codes .badge { white-space: normal; max-width: 100%; }
  table.credit-codes td > .btn { justify-self: start; }
  table.credit-ledger td.credit-ledger-ref { grid-area: ref; }
  table.credit-ledger td.credit-ledger-note { grid-area: note; }
  table.credit-ledger td.credit-ledger-blank { display: none; }
}

/* Rewards ladder: the dip warning gets its own full-width row under the
   step instead of being squeezed into the Per point cell (M10). */
tr.ladder-dip-row td { border-top: 0; padding-top: 0; }
tr.ladder-dip-row .flash { margin: 0; }
/* ---- Staff frame fixes, round 2 (#1322, 2026-10-25) ---------------------
   Appended as a whole unit so concurrent edits to earlier sections never
   collide. */

/* S3: at phone width the Activity rows become cards, like the other
   `.rowcards` tables. One entry is a <tbody> (summary row plus its Technical
   detail row), so the card frame moves from each <tr> to the <tbody>. */
@media (max-width: 46rem) {
  table.activity.rowcards tbody.activity-entry {
    display: grid; gap: .35rem; margin-bottom: .6rem; padding: .7rem .8rem;
    background: var(--surface);
    border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
  }
  table.activity.rowcards tbody.activity-entry tr {
    padding: 0; border: 0; border-radius: 0; box-shadow: none; background: transparent;
  }
  table.activity.rowcards .activity-detail-row td { display: block; }
  table.activity.rowcards .activity-detail-row td::before { content: none; }
}

/* S4: the dashboard changelog keeps "What happened" under the update's name,
   so the sentence gets the row's width instead of one word per line. */
table.changelog .changelog-summary { margin-top: .15rem; }
table.changelog .badge, table.changelog .changelog-details { white-space: nowrap; }

/* #1391: Ship/Pickup and Online/In store beside each order on the pull sheet
   queue. Two short pills that wrap onto their own line on a phone rather than
   widening the row. */
.order-facts { display: inline-flex; flex-wrap: wrap; gap: .25rem; margin-left: var(--staff-space-2); vertical-align: baseline; }
@media (max-width: 46rem) { .order-facts { display: flex; margin: .2rem 0 0; } }
.order-facts-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: .4rem; margin: .2rem 0 .6rem; }
.order-facts-line .order-facts { margin-left: 0; }
