/* ökēn équipe · M4 le stock (STOCK). Prefix .m-stock-. Kit tokens only; no new colours. */
.m-stock{display:flex;flex-direction:column;gap:var(--sp-3);min-height:0;flex:1 1 auto}
html[data-form="wall"] .m-stock{height:100%;overflow:hidden}
.m-stock-head{gap:var(--sp-3)}
.m-stock-hx{display:flex;align-items:center;gap:var(--sp-3)}
.m-stock-prog{font-size:var(--fs-title)}
.m-stock-tabs .chip{gap:.5em;flex:none}
.m-stock-tb{font-family:var(--mono);font-size:var(--fs-lab);letter-spacing:.1em;text-transform:uppercase;opacity:.8}
.m-stock-lead{max-width:60ch}
.m-stock-ex{margin-left:auto;flex:none}
.m-stock-ph{display:flex;align-items:center;gap:var(--sp-2);flex-wrap:wrap;margin-bottom:var(--sp-1)}
.m-stock-ph .ex{margin-left:auto}
.m-stock-gap{display:block;margin-top:var(--sp-3)}
.m-stock-due{color:var(--ink)}
.m-stock-due::before{content:"";display:inline-block;width:.55em;height:.55em;background:var(--signal);margin-right:.5em;vertical-align:.05em}
.m-stock-q{font-size:var(--fs-title);min-width:2.4em;text-align:right}
.m-stock-q.is-zero{text-decoration:underline;text-decoration-color:var(--signal);text-decoration-thickness:2px;text-underline-offset:.25em}
.m-stock-val{margin:var(--sp-1) 0}

/* columns: three on the wall, one on the phone; inner lists scroll on the wall */
.m-stock-etat{display:grid;grid-template-columns:minmax(0,1.15fr) minmax(0,1fr) minmax(0,.85fr);gap:var(--sp-5);min-height:0;flex:1 1 auto}
.m-stock-two{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,420px),1fr));gap:var(--sp-5);min-height:0;flex:1 1 auto}
.m-stock-col{display:flex;flex-direction:column;gap:var(--sp-2);min-height:0}
.m-stock-sc{flex:1 1 auto;min-height:0}
.m-stock-cpanel{display:flex;flex-direction:column;min-height:0;flex:1 1 auto}
.m-stock-foot{display:flex;align-items:center;justify-content:flex-end;gap:var(--sp-3);flex-wrap:wrap;border-top:1px solid var(--ink);padding-top:var(--sp-2);margin-top:var(--sp-1)}
.m-stock-foot > .mono:first-child{margin-right:auto}
.m-stock-foot > .cell:first-child{margin-right:auto}
.m-stock-tot{font-size:var(--fs-title)}
html[data-form="tablet"] .m-stock-etat{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
html[data-form="phone"] .m-stock-etat{grid-template-columns:minmax(0,1fr);gap:var(--sp-4)}
html:not([data-form="wall"]) .m-stock-sc{overflow:visible}
html[data-form="phone"] .m-stock-foot{position:sticky;bottom:calc(57px + env(safe-area-inset-bottom));background:var(--paper);z-index:2;padding-bottom:var(--sp-2)}
html[data-form="phone"] .m-stock-foot .btn--ink{flex:1 1 auto}
html[data-form="phone"] .m-stock-foot > .mono{flex:1 1 100%}

/* the count, list mode: one flush row per bottle */
.m-stock-crow{display:grid;grid-template-columns:auto minmax(0,1fr) auto calc(var(--tap) * 12.9);align-items:center;gap:var(--sp-3)}
.m-stock-crow .nm{font-size:var(--fs-name)}
.m-stock-pos{min-width:2.2em}
.m-stock-last{opacity:.85}
.m-stock-crow.is-done .m-stock-last{opacity:.6}
.m-stock-ctr{display:flex;align-items:center;gap:var(--sp-1)}
.m-stock-pm{width:var(--tap);height:var(--tap);border:1px solid var(--ink);border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-family:var(--mono);font-size:var(--fs-title);line-height:1;flex:none}
.m-stock-pm:active,.m-stock-same:active,.m-stock-next:active{transform:scale(.96)}
.m-stock-v{min-width:3.2em;min-height:var(--tap);text-align:center;font-size:var(--fs-title);color:var(--stone)}
.m-stock-crow.is-done .m-stock-v{color:var(--ink);text-decoration:underline;text-underline-offset:.3em;text-decoration-thickness:1px}
.m-stock-same{margin-right:var(--sp-2)}
.m-stock-case{padding:0 var(--sp-2)}
.m-stock-tenths{min-width:0;display:flex}
.m-stock-tenths.is-none{min-height:1px}
.m-stock-k10{flex:1 1 auto}
/* the open bottle on narrow screens: two rows of five so every tenth stays a thumb wide */
html[data-form="phone"] .m-stock-k10{display:grid;grid-template-columns:repeat(6,minmax(44px,1fr));gap:4px}
html[data-form="phone"] .m-stock-k10 button{min-height:48px;width:auto}
html[data-form="phone"] .m-stock-k10 button:first-child{width:auto}
html[data-form="phone"] .m-stock-k10 .v{text-align:center;align-self:center}
html[data-form="tablet"] .m-stock-crow,html[data-form="phone"] .m-stock-crow{grid-template-columns:auto minmax(0,1fr);row-gap:var(--sp-1)}
html[data-form="tablet"] .m-stock-ctr,html[data-form="phone"] .m-stock-ctr{grid-column:1 / -1;justify-content:flex-end}
html[data-form="tablet"] .m-stock-tenths,html[data-form="phone"] .m-stock-tenths{grid-column:1 / -1}
html[data-form="phone"] .m-stock-same{margin-right:auto}

/* the count, one at a time: everything you touch in the lower half, for the thumb */
.m-stock-one{display:flex;flex-direction:column;gap:var(--sp-4);flex:1 1 auto;min-height:0;border-top:1px solid var(--ink);padding-top:var(--sp-3)}
html[data-form="phone"] .m-stock.is-focus{min-height:calc(100svh - var(--top) - 57px - var(--pad) * 2)}
html[data-form="phone"] .m-stock.is-focus .h1{font-size:var(--fs-h2)}
html[data-form="phone"] .m-stock-one{gap:var(--sp-3)}
html[data-form="phone"] .m-stock-thumb{margin-top:auto}
.m-stock-back{align-self:flex-start;margin-left:calc(var(--sp-2) * -1)}
/* the tabs: one row that scrolls inside itself on a phone */
html[data-form="phone"] .m-stock-tabs{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;margin:0 calc(var(--pad) * -1);padding:0 var(--pad)}
html[data-form="phone"] .m-stock-tabs::-webkit-scrollbar{display:none}
html[data-form="wall"] .m-stock-one{max-width:calc(var(--u)*70);width:100%;align-self:center}
.m-stock-dots{display:flex;gap:4px}
.m-stock-dots i{flex:1 1 0;height:4px;background:var(--line)}
.m-stock-dots i.on{background:var(--stone)}
.m-stock-dots i.cur{background:var(--ink)}
.m-stock-oh{display:flex;flex-direction:column;gap:var(--sp-1)}
.m-stock-oh .h2{font-weight:400}
.m-stock-obig{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--sp-3);margin-top:auto}
.m-stock-obig .cell{align-items:center;text-align:center}
.m-stock-bigv{font-size:calc(var(--fs-big)*1.35);min-height:calc(var(--tap)*1.4);padding:0 var(--sp-2)}
.m-stock-bigv.is-todo{color:var(--stone)}
.m-stock-pm--xl{width:calc(var(--tap)*1.5);height:calc(var(--tap)*1.5);font-size:var(--fs-h2)}
.m-stock-ot{display:flex;flex-direction:column;gap:var(--sp-1)}
.m-stock-thumb{display:grid;grid-template-columns:auto 1fr;gap:var(--sp-2)}
.m-stock-next{min-height:calc(var(--tap)*1.3);font-size:var(--fs-mono)}
.m-stock-prev{min-height:calc(var(--tap)*1.3);padding:0;width:calc(var(--tap)*1.3);font-size:var(--fs-title)}

/* gap rows */
.m-stock-gend{gap:var(--sp-4)}
.m-stock-gc{align-items:flex-end;min-width:4.2em}
.m-stock-gc .num{font-size:var(--fs-name)}
.m-stock-ge{min-width:6.5em}
html[data-form="phone"] .m-stock-grow{flex-wrap:wrap;row-gap:var(--sp-1)}
html[data-form="phone"] .m-stock-grow .cell.grow{flex:1 1 100%}
html[data-form="phone"] .m-stock-gend{margin-left:0;width:100%;justify-content:space-between}
html[data-form="phone"] .m-stock-gc{align-items:flex-start}

/* order rows */
.m-stock-orow .k-step output{min-width:2.6em}
.m-stock-orow.is-zero .nm{color:var(--stone)}
.m-stock-lt{min-width:6em;text-align:right}
html[data-form="phone"] .m-stock-orow{flex-wrap:wrap}
html[data-form="phone"] .m-stock-orow .cell.grow{flex:1 1 100%}
html[data-form="phone"] .m-stock-orow .k-step{margin-right:auto}

/* receive rows */
.m-stock-box{width:var(--tap);height:var(--tap);border:1px solid var(--ink);display:inline-flex;align-items:center;justify-content:center;flex:none}
.m-stock-box .k-tick{width:70%;height:70%}
.m-stock-rrow.is-missing .nm{text-decoration:line-through;text-decoration-color:var(--signal)}
.m-stock-rrow .end{gap:0}
html[data-form="phone"] .m-stock-rrow{flex-wrap:wrap}
html[data-form="phone"] .m-stock-rrow .cell.grow{flex:1 1 calc(100% - var(--tap) - var(--sp-3))}
html[data-form="phone"] .m-stock-rrow .end{margin-left:0;width:100%;justify-content:flex-end}

/* losses */
.m-stock-pgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,260px),1fr));border-top:1px solid var(--line)}
.m-stock-pitem{display:flex;flex-direction:column;justify-content:center;gap:2px;min-height:calc(var(--tap)*1.25);padding:var(--sp-1) var(--sp-2);border-bottom:1px solid var(--line);border-right:1px solid var(--line)}
.m-stock-pitem:active{background:var(--sand)}
.m-stock-loss,.m-stock-pick,.m-stock-sheet{display:flex;flex-direction:column;gap:var(--sp-3)}
.m-stock-reasons{display:grid;grid-template-columns:repeat(auto-fill,minmax(min(100%,180px),1fr));gap:var(--sp-2)}
.m-stock-reason{width:100%;min-height:calc(var(--tap)*1.2);font-size:var(--fs-mono)}
.m-stock-empty{border-top:0;padding-top:0}

/* print: only the order sheet */
@media print{
  html.m-stock-printing body > *:not(.k-sheet){display:none!important}
  html.m-stock-printing .k-sheet{position:static;width:auto;border:0}
  html.m-stock-printing .k-sheet .sact{display:none}
}

.m-stock-stack{display:flex;flex-direction:column;gap:var(--sp-2);align-items:stretch}
.m-stock-stack > .btn{align-self:flex-start}
.m-stock-print .num,.m-stock-print .mono{white-space:nowrap}
