:root {
  --ink:        #17191A;
  --ink-2:      #4A4E4F;
  --ink-3:      #7C8183;
  --paper:      #F4F4F1;
  --surface:    #FFFFFF;
  --sunken:     #FAFAF8;
  --line:       #E3E4E0;
  --line-2:     #C9CBC5;

  --signal:     #9E5A11;
  --signal-bg:  #FBF2E5;
  --signal-line:#E8CFA8;

  --danger:     #973024;
  --danger-bg:  #FAEBE8;
  --ok:         #2B6449;
  --ok-bg:      #E8F1EC;

  --r:   6px;
  --r-lg: 10px;
  --ui:   "Archivo", -apple-system, BlinkMacSystemFont, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 15px/1.55 var(--ui);
  -webkit-font-smoothing: antialiased;
}

/* Measured values read differently from prose — formulas are code,
   dimensions are measurements. */
.mono, input.mono, textarea.mono, .num, code { font-family: var(--mono); }

.eyebrow {
  font: 500 11px/1 var(--ui);
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------------- header ---------------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 32px;
  padding: 0 28px;
  height: 58px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font: 600 16px var(--ui);
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--ink);
}
.brand em { font-style: normal; color: var(--signal); }
.app-header nav { display: flex; gap: 2px; flex: 1; }
.app-header nav a {
  padding: 7px 12px;
  border-radius: var(--r);
  text-decoration: none;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
}
.app-header nav a:hover { background: var(--paper); color: var(--ink); }
.app-header nav a.active { background: var(--ink); color: #fff; }
.header-right { display: flex; align-items: center; gap: 14px; }
.user-email { color: var(--ink-3); font-size: 13px; }

/* ---------------- layout ---------------- */
.app-main { max-width: 1180px; margin: 0 auto; padding: 26px 28px 96px; }

.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 22px;
  border-bottom: 1px solid var(--line);
}
.page-head h1 {
  margin: 6px 0 0;
  font: 500 25px/1.15 var(--ui);
  letter-spacing: -0.025em;
}
.page-head .sub { color: var(--ink-3); font-size: 14px; margin-top: 6px; }
.head-actions { display: flex; gap: 8px; flex-shrink: 0; }

.editor { display: grid; grid-template-columns: minmax(0,1fr) 316px; gap: 24px; align-items: start; }

@media (max-width: 900px) {
  .editor { grid-template-columns: 1fr; }
  .app-main { padding: 20px 16px 80px; }
}

/* ---------------- section blocks ---------------- */
.section {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  margin-bottom: 18px;
  overflow: hidden;
}
.section-head {
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}
.section-head h2 {
  margin: 0;
  font: 500 15px var(--ui);
  letter-spacing: -0.01em;
}
.section-head .hint { margin: 3px 0 0; color: var(--ink-3); font-size: 13px; max-width: 62ch; }
.section-body { padding: 18px; }
.section-body > :last-child { margin-bottom: 0; }

/* ---------------- forms ---------------- */
label { display: block; font-size: 13px; font-weight: 500; margin-bottom: 5px; color: var(--ink-2); }
input[type=text], input[type=email], input[type=number], input[type=password],
input[type=datetime-local], select, textarea {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--line-2);
  border-radius: var(--r);
  font: 400 14px var(--ui);
  background: var(--surface);
  color: var(--ink);
}
input.mono, textarea.mono { font: 400 13px var(--mono); }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(23,25,26,.09);
}
textarea { resize: vertical; }
.field { margin-bottom: 14px; }
.field:last-child { margin-bottom: 0; }
.row { display: grid; gap: 12px; }
.row-2 { grid-template-columns: 1fr 1fr; }
.row-3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 700px) { .row-2, .row-3 { grid-template-columns: 1fr; } }

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 400;
  color: var(--ink);
  margin: 0;
}
.checkbox-inline input { width: auto; }

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 16px 0 0;
}
.actions-sticky {
  position: sticky;
  bottom: 0;
  background: linear-gradient(to top, var(--paper) 68%, rgba(244,244,241,0));
  padding: 18px 0 14px;
  margin-top: -6px;
  z-index: 5;
}

button, .button {
  padding: 8px 15px;
  border-radius: var(--r);
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
  font: 500 14px var(--ui);
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
button:hover, .button:hover { background: #000; }
.button-secondary { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.button-secondary:hover { background: var(--paper); }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: #7d2820; }
.button-small { padding: 5px 10px; font-size: 13px; }
.button-ghost {
  background: none; border: 1px dashed var(--line-2); color: var(--ink-2);
  width: 100%; text-align: center; padding: 9px;
}
.button-ghost:hover { background: var(--sunken); border-color: var(--ink-3); color: var(--ink); }
.link-button { background: none; border: none; color: var(--ink-3); padding: 4px 6px; font-weight: 400; }
.link-button:hover { background: none; color: var(--danger); }

.icon-button {
  background: none;
  border: 1px solid var(--line);
  color: var(--ink-3);
  width: 32px; height: 34px;
  border-radius: var(--r);
  font-size: 17px; line-height: 1;
  padding: 0;
  flex-shrink: 0;
}
.icon-button:hover { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-bg); }

/* ---------------- tables ---------------- */
table { width: 100%; border-collapse: collapse; }
th {
  text-align: left;
  font: 500 11px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding: 0 12px 9px;
  border-bottom: 1px solid var(--line);
}
td { padding: 11px 12px; border-bottom: 1px solid var(--line); font-size: 14px; }
tr:last-child td { border-bottom: none; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
td.num { font-family: var(--mono); font-size: 13px; }
.row-link { text-decoration: none; color: var(--ink); font-weight: 500; }
.row-link:hover { color: var(--signal); }
tbody tr:hover { background: var(--sunken); }

/* ---------------- flash + badges ---------------- */
.flash-stack { margin-bottom: 18px; }
.flash-stack:empty { margin-bottom: 0; }

.flash {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 11px 12px 11px 15px;
  border-radius: var(--r);
  margin-bottom: 10px;
  font-size: 14px;
  border: 1px solid transparent;
  opacity: 1;
  transform: translateY(0);
}
.flash:last-child { margin-bottom: 0; }
.flash-message { flex: 1; }

.flash-close {
  background: none;
  border: none;
  color: currentColor;
  opacity: .5;
  font-size: 18px;
  line-height: 1;
  padding: 0 2px;
  cursor: pointer;
  flex-shrink: 0;
}
.flash-close:hover { opacity: 1; background: none; }

@media (prefers-reduced-motion: no-preference) {
  .flash { transition: opacity .25s ease, transform .25s ease; }
}
.flash.is-leaving { opacity: 0; transform: translateY(-4px); }
.flash-notice { background: var(--ok-bg); color: var(--ok); border-color: #CADCD2; }
.flash-alert { background: var(--danger-bg); color: var(--danger); border-color: #EFD0CA; }

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 20px;
  font: 500 11px var(--ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  background: var(--paper);
  color: var(--ink-2);
  border: 1px solid var(--line);
  vertical-align: middle;
}
.badge-draft     { background: var(--paper); }
.badge-sent      { background: var(--signal-bg); color: var(--signal); border-color: var(--signal-line); }
.badge-accepted  { background: var(--ok-bg); color: var(--ok); border-color: #CADCD2; }
.badge-rejected, .badge-expired { background: var(--danger-bg); color: var(--danger); border-color: #EFD0CA; }
.badge-superseded{ background: var(--sunken); color: var(--ink-3); }
.badge-role      { background: var(--ink); color: #fff; border-color: var(--ink); }
.badge-internal  { background: var(--sunken); color: var(--ink-3); }

.muted { color: var(--ink-3); }
.empty {
  text-align: center;
  padding: 52px 20px;
  color: var(--ink-3);
}
.empty p { margin: 0 0 16px; }

/* ---------------- the readout (signature element) ----------------
   A live instrument: what this product costs AND what it takes to build,
   at three representative sizes, recomputed as you type. */
/* The rail is the sticky element, not the readout inside it — sticky needs a
   tall containing block to travel within, and the readout is only as tall as
   itself. */
.rail { position: sticky; top: 78px; }
@media (max-width: 900px) { .rail { position: static; } }

.readout {
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  background: var(--surface);
  overflow: hidden;
}
.readout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 11px 14px;
  background: var(--ink);
  color: #fff;
}
.readout-head .eyebrow { color: rgba(255,255,255,.62); }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--signal); }
.dot.err { background: #E0705F; }

.readout-size {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.readout-size:last-child { border-bottom: none; }
.readout-dims {
  font: 400 12px var(--mono);
  color: var(--ink-3);
  margin-bottom: 7px;
}
.readout-price {
  font: 500 21px var(--mono);
  color: var(--signal);
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}
.readout-line {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 12.5px;
  padding: 3px 0;
  color: var(--ink-2);
}
.readout-line b { font: 400 12.5px var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.readout-outputs { margin-top: 8px; padding-top: 7px; border-top: 1px dashed var(--line); }

.readout-problem {
  padding: 11px 14px;
  font-size: 13px;
  line-height: 1.45;
  background: var(--danger-bg);
  color: var(--danger);
  border-bottom: 1px solid #EFD0CA;
}
.readout-problem strong { display: block; margin-bottom: 2px; }
.readout-warn { background: var(--signal-bg); color: var(--signal); border-bottom-color: var(--signal-line); }
.readout-empty { padding: 26px 14px; text-align: center; color: var(--ink-3); font-size: 13px; }

/* ---------------- repeating rows ---------------- */
.rows-head, .kv-row, .value-row, .formula-row {
  display: grid;
  gap: 9px;
  align-items: center;
}
.rows-head {
  font: 500 11px var(--ui);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 7px;
}
.kv-row, .rows-head.kv    { grid-template-columns: 1fr 1fr 32px; }
.value-row, .rows-head.val { grid-template-columns: 1.3fr .9fr 1.4fr 32px; }
.kv-row, .value-row, .formula-row { margin-bottom: 8px; }

.subcard {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--sunken);
  padding: 15px;
  margin-bottom: 12px;
}
.subcard-head { display: flex; gap: 10px; align-items: flex-end; }
.subcard-head .field { margin-bottom: 0; flex: 1; }
.subcard-part {
  margin-top: 14px;
  padding-top: 13px;
  border-top: 1px solid var(--line);
}

.note {
  font-size: 12.5px;
  color: var(--signal);
  background: var(--signal-bg);
  border: 1px solid var(--signal-line);
  padding: 4px 9px;
  border-radius: var(--r);
  display: inline-block;
}

/* Price breakdown on quotes */
.breakdown { font-size: 13px; }
.breakdown-line {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 4px 0;
  color: var(--ink-2);
}
.breakdown-line span:last-child { font-family: var(--mono); color: var(--ink); font-variant-numeric: tabular-nums; }
.breakdown-total {
  display: flex; justify-content: space-between;
  padding-top: 10px; margin-top: 8px;
  border-top: 1px solid var(--ink);
  font-weight: 500;
}
.breakdown-total span:last-child { font-family: var(--mono); font-variant-numeric: tabular-nums; }

@media (prefers-reduced-motion: no-preference) {
  .readout-price, .readout-line b { transition: color .12s ease; }
}

/* ---------------- public customer site ----------------
   Photo-led and roomier than the internal tool: this is a shop window, not a
   workbench. Same type and colour system so the two never look unrelated. */
.pub { background: var(--surface); }

.pub-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 32px;
  height: 72px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 20;
}
.pub-brand { font: 600 17px var(--ui); color: var(--ink); text-decoration: none; letter-spacing: -0.02em; }
.pub-basket {
  font: 500 14px var(--ui);
  color: var(--ink);
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.pub-basket:hover { border-color: var(--ink); }
.pub-count {
  background: var(--ink); color: #fff;
  border-radius: 999px; min-width: 20px; height: 20px;
  display: inline-flex; align-items: center; justify-content: center;
  font: 500 12px var(--mono);
}

.pub-main { max-width: 1120px; margin: 0 auto; padding: 40px 32px 80px; }
.pub-footer {
  border-top: 1px solid var(--line);
  padding: 28px 32px 44px;
  text-align: center;
  font-size: 13px;
  color: var(--ink-2);
}
.pub-footer .muted { margin-top: 5px; font-size: 12.5px; }

.pub-hero { max-width: 620px; margin-bottom: 44px; }
.pub-hero h1 {
  font: 500 34px/1.12 var(--ui);
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
}
.pub-hero p { color: var(--ink-2); font-size: 16px; margin: 0; }

.pub-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 26px;
}
.pub-card { text-decoration: none; color: inherit; display: block; }
.pub-thumb {
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--paper);
  border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pub-thumb .placeholder { color: var(--ink-3); font-size: 13px; }
.pub-card:hover .pub-thumb { border-color: var(--line-2); }
.pub-card h3 { font: 500 16px var(--ui); margin: 0 0 4px; letter-spacing: -0.01em; }
.pub-card p { color: var(--ink-2); font-size: 13.5px; margin: 0; line-height: 1.5; }
.pub-from { font: 400 13px var(--mono); color: var(--signal); margin-top: 7px; }

.pub-detail { display: grid; grid-template-columns: 1fr 400px; gap: 44px; align-items: start; }
@media (max-width: 880px) { .pub-detail { grid-template-columns: 1fr; gap: 28px; } }

.pub-gallery { display: grid; gap: 12px; }
.pub-gallery .main {
  aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center;
}
.pub-gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.pub-gallery .strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pub-gallery .strip img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 8px; border: 1px solid var(--line);
}

.pub-config { position: sticky; top: 96px; }
.pub-config h1 { font: 500 25px var(--ui); letter-spacing: -0.025em; margin: 0 0 6px; }
.pub-config .lede { color: var(--ink-2); font-size: 14.5px; margin: 0 0 22px; }

.pub-price {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 16px;
  background: var(--sunken);
  margin: 20px 0;
}
.pub-price .amount {
  font: 500 27px var(--mono);
  color: var(--signal);
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.pub-price .caveat { font-size: 12.5px; color: var(--ink-3); margin-top: 6px; line-height: 1.45; }

.pub-swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.pub-swatch {
  display: inline-flex; align-items: center; gap: 7px;
  border: 1px solid var(--line-2); border-radius: 999px;
  padding: 6px 12px 6px 7px; font-size: 13px; cursor: pointer;
  background: var(--surface);
}
.pub-swatch input { display: none; }
.pub-swatch .chip {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid rgba(0,0,0,.14); flex-shrink: 0;
}
.pub-swatch:has(input:checked) { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.pub-line {
  display: flex; gap: 16px; padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.pub-line:last-of-type { border-bottom: none; }
.pub-line-thumb {
  width: 86px; height: 66px; border-radius: 8px; flex-shrink: 0;
  object-fit: cover; border: 1px solid var(--line); background: var(--paper);
}

.pub-gallery .strip img { cursor: default; transition: border-color .12s ease; }
.pub-gallery .strip img.is-current { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }

.pub-qty { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pub-qty label { margin: 0; font-size: 12.5px; color: var(--ink-3); }
.pub-qty input { width: 68px; padding: 5px 8px; font-size: 13px; }

/* ---------------- sign in ----------------
   The front door of the same instrument. Its only ornament is bands of light
   — the thing this product exists to control. No stock photography. */
.auth { background: var(--surface); }

.auth-split {
  display: grid;
  grid-template-columns: minmax(0, 44%) 1fr;
  min-height: 100vh;
}
@media (max-width: 820px) {
  .auth-split { grid-template-columns: 1fr; }
  .auth-brand { min-height: 210px; }
}

.auth-brand {
  position: relative;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
  padding: 44px;
  display: flex;
  flex-direction: column;
  /* Identity sits low, where the light has fallen away — so the ornament
     never competes with the words. */
  justify-content: flex-end;
  gap: 22px;
}

/* Slats: full-bleed bands of light, brightest at the top and falling away —
   a shade closing downward. The panel's only ornament. */
.auth-slats {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  padding-top: 8px;
  pointer-events: none;
}
.auth-slats span {
  display: block;
  height: 5px;
  background: var(--signal);
  flex-shrink: 0;
}

/* Chrome's autofill overrides our field colours; pin them back. */
.auth-form input:-webkit-autofill,
.auth-form input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--ink);
  -webkit-box-shadow: 0 0 0 1000px var(--surface) inset;
  caret-color: var(--ink);
}

.auth-brand-inner, .auth-brand-foot { position: relative; z-index: 1; }
.auth-logo { max-height: 40px; max-width: 200px; display: block; margin-bottom: 20px; }
.auth-wordmark {
  font: 600 26px var(--ui);
  letter-spacing: -0.03em;
  margin-bottom: 14px;
}
.auth-wordmark em { font-style: normal; color: var(--signal); }

.auth-setup {
  margin: 16px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: rgba(255,255,255,.5);
  max-width: 32ch;
}
.auth-tagline {
  font-size: 15px;
  line-height: 1.55;
  color: rgba(255,255,255,.72);
  max-width: 30ch;
  margin: 0;
}
.auth-brand-foot {
  font: 400 12px var(--mono);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255,255,255,.42);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 32px;
}
.auth-form { width: 100%; max-width: 348px; }
.auth-title {
  font: 500 26px var(--ui);
  letter-spacing: -0.025em;
  margin: 8px 0 24px;
}
.auth-lede { color: var(--ink-2); font-size: 14.5px; margin: -14px 0 22px; }
.auth-form .field { margin-bottom: 16px; }
.auth-form input[type=email],
.auth-form input[type=password] { padding: 10px 12px; }

.auth-links {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 13.5px;
}
.auth-links a { color: var(--ink-2); text-decoration: none; }
.auth-links a:hover { color: var(--signal); }

/* Search and filters on list pages. */
.search-form { display: flex; align-items: center; gap: 8px; }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-clear {
  position: absolute; right: 10px;
  text-decoration: none; color: var(--ink-3);
  font-size: 17px; line-height: 1;
}
.search-clear:hover { color: var(--ink); }
.search-input {
  width: 230px;
  padding: 7px 11px;
  font-size: 14px;
  border: 1px solid var(--line-2);
  border-radius: 999px;
  background: var(--surface);
}
.search-input:focus { border-color: var(--ink); box-shadow: 0 0 0 3px rgba(23,25,26,.08); outline: none; }
.search-input::-webkit-search-cancel-button { display: none; }

.filter-tabs { display: flex; gap: 3px; margin-top: 10px; flex-wrap: wrap; }
.filter-tabs a {
  font-size: 13px;
  padding: 4px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
}
.filter-tabs a:hover { background: var(--paper); color: var(--ink); }
.filter-tabs a.on { background: var(--ink); color: #fff; }

/* ---------------- product form: less scrolling ---------------- */
.section-nav {
  position: sticky;
  top: 58px;
  z-index: 9;
  display: flex;
  gap: 2px;
  flex-wrap: wrap;
  padding: 10px 0 12px;
  margin-bottom: 4px;
  background: var(--paper);
  border-bottom: 1px solid var(--line);
}
.section-nav a {
  font-size: 13px;
  padding: 5px 11px;
  border-radius: 999px;
  text-decoration: none;
  color: var(--ink-2);
}
.section-nav a:hover { background: var(--surface); color: var(--ink); }

/* Anchors clear the sticky header and nav. */
.section[id] { scroll-margin-top: 118px; }

/* Options collapse to a summary line. */
.option {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--sunken);
  margin-bottom: 10px;
}
.option[open] { background: var(--surface); }
.option-summary {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 12px 15px;
  cursor: pointer;
  list-style: none;
  font-size: 14px;
}
.option-summary::-webkit-details-marker { display: none; }
.option-summary::before {
  content: "›";
  color: var(--ink-3);
  font-size: 16px;
  transition: transform .12s ease;
  display: inline-block;
}
.option[open] > .option-summary::before { transform: rotate(90deg); }
.option-summary:hover { background: var(--paper); border-radius: var(--r); }
.option-name { font-weight: 500; }
.option-count { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }
.option-body { padding: 4px 15px 16px; border-top: 1px solid var(--line); }

/* Answers: compact, with the less-used fields tucked away. */
.answer {
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--surface);
  padding: 12px;
  margin-bottom: 9px;
}
.answer-more { margin-top: 4px; }
.answer-more > summary {
  cursor: pointer;
  font-size: 12.5px;
  color: var(--ink-3);
  padding: 4px 0;
  list-style: none;
}
.answer-more > summary::-webkit-details-marker { display: none; }
.answer-more > summary::before { content: "+ "; }
.answer-more[open] > summary::before { content: "− "; }
.answer-more > summary:hover { color: var(--ink); }

/* ---------------- production ---------------- */
.progress {
  height: 5px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
}
.progress span { display: block; height: 100%; background: var(--signal); }

/* Shop paperwork. Printed and carried around a workshop, so it's plain,
   high-contrast, and has somewhere to tick things off. */
body.print { background: #fff; }
.sheet { max-width: 980px; margin: 0 auto; padding: 28px; color: #000; }
.sheet-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding-bottom: 12px; margin-bottom: 18px; border-bottom: 2px solid #000;
}
.sheet-title { font: 600 19px var(--ui); letter-spacing: -0.02em; }
.sheet-sub { font-size: 12.5px; color: #444; margin-top: 3px; }

.sheet-table { width: 100%; border-collapse: collapse; }
.sheet-table th {
  font: 500 10px var(--ui); text-transform: uppercase; letter-spacing: 0.06em;
  text-align: left; color: #444; padding: 6px 8px; border-bottom: 1px solid #000;
}
.sheet-table td { padding: 9px 8px; border-bottom: 1px solid #ccc; font-size: 12.5px; vertical-align: top; }
.sheet-table .num { text-align: right; }
.sheet-table .small { font-size: 11.5px; color: #333; }
.sheet-table .strong { font-weight: 600; font-size: 13.5px; }
.tickbox { }
.tickbox::before {
  content: ""; display: block; width: 15px; height: 15px;
  border: 1.5px solid #000; border-radius: 2px;
}

.sheet-block { margin-top: 20px; padding-top: 12px; border-top: 1px solid #000; }
.sheet-block-title {
  font: 500 10px var(--ui); text-transform: uppercase; letter-spacing: 0.06em;
  color: #444; margin-bottom: 7px;
}
.sheet-row { display: flex; justify-content: space-between; font-size: 12.5px; padding: 3px 0; }
.sheet-note { font-size: 12.5px; padding: 3px 0; }
.sheet-foot { margin-top: 26px; font-size: 11px; color: #666; }

@media print {
  .print-hide { display: none; }
  .sheet { padding: 0; max-width: none; }
  .sheet-table tr { page-break-inside: avoid; }
}

/* ---------------- audit trail ---------------- */
.audit-filters { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.audit-filters .field { margin: 0; }
.audit-filters input { width: 200px; }
.audit-filters input[type=date] { width: 150px; }

.audit-changes { padding: 6px 0 2px; }
.audit-change {
  display: flex; gap: 8px; align-items: baseline;
  font-size: 12.5px; padding: 3px 0;
  border-bottom: 1px dashed var(--line);
}
.audit-change:last-child { border-bottom: none; }
.audit-change .field {
  min-width: 130px;
  flex-shrink: 0;
  color: var(--ink-3);
  font-size: 12px;
}
.audit-change .was { color: var(--ink-3); text-decoration: line-through; }
.audit-change .arrow { color: var(--ink-3); flex-shrink: 0; }
.audit-change .now { color: var(--ink); }
.audit-change .was div, .audit-change .now div { line-height: 1.5; }

.split-check { width: auto; }

.pagination {
  display: flex; align-items: center; justify-content: space-between;
  gap: 14px; padding: 14px 18px; border-top: 1px solid var(--line);
  font-size: 13px;
}
.pagination-links { display: flex; gap: 8px; }

/* "showing some of many" on a card, with a way through to the rest. */
.card-more {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 11px 18px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--ink-3);
}

/* ---------------- shop floor ---------------- */
/* A unit and its steps are one block: drop the rule between them, and let the
   steps cell own the spacing. Without this the first card butts straight up
   against the unit row's border. */
tr.unit-row.has-steps > td { border-bottom: none; padding-bottom: 4px; }
.steps-cell { padding: 0 18px 16px; border-bottom: 1px solid var(--line); }
.steps { display: flex; flex-direction: column; gap: 6px; }
.step {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 14px;
  padding: 10px 12px; border-radius: var(--r);
  background: var(--sunken); border: 1px solid var(--line);
}
.step.in_progress { border-color: var(--signal); background: var(--signal-bg); }
.step.done, .step.skipped { opacity: .55; }
.step-main { flex: 1; font-size: 13px; }
.step-instructions { font-size: 12.5px; margin-top: 4px; line-height: 1.5; white-space: pre-line; }
.step-actions { flex-shrink: 0; display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }
.step-finish { display: flex; justify-content: flex-end; }

/* The override is the exception, so it stays folded away until asked for. */
.step-override > summary {
  cursor: pointer; list-style: none;
  font-size: 11.5px; color: var(--ink-3);
  text-align: right; padding: 4px 0 0;
}
.step-override > summary::-webkit-details-marker { display: none; }
.step-override > summary:hover { color: var(--ink); }
.step-override-body { padding-top: 6px; max-width: 210px; }
.step-override-body input { width: 100%; text-align: right; }
.step-override-body p { font-size: 11px; line-height: 1.4; margin: 5px 0 0; text-align: right; }

.timer { display: flex; align-items: center; gap: 8px; }
.timer-clock {
  font: 500 15px var(--mono);
  font-variant-numeric: tabular-nums;
  color: var(--ink-3);
}
.timer-clock.is-running { color: var(--signal); }

/* ---------------- copyable identifiers ---------------- */
.copyable { display: inline-flex; align-items: center; gap: 5px; }

.copy-button {
  background: none;
  border: none;
  padding: 2px;
  border-radius: 4px;
  color: var(--ink-3);
  cursor: pointer;
  line-height: 0;
  opacity: 0;
  transition: opacity .12s ease, color .12s ease;
}
/* Present but quiet: revealed on hover or keyboard focus, so identifiers stay
   readable rather than sprouting furniture. */
.copyable:hover .copy-button,
.copy-button:focus-visible,
.page-head:hover .copy-button,
tr:hover .copy-button { opacity: 1; }
.copy-button:hover { color: var(--ink); background: var(--paper); }
.copy-button.is-copied { color: var(--ok); opacity: 1; }
.copy-button.is-copied::after {
  content: "Copied";
  font: 500 11px var(--ui);
  margin-left: 4px;
  vertical-align: middle;
}

@media (hover: none) {
  .copy-button { opacity: 1; }
}

/* Links in the eyebrow and subtitle were falling back to browser blue. */
.page-head .eyebrow a, .page-head .sub a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-color: var(--line-2);
}
.page-head .eyebrow a:hover, .page-head .sub a:hover {
  color: var(--signal);
  text-decoration-color: var(--signal);
}

.step.has-error { border-color: var(--danger); }
.step-error {
  font-size: 12.5px;
  color: var(--danger);
  margin-bottom: 6px;
  line-height: 1.45;
}

.flash-notice { display: flex; align-items: center; gap: 14px; }

/* ================= left navigation ================= */

body.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 226px;
  flex: 0 0 226px;
  background: var(--ink);
  color: rgba(255,255,255,.72);
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  transition: width .14s ease, flex-basis .14s ease;
}

.sidebar-head {
  display: flex; align-items: center; gap: 8px;
  padding: 16px 14px 14px;
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.sidebar-brand { text-decoration: none; color: #fff; flex: 1; min-width: 0; }
.sidebar-brand-name {
  font: 600 14px var(--ui);
  letter-spacing: -0.01em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  display: block;
}
.sidebar-brand-initials {
  display: none;
  font: 600 13px var(--ui);
  letter-spacing: .02em;
  color: #fff;
}

.sidebar-toggle {
  background: none; border: none; padding: 4px; cursor: pointer;
  color: rgba(255,255,255,.45); border-radius: 5px; line-height: 0;
}
.sidebar-toggle:hover { color: #fff; background: rgba(255,255,255,.08); }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 8px;
  /* Thin, and only visible while scrolling — a default scrollbar in a dark
     rail reads as a light stripe down the edge of the app. */
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.16) transparent;
  scrollbar-gutter: stable;
}
.sidebar-nav::-webkit-scrollbar { width: 6px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb {
  background: transparent;
  border-radius: 3px;
}
.sidebar:hover .sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,.16); }
.sidebar-nav:hover::-webkit-scrollbar-thumb { background: rgba(255,255,255,.28); }

.nav-group + .nav-group { margin-top: 16px; }
/* Grey, but readable. These were hard to read at 10px/500 against the dark
   rail — the fix is weight and size, not colour: tinting them made them
   compete with the active item, which is the one thing here that should
   stand out. */
.nav-group-label {
  font: 600 11.5px var(--ui);
  text-transform: uppercase;
  letter-spacing: .07em;
  color: rgba(255,255,255,.52);
  padding: 0 8px 7px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  border-radius: 7px;
  color: rgba(255,255,255,.72);
  text-decoration: none;
  font-size: 13.5px;
  white-space: nowrap;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: rgba(255,255,255,.12); color: #fff; }
.nav-icon { flex: 0 0 16px; opacity: .82; }
.nav-item.active .nav-icon { opacity: 1; color: var(--primary, var(--signal)); }
.nav-label { flex: 1; overflow: hidden; text-overflow: ellipsis; }

/* A queue you work through, versus something that has gone wrong. */
.nav-count {
  font: 500 11px var(--ui);
  background: rgba(255,255,255,.16);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  flex-shrink: 0;
}
.nav-count.is-alert { background: var(--danger); }

.sidebar-foot {
  border-top: 1px solid rgba(255,255,255,.08);
  padding: 10px 8px;
}
.nav-user {
  font-size: 12px; color: rgba(255,255,255,.42);
  padding: 2px 8px 8px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.nav-signout {
  width: 100%; background: none; border: none; cursor: pointer;
  font: inherit; font-size: 13.5px; text-align: left;
}
.nav-signout:hover { background: rgba(255,255,255,.07); }

/* Collapsed: icons only, with the title attribute doing the explaining. */
body.nav-collapsed .nav-label,
body.nav-collapsed .nav-group-label,
body.nav-collapsed .sidebar-brand-name,
body.nav-collapsed .nav-user { display: none; }
body.nav-collapsed .nav-item { justify-content: center; padding: 9px 0; }
body.nav-collapsed .nav-group + .nav-group {
  margin-top: 10px; padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,.08);
}
body.nav-collapsed .nav-count {
  position: absolute; margin-left: 18px; margin-top: -14px;
  padding: 0 5px; font-size: 10px;
}
body.nav-collapsed .sidebar-brand-initials { display: block; }
body.nav-collapsed .sidebar-brand { flex: 0 0 auto; }
body.nav-collapsed .sidebar-head {
  flex-direction: column; gap: 10px; padding: 14px 0 12px;
}

/* Set outright rather than through the custom property: a variable swap on the
   flex container didn't reliably re-resolve flex-basis here. */
body.nav-collapsed .sidebar {
  width: 58px;
  flex: 0 0 58px;
}

.app-body { flex: 1; min-width: 0; }
.app-main { max-width: 1240px; margin: 0 auto; padding: 26px 28px 60px; }

@media (max-width: 860px) {
  body.app-shell { display: block; }
  .sidebar {
    position: static; width: 100%; flex: none; height: auto;
    flex-direction: row; align-items: center; overflow-x: auto;
  }
  .sidebar-nav { display: flex; gap: 4px; padding: 8px; }
  .nav-group { display: flex; gap: 4px; }
  .nav-group + .nav-group { margin-top: 0; }
  .nav-group-label, .sidebar-foot { display: none; }
  .app-main { padding: 18px 16px 40px; }
}

/* The shop preview leaves the back office, so it reads a little quieter. */
.nav-item.is-external { color: rgba(255,255,255,.5); }
.nav-item.is-external:hover { color: #fff; }

/* ---------------- dashboard ---------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.tile {
  display: block; text-decoration: none;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r); padding: 16px 18px;
}
.tile:hover { border-color: var(--line-2); }
.tile.is-alert { border-color: var(--danger); }
.tile-label { font: 500 10px var(--ui); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-3); }
.tile-value { font: 600 24px var(--ui); letter-spacing: -0.02em; color: var(--ink); margin-top: 6px; }
.tile.is-alert .tile-value { color: var(--danger); }
.tile-note { font-size: 12px; color: var(--ink-3); margin-top: 2px; }

.attention-row {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 18px; text-decoration: none; color: var(--ink); font-size: 13.5px;
}
.attention-row:hover { background: var(--paper); }
.attention-main { display: flex; gap: 8px; align-items: baseline; min-width: 0; }
.attention-main .muted { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.attention-right { text-align: right; flex-shrink: 0; }
.attention-right.is-alert { color: var(--danger); }
.attention-note { display: block; font-size: 11.5px; color: var(--ink-3); }

/* ---------------- customer acceptance ---------------- */
.accept-page { max-width: 720px; margin: 0 auto; padding: 30px 20px 60px; }
.accept-head {
  display: flex; justify-content: space-between; align-items: flex-start; gap: 20px;
  padding-bottom: 18px; margin-bottom: 22px; border-bottom: 2px solid var(--ink);
}
.accept-company { font: 600 14px var(--ui); }
.accept-head h1 { font-size: 26px; margin: 6px 0 4px; letter-spacing: -0.02em; }
.accept-sub { color: var(--ink-3); font-size: 13.5px; margin: 0; }

.accept-done {
  background: var(--ok-bg, #EDF5EF); border: 1px solid var(--ok, #3F7A52);
  border-radius: var(--r); padding: 18px 20px; margin-bottom: 24px;
}
.accept-done h2 { font-size: 17px; margin: 0 0 6px; }
.accept-done p { margin: 0; font-size: 14px; }
.accept-signature-shown {
  margin-top: 12px; max-width: 260px; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; padding: 6px;
}

.accept-lines table { width: 100%; border-collapse: collapse; }
.accept-lines th {
  font: 500 10px var(--ui); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-3); text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--ink);
}
.accept-lines td { padding: 12px 10px; border-bottom: 1px solid var(--line); font-size: 14px; vertical-align: top; }
.accept-lines .num { text-align: right; }
.accept-lines .muted { font-size: 12.5px; }
.accept-option { color: var(--ink-3); }
.accept-total {
  display: flex; justify-content: space-between; align-items: baseline;
  padding: 16px 10px 0; font-size: 15px;
}
.accept-total strong { font-size: 22px; letter-spacing: -0.02em; }

.accept-terms { margin-top: 28px; font-size: 13px; color: var(--ink-2); }
.accept-terms h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-3); }

.accept-form {
  margin-top: 32px; padding: 22px;
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r);
}
.accept-form h2 { font-size: 19px; margin: 0 0 6px; }
.accept-form > .muted { font-size: 13px; margin: 0 0 18px; }

/* Tall enough to sign in properly — a cramped box produces a scrawl nobody
   would recognise as theirs. */
.signature-pad { position: relative; }
.signature-pad canvas {
  width: 100%; height: 150px; touch-action: none;
  background: #fff; border: 1px dashed var(--line-2); border-radius: var(--r);
  cursor: crosshair; display: block;
}
.signature-clear {
  position: absolute; top: 8px; right: 8px;
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: var(--ink-3);
}
.signature-clear:hover { background: none; color: var(--ink); }

.accept-agree { align-items: flex-start; gap: 10px; margin: 18px 0; font-size: 14px; line-height: 1.5; }
.accept-actions .button { width: 100%; padding: 13px; font-size: 15px; }

.accept-decline { margin-top: 20px; }
.accept-decline > summary { cursor: pointer; font-size: 13px; color: var(--ink-3); }
.accept-decline > summary:hover { color: var(--ink); }

.accept-foot { margin-top: 34px; font-size: 12px; color: var(--ink-3); text-align: center; }

.document-body { background: var(--paper); display: block; min-height: 100vh; }
.document-body .flash-stack { max-width: 720px; margin: 0 auto; padding: 16px 20px 0; }

/* Won work reads as won, not as another warning. */
.tile.is-good { border-color: var(--ok, #3F7A52); }
.tile.is-good .tile-value { color: var(--ok, #3F7A52); }
.attention-right.is-task { color: var(--ink-2); }

/* The totals block sits flush to the table above it, so the signature card
   needs its own room rather than butting against the total. */
.signature-card { margin-top: 26px; }

/* Which site you're looking at. Sits under the brand because it changes the
   meaning of nearly everything below it. */
.location-switch { padding: 10px 10px 0; }
.location-switch select {
  width: 100%; padding: 6px 8px; font: 500 12.5px var(--ui);
  color: #fff; background: rgba(255,255,255,.08);
  border: 1px solid rgba(255,255,255,.14); border-radius: 6px;
}
.location-switch select:hover { background: rgba(255,255,255,.13); }
.location-switch option { color: var(--ink); }
.location-single {
  padding: 10px 12px 0; font-size: 11.5px; color: rgba(255,255,255,.4);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
body.nav-collapsed .location-switch,
body.nav-collapsed .location-single { display: none; }
.num.is-alert { color: var(--danger); }

/* ---------------- settings area ---------------- */

/* A second rail INSIDE the content, so it reads as a place you've gone rather
   than a mode the whole app is in. */
.settings-shell {
  display: grid;
  grid-template-columns: 176px minmax(0, 1fr);
  gap: 34px;
  align-items: start;
}

.settings-nav { position: sticky; top: 26px; }
.settings-nav-head { padding: 0 0 10px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.settings-nav-title {
  font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-3); text-decoration: none;
}
.settings-nav-title:hover { color: var(--ink); }

.settings-nav-item {
  display: flex; align-items: baseline; justify-content: space-between; gap: 8px;
  padding: 6px 10px; margin: 0 -10px;
  border-radius: 6px; text-decoration: none;
  color: var(--ink-2); font-size: 13.5px;
}
.settings-nav-item:hover { background: var(--paper); color: var(--ink); }
.settings-nav-item.active { background: var(--surface); color: var(--ink); font-weight: 500; }
/* The marker is the accent, not the whole row — the row is somewhere you are,
   not something that needs shouting. */
.settings-nav-item.active .settings-nav-name { box-shadow: inset 0 -2px 0 var(--signal); }
.settings-nav-count { font: 400 11.5px var(--mono); color: var(--ink-3); }

.settings-content { min-width: 0; }

/* The landing page is a map: what each area controls, and what's in it. */
.settings-map {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}
.settings-card {
  display: block; text-decoration: none;
  padding: 16px 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
}
.settings-card:hover { border-color: var(--line-2); }
.settings-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.settings-card h2 {
  font-size: 15px; margin: 0; letter-spacing: -0.01em; color: var(--ink);
}
.settings-card-count { font: 500 12px var(--mono); color: var(--ink-3); }
.settings-card p {
  margin: 6px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-3);
}

@media (max-width: 900px) {
  .settings-shell { grid-template-columns: 1fr; gap: 18px; }
  .settings-nav { position: static; display: flex; flex-wrap: wrap; gap: 4px; }
  .settings-nav-head { width: 100%; }
  .settings-nav-item { margin: 0; }
}

/* ---------------- audit trail ---------------- */

/* A trail is scrolled, so its filters travel with it. */
.audit-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding: 12px 0 14px; margin-bottom: 4px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}
.audit-filters { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.audit-field { display: flex; flex-direction: column; gap: 4px; }
.audit-field label {
  font: 500 10px var(--ui); text-transform: uppercase; letter-spacing: .07em;
  color: var(--ink-3);
}
.audit-field input, .audit-field select {
  padding: 5px 8px; font-size: 13px; border: 1px solid var(--line-2);
  border-radius: 6px; background: var(--surface); color: var(--ink);
}
.audit-field-wide input { min-width: 230px; }
.audit-actions { display: flex; align-items: center; gap: 10px; padding-bottom: 1px; }
.audit-bar-end { display: flex; align-items: center; gap: 12px; padding-bottom: 1px; }
.audit-count { font: 500 12px var(--mono); color: var(--ink-3); }

/* The day is a heading; the row carries only the time. */
.audit-day {
  display: flex; align-items: baseline; gap: 10px;
  padding: 20px 0 6px;
}
.audit-day-date {
  font: 600 11px var(--ui); text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-2);
}
.audit-day-count { font: 400 11px var(--mono); color: var(--ink-3); }

.audit-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr) 200px 150px;
  gap: 14px; align-items: baseline;
  padding: 7px 10px; margin: 0 -10px;
  border-radius: 6px;
  font-size: 13px;
  border-bottom: 1px solid var(--line);
}
.audit-row:hover { background: var(--surface); }
.audit-time { font: 400 12px var(--mono); color: var(--ink-3); }

.audit-what { display: flex; align-items: baseline; gap: 8px; min-width: 0; }
.audit-action {
  flex-shrink: 0;
  font: 500 11.5px var(--ui);
  padding: 1px 7px; border-radius: 4px;
  background: var(--paper); color: var(--ink-2);
  border: 1px solid var(--line-2);
}
.audit-action.is-created { color: var(--ok, #3F7A52); border-color: #CBE0D2; background: #F1F7F3; }
.audit-action.is-removal { color: var(--danger); border-color: #EBC9C6; background: #FBF1F0; }
.audit-action.is-refused { color: #fff; background: var(--danger); border-color: var(--danger); }
.audit-record {
  color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.audit-who { color: var(--ink-3); font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; }
.audit-role {
  font: 500 10px var(--ui); text-transform: uppercase; letter-spacing: .05em;
  color: var(--ink-3); margin-left: 4px;
}

.audit-detail summary {
  cursor: pointer; list-style: none;
  font-size: 12px; color: var(--ink-3);
}
.audit-detail summary::-webkit-details-marker { display: none; }
.audit-detail summary:hover { color: var(--ink); }
.audit-detail dl { margin: 6px 0 2px; font-size: 12px; }
.audit-detail dl div { display: flex; gap: 8px; padding: 2px 0; }
.audit-detail dt { color: var(--ink-3); min-width: 92px; }
.audit-detail dd { margin: 0; color: var(--ink); word-break: break-word; }
.audit-before { color: var(--ink-3); text-decoration: line-through; }

@media (max-width: 1000px) {
  .audit-row { grid-template-columns: 48px minmax(0, 1fr); }
  .audit-who, .audit-detail { grid-column: 2; }
}

/* ---------------- sticky list toolbar ---------------- */

/* Every list that can be filtered gets the same bar, in the same place, doing
   the same thing — the audit trail proved the pattern, so it shouldn't be a
   one-off. Controls stay with you as the list scrolls under them. */
.list-bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between;
  gap: 18px; flex-wrap: wrap;
  padding: 10px 0 12px;
  margin-bottom: 4px;
  background: var(--paper);
  border-bottom: 1px solid var(--line-2);
}
/* The page title scrolls away; the controls don't. */
.page-head:has(+ .list-bar), .page-head:has(+ * + * + .list-bar) { padding-bottom: 4px; }

.list-bar .filter-tabs { margin: 0; }
.list-bar .head-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

@media (max-width: 720px) {
  .list-bar { gap: 10px; padding: 8px 0 10px; }
  .list-bar .head-actions { width: 100%; }
}

/* ---------------- shop, refined ---------------- */

/* The sequence is the reassurance: people hesitate here because they can't
   see how a made-to-measure price gets decided. */
.pub-steps {
  display: flex; flex-wrap: wrap; gap: 18px;
  list-style: none; margin: 22px 0 0; padding: 0;
}
.pub-steps li {
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--ink-2);
}
.pub-steps span {
  display: grid; place-items: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: var(--ink); color: #fff;
  font: 500 11px var(--mono);
}

/* Cards are equal height so the row reads as a set, and the footer sits on a
   shared baseline instead of wherever the description happens to end. */
.pub-card { display: flex; flex-direction: column; }
.pub-card-body { display: flex; flex-direction: column; flex: 1; padding-top: 13px; }

/* Two lines, cut at a word by the browser rather than mid-syllable by us. */
.pub-card p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pub-card-foot {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 10px; margin-top: auto; padding-top: 12px;
}

/* The card is already a link, so this is an affordance rather than a second
   control — it moves on hover to say the whole card is clickable. */
.pub-configure {
  font: 500 13px var(--ui); color: var(--ink);
  border-bottom: 1px solid var(--signal);
  padding-bottom: 1px;
}
.pub-card:hover .pub-configure { color: var(--signal); }
.pub-configure::after { content: " →"; transition: none; }

/* Lead time is useful, not headline: it was the loudest thing on the card,
   competing with the product's own name. */
.pub-lead { font-size: 12px; color: var(--ink-3); }

.pub-empty {
  max-width: 460px; padding: 40px 0;
}
.pub-empty h2 { font-size: 20px; margin: 0 0 8px; letter-spacing: -0.01em; }
.pub-empty p { color: var(--ink-2); font-size: 14.5px; margin: 0; }

@media (max-width: 640px) {
  .pub-steps { gap: 12px; }
  .pub-steps li { font-size: 12.5px; }
}

/* The default price level: still a level, just not one anybody chose. */
.badge-quiet { background: transparent; border: 1px dashed var(--line-2); color: var(--ink-3); }

/* Lifecycle on one side, stations on the other: they answer different
   questions and shouldn't read as one list. */
.tab-divider {
  display: inline-block; width: 1px; height: 16px;
  background: var(--line-2); margin: 0 4px; vertical-align: middle;
}

/* ---------------- in-app reporting ---------------- */

.reporter-button {
  position: fixed; right: 22px; bottom: 22px; z-index: 40;
  display: grid; place-items: center;
  width: 44px; height: 44px;
  /* The global button padding (8px 15px) left a 14px content box for an 18px
     icon, pushing it 2px off centre. I'd been measuring only the vertical and
     kept adjusting the artwork, which was never the problem. */
  padding: 0; line-height: 0;
  border: none; border-radius: 50%;
  background: var(--ink); color: #fff; cursor: pointer;
  box-shadow: 0 2px 6px rgba(20,20,18,.16), 0 10px 28px rgba(20,20,18,.14);
  transition: box-shadow .16s ease;
}
/* Centring is done in the artwork (see the g transform). */
.reporter-button:hover { box-shadow: 0 3px 8px rgba(20,20,18,.2), 0 14px 34px rgba(20,20,18,.2); }
.reporter-button:focus-visible { outline: 2px solid var(--signal); outline-offset: 3px; }

/* A panel, not a modal: reporting and asking are both things you do ALONGSIDE
   your work, and the page you're describing should stay visible while you
   describe it. */
.reporter-panel { position: fixed; inset: 0; z-index: 60; }
.reporter-scrim { position: absolute; inset: 0; background: rgba(20,20,18,.22); }

.reporter-sheet {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(520px, 100vw);
  transition: width .18s ease;
  display: flex; flex-direction: column;
  overflow-y: auto;
  background: var(--surface);
  border-left: 1px solid var(--line-2);
  box-shadow: -18px 0 44px rgba(20,20,18,.16);
  padding: 20px;
}

/* Wider while marking up: the screenshot is the artefact, and every extra
   pixel is one less thing you have to zoom to see. A conversation gains
   nothing from the same width — long lines are harder to read, not easier. */
.reporter-panel.is-marking .reporter-sheet { width: min(760px, 100vw); }

.reporter-close {
  position: absolute; top: 12px; right: 14px; z-index: 2;
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 6px;
  background: none; border: none; padding: 0;
  font-size: 20px; line-height: 1;
  color: var(--ink-3); cursor: pointer;
}
/* Dark disc, light glyph — rather than the global black hover landing behind
   ink-coloured text and reading as a filled square. */
.reporter-close:hover, .reporter-close:focus-visible {
  background: var(--ink); color: #fff;
}

/* Stacked in a panel this narrow — side by side would give each card 230px. */
.reporter-choices { display: grid; gap: 10px; padding-top: 26px; }
/* A display rule beats the hidden attribute, so anything given display:grid or
   display:flex stops being hideable. This caught the choices, and then caught
   the form when it gained display:flex — so it's said once, for every view,
   rather than per class. */
.reporter [hidden] { display: none !important; }

.reporter-choice {
  display: block; text-align: left; cursor: pointer;
  padding: 16px; border-radius: 10px;
  border: 1px solid var(--line-2); background: var(--paper);
  transition: border-color .12s ease, background .12s ease;
}
.reporter-choice:hover { border-color: var(--ink-3); background: var(--surface); }
.reporter-choice-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--surface); border: 1px solid var(--line-2);
  color: var(--ink-2); margin-bottom: 10px;
}
.reporter-choice:hover .reporter-choice-mark { color: var(--signal); border-color: var(--signal); }
.reporter-choice-title { display: block; font: 500 14.5px var(--ui); color: var(--ink); }
.reporter-choice-note {
  display: block; font-size: 12.5px; color: var(--ink-3);
  margin-top: 4px; line-height: 1.45;
}

/* --- marking up --- */

.reporter-toolbar {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 7px 8px; margin: 26px 0 8px;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 9px;
}

/* Every control on the strip is the same square, so the icons line up on one
   grid instead of each sitting wherever its own artwork lands. */
.reporter-back, .reporter-tool {
  display: grid; place-items: center;
  width: 28px; height: 28px; border-radius: 6px;
  border: none; background: none; color: var(--ink-2); cursor: pointer;
  padding: 0;
}
.reporter-back:hover, .reporter-tool:hover { background: var(--surface); color: var(--ink); }
.reporter-tool.is-on { background: var(--ink); color: #fff; }
.reporter-back { color: var(--ink-3); }

.reporter-divider { width: 1px; height: 18px; background: var(--line-2); }
.reporter-tools { display: flex; gap: 2px; }

.reporter-colours { display: flex; gap: 5px; }
.reporter-swatch {
  width: 15px; height: 15px; border-radius: 50%; padding: 0;
  background: var(--swatch); border: none;
  box-shadow: 0 0 0 1px rgba(0,0,0,.14); cursor: pointer;
}
.reporter-swatch.is-on { box-shadow: 0 0 0 1.5px var(--surface), 0 0 0 3px var(--ink); }

.reporter-status { font-size: 11.5px; color: var(--ink-3); margin: 0 0 10px 2px; }
/* Wraps to its own line rather than being clipped when the strip is full. */
.reporter-tool-actions { display: flex; gap: 10px; margin-left: auto; }

.reporter-shot {
  position: relative; padding: 7px;
  background: var(--paper); border: 1px solid var(--line); border-radius: 10px;
}
/* A window onto the picture rather than the whole picture squeezed to fit:
   at panel width a full page is unreadable, so it can be bigger than its
   frame and scrolled. */
.reporter-viewport {
  overflow: auto; max-height: 46vh; border-radius: 4px;
  background: var(--surface);
  overscroll-behavior: contain;
}
.reporter-shot canvas {
  display: block; cursor: crosshair; touch-action: none;
  box-shadow: 0 1px 3px rgba(20,20,18,.1);
}
.reporter-shot canvas.is-picking { cursor: default; }
.reporter-shot canvas.is-panning { cursor: grab; }
.reporter-shot canvas.is-panning:active { cursor: grabbing; }

.reporter-textsize { display: flex; gap: 2px; }
.reporter-a { font: 600 15px var(--ui); line-height: 1; }
.reporter-a.is-small { font-size: 11px; }

.reporter-zoom { display: flex; align-items: center; gap: 1px; }
.reporter-zoom-level {
  min-width: 42px; height: 28px; padding: 0 4px;
  border: none; background: none; cursor: pointer;
  font: 500 11.5px var(--mono); color: var(--ink-2);
  border-radius: 6px;
}
.reporter-zoom-level:hover { background: var(--surface); color: var(--ink); }
/* Sized to itself, not to the form: a global full-width input rule stretched
   this across the whole picture, so it never looked anchored to the click. */
.reporter-text-entry {
  position: absolute; transform: translate(-4px, -50%);
  font: 500 13px var(--ui);
  padding: 4px 8px; border: 1px solid var(--ink); border-radius: 5px;
  background: #fff; z-index: 3;
  width: 210px; min-width: 0; max-width: 210px;
  box-shadow: 0 2px 8px rgba(20,20,18,.18);
}

/* The description is the part people actually have to compose, so it gets the
   room. */
.reporter-fields { margin-top: 16px; }
.reporter-field-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 6px;
}
.reporter-fields label { display: block; margin: 0; }

.reporter-dictate {
  display: flex; align-items: center; gap: 5px;
  padding: 4px 9px; border-radius: 999px;
  border: 1px solid var(--line-2); background: var(--paper);
  font: 500 11.5px var(--ui); color: var(--ink-2); cursor: pointer;
}
.reporter-dictate:hover { background: var(--surface); border-color: var(--ink-3); color: var(--ink); }
/* Listening has to be unmistakable — a microphone that's on and doesn't look
   it is worse than no microphone. */
.reporter-dictate.is-listening {
  background: var(--danger); border-color: var(--danger); color: #fff;
}
.reporter-dictate.is-listening svg { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%, 100% { opacity: 1 } 50% { opacity: .45 } }
.reporter-fields textarea { width: 100%; min-height: 130px; resize: vertical; }

/* Three options is a choice, not a form control with a label above it. */
.reporter-severity { display: flex; gap: 6px; margin-top: 10px; }
.reporter-pill { flex: 1; }
.reporter-pill input { position: absolute; opacity: 0; pointer-events: none; }
.reporter-pill span {
  display: block; text-align: center; cursor: pointer;
  padding: 7px 6px; border-radius: 7px;
  border: 1px solid var(--line-2); background: var(--paper);
  font-size: 12.5px; color: var(--ink-2);
}
.reporter-pill input:checked + span {
  background: var(--ink); border-color: var(--ink); color: #fff;
}
.reporter-pill input:focus-visible + span { outline: 2px solid var(--signal); outline-offset: 2px; }

.reporter-actions {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px; margin-top: auto; padding-top: 16px;
  border-top: 1px solid var(--line);
}
.reporter-fineprint { font-size: 11px; margin: 0; line-height: 1.5; }
.reporter-form { display: flex; flex-direction: column; flex: 1; padding-top: 26px; }

/* --- the assistant, stubbed --- */

.reporter-assistant { padding-top: 6px; }
.assistant-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.assistant-message p {
  margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink);
  background: var(--paper); border-radius: 10px; padding: 12px 14px;
}
.assistant-examples { display: grid; gap: 8px; margin: 14px 0; }
.assistant-example {
  display: block; text-align: left; padding: 12px 14px;
  border: 1px dashed var(--line-2); border-radius: 9px;
  background: none; color: inherit; cursor: not-allowed; opacity: .75;
}
.assistant-example:hover { background: none; }
.assistant-example strong { display: block; font: 500 13.5px var(--ui); }
.assistant-example span {
  display: block; font-size: 12.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.45;
}
.assistant-note { font-size: 12px; line-height: 1.5; margin: 0; }
.assistant-composer {
  display: flex; gap: 8px; align-items: flex-end;
  margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line);
}
.assistant-composer textarea { flex: 1; resize: none; }

@media (max-width: 560px) {
  .reporter-sheet { width: 100vw; padding: 16px; }
  .reporter-button { right: 14px; bottom: 14px; }
}

.report-shot { max-width: 100%; border: 1px solid var(--line); border-radius: 8px; }
.report-errors {
  font: 400 11.5px var(--mono); background: var(--paper); padding: 10px;
  border-radius: 6px; overflow-x: auto; white-space: pre-wrap; margin: 0;
}
.report-meta { font: 400 12px var(--mono); text-align: right; word-break: break-all; }

.reporter-stub-list { margin: 0 0 14px; padding-left: 18px; font-size: 13px; line-height: 1.6; }
