/* CountMesh web app.
 *
 * The palette is the product app's, taken from `app/lib/theme/bar_theme.dart` rather than
 * re-chosen, so the web and the phone are one product. Every text/surface pair there is checked
 * against WCAG AA in the app's `theme_contrast_test.dart`; re-picking colours here would quietly
 * leave that behind.
 *
 * Dark-first on purpose: this is read in dimly lit storerooms and bars. `--primary` is reserved
 * for actions and focus. The status hues never touch an interactive element — a red button must
 * not be able to mean "out of stock".
 */
:root {
  --bg: #12141C;
  --surface: #1A1D27;
  --surface-container: #1E2230;
  --surface-high: #252A3C;
  --outline: #4A5166;
  --ink: #F2F4F8;
  --ink-dim: #B4BBCB;
  --primary: #00E5FF;
  --on-primary: #00363D;
  --error: #FF6E6E;

  /* Status signalling, from the same file and used only to report state. */
  --ok: #69F0AE;
  --warn: #FFB300;
  --bad: #FF5252;

  --radius: 14px;
  --gutter: 16px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* **Links, which until 2026-11-23 nothing styled.** The browser default is `#0000EE` on a
   `#12141C` background — dark blue on near-black, which fails contrast badly enough that the
   address in a lead card was legible only by selecting it. Two links exist in this whole
   console (a lead's email and a seed submission's file) and both were unreadable, so the rule
   is on `a` rather than scoped to the screen that found it. */
a { color: var(--primary); }
a:hover { text-decoration-thickness: 2px; }

/* ------------------------------------------------------------------ the sign-in screen */
body.signed-out { display: flex; align-items: center; justify-content: center; min-height: 100dvh; padding: 24px var(--gutter); }
body.signed-out #app { display: none; }
body.signed-in #gate { display: none; }

#gate { width: 100%; max-width: 380px; }
.brand { text-align: center; margin-bottom: 28px; }
.brand h1 { margin: 0; font-size: 30px; font-weight: 650; letter-spacing: -0.02em; }
.brand h1 b { color: var(--primary); font-weight: 650; }
.brand p { margin: 6px 0 0; color: var(--ink-dim); font-size: 14px; }

.card { background: var(--surface); border: 1px solid var(--outline); border-radius: var(--radius); padding: 22px 20px; }
form { display: flex; flex-direction: column; gap: 16px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--ink-dim); }
/* `optional` beside a label, so a blank field reads as a choice rather than something
   missed. Quieter than the label and not a chip: it is not a state. */
.opt { font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
       color: var(--outline); font-weight: 600; }

input, select {
  font: inherit; font-size: 16px;  /* 16px minimum, or iOS zooms the page on focus */
  color: var(--ink); background: var(--surface-container);
  border: 1px solid var(--outline); border-radius: 10px; padding: 11px 13px;
}
input:focus-visible, select:focus-visible, button:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 1px;
}
input:disabled, button:disabled { opacity: .55; }

button {
  font: inherit; font-weight: 600; cursor: pointer; border-radius: 10px;
  padding: 11px 15px; min-height: 44px;
  border: 1px solid var(--outline); background: transparent; color: var(--ink);
}
button.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
button.small { min-height: 34px; padding: 5px 11px; font-size: 13px; font-weight: 500; }
button:disabled { cursor: default; }

.alert {
  margin: 0; padding: 11px 13px; border-radius: 10px;
  border: 1px solid var(--error); color: var(--error); background: rgba(255,110,110,.08); font-size: 14px;
}
.alert[hidden], [hidden] { display: none !important; }

/* ------------------------------------------------------------------ the shell */
header.top {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg); border-bottom: 1px solid var(--outline);
  padding: 10px var(--gutter) 0;
}
.top .row { display: flex; align-items: center; gap: 10px; max-width: 1100px; margin: 0 auto; }
.top .wordmark { font-size: 17px; font-weight: 650; letter-spacing: -0.01em; }
.top .wordmark b { color: var(--primary); font-weight: 650; }
.grow { flex: 1 1 auto; min-width: 0; }
.who { font-size: 13px; color: var(--ink-dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

nav.tabs {
  display: flex; gap: 2px; max-width: 1100px; margin: 8px auto 0;
  overflow-x: auto; scrollbar-width: none;
}
nav.tabs::-webkit-scrollbar { display: none; }
nav.tabs button {
  border: none; border-bottom: 2px solid transparent; border-radius: 0;
  background: none; color: var(--ink-dim); font-weight: 500;
  padding: 9px 13px; min-height: 40px; white-space: nowrap;
}
nav.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--primary); font-weight: 600; }

main { max-width: 1100px; margin: 0 auto; padding: var(--gutter) var(--gutter) 56px; }

.bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.bar input[type=search] { flex: 1 1 240px; min-width: 0; }
.count { color: var(--ink-dim); font-size: 13px; font-variant-numeric: tabular-nums; }

.note { color: var(--ink-dim); font-size: 13px; }
/* The answer to "is there anything to do?", above the history rather than inside it. */
#sessionWaiting { margin: 0 0 12px; color: var(--ink); font-weight: 500; }
.status.bad { color: var(--error); }

/* ------------------------------------------------------------------ cards and rows */
.item {
  background: var(--surface); border: 1px solid var(--outline);
  border-radius: 12px; margin-bottom: 10px; overflow: hidden;
}
.item .head { display: flex; gap: 12px; align-items: center; padding: 12px 14px; }
.item .body { border-top: 1px solid var(--outline); padding: 12px 14px; }
.title { font-weight: 600; }
.sub { color: var(--ink-dim); font-size: 13px; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 12px; color: var(--ink-dim); }

/* The verdict, at a glance. Louder than the detail behind it, because "can this bottle be
   counted" is the question and which sides are held is the explanation. */
.chip {
  font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  border: 1px solid currentColor; white-space: nowrap;
}
.chip.ok { color: var(--ok); }
.chip.calc { color: var(--primary); }
.chip.warn { color: var(--warn); }
.chip.bad { color: var(--bad); }
.chip.quiet { color: var(--ink-dim); border-color: var(--outline); font-weight: 400; }

/* A cell holding more than one control. The buttons already refuse to break their own labels;
   this keeps Fix and Publish on one line as a pair rather than stacking them in a narrow column. */
.nowrap { white-space: nowrap; }

/* A cell whose value disagrees with the one beside it. Colour alone would not carry the fact to
   somebody who cannot see it, so the comparison also counts the differences in words above the
   table and the heading says which column is which. */
td.warn { color: var(--warn); font-weight: 600; }

/* **A value you can point at.** The whole cell is the target, not the eight pixels of the
   radio: these rows are read and ticked one after another down a long list, and a hit area
   the size of a full stop is what makes that tiring. */
label.pick { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
label.pick input { cursor: pointer; margin: 0; }
/* The name of the row the survivor ticks sit on. `th` is bold and upper-cased like the brand
   headings beside it, and this is a label for them, not another heading. */
th.rowname { font-weight: 400; text-transform: none; color: var(--ink-dim); }
/* **The two brands being compared are not a column heading.** `th` is upper-cased, which on
   this screen destroys the very thing the card reports: `Bacardi` and `BACARDÍ` both render
   `BACARDÍ`, and the sentence underneath then names a difference the reader cannot see
   (the owner, 2026-11-14). Shown as stored, at reading size. */
th.brandname { text-transform: none; font-size: 13px; letter-spacing: 0; color: var(--ink); }
td.warn label.pick { font-weight: 600; }

/* A fixed box so a tall bottle and a wide one do not make two rows different heights, and
   `contain` rather than `cover` because a label cropped square is the half somebody is reading. */
.thumb {
  width: 44px; height: 58px; flex: 0 0 auto; border-radius: 6px;
  border: 1px solid var(--outline); background: var(--surface-container);
  object-fit: contain;
}
/* Faded and inert while there is nothing behind it; a pointer once there is. */
.thumb[data-empty] { opacity: .35; }
/* The catalog's picture column. Narrow and fixed, so 50 rows line up whether or not they have a
   photograph — a column that collapses when a page happens to have none would reflow the table
   under somebody reading it. */
.shotcol { width: 46px; padding-right: 0; }
.shotcol .thumb { width: 38px; height: 50px; object-fit: contain; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.thumb[src] { cursor: zoom-in; }

.shots { display: flex; gap: 6px; flex-wrap: wrap; }
.shots img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 6px;
  border: 1px solid var(--outline); background: var(--surface-container); cursor: zoom-in;
}

table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 7px 9px; border-bottom: 1px solid var(--outline); vertical-align: top; }
th { color: var(--ink-dim); font-weight: 600; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
td.num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.scroll { overflow-x: auto; }

/* A finding from the label check. The rule carries the severity, so scanning the column shows
   where to stop without reading a word. */
.find { border-left: 2px solid var(--outline); padding: 3px 0 3px 9px; margin: 5px 0; font-size: 13px; }
.find.stop { border-color: var(--bad); }
.find.look { border-color: var(--warn); }
.find .was { color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.src { font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--ink-dim); }

dialog { border: none; border-radius: 12px; padding: 0; background: var(--surface); max-width: 95vw; }
dialog img { display: block; max-width: 92vw; max-height: 86vh; }
dialog::backdrop { background: rgba(0,0,0,.72); }
/* The user-agent rule, restated so that a `display` added to a dialog one day cannot switch it
   on everywhere. It is the whole of the defect above, and it costs one line to make unreachable. */
dialog:not([open]) { display: none; }

footer { max-width: 1100px; margin: 0 auto; padding: 0 var(--gutter) 28px; color: var(--ink-dim); font-size: 12px; }

@media (max-width: 560px) {
  .item .head { flex-wrap: wrap; }
  th, td { padding: 6px 7px; }
}
@media (prefers-reduced-motion: no-preference) {
  #gate { animation: rise .22s ease-out both; }
  @keyframes rise { from { opacity: 0; transform: translateY(6px); } }
}

/* --------------------------------------------------------------- the people at a store */
.switches { display: flex; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--ink-dim); }
.switches label { display: flex; gap: 5px; align-items: center; white-space: nowrap; }
.switches input:disabled + span { opacity: .5; }
select.small { min-height: 34px; padding: 4px 8px; font-size: 14px; }
tr.gone td { opacity: .5; }

/* **An Area is a heading over the walk, not a row in it.** It has no counting mode, no walk of its
   own and nothing to answer, so it must not read as something countable sitting between two
   sections. The indent is inline on the cell (`padding-left`), because the depth is data — an area
   inside an area inside an area is legal and a fixed set of classes would cap it. */
tr.group > td { background: var(--surface-container); }
tr.group .name { font-weight: 600; }
tr.group .sub { font-weight: 400; }
/* The rail is what makes an indent read as containment rather than as a typo. */
.rail { color: var(--outline); margin-right: 6px; }
td.saving { color: var(--primary); font-size: 12px; }
td.saved { color: var(--ok); font-size: 12px; }
td.failed { color: var(--error); font-size: 12px; }
button.danger { border-color: var(--bad); color: var(--bad); background: transparent; }

h2.section, h3.section {
  font-size: 12px; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-dim); margin: 24px 0 8px; font-weight: 600;
}
/* A sub-heading inside a section: the same rule, a quieter voice. */
h3.section { font-size: 15px; color: var(--ink-dim); margin-top: 22px; }

/* The one-time link. Loud because it cannot be shown again — only its digest is stored, so a
   person who closes this without copying it has to issue another. */
.handoff {
  margin-top: 14px; border: 1px solid var(--primary); border-radius: 10px;
  background: rgba(0, 229, 255, .06); padding: 12px 13px;
}
.handoff code {
  display: block; word-break: break-all; font-size: 12px; color: var(--ink);
  background: var(--surface-container); border-radius: 8px; padding: 9px 10px; margin: 8px 0;
}

/* ------------------------------------------------------------------ toasts
 *
 * Transient outcomes: "store closed", "invitation emailed". **Never errors a person must act on**
 * — those belong next to the control that produced them, where the eye already is, and a message
 * that disappears is a message somebody can miss.
 *
 * Bottom of the screen rather than the top: on a phone the top is where the browser's own chrome
 * and the notch live, and a thumb reaches the bottom.
 */
#toasts {
  position: fixed; z-index: 100;
  left: 50%; transform: translateX(-50%);
  bottom: calc(16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column-reverse; gap: 8px;
  width: min(420px, calc(100vw - 32px));
  /* The container never eats clicks; each toast re-enables them for itself. */
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--surface-high); color: var(--ink);
  border: 1px solid var(--outline); border-left-width: 3px;
  border-radius: 10px; padding: 11px 12px;
  font-size: 14px; line-height: 1.45;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .45);
}
.toast.ok   { border-left-color: var(--ok); }
.toast.warn { border-left-color: var(--warn); }
.toast.bad  { border-left-color: var(--error); }
.toast.info { border-left-color: var(--primary); }
.toast .grow { flex: 1 1 auto; min-width: 0; }
.toast b { display: block; font-weight: 600; }
.toast .detail { color: var(--ink-dim); font-size: 13px; }
.toast button.close {
  flex: 0 0 auto; min-height: 0; padding: 0 6px; margin: -2px -4px 0 0;
  border: none; background: none; color: var(--ink-dim); font-size: 18px; line-height: 1;
}
.toast button.act {
  flex: 0 0 auto; min-height: 0; padding: 4px 10px; font-size: 13px;
  border-color: var(--outline); background: transparent; color: var(--ink);
}

@media (prefers-reduced-motion: no-preference) {
  .toast { animation: toast-in .18s ease-out both; }
  .toast.going { animation: toast-out .16s ease-in both; }
  @keyframes toast-in { from { opacity: 0; transform: translateY(8px); } }
  @keyframes toast-out { to { opacity: 0; transform: translateY(6px); } }
}

/* ------------------------------------------------------------------ the layout tree
 *
 * Nested lists, because a tree is what this is: an Area holds Sections and other Areas, and a
 * table could neither nest them nor say what a dragged row was dropped *into*. The indent comes
 * from the nesting itself rather than from a computed `padding-left`, so a branch cannot drift
 * out of step with its depth.
 */
.tree, .tree .kids { list-style: none; margin: 0; padding: 0; }
.tree .kids { margin-left: 18px; border-left: 1px solid var(--outline); padding-left: 6px; }
/* An empty child list still has to be a drop target, or an Area can never be the first thing a
   section is dragged into. It keeps its height and **loses its rail**: a line hanging below a
   branch with nothing in it reads as a branch with something in it, which is the same class of
   thing as the border that looked like a strikethrough. */
.tree .kids:empty { min-height: 10px; margin-bottom: 2px; border-left-color: transparent; }
.tree .node.shut > .kids { display: none; }

.tree .row { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-radius: 8px;
             min-height: 36px; }
.tree .row:hover { background: var(--surface-container); }
.tree .node.area > .row .name { font-weight: 600; }
.tree .row .spacer { flex: 1 1 auto; }
.tree .row .sub { font-size: 12px; color: var(--ink-dim); }
.tree .node.heading .name { font-size: 12px; letter-spacing: .04em; text-transform: uppercase; }
.tree .node.heading { padding: 10px 8px 2px; }

/* The twisty is a control and reads as one; disabled where there is nothing inside to fold, so
   the arrow is never a promise of something that is not there. */
.tree .twisty { flex: 0 0 auto; min-height: 0; width: 22px; padding: 0; border: none;
                background: none; color: var(--ink-dim); font-size: 12px; line-height: 1;
                cursor: pointer; }
.tree .twisty[disabled] { opacity: .25; cursor: default; }
.tree .grip { flex: 0 0 auto; color: var(--ink-dim); cursor: grab; font-size: 13px;
              user-select: none; }
.tree .grip:active { cursor: grabbing; }
.sortable-ghost > .row { background: var(--surface-high); outline: 1px dashed var(--primary); }

/* A bottle is a leaf: no twisty, a lighter name, and the locked ones — weighed here and on no
   line of the sheet — are visibly not pickupable rather than silently refusing the drag. */
.tree .node.bottle > .row { min-height: 30px; padding: 3px 8px; }
.tree .node.bottle .name { font-size: 13px; }
.tree .node.bottle.locked .name { color: var(--ink-dim); }
.tree .grip.none { width: 13px; }
.tree .node.unassigned > .row { border: 1px dashed var(--outline); }

/* The editors and the walk, which used to be table rows spanning every column. */
.tree .panel { margin: 2px 0 8px 24px; padding: 10px 12px; border-radius: 9px;
               background: var(--surface-container); border: 1px solid var(--outline); }

/* ------------------------------------------------------------------ the ask dialog
 *
 * Replaces `prompt()` and `confirm()`. Those cannot be styled, cannot carry two fields, block the
 * whole page, and on a phone announce the host name before the question — which trains people to
 * dismiss exactly the dialogs that matter.
 */
#ask { width: min(440px, calc(100vw - 32px)); }
#ask form { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
#ask h2 { margin: 0; font-size: 18px; }
#ask .why { margin: 0; color: var(--ink-dim); font-size: 14px; }
#ask .row { display: flex; gap: 8px; align-items: center; }

/* ------------------------------------------------------------------ the platform's one act
 *
 * **A tile, not a button.** The act behind it is nine fields, a customer and an invitation that
 * cannot be unsent; a 90-pixel button in a toolbar reads as "this happens now", and this is
 * "this opens something". It is also the only control on the screen that creates anything, so
 * it is allowed to be the thing the eye lands on.
 */
.tile {
  display: flex; align-items: center; gap: 14px; width: 100%; text-align: left;
  padding: 16px 18px; margin: 14px 0; border-radius: var(--radius);
  /* Dashed, which is the one visual convention for "there is nothing here yet, make one". */
  border: 1px dashed var(--outline); background: transparent; color: var(--ink);
  font: inherit; cursor: pointer;
  transition: border-color .12s ease, background .12s ease;
}
.tile:hover, .tile:focus-visible { border-color: var(--primary); background: var(--surface-container); }
.tile .plus {
  display: grid; place-items: center; flex: none; width: 38px; height: 38px; border-radius: 50%;
  background: var(--surface-high); color: var(--primary); font-size: 24px; line-height: 1;
}
.tile:hover .plus, .tile:focus-visible .plus { background: var(--primary); color: var(--on-primary); }
.tile .tiletext { display: flex; flex-direction: column; gap: 2px; }
.tile .tiletext b { font-size: 16px; }
.tile .tiletext .sub { color: var(--ink-dim); font-size: 13px; }

/* **One class, seven dialogs.** Every "add a thing" form on this console is a `.sheet`: the
   platform's onboarding, both invitations, a store, a section, an area, a line. They were seven
   cards sitting permanently on six panels until 2026-11-16, when the owner asked for the
   treatment the platform screen got — *"if we have text boxes... make them modals"*.

   **`display` only when it is open**, for the reason `#look` carries above: a `display` on the
   dialog itself overrides the browser's `dialog:not([open]) { display: none }`, and the modal
   then renders on the sign-in page. A class makes that one rule rather than seven chances to
   get it wrong. */
dialog.sheet { width: min(560px, calc(100vw - 32px)); padding: 20px; max-height: 88vh; }
dialog.sheet[open] { display: flex; flex-direction: column; gap: 12px; }
dialog.sheet h2 { margin: 0; font-size: 18px; }
dialog.sheet .why { margin: 0; color: var(--ink-dim); font-size: 14px; }
dialog.sheet form { display: flex; flex-direction: column; gap: 12px; min-height: 0; }
/* The fields scroll and the actions do not. Nine of them is taller than a laptop window, and a
   Create button below the fold — on a screen whose act cannot be undone — is the wrong thing to
   make somebody hunt for. */
dialog.sheet .fields { overflow: auto; min-height: 0; display: flex; flex-direction: column;
                       gap: 12px; padding-right: 4px; }
dialog.sheet .row { display: flex; gap: 8px; align-items: center; }
dialog.sheet h3.section { margin: 6px 0 0; font-size: 13px; }
/* A note inside a form is guidance, not a heading above it: it reads smaller than the fields. */
dialog.sheet .note { font-size: 13px; }

/* --------------------------------------------------- what is behind a duplicate's counts */
/* Wider than `ask` and scrollable: two columns of sizes, barcodes and weighings, on a screen
   somebody is comparing with a bottle in their hand. */
/* **`display` only when it is open.** A `display` on the element itself overrides the
   browser's own `dialog:not([open]) { display: none }`, so this modal rendered on the sign-in
   page, empty and across the form (2026-11-14). `#ask` never met this because it puts its
   `flex` on the inner `form`, not on the dialog. */
#look { width: min(980px, calc(100vw - 32px)); padding: 20px; max-height: 88vh; }
#look[open] { display: flex; flex-direction: column; gap: 14px; }
#look h2 { margin: 0; font-size: 18px; }
#look .why { margin: 0; color: var(--ink-dim); font-size: 14px; }
#look .row { display: flex; gap: 8px; align-items: center; }
#look #lookBody { overflow: auto; }
.sides { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 720px) { .sides { grid-template-columns: 1fr; } }
.side h3 { margin: 0 0 2px; font-size: 15px; }
.sizebox { border: 1px solid var(--line); border-radius: 9px; padding: 10px; margin: 10px 0; }
.sizebox > h4 { margin: 0 0 8px; font-size: 13px; }
/* **White, always.** A scanner reads reflected contrast, and a barcode drawn on the console's
   dark surface is a barcode that will not scan off the screen — which is the one thing this
   element exists to do. */
.upc { background: #fff; padding: 8px 10px 4px; border-radius: 6px; display: inline-block;
       margin: 0 8px 8px 0; }
.upc svg { display: block; }
.upc figcaption { font: 12px/1.5 ui-monospace, monospace; color: #111; letter-spacing: .12em;
                  text-align: center; }
.evid { font-size: 13px; }
.evid td, .evid th { padding: 4px 6px; }
.shot { width: 46px; height: 60px; object-fit: contain; border-radius: 4px;
        background: var(--surface-2, rgba(255,255,255,.04)); cursor: zoom-in; }
.review { border: 1px solid var(--line); border-radius: 9px; padding: 12px; margin-top: 4px; }
.review ul { margin: 6px 0 0; padding-left: 20px; }
.review li { margin: 3px 0; }

/* Sprint 03-MFA slice A. Recovery codes are read off a screen and typed somewhere else, so they
   are set in a monospaced column with generous tracking: the whole point is that `0`/`O` and
   `1`/`I` cannot be confused. The Base32 alphabet excludes those four characters anyway, which is
   belt and braces on purpose. */
.codes {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 15px; line-height: 1.9; letter-spacing: .08em;
  background: var(--surface-container);
  border: 1px solid var(--outline);
  color: var(--ink);
  border-radius: 6px; padding: 12px 14px; margin: 10px 0; white-space: pre; overflow-x: auto;
}
.primary-link { color: var(--primary); font-weight: 600; }

/* The enrolment QR. A white quiet zone regardless of the dark theme, because a scanner reads
   contrast and an SVG of black modules on a dark surface is a code nothing can read. */
.qr {
  width: 196px; height: 196px; display: block; margin: 4px 0 12px;
  background: #fff; padding: 10px; border-radius: 8px; border: 1px solid var(--outline);
  image-rendering: pixelated;
}

/* Sprint 03-MFA slice B. A role list is read down, not across: one line each so the labels and
   their hints stay aligned, and a disabled row is dimmed because it is inherited rather than
   broken. */
.checks { display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; gap: 9px; align-items: baseline; font-size: 14px; }
.checks input { margin: 0; flex: 0 0 auto; }
.checks .why { color: var(--ink-dim); font-size: 12px; }
.checks label[data-inherited] { opacity: .7; }

/* ---------------------------------------------------------------- the inventory list (04-ASSORTMENT)
 *
 * A line holds one size cell per container size, and a cell holds an ordered list of bottles
 * whose first entry is the usual one. The cell is bordered and the bottles are not: the cell is
 * the thing with an identity and a code, and a bottle is an entry in its list.
 */
.cell { border: 1px solid var(--outline); border-radius: var(--radius); padding: 10px 12px; margin-top: 10px; }
.cell.retired { opacity: .55; }
.cell .bar { gap: 10px; flex-wrap: wrap; }
ul.plain { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
ul.plain li { display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
              padding: 6px 8px; border-radius: 8px; background: var(--surface-container); }
.pill { font-size: 12px; border: 1px solid var(--outline); border-radius: 999px; padding: 1px 8px;
        color: var(--ink-dim); white-space: nowrap; }
.pill.bad { color: var(--error); border-color: var(--error); }
/* **A label, in none of the vocabulary of controls.** `usual` sits in a row of `.rowbtn` items,
   and every boxed form of it has been misread: outlined in dim ink it looked like a disabled
   button, and filled in the accent it looked like one switched on that could not be switched off.
   No box, no border, no accent — a tick and a word, which is what it is. It appears only on a
   cell holding more than one bottle, because a cell with one has nothing for it to be usual
   among. */
.usualmark { font-size: 12px; color: var(--ink-dim); white-space: nowrap; font-style: italic;
             padding: 0 4px; }

/* ------------------------------------------------- the walk inside a section (`04-LAYOUT`)
   An ordered list that reads as an order: the number is the place in the walk, which is the
   thing R-41 replays and R-43 freezes as scope, so it is drawn rather than implied. */
.walk { list-style: none; counter-reset: place; margin: 6px 0 10px; padding: 0; }
.walk li { counter-increment: place; display: flex; align-items: center; gap: 8px;
           padding: 6px 8px; border-bottom: 1px solid var(--surface-high); }
.walk li::before { content: counter(place); font-variant-numeric: tabular-nums;
                   color: var(--ink-dim); font-size: 12px; min-width: 18px; text-align: right; }
.walk li:last-child { border-bottom: none; }
.walk .who { flex: 1 1 auto; }
.detailrow > td { background: var(--surface-container); }

/* The Location box, once it has something to say. Dashed while empty - the same treatment the
   photograph's empty state uses, and for the same reason: this is a fact the sheet is MISSING,
   not one it does not have. */
/* **The box when it has something to say.** `.where.coming` carried the border, the radius, the
   padding and the min-width, so the filled box inherited none of them and a second place had no
   room drawn for it. One place or four, the box is the same shape and grows downward. */
.where .at { display: block; font-size: 12px; color: var(--ink); white-space: nowrap; }
.where:not(.coming) { border: 1px solid var(--outline); border-radius: 9px; padding: 4px 10px;
                      align-items: flex-start; gap: 1px; min-width: 104px; }
/* The cell that is the line's usual size. A left edge rather than a fill, so the chip still reads
   as the control it is — the marker inside it says what it is, and two signals saying the same
   thing is how `usual` came to look like a button twice. */
.cell-chip.usualsize { border-left: 3px solid var(--primary); }
.cell-chip .usualmark { display: block; padding: 0; }
.cell-chip .rowbtn { display: block; padding: 0; font-size: 11px; }
/* The drag handle. `cursor: grab` and a wide hit area, because the alternative to dragging is
   "Make usual", and somebody who cannot grip this has to reach for that instead. */
.grip { cursor: grab; user-select: none; color: var(--ink-dim); padding: 0 4px; }
.grip:active { cursor: grabbing; }
button.pick { display: block; width: 100%; text-align: left; }

/* ---------------------------------------------------------------- the Inventory editor
 *
 * **Ported from `mockups/inventory-editor.html`, which this screen was supposed to be.** Slice C
 * named the mockup as its reference and listed what ships; the behaviour was built and the shape
 * was not, because §6's evidence rows are all about what refuses what and none of them says what
 * the screen looks like. So nothing could fail. The owner opened it and said so.
 *
 * Three things do the work, and they are why the mockup reads calmly:
 *   1. an **edit mode** — every action is hidden until "Edit assortment" is pressed;
 *   2. the size cells are **chips that disclose their bottles on click**, not stacked panels;
 *   3. the bottle's photograph, whose **absence** is drawn rather than hidden.
 */
.group { border: 1px solid var(--outline); border-radius: var(--radius);
         background: var(--surface); margin-bottom: 12px; }
.group > header { display: flex; gap: 12px; align-items: center; padding: 11px 12px;
                  flex-wrap: wrap; }
.group > header h3 { margin: 0; font-size: 15px; flex: 0 0 auto; }
.group.retired { opacity: .6; }
.group .adopted { font-size: 11px; letter-spacing: .04em; text-transform: uppercase;
                  color: var(--ink-dim); border: 1px solid var(--outline);
                  border-radius: 999px; padding: 1px 8px; }

/* The store's own capture evidence, never a catalog image. A dashed outline means this store has
   no photograph of this bottle yet, which is worth seeing rather than hiding. */
.shot { width: 34px; height: 52px; flex: 0 0 auto; border-radius: 5px;
        background: var(--surface-container); border: 1px solid var(--outline);
        display: grid; place-items: center; overflow: hidden; }
.shot svg { opacity: .5; }
.shot img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; }
.shot.none { border-style: dashed; }

/* Where the line sits. Derived from the layout, never stored here — one line can be in several
   places, and a line in none is worth seeing. */
.where { display: flex; flex-direction: column; gap: 2px; align-items: flex-end;
         flex: 0 0 auto; text-align: right; font-size: 12px; color: var(--ink-dim); }
.where .pin { white-space: nowrap; }
.where .none { color: var(--warn); }

/* The size cells — the owner's "one visible row with separate size cells". */
.cells { display: flex; gap: 7px; flex-wrap: wrap; flex: 1 1 auto; }
.cell-chip { display: flex; flex-direction: column; gap: 1px; align-items: flex-start;
             background: var(--surface-container); border: 1px solid var(--outline);
             border-radius: 9px; padding: 5px 10px; cursor: pointer; color: inherit;
             font: inherit; text-align: left; min-width: 104px; }
.cell-chip:hover, .cell-chip:focus-visible { border-color: var(--primary); }
.cell-chip[aria-expanded="true"] { border-color: var(--primary); background: var(--surface-high); }
.cell-chip .sz { font-size: 14px; font-weight: 600; }
.cell-chip .cd { font-size: 12px; color: var(--ink-dim); font-variant-numeric: tabular-nums; }
.cell-chip .cd.unset { font-style: italic; }
.cell-chip .n { font-size: 11px; color: var(--ink-dim); }
.cell-chip.retired { opacity: .5; }

/* **Scoped to the group it opens inside, because `.detail` is not this panel's name alone.**
   `toast()` gives its second line `class="detail"` too, and an unscoped rule here put a
   `border-top` and 11px of padding on an **inline span** that wraps three lines — an inline box
   breaks into one fragment per line and paints its top border on each, so every toast with a
   detail drew a rule through its own text. It looked like a strikethrough and was a border.
   The owner reported it 2026-11-11 and had seen it before without reporting it.
   `drawDetail` returns this panel as a direct child of `section.group`, every time, so the child
   combinator is exact and says where it belongs. */
.group > .detail { border-top: 1px solid var(--outline); padding: 11px 12px 12px; }
.group > .detail h4 { margin: 0 0 6px; font-size: 13px; text-transform: uppercase;
             letter-spacing: .06em; color: var(--ink-dim); font-weight: 600; }
.upcs { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column;
        gap: 4px; }
.upc { display: flex; align-items: center; gap: 9px; padding: 6px 8px; border-radius: 8px;
       background: var(--surface-container); border: 1px solid transparent; }
.upc:hover { border-color: var(--outline); }
.upc .who { flex: 1 1 auto; min-width: 0; }

.grip { cursor: grab; color: var(--ink-dim); background: none; border: none; padding: 3px 5px;
        border-radius: 6px; touch-action: none; flex: 0 0 auto; }
.grip:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.rowbtn { background: none; border: 1px solid transparent; color: var(--ink-dim); cursor: pointer;
          border-radius: 7px; padding: 3px 8px; font-size: 13px; flex: 0 0 auto; }
.rowbtn:hover { border-color: var(--outline); color: var(--ink); }
.rowbtn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }

/* **The whole reason the mockup reads calmly.** Six actions per line, always visible, is what the
   first build shipped. They appear when the person says they are editing. */
/* **Two toggles for a Location's mode**, because the three stored values are exactly the non-empty
   combinations of two facts: does this hold sealed stock, does it hold open bottles. A pressed
   button is filled rather than merely outlined — at a glance the row's `Bulk | Open` chip and the
   two lit buttons are visibly the same statement. */
.toggles { display: flex; gap: 8px; }
.toggle {
  min-height: 38px; padding: 6px 16px; border-radius: 999px;
  border: 1px solid var(--outline); background: transparent; color: var(--ink-dim);
  font-size: 14px; cursor: pointer;
}
.toggle:hover { border-color: var(--primary); color: var(--ink); }
.toggle[aria-pressed="true"] {
  background: var(--primary); border-color: var(--primary); color: var(--on-primary);
  font-weight: 600;
}
/* Keyboard focus has to be visible on both states, and the filled one hides a default outline. */
.toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* The section editor opens as a row under the one being edited, so the walk position is changed
   while the order around it is visible — moving a section is the one edit that means nothing on
   its own. Set apart from the table rows rather than floating over them. */
tr.editing > td {
  background: var(--surface-container);
  border-top: 1px solid var(--outline);
  padding: 12px 14px;
}
tr.editing .bar { margin-bottom: 8px; }
tr.editing .bar:last-of-type { margin-bottom: 0; }

#assortment:not(.editing) .grip,
#assortment:not(.editing) .rowbtn { display: none; }

.sheetline { color: var(--ink-dim); font-size: 13px; font-variant-numeric: tabular-nums; }

@media (max-width: 620px) {
  .group > header { align-items: flex-start; }
  .cells { flex-basis: 100%; }
  .where { align-items: flex-start; text-align: left; }
}

/* The location box, holding the place the Layout editor's pins will take. Dashed for the same
   reason `.shot.none` is: a fact the sheet is missing, not one it does not have. */
.where.coming { border: 1px dashed var(--outline); border-radius: 9px; padding: 4px 10px;
                align-items: flex-start; gap: 1px; min-width: 104px; }
.where .k { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; }
.where.coming .none { color: var(--ink-dim); font-style: italic; }

/* ------------------------------------------------------------------ leads (2026-11-23)
   A lead is a card, not a table row: nine fields plus a free-text message is wider than a row
   anybody can read, and the decision being made — whether to telephone somebody — wants the
   message and how they count today in front of the eye, not behind a disclosure. */
.lead { padding: 18px; }
#leadList { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(23rem, 1fr)); }

.leadhead { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 14px; }
.leadhead b { font-size: 16px; }

/* Label above value in a narrow card, side by side once there is room for it. A definition list
   because that is what it is — the label is not a column heading, there is one row. */
.leadfacts { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; margin: 0; }
.leadfacts dt { color: var(--ink-dim); font-size: 12px; }
.leadfacts dd { margin: 0; font-size: 14px; }
.leadfacts dd .sub { font-size: 12px; }
@media (max-width: 30rem) {
  .leadfacts { grid-template-columns: 1fr; gap: 2px; }
  .leadfacts dd { margin-bottom: 8px; }
}

/* What they typed, set apart as a quotation because it is theirs and not ours. */
.leadsaid {
  margin: 14px 0 0; padding: 10px 14px; font-size: 14px;
  border-left: 3px solid var(--outline); background: var(--surface-container);
  border-radius: 0 var(--radius) var(--radius) 0; white-space: pre-wrap;
}

/* The six, as six buttons. **Not a `<select>`**: a dropdown hides five of the six behind a click
   and gives no room for what each one means, and this is the one thing the screen does. The
   current state's button is disabled, so the row also reads as where the lead is. */
.leadmove { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.leadmove button { font-size: 13px; padding: 6px 12px; }
.leadmove button:disabled { opacity: 1; border-color: var(--primary); color: var(--primary); }
.leadmeaning { margin: 8px 0 0; }

/* The lead a notice mail's link pointed at, among the others. A ring rather than a different
   background: it says "this is the one you asked for" without implying a different kind of row. */
.lead.picked { box-shadow: 0 0 0 2px var(--primary); }

/* What is odd about a submission, when something is. Warning-coloured and not an `.alert`: it
   is a thing to know before telephoning somebody, not a failure of this screen. */
.leadcaution { margin: 12px 0 0; font-size: 13px; color: var(--warn); }

/* The one act on a lead card that is not a state change: it creates an organisation and sends
   an invitation. **Outlined rather than filled**, which is the whole of the decision here — a
   `primary` button is right for the one act in a dialog and wrong twenty times down a list,
   where it stops being emphasis and becomes the background. Outlined still says "not one of the
   six" without a wall of colour. */
.lead .leadonboard {
  display: block;
  margin-top: 0.9rem;
  background: transparent;
  color: var(--primary);
  border-color: var(--primary);
  font-weight: 600;
}
.lead .leadonboard:hover { background: rgba(0, 229, 255, .10); }
