/* White base dairy (Oct 2026 slice 4): the coldroom pick screen (pasteuriser.html) and the
   "what's in this batch" record (pasteuriser.html + white-bases.html). Loaded by those two pages
   only, with white-base-dairy.js. Uses the shared tokens from styles.css. */

/* ---- the batch record ---- */
.wbd-record { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }
.wbd-line { font-size: 12px; color: var(--text-secondary); margin: 0; overflow-wrap: anywhere; }
.wbd-k { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); margin-right: 4px; }
.wbd-ref { font-family: var(--font-mono); font-size: 11px; }
.wbd-adj { color: var(--warning-text); font-weight: 600; }

/* ---- the pick screen ---- */
.cp { min-width: 0; }
.cp-h { font-size: 18px; font-weight: 600; margin: 8px 0 2px; }
.cp-card { margin-bottom: 12px; }
.cp-row { display: flex; flex-wrap: wrap; gap: 10px 14px; }
.cp-field { display: flex; flex-direction: column; min-width: 0; flex: 1 1 180px; }
.cp-field select, .cp-field input[type="datetime-local"] { max-width: 100%; box-sizing: border-box; }
.cp-inline { display: inline-flex; align-items: center; gap: 6px; }
.cp-inline input { width: 90px; }
.cp-needs { display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.cp-needs div { background: var(--surface-1); border-radius: var(--radius); padding: 8px 10px; }
.cp-needs b { display: block; font-size: 16px; }
.cp-needs span { font-size: 12px; color: var(--text-muted); }
.cp-check { display: flex; align-items: center; gap: 8px; font-size: 13px; margin-top: 10px; }
.cp-adj { font-size: 13px; color: var(--text-secondary); margin: 4px 0 0; }
.cp-adj.on { color: var(--warning-text); font-weight: 600; }
.cp-btnrow { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 12px; }
.cp-sec { font-size: 15px; font-weight: 600; margin: 0 0 2px; }
.cp-hint { font-size: 12px; color: var(--text-muted); margin: 0 0 8px; }

.cp-lot { border-top: 1px dashed var(--border); padding: 10px 0 4px; }
.cp-lot:first-of-type { border-top: 0; }
.cp-lothead { display: flex; align-items: center; gap: 4px 8px; flex-wrap: wrap; font-size: 12px; margin-bottom: 6px; min-width: 0; }
.cp-lothead > b { font-size: 13px; }
.cp-onhand { color: var(--text-secondary); }
.cp-lotcode { color: var(--text-muted); font-family: var(--font-mono); font-size: 11px; }
.cp-chip { border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 600; white-space: nowrap; }
.cp-chip.expired { background: var(--danger-bg); color: var(--danger-text); }
.cp-chip.soon { background: var(--warning-bg); color: var(--warning-text); }
.cp-chip.ok { background: var(--success-bg); color: var(--success-fill); }

.cp-shelf { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px 6px 6px; border-bottom: 5px solid var(--border-strong); border-radius: 3px; }
.cp-unit-wrap { display: flex; flex-direction: column; align-items: center; gap: 2px; }
.cp-unit { position: relative; background: none; border: 0; padding: 4px 2px 0; margin: 0; cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--text-muted); font-size: 11px; min-width: 40px; min-height: 44px; }
.cp-unit svg { display: block; }
.cp-unit .cp-body { fill: var(--surface-2); stroke: var(--border-strong); stroke-width: 1.5; }
.cp-unit .cp-cap { fill: var(--accent-text); }
.cp-unit .cp-lid { fill: #d8c483; }
.cp-unit .cp-milk { fill: #eef3f4; }
.cp-unit .cp-cream { fill: #f6e7b8; }
.cp-unit.on .cp-body, .cp-unit.part .cp-body { stroke: var(--accent-text); stroke-width: 2.5; }
.cp-tick { position: absolute; top: -4px; right: -6px; min-width: 20px; height: 20px; padding: 0 3px; box-sizing: border-box; border-radius: 10px; background: var(--accent-text); color: #fff; font-size: 11px; font-weight: 700; display: none; align-items: center; justify-content: center; }
.cp-unit.on .cp-tick, .cp-unit.part .cp-tick { display: flex; }
.cp-unit.part .cp-tick { background: var(--status-orange); }
.cp-unit.dim { opacity: 0.45; }
.cp-unit:focus-visible { outline: 2px solid var(--accent-text); outline-offset: 2px; border-radius: 6px; }
.cp-part { background: none; border: 0; padding: 2px 4px; font-size: 11px; color: var(--accent-text); cursor: pointer; min-height: 0; }

/* The sticky tally: fixed to the bottom; the page is padded by its measured height (#cp-spacer). */
.cp-tally { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; background: var(--surface-2); border-top: 1px solid var(--border); box-shadow: 0 -6px 20px rgba(0, 0, 0, 0.08); }
.cp-tally-in { max-width: 900px; margin: 0 auto; padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0px)); box-sizing: border-box; display: grid; grid-template-columns: 1fr 1fr 1fr auto; gap: 8px 12px; align-items: center; }
.cp-metric { min-width: 0; }
.cp-metric span { display: block; font-size: 11px; color: var(--text-muted); }
.cp-metric b { display: block; font-size: 16px; white-space: nowrap; }
.cp-metric b.ok { color: var(--success-fill); }
.cp-metric b.off { color: var(--warning-text); }
.cp-metric b.bad { color: var(--danger-text); }
.cp-bar { height: 5px; background: var(--surface-1); border-radius: 3px; overflow: hidden; margin-top: 3px; }
.cp-bar i { display: block; height: 100%; background: var(--accent-text); }
.cp-bar.off i { background: var(--status-orange); }
.cp-warn { grid-column: 1 / -1; margin: 0; font-size: 12px; color: var(--warning-text); }
.cp-warn.bad { color: var(--danger-text); }
#c-start { white-space: nowrap; }

@media (max-width: 620px) {
  .cp-tally-in { grid-template-columns: 1fr 1fr; }
  .cp-tally-in .cp-metric:nth-child(3) { grid-column: 1 / -1; display: flex; gap: 8px; align-items: baseline; }
  #c-start { grid-column: 1 / -1; }
}
