/* ORVO HYGIENE -- DOOR TO PLATE: THE TRACE PAGES (build order step 56; Documentation/mockups/2026-10-01_hygiene_step56,
   frames T1-T6c, all seventeen decisions approved as recommended except 6).
   Linked by my/hygiene-trace.html, my/hygiene-trace-lot.html, my/hygiene-trace-plate.html, my/hygiene-recall.html and
   (the TR4 / TR9 rules only) my/database-recipe-builder.html's History box.

   PART 1 IS THE RECORD BOOK'S OWN PAGE-LOCAL RULES, copied verbatim from my/hygiene-records.html (the mockup wears them
   through its copy hygiene-records-page.css): the first-load fade, the state word and its second line, the struck line,
   the type switch's scroll, the table's width and number column, the two-up fields in a box. my.css does not say them,
   and the trace pages are the Record book's family.
   PART 2 IS THE MOCKUP'S PROPOSED BLOCK, verbatim (TR1-TR9, NOTE.md "What is new"): layout and one drawing (the in-use
   bars), every colour one the platform already owns. No new button, modal, switch, pill or badge.
   (c) 2026 ORVO Software -- orvopos.com */

/* ================================ PART 1 -- the Record book's own rules ================================ */
main.page { max-width: 1200px; }
.hidden { display: none !important; }
#hrBody { opacity: 0; pointer-events: none; transition: opacity .2s ease; }
#hrBody.is-ready { opacity: 1; pointer-events: auto; }
@media (prefers-reduced-motion: reduce) { #hrBody { transition: none; } }
.is-busy { opacity: .5; pointer-events: none; transition: opacity .15s; }

.hy-st { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; white-space: nowrap; }
.hy-st::before { content: ''; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.hy-st.is-done  { color: #4ADE80; }
.hy-st.is-due   { color: #73D1DE; }
.hy-st.is-soon  { color: #E8C846; }
.hy-st.is-late  { color: #FB923C; }
.hy-st.is-fixed { color: #FB923C; }
.hy-st.is-miss, .hy-st.is-out, .hy-st.is-rej { color: #F87171; }
.hy-st.is-quiet { color: #888; }
.hy-st.is-quiet::before { background: transparent; border: 1px solid #666; box-sizing: border-box; }

.hy-sub { display: block; font-size: 12px; color: #7a8285; margin-top: 2px; white-space: normal; }
.hy-was td { color: #666 !important; }
.hy-strike { text-decoration: line-through; text-decoration-color: #555; }
.hy-rtab { display: flex; width: max-content; max-width: 100%; overflow-x: auto; scrollbar-width: none; margin: 0 0 14px; }
.hy-rtab::-webkit-scrollbar { display: none; }
.hy-rtab button { flex: none; white-space: nowrap; }
.chg-table.hy-book { min-width: 900px; }
.chg-table.hy-book td { white-space: normal; }
.hy-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.modal .field { text-align: left; }
.hy-two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.hy-book td.hy-what b { color: #fff; font-weight: 600; }
.chg-table.hy-book td.hy-num, .chg-table.hy-book td.hy-shopc, .chg-table.hy-book td.hy-rec { white-space: nowrap; }
.ins-card-head .hint-icon { margin-left: 6px; }
@media (max-width: 600px) { .hy-two { grid-template-columns: 1fr; } }

/* ================================ PART 2 -- PROPOSED (TR1-TR9), as approved ================================ */

/* TR1 -- THE SEARCH LINE. OrvoDbSearch as the Add bars wear it, capped the way Order history caps its
   search (`.oh-tools .toolbar-search { max-width: 50% }`): a lookup box is not a form to fill in. */
.tr-find { max-width: 640px; margin: 0 0 16px; }

/* TR2 -- WHEN EACH BATCH WAS IN USE. One row per batch (or per lot, for what went straight to plates), a
   bar on a five-day axis. Solid = in use, faint = still in date, gold = the stretch where two were open at
   once. The figures sit at the right in the page's own words. (No Finished key: his answer to decision 6.) */
.tr-tl { padding: 2px 0 6px; }
.tr-tl-axis, .tr-tl-row { display: grid; grid-template-columns: 200px minmax(0, 1fr) 190px; align-items: center; column-gap: 16px; }
.tr-tl-axis { margin-bottom: 4px; font-size: 11px; color: #7a8285; text-transform: uppercase; letter-spacing: .08em; }
.tr-tl-days { display: grid; grid-template-columns: repeat(5, 1fr); }
.tr-tl-days span { border-left: 1px solid #2a2a2a; padding-left: 6px; }
.tr-tl-grp { margin: 14px 0 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: #8a9396; }
.tr-tl-row { padding: 7px 0; border-top: 1px solid #222; }
.tr-tl-lab b { display: block; font-size: 13px; font-weight: 600; color: #fff; }
.tr-tl-lab small { display: block; font-size: 12px; color: #7a8285; margin-top: 1px; }
.tr-tl-track { position: relative; height: 18px; background: repeating-linear-gradient(90deg, transparent 0, transparent calc(20% - 1px), #2a2a2a calc(20% - 1px), #2a2a2a 20%); }
.tr-tl-bar { position: absolute; top: 4px; height: 10px; border-radius: 5px; background: #188796; }
.tr-tl-bar.is-lite { background: rgba(24, 135, 150, .28); }
.tr-tl-bar.is-both { background: #E8C846; border-radius: 0; z-index: 1; }
.tr-tl-now { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #fff; opacity: .55; z-index: 2; }
.tr-tl-n { text-align: right; font-size: 13px; color: #ccc; white-space: nowrap; }
.tr-tl-n b { color: #fff; font-weight: 600; }
@media (max-width: 700px) {
    .tr-tl-axis, .tr-tl-row { grid-template-columns: 1fr; row-gap: 4px; }
    .tr-tl-axis > span:first-child { display: none; }
    .tr-tl-n { text-align: left; }
}

/* TR2b -- a figure with its possible beside it: the gold word sits a clear gap from the certain one. */
.tr-gap { margin-left: 14px; }

/* the five tiles are the last thing in their card, so they give back the gap the report pages keep under a tile row */
.ins-card > .ins-kpis { margin-bottom: 2px; }

/* TR3 -- A CARD'S HEAD CARRIES ITS ONE OR TWO KEYS at the right, the way the Devices card's does. */
.ins-card-head .tr-keys { display: flex; gap: 8px; margin-left: auto; flex: none; }
.ins-card-head .tr-keys .btn { white-space: nowrap; }
.ins-card-head.tr-head { align-items: center; }
.tr-head-l { min-width: 0; }
.tr-head-l .ins-card-sub { display: block; margin-top: 3px; }

/* TR4 -- THE WORDS UNDER A LINE on the plate card and the recipe card: who saved it and when, and the
   one key that opens it. Grey like every quiet line on these pages (`.hy-sub`), the key is a `.btn-sm`. */
.tr-quiet { display: flex; align-items: center; gap: 12px; margin-top: 4px; font-size: 12px; color: #7a8285; }
.tr-quiet b { color: #ccc; font-weight: 600; }
.tr-quiet .btn { margin-left: auto; flex: none; }
.tr-asof { margin: 0 0 14px; font-size: 12.5px; color: #8a9396; line-height: 1.5; }
.tr-asof b { color: #E8C846; font-weight: 600; }

/* TR6 -- TWO ANSWERS IN A MODAL: the page's own `.rp-range` (the period switch every report wears), full
   width of the field with the two halves equal. */
.modal .tr-seg.rp-range { display: flex; width: 100%; margin: 0; }
.modal .tr-seg.rp-range button { flex: 1 1 0; }
.tr-step { text-align: center; margin: -4px 0 16px; font-size: 12.5px; color: #8a9396; }
.tr-who { font-size: 14px; color: #fff; padding: 9px 0 2px; }
.tr-who small { color: #888; font-size: 12px; margin-left: 6px; }
.tr-chosen { background: #1a1a1a; border: 1px solid #262626; border-radius: 8px; padding: 10px 14px; margin: 0 0 16px; font-size: 13px; color: #ccc; text-align: left; }
.tr-chosen b { display: block; color: #fff; font-size: 14px; font-weight: 600; }
.tr-chosen small { color: #7a8285; font-size: 12px; }
.modal .field + .field { margin-top: 14px; }
.modal .hy-two { margin-top: 14px; }
.modal .hy-two .field + .field { margin-top: 0; }

/* TR9 -- AN OLD RECIPE, READ ONLY, INSIDE THE SAME 440 BOX AS THE HISTORY LIST (one width through the flow). Rows, not a table:
   a table would need the width of the page. Colours are the .tr-chosen box's own (#1a1a1a on #262626). */
.tr-old { background: #1a1a1a; border: 1px solid #262626; border-radius: 8px; margin: 0 0 6px; }
.tr-old-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; border-bottom: 1px solid #262626; font-size: 14px; color: #fff; }
.tr-old-row:last-child { border-bottom: 0; }
.tr-old-n.ml-item { flex: 1 1 auto; }
.tr-old-q { color: #aaa; font-size: 13px; white-space: nowrap; }
.tr-old-tag { margin-left: 10px; font-size: 12px; }

/* TR8 -- ON A PHONE A TRACE TABLE STACKS, ONE ROW TO A CARD, instead of scrolling sideways. The report pages keep their
   one-line rows (his BP.8); a trace is different because the answer (which batch, which lot, how sure) sits in the columns
   that scroll off. The labels come from the column headings; the first cell leads the card; an empty cell draws nothing. */
@media (max-width: 600px) {
    .chg-table.tr-stack { min-width: 0 !important; }
    .chg-table.tr-stack thead { display: none; }
    .chg-table.tr-stack, .chg-table.tr-stack tbody, .chg-table.tr-stack tr, .chg-table.tr-stack td { display: block; }
    .chg-table.tr-stack tr { padding: 12px 2px; border-bottom: 1px solid #262626; }
    .chg-table.tr-stack tr:last-child { border-bottom: 0; }
    .chg-table.tr-stack td { padding: 2px 0 !important; border: 0 !important; white-space: normal !important; background: none !important; }
    .chg-table.tr-stack td:empty { display: none; }
    .chg-table.tr-stack td[data-l]::before { content: attr(data-l); display: inline-block; min-width: 116px; padding-right: 8px; box-sizing: border-box; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; color: #7a8285; }
    .chg-table.tr-stack td:first-child::before { display: none; }
    /* an item's picture and name in a labelled cell sits beside its label, not under it */
    .chg-table.tr-stack td:not(:first-child) .ml-item { display: inline-flex; vertical-align: middle; max-width: calc(100% - 120px); }
    .chg-table.tr-stack td:last-child:has(> .btn) { padding-top: 8px !important; }
}

/* TR7 -- THE PRINTED PAGE. One A4 sheet, black on white, drawn for the printer and the PDF. The inspection
   PDF (step 57) does not exist yet, so nothing here is copied from it; when it is built it should take this
   sheet's head and table and not the other way round. */
.tr-paper { width: 794px; height: 1123px; box-sizing: border-box; padding: 52px 56px 44px; background: #fff; color: #111; font-family: 'Outfit', system-ui, sans-serif; font-size: 12px; line-height: 1.45; display: flex; flex-direction: column; overflow: hidden; }
.tr-paper h1 { font-size: 22px; font-weight: 700; margin: 0 0 2px; color: #000; }
.tr-paper .tp-top { display: flex; justify-content: space-between; align-items: baseline; font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #666; margin-bottom: 14px; }
.tr-paper h2 { font-size: 10.5px; text-transform: uppercase; letter-spacing: .1em; color: #555; margin: 18px 0 6px; font-weight: 700; }
.tr-paper .tp-facts { display: grid; grid-template-columns: 120px 1fr 120px 1fr; gap: 4px 12px; margin: 10px 0 2px; }
.tr-paper .tp-facts span { color: #666; }
.tr-paper table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.tr-paper th { text-align: left; font-weight: 600; color: #555; border-bottom: 1.5px solid #111; padding: 4px 8px 4px 0; font-size: 10.5px; text-transform: uppercase; letter-spacing: .05em; }
.tr-paper td { padding: 5px 8px 5px 0; border-bottom: 1px solid #ddd; vertical-align: top; }
.tr-paper td.n, .tr-paper th.n { text-align: right; padding-right: 0; padding-left: 16px; font-variant-numeric: tabular-nums; }
.tr-paper .tp-note { margin: 6px 0 0; font-size: 10.5px; color: #555; }
.tr-paper .tp-foot { margin-top: auto; padding-top: 16px; border-top: 1px solid #999; display: flex; justify-content: space-between; font-size: 10.5px; color: #555; }
.tr-paper .tp-sign { display: flex; gap: 40px; margin-top: 26px; font-size: 11px; color: #555; }
.tr-paper .tp-sign i { display: inline-block; width: 210px; border-bottom: 1px solid #111; margin-left: 8px; height: 14px; }

/* ================================ PART 3 -- the build's own (layout only) ================================ */

/* TR5 -- THE TRACE KEY ON AN ORDER LINE lives in my/order-history.html's own <style> (its page), not here. */

/* THE PRINT SHEET SITS OFF-SCREEN, NEVER display:none (feedback_print_sheet_display_none: a browser does not lay out
   or decode inside a display:none subtree before window.print() snaps). The printer gets the sheet and nothing else. */
.tr-print { position: absolute; left: -10000px; top: 0; opacity: 0; pointer-events: none; }
@media print {
    @page { size: A4; margin: 0; }
    html, body { background: #fff !important; color: #000 !important; }
    body > *:not(.tr-print) { display: none !important; }
    .tr-print { position: static; left: auto; opacity: 1; }
    .tr-paper { width: 210mm; height: 297mm; }
}

/* ---- BATCH SCAN (2 Oct 2026): the label photo on the Trace pages (the mockup's BT2 and BT3; .hy-thumb's own border, radius and ground) ---- */
.tr-lblmark { display: inline-block; width: 34px; height: 26px; overflow: hidden; border: 1px solid #333; border-radius: 6px; background: #111; vertical-align: middle; }
.tr-lblmark img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tr-lbl { display: flex; gap: 16px; align-items: flex-start; }
.tr-lbl + .tr-lbl { margin-top: 16px; }
.tr-lbl-photo { flex: none; width: 240px; height: 180px; overflow: hidden; border: 1px solid #333; border-radius: 6px; background: #111; }
.tr-lbl-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.tr-lbl-facts { flex: 1 1 auto; min-width: 0; }
@media (max-width: 600px) { .tr-lbl { flex-direction: column; align-items: stretch; } .tr-lbl-photo { width: 100%; height: 210px; } }
@media print { .tr-lblmark, .tr-lbl { display: none !important; } }

/* LOTS > NOT PLACED (3 Oct 2026): the All | Not placed view buttons above the card, worn from the Orders list (my.css .ord-fbtns) */
.tr-views { margin: 0 0 12px; }
