/* Blue Skies Studio: base styles (docs/design/README.md, docs/design/tokens.json).
   Phone first (390 px); the side menu appears from 60rem (960 px).
   No inline styles anywhere: the Content Security Policy blocks them. Fonts are self-hosted (OFL). */

/* ---------- Fonts ---------- */
@font-face { font-family: "IBM Plex Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-500.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-600.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Sans"; font-weight: 700; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexSans-700.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 400; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexMono-400.woff2") format("woff2"); }
@font-face { font-family: "IBM Plex Mono"; font-weight: 500; font-style: normal; font-display: swap; src: url("../fonts/IBMPlexMono-500.woff2") format("woff2"); }

/* ---------- Tokens (every token in tokens.json) ---------- */
:root {
  /* Color (light theme). Named by role so a dark theme can be added without renaming. */
  --bench: #F7FAFD;
  --panel: #FFFFFF;
  --line: #BFDDF0;
  --divider: #E3EFF8;
  --control-border: #8C8F96;
  --ink: #1B1D21;
  --ink-muted: #5A5E66;
  /* The logo's two colors. Navy acts (buttons, links, focus); sky highlights and is never text on white. */
  --navy: #0F2A47;
  --navy-strong: #0A1E33;
  --sky: #58AAD9;
  --sky-tint: #E8F4FB;
  --menu-ink: #E3EEF7;
  --menu-muted: #A9C6DD;
  /* The accent a person's color scheme swaps; Studio's default is navy. */
  --accent: var(--navy);
  --accent-strong: var(--navy-strong);
  --accent-tint: var(--sky-tint);
  --hot-end: #E8590C;
  --plate: #0F2A47;
  --plate-dot: #2A4A6C;
  --plate-ink: #E3EEF7;
  --good: #17784A;
  --warn: #9A5B00;
  --bad: #BF3326;

  /* Type */
  --font-sans: "IBM Plex Sans", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, monospace;
  --display: 600 32px/36px var(--font-sans);
  --title: 600 22px/28px var(--font-sans);
  --heading: 600 16px/22px var(--font-sans);
  --body: 400 15px/22px var(--font-sans);
  --small: 400 13px/18px var(--font-sans);
  --tag: 500 11px/14px var(--font-mono);
  --number: 500 14px/20px var(--font-mono);

  /* Spacing, corners, shadow */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;
  --shadow-card: 0 1px 2px rgba(15,42,71,.05), 0 6px 18px rgba(88,170,217,.12);
  --shadow-raise: 0 1px 0 rgba(27,29,33,.06), 0 2px 8px rgba(27,29,33,.06);

  /* Layout (not design tokens): control height and the phone bars. */
  --control-h: 44px;
  --bottombar-h: 64px;
}

/* ---------- Color schemes: a per-person setting. Only the three accent variables change. ---------- */
[data-scheme="purple"] { --accent: #6B3FD4; --accent-strong: #5530B5; --accent-tint: #EEE8FB; }
[data-scheme="teal"] { --accent: #0E6670; --accent-strong: #0A5058; --accent-tint: #E0EFF0; }
[data-scheme="magenta"] { --accent: #B0246F; --accent-strong: #8F1C5A; --accent-tint: #F9E5F0; }
[data-scheme="graphite"] { --accent: #2F3338; --accent-strong: #1B1D21; --accent-tint: #E7E8EA; }

@media (min-width: 60rem) { :root { --control-h: 36px; } }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { margin: 0; background: var(--bench); color: var(--ink); font: var(--body); }
/* The work area's faint blueprint grid (served from our own static files): fixed and covering, behind everything.
   A fixed layer rather than background-attachment: fixed, which phones ignore or repaint slowly. */
body::before { content: ""; position: fixed; inset: 0; z-index: -1; background: var(--bench) url("../img/grid-background.png") center / cover no-repeat; pointer-events: none; }
h1, h2, h3, p, ul, ol, dl, figure { margin: 0; }
h1 { font: var(--title); }
h2 { font: var(--heading); }
h3 { font: var(--heading); }
/* Page titles and card headings are navy (the accent); on the plate they keep the plate's ink. */
h1, h2, .card-title { color: var(--accent); }
.plate h1, .plate h2, .plate h3, .plate .card-title { color: inherit; }
.display { font: var(--display); }
img { max-width: 100%; display: block; }
hr, .rule { border: 0; border-top: 1px solid var(--divider); margin: var(--space-4) 0; }

a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--accent-strong); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.small { font: var(--small); }
.muted { color: var(--ink-muted); }
.tag { font: var(--tag); letter-spacing: .06em; text-transform: uppercase; }
.num { font: var(--number); font-variant-numeric: tabular-nums; }
.mono { font-family: var(--font-mono); }
.good { color: var(--good); }
.warn { color: var(--warn); }
.bad { color: var(--bad); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--space-2); top: -100px; z-index: 10; padding: var(--space-2) var(--space-3); background: var(--panel); border-radius: var(--radius-md); box-shadow: var(--shadow-raise); }
.skip:focus { top: var(--space-2); }

.stack { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-lg { display: flex; flex-direction: column; gap: var(--space-6); }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }

/* ---------- Icons: line icons, 1.5px stroke, 20px in controls and 16px inline ---------- */
.icon { width: 20px; height: 20px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.icon-sm { width: 16px; height: 16px; }

/* ---------- Buttons: 36px on desktop, 44px on phones. No pills. ---------- */
button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: var(--control-h); padding: 0 14px; border: 1px solid var(--control-border); border-radius: var(--radius-md);
  background: var(--panel); color: var(--ink); font: var(--body); font-weight: 500; text-decoration: none; cursor: pointer;
}
button:hover, .btn:hover { color: var(--ink); background: var(--bench); }
/* Secondary buttons: white, a sky outline, navy text. */
.btn:not(.btn-primary, .btn-danger, .btn-link), button:not([class]), button.btn-icon { border-color: var(--sky); color: var(--accent); }
.btn:not(.btn-primary, .btn-danger, .btn-link):hover, button:not([class]):hover, button.btn-icon:hover { border-color: var(--accent); background: var(--sky-tint); color: var(--accent); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #FFFFFF; }
.btn-primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); color: #FFFFFF; }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #FFFFFF; }
.btn-danger:hover { background: #9E2A1F; border-color: #9E2A1F; color: #FFFFFF; }
.btn-link { border-color: transparent; background: none; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; padding: 0 var(--space-2); }
.btn-link:hover { background: none; color: var(--accent-strong); }
.btn-block { width: 100%; }

/* ---------- Inputs ---------- */
input, select, textarea { font: var(--body); color: var(--ink); }
input:not([type="checkbox"], [type="radio"], [type="hidden"], [type="file"]), select, textarea {
  display: block; width: 100%; min-height: var(--control-h); padding: 0 var(--space-3);
  background: var(--panel); border: 1px solid var(--control-border); border-radius: var(--radius-md);
}
textarea { padding: var(--space-2) var(--space-3); min-height: 6rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
input[type="file"] { display: block; width: 100%; padding: var(--space-2) 0; font: var(--small); }
input[type="file"]::file-selector-button {
  min-height: var(--control-h); margin-right: var(--space-3); padding: 0 14px; border: 1px solid var(--sky);
  border-radius: var(--radius-md); background: var(--panel); color: var(--accent); font: var(--body); font-weight: 500; cursor: pointer;
}
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; margin: 0; flex: none; accent-color: var(--accent); }

.field { display: flex; flex-direction: column; gap: var(--space-1); }
.field > label, .label { font-weight: 500; }
.field .help { font: var(--small); color: var(--ink-muted); }
.field .help ul { padding-left: var(--space-4); }
/* On phones, short text links (help text, footnotes) still get a 44px tap target. */
@media (max-width: 59.99rem) { .field .help a, .footnote a, .dialog-body p a { display: inline-flex; align-items: center; min-height: 44px; } }
.check { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; font-weight: 400; cursor: pointer; }
.errorlist { list-style: none; margin: 0; padding: 0; color: var(--bad); font: var(--small); font-weight: 500; }
.field.has-error input, .field.has-error select, .field.has-error textarea, .field.has-error .affix { border-color: var(--bad); }
fieldset { margin: 0; padding: 0; border: 0; min-width: 0; }
legend { padding: 0; font-weight: 500; }

/* ---------- Panels, tables, tags ---------- */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: var(--space-4); box-shadow: var(--shadow-card); }
.panel-flush { padding: 0; overflow: hidden; }
.chip { display: inline-block; padding: 2px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bench); color: var(--ink); }

.table-wrap { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; }
.table th { padding: 10px var(--space-3); border-bottom: 1px solid var(--divider); text-align: left; color: var(--ink-muted); font: var(--tag); letter-spacing: .06em; text-transform: uppercase; }
.table td { padding: 10px var(--space-3); border-bottom: 1px solid var(--divider); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table .num, .table th.num { text-align: right; }

/* Status always has a word too; the dot is only a helper. */
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 4px; margin-right: 6px; vertical-align: 1px; background: var(--ink-muted); }
.dot.good { background: var(--good); }
.dot.warn { background: var(--warn); }
.dot.bad { background: var(--bad); }
.dot.hot { background: var(--hot-end); }

/* ---------- The build plate: dark, dotted work area behind photos and empty states ---------- */
.plate {
  background-color: var(--plate); color: var(--plate-ink); border-radius: var(--radius-lg);
  background-image: radial-gradient(var(--plate-dot) 1px, transparent 1.5px); background-size: var(--space-4) var(--space-4);
}
.plate a { color: var(--plate-ink); }
.thumb { display: block; width: 44px; height: 44px; flex: none; border-radius: var(--radius-md); object-fit: cover; background-color: var(--plate); background-image: radial-gradient(var(--plate-dot) 1px, transparent 1.5px); background-size: 8px 8px; }
.empty { display: flex; flex-direction: column; align-items: center; gap: var(--space-4); padding: var(--space-8) var(--space-4); text-align: center; }
.empty .btn { border-color: var(--plate-ink); }

/* ---------- Collapsible cards: a header plus a one-line summary when closed ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); }
.card > summary {
  display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) var(--space-4);
  list-style: none; cursor: pointer; border-radius: var(--radius-lg);
}
.card > summary::-webkit-details-marker { display: none; }
.card-head { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.card-title { font: var(--heading); }
.card-sum { font: var(--small); font-family: var(--font-mono); color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card[open] .card-sum { display: none; }
.card .chev { color: var(--ink-muted); transition: transform .15s; }
.card[open] .chev { transform: rotate(180deg); }
.card-body[id] { scroll-margin-top: 72px; }
.card-body { padding: 0 var(--space-4) var(--space-4); display: flex; flex-direction: column; gap: var(--space-4); }

/* Rows inside a card (health checks, switches, activity). */
.rows { list-style: none; padding: 0; margin: 0; }
.rows > li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-top: 1px solid var(--divider); }
.rows > li:first-child { border-top: 0; padding-top: 0; }
.rows .grow { flex: 1 1 14rem; min-width: 0; }
.rows form { margin: 0; }

/* ---------- Messages ---------- */
.notices { list-style: none; padding: 0; margin: 0 0 var(--space-4); display: flex; flex-direction: column; gap: var(--space-2); }
.notice { display: flex; align-items: baseline; gap: var(--space-2); padding: var(--space-3) var(--space-4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.notice .tag { flex: none; }
.notice-success .tag { color: var(--good); }
.notice-error .tag { color: var(--bad); }
.notice-warning .tag { color: var(--warn); }

/* ---------- Page header ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.page-head-text { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.back { display: inline-flex; align-items: center; gap: var(--space-1); min-height: 44px; margin-bottom: var(--space-1); }

/* ---------- Shop layout: top bar + bottom bar on phones, side menu on desktop ---------- */
.mark { display: block; flex: none; height: 28px; width: auto; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand-name { font-weight: 600; line-height: 18px; overflow-wrap: anywhere; }
/* The shop's own logo in place of the mark (notes row 66): 32 px tall, never wider than 128 px. */
.shop-logo { display: block; flex: none; height: 32px; width: auto; max-width: 128px; object-fit: contain; border-radius: var(--radius-sm); }
.logo-preview { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-4); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bench); }
.logo-preview-header img { display: block; height: 32px; width: auto; max-width: 128px; object-fit: contain; }
.logo-preview-icon img { display: block; border: 1px solid var(--line); border-radius: var(--radius-md); }

.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: var(--space-3); min-height: 53px; padding: var(--space-3) var(--space-4); background: var(--bench); border-bottom: 1px solid var(--divider); }
.main { min-width: 0; padding: var(--space-4) var(--space-4) calc(var(--bottombar-h) + var(--space-6) + env(safe-area-inset-bottom)); }
.bottombar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5; display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: var(--space-1);
  padding: var(--space-1) var(--space-1) calc(var(--space-1) + env(safe-area-inset-bottom)); background: var(--navy);
}
.bottombar a {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: calc(var(--bottombar-h) - 2 * var(--space-1));
  border-radius: var(--radius-md); color: var(--menu-ink); font-size: 12px; line-height: 16px; text-decoration: none;
}
.bottombar a:hover { color: var(--menu-ink); }
.bottombar a .icon { width: 22px; height: 22px; }
.bottombar a[aria-current="page"] { background: var(--sky); color: var(--navy); font-weight: 600; }
.bottombar a:focus-visible, .side a:focus-visible { outline-color: var(--menu-ink); }
.side { display: none; }

/* ---------- The Unsaved changes bar (static/js/unsaved.js): above the phone's bottom menu, or the foot of the main
   column. The page keeps --dock-h of room under it, and a focused field scrolls clear of it. Under the dialogs. ---------- */
.unsaved-dock:not([hidden]) {
  position: fixed; left: 0; right: 0; bottom: calc(var(--bottombar-h) + env(safe-area-inset-bottom)); z-index: 4;
  display: flex; flex-direction: column; background: var(--panel); border-top: 2px solid var(--accent); box-shadow: 0 -2px 8px rgba(27,29,33,.08);
}
.unsaved-bar:not([hidden]) { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); padding: var(--space-2) var(--space-4); }
.unsaved-bar + .unsaved-bar { border-top: 1px solid var(--divider); }
.unsaved-text { flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; font: var(--small); }
.unsaved-actions { display: flex; flex: 1 0 auto; gap: var(--space-2); }
.unsaved-actions button { flex: 1; min-width: 6rem; min-height: 44px; justify-content: center; }
.unsaved-mark { display: flex; flex-direction: column; gap: var(--space-1); }
.has-unsaved [data-card-save] { display: none; }
.unsaved-notices { position: fixed; left: var(--space-4); right: var(--space-4); bottom: calc(var(--bottombar-h) + var(--space-3) + env(safe-area-inset-bottom)); z-index: 6; margin: 0; }
.unsaved-notices .notice { box-shadow: var(--shadow-raise); }
.has-unsaved { scroll-padding-bottom: calc(var(--bottombar-h) + var(--dock-h, 0px) + var(--space-4)); }
.has-unsaved .main { padding-bottom: calc(var(--bottombar-h) + var(--dock-h, 0px) + var(--space-6) + env(safe-area-inset-bottom)); }
@media (min-width: 60rem) {
  .unsaved-dock:not([hidden]) { left: calc(232px + var(--space-8)); right: auto; bottom: 0; width: calc(100% - 232px - 2 * var(--space-8)); max-width: calc(72rem - 2 * var(--space-8)); border: 1px solid var(--line); border-top: 2px solid var(--accent); border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
  .unsaved-actions { flex: none; }
  .unsaved-notices { left: auto; right: var(--space-8); bottom: var(--space-6); }
  .has-unsaved { scroll-padding-bottom: calc(var(--dock-h, 0px) + var(--space-4)); }
  .has-unsaved .main { padding-bottom: calc(var(--dock-h, 0px) + var(--space-8)); }
}

@media (min-width: 60rem) {
  .app { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
  .topbar, .bottombar { display: none; }
  .side { position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--space-6); padding: 20px var(--space-3); background: var(--navy); color: var(--menu-ink); }
  .side .brand { padding: 0 var(--space-3); }
  .main { padding: var(--space-6) var(--space-8) var(--space-8); max-width: 72rem; }
}

.menu { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 2px; }
/* The side menu: navy, menu-ink text, the selected item a sky block with navy text (the same in every color scheme). */
.menu a { display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--menu-ink); text-decoration: none; }
.menu a:hover { background: rgba(227,238,247,.1); color: var(--menu-ink); }
.menu a[aria-current="page"] { background: var(--sky); color: var(--navy); font-weight: 600; }
.side-logo { display: block; width: 100%; max-width: 196px; height: auto; padding: 0 var(--space-3); }
.side .brand-name { color: var(--menu-ink); }
.side .muted { color: var(--menu-muted); }
/* A shop's own logo may be dark: it sits on a small white plate in the navy menu. */
.side .shop-logo { padding: 2px; background: var(--panel); box-sizing: content-box; }

.meter { margin-top: auto; padding: var(--space-3); background: rgba(227,238,247,.06); border: 1px solid var(--plate-dot); border-radius: var(--radius-lg); }
.meter .warn { color: var(--menu-ink); font-weight: 600; }
.meter .num { display: block; margin: var(--space-1) 0 var(--space-2); }
.meter progress { display: block; width: 100%; height: 6px; border: 0; border-radius: 3px; background: var(--plate-dot); color: var(--sky); appearance: none; -webkit-appearance: none; }
.meter progress::-webkit-progress-bar { background: var(--plate-dot); border-radius: 3px; }
.meter progress::-webkit-progress-value { background: var(--sky); border-radius: 3px; }
.meter progress::-moz-progress-bar { background: var(--sky); border-radius: 3px; }
.meter.is-warn progress::-webkit-progress-value { background: var(--hot-end); }
.meter.is-warn progress::-moz-progress-bar { background: var(--hot-end); }
.meter .warn { display: block; margin-top: var(--space-2); }

/* ---------- Plain layout: public site, sign-in and error pages ---------- */
.plainbar { display: flex; align-items: center; min-height: 53px; padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.wordmark { display: inline-flex; align-items: center; gap: 10px; min-height: 44px; color: var(--ink); font-weight: 600; text-decoration: none; }
.wordmark:hover { color: var(--ink); }
.wordmark-mark { display: block; flex: none; height: 28px; width: auto; }
.plain-main { width: 100%; max-width: 60rem; margin: 0 auto; padding: var(--space-6) var(--space-4) var(--space-8); }
.entrance { max-width: 28rem; }
.entrance .panel { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 60rem) {
  .plainbar { padding: var(--space-3) var(--space-8); }
  .plain-main { padding: var(--space-8); }
  .entrance .panel { padding: var(--space-6); }
}
.hero { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-8) 0; }
.hero p { max-width: 36rem; }

/* ---------- Products list: a table on desktop, rows of cards on phones ---------- */
.products-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.products-main { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
.coll-panel { display: none; }
.coll-picker > summary { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: var(--space-2) var(--space-4); list-style: none; cursor: pointer; }
.coll-picker > summary::-webkit-details-marker { display: none; }
.coll-picker .picker-current { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.coll-picker .chev { color: var(--ink-muted); transition: transform .15s; }
.coll-picker[open] .chev { transform: rotate(180deg); }
.coll-body { padding-top: 0; }
.coll-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.coll-list a { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: 44px; padding: 0 var(--space-3); border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.coll-list a:hover { background: var(--bench); color: var(--ink); }
.coll-list a[aria-current="page"] { background: var(--accent-tint); color: var(--accent); font-weight: 600; }
.coll-list .num { color: var(--ink-muted); }
.coll-list a[aria-current="page"] .num { color: var(--accent); }
.btn-dashed { border-style: dashed; border-color: var(--control-border); }
@media (min-width: 60rem) {
  .products-layout { display: grid; grid-template-columns: 13.5rem minmax(0, 1fr); align-items: start; gap: var(--space-6); }
  .coll-panel { display: block; position: sticky; top: var(--space-6); }
  .coll-picker { display: none; }
  .coll-list a { min-height: 36px; }
}

.tabs { display: flex; gap: var(--space-1); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; border-bottom: 1px solid var(--divider); }
.tabs a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 var(--space-3); color: var(--ink-muted); text-decoration: none; white-space: nowrap; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -3px 0 var(--sky); }
.tabs .num { font-size: 13px; }

.status { display: inline-flex; align-items: center; white-space: nowrap; font: var(--small); }
.dot-hollow { background: none; border: 1.5px solid var(--ink-muted); }
.sku-line { display: block; font: var(--small); font-family: var(--font-mono); color: var(--ink-muted); overflow-wrap: anywhere; }
.phone-only { display: none; }

.product-name { color: var(--ink); font-weight: 600; text-decoration-color: var(--control-border); overflow-wrap: anywhere; }
.product-name:hover { color: var(--accent); }
.product-name::after { content: ""; position: absolute; inset: 0; }
.product-table tr { position: relative; }
.product-table tbody tr:hover { background: var(--bench); }
.product-table .thumb-cell { width: 68px; padding-right: 0; }
/* The owner's tick boxes: above the row's link (.product-name::after), 44 px to tap. */
.product-table .pick-cell { width: 52px; padding: 0 0 0 var(--space-2); }
.pick { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; width: 44px; min-height: 44px; cursor: pointer; }
.pick-all { margin: 0; }
.send-selected { position: relative; }
.send-selected > summary { gap: var(--space-1); }
.send-selected [data-pick-count]:empty { display: none; }
.send-selected .split-pop { right: auto; left: 0; width: min(19rem, calc(100vw - 4 * var(--space-4))); }
.send-selected .split-pop form { margin: 0; }
.send-selected .split-pop p { margin: 0; padding: var(--space-2) var(--space-3); }
.send-selected .split-pop .btn-link { display: flex; align-items: center; padding: 0 var(--space-3); font: var(--body); text-align: left; }
.csv-cell { overflow-wrap: anywhere; }
@media (min-width: 60rem) { .send-selected .split-pop { right: 0; left: auto; } }
@media (max-width: 59.99rem) {
  .phone-only { display: inline; }
  .product-panel { background: none; border: 0; border-radius: 0; overflow: visible; }
  .product-table, .product-table tbody { display: block; }
  .product-table thead { display: none; }
  .product-table tbody { display: flex; flex-direction: column; gap: var(--space-2); }
  .product-table tr {
    display: grid; grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "thumb name date" "thumb status status";
    column-gap: var(--space-3); row-gap: 2px; align-items: center; padding: 10px; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg);
  }
  .product-table.has-picks tr { grid-template-columns: 44px 56px minmax(0, 1fr) auto; grid-template-areas: "pick thumb name date" "pick thumb status status"; padding-left: 0; column-gap: var(--space-2); }
  .product-table .pick-cell { grid-area: pick; width: auto; }
  .list-actions > .btn, .send-selected > summary { padding-inline: var(--space-3); }
  .product-table td { padding: 0; border: 0; }
  .product-table .thumb-cell { grid-area: thumb; width: auto; }
  .product-table .thumb-cell .thumb { width: 56px; height: 56px; }
  .product-table .name-cell { grid-area: name; }
  .product-table .status-cell { grid-area: status; }
  .product-table .variants-cell { display: none; }
  .product-table .date-cell { grid-area: date; align-self: start; font-size: 13px; }
}

/* ---------- Product page ---------- */
.title-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.product-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.product-main, .product-side { min-width: 0; }
/* Two columns from 1200 px, as in docs/design/mockups/product-desktop.html: the main work on the left (the
   Details card first, then the variant table, or the Production card for a product with no options) and a 22rem column on the right. */
@media (min-width: 75rem) {
  .product-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; gap: var(--space-6); }
}
/* The product checklist (notes row 52): full width under the tabs, needed and suggested side by side from 48rem.
   Each state has an icon, a color and a word; the three colors also differ in lightness. */
.checklist-wrap { margin-bottom: var(--space-4); }
.checklist-body { display: grid; gap: var(--space-4); }
@media (min-width: 48rem) { .checklist-body { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-6); } }
.check-group h3 { margin: 0 0 var(--space-1); }
.check-list { list-style: none; margin: 0; padding: 0; }
.check-item + .check-item { border-top: 1px solid var(--divider); }
.check-row { display: grid; grid-template-columns: 20px 6.5rem minmax(0, 1fr) auto; align-items: center; gap: var(--space-2); min-height: 44px; padding: var(--space-1) 0; color: var(--ink); text-decoration: none; }
a.check-row:hover .check-label { text-decoration: underline; }
a.check-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--radius-sm); }
.check-mark { display: grid; place-items: center; width: 20px; height: 20px; border-radius: var(--radius-sm); color: #FFFFFF; }
.check-mark .icon { stroke-width: 2.5; }
.check-word { font: var(--tag); letter-spacing: .06em; text-transform: uppercase; }
.check-text { display: flex; flex-direction: column; min-width: 0; }
.check-note { font: var(--small); color: var(--ink-muted); }
.check-go { color: var(--ink-muted); }
.is-missing .check-mark { background: var(--bad); }
.is-missing .check-word { color: var(--bad); }
.is-suggested .check-mark { background: var(--warn); }
.is-suggested .check-word { color: var(--warn); }
.is-done .check-mark { background: var(--good); }
.is-done .check-word { color: var(--good); }

/* The Production card (notes row 5): facts only, each with its Edit link. */
.prod-facts dd { display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.prod-value { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; align-items: center; gap: var(--space-1) var(--space-3); }
.prod-edit { display: inline-flex; align-items: center; min-height: var(--control-h); }
.prod-note { font: var(--small); color: var(--ink-muted); text-align: right; }
.prod-facts > div { align-items: center; }

.form-narrow { max-width: 40rem; }
.add-options { padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.footnote { margin-top: var(--space-4); }
.delete-card { margin-top: var(--space-6); }

.card-intro { margin: 0 0 var(--space-3); }
.options-box { border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bench); }
/* Each option folds on the Variants card (notes row 35): name, values and what it changes; opened, its form. */
.option-fold { border-bottom: 1px solid var(--divider); }
.option-fold:last-child { border-bottom: 0; }
.option-fold > summary { list-style: none; cursor: pointer; }
.option-fold > summary::-webkit-details-marker { display: none; }
.option-row { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); }
.option-fold[open] > .option-row { border-bottom: 1px solid var(--divider); }
.option-fold[open] .option-open { background: var(--accent-tint); border-color: var(--accent); color: var(--accent); }
.option-body { padding: var(--space-4); background: var(--panel); }
.option-fold:last-child .option-body { border-radius: 0 0 var(--radius-md) var(--radius-md); }
.option-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3); padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.option-foot .move-buttons { align-items: center; }
.add-options .option-fold { border: 1px solid var(--line); border-radius: var(--radius-md); }
.option-text { flex: 1 1 16rem; min-width: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.option-name { font-weight: 600; font-size: 15px; line-height: 22px; }
.option-actions { display: flex; align-items: center; gap: var(--space-2); }
.option-empty { padding: var(--space-3) var(--space-4); border-bottom: 1px solid var(--divider); }
.move-buttons { display: flex; gap: var(--space-1); }
.chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.chips .chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; background: var(--panel); border-color: var(--line); font: var(--small); }
.add-option-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding: 0 var(--space-4); color: var(--accent); }
.add-option { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 48px; font-weight: 500; }
.btn-icon { width: var(--control-h); padding: 0; }
.btn-icon:disabled { opacity: .4; cursor: default; }
.swatch-dot { width: 12px; height: 12px; flex: none; display: inline-block; vertical-align: -1px; margin-right: 6px; }
.swatch-dot rect { stroke: rgba(27,29,33,.35); stroke-width: 1; }
.chips .swatch-dot { margin-right: 0; }

/* The variant list: aligned columns on desktop; on phones the name, then the numbers with their labels. */
.vlist { border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }
.vrows { list-style: none; margin: 0; padding: 0; }
.vrow {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name name" "sku sku" "g t" "l l";
  gap: 2px var(--space-3); padding: 10px var(--space-4); min-height: 44px; border-top: 1px solid var(--divider); color: var(--ink); text-decoration: none;
}
.vrows li:first-child .vrow { border-top: 0; }
.vrow:hover { background: var(--bench); color: var(--ink); }
.vrow .vname { grid-area: name; font-weight: 600; overflow-wrap: anywhere; }
.vrow .vsku { grid-area: sku; font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }
.vrow .n { font: var(--number); font-size: 13px; color: var(--ink-muted); }
.vrow .n.own { color: var(--ink); font-weight: 600; }
.vrow .n:nth-of-type(3) { grid-area: g; }
.vrow .n:nth-of-type(4) { grid-area: t; text-align: right; }
.vrow .n:nth-of-type(5) { grid-area: l; }
.cell-label { font-family: var(--font-sans); }
.vhead { display: none; }
.vgroup { border-top: 1px solid var(--divider); }
.vgroup:first-of-type { border-top: 0; }
.vgroup > summary { display: flex; flex-wrap: wrap; align-items: center; gap: 2px var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-4); background: var(--bench); list-style: none; cursor: pointer; }
.vgroup > summary::-webkit-details-marker { display: none; }
.vgroup .chev { color: var(--ink-muted); transform: rotate(-90deg); transition: transform .15s; }
.vgroup[open] .chev { transform: none; }
.vgroup-name { font-weight: 600; }
.vgroup .vrows { border-top: 1px solid var(--divider); }
@media (min-width: 60rem) {
  /* Fits the left column at 1200 px (two columns, scrollbar included): about 26rem at the narrowest. */
  .vrow, .vhead { display: grid; grid-template-columns: minmax(5rem, 1fr) minmax(5rem, 11rem) 4rem 5rem 5rem; grid-template-areas: none; align-items: center; gap: var(--space-2); }
  .vrow .vname, .vrow .vsku, .vrow .n, .vrow .n:nth-of-type(n) { grid-area: auto; }
  .vrow .n, .vhead .n { text-align: right; }
  .vrow .n { font-size: 14px; }
  .vhead .n { font: var(--tag); color: var(--ink-muted); }
  .vhead { padding: 8px var(--space-4); border-bottom: 1px solid var(--divider); color: var(--ink-muted); font: var(--tag); letter-spacing: .06em; text-transform: uppercase; min-height: 0; }
  .cell-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

/* A variant's own page (notes row 35): the variants listed on the left on desktop; "Variant 2 of 6" with the one before
   and after on phones. The current variant has the accent tint and a 1px accent border all round. */
.variant-pager { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.variant-pager .btn-icon { width: 44px; min-height: 44px; }
.variant-pager [aria-disabled="true"] { opacity: .4; cursor: default; }
.pager-count { font-weight: 600; }
.variant-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.variant-main { min-width: 0; }
.variant-nav { display: none; }
@media (min-width: 60rem) {
  .variant-pager { display: none; }
  .variant-layout { display: grid; grid-template-columns: 17rem minmax(0, 1fr); align-items: start; gap: var(--space-6); }
  .variant-nav { display: block; position: sticky; top: var(--space-6); max-height: calc(100vh - 2 * var(--space-6)); overflow-y: auto; padding: var(--space-2); }
}
.variant-nav-head { margin: 0; padding: var(--space-2) var(--space-3); }
.variant-nav-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.variant-nav-list a { display: flex; flex-direction: column; gap: 2px; min-height: 44px; padding: var(--space-2) var(--space-3); border: 1px solid transparent; border-radius: var(--radius-md); color: var(--ink); text-decoration: none; }
.variant-nav-list a:hover { background: var(--bench); color: var(--ink); }
.variant-nav-list a[aria-current="page"] { background: var(--accent-tint); border-color: var(--accent); }
.vn-name { font-weight: 600; overflow-wrap: anywhere; }
.vn-sku { font-size: 13px; color: var(--ink-muted); overflow-wrap: anywhere; }

.facts { margin: 0; display: flex; flex-direction: column; }
.facts > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--divider); }
.facts > div:first-child { border-top: 0; padding-top: 0; }
.facts dt { color: var(--ink-muted); }
.facts dd { margin: 0; text-align: right; }
.source { display: inline-block; margin-left: var(--space-2); font: var(--tag); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.source.own { color: var(--accent); }

.value-rows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.value-row { display: flex; flex-direction: column; gap: var(--space-2); padding-bottom: var(--space-3); border-bottom: 1px solid var(--divider); }
.value-tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.swatch-check { min-height: 44px; }
input[type="color"].color-input { width: 56px; min-height: var(--control-h); padding: 4px; }
.going { margin: 0; padding-left: var(--space-6); display: flex; flex-direction: column; gap: var(--space-1); }

/* ---------- Product tabs and the Files tab ---------- */
.product-tabs { margin-bottom: var(--space-4); }
.change-item + .change-item::before { content: ", "; }
.sources { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.source-line { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: 0; min-height: 32px; }
.source-line .btn-link { min-height: 44px; padding: 0; }
.source-line .source { margin-left: 0; }

.files-layout { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 60rem) {
  .files-layout { display: grid; grid-template-columns: minmax(0, 24rem) minmax(0, 1fr); align-items: start; gap: var(--space-6); }
  .file-details { position: sticky; top: var(--space-6); }
}
.add-file {
  display: flex; flex-direction: column; align-items: center; gap: var(--space-2); padding: var(--space-4);
  border: 1.5px dashed var(--control-border); border-radius: var(--radius-lg); text-align: center; color: var(--accent);
}
.add-file-title { color: var(--ink); font-weight: 600; }
.add-file input[type="file"] { max-width: 100%; text-align: left; }
.add-file .btn-primary { width: 100%; }
.file-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.file-row {
  display: flex; flex-direction: column; gap: 2px; padding: var(--space-3) var(--space-4); min-height: 44px;
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); color: var(--ink); text-decoration: none;
}
.file-row:hover { border-color: var(--control-border); color: var(--ink); }
.file-row[aria-current="true"] { background: var(--accent-tint); border-color: var(--accent); }
.file-row-top { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--space-2); }
.file-name { font-size: 14px; overflow-wrap: anywhere; }
.kind-tag { flex: none; padding: 1px 6px; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--bench); font: var(--tag); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.kind-tag.hot { border-color: var(--hot-end); color: var(--ink); }
.kind-tag.bad { border-color: var(--bad); color: var(--bad); }

.file-plate { display: flex; flex-wrap: wrap; gap: var(--space-3); padding: var(--space-4); min-height: 12rem; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
.plate-picture { margin: 0; flex: 1 1 14rem; display: flex; flex-direction: column; gap: var(--space-2); }
.plate-picture img { width: 100%; max-height: 22rem; object-fit: contain; border-radius: var(--radius-md); }
.file-plate-empty { flex-direction: column; justify-content: space-between; min-height: 14rem; overflow-wrap: anywhere; }
.file-body { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-4); }
.file-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.file-title { font: var(--number); font-size: 16px; overflow-wrap: anywhere; }
.file-actions { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-2); }
.replace-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); flex: 1 1 14rem; }
.replace-form label { flex-basis: 100%; font: var(--small); color: var(--ink-muted); }
.replace-form input[type="file"] { flex: 1 1 12rem; width: auto; }
/* With files-replace.js the button opens the picker itself: the picker and its label are hidden, not removed. */
.replace-form.picker-only { flex: 0 0 auto; }
.replace-form.picker-only label, .replace-form.picker-only input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
.reading { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: baseline; font-weight: 600; }
.file-facts dt { align-self: center; }
.filaments { list-style: none; margin: var(--space-1) 0 0; padding: 0; font: var(--small); }
/* "Makes [N] items" (notes row 63): the number between its words, the "?" beside it. */
.makes-field { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.makes-field .makes-input { width: 5.5rem; min-height: 44px; }
.add-file .makes-field { color: var(--ink); }
.file-makes { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); }
.file-makes > p { flex-basis: 100%; margin: 0; }
.used-by { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.used-by a, .bad-link { display: inline-flex; align-items: center; min-height: 44px; }
.bad-link { color: var(--bad); }
.stack-tight { display: flex; flex-direction: column; gap: 2px; margin: 0; }
/* Which variants a file is for (upload box and For page), and the "Use for pricing" card. */
.file-for { display: flex; flex-direction: column; align-self: stretch; text-align: left; color: var(--ink); }
.file-for legend { font-weight: 600; margin-bottom: var(--space-1); }
.file-for-values { display: flex; flex-direction: column; padding-left: var(--space-6); }
.file-for-values .tag { margin: var(--space-2) 0 0; }
.pick-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); }
.pick-row + .pick-row { padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.pick-label { flex-basis: 100%; font-weight: 600; }
.pick-row select { flex: 1 1 12rem; min-width: 0; max-width: 100%; min-height: 44px; }
.pick-name { overflow-wrap: anywhere; }
.numbers-from { display: flex; flex-wrap: wrap; align-items: center; gap: 0 var(--space-2); margin: 0; }
.numbers-from a { display: inline-flex; align-items: center; min-height: 44px; }
.numbers-from .mono { overflow-wrap: anywhere; }
.bad-link:hover { color: #9E2A1F; }

/* ---------- Where a number comes from: From file, Override (solid accent, a choice not a warning), Set by you ---------- */
.source-tag { display: inline-block; padding: 1px 6px; border: 1px solid transparent; border-radius: var(--radius-sm); font: var(--tag); letter-spacing: .06em; text-transform: uppercase; vertical-align: 1px; }
.source-tag.from-file { background: var(--accent-tint); color: var(--accent); }
.source-tag.override { background: var(--accent); color: #FFFFFF; }
.source-tag.set { border-color: var(--line); background: var(--bench); color: var(--ink-muted); }

/* ---------- Pricing tab ---------- */
.pickers { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); margin-bottom: var(--space-4); }
.pickers .field { flex: 1 1 14rem; max-width: 22rem; }
.pricing-layout { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 60rem) { .pricing-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: var(--space-6); } }
.cost-body { gap: var(--space-2); }
.cost-rows { list-style: none; margin: 0; padding: 0; }
.cost-row { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) 0; border-bottom: 1px solid var(--divider); color: var(--ink); text-decoration: none; }
.cost-row:hover { color: var(--ink); background: var(--bench); }
.cost-row .icon { color: var(--ink-muted); }
.cost-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cost-name { font-weight: 500; }
.cost-figures { font: var(--small); font-family: var(--font-mono); color: var(--ink-muted); overflow-wrap: anywhere; }
.cost-amount { font: var(--number); }
.cost-subtotal { display: flex; justify-content: space-between; align-items: baseline; margin: 0; padding: var(--space-2) 0; font-weight: 600; }
.source-tag.default { border-color: var(--line); color: var(--ink-muted); }
.suggest-leaves { display: block; color: var(--ink-muted); }
.suggest-leaves.bad { color: var(--bad); }
.keep-left { padding-top: var(--space-2); border-top: 1px solid var(--divider); }
.history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.history li { display: flex; flex-direction: column; gap: 2px; padding: var(--space-2) 0; border-top: 1px solid var(--divider); }
.history li:first-child { border-top: 0; padding-top: 0; }

.affix { display: flex; align-items: center; border: 1px solid var(--control-border); border-radius: var(--radius-md); background: var(--panel); }
.affix:focus-within { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.affix input:not([type="checkbox"]) { border: 0; min-width: 0; flex: 1; background: none; }
.affix input:focus-visible { outline: 0; }
.affix-before, .affix-after { padding: 0 var(--space-3); color: var(--ink-muted); font-family: var(--font-mono); }
.affix-before { padding-right: 0; }
.price-form { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.big-price { flex: 1 1 12rem; }
.big-price input:not([type="checkbox"]) { min-height: 52px; font: var(--number); font-size: 22px; }
.suggest-line { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.split { display: flex; position: relative; }
.split form { margin: 0; }
.split-main { border-top-right-radius: 0; border-bottom-right-radius: 0; }
.split-menu > summary { list-style: none; }
.send-to .split-pop { right: auto; left: 0; width: min(19rem, calc(100vw - 4 * var(--space-4))); }
.send-to .split-menu { position: static; }
.send-to .split-pop .tag { margin: 0; padding: 0 var(--space-3); }
.send-to .split-pop .btn-link { display: flex; align-items: center; padding: 0 var(--space-3); font: var(--body); text-align: left; }
.send-to .split-toggle { border-left-color: rgba(255, 255, 255, .45); }
.hand-search { display: flex; gap: var(--space-2); }
.hand-search input { flex: 1; min-width: 0; }
.split-menu > summary::-webkit-details-marker { display: none; }
.split-toggle { width: var(--control-h); padding: 0; margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.split-pop { position: absolute; right: 0; top: calc(100% + 4px); z-index: 3; min-width: 13rem; padding: var(--space-2); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-raise); }
.split-pop .btn-link { min-height: 44px; width: 100%; justify-content: flex-start; }
.keep-box { display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-3) var(--space-4); background: var(--bench); border-radius: var(--radius-md); }
.keep-fees, .keep-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); margin: 0; }
.keep-amount { margin: 0; font: var(--number); font-size: 26px; line-height: 32px; }
.channel-table tr[aria-current="true"] { background: var(--accent-tint); }
@media (max-width: 59.99rem) { .channel-table th, .channel-table td { padding-left: var(--space-2); padding-right: var(--space-2); } }
.channel-table th[scope="row"] { color: var(--ink); font: var(--body); font-weight: 600; letter-spacing: 0; text-transform: none; }
.channel-table th[scope="row"] a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); }
.card-foot { margin: 0; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); }
/* Pricing tab design pass (notes rows 9, 10, 11, 57, 58). */
.cost-rows + .cost-subtotal, .cost-other + .cost-subtotal { margin-top: var(--space-1); padding-top: var(--space-3); border-top: 2px solid var(--ink); }
.cost-other > summary { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-2) 0; border-bottom: 1px solid var(--divider); list-style: none; cursor: pointer; }
.cost-other > summary::-webkit-details-marker { display: none; }
.cost-other > summary .cost-name { flex: 1; }
.cost-other .chev { color: var(--ink-muted); transition: transform .15s; }
.cost-other[open] > summary .chev { transform: rotate(180deg); }
.cost-other .cost-rows { padding-left: var(--space-4); }
.card-top { display: flex; align-items: center; gap: var(--space-2); min-height: 56px; padding: var(--space-2) var(--space-4); }
.card-top h2 { margin: 0; font: var(--heading); }
.keep-full { padding-top: var(--space-2); border-top: 1px solid var(--divider); }
.keep-full + .keep-left { border-top: 0; padding-top: 0; }
.use-tier { display: inline-flex; align-items: center; min-height: 44px; }
.price-everywhere { flex-basis: 100%; display: flex; align-items: center; gap: var(--space-2); min-height: 44px; margin: 0; }
.price-everywhere input { width: 20px; height: 20px; margin: 0; }

/* The "?" help (templates/partials/help.html, static/js/help.js). Next to a card's fold arrow, or after a title. */
.help-tip { display: inline-grid; place-items: center; width: var(--control-h); height: var(--control-h); padding: 0; border: 0; border-radius: var(--radius-md); background: none; color: var(--ink-muted); cursor: pointer; }
.help-tip:hover, .help-tip:has(+ .help-pop:popover-open) { color: var(--accent); background: var(--accent-tint); }
.help-tip:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.card-wrap { position: relative; }
.card-wrap > .help-tip { position: absolute; top: calc((56px - var(--control-h)) / 2); right: calc(var(--space-4) + 20px + var(--space-1)); }
.card-wrap > .card > summary .chev { margin-left: calc(var(--control-h) + var(--space-1)); }
.help-pop { width: min(20rem, calc(100vw - 2 * var(--space-4))); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); color: var(--ink); font: var(--small); box-shadow: var(--shadow-raise); }
.help-pop[data-placed] { position: fixed; inset: auto; margin: 0; }

/* The cost dialog: centered on desktop, a bottom sheet on phones. */
.dialog-backdrop { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; background: rgba(27, 29, 33, .45); }
.dialog { width: 100%; max-height: calc(100vh - 2rem); max-height: calc(100dvh - 2rem); overflow-y: auto; overscroll-behavior: contain; background: var(--panel); border-radius: var(--radius-lg) var(--radius-lg) 0 0; box-shadow: var(--shadow-raise); padding-bottom: env(safe-area-inset-bottom); }
.dialog-head { padding: var(--space-4) var(--space-4) 0; }
.dialog-head h2 { font: var(--title); }
.dialog-body { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); }
.result-box { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-2); padding: var(--space-3); background: var(--bench); border-radius: var(--radius-md); }
.result-box .num { font-size: 18px; }
.apply-to { gap: 0; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); }
/* Long dialogs scroll inside; the actions stay at the bottom of the box. */
.dialog .dialog-actions { position: sticky; bottom: 0; z-index: 2; margin: 0 calc(-1 * var(--space-4)) calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4) var(--space-4); border-top: 1px solid var(--divider); background: var(--panel); }
@media (min-width: 60rem) {
  .dialog-backdrop { align-items: flex-start; padding-top: 10vh; }
  .dialog { max-width: 32rem; max-height: calc(90vh - 1rem); max-height: calc(90dvh - 1rem); border-radius: var(--radius-lg); }
  .dialog-actions { display: flex; justify-content: flex-end; border-top: 1px solid var(--divider); margin: 0 calc(-1 * var(--space-4)); padding: var(--space-3) var(--space-4) 0; }
}

/* ---------- Settings > Pricing ---------- */
.settings-tabs { margin-bottom: var(--space-4); }
.channel-tabs { margin-bottom: var(--space-4); }
/* Sales channels (row 86): one tab per channel in use, then the open channel's head and its own tabs. */
.channel-picker { margin-bottom: var(--space-3); }
.channel-picker a[aria-current="true"] { color: var(--accent); font-weight: 600; box-shadow: inset 0 -3px 0 var(--sky); }
.channel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.channel-head p { margin: 0; flex: 1 1 12rem; min-width: 0; overflow-wrap: anywhere; }
.price-list-product a { font-weight: 600; }
.price-list-price { font-family: var(--font-mono); white-space: nowrap; margin-left: auto; }
.price-list-variants { list-style: none; margin: 0; padding: 0 0 0 var(--space-3); flex: 1 0 100%; }
.price-list-variants li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--divider); }
.price-list-variants .grow { flex: 1 1 10rem; min-width: 0; }
.settings-intro { margin-bottom: var(--space-4); }
.settings-grid { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 60rem) { .settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: var(--space-6); } }
.field-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(10rem, 1fr)); gap: var(--space-3); }
.list-rows > li.list-row { display: block; padding: 0; }
.list-row > details > summary { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; list-style: none; cursor: pointer; }
.list-row > details > summary::-webkit-details-marker { display: none; }
.list-row .edit-word { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.list-row > details[open] > summary .edit-word { color: var(--ink-muted); }
.row-form { padding: var(--space-2) 0 var(--space-3); }
.row-delete { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); padding-bottom: var(--space-3); }
.row-delete .btn-link { padding: 0; min-height: 44px; }
.list-add > summary { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; list-style: none; cursor: pointer; }
.list-add > summary::-webkit-details-marker { display: none; }
.stand-in .tag { padding: 1px 6px; border: 1px dashed var(--control-border); border-radius: var(--radius-sm); }

/* ---------- Pricing extras (M2 step 3b) ---------- */
.hueforge-export { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3); margin: var(--space-3) 0; }
.hueforge-export p { margin: 0; flex: 1 1 14rem; }
.cost-more { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin: 0; }
.cost-more a { display: inline-flex; align-items: center; gap: var(--space-2); min-height: 44px; }
.add-cost { font-weight: 500; }
.optional-fee { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.optional-fee .btn-link { min-height: 44px; padding: 0; }
.more-options > summary { display: inline-flex; align-items: center; min-height: 44px; color: var(--accent); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; }
.more-options[open] > summary { margin-bottom: var(--space-2); }
.more-options > summary .muted { margin-left: var(--space-2); text-decoration: none; }
.dialog-remove { padding: 0 var(--space-4) var(--space-4); }
.dialog-remove .btn-link { padding: 0; min-height: 44px; }

/* ---------- Pricing 3c ---------- */
.suggestions { display: flex; flex-direction: column; gap: var(--space-2); }
.suggestions.is-tiers .suggest-line { padding: var(--space-1) 0; border-top: 1px solid var(--divider); }
.suggestions.is-tiers .suggest-line:first-child { border-top: 0; }
.electricity { padding-top: var(--space-3); border-top: 1px solid var(--divider); }

/* ---------- Materials (M2 step 4) ---------- */
.materials-tabs { margin-bottom: var(--space-3); }
.low-count { font: var(--tag); color: var(--warn); border: 1px solid currentColor; border-radius: var(--radius-sm); padding: 1px 5px; }
.sub-tabs { margin-bottom: var(--space-4); border-bottom: 0; }
.sub-tabs a[aria-current="page"] { box-shadow: none; background: var(--accent-tint); border-radius: var(--radius-md); }
.materials-layout { display: flex; flex-direction: column; gap: var(--space-4); }
@media (max-width: 59.99rem) { .materials-layout.is-chosen .spool-detail { order: -1; } }
@media (min-width: 60rem) { .materials-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: var(--space-6); } }
.spool-list { list-style: none; margin: 0; padding: 0; }
.spool-list li + li { border-top: 1px solid var(--divider); }
.spool-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "dot name price" "dot left left"; align-items: center; gap: var(--space-1) var(--space-3); min-height: 56px; padding: var(--space-3) var(--space-4); color: var(--ink); text-decoration: none; }
.spool-row:hover { background: var(--bench); }
.spool-row[aria-current="true"] { background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.spool-row .color-dot { grid-area: dot; }
.spool-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.spool-name .strong { font-weight: 600; }
.spool-left { grid-area: left; display: flex; align-items: center; gap: var(--space-3); }
.spool-left .num { min-width: 6.5rem; font-size: 13px; }
.spool-price { grid-area: price; font-size: 13px; color: var(--ink-muted); text-align: right; }
@media (min-width: 60rem) {
  .spool-row { grid-template-columns: auto minmax(0, 1.4fr) minmax(0, 1fr) 6.5rem; grid-template-areas: "dot name left price"; }
}
.color-dot { width: 16px; height: 16px; flex: none; display: inline-block; vertical-align: -3px; margin-right: 6px; }
.color-dot.big { width: 28px; height: 28px; margin-right: 0; }
.color-dot circle { stroke: rgba(27,29,33,.35); stroke-width: 1; }
.color-dot .no-color { fill: none; stroke-dasharray: 2 2; }
.color-dot .ring { fill: none; }
.spool-bar { display: block; flex: 1 1 auto; width: 100%; min-width: 4rem; height: 6px; border: 0; border-radius: 3px; background: var(--line); color: var(--accent); appearance: none; -webkit-appearance: none; }
.spool-bar::-webkit-progress-bar { background: var(--line); border-radius: 3px; }
.spool-bar::-webkit-progress-value { background: var(--accent); border-radius: 3px; }
.spool-bar::-moz-progress-bar { background: var(--accent); border-radius: 3px; }
.spool-bar.is-low::-webkit-progress-value { background: var(--hot-end); }
.spool-bar.is-low::-moz-progress-bar { background: var(--hot-end); }
.spool-bar.big { height: 8px; margin: 0; }
.spool-detail { display: flex; flex-direction: column; gap: var(--space-3); scroll-margin-top: 72px; }
.spool-head { display: flex; align-items: flex-start; gap: var(--space-3); }
.spool-head .grow { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.spool-head h2 { font: var(--title); }
.spool-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.spool-action > summary { list-style: none; }
.spool-action > summary::-webkit-details-marker { display: none; }
.spool-action[open] { flex-basis: 100%; order: 2; }
.spool-action[open] > summary { background: var(--accent-tint); border-color: var(--accent); }
.spool-action .row-form { margin-top: var(--space-3); }
.history-card { box-shadow: none; }
.counted-table .item-cell { overflow-wrap: anywhere; }
.counted-table .item-name { display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--ink); }
.counted-table .item-cell .small:not(.phone-only) { display: block; }
.stepper { display: flex; align-items: center; gap: var(--space-2); }
.stepper form { margin: 0; }
.stepper .num { min-width: 3.5rem; text-align: center; }
@media (max-width: 59.99rem) {
  .counted-table .where-cell, .counted-table .low-cell, .counted-table .used-cell { display: none; }
  .counted-table .item-cell .phone-only { display: block; }
  .counted-table th, .counted-table td { padding-left: var(--space-2); padding-right: var(--space-2); }
  .stepper { gap: var(--space-1); }
  .stepper .num { min-width: 2.5rem; }
}
.materials-empty { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }
.narrow-stack { max-width: 44rem; }
.steps { margin: 0; padding-left: 1.25rem; display: flex; flex-direction: column; gap: var(--space-2); }
.import-preview .rows > li { align-items: center; }
.preset-note { align-items: center; margin-bottom: var(--space-3); }
.preset-note .grow { flex: 1 1 auto; min-width: 0; }
.preset-note form { margin: 0; }
.preset-picker[hidden], .preset-list li[hidden], [data-preset-save][hidden] { display: none; }
.preset-picker input[type="search"] { width: 100%; }
.preset-list { list-style: none; margin: var(--space-2) 0 0; padding: 0; max-height: 16rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.preset-list li + li { border-top: 1px solid var(--divider); }
.preset-row { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; min-height: 44px; padding: var(--space-2) var(--space-3); border: 0; background: none; color: var(--ink); font: inherit; text-align: left; cursor: pointer; }
.preset-row:hover { background: var(--bench); }
.preset-row[aria-pressed="true"] { background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.preset-row .preset-name { overflow-wrap: anywhere; }
.preset-row .strong { font-weight: 600; }
/* Add a spool's "What is it?" (row 77): radio rows in one scroll box, grouped; the Color step for a preset. */
.spool-picker { border: 0; margin: 0; padding: 0; min-width: 0; }
.spool-picker legend { padding: 0; margin-bottom: var(--space-1); }
.pick-search { width: 100%; }
.pick-search[hidden], .pick-row[hidden], .pick-list [data-pick-head][hidden], .pick-none[hidden],
[data-color-step][hidden], [data-new-color][hidden], .color-chips[hidden], [data-color-hint][hidden] { display: none; }
.pick-list { margin-top: var(--space-2); max-height: min(35vh, 320px); max-height: min(35dvh, 320px); overflow-y: auto; overscroll-behavior: contain; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.pick-group, .pick-brand, .pick-divider { position: sticky; top: 0; z-index: 1; margin: 0; padding: var(--space-1) var(--space-3); background: var(--bench); border-bottom: 1px solid var(--divider); font: var(--tag); text-transform: uppercase; letter-spacing: 0.04em; color: var(--ink-muted); }
.pick-brand { text-transform: none; letter-spacing: 0; font: var(--small); font-weight: 600; color: var(--ink); background: var(--panel); }
.pick-brand-group[hidden] { display: none; }
/* The browser's own arrow (list-item marker) is the only one. */
.pick-brand-group > summary { display: list-item; min-height: 44px; padding-block: 13px; cursor: pointer; }
.pick-brand-group > summary .muted { font-weight: 400; }
.pick-brand-group > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.pick-divider { border-top: 2px solid var(--divider); }
.pick-row { display: flex; align-items: center; gap: var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-3); border-bottom: 1px solid var(--divider); cursor: pointer; }
.pick-row:hover { background: var(--bench); }
.pick-row:has(input:checked) { background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.pick-row input { flex: none; margin: 0; accent-color: var(--accent); }
.pick-text { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.pick-text .strong { font-weight: 600; }
.pick-inline { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0 var(--space-2); }
.pick-none { margin: 0; padding: var(--space-3); }
.color-chips .chip { min-height: 44px; padding: 4px 12px; cursor: pointer; font: var(--body); }
.color-chips .chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-tint); box-shadow: inset 0 0 0 1px var(--accent); }
.color-step input[type="color"] { width: 100%; min-height: 44px; padding: 2px; }
.price-history { width: 100%; }
.price-history td, .price-history th { padding: var(--space-2) var(--space-1); }
.price-history td:first-child, .price-history th:first-child { padding-left: 0; }
.dialog-section { padding: 0 var(--space-4) var(--space-4); }
.dialog-section .table { width: 100%; }
.presets-panel .cost-row:last-child { border-bottom: 0; }

/* ---------- Stock (M2 step 5a) ---------- */
.stock-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); margin-bottom: var(--space-3); }
.stock-filters .field { flex: 1 1 12rem; margin: 0; }
.stock-filters .actions { flex: 0 0 auto; align-items: center; }
.stock-filters .btn-link, .stock-link { display: inline-flex; align-items: center; min-height: 44px; }
.stock-layout { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 90rem) { .stock-layout { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; gap: var(--space-6); } }
.stock-head, .stock-row, .stock-group > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--space-1) var(--space-3); padding: var(--space-2) var(--space-4); }
.stock-head { display: none; }
.stock-rows { list-style: none; margin: 0; padding: 0; }
.stock-panel > * + * { border-top: 1px solid var(--divider); }
.stock-rows .stock-row + .stock-row { border-top: 1px solid var(--divider); }
.stock-row { min-height: 56px; }
.stock-group .stock-row { padding-left: var(--space-6); background: var(--bench); }
.stock-name { display: flex; flex-direction: column; min-width: 0; overflow-wrap: anywhere; }
.stock-name a { display: inline-flex; align-items: center; min-height: 44px; color: var(--ink); font-weight: 600; }
.stock-where, .stock-ordered, .stock-queued, .stock-low { display: none; }
.stock-group > summary { list-style: none; cursor: pointer; min-height: 56px; grid-template-columns: minmax(0, 1fr) auto auto; }
.stock-group > summary::-webkit-details-marker { display: none; }
.stock-group .chev { transition: transform .15s; }
.stock-group[open] > summary .chev { transform: rotate(180deg); }
.stock-total { min-width: 2.5rem; text-align: right; }
.stock-count { min-width: 2.5rem; text-align: center; }
.stock-count .small { display: block; font-size: 11px; line-height: 12px; }
@media (min-width: 60rem) {
  .stock-head, .stock-row, .stock-group > summary { grid-template-columns: minmax(0, 2fr) minmax(0, 1.4fr) 9.5rem 4.5rem 4.5rem 4.5rem; }
  .stock-head { display: grid; color: var(--ink-muted); font: var(--tag); letter-spacing: .06em; text-transform: uppercase; min-height: 40px; }
  .stock-head .right { text-align: right; }
  .stock-head .center { text-align: center; }
  .stock-where, .stock-ordered, .stock-queued, .stock-low { display: block; }
  .stock-ordered, .stock-queued, .stock-low { text-align: right; }
  .stock-where-phone { display: none; }
  .stock-group > summary .stock-total { text-align: center; }
  .stock-group > summary .chev { justify-self: end; }
  .stock-group > summary .phone-only { display: none; }
}
.stores-card h2 { font: var(--heading); }
.store-row { align-items: center; }
.store-row .grow { display: flex; flex-direction: column; gap: 2px; }
.stock-variant-layout { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 60rem) { .stock-variant-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: var(--space-6); } }
.spots-head { display: flex; flex-direction: column; gap: 2px; }
.spots-head h2 { font: var(--title); }
.spot-rows > li { align-items: center; min-height: 52px; flex-wrap: nowrap; }
.spot-rows .grow { min-width: 0; overflow-wrap: anywhere; }

/* ---------- Print queue (M2 step 5b) ---------- */
.stock-tabs { margin-bottom: var(--space-3); }
.queue-summary { margin: 0 0 var(--space-3); }
.queue-summary a { display: inline-flex; align-items: center; min-height: 44px; }
.suggest-card { margin-bottom: var(--space-4); }
.suggest-card h2 { margin-bottom: var(--space-2); }
.suggest-card .rows > li { flex-wrap: wrap; align-items: center; }
.suggest-actions { display: flex; gap: var(--space-2); }
.queue-switch { display: flex; gap: var(--space-2); overflow-x: auto; margin-bottom: var(--space-3); scrollbar-width: none; }
.queue-switch a { flex: 0 0 auto; display: flex; flex-direction: column; justify-content: center; min-height: 52px; padding: var(--space-1) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); color: var(--ink); text-decoration: none; }
.queue-switch a[aria-current="page"] { border-color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.queue-board { display: flex; flex-direction: column; gap: var(--space-4); margin-bottom: var(--space-4); }
.queue-col { display: none; }
.queue-col.is-current { display: block; }
.queue-col-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: var(--space-2); }
.queue-col-head h2 { font: var(--heading); }
@media (min-width: 60rem) {
  .queue-switch { display: none; }
  .queue-board { flex-direction: row; align-items: flex-start; overflow-x: auto; padding-bottom: var(--space-2); }
  .queue-col, .queue-col.is-current { display: block; flex: 1 0 18rem; max-width: 26rem; min-height: 8rem; padding: var(--space-3); border-radius: var(--radius-lg); background: var(--panel); border: 1px solid var(--line); }
}
.queue-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); min-height: 3rem; }
.queue-empty { padding: var(--space-3); border: 1px dashed var(--line); border-radius: var(--radius-md); text-align: center; }
.job { display: flex; align-items: flex-start; gap: var(--space-1); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--panel); }
.job.is-printing { border-color: var(--accent); }
.job.is-overdue { border-color: var(--warn); box-shadow: 0 0 0 1px var(--warn); animation: overdue-pulse 2.4s ease-in-out infinite; }
@keyframes overdue-pulse { 50% { box-shadow: 0 0 0 4px rgba(154, 91, 0, .18); } }
@media (prefers-reduced-motion: reduce) { .job.is-overdue { animation: none; } }
.job.is-dragging { opacity: .45; }
.drop-marker { height: 0; border-top: 3px solid var(--accent); border-radius: 2px; }
.drag-handle { flex: none; width: 36px; min-height: 52px; padding: 0; border: 0; background: none; color: var(--ink-muted); cursor: grab; touch-action: none; font-size: 18px; letter-spacing: -3px; }
.drag-handle:active { cursor: grabbing; }
.job-card { flex: 1 1 auto; min-width: 0; }
.job-card > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "name wait" "labels time"; gap: 2px var(--space-2); padding: var(--space-2) var(--space-3) var(--space-2) 0; min-height: 52px; }
.job-card > summary::-webkit-details-marker { display: none; }
.job-name { grid-area: name; font-weight: 600; overflow-wrap: anywhere; }
.job-wait { grid-area: wait; font-size: 18px; text-align: right; }
.job-labels { grid-area: labels; display: flex; flex-wrap: wrap; gap: var(--space-1); align-items: center; }
.job-time { grid-area: time; text-align: right; color: var(--ink-muted); font-size: 13px; }
.job-type, .job-status { font: var(--tag); padding: 2px 6px; border-radius: var(--radius-sm); border: 1px solid transparent; white-space: nowrap; }
.type-order { background: var(--accent); color: #fff; }
.type-restock { border-color: var(--control-border); color: var(--ink-muted); }
.type-oneoff { border: 1px dashed var(--control-border); color: var(--ink-muted); }
.type-batch { border-color: var(--ink-muted); color: var(--ink); }
.batch-runs { margin-bottom: var(--space-3); gap: var(--space-2); }
.finish-item input { max-width: 8rem; }
.job-status.printing { background: var(--accent-tint); color: var(--accent-strong); }
.job-status.overdue { border-color: var(--warn); color: var(--warn); }
.job-status.warn-tag { color: var(--warn); }
.tip-wrap { position: relative; display: inline-flex; }
.tip { display: none; position: absolute; z-index: 5; left: 0; top: calc(100% + 6px); width: max-content; max-width: 16rem; padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); background: var(--ink); color: var(--panel); font: var(--small); white-space: normal; box-shadow: var(--shadow-raise); }
.tip-wrap:hover .tip, .job-type:focus-visible + .tip, .tip-wrap.is-shown .tip { display: block; }
.job-body { display: flex; flex-direction: column; gap: var(--space-2); padding: 0 var(--space-3) var(--space-3) 0; }
.job-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: flex-start; }
.job-actions form { margin: 0; }
.job-menu > summary, .job-done > summary { list-style: none; }
.job-menu > summary::-webkit-details-marker, .job-done > summary::-webkit-details-marker { display: none; }
.job-menu[open] { flex-basis: 100%; order: 3; }
.job-menu-body { margin-top: var(--space-2); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.inline-form label { flex-basis: 100%; font-weight: 600; }
.inline-form select, .inline-form input { flex: 1 1 8rem; width: auto; }
.done-form { margin-top: var(--space-2); }
.print-more-form { display: inline-block; margin: var(--space-1) 0 0; }

/* ---------- Color scheme picker ---------- */
.schemes { display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: var(--space-2); }
.scheme { display: flex; align-items: center; gap: var(--space-3); min-height: 48px; padding: var(--space-2) var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.scheme:has(input:checked) { border-color: var(--accent); background: var(--accent-tint); font-weight: 600; }
.swatch { width: 24px; height: 24px; flex: none; border-radius: var(--radius-sm); }
.swatch-blue { background: var(--navy); }
.swatch-purple { background: #6B3FD4; }
.swatch-teal { background: #0E6670; }
.swatch-magenta { background: #B0246F; }
.swatch-graphite { background: #2F3338; }

/* ---------- Error pages ---------- */
.error-page { display: flex; flex-direction: column; gap: var(--space-4); max-width: 36rem; }
.error-ref { display: flex; flex-wrap: wrap; gap: var(--space-2); }

/* ---------- Account pages (allauth) ---------- */
.qr { width: 220px; height: 220px; padding: var(--space-2); background: #FFFFFF; border: 1px solid var(--line); border-radius: var(--radius-md); }
.entrance-panel { max-width: 36rem; }

/* ---------- "Needs you" bar (M2 step 5c): calm, only when something needs action; one line on phones ---------- */
.ny { position: relative; display: flex; align-items: center; gap: var(--space-2); min-width: 0; margin-bottom: var(--space-4); padding: 0 var(--space-1) 0 var(--space-3); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ny-dot { flex: none; width: 8px; height: 8px; border-radius: 4px; background: var(--warn); animation: ny-pulse 2.4s ease-in-out 3; }
@keyframes ny-pulse { 50% { box-shadow: 0 0 0 4px rgba(154, 91, 0, .18); } }
@media (prefers-reduced-motion: reduce) { .ny-dot { animation: none; } }
.ny-label { flex: none; color: var(--warn); }
.ny-item { flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: var(--space-2); min-height: 44px; color: var(--ink); text-decoration: none; }
.ny-item:hover { color: var(--ink); }
.ny-what { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-decoration: underline; text-underline-offset: 2px; }
.ny-when { flex: 0 1 auto; min-width: 0; max-width: 60%; overflow: hidden; text-overflow: ellipsis; font: var(--small); font-weight: 500; color: var(--warn); white-space: nowrap; }
.ny-more { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: .3em; min-width: 44px; min-height: 44px; padding: 0 var(--space-2); white-space: nowrap; font: var(--small); font-weight: 500; }
.ny-menu { flex: none; }
.ny-menu > summary { list-style: none; border-color: transparent; }
.ny-menu > summary::-webkit-details-marker { display: none; }
.ny-menu-body { position: absolute; right: 0; top: calc(100% + var(--space-1)); z-index: 6; display: flex; flex-direction: column; gap: 2px; width: min(17rem, calc(100vw - 2 * var(--space-4))); padding: var(--space-2); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-md); box-shadow: var(--shadow-raise); }
.ny-menu-body .tag { padding: var(--space-1) var(--space-2); }
.ny-menu-body button { justify-content: flex-start; border-color: transparent; }
.ny-list { padding: var(--space-3) var(--space-4); background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.ny-list > li { position: relative; flex-wrap: nowrap; }
.ny-clear { padding: var(--space-6) var(--space-4); text-align: center; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
@media (max-width: 40rem) {
  .ny-label { display: none; }
  .ny-wide { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
}

/* Menu counts: how many items need this person in that part of the shop. */
.nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; padding: 0 5px; margin-left: auto; border: 1px solid var(--warn); border-radius: var(--radius-sm); background: var(--panel); color: var(--warn); font: var(--tag); }
.nav-badge[hidden] { display: none; }
.bottombar a { position: relative; }
.bottombar .nav-badge { position: absolute; top: 6px; left: calc(50% + 6px); margin: 0; }
.ny-hidden { margin-top: var(--space-6); display: flex; flex-direction: column; gap: var(--space-3); }
.ny-hidden h2 { font: var(--heading); }
.ny-hidden .btn { white-space: nowrap; }

/* ---------- Listing tab (M2 step 6; docs/design/mockups/listing-*.html) ---------- */
/* Phone: one column in the phone mock-up's order; the two column boxes step aside (display: contents)
   so each card takes its own place. From 1200 px: the text on the left, a 22rem column on the right. */
.listing-layout { display: flex; flex-direction: column; gap: var(--space-4); }
.listing-col { display: contents; }
.listing-layout [hidden] { display: none !important; }
.listing-status { order: 1; } .listing-text { order: 2; } .listing-photos { order: 3; } .listing-points { order: 4; }
.listing-tags { order: 5; } .listing-price { order: 6; } .listing-org { order: 7; } .listing-shipping { order: 8; }
.listing-seo { order: 9; } .listing-versions { order: 10; }
@media (min-width: 75rem) {
  .listing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; gap: var(--space-6); }
  .listing-col { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; }
}
.label-line { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-3); margin: 0; }
.counter { font: var(--small); font-family: var(--font-mono); color: var(--ink-muted); white-space: nowrap; }
.counter.is-over { color: var(--bad); font-weight: 500; }
.input-prefix { display: flex; align-items: center; gap: var(--space-2); }
.input-prefix input { flex: 1; min-width: 0; }

/* The description editor: a box like the inputs, with its three buttons above. */
.editor-bar { display: flex; gap: var(--space-1); }
.editor-bar[hidden], .editor[hidden] { display: none; }
.editor-bar [aria-pressed="true"] { background: var(--accent-tint); border-color: var(--accent); color: var(--ink); }
.editor { min-height: 10rem; max-height: 32rem; overflow-y: auto; padding: var(--space-2) var(--space-3); background: var(--panel); border: 1px solid var(--control-border); border-radius: var(--radius-md); }
.editor:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-color: var(--accent); }
.rich > :first-child { margin-top: 0; }
.rich > :last-child { margin-bottom: 0; }
.rich p, .rich ul { margin: 0 0 var(--space-2); }
.rich ul { padding-left: var(--space-5, 20px); }

/* Selling points (notes row 15): drag handle on the left, numbered line with its counter, square trash on the right.
   The handle and trash keep their place when hidden (an empty line), so every box lines up. */
.points { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.point-row { display: grid; grid-template-columns: var(--control-h) 1.25rem minmax(0, 1fr) var(--control-h); align-items: start; gap: var(--space-2); }
.point-row > * { grid-row: 1; }
.point-handle { grid-column: 1; width: var(--control-h); min-height: var(--control-h); border-radius: var(--radius-md); }
.point-handle:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.point-n { grid-column: 2; align-self: start; line-height: var(--control-h); text-align: right; }
.point-input { grid-column: 3; }
.point-remove { grid-column: 4; height: var(--control-h); color: var(--ink-muted); }
.point-remove:hover { color: var(--bad); border-color: var(--bad); }
.point-row.is-dragging { opacity: .45; }
.listing-layout .point-row [hidden] { display: block !important; visibility: hidden; }

/* A rarely changed field folded inside a card (the Shopify web address, notes row 13): its name and value; opened, the box. */
.field-fold { border: 1px solid var(--line); border-radius: var(--radius-md); }
.field-fold > summary { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); min-height: var(--control-h); padding: var(--space-1) var(--space-3); list-style: none; cursor: pointer; }
.field-fold > summary::-webkit-details-marker { display: none; }
.field-fold > summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; border-radius: var(--radius-md); }
.field-fold-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-3); min-width: 0; }
.field-fold-sum { overflow-wrap: anywhere; }
.field-fold[open] > summary { border-bottom: 1px solid var(--divider); }
.field-fold[open] > summary .chev { transform: rotate(180deg); }
.field-fold > .field { padding: var(--space-3); margin: 0; }
.point-input { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.point-input .counter { align-self: flex-end; }

/* Tags as chips. */
.tag-chips .chip { padding-right: 2px; }
.chip-remove { min-height: 28px; width: 28px; padding: 0; border-color: transparent; background: none; color: var(--ink-muted); }
.chip-remove:hover { background: var(--bench); color: var(--ink); }
.tag-add { display: flex; gap: var(--space-2); }
.tag-add input { flex: 1; min-width: 0; }
.tag-add button { flex: none; }
@media (max-width: 59.99rem) { .chip-remove { min-height: 44px; width: 44px; } }

/* Shipping (9d-2): a number with its unit, a size on one line, the countries, the HS code results. */
.number-unit { display: flex; gap: var(--space-2); max-width: 16rem; }
.number-unit input { flex: 1; min-width: 0; }
.number-unit select { flex: none; width: 5rem; }
.size-field { border: 0; margin: 0; padding: 0; min-width: 0; }
.size-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) 5rem; gap: var(--space-2); max-width: 28rem; }
.size-row input, .size-row select { width: 100%; min-width: 0; }
.ship-total p { margin: 0 0 var(--space-1); }
.country-list { max-height: 16rem; overflow-y: auto; margin-top: var(--space-2); padding: var(--space-2) var(--space-3); border: 1px solid var(--control-border); border-radius: var(--radius-md); }
.hs-results { list-style: none; margin: var(--space-2) 0 0; padding: 0; max-height: 24rem; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius-md); }
.hs-results li + li { border-top: 1px solid var(--divider); }
.hs-results a { display: block; min-height: 44px; padding: var(--space-2) var(--space-3); color: var(--ink); text-decoration: none; overflow-wrap: anywhere; }
.hs-results a:hover, .hs-results a:focus-visible { background: var(--bench); }

/* Search engine preview, Google-style. */
.serp { padding: var(--space-3) var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bench); overflow-wrap: anywhere; }
.serp-title { color: #1A0DAB; font-size: 18px; line-height: 24px; }
.serp-url { color: #006621; margin: 2px 0 4px; }
.serp-desc { color: var(--ink); }

.listing-photo { position: relative; aspect-ratio: 1; display: flex; align-items: center; justify-content: center; border-radius: var(--radius-md); overflow: hidden; }
.listing-photo img { width: 100%; height: 100%; object-fit: contain; }
.listing-photo .tag { position: absolute; top: var(--space-2); left: var(--space-2); padding: 1px 6px; background: var(--panel); color: var(--ink); border-radius: var(--radius-sm); }
.price-line { display: flex; justify-content: space-between; align-items: baseline; gap: var(--space-3); margin: 0; }
.org-collections { padding-top: var(--space-4); border-top: 1px solid var(--divider); }

/* Versions: newest first; each opens to its changes, before and after side by side. */
.versions { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.version { border: 1px solid var(--line); border-radius: var(--radius-md); }
.version > summary { display: flex; flex-direction: column; gap: 2px; padding: var(--space-3); cursor: pointer; list-style: none; min-height: 44px; }
.version > summary::-webkit-details-marker { display: none; }
.version-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.version-body { display: flex; flex-direction: column; gap: var(--space-3); padding: 0 var(--space-3) var(--space-3); }
.change > .tag { margin: 0 0 var(--space-1); }
.change-sides { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--space-2); }
.change-side { min-width: 0; display: flex; flex-direction: column; gap: var(--space-1); padding: var(--space-2); border: 1px solid var(--line); border-radius: var(--radius-sm); overflow-wrap: anywhere; }
.change-old { background: var(--bench); }
.change-text { margin: 0; }
.change-list { margin: 0; padding-left: var(--space-4); }

/* ---------- Sources (M2 step 7): laid out like the Materials pages ---------- */
.search-line { display: flex; gap: var(--space-2); margin-bottom: var(--space-4); max-width: 32rem; }
.search-line input { flex: 1; min-width: 0; }
.source-list { list-style: none; margin: 0; padding: 0; }
.source-row { display: flex; align-items: flex-start; gap: var(--space-3); padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); }
.source-row:first-child { border-top: 0; }
.source-initial { display: inline-flex; align-items: center; justify-content: center; color: var(--plate-ink); font-weight: 600; }
.source-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.source-name { font-weight: 600; }
.source-money { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
.payback-lines { list-style: none; margin: var(--space-1) 0 0; padding: 0; }
.tag.estimate { padding: 1px 6px; border: 1px dashed var(--control-border); border-radius: var(--radius-sm); color: var(--ink-muted); }
.source-layout { display: flex; flex-direction: column; gap: var(--space-4); }
@media (min-width: 60rem) { .source-layout { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); align-items: start; gap: var(--space-6); } }
.source-dialog { margin-bottom: var(--space-4); border-color: var(--accent); }
.terms-fields { padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.remove-line { margin: 0; }
.license-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-3); }
.license { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); display: flex; flex-direction: column; gap: var(--space-2); }
.license-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.license-head .btn-link { margin-left: auto; }
.terms { display: grid; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); gap: var(--space-2) var(--space-4); margin: 0; }
.terms dt { font: var(--tag); letter-spacing: .06em; text-transform: uppercase; color: var(--ink-muted); }
.terms dd { margin: 0; overflow-wrap: anywhere; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; margin: 0; }
/* Source documents (notes row 69): the card's rows, and a document's own page. */
.documents .grow > a { overflow-wrap: anywhere; }
.license-docs { margin: 0; overflow-wrap: anywhere; }
.doc-note { margin: 0 0 var(--space-4); }
.doc-actions { margin-bottom: var(--space-4); align-items: center; }
.doc-actions form { margin: 0; }
.doc-edit { margin-bottom: var(--space-4); }
.doc-picture { margin: 0; padding: var(--space-2); background: var(--plate); display: flex; justify-content: center; }
.doc-picture img { display: block; max-width: 100%; height: auto; max-height: 80vh; object-fit: contain; }
.pdf-view { padding: var(--space-2); background: var(--plate); display: flex; flex-direction: column; gap: var(--space-2); }
.pdf-view > p { margin: 0; padding: var(--space-2); color: var(--plate-ink); }
/* The pages scroll inside a box one page tall (capped at 75vh), so on a phone the page around it still scrolls. */
.pdf-pages { display: flex; flex-direction: column; gap: var(--space-2); min-width: 0; height: min(var(--pdf-page-h, 0px), 75vh); overflow-y: auto; scrollbar-gutter: stable; border-radius: var(--radius-sm); }
.pdf-page { display: block; width: 100%; height: auto; background: #FFFFFF; border-radius: var(--radius-sm); }
@media (max-width: 59.99rem) { .documents .grow > a, .license-docs a { display: inline-flex; align-items: center; min-height: 44px; } }
.source-links { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-1); }
.source-links a { overflow-wrap: anywhere; }
@media (max-width: 59.99rem) { .source-links a { display: inline-flex; align-items: center; min-height: 44px; } }
.payback-block { display: flex; flex-direction: column; gap: var(--space-2); padding-top: var(--space-3); border-top: 1px solid var(--divider); }
.payback-block h3 { font: var(--heading); margin: 0; }
.period-running { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--bench); display: flex; flex-direction: column; gap: var(--space-2); }
.period-running progress { width: 100%; }
.recovered { margin: 0; }
.periods, .shares { font: var(--small); }
.periods th, .periods td, .shares th, .shares td { padding: 6px var(--space-2); }
.payback-block .table { display: block; overflow-x: auto; }
.totals { display: flex; gap: var(--space-6); margin: 0; }
.org-credit { display: flex; flex-direction: column; gap: var(--space-1); padding-top: var(--space-4); border-top: 1px solid var(--divider); }
.org-credit p { margin: 0; }
.more-list { list-style: none; margin: 0; padding: 0; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius-lg); }
.more-list li + li { border-top: 1px solid var(--divider); }
.more-list a { display: flex; align-items: center; gap: var(--space-3); min-height: 56px; padding: var(--space-3) var(--space-4); color: var(--ink); text-decoration: none; }
.more-list .grow { flex: 1; min-width: 0; }
.more-list .nav-badge { margin-left: 0; }
.last-made { margin: calc(-1 * var(--space-3)) 0 0; }

/* The shared confirm dialog for deletes (static/js/confirm.js) and the confirm page it reads from.
   Phone: a bottom sheet with two equal 44 px buttons; desktop: centered. Cancel comes first. */
.confirm-dialog { width: calc(100% - 2 * var(--space-4)); max-width: 30rem; max-height: 90vh; overflow-y: auto; margin: auto auto var(--space-4); padding: var(--space-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel); color: var(--ink); box-shadow: var(--shadow-raise); }
.confirm-dialog::backdrop { background: rgba(27, 29, 33, .45); }
.confirm-dialog h2 { font: var(--title); margin: 0 0 var(--space-3); overflow-wrap: anywhere; }
.confirm-dialog p, .confirm-page p { margin: 0; overflow-wrap: anywhere; }
.confirm-actions { display: grid; grid-template-columns: 1fr 1fr; gap: var(--space-2); margin-top: var(--space-4); }
.confirm-actions .btn, .confirm-actions button { min-height: 44px; justify-content: center; }
@media (min-width: 40rem) {
  .confirm-dialog { margin: auto; }
  .confirm-actions { display: flex; justify-content: flex-end; }
}

/* ---------- Photos (M2 step 8b): the viewer, the product's grid, the open photo, the variant's photo ---------- */
/* The viewer (notes row 6): the card's width, the photo whole on the build plate, never cropped. */
.photo-viewer { margin: 0; display: flex; flex-direction: column; gap: var(--space-2); }
.photo-stage { display: grid; place-items: center; aspect-ratio: 1; padding: var(--space-2); border-radius: var(--radius-lg); overflow: hidden; }
.photo-stage img { width: 100%; height: 100%; min-height: 0; object-fit: contain; }
.photo-viewer-line { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.photo-viewer-line .warn-tag { color: var(--warn); }
.photo-viewer-edit { margin-left: auto; display: inline-flex; align-items: center; min-height: var(--control-h); }
.photo-grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
@media (min-width: 60rem) { .photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.photo-tile { position: relative; aspect-ratio: 1; min-width: 0; }
.photo-link { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; border-radius: var(--radius-md); overflow: hidden; }
.photo-link img { width: 100%; height: 100%; object-fit: contain; -webkit-user-select: none; user-select: none; }
.photo-tile.is-open .photo-link { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-tile.is-dragging { opacity: .4; }
.photo-main { position: absolute; top: var(--space-1); left: var(--space-1); padding: 1px 6px; background: var(--panel); color: var(--ink); border-radius: var(--radius-sm); pointer-events: none; }
.photo-flag { position: absolute; top: var(--space-1); right: var(--space-1); width: 20px; height: 20px; display: grid; place-items: center; border-radius: 10px; background: var(--panel); color: var(--warn); font-weight: 700; font-size: 13px; pointer-events: none; }
.photo-handle { position: absolute; right: 0; bottom: 0; width: 44px; min-height: 44px; border-radius: var(--radius-md) 0 var(--radius-md) 0; background: var(--panel); opacity: .9; }
.photo-drop { outline: 2px dashed var(--accent); outline-offset: 2px; border-radius: var(--radius-md); }
.photo-add-form { width: 100%; height: 100%; display: flex; flex-direction: column; gap: var(--space-1); }
.photo-add-label { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-1); min-height: 44px; border-radius: var(--radius-md); cursor: pointer; text-align: center; font-size: 14px; }
.photo-add-label:focus-within, .visually-hidden-file:focus + .photo-add-send { outline: 2px solid var(--accent); }
.visually-hidden-file { position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden; }
.photo-add-send { width: 100%; }
.js-photos .photo-add-send { display: none; }
.photo-stats { color: var(--ink-muted); }
.photo-editor { margin-top: var(--space-2); padding-top: var(--space-4); border-top: 1px solid var(--divider); }
.photo-editor-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-2); }
.photo-editor-head h3 { margin: 0; font-size: 16px; }
.photo-moves form { display: inline; }
.photo-switches { border: 0; margin: 0; padding: 0; display: flex; flex-wrap: wrap; column-gap: var(--space-6); }
.variant-photo { margin: var(--space-2) 0; }
.variant-photo-sum { display: flex; align-items: center; gap: var(--space-3); min-height: 44px; cursor: pointer; list-style: none; }
.variant-photo-sum::-webkit-details-marker { display: none; }
.variant-photo-sum > span:nth-child(2) { flex: 1; display: flex; flex-direction: column; }
.photo-pick { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.photo-pick-item { position: relative; display: block; cursor: pointer; }
.photo-pick-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.photo-pick-item .thumb { width: 56px; height: 56px; border: 2px solid transparent; }
.photo-pick-item input:checked + .thumb { border-color: var(--accent); }
.photo-pick-item input:focus-visible + .thumb { outline: 2px solid var(--accent); outline-offset: 2px; }
.photo-none { display: grid; place-items: center; font-size: 12px; color: var(--plate-ink); }
.thumb-sm { width: 36px; height: 36px; }
.stock-name:has(> .thumb) { display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: var(--space-2); align-items: center; }
.stock-name > .thumb { grid-row: span 2; }
.stock-name:has(> .thumb) > :not(.thumb) { grid-column: 2; }
.job-name .thumb { display: inline-block; vertical-align: middle; margin-right: var(--space-2); }
.listing-photo-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
/* Photos to show the AI (ai/photos.py): tick boxes on the product's photos, 3 across on a phone */
.ai-photos { border: 0; margin: 0; padding: 0; min-width: 0; }
.ai-photo-grid { list-style: none; margin: var(--space-2) 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-2); }
@media (min-width: 40rem) { .ai-photo-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ai-photo { position: relative; display: flex; flex-direction: column; gap: var(--space-1); min-height: 44px; cursor: pointer; }
.ai-photo input { position: absolute; top: var(--space-1); left: var(--space-1); width: 24px; height: 24px; margin: 0; z-index: 1; accent-color: var(--accent); }
.ai-photo-img { display: block; aspect-ratio: 1; border-radius: var(--radius-md); overflow: hidden; border: 2px solid transparent; }
.ai-photo-img img { width: 100%; height: 100%; object-fit: contain; }
.ai-photo input:checked ~ .ai-photo-img { border-color: var(--accent); }
.ai-photo input:focus-visible ~ .ai-photo-img { outline: 2px solid var(--accent); outline-offset: 2px; }
.ai-photo input:disabled ~ .ai-photo-img { opacity: .5; }
.ai-photo-text { color: var(--ink-muted); }
.ai-sent-photos { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
@media (min-width: 40rem) { .ai-sent-photos { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.ai-sent-photos img { width: 100%; aspect-ratio: 1; object-fit: contain; border-radius: var(--radius-md); }
.ai-alt-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: var(--space-4); }
.ai-alt { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: var(--space-3); align-items: start; }
.ai-alt > img, .ai-alt > .thumb-gone { width: 72px; height: 72px; object-fit: contain; border-radius: var(--radius-md); }
.ai-alt textarea { width: 100%; }
.serp-thumb { float: right; width: 72px; height: 72px; margin: 0 0 var(--space-2) var(--space-3); border-radius: var(--radius-md); object-fit: cover; }

/* Shopify link (M2 step 9a): the line on the Listing tab */
.shopify-strip { margin: 0 0 var(--space-3); padding: var(--space-3) var(--space-4); }
.shopify-strip > * + * { margin-top: var(--space-2); }

/* Send to Shopify (M2 step 9b): long handles, descriptions and Shopify messages wrap on phones */
.send-item .changes .grow, .send-item .notes, .shopify-strip { overflow-wrap: anywhere; min-width: 0; }
.send-item .notes { margin: 0; padding-left: var(--space-4); }

/* Take from Shopify (M2 step 9c): the "tick for every product" choices wrap; each field's tick is a 44 px row */
.take-page .changes .check { min-height: 44px; }
.take-page .notes { margin-top: var(--space-1); }
.shopify-strip .strip-stock { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2); margin-block: var(--space-2); }

/* Stock shelf: the count is a number box (M2 step 9d-1 review); − and + stay beside it. 44 px tall on phones. */
.stock-count { margin: 0; display: flex; flex-direction: column; align-items: center; }
.stock-count .count-box { width: 3.75rem; min-height: var(--control-h); padding: 0 4px; text-align: center;
  font-variant-numeric: tabular-nums; -moz-appearance: textfield; appearance: textfield; }
.stock-count .count-box::-webkit-inner-spin-button, .stock-count .count-box::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.stock-count.bad .count-box { color: var(--bad); border-color: var(--bad); }
.stock-count.warn .count-box { color: var(--warn); }

/* Compare with Shopify (M2 step 9d-4b): one block per field; the three picks side by side, one under another on phones */
.compare-page .card-body, .compare-page .picks { overflow-wrap: anywhere; min-width: 0; }
.picks { list-style: none; margin: 0; padding: 0; }
.picks > li { padding: var(--space-3) 0; border-top: 1px solid var(--divider); }
.picks > li:first-child { border-top: 0; padding-top: 0; }
.pick-sides { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); margin-top: var(--space-2); }
.pick-side { display: flex; align-items: flex-start; gap: var(--space-2); min-height: 44px; padding: var(--space-2) var(--space-3);
  border: 1px solid var(--line); border-radius: var(--radius-md); cursor: pointer; }
.pick-side > span { min-width: 0; }
.pick-side:has(input:checked) { border-color: var(--accent); background: var(--bench); }
.pick-side.is-off { cursor: default; }
.pick-side .notes { margin: var(--space-1) 0 0; padding-left: var(--space-4); }
.set-all { display: flex; flex-wrap: wrap; align-items: end; gap: var(--space-2) var(--space-3); }
.set-all .field { flex: 1 1 12rem; }
@media (min-width: 60rem) { .pick-sides { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; } }

/* AI module (step 10): the preview's exact text, and the draft card on the Listing tab */
.sent-text { margin: 0; padding: var(--space-3); max-height: 24rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere;
  font: var(--small); font-family: var(--font-mono); background: var(--bench); border: 1px solid var(--line); border-radius: var(--radius-md); }
.sent-summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2) var(--space-3); margin: 0; }
.sent-summary dt { color: var(--ink-muted); }
.sent-summary dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.draft-card, .learn-offer { border-color: var(--accent); }
.learn-offer + .actions { margin-top: var(--space-3); }
.draft-card .questions { margin: 0; padding-left: var(--space-4); }
/* A price suggestion on the Pricing tab (templates/ai/_price_card.html) */
.ai-price { padding: var(--space-3); border: 1px solid var(--accent); border-radius: var(--radius-md); margin-bottom: var(--space-3); }
.ai-price p, .ai-price h3 { margin: 0; }
/* The two answers (market, what the costs need): side by side when there's room, stacked on a phone */
.ai-price-answers { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-3); grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.ai-price-answers li { display: grid; gap: var(--space-1); align-content: start; padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
.ai-price-answers .num.big { font: var(--number); font-size: 22px; }
.ai-price-answers .btn { justify-self: start; min-height: 44px; }
.found-items { margin: 0; padding-left: var(--space-4); display: grid; gap: var(--space-2); }
.found-items a { overflow-wrap: anywhere; }
.ai-price-head { display: flex; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.card .ai-price { padding: 0; border: 0; margin: 0; }
.ai-price-head .btn-link { min-height: 44px; padding: 0 var(--space-1); }
/* The owner's comparables (Pricing tab): link, price and note, with Remove under each */
.comparables { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--space-2); }
.comparables li { display: grid; gap: var(--space-1); border-bottom: 1px solid var(--divider); }
.comparables p { margin: 0; }
.comparables a { overflow-wrap: anywhere; }
.comparables .row-delete { padding-bottom: var(--space-2); }
/* Shop voice setup: the cleaning note, one reply per row (they are long), and the quick reasons as tap-sized chips */
.voice-note { padding: var(--space-3); border: 1px solid var(--warn); border-radius: var(--radius-md); background: var(--bench); }
.voice-note p { margin: 0; }
@media (min-width: 60rem) { .pick-sides.voice-picks { grid-template-columns: minmax(0, 1fr); } }
.voice-reply { overflow-wrap: anywhere; }
.chips.reasons .chip { min-height: 44px; cursor: pointer; }
.chips.reasons .chip:has(input:checked) { border-color: var(--accent); background: var(--bench); }
.draft-tags { display: flex; flex-wrap: wrap; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.draft-tags button { min-height: 44px; }
/* Store review (templates/ai/review.html) */
.review-product h2 { margin: 0; overflow-wrap: anywhere; }
.review-suggestion { padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); }
.review-suggestion.is-skipped { opacity: 0.65; }
.review-suggestion p, .review-flag p { margin: 0; }
.review-suggestion-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.review-suggestion .actions button { min-height: 44px; }
.review-flag { padding: var(--space-3); border: 1px solid var(--warn); border-radius: var(--radius-md); background: var(--bench); }
.report-text { margin: 0; max-height: 20rem; overflow: auto; white-space: pre-wrap; overflow-wrap: anywhere; font: var(--small); }

/* Count sheets (Stock › Count): making one, the entry page (phone first) and the printed sheet (letter size). */
.count-layout { display: grid; gap: var(--space-4); }
@media (min-width: 60rem) { .count-layout { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.count-sheets .btn { min-height: 44px; }
.count-place { margin: 0; padding: var(--space-3) var(--space-4); font: var(--heading); border-bottom: 1px solid var(--divider); }
.count-rows { list-style: none; margin: 0; padding: 0; }
.count-row { display: grid; grid-template-columns: minmax(0, 1fr) 6.5rem; grid-template-areas: "name box" "expected diff"; gap: var(--space-1) var(--space-3); align-items: center; padding: var(--space-3) var(--space-4); border-top: 1px solid var(--divider); }
.count-row:first-child { border-top: 0; }
.count-row.has-error { background: var(--bench); box-shadow: inset 0 0 0 2px var(--bad); }
.count-name { grid-area: name; display: flex; flex-direction: column; min-width: 0; font-weight: 400; overflow-wrap: anywhere; }
.count-expected { grid-area: expected; }
.count-box { grid-area: box; text-align: right; min-height: 48px; font: var(--number); font-size: 18px; }
.count-row [aria-invalid="true"] { border-color: var(--bad); }
.count-diff { grid-area: diff; text-align: right; min-height: 18px; }
.count-save { display: flex; justify-content: flex-end; }
.count-save .btn { min-height: 48px; }
@media (min-width: 60rem) {
  .count-row { grid-template-columns: minmax(0, 1fr) 10rem 7rem 4rem; grid-template-areas: "name expected box diff"; }
  .count-expected { text-align: right; }
}

.count-print { max-width: 8.5in; margin: 0 auto; padding: var(--space-4); background: var(--panel); color: var(--ink); }
.count-print-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-bottom: var(--space-4); }
.count-print-bar .btn, .count-print-bar .btn-link { min-height: 44px; }
.count-print-head h1 { margin: 0 0 var(--space-1); font: var(--title); }
.count-print-head p { margin: 0 0 var(--space-2); }
.write-line { display: inline-block; width: 14em; border-bottom: 1px solid var(--ink); }
.write-line.short { width: 8em; }
.count-sheet { width: 100%; border-collapse: collapse; font-size: 16px; line-height: 1.3; }
.count-sheet th, .count-sheet td { padding: 8px 6px; border-bottom: 1px solid var(--ink-muted); text-align: left; vertical-align: middle; }
.count-sheet thead th { font-size: 13px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 2px solid var(--ink); }
.count-sheet .num { text-align: right; font-family: var(--font-mono); font-size: 18px; white-space: nowrap; }
.count-sheet thead .num { font-family: inherit; font-size: 13px; }
.count-sheet .place-row th { padding-top: 14px; font-size: 17px; border-bottom: 2px solid var(--ink); }
.count-sheet .sub { display: block; font-size: 14px; }
.count-sheet .photo-col { width: 56px; }
.count-sheet .photo-col img { display: block; width: 48px; height: 48px; object-fit: cover; border-radius: 4px; }
.count-sheet .box-col { width: 1.3in; }
.write-box { position: relative; display: block; height: 40px; border: 2px solid var(--ink); border-radius: 4px; }
.write-box .unit { position: absolute; right: 6px; bottom: 4px; font-size: 13px; }
.count-print-foot { margin-top: var(--space-4); font-size: 14px; }
@media (max-width: 40rem) { .count-sheet .photo-col { display: none; } .count-sheet .box-col { width: 5.5rem; } }
.price-sheet tbody th[scope="row"] { font-weight: 600; }
.price-sheet .place-row ~ tr td:first-child { padding-left: 18px; }
.price-tags { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(10rem, 1fr)); gap: 0; }
.price-tag { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 1.5in; padding: 10px; border: 1px dashed var(--ink-muted); text-align: center; overflow-wrap: anywhere; }
.price-tag-name { font-weight: 600; font-size: 15px; line-height: 1.2; }
.price-tag-variant { font-size: 13px; }
.price-tag-price { font-family: var(--font-mono); font-size: 26px; font-weight: 600; margin-top: 4px; }
.price-tag-sku { font-family: var(--font-mono); font-size: 11px; color: var(--ink-muted); }

@media print {
  @page { size: letter; margin: 0.5in; }
  body { background: #fff; color: #000; }
  .screen-only, .skip { display: none !important; }
  .count-print { max-width: none; margin: 0; padding: 0; }
  .count-sheet { font-size: 14pt; }
  .count-sheet .num { font-size: 15pt; }
  .count-sheet thead .num { font-size: 10pt; }
  .count-sheet thead { display: table-header-group; }
  .count-sheet tr { break-inside: avoid; page-break-inside: avoid; }
  .count-sheet .place-row { break-after: avoid; page-break-after: avoid; }
  .count-sheet .photo-col { display: table-cell; }
  .count-sheet th, .count-sheet td { border-color: #000; }
  .price-sheet tbody { break-inside: avoid; page-break-inside: avoid; }
  .price-tags { grid-template-columns: repeat(3, 1fr); }
  .price-tag { min-height: 1.75in; border-color: #000; break-inside: avoid; page-break-inside: avoid; }
  .price-tag-sku { color: #000; }
}

/* ---------- Batches (notes row 79) ---------- */
.batch-page { max-width: 56rem; }
.batch-files, .batch-makes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.batch-files { gap: var(--space-3); }
.batch-file { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-3); border: 1px solid var(--line); border-radius: var(--radius-md); min-width: 0; }
.batch-file .stack-tight, .batch-make .stack-tight { display: flex; flex-direction: column; gap: var(--space-1); min-width: 0; }
.batch-file .file-name { overflow-wrap: anywhere; }
.batch-plates { display: flex; gap: var(--space-2); padding: var(--space-2); border-radius: var(--radius-md); overflow-x: auto; }
.batch-plates img { height: 6rem; width: auto; border-radius: var(--radius-md); }
.batch-file-form, .batch-make-add { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-2) var(--space-3); }
.batch-file-form .field, .batch-make-add .field { margin: 0; }
.batch-file-form .field:first-of-type { flex: 1 1 12rem; min-width: 0; }
.batch-file-form select, .batch-make-add select { width: 100%; min-height: 44px; }
.runs-field input { width: 6rem; min-height: 44px; }
.batch-make-add .grow { flex: 1 1 14rem; min-width: 0; }
.batch-make { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); padding-block: var(--space-2); border-top: 1px solid var(--divider); }
.batch-make:first-child { border-top: 0; }
.batch-make > .stack-tight { flex: 1 1 12rem; }
.batch-make .btn-icon { min-height: 44px; width: 44px; }
.batch-make-controls { display: flex; align-items: center; gap: var(--space-2); margin-left: auto; }
.pre-line { white-space: pre-line; }
.also-made a { overflow-wrap: anywhere; }
.batch-compare { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-1) var(--space-2); margin: 0 0 var(--space-3); }
.batch-compare .used { font-weight: 600; }
