:root {
  --ink: #171311;
  --mahogany: #3c1518;
  --burgundy: #681e27;
  --oxblood: #861f2d;
  --copper: #b78345;
  --brass: #d0a565;
  --ivory: #f1eadc;
  --paper: #fbf7ed;
  --paper-2: #e8decb;
  --muted: #776d61;
  --line: rgba(50, 31, 24, .18);
  --green: #1f6a50;
  --amber: #9b6418;
  --red: #9a2834;
  --shadow: 0 18px 48px rgba(34, 20, 15, .14);
  --serif: Georgia, "Times New Roman", serif;
  --sans: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Photo-first intake; detailed assessment stays at the review bench. */
.simple-intake .page-head p, .intake-tip { font-size: 1rem; line-height: 1.5; }
.intake-tip { margin: 0 0 16px; color: #5d5148; }
.intake-photos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.intake-photo { min-width: 0; padding: 14px; border: 1px solid var(--line); border-radius: 7px; background: rgba(255,255,255,.6); }
.intake-photo.saved { border-color: #63776a; }
.intake-photo-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px; margin-bottom: 16px; }
.intake-photo h3 { margin: 0; font: 600 24px/1.2 var(--serif); }
.intake-photo-head span, .photo-note, .intake-local { font-size: .875rem; line-height: 1.4; color: #5d5148; }
.intake-preview { width: 100%; height: 150px; object-fit: contain; background: #211b18; border-radius: 4px; margin-bottom: 12px; }
.intake-photo-actions { display: grid; gap: 8px; }
.photo-picker { position: relative; display: grid; place-items: center; min-height: 48px; padding: 10px 6px; overflow: hidden; color: #fffaf0; background: var(--mahogany); border: 1px solid var(--mahogany); border-radius: 5px; font-size: 1rem; font-weight: 600; cursor: pointer; }
.photo-picker.secondary { color: var(--mahogany); background: transparent; }
.photo-picker input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.photo-picker:focus-within { outline: 3px solid var(--copper); outline-offset: 3px; }
.photo-picker.unavailable { opacity: .5; cursor: default; }
.intake-status { font-size: 1rem; line-height: 1.5; margin: 18px 0 12px; }
.simple-intake .intake-next { width: 100%; min-height: 50px; font-size: 1rem; }
.intake-local { margin: 12px 0 0; text-align: center; }
.intake-details > summary { padding: 16px; cursor: pointer; font-size: 1rem; font-weight: 600; }
.intake-details > summary span { margin-left: 8px; font-size: .875rem; font-weight: 400; color: #5d5148; }
.intake-details .field label { font-size: .875rem; text-transform: none; letter-spacing: 0; }
.intake-details .field input, .intake-details .field select, .intake-details .field textarea { font-size: 1rem; }
.simple-intake .panel-head span { font-size: .875rem; letter-spacing: 0; text-transform: none; }
@media (max-width: 360px) {
  .intake-photos { gap: 8px; }
  .intake-photo { padding: 10px; }
  .intake-details .field-grid { grid-template-columns: 1fr; }
}

* { box-sizing: border-box; }
html { background: #1a1513; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(circle at 90% 0%, rgba(183,131,69,.18), transparent 32rem),
    linear-gradient(155deg, #eee4d3, #f8f3e9 48%, #e8decb);
  font-family: var(--sans);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.shell { min-height: 100vh; padding-bottom: calc(82px + env(safe-area-inset-bottom)); }

.masthead {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 78px;
  padding: calc(10px + env(safe-area-inset-top)) 16px 10px;
  color: #fffaf0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px) 0 0/12px 12px,
    linear-gradient(180deg, rgba(255,255,255,.05), transparent 40%),
    #171311;
  border-bottom: 2px solid var(--copper);
  box-shadow: 0 8px 24px rgba(25,14,10,.28);
}
.monogram {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(208,165,101,.75);
  outline: 1px solid rgba(255,255,255,.12);
  outline-offset: -5px;
  background: linear-gradient(145deg, #73202a, #351014);
  color: #f2d7aa;
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: -.08em;
}
.brand-lockup { min-width: 0; line-height: 1; }
.brand-lockup p,
.brand-lockup span {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 8px;
  color: rgba(255,250,240,.62);
}
.brand-lockup h1 {
  margin: 5px 0 4px;
  font: 600 20px/.9 var(--serif);
  letter-spacing: .015em;
}
.icon-btn {
  margin-left: auto;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid rgba(208,165,101,.5);
  background: rgba(255,255,255,.06);
  color: #f4d6a5;
  font-size: 22px;
}

.batch-rail {
  position: sticky;
  top: calc(78px + env(safe-area-inset-top));
  z-index: 25;
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  background: rgba(247,241,230,.96);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.rail-copy { flex: 0 0 104px; }
.rail-copy strong { display: block; font: 600 12px/1.15 var(--serif); }
.eyebrow {
  display: block;
  margin-bottom: 3px;
  color: var(--burgundy);
  font-size: 8px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .11em;
}
.card-strip {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 2px 2px 5px;
  scrollbar-width: none;
}
.card-strip::-webkit-scrollbar { display: none; }
.card-chip {
  position: relative;
  flex: 0 0 37px;
  height: 43px;
  border: 1px solid rgba(52,34,27,.2);
  border-radius: 4px;
  background: rgba(255,255,255,.62);
  box-shadow: 0 2px 5px rgba(45,25,19,.08);
  font-weight: 800;
  font-size: 11px;
}
.card-chip::after {
  content: "";
  position: absolute;
  right: 4px;
  bottom: 4px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #b7aea2;
}
.card-chip[data-state="started"]::after { background: var(--amber); }
.card-chip[data-state="complete"]::after { background: var(--green); }
.card-chip.active {
  color: #fff;
  border-color: var(--mahogany);
  background: linear-gradient(145deg, var(--burgundy), var(--mahogany));
  box-shadow: 0 4px 12px rgba(93,27,35,.26);
}

main { width: min(100%, 760px); margin: 0 auto; padding: 20px 14px 32px; }
.page-head { margin: 5px 2px 18px; }
.page-head .kicker {
  margin: 0 0 7px;
  color: var(--burgundy);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: .16em;
  text-transform: uppercase;
}
.page-head h2 { margin: 0; font: 600 clamp(26px, 7vw, 38px)/.98 var(--serif); }
.page-head p { margin: 9px 0 0; max-width: 60ch; color: var(--muted); font-size: 13px; line-height: 1.5; }

.panel {
  margin-bottom: 14px;
  overflow: hidden;
  border: 1px solid rgba(55,36,27,.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255,255,255,.7), rgba(255,255,255,.2)),
    var(--paper);
  box-shadow: 0 7px 24px rgba(43,25,19,.08);
}
.panel.dark {
  color: #fff8eb;
  background:
    linear-gradient(90deg, rgba(255,255,255,.025) 1px, transparent 1px) 0 0/9px 9px,
    linear-gradient(145deg, rgba(58,44,39,.96), rgba(13,11,10,.98));
  border-color: rgba(183,131,69,.58);
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 15px;
  border-bottom: 1px solid var(--line);
  background: rgba(75,40,31,.035);
}
.panel.dark .panel-head { border-color: rgba(255,255,255,.1); }
.panel-head h3 { margin: 0; font: 600 16px/1.1 var(--serif); }
.panel-head span { color: var(--muted); font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.panel.dark .panel-head span { color: rgba(255,248,235,.55); }
.panel-body { padding: 15px; }

.status-line {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.45);
  font-size: 12px;
}
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: #a79c90; }
.status-dot.good { background: var(--green); box-shadow: 0 0 0 4px rgba(31,106,80,.11); }
.status-dot.warn { background: var(--amber); box-shadow: 0 0 0 4px rgba(155,100,24,.1); }
.status-dot.hold { background: var(--red); box-shadow: 0 0 0 4px rgba(154,40,52,.1); }

.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label,
.mini-label {
  display: block;
  margin: 0 0 6px;
  color: #5d5148;
  font-size: 9px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
}
.field input,
.field select,
.field textarea,
.score-input {
  width: 100%;
  min-height: 43px;
  padding: 10px 11px;
  color: var(--ink);
  border: 1px solid rgba(60,38,28,.24);
  border-radius: 5px;
  outline: none;
  background: rgba(255,255,255,.67);
}
.field textarea { min-height: 78px; resize: vertical; }
.field input:focus,
.field select:focus,
.field textarea:focus,
.score-input:focus { border-color: var(--copper); box-shadow: 0 0 0 3px rgba(183,131,69,.14); }
.help { display: block; margin-top: 5px; color: var(--muted); font-size: 10px; line-height: 1.35; }
.divider { height: 1px; margin: 16px 0; background: var(--line); }

.button-row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 15px; }
.btn {
  min-height: 43px;
  padding: 10px 14px;
  border: 1px solid rgba(61,37,28,.25);
  border-radius: 5px;
  background: rgba(255,255,255,.58);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}
.btn.primary {
  color: #fff8ea;
  border-color: #4b171d;
  background: linear-gradient(180deg, #7b2631, #4a151a);
  box-shadow: inset 0 1px rgba(255,255,255,.18), 0 5px 14px rgba(80,20,28,.18);
}
.btn.dark { color: #f8ebd5; background: #201b18; border-color: #201b18; }
.btn.copper { color: #281811; background: linear-gradient(180deg, #d9b173, #b47f3d); border-color: #9b672e; }
.btn.danger { color: var(--red); border-color: rgba(154,40,52,.3); background: rgba(154,40,52,.04); }
.btn:disabled { opacity: .42; cursor: not-allowed; }
.btn.small { min-height: 34px; padding: 7px 10px; font-size: 10px; }

.metric-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; }
.metric {
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.45);
}
.metric span { display: block; color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.metric strong { display: block; margin-top: 5px; font: 600 20px/1 var(--serif); }
.metric.good strong { color: var(--green); }
.metric.warn strong { color: var(--amber); }
.metric.hold strong { color: var(--red); }

.protocol-grid { display: grid; gap: 9px; }
.capture-card {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
  min-height: 68px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.48);
}
.capture-card.complete { border-color: rgba(31,106,80,.38); background: rgba(31,106,80,.045); }
.capture-no {
  width: 36px;
  height: 46px;
  display: grid;
  place-items: center;
  color: rgba(255,255,255,.86);
  border-radius: 3px;
  background: linear-gradient(145deg, #3e3530, #171311);
  font: 600 13px var(--serif);
}
.capture-copy { min-width: 0; }
.capture-copy strong { display: block; font-size: 12px; }
.capture-copy span { display: block; margin-top: 3px; color: var(--muted); font-size: 10px; line-height: 1.3; }
.capture-result { margin-top: 5px; font-size: 9px; font-weight: 700; color: var(--green); }
.capture-action { position: relative; }
.capture-action input { position: absolute; inset: 0; opacity: 0; width: 100%; cursor: pointer; }
.capture-action label { display: block; padding: 8px 9px; border: 1px solid var(--line); border-radius: 4px; background: #fffaf1; font-size: 10px; font-weight: 800; }
.capture-card.complete .capture-action label { color: var(--green); border-color: rgba(31,106,80,.3); }

.quality-key { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; color: var(--muted); font-size: 9px; }
.quality-key b { color: var(--ink); }
.callout {
  padding: 12px 13px;
  border-left: 3px solid var(--copper);
  background: rgba(183,131,69,.09);
  color: #574b42;
  font-size: 11px;
  line-height: 1.5;
}
.callout.hold { border-left-color: var(--red); background: rgba(154,40,52,.06); }
.callout.good { border-left-color: var(--green); background: rgba(31,106,80,.06); }

.centering-stage { position: relative; overflow: hidden; border-radius: 6px; background: #151312; }
#centeringCanvas { width: 100%; display: block; touch-action: none; }
.guide-sequence {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
}
.guide-pill {
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: rgba(255,255,255,.46);
  color: var(--muted);
  font-size: 8px;
  text-align: center;
}
.guide-pill.done { color: var(--green); border-color: rgba(31,106,80,.34); }
.guide-pill.active { color: #fff; background: var(--burgundy); border-color: var(--burgundy); }

.subgrade-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.subgrade {
  padding: 10px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  text-align: center;
  background: rgba(255,255,255,.47);
}
.subgrade span { display: block; color: var(--muted); font-size: 7px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.subgrade strong { display: block; margin-top: 5px; font: 600 25px/1 var(--serif); }
.grade-orb {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  margin: 5px auto 14px;
  border: 1px solid rgba(208,165,101,.72);
  outline: 1px solid rgba(255,255,255,.12);
  outline-offset: -7px;
  border-radius: 50%;
  background: radial-gradient(circle at 34% 24%, #51433d, #171311 62%);
  box-shadow: 0 10px 28px rgba(0,0,0,.35), inset 0 0 26px rgba(255,255,255,.04);
  color: #f1d3a2;
  font: 600 42px/1 var(--serif);
}
.grade-name { text-align: center; margin: -7px 0 16px; color: rgba(255,248,235,.72); font-size: 10px; letter-spacing: .13em; text-transform: uppercase; }

.defect-list { display: grid; gap: 7px; margin: 12px 0; }
.defect-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.45);
}
.defect-row strong { display: block; font-size: 11px; }
.defect-row span { display: block; margin-top: 3px; color: var(--muted); font-size: 9px; }
.severity { color: var(--burgundy); text-transform: uppercase; letter-spacing: .08em; }

.check-grid { display: grid; gap: 7px; }
.check-row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: rgba(255,255,255,.4);
  font-size: 11px;
  line-height: 1.35;
}
.check-row input { width: 17px; height: 17px; accent-color: var(--burgundy); }

.review-card {
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.45);
}
.review-card + .review-card { margin-top: 10px; }
.review-card.locked { background: repeating-linear-gradient(135deg, rgba(29,21,18,.045) 0 5px, transparent 5px 10px); }
.review-head { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.review-head strong { font: 600 14px var(--serif); }
.lock-state { color: var(--muted); font-size: 9px; text-transform: uppercase; letter-spacing: .08em; }
.commitment { overflow-wrap: anywhere; color: var(--muted); font: 9px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; }

.ledger { position: relative; margin-left: 10px; padding-left: 20px; border-left: 1px solid rgba(183,131,69,.55); }
.ledger-event { position: relative; padding: 0 0 18px; }
.ledger-event::before {
  content: "";
  position: absolute;
  left: -25px;
  top: 2px;
  width: 9px;
  height: 9px;
  border: 2px solid var(--paper);
  border-radius: 50%;
  background: var(--burgundy);
  box-shadow: 0 0 0 1px var(--copper);
}
.ledger-event strong { display: block; font-size: 11px; }
.ledger-event time { display: block; margin: 3px 0; color: var(--muted); font-size: 9px; }
.ledger-event code { display: block; overflow-wrap: anywhere; color: #75675b; font-size: 8px; }

.confidence-bar { height: 9px; overflow: hidden; border-radius: 9px; background: #d9cdbb; }
.confidence-bar i { display: block; height: 100%; background: linear-gradient(90deg, var(--burgundy), var(--copper)); }

.tabbar {
  position: fixed;
  z-index: 40;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  padding: 7px 6px calc(6px + env(safe-area-inset-bottom));
  color: rgba(255,248,235,.52);
  background: rgba(20,16,14,.98);
  border-top: 1px solid rgba(208,165,101,.45);
  backdrop-filter: blur(14px);
}
.tabbar button {
  display: grid;
  gap: 3px;
  place-items: center;
  padding: 4px 1px;
  border: 0;
  background: transparent;
  color: inherit;
  font-size: 8px;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.tabbar button span {
  width: 27px;
  height: 22px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 3px;
  font: 600 9px var(--serif);
}
.tabbar button.active { color: #f1d3a2; }
.tabbar button.active span { border-color: var(--copper); background: rgba(183,131,69,.12); }

.table-scroll { overflow-x: auto; margin: 14px 0; }
.audit-table { width: 100%; border-collapse: collapse; font-size: 11px; }
.audit-table th, .audit-table td { padding: 9px 7px; text-align: left; border-bottom: 1px solid #a68c7040; }
.audit-table th { text-transform: capitalize; }
.issue-list { padding-left: 18px; font-size: 12px; line-height: 1.7; }
.coverage-row { padding: 14px 0; border-bottom: 1px solid #a68c7040; }
.coverage-row summary { font-size: 12px; font-weight: 600; cursor: pointer; }
.coverage-row code, .json-record { display: block; overflow-wrap: anywhere; white-space: pre-wrap; font-size: 10px; }
.coverage-row .field, .coverage-row .btn { margin-top: 10px; }
.evidence-stage { position: relative; width: 100%; margin: 10px 0; touch-action: manipulation; }
.evidence-stage img { display: block; width: 100%; height: auto; border-radius: 3px; }
.evidence-pin { position: absolute; width: 22px; height: 22px; border: 2px solid #ef4040; border-radius: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.evidence-pin[hidden] { display: none; }
.registry-mark { display: grid; place-items: center; border: .3mm solid #907147; color: #653f2c; width: 8mm; height: 8mm; font: bold 12pt Georgia,serif; }
button:disabled, input:disabled, select:disabled, textarea:disabled { cursor: not-allowed; opacity: .55; }

.toast {
  position: fixed;
  z-index: 90;
  left: 50%;
  bottom: calc(88px + env(safe-area-inset-bottom));
  width: min(calc(100% - 28px), 460px);
  padding: 12px 15px;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  color: #fff9ef;
  border: 1px solid rgba(208,165,101,.55);
  border-radius: 6px;
  background: rgba(25,20,18,.96);
  box-shadow: var(--shadow);
  font-size: 11px;
  transition: .2s ease;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

.empty { padding: 22px; color: var(--muted); text-align: center; font-size: 12px; }
.micro { color: var(--muted); font-size: 9px; line-height: 1.45; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.runbook { margin: 0; padding-left: 20px; color: #574b42; font-size: 11px; line-height: 1.48; }
.runbook li + li { margin-top: 7px; }
.method-links summary { padding: 14px 15px; cursor: pointer; font: 600 14px var(--serif); }
.method-links[open] summary { border-bottom: 1px solid var(--line); }
.source-list { display: grid; grid-template-columns: 1fr 1fr; gap: 7px; margin-top: 10px; }
.source-list a { padding: 8px; color: var(--burgundy); border: 1px solid var(--line); border-radius: 4px; background: rgba(255,255,255,.45); font-size: 10px; text-decoration: none; }

/* Production label system: 68.5 × 20.5 mm, no bleed. */
.label-toolbar { margin-bottom: 16px; }
.label-sheet { display: grid; gap: 5mm; justify-content: center; }
.label-pair { display: flex; flex-wrap: wrap; gap: 4mm; align-items: start; justify-content: center; }
.slab-label {
  position: relative;
  width: 68.5mm;
  height: 20.5mm;
  overflow: hidden;
  color: #16110f;
  border: .28mm solid #46171c;
  background:
    repeating-linear-gradient(90deg, rgba(71,37,25,.025) 0 .18mm, transparent .18mm .9mm),
    linear-gradient(112deg, #fffaf0, #e9ddc7 52%, #f9f1e3);
  box-shadow: 0 4px 10px rgba(35,20,14,.15);
  print-color-adjust: exact;
  -webkit-print-color-adjust: exact;
}
.slab-label::before {
  content: "";
  position: absolute;
  inset: .8mm;
  pointer-events: none;
  border: .16mm solid rgba(119,69,40,.45);
}
.slab-front { display: grid; grid-template-columns: 13.5mm 1fr 14.6mm; }
.label-brand {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  color: #5f1c25;
  background: rgba(255,255,255,.18);
  border-right: .22mm solid rgba(91,28,36,.62);
}
.label-brand b {
  width: 9.2mm;
  height: 9.2mm;
  display: grid;
  place-items: center;
  color: #f4dfbc;
  border: .25mm solid #b78345;
  outline: .18mm solid rgba(103,31,40,.4);
  outline-offset: .55mm;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 25%, #8a2a36, #4a151b 68%);
  font: 700 4.2mm/.8 var(--serif);
  letter-spacing: -.38mm;
}
.label-brand span { margin-top: 1.5mm; color: #4d171d; font: 800 1.05mm/1 var(--sans); letter-spacing: .16mm; text-transform: uppercase; }
.label-copy {
  position: relative;
  z-index: 1;
  min-width: 0;
  padding: 1.7mm 1.8mm 1mm;
}
.label-copy .line1 { color: #6a1e27; font: 800 1.55mm/1.1 var(--sans); letter-spacing: .06mm; text-transform: uppercase; }
.label-copy .line2 { margin-top: .55mm; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font: 700 2.05mm/1.08 var(--sans); text-transform: uppercase; }
.label-copy .line3 { margin-top: .45mm; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; color: #4f443c; font: 700 1.38mm/1.1 var(--sans); text-transform: uppercase; }
.label-copy .subline {
  display: grid;
  grid-template-columns: repeat(4, auto);
  gap: 1.25mm;
  align-items: center;
  margin-top: 1.5mm;
  padding-top: 1mm;
  border-top: .16mm solid rgba(74,40,28,.27);
  color: #342a25;
  font: 700 1.18mm/1 var(--sans);
  text-transform: uppercase;
}
.label-grade {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  color: #671f28;
  border-left: .28mm solid #6e202a;
  background:
    linear-gradient(145deg, rgba(255,255,255,.7), rgba(227,214,192,.46)),
    rgba(248,241,227,.74);
}
.label-grade b { font: 600 7.2mm/.78 var(--serif); }
.label-grade span { margin-top: 1.3mm; color: #241a17; font: 800 1.15mm/1 var(--sans); letter-spacing: .14mm; text-transform: uppercase; }
.label-grade small { margin-top: .8mm; color: rgba(70,39,31,.72); font: 700 1mm/1 var(--sans); letter-spacing: .08mm; }
.slab-back { display: grid; grid-template-columns: 19mm 1fr 18mm; color: #f7e8cb; background: #1c1815; }
.slab-back::before { border-color: rgba(208,165,101,.44); }
.back-seal {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-right: .25mm solid rgba(208,165,101,.7);
  background: linear-gradient(145deg, #6a1d26, #351116);
}
.back-seal b { font: 700 5mm/.8 var(--serif); letter-spacing: -.4mm; }
.back-seal span { margin-top: 1.1mm; font: 700 1mm var(--sans); letter-spacing: .15mm; text-transform: uppercase; }
.back-copy { position: relative; z-index: 1; padding: 2.2mm 1.8mm; }
.back-copy strong { display: block; color: #d5ae70; font: 700 1.5mm/1.1 var(--sans); letter-spacing: .1mm; text-transform: uppercase; }
.back-copy p { margin: 1mm 0 0; color: rgba(255,245,225,.78); font: 600 1.1mm/1.35 var(--sans); text-transform: uppercase; }
.back-copy code { display: block; margin-top: 1mm; color: rgba(255,245,225,.5); font: 1mm/1.2 ui-monospace, monospace; }
.back-code {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-content: center;
  border-left: .25mm solid rgba(208,165,101,.7);
  background: rgba(255,255,255,.025);
}
.back-code b { color: #fff2da; font: 700 1.65mm/1 var(--sans); letter-spacing: .08mm; }
.back-code span { margin-top: 1.2mm; color: #d2a866; font: 700 1.05mm/1 var(--sans); letter-spacing: .09mm; text-transform: uppercase; }
.matrix-mark {
  width: 8mm;
  height: 8mm;
  display: grid;
  place-items: center;
  margin-bottom: 1.2mm;
  border: .3mm solid #d1a565;
  outline: .18mm solid rgba(244,228,200,.55);
  outline-offset: -.9mm;
  color: #f4e4c8;
  background: linear-gradient(145deg, #75232d, #321115);
  font: 700 3.2mm/.8 var(--serif);
  letter-spacing: -.25mm;
}
.calibration-rule { width: 50mm; margin: 8mm auto 0; border-top: .25mm solid #000; text-align: center; font-size: 2.2mm; }

@media (min-width: 720px) {
  .masthead { padding-left: max(24px, calc((100% - 760px)/2)); padding-right: max(24px, calc((100% - 760px)/2)); }
  .batch-rail { padding-left: max(24px, calc((100% - 760px)/2)); padding-right: max(24px, calc((100% - 760px)/2)); }
  .metric-grid { grid-template-columns: repeat(4, 1fr); }
  .protocol-grid { grid-template-columns: 1fr 1fr; }
}

@media print {
  @page { size: letter portrait; margin: 8mm; }
  html, body { background: #fff !important; }
  body { min-height: auto; }
  .no-print, .page-head, .label-toolbar, .toast { display: none !important; }
  .shell { min-height: auto; padding: 0; }
  main { width: 100%; max-width: none; margin: 0; padding: 0; }
  .label-sheet { display: grid !important; grid-template-columns: 1fr; gap: 3mm; }
  .label-pair { display: flex; flex-wrap: nowrap; gap: 4mm; break-inside: avoid; }
  .slab-label { box-shadow: none; }
  .calibration-rule { display: block; }
}

/* Gizato domain integration; preserves the existing grading controls. */
.gizato-workspace-bar{display:flex;flex-wrap:wrap;justify-content:space-between;gap:.7rem;padding:1rem 0;font-size:14px;line-height:1.5}
.gizato-workspace-bar a{color:var(--gold,#bf9b60);text-decoration:underline;text-underline-offset:4px}
.gizato-storage-note{padding:1rem;margin-bottom:1rem;border:1px solid #655d50;background:#231e19;color:#e9dfcf;font-size:14px;line-height:1.65}
.gizato-storage-note strong{display:block;color:#fff2dd;margin-bottom:.3rem}
