/* lab-alambic (LAB-C2) · l'alambic. Wall: one screen, lists scroll inside themselves. Phone: the page scrolls. */
.m-labr{display:flex;flex-direction:column;gap:var(--sp-3);min-height:0;min-width:0;flex:1 1 auto}
.m-labr-body{display:flex;flex-direction:column;gap:var(--sp-3);min-height:0;min-width:0;flex:1 1 auto}

/* calculators: inputs left, the reading right */
.m-labr-calc{display:grid;grid-template-columns:minmax(0,5fr) minmax(0,7fr);gap:var(--sp-5);align-items:start;min-height:0}
.m-labr-side{display:flex;flex-direction:column;gap:var(--sp-4);min-width:0}
.m-labr-ins{display:grid;grid-template-columns:1fr;gap:var(--sp-3) var(--sp-4)}
.m-labr-ins--run{grid-template-columns:repeat(2,minmax(0,1fr))}
.m-labr-ins--row .m-labr-field{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:center;column-gap:var(--sp-3)}
.m-labr-ins--row .m-labr-ctl{flex-wrap:nowrap}
.m-labr-prep .m-labr-ctl{gap:var(--sp-3);flex-wrap:wrap}
.m-labr-prep .btn{margin-left:auto}
.m-labr-prepn{font-weight:400;font-size:var(--fs-name)}
.m-labr-sheetchips{padding:var(--sp-2) 0}
.m-labr-field{display:flex;flex-direction:column;gap:var(--sp-1);min-width:0;padding-top:var(--sp-1);border-top:1px solid var(--line)}
.m-labr-ctl{display:flex;align-items:center;gap:var(--sp-1);flex-wrap:nowrap;min-width:0}
.m-labr-ctl .k-step output{min-width:3em}
.m-labr-pad,.m-labr-clear{font-family:var(--mono);font-size:var(--fs-lab);letter-spacing:.12em;text-transform:uppercase;color:var(--ink)}
.m-labr-none{font-size:var(--fs-mono);min-width:7em}
.m-labr-act{display:flex;align-items:center;gap:var(--sp-2);flex-wrap:wrap}
.m-labr-act .lab{max-width:28ch}

.m-labr-out{display:flex;flex-direction:column;gap:var(--sp-3);min-width:0;border-top:1px solid var(--ink);padding-top:var(--sp-3)}
.m-labr-bigs{display:grid;grid-auto-flow:column;grid-auto-columns:minmax(0,1fr);border-bottom:1px solid var(--line)}
.m-labr-big{display:flex;flex-direction:column;gap:var(--sp-1);padding:0 var(--sp-3) var(--sp-3) 0;min-width:0}
.m-labr-big + .m-labr-big{padding-left:var(--sp-3);border-left:1px solid var(--line)}
.m-labr-num{font-weight:300;font-size:var(--fs-big);line-height:1;letter-spacing:-.03em;font-variant-numeric:tabular-nums;white-space:nowrap}
.m-labr-num small{font-family:var(--mono);font-weight:400;font-size:var(--fs-mono);letter-spacing:.12em;text-transform:uppercase;color:var(--stone);margin-left:.4em}
.m-labr-note{max-width:64ch;font-size:var(--fs-body);color:var(--ink);line-height:1.4}
.m-labr-note.muted{color:var(--stone)}
.m-labr-verdict{font-size:var(--fs-mono)}
.m-labr-warn{align-self:flex-start}
.m-labr-lede{max-width:80ch;line-height:1.4}
.m-labr-lede .lab{margin-right:.4em}

/* les fiches: eight columns on the wall, a card per job on a phone */
.m-labr-cards,.m-labr-preps{display:flex;flex-direction:column;min-height:0;flex:1 1 auto;border-top:1px solid var(--ink)}
.m-labr-trow{display:grid;grid-template-columns:minmax(0,2.4fr) minmax(0,.8fr) minmax(0,.8fr) minmax(0,1.5fr) minmax(0,1.2fr) minmax(0,.9fr) minmax(0,2fr) minmax(0,1.8fr);gap:var(--sp-2);padding:var(--sp-2) 0;border-bottom:1px solid var(--line);align-items:start}
.m-labr-thead .lab{letter-spacing:.08em}
.m-labr-thead{position:sticky;top:0;background:var(--paper);z-index:1;padding:var(--sp-1) 0}
.m-labr-c{display:flex;flex-direction:column;gap:2px;min-width:0;font-size:var(--fs-body);line-height:1.3}
.m-labr-c--job{gap:var(--sp-1)}
.m-labr-jn{font-weight:400;font-size:var(--fs-name)}
.m-labr-what{color:var(--stone)}
.m-labr-v.mono{font-size:var(--fs-mono);letter-spacing:.06em;text-transform:none}
.is-later .m-labr-jn,.is-later .m-labr-pn{color:var(--stone)}

.m-labr-prow{display:grid;grid-template-columns:minmax(0,1.7fr) minmax(0,2.6fr) minmax(0,1.5fr) minmax(0,1fr) minmax(0,1.5fr) 15em;gap:var(--sp-2);padding:var(--sp-1) 0;border-bottom:1px solid var(--line);align-items:center}
.m-labr-pn{font-weight:400}
.m-labr-pc,.m-labr-pu{line-height:1.3}
.m-labr-pc{color:var(--stone)}
.m-labr-pk{font-size:var(--fs-mono);letter-spacing:.06em;text-transform:none}
.m-labr-pj{color:var(--stone)}
.m-labr-pk{white-space:nowrap}
.m-labr-prow > .btn{justify-self:end}

/* le journal: the form left, the log right */
.m-labr-journal{display:grid;grid-template-columns:minmax(0,7fr) minmax(0,5fr);gap:var(--sp-5);min-height:0;flex:1 1 auto}
.m-labr-form{display:flex;flex-direction:column;gap:var(--sp-3);min-height:0;overflow-y:auto;overscroll-behavior:contain;padding-right:var(--sp-2)}
.m-labr-grp{display:flex;flex-direction:column;gap:var(--sp-1)}
.m-labr-chips{display:flex;flex-wrap:wrap;gap:var(--sp-1)}
.m-labr-chips .chip{border-color:var(--ink)}
.m-labr-log{display:flex;flex-direction:column;gap:var(--sp-2);min-height:0;border-top:1px solid var(--ink);padding-top:var(--sp-2)}
.m-labr-loghead{display:flex;justify-content:space-between;gap:var(--sp-2)}
.m-labr-run{display:flex;flex-direction:column;gap:var(--sp-1);padding:var(--sp-2) 0;border-bottom:1px solid var(--line)}
.m-labr-rt{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--sp-1) var(--sp-2)}
.m-labr-rt b{font-weight:400}
.m-labr-rt .mono{font-size:var(--fs-mono);letter-spacing:.06em;text-transform:none}
.m-labr-rd{margin-left:auto}
.m-labr-rm{line-height:1.5;letter-spacing:.08em}
.m-labr-empty{border-top:0;padding-top:var(--sp-2)}

/* avant le premier run */
.m-labr-avant{list-style:none;margin:0;padding:0;border-top:1px solid var(--ink);overflow-y:auto;min-height:0;flex:1 1 auto}
.m-labr-avant li{display:grid;grid-template-columns:4em minmax(0,1fr);gap:var(--sp-3);padding:var(--sp-2) 0;border-bottom:1px solid var(--line)}
.m-labr-avant p{max-width:84ch;line-height:1.4}
.m-labr-avant b{font-weight:400}
.m-labr-an{color:var(--stone);padding-top:.2em}

/* tablet: one column for the calculators, the journal stacks */
html[data-form="tablet"] .m-labr-journal{grid-template-columns:1fr;gap:var(--sp-4)}
html[data-form="tablet"] .m-labr-calc{grid-template-columns:minmax(0,1.15fr) minmax(0,1fr);gap:var(--sp-4)}
html[data-form="tablet"] .m-labr-ins--row .m-labr-field{grid-template-columns:1fr}
html[data-form="tablet"] .m-labr-bigs{grid-auto-flow:row;grid-template-columns:1fr}
html[data-form="tablet"] .m-labr-big{padding:var(--sp-2) 0;border-bottom:1px solid var(--line)}
html[data-form="tablet"] .m-labr-big + .m-labr-big{padding-left:0;border-left:0}
html[data-form="tablet"] .m-labr-num{font-size:var(--fs-h1)}
html[data-form="tablet"] .m-labr-trow{grid-template-columns:repeat(3,minmax(0,1fr));row-gap:var(--sp-2)}
html[data-form="tablet"] .m-labr-c--job{grid-column:1 / -1}

/* phone: everything stacks, the page scrolls */
html[data-form="phone"] .m-labr-calc,html[data-form="phone"] .m-labr-journal{grid-template-columns:1fr;gap:var(--sp-4)}
html[data-form="phone"] .m-labr-ins--run{grid-template-columns:1fr}
html[data-form="phone"] .m-labr-ins--row .m-labr-field{grid-template-columns:1fr}
html[data-form="phone"] .m-labr-bigs{grid-auto-flow:row;grid-template-columns:1fr 1fr}
html[data-form="phone"] .m-labr-big{padding:var(--sp-2) var(--sp-2) var(--sp-2) 0;border-bottom:1px solid var(--line)}
html[data-form="phone"] .m-labr-big + .m-labr-big{border-left:0}
html[data-form="phone"] .m-labr-big:nth-child(even){padding-left:var(--sp-2);border-left:1px solid var(--line)}
html[data-form="phone"] .m-labr-num{font-size:var(--fs-h1)}
html[data-form="phone"] .m-labr-trow{grid-template-columns:repeat(2,minmax(0,1fr));gap:var(--sp-2)}
html[data-form="phone"] .m-labr-c--job{grid-column:1 / -1}
html[data-form="phone"] .m-labr-c[data-col="stop"],html[data-form="phone"] .m-labr-c[data-col="out"]{grid-column:1 / -1}
html[data-form="phone"] .m-labr-prow{grid-template-columns:minmax(0,1fr) auto;gap:var(--sp-1) var(--sp-2);padding:var(--sp-2) 0}
html[data-form="phone"] .m-labr-pn,html[data-form="phone"] .m-labr-pc,html[data-form="phone"] .m-labr-pu{grid-column:1 / -1}
html[data-form="phone"] .m-labr-form{overflow:visible;padding-right:0}
html[data-form="phone"] .m-labr-avant{overflow:visible}
html[data-form="phone"] .m-labr-avant li{grid-template-columns:2.4em minmax(0,1fr);gap:var(--sp-2)}
/* the save stays in reach while the form scrolls */
.m-labr-form > .m-labr-act{position:sticky;bottom:0;background:var(--paper);padding:var(--sp-2) 0;border-top:1px solid var(--ink);margin-top:auto}
html[data-form="phone"] .m-labr-form > .m-labr-act{position:static}

/* column names: in the head on the wall, beside each figure elsewhere */
html[data-form="wall"] .m-labr-cl{display:none}
html:not([data-form="wall"]) .m-labr-thead{display:none}
html[data-form="tablet"] .m-labr-prow{grid-template-columns:minmax(0,1.2fr) minmax(0,.8fr) minmax(0,1.4fr) auto;row-gap:var(--sp-1);padding:var(--sp-2) 0}
html[data-form="tablet"] .m-labr-pn,html[data-form="tablet"] .m-labr-pc{grid-column:1 / -1}

/* wall journal (chat's look round 1): the whole form fits beside the log, "noter ce run" always in view */
.m-labr-tapnum{cursor:pointer;min-height:var(--tap);display:inline-flex;align-items:center;justify-content:center}
.m-labr-save{margin-left:auto}
.m-labr-rule{max-width:40ch}
html[data-form="wall"] .m-labr-journal{grid-template-columns:minmax(0,8fr) minmax(0,4fr);gap:var(--sp-4)}
html[data-form="wall"] .m-labr-form{overflow:visible;gap:var(--sp-2);padding-right:0}
html[data-form="wall"] .m-labr-ins--run{grid-template-columns:repeat(3,minmax(0,1fr));gap:var(--sp-2) var(--sp-3)}
html[data-form="wall"] .m-labr-ins--run .m-labr-pad,html[data-form="wall"] .m-labr-ins--run .m-labr-clear{display:none}
html[data-form="wall"] .m-labr-ins--run .k-step output{min-width:2.6em}
html[data-form="wall"] .m-labr-ins--run .m-labr-none{min-width:0;font-size:var(--fs-lab)}
html[data-form="wall"] .m-labr-form > .m-labr-act{position:static;margin-top:0;padding:var(--sp-2) 0 0}
html[data-form="wall"] .m-labr-prep{flex-direction:row;align-items:center;gap:var(--sp-3)}
html[data-form="wall"] .m-labr-prep .m-labr-ctl{flex:1 1 auto;flex-wrap:nowrap;min-width:0}
html[data-form="wall"] .m-labr-prepn{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;min-width:0}
html[data-form="wall"] .m-labr-prep .mono{display:none}
html[data-form="wall"] .m-labr-prep > .lab{flex:none}
html[data-form="wall"] .m-labr-form .m-labr-grp{gap:2px}
/* avant le premier run: two columns so the six points end on the screen */
html[data-form="wall"] .m-labr-avant{display:block;column-count:2;column-gap:var(--sp-5);column-rule:1px solid var(--line);overflow:visible}
html[data-form="wall"] .m-labr-avant li{break-inside:avoid}
html[data-form="wall"] .m-labr-avant{flex:none;height:auto;column-fill:balance}
html[data-form="wall"] .m-labr-avant li{grid-template-columns:2.2em minmax(0,1fr);gap:var(--sp-2)}
html[data-form="wall"] .m-labr-avant p{font-size:calc(var(--fs-body)*.85);line-height:1.38}
