/* =====================================================================
   מלאי פילמנטים · v3
   One interface, two palettes. Components read only the tokens below, so another
   palette is one more [data-theme] block. Product photos and filament swatches never
   read them.
   ===================================================================== */
:root{
  --font:'IBM Plex Sans Hebrew', system-ui, sans-serif;
  --mono:'IBM Plex Mono', ui-monospace, monospace;
  --tile:156px; --r:12px;
}
:root, [data-theme="dark"]{
  color-scheme:dark;
  --bg:#111213; --surface:#1A1B1D; --surface-2:#232427; --well:#1F2023; --field:#151617;
  --line:#2C2D31; --line-strong:#3E4045; --shelf:#34363B;
  --text:#ECEAE6; --muted:#A6A39C; --faint:#7A776F;
  --accent:#E8A23A; --accent-text:#F0B75E; --on-accent:#1A1206; --accent-soft:rgba(232,162,58,.12);
  --fault:#C98A74; --fault-bg:rgba(201,138,116,.10); --fault-line:rgba(201,138,116,.32);
  --danger:#E07A66; --danger-bg:rgba(224,122,102,.12);
  --ok:#8FAE96; --ok-bg:rgba(143,174,150,.12);
  --unknown:#D9A857; --unknown-line:rgba(217,168,87,.45);
  --plan:#8FA9D6; --plan-bg:rgba(143,169,214,.12);
  --chip:#0B0C0D; --chip-text:#ECEAE6; --amt-bg:#2A2B2F;
  --scrim:rgba(0,0,0,.6); --shadow:0 18px 40px -16px rgba(0,0,0,.7);
  --bed:#2A2B2F; --layer-2:#C98A2E; --focus:#F0B75E;
}
[data-theme="light"]{
  color-scheme:light;
  --bg:#F2F0EA; --surface:#FBFAF6; --surface-2:#EDE9E1; --well:#ECE8DF; --field:#FFFFFF;
  --line:#DFDACF; --line-strong:#C8C2B5; --shelf:#CFC9BC;
  --text:#1D1C1A; --muted:#5F5B53; --faint:#8A857B;
  --accent:#B5461A; --accent-text:#A03C14; --on-accent:#FFFFFF; --accent-soft:rgba(181,70,26,.09);
  --fault:#94432D; --fault-bg:#F3E6DF; --fault-line:rgba(148,67,45,.3);
  --danger:#A4331F; --danger-bg:#F6E2DB;
  --ok:#4C7656; --ok-bg:#E4EDE4;
  --unknown:#8A5A12; --unknown-line:rgba(138,90,18,.4);
  --plan:#3E5F96; --plan-bg:#E3E9F3;
  --chip:#1D1C1A; --chip-text:#FBFAF6; --amt-bg:#FBFAF6;
  --scrim:rgba(29,28,26,.4); --shadow:0 18px 40px -18px rgba(60,50,30,.35);
  --bed:#D9D4C8; --layer-2:#933714; --focus:#B5461A;
}

*{box-sizing:border-box}
html{scrollbar-gutter:stable}
body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);font-size:15px;line-height:1.45;-webkit-font-smoothing:antialiased}
body.modal-open{overflow:hidden}
button,input,select,textarea{font:inherit;color:inherit}
a{color:inherit}
:focus-visible{outline:2px solid var(--focus);outline-offset:2px;border-radius:6px}
[hidden]{display:none !important}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.ico{flex:0 0 auto;display:block}
.mono{font-family:var(--mono)} .muted{color:var(--muted)} .small{font-size:13px}
h1,h2,h3,h4{font-family:var(--font)}

/* ---------- form controls ---------- */
input:where(:not([type=checkbox]):not([type=radio]):not([type=file]):not([type=range])), select, textarea{
  background:var(--field);color:var(--text);border:1px solid var(--line-strong);border-radius:9px;padding:9px 12px;font-size:15px;width:100%;
}
input::placeholder, textarea::placeholder{color:var(--faint)}
input:focus, select:focus, textarea:focus{outline:none;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft)}
textarea{resize:vertical;line-height:1.5}
input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent)}

/* ---------- buttons ---------- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:7px;height:40px;padding:0 15px;border-radius:9px;border:1px solid var(--line-strong);
  background:var(--surface-2);color:var(--text);font-size:14px;font-weight:500;cursor:pointer;text-decoration:none;white-space:nowrap}
.btn:hover{border-color:var(--muted)}
.btn:disabled{opacity:.45;cursor:default}
.btn.sm{height:34px;padding:0 11px;font-size:13.5px;border-radius:8px}
.btn.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:600}
.btn.primary:hover{filter:brightness(1.06)}
.btn.primary.danger, .btn.danger.primary{background:var(--danger);border-color:var(--danger);color:#fff}
.btn.accent, .btn.teal{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft);font-weight:600}
.btn.blue{border-color:var(--plan);color:var(--plan);background:var(--plan-bg)}
.btn.warn{border-color:var(--fault-line);color:var(--fault);background:var(--fault-bg);font-weight:600}
.btn.danger{border-color:var(--danger);color:var(--danger);background:none}
.btn.ghost{background:none;border-color:transparent;color:var(--muted)}
.btn.ghost:hover{color:var(--text);border-color:var(--line-strong)}
.btn.wide{width:100%}
.icon-btn{display:flex;align-items:center;justify-content:center;width:40px;height:40px;flex:0 0 auto;border-radius:10px;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);cursor:pointer}
.icon-btn:hover{border-color:var(--muted)}
.linkish{background:none;border:none;padding:0 4px;color:var(--accent-text);font-weight:600;cursor:pointer;text-decoration:underline;text-underline-offset:3px}

/* ---------- print loader (drawn by script, see util.js) ---------- */
.printer-loader{display:flex;flex-direction:column;align-items:center}
.printer-loader svg{display:block;overflow:visible}
.pl-bed{fill:var(--bed)} .pl-bead{fill:var(--accent)} .pl-bead.alt{fill:var(--layer-2)} .pl-nozzle{fill:var(--text)} .pl-tip{fill:var(--accent)}
.pl-text{margin-top:14px;font-size:14.5px;color:var(--muted)}

/* ---------- full-screen states: boot, load failure ---------- */
.screen-state{min-height:100vh;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:8px;padding:32px 20px;text-align:center;color:var(--muted)}
.screen-state h2{margin:6px 0 0;font-size:20px;color:var(--text)}
.screen-state p{margin:0;max-width:360px}
.screen-state .actions{display:flex;gap:10px;flex-wrap:wrap;justify-content:center;margin-top:12px}
.screen-state details{font-size:12.5px;color:var(--faint);margin-top:10px}
.screen-state code{font-family:var(--mono);direction:ltr;display:inline-block;margin-top:6px}
.screen-state .fail-ico{color:var(--fault)}

/* ---------- login ---------- */
.login-screen{min-height:100vh;display:flex;align-items:center;justify-content:center;padding:32px 16px}
.login{width:100%;max-width:400px;display:flex;flex-direction:column;gap:26px}
.login .brand{display:flex;flex-direction:column;gap:14px}
.login .mark{width:44px;height:44px}
.login h1{margin:0;font-size:30px;font-weight:600;letter-spacing:-.01em;line-height:1.1}
.login .brand p{margin:0;color:var(--muted)}
.login-card{background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:26px 24px;display:flex;flex-direction:column;gap:18px}
.field{display:flex;flex-direction:column;gap:7px;font-size:14px;color:var(--muted)}
.login-card input{height:48px;font-size:16px;direction:ltr;text-align:left;background:var(--bg)}
.pw{position:relative;display:block}
.pw input{padding-left:66px}
.pw button{position:absolute;left:8px;top:50%;transform:translateY(-50%);height:34px;padding:0 10px;border:none;background:none;color:var(--muted);font-size:13px;cursor:pointer;border-radius:8px}
.login-submit{height:50px;border:none;border-radius:11px;background:var(--accent);color:var(--on-accent);font-size:16px;font-weight:600;cursor:pointer;display:flex;align-items:center;justify-content:center;gap:12px}
.login-submit[disabled]{cursor:progress;opacity:.92}
.login-submit .busy{display:none;align-items:center;gap:12px}
.login-screen.busy .login-submit .idle{display:none}
.login-screen.busy .login-submit .busy{display:flex}
.login-screen.busy input{opacity:.6}
.bar{width:64px;height:4px;border-radius:2px;background:color-mix(in srgb, var(--on-accent) 25%, transparent);overflow:hidden;position:relative}
.bar::after{content:"";position:absolute;inset:0;background:var(--on-accent);transform-origin:right;animation:bar 1.1s ease-in-out infinite}
@keyframes bar{0%{transform:scaleX(0)}60%{transform:scaleX(1);opacity:1}100%{transform:scaleX(1);opacity:0}}
.form-error{display:flex;gap:10px;align-items:flex-start;padding:11px 13px;border-radius:10px;background:var(--danger-bg);color:var(--danger);font-size:14px}
.form-error:empty{display:none}
.login-foot{display:flex;justify-content:space-between;align-items:center;gap:12px;flex-wrap:wrap;font-size:13.5px;color:var(--faint)}

/* theme switch */
.theme{display:inline-flex;align-items:center;border:1px solid var(--line-strong);border-radius:999px;padding:3px;gap:2px;flex:0 0 auto}
.theme button{display:flex;align-items:center;gap:6px;border:none;background:none;height:34px;padding:0 12px;border-radius:999px;cursor:pointer;color:var(--muted);font-size:13.5px}
.theme button[aria-pressed="true"]{background:var(--surface-2);color:var(--text);font-weight:600}

/* ---------- app shell ---------- */
.app{container-type:inline-size}
.wrap{max-width:1440px;margin:0 auto;padding:28px 56px 90px;display:flex;flex-direction:column;gap:32px}
.top{display:flex;align-items:center;gap:20px}
.inv{display:flex;flex-direction:column;gap:2px;min-width:0}
.inv-select{font-size:22px;font-weight:600;background:transparent;border:none;color:var(--text);padding:0 0 0 22px;width:auto;max-width:100%;cursor:pointer;appearance:none;-webkit-appearance:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23A6A39C' stroke-width='2' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat left center}
.inv-select:focus{box-shadow:none}
.inv-select option{background:var(--surface);color:var(--text);font-size:15px}
.inv-sub{font-size:13.5px;color:var(--muted)}
.sync{background:none;border:none;padding:0;color:var(--faint);font-size:13px;cursor:pointer}
.sync:hover{color:var(--text)}
.nav{display:flex;gap:22px;margin-inline-start:auto;align-items:center}
.nav .nl{background:none;border:none;padding:0;text-decoration:none;color:var(--muted);font-size:15px;white-space:nowrap;cursor:pointer}
.nav .nl:hover{color:var(--text)}
.avatar{width:40px;height:40px;flex:0 0 auto;border-radius:50%;border:1px solid var(--line-strong);background:var(--surface);font-weight:600;cursor:pointer}
.btn-add{height:44px;padding:0 20px;border-radius:9px;border:none;background:var(--accent);color:var(--on-accent);font-weight:600;display:flex;align-items:center;gap:8px;cursor:pointer;white-space:nowrap;flex:0 0 auto}
.menu-btn,.theme-mini{display:none}

/* ---------- photo well ----------
   The product photo has its baked-in white removed (only white connected to the photo's
   border) and sits on a quiet well. No filter, blend mode or tint on the photo. */
.well{position:relative;border-radius:12px;background:var(--well);overflow:hidden;display:flex;align-items:center;justify-content:center}
.well img{display:block;width:100%;height:100%;object-fit:contain;padding:7%;opacity:0;transition:opacity .2s}
.well img.ready{opacity:1}
.well.nophoto{background:var(--sw)}
.well.empty{background:none;border:1.5px dashed var(--line-strong);color:var(--faint);font-size:12.5px}

/* ---------- printer ---------- */
.printer{display:flex;flex-direction:column;gap:14px}
.sec-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap}
.sec-head h2{margin:0;font-size:17px;font-weight:600}
.sec-head .meta{font-size:13.5px;color:var(--muted)}
.sec-head .end{margin-inline-start:auto}
.heads{display:grid;grid-template-columns:repeat(var(--cols,5),minmax(0,1fr));gap:12px}
.heads.few{max-width:calc(var(--cols,1) * 250px)}
.head{display:flex;flex-direction:column;gap:12px;padding:14px;border-radius:14px;background:var(--surface);border:1px solid var(--line);min-width:0;text-align:start;cursor:pointer;color:var(--text)}
.head:hover{border-color:var(--line-strong)}
.head-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.head .num{font-family:var(--mono);font-size:13px;color:var(--muted);font-weight:500}
.head .num .short{display:none}
.head .num .n{display:none}
.head .well{width:100%;aspect-ratio:4/3}
.head .who{display:flex;flex-direction:column;gap:1px;min-width:0}
.head b{font-size:15.5px;font-weight:600;line-height:1.3;overflow-wrap:anywhere}
.head small{font-size:13px;color:var(--muted)}
.head .empty-name{font-size:15px;color:var(--muted)}
.head .why{font-size:13px;line-height:1.4;color:var(--muted);padding-top:10px;border-top:1px solid var(--line)}
.head .plan-note{font-size:13px;color:var(--plan);display:flex;gap:6px;align-items:center}
.row-tag,.chev{display:none}
.tag{display:inline-flex;align-items:center;gap:5px;height:24px;padding:0 8px;border-radius:6px;font-size:12.5px;font-weight:500;white-space:nowrap}
.tag.ok{color:var(--ok)}
.tag.fault{color:var(--fault);background:var(--fault-bg);box-shadow:inset 0 0 0 1px var(--fault-line);font-weight:600}
.tag.plan{color:var(--plan);background:var(--plan-bg)}
.todo{display:flex;gap:10px 18px;align-items:center;flex-wrap:wrap;font-size:14.5px;color:var(--muted);padding:12px 16px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
.todo:empty{display:none}
.todo strong{color:var(--text);font-weight:600}
.todo .sep{width:1px;height:18px;background:var(--line-strong)}
.todo .fault-text{color:var(--fault);font-weight:600}
.btn-line{height:36px;padding:0 14px;border-radius:8px;border:1px solid var(--accent);background:none;color:var(--accent-text);font-weight:600;cursor:pointer}
.psum{display:none}

/* ---------- inventory controls ---------- */
.controls{display:flex;align-items:flex-end;gap:12px 24px;flex-wrap:wrap;border-bottom:1px solid var(--line)}
.mtabs{display:flex;gap:22px;overflow-x:auto;scrollbar-width:none;min-width:0;flex:1 1 420px}
.mtabs::-webkit-scrollbar{display:none}
.mtab{flex:0 0 auto;background:none;border:none;padding:0 0 12px;margin-bottom:-1px;border-bottom:2px solid transparent;color:var(--muted);cursor:pointer;font-size:15px;display:flex;gap:6px;align-items:baseline;white-space:nowrap}
.mtab i{font-style:normal;font-family:var(--mono);font-size:12px;color:var(--faint)}
.mtab[aria-pressed="true"]{color:var(--text);font-weight:600;border-bottom-color:var(--text)}
.search{display:flex;gap:10px;padding-bottom:10px;flex:0 1 auto;min-width:0}
.search input,.search select{height:42px;width:auto;min-width:0}
.search input{width:250px}
.filter-btn{display:none;height:46px;padding:0 14px;border-radius:9px;border:1px solid var(--line-strong);background:var(--surface);align-items:center;gap:6px;font-weight:600;cursor:pointer;white-space:nowrap;flex:0 0 auto}
.fcount:empty{display:none}
.fcount{min-width:20px;height:20px;padding:0 6px;border-radius:10px;background:var(--accent);color:var(--on-accent);font-size:12px;font-weight:700;display:inline-flex;align-items:center;justify-content:center}
.colors{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:14px}
.colors .lbl{font-size:13.5px;color:var(--muted);margin-inline-end:4px}
.cchip{display:inline-flex;align-items:center;gap:7px;height:34px;padding:0 12px 0 10px;border-radius:999px;border:1px solid var(--line-strong);background:none;color:var(--text);font-size:14px;cursor:pointer}
.cchip .dot{width:14px;height:14px;border-radius:50%;background:var(--fc);box-shadow:0 0 0 1px rgba(128,128,128,.55)}
.cchip i{font-style:normal;font-family:var(--mono);font-size:12px;color:var(--faint)}
.cchip[aria-pressed="true"]{border-color:var(--text);background:var(--surface-2);font-weight:600}
.cchip[disabled]{opacity:.35;cursor:default}
.active-filters{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:12px}
.active-filters:empty{display:none}
.achip{display:inline-flex;align-items:center;gap:6px;height:32px;padding:0 6px 0 12px;border-radius:8px;background:var(--surface-2);border:1px solid var(--line-strong);font-size:14px;cursor:pointer;color:var(--text);flex:0 0 auto}
.achip .x{width:22px;height:22px;border-radius:6px;display:flex;align-items:center;justify-content:center;color:var(--muted)}
.achip:hover .x{background:var(--line)}
.achip .dot{width:11px;height:11px;border-radius:50%;background:var(--fc);box-shadow:0 0 0 1px rgba(128,128,128,.55)}
.none{margin-top:30px;padding:28px;border:1px dashed var(--line-strong);border-radius:12px;text-align:center;color:var(--muted)}

/* ---------- shelves ---------- */
.shelves{display:flex;flex-wrap:wrap;gap:36px 56px;margin-top:26px}
.shelf{flex:0 1 auto;max-width:100%;display:flex;flex-direction:column;gap:14px}
.shelf-head{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap}
.shelf-head h3{margin:0;font-size:19px;font-weight:600;white-space:nowrap}
.shelf-head .spec{font-family:var(--mono);font-size:12.5px;color:var(--muted);padding:1px 7px;border:1px solid var(--line-strong);border-radius:6px}
.shelf-head .meta{font-size:13.5px;color:var(--faint)}
.row{display:flex;flex-wrap:wrap;gap:18px 14px;padding-bottom:16px;border-bottom:3px solid var(--shelf)}
.tile{width:var(--tile);display:flex;flex-direction:column;gap:8px;text-align:start;background:none;border:none;padding:0;cursor:pointer;color:var(--text)}
.tile .well{width:100%;aspect-ratio:1/1}
.tile:hover .well{box-shadow:0 0 0 1.5px var(--line-strong)}
.tile.is-out{opacity:.55}
.tile .txt{display:contents}
.badge{direction:ltr;position:absolute;z-index:1;height:22px;padding:0 7px;border-radius:6px;display:flex;align-items:center;font-family:var(--mono);font-size:12px;font-weight:500}
.badge.count{top:9px;inset-inline-start:9px;background:var(--chip);color:var(--chip-text)}
.badge.slot{top:9px;inset-inline-end:9px;background:var(--accent);color:var(--on-accent)}
.badge.flag{bottom:9px;inset-inline-end:9px;background:var(--fault-bg);color:var(--fault);box-shadow:inset 0 0 0 1px var(--fault-line);font-family:var(--font)}
/* the amount: always in the same corner, big enough to read at a glance */
.amt{position:absolute;z-index:1;bottom:9px;inset-inline-start:9px;display:flex;align-items:baseline;gap:2px;height:28px;padding:0 9px;border-radius:8px;background:var(--amt-bg);box-shadow:0 0 0 1px var(--line-strong);font-family:var(--mono);font-weight:600;font-size:15.5px;line-height:28px;color:var(--text);white-space:nowrap}
.amt small{font-size:11.5px;font-weight:500;color:var(--muted)}
.amt.unknown{font-family:var(--font);font-size:13px;color:var(--unknown);box-shadow:0 0 0 1px var(--unknown-line)}
.amt.low{color:var(--fault);box-shadow:0 0 0 1px var(--fault-line)}
.amt.out{font-family:var(--font);font-size:13px;color:var(--muted)}
.tile .name{display:flex;align-items:flex-start;gap:7px;font-size:15px;font-weight:500;line-height:1.3;padding:0 2px}
.sw{width:11px;height:11px;margin-top:5px;flex:0 0 auto;border-radius:50%;background:var(--sw);box-shadow:0 0 0 1px rgba(128,128,128,.5)}
.tile .sub{font-size:13px;color:var(--muted);padding:0 2px;margin-top:-5px}

/* ---------- combos & wishlist ---------- */
.section{display:flex;flex-direction:column;gap:16px}
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.toolbar .search-input{max-width:280px;height:42px}
.cards{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:14px}
.combo-card,.wish-card{position:relative;background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:16px;display:flex;flex-direction:column;gap:10px}
.combo-top{display:flex;justify-content:space-between;gap:10px;align-items:flex-start}
.combo-name{margin:0;font-size:16px;font-weight:600}
.combo-chips{display:flex;flex-wrap:wrap;gap:6px}
.combo-chip{display:inline-flex;align-items:center;gap:7px;font-size:13.5px;padding:5px 11px;border-radius:999px;border:1px solid var(--line-strong);background:var(--surface-2);color:var(--text);cursor:pointer}
.combo-chip i{width:10px;height:10px;border-radius:50%;background:var(--dot);box-shadow:0 0 0 1px rgba(128,128,128,.5)}
.combo-chip.missing{cursor:default;color:var(--muted);border-style:dashed}
.note{font-size:14px;color:var(--muted);background:var(--surface-2);padding:9px 12px;border-radius:9px;line-height:1.5}
.mini-actions{display:flex;gap:6px;align-items:center}
.mini-actions .icon-btn{width:34px;height:34px;border-radius:8px}
.wish-photo{margin:-16px -16px 0;height:120px;border-radius:14px 14px 0 0}
.wish-material{font-family:var(--mono);font-size:12px;color:var(--muted)}
.wish-title{font-weight:600;font-size:15.5px}
.wish-bottom{display:flex;justify-content:space-between;align-items:center;margin-top:auto;gap:8px}
.wish-price{font-family:var(--mono);font-size:14px;font-weight:600}
.add-card{border:1.5px dashed var(--line-strong);border-radius:14px;display:flex;align-items:center;justify-content:center;color:var(--muted);font-size:14.5px;padding:18px;min-height:120px;background:none;cursor:pointer}
.add-card:hover{border-color:var(--accent);color:var(--accent-text)}
.empty-state{color:var(--muted);font-size:14px;padding:20px;border:1px dashed var(--line-strong);border-radius:12px;text-align:center;grid-column:1/-1}
.jump-highlight .well{box-shadow:0 0 0 3px var(--accent)}
.jump-highlight.head{box-shadow:0 0 0 3px var(--accent)}

/* ---------- modals: centred on desktop, bottom sheets on the phone ---------- */
.modal-overlay{position:fixed;inset:0;background:var(--scrim);display:flex;align-items:center;justify-content:center;padding:20px;z-index:1000}
.modal{width:100%;max-width:500px;max-height:90vh;overflow-y:auto;overscroll-behavior:contain;background:var(--surface);border:1px solid var(--line-strong);border-radius:18px;box-shadow:var(--shadow);padding:22px}
.modal.wide{max-width:740px}
.modal h3{margin:0 0 6px;font-size:19px;font-weight:600}
.modal .sub{color:var(--muted);font-size:14px;margin:0 0 14px;line-height:1.55}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.form-grid .full{grid-column:1/-1}
.form-grid label{display:flex;flex-direction:column;gap:6px;font-size:13.5px;color:var(--muted)}
.form-actions{display:flex;gap:10px;align-items:center;margin-top:18px;flex-wrap:wrap}
.form-actions .spacer{flex:1}
.checkbox{flex-direction:row !important;align-items:center;gap:9px !important;color:var(--text) !important;font-size:14px !important}
.checkbox input{width:auto}
.dialog-card{max-width:440px;display:flex;flex-direction:column;gap:18px}
.dialog-text{font-size:15px;line-height:1.65;white-space:pre-line}
.dialog-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.tabs{display:flex;gap:6px;margin:6px 0 16px;flex-wrap:wrap}
.tab{height:36px;padding:0 14px;border-radius:9px;border:1px solid var(--line-strong);background:none;color:var(--muted);cursor:pointer;font-size:14px}
.tab.active{border-color:var(--text);color:var(--text);background:var(--surface-2);font-weight:600}
.list-box{max-height:300px;overflow-y:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:10px;padding:6px;background:var(--bg);display:flex;flex-direction:column;gap:2px}
.list-row{display:flex;align-items:center;gap:10px;min-height:42px;padding:6px 10px;border-radius:8px;font-size:14.5px;cursor:pointer;text-align:start;background:transparent;border:none;color:var(--text);width:100%}
.list-row:hover{background:var(--surface-2)}
.list-row input[type=checkbox]{width:18px;flex:0 0 auto}
.form-grid label.list-row{flex-direction:row;gap:10px;font-size:14.5px;color:var(--text)}
.list-row .dot{width:12px;height:12px;border-radius:50%;flex:0 0 auto;box-shadow:0 0 0 1px rgba(128,128,128,.5)}
.dot{width:12px;height:12px;border-radius:50%;flex-shrink:0;box-shadow:0 0 0 1px rgba(128,128,128,.5)}
.pill{font-family:var(--mono);font-size:11.5px;padding:2px 7px;border-radius:6px;border:1px solid var(--line-strong);color:var(--muted)}
.pill.blue{color:var(--plan);border-color:var(--plan);background:var(--plan-bg)}
.pill.warn{color:var(--fault);border-color:var(--fault-line);background:var(--fault-bg)}
.member-row{display:grid;grid-template-columns:1fr auto auto;gap:10px;align-items:center;padding:10px 0;border-bottom:1px solid var(--line);font-size:14.5px}
.member-row select{width:auto;padding:6px 10px;font-size:14px}
.member-row .who small{display:block;color:var(--muted);font-family:var(--mono);font-size:12px;direction:ltr;text-align:right}
.weigh-preview{margin:14px 0 4px;padding:14px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line)}
.weigh-preview .big{font-family:var(--mono);font-size:24px;font-weight:600}
.warn-box{font-size:14px;line-height:1.55;color:var(--unknown);background:var(--accent-soft);border:1px solid var(--unknown-line);border-radius:9px;padding:10px 12px;margin-top:10px}
.fault-text{font-size:14.5px;line-height:1.5;color:var(--fault);white-space:pre-wrap;background:var(--fault-bg);border-radius:9px;padding:10px 12px}
.resolved-note{font-size:13.5px;color:var(--ok)}
.weigh-list{display:flex;flex-direction:column;gap:8px;max-height:62vh;overflow-y:auto;overscroll-behavior:contain}
.weigh-row{display:grid;grid-template-columns:14px 1fr 104px 76px;gap:10px;align-items:center;padding:9px 11px;border-radius:10px;background:var(--surface-2);border:1px solid var(--line)}
.weigh-row.saved{border-color:var(--ok)}
.weigh-row .nm{font-size:14.5px} .weigh-row .nm small{display:block;color:var(--muted);font-family:var(--mono);font-size:12px}
.weigh-row input{padding:8px;text-align:center;direction:ltr;font-family:var(--mono)}
.weigh-row .res{font-family:var(--mono);font-size:13px;text-align:center}
.weigh-row .dot{width:12px;height:12px}

/* material details / manage */
.ms-head{display:flex;gap:16px;align-items:center;margin-bottom:16px}
.ms-head h3{margin:2px 0}
.ms-head .well{width:96px;height:96px;flex:0 0 auto}
.ms-close{margin-inline-start:auto;align-self:flex-start}
.ms-mat{font-family:var(--mono);font-size:12.5px;color:var(--muted)}
.kv{display:grid;grid-template-columns:auto 1fr;gap:9px 18px;font-size:15px;margin:0 0 18px;padding:14px;border-radius:12px;background:var(--surface-2)}
.kv > span:nth-child(odd){color:var(--muted)}
.kv .warnv{color:var(--unknown)}
.ms-title{margin:0 0 10px;font-size:15px;font-weight:600}
.ms-list{display:flex;flex-direction:column;gap:8px}
.ms-row{display:flex;gap:12px;align-items:center;padding:11px 13px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2);flex-wrap:wrap}
.ms-info{flex:1 1 200px;display:flex;flex-direction:column;gap:3px;min-width:0}
.ms-info b{font-size:14.5px}
.ms-info span{font-size:13.5px;color:var(--muted)}
.ms-acts{display:flex;gap:6px}
.ms-acts .btn{min-width:96px}
.ms-acts .btn{width:100%}
.ms-bar{display:flex;gap:8px;flex-wrap:wrap;margin-top:16px}
.danger-zone{margin-top:20px;border-top:1px solid var(--line);padding-top:14px}
.danger-zone .dz-panel{margin-top:10px;padding:12px;border:1px solid var(--danger);border-radius:10px;background:var(--danger-bg)}
.danger-zone .dz-panel p{margin:0 0 10px}
.danger-zone .dz-list{display:flex;gap:6px;flex-wrap:wrap}

/* guided material form */
.wz-steps{display:flex;gap:6px;margin-bottom:16px}
.wz-dot{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px;background:none;border:none;color:var(--muted);font-size:12.5px;cursor:pointer;padding:0;font-family:inherit}
.wz-dot:disabled{cursor:default}
.wz-dot i{font-style:normal;width:28px;height:28px;border-radius:50%;display:flex;align-items:center;justify-content:center;border:1.5px solid var(--line-strong);font-family:var(--mono);font-size:13px}
.wz-dot.on{color:var(--text)} .wz-dot.on i{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-text)}
.wz-dot.done i{border-color:var(--ok);background:var(--ok-bg);color:var(--ok)}
.wz-title{font-size:20px !important;margin:0 0 14px !important}
.wz-body{display:flex;flex-direction:column;gap:14px}
.wz-field{display:flex;flex-direction:column;gap:7px;font-size:14px;color:var(--muted)}
.wz-field input,.wz-field textarea,.wz-field select{font-size:15.5px;padding:11px 13px}
.wz-field .opt{font-size:12.5px;opacity:.8}
.wz-two{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end}
.wz-chips{display:flex;flex-wrap:wrap;gap:6px}
.chip{height:32px;padding:0 12px;border-radius:999px;border:1px solid var(--line-strong);background:none;font-size:13.5px;cursor:pointer;color:var(--muted)}
.chip{display:inline-flex;align-items:center;gap:7px;white-space:nowrap}
.chip .sw{margin-top:0}
.chip.active{border-color:var(--accent);color:var(--accent-text);background:var(--accent-soft)}
.wz-hint{font-size:13.5px;color:var(--muted);margin:-4px 0 0;line-height:1.5}
.wz-adv{border:1px solid var(--line);border-radius:10px;padding:10px 14px}
.wz-adv summary{cursor:pointer;font-size:14px;color:var(--muted)}
.wz-adv[open] summary{margin-bottom:12px}
.wz-adv .checkbox{margin-top:12px;display:flex}
.wz-preview{height:160px;border:1px dashed var(--line-strong);border-radius:12px;display:flex;align-items:center;justify-content:center;overflow:hidden;color:var(--muted);font-size:13px}
.wz-preview img{max-width:100%;max-height:100%}
.wz-count{display:flex;flex-direction:column;gap:10px}
.wz-count-row{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:12px 14px;border:1px solid var(--line);border-radius:11px;background:var(--surface-2);font-size:15px}
.stepper{display:flex;align-items:center;gap:4px;direction:ltr}
.stepper button{width:40px;height:40px;border-radius:9px;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);font-size:19px;cursor:pointer}
.stepper b{min-width:38px;text-align:center;font-family:var(--mono);font-size:19px}
.wz-nav{border-top:1px solid var(--line);padding-top:16px}
.fam-pick{display:flex;flex-wrap:wrap;gap:6px}

/* filter sheet (phone) */
.fsec{display:flex;flex-direction:column;gap:10px}
.fsec h4{margin:0;font-size:14px;color:var(--muted);font-weight:600}
.fsec .opts{display:flex;flex-wrap:wrap;gap:8px}
.seg2{display:grid;grid-template-columns:1fr 1fr;border:1px solid var(--line-strong);border-radius:10px;overflow:hidden}
.seg2 button{height:44px;border:none;background:none;cursor:pointer;color:var(--muted)}
.seg2 button[aria-pressed="true"]{background:var(--surface-2);color:var(--text);font-weight:600}
.sheet-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.sheet-title h3{margin:0}
.sheet-body{display:flex;flex-direction:column;gap:20px}
.sheet-foot{display:grid;grid-template-columns:1fr 2fr;gap:10px;padding-top:14px;margin-top:18px;border-top:1px solid var(--line)}
.sheet-foot .btn{height:50px}
.menu-list{display:flex;flex-direction:column;gap:4px}
.menu-list button,.menu-list a{display:flex;align-items:center;gap:12px;min-height:52px;padding:0 12px;border-radius:10px;border:none;background:none;color:var(--text);font-size:16px;text-align:start;text-decoration:none;cursor:pointer}
.menu-list button:hover,.menu-list a:hover{background:var(--surface-2)}

.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%) translateY(20px);opacity:0;pointer-events:none;background:var(--surface-2);border:1px solid var(--line-strong);color:var(--text);padding:11px 18px;border-radius:10px;font-size:14.5px;box-shadow:var(--shadow);z-index:2000;transition:all .2s ease;max-width:90vw}
.toast.show{opacity:1;transform:translateX(-50%) translateY(0)}
.toast.ok{border-color:var(--ok)} .toast.err{border-color:var(--danger);color:var(--danger)}
.fab{display:none}
footer{text-align:center;padding:26px;color:var(--faint);font-size:12.5px}

/* ---------- mid widths ---------- */
@container (max-width: 1180px){
  .wrap{padding:24px 32px 90px}
  .nav .nl{display:none}
  .menu-btn{display:flex}
  .heads{gap:10px}
  .head{padding:12px}
  .head .tag.ok span{display:none}
}
@container (max-width: 860px){
  .search{flex:1 1 100%;padding-bottom:12px}
  .search input{width:auto;flex:1 1 auto}
  .mtabs{flex-basis:100%;order:2}
  .theme button span{display:none}
  .theme button{padding:0 10px}
  .head .well{aspect-ratio:1/1}
  .head .why{display:none}
  .head .num .full{display:none}
  .head .num .short{display:inline}
  .head .tag.ok{padding:0 4px}
}

/* ---------- phone: its own layout, not a shrunk desktop ---------- */
@container (max-width: 640px){
  .wrap{padding:14px 16px 112px;gap:22px}
  .top{gap:8px}
  .inv-select{font-size:19px}
  .avatar,.top .btn-add,.theme{display:none}
  .theme-mini{display:flex}
  .nav{gap:8px}

  /* printer: summary always visible; five separate rows when open */
  .printer .sec-head{display:none}
  .psum{display:flex;flex-direction:column;gap:12px}
  .psum-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
  .psum-top b{font-size:16.5px}
  .psum-top .meta{font-size:13.5px;color:var(--muted)}
  .psum-top .meta .f{color:var(--fault);font-weight:600}
  .psum-toggle{height:40px;padding:0 12px;border-radius:9px;border:1px solid var(--line-strong);background:var(--surface);display:flex;align-items:center;gap:6px;font-weight:600;cursor:pointer;flex:0 0 auto}
  .psum-toggle svg{transition:transform .2s}
  .printer.open .psum-toggle svg{transform:rotate(180deg)}
  .slots{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
  .slots.few{grid-template-columns:repeat(var(--cols,5),minmax(0,64px))}
  .slot{display:flex;flex-direction:column;align-items:center;gap:5px;padding:8px 2px 8px;border-radius:12px;background:var(--surface);border:1px solid var(--line);cursor:pointer;color:var(--text)}
  .slot .well{width:44px;height:44px;border-radius:9px}
  .slot .well.empty{font-size:0}
  .slot .e{font-family:var(--mono);font-size:13px;font-weight:600}
  .slot .st{font-size:12px;line-height:1;display:flex;align-items:center;gap:3px;color:var(--ok)}
  .slot .st.empty{color:var(--faint)}
  .slot.fault{box-shadow:inset 0 0 0 1px var(--fault-line)}
  .slot.fault .st{color:var(--fault);font-weight:600}
  .printer:not(.open) .heads{display:none}
  .printer.open .slots{display:none}
  .heads,.heads.few{grid-template-columns:1fr;gap:8px;max-width:none}
  .head{flex-direction:row;align-items:center;gap:12px;padding:10px 12px;border-radius:12px;min-height:72px}
  .head-top{flex-direction:column;align-items:center;justify-content:center;width:30px}
  .head .num{font-size:20px;font-weight:600;color:var(--text);line-height:1}
  .head .num .full,.head .num .short{display:none}
  .head .num .n{display:block}
  .head .well{width:52px;height:52px;aspect-ratio:auto;flex:0 0 auto;border-radius:10px}
  .head .well.empty{font-size:0}
  .head .who{flex:1 1 auto}
  .head .top-tag{display:none}
  .head .row-tag{display:inline-flex}
  .head .why,.head .plan-note{display:none}
  .head .tag.ok span{display:inline}
  .head .tag.ok{padding:0 8px}
  .chev{display:block;color:var(--faint)}
  .todo{padding:12px 14px}
  .todo .sep{display:none}

  .controls{border-bottom:none;gap:10px;position:sticky;top:0;z-index:5;background:var(--bg);padding-top:6px}
  .search{order:-1;padding-bottom:0;flex:1 1 100%}
  .search select{display:none}
  .search input{height:46px;font-size:16px}
  .filter-btn{display:flex}
  .colors{display:none}
  .mtabs{gap:8px;flex-basis:100%;padding-bottom:10px;border-bottom:1px solid var(--line)}
  .mtab{height:38px;padding:0 14px;border:1px solid var(--line-strong);border-radius:999px;margin:0;font-size:14px;align-items:center}
  .mtab[aria-pressed="true"]{border-color:var(--text);background:var(--surface-2)}
  .active-filters{margin-top:10px;flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}
  .active-filters::-webkit-scrollbar{display:none}
  .achip{height:36px}

  .shelves{gap:26px;margin-top:16px}
  .shelf{flex:1 1 100%;gap:10px}
  .shelf-head h3{font-size:18px}
  .row{display:flex;flex-direction:column;gap:8px;border-bottom:none;padding:0}
  .tile{width:auto;flex-direction:row;align-items:center;gap:12px;padding:8px;border-radius:12px;background:var(--surface);border:1px solid var(--line)}
  .tile .well{width:76px;height:76px;flex:0 0 auto;aspect-ratio:auto;border-radius:10px}
  .tile .well img{padding:5%}
  .tile .txt{display:flex;flex:1 1 auto;min-width:0;flex-direction:column;gap:3px}
  .tile .name{font-size:16px;padding:0}
  .tile .sub{margin:0;padding:0}
  .tile .amt{position:static;flex:0 0 auto}
  .badge{height:20px;font-size:11px;padding:0 5px}
  .badge.count{top:5px;inset-inline-start:5px} .badge.slot{top:5px;inset-inline-end:5px} .badge.flag{bottom:5px;inset-inline-end:5px}
  .cards{grid-template-columns:1fr}
  .fab{display:flex;position:fixed;left:16px;bottom:20px;height:52px;padding:0 20px;border-radius:26px;box-shadow:0 8px 22px rgba(0,0,0,.3);z-index:900}
  body.modal-open .fab{display:none}
}
/* dialogs become bottom sheets on narrow screens (viewport query: they live outside the app container) */
@media (max-width: 640px){
  .modal-overlay{align-items:flex-end;padding:0}
  .modal{max-width:none !important;border-radius:20px 20px 0 0;max-height:88vh;padding:10px 18px 24px;border-bottom:none}
  .modal::before{content:"";display:block;width:40px;height:5px;border-radius:3px;background:var(--line-strong);margin:0 auto 14px}
  .form-grid,.wz-two{grid-template-columns:1fr}
  .ms-acts{width:100%}
  .ms-acts .btn{flex:1 1 0}
  .wz-dot span{display:none}
  .dialog-card{border-radius:20px 20px 0 0}
}
@media (prefers-reduced-motion: reduce){ *{transition:none !important} .bar::after{animation:none;transform:scaleX(.5)} }
.wz-hint:empty{display:none}
.wz-hint.err{color:var(--danger)}
input.bad{border-color:var(--danger) !important}
/* combo form */
.combo-pick-head{display:flex;align-items:center;gap:12px}
.combo-pick-head span{font-size:13.5px;color:var(--muted);white-space:nowrap}
.combo-pick-head input{flex:1 1 auto}
.slot-badge{margin-inline-start:auto;font-family:var(--mono);font-size:12px;color:var(--accent-text);background:var(--accent-soft);padding:2px 7px;border-radius:6px}

/* =====================================================================
   DESIGN PREVIEW (html.preview — only the /preview/ copy)
   ===================================================================== */
/* light palette taken from the Figma frame ("סדנת המודל"): warm paper #F4F0E7, cards #FFFCF6,
   ink #292A27, olive #465031 for primary actions, sage #E4E7D5 for "full", brick #B73A2F on #F8DFD2 for trouble */
html.preview[data-theme="light"]{
  --font:'Noto Sans Hebrew', 'IBM Plex Sans Hebrew', system-ui, sans-serif;
  --bg:#F4F0E7; --surface:#FFFCF6; --surface-2:#F8F6EF; --well:#EDE6D9; --field:#FFFFFF;
  --line:#D8D1C3; --line-strong:#BDB4A4; --shelf:#D8D1C3;
  --text:#292A27; --muted:#706E65; --faint:#9A968B;
  --accent:#465031; --accent-text:#465031; --on-accent:#FFFCF6; --accent-soft:#E4E7D5;
  --fault:#B73A2F; --fault-bg:#F8DFD2; --fault-line:rgba(183,58,47,.45);
  --danger:#B73A2F; --danger-bg:#F8DFD2;
  --ok:#66704A; --ok-bg:#E4E7D5;
  --unknown:#78835B; --unknown-line:rgba(120,131,91,.45);
  --plan:#476E8A; --plan-bg:#E3EAEE;
  --chip:#292A27; --chip-text:#FFFCF6; --amt-bg:#FFFCF6;
  --focus:#465031; --bed:#D8D1C3; --layer-2:#465031;
}
html.preview{ --unknown-bg:rgba(217,168,87,.08); --low-edge:#E07A66; }
html.preview[data-theme="light"]{ --unknown-bg:#EDE6D9; --low-edge:#D86135; }

.preview-note{font-size:12.5px;color:var(--muted);background:var(--surface-2);border:1px dashed var(--line-strong);border-radius:8px;padding:6px 12px;align-self:flex-start}
.preview-note a{color:var(--accent-text)}

/* 1. printer heads: amount + fill bar, health and swap at the bottom */
html.preview .head .fill{display:flex;flex-direction:column;gap:6px;margin-top:10px}
html.preview .fill-top{display:flex;justify-content:space-between;align-items:baseline;font-size:13px;color:var(--muted)}
html.preview .fill-top b{font-size:15.5px;color:var(--text);font-weight:700}
html.preview .fill-bar{height:7px;border-radius:99px;background:var(--line);overflow:hidden}
html.preview .fill-bar i{display:block;height:100%;border-radius:inherit;background:var(--ok)}
html.preview .fill.mid .fill-bar i{background:#D9A12F}
html.preview .fill.low .fill-bar i{background:var(--danger)}
html.preview .fill.low .fill-top b{color:var(--danger)}
html.preview .fill.unknown .fill-bar{background:repeating-linear-gradient(135deg,var(--line) 0 6px,transparent 6px 10px)}
html.preview .fill.unknown .fill-top b{color:var(--unknown);font-weight:600}
html.preview .head-foot{display:flex;justify-content:space-between;align-items:center;margin-top:auto;padding-top:10px;border-top:1px solid var(--line);font-size:13.5px}
html.preview .hf-health{display:inline-flex;align-items:center;gap:5px;font-weight:600}
html.preview .hf-health.ok{color:var(--ok)} html.preview .hf-health.ok::before{content:"✓"}
html.preview .hf-health.bad{color:var(--fault)}
html.preview .hf-swap{color:var(--plan);font-weight:600;padding:4px 6px;margin:-4px -6px;border-radius:6px;cursor:pointer}
html.preview .hf-swap:hover{background:var(--plan-bg)}
html.preview .head .why{border-top:none;padding-top:0}

/* 2. inventory tabs */
.inv-tabs{display:flex;align-items:center;gap:6px;overflow-x:auto;scrollbar-width:none}
.inv-tabs::-webkit-scrollbar{display:none}
.inv-tabs .lbl{font-size:13.5px;color:var(--faint);white-space:nowrap;margin-inline-end:4px}
.inv-tabs button{flex:0 0 auto;height:34px;padding:0 14px;border-radius:9px;border:none;background:none;color:var(--muted);font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap}
.inv-tabs button:hover{background:var(--surface-2)}
.inv-tabs button[aria-pressed="true"]{background:var(--accent-soft);color:var(--text)}

/* 3. combinations as compact cards */
.cb-grid{grid-template-columns:repeat(auto-fill,minmax(260px,1fr)) !important;gap:10px !important}
.cb-card{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;border-radius:12px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);text-align:start;cursor:pointer;min-height:72px}
.cb-card:hover{border-color:var(--line-strong)}
.cb-txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.cb-txt b{font-size:15.5px;font-weight:700}
.cb-txt small{font-size:13px;color:var(--muted)}
.cb-dots{display:flex;align-items:center;flex:0 0 auto;direction:ltr}
.cb-dots i{width:26px;height:26px;border-radius:50%;background:var(--sw);box-shadow:0 0 0 2px var(--surface-2),inset 0 0 0 1px rgba(128,128,128,.35);margin-left:-7px}
.cb-dots i:first-child{margin-left:0}
.cb-dots em{font-style:normal;font-size:12px;color:var(--muted);margin-left:6px}

/* 4. filter row: search + selects + one view button on top, all material tabs on their own row */
html.preview .controls{flex-wrap:wrap;row-gap:4px}
html.preview .search{order:1;flex:1 1 100%;padding-bottom:6px}
html.preview .search input{flex:1 1 auto;width:auto;max-width:420px}
html.preview .mtabs{order:2;flex:1 1 100%;flex-wrap:wrap;row-gap:10px;overflow:visible}
.viewtoggle{display:inline-flex;align-items:center;gap:8px;height:42px;padding:0 14px;border-radius:9px;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);font-size:14px;font-weight:600;cursor:pointer;white-space:nowrap;flex:0 0 auto;margin-inline-start:auto}
.viewtoggle:hover{border-color:var(--muted)}

/* ledger: every product its own bordered card, with its photo */
#grid.is-ledger{display:block}
.lg-head{display:flex;align-items:baseline;gap:12px;flex-wrap:wrap;margin-bottom:14px}
.lg-head h3{margin:0;font-size:18px;font-weight:700}
.lg-head .meta{font-size:13px;color:var(--muted)}
.ledger{display:grid;grid-template-columns:repeat(auto-fill,minmax(300px,1fr));gap:10px}
.lg-cell{display:flex;align-items:center;gap:12px;padding:10px 14px 10px 12px;border:1px solid var(--line);border-radius:12px;background:var(--surface);color:var(--text);text-align:start;cursor:pointer;min-height:92px;position:relative;overflow:hidden}
.lg-cell:hover{border-color:var(--line-strong);box-shadow:0 6px 16px -10px rgba(0,0,0,.35)}
.lg-cell.full{background:var(--ok-bg);border-color:color-mix(in srgb,var(--ok) 28%,var(--line))}
.lg-cell.low{background:var(--danger-bg);border-color:color-mix(in srgb,var(--danger) 35%,var(--line))}
.lg-cell.low::after{content:"";position:absolute;inset-block:0;inset-inline-end:0;width:4px;background:var(--low-edge)}
.lg-cell.unknown{background:var(--unknown-bg)}
.lg-cell.out{opacity:.6}
/* the cell's colour says how much is left, in four distinct steps; unknown (not weighed) is blue */
.lg-cell.lv-red{--lvl:#FF5A4E} .lg-cell.lv-orange{--lvl:#FF9F1C} .lg-cell.lv-yellow{--lvl:#F2D541} .lg-cell.lv-green{--lvl:#3DDC84}
.lg-cell.unknown:not(.lvl){--lvl:#5BA4FF}
.lg-cell.lvl,.lg-cell.unknown:not(.lvl){background:color-mix(in srgb,var(--lvl) 24%,var(--surface));border:1.5px solid color-mix(in srgb,var(--lvl) 75%,var(--line))}
.lg-cell.lvl .lg-amt b,.lg-cell.unknown:not(.lvl) .lg-amt b{color:var(--lvl)}
.lg-cell.lvl .lg-amt{border-inline-start-color:color-mix(in srgb,var(--lvl) 45%,var(--line))}
.lg-cell.lvl.out{opacity:.8}
html[data-theme="light"] .lg-cell.lv-red{--lvl:#D92D20} html[data-theme="light"] .lg-cell.lv-orange{--lvl:#E07800}
html[data-theme="light"] .lg-cell.lv-yellow{--lvl:#B59400} html[data-theme="light"] .lg-cell.lv-green{--lvl:#16A34A}
html[data-theme="light"] .lg-cell.unknown:not(.lvl){--lvl:#2F6FD8}
html[data-theme="light"] .lg-cell.lvl,html[data-theme="light"] .lg-cell.unknown:not(.lvl){background:color-mix(in srgb,var(--lvl) 16%,var(--surface))}
html.preview[data-theme="light"] .lg-cell.lvl,html.preview[data-theme="light"] .lg-cell.unknown:not(.lvl){border:1.5px solid color-mix(in srgb,var(--lvl) 70%,var(--line))}
.lg-legend i.lv-red{background:#FF5A4E} .lg-legend i.lv-orange{background:#FF9F1C} .lg-legend i.lv-yellow{background:#F2D541} .lg-legend i.lv-green{background:#3DDC84} .lg-legend i.lv-unknown{background:#5BA4FF}
html[data-theme="light"] .lg-legend i.lv-red{background:#D92D20} html[data-theme="light"] .lg-legend i.lv-orange{background:#E07800} html[data-theme="light"] .lg-legend i.lv-yellow{background:#B59400} html[data-theme="light"] .lg-legend i.lv-green{background:#16A34A} html[data-theme="light"] .lg-legend i.lv-unknown{background:#2F6FD8}
.lg-cell .lg-well{width:68px;height:68px;flex:0 0 auto;border-radius:10px;aspect-ratio:auto}
.lg-cell .lg-well img{padding:6%}
.lg-main{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1 1 auto}
.lg-main b{display:flex;align-items:center;gap:7px;font-size:15px;font-weight:700;line-height:1.3}
.lg-main b .sw{margin-top:0}
.lg-main small{font-size:12.5px;color:var(--muted)}
.lg-main .mono{font-size:11.5px;color:var(--faint);text-align:right}
.lg-amt{display:flex;flex-direction:column;align-items:flex-end;gap:6px;flex:0 0 auto;text-align:end;padding-inline-start:12px;border-inline-start:1px solid var(--line);align-self:stretch;justify-content:center}
.lg-amt>span{display:flex;flex-direction:column;align-items:flex-end}
.lg-amt b{font-size:16px;font-weight:700;white-space:nowrap}
.lg-amt small{font-size:12px;color:var(--muted);white-space:nowrap}
.lg-amt .low b,.lg-amt .low small{color:var(--danger)}
.lg-amt .unknown b{color:var(--unknown);font-weight:600}
.lg-legend{display:flex;flex-wrap:wrap;gap:16px;margin-top:12px;font-size:12.5px;color:var(--muted)}
.lg-legend span{display:inline-flex;align-items:center;gap:6px}
.lg-legend i{width:14px;height:14px;border-radius:4px;border:1px solid var(--line-strong)}
.lg-legend i.full{background:var(--ok-bg)} .lg-legend i.low{background:var(--danger-bg)} .lg-legend i.unknown{background:var(--unknown-bg)}

@container (max-width: 640px){
  html.preview .head .fill{margin-top:6px}
  html.preview .head-foot{display:none}
  html.preview .search{padding-bottom:0}
  html.preview .search input{max-width:none}
  html.preview .mtabs{flex-wrap:wrap;overflow:visible;gap:6px;padding-bottom:8px}
  html.preview .mtab{height:32px;padding:0 11px;font-size:13.5px}
  .inv-tabs{margin-top:0}
  .ledger{grid-template-columns:1fr;gap:8px}
  .lg-cell{min-height:0;padding:8px 12px 8px 8px}
  .lg-cell .lg-well{width:56px;height:56px}
  .cb-grid{grid-template-columns:1fr !important}
}

@container (max-width: 640px){
  .search .viewtoggle{display:none}
  html.preview .fill-top span{display:none}
  html.preview .fill-top{justify-content:flex-start}
  html.preview .head .fill{max-width:180px}
}

/* ---- the Figma "feel" in the light theme: square corners, hairline borders, a paper header band, heavy headings ---- */
html.preview[data-theme="light"] body{font-family:var(--font)}
html.preview[data-theme="light"] :is(.head,.todo,.tile,.combo-card,.wish-card,.cb-card,.lg-cell){border:1px solid var(--line);box-shadow:none}
html.preview[data-theme="light"] .tile{background:var(--surface)}
html.preview[data-theme="light"] .lg-cell.full{border-color:#C9CDB5}
html.preview[data-theme="light"] .lg-cell.low{border-color:#E7B7A6}
html.preview[data-theme="light"] :is(h1,h2,h3,.sec-head h2,.shelf-head h3,.lg-head h3,.inv-select){font-weight:800;letter-spacing:-.01em;color:var(--text)}
html.preview[data-theme="light"] .head b,html.preview[data-theme="light"] .lg-main b,html.preview[data-theme="light"] .cb-txt b{font-weight:700}
html.preview[data-theme="light"] .head .num{font-family:var(--mono);color:var(--text);font-weight:600}
/* paper band behind the header (with the inventory tabs inside it), edge to edge and up to the top of the page */
html.preview header.top{flex-wrap:wrap}
html.preview #invTabs{order:10;flex:1 1 100%;margin-top:0}
html.preview[data-theme="light"] header.top{position:relative;background:var(--surface);box-shadow:0 0 0 100vmax var(--surface);clip-path:inset(-300px -100vmax 0 -100vmax);padding-bottom:14px}
html.preview[data-theme="light"] header.top::after{content:"";position:absolute;bottom:0;left:-100vmax;right:-100vmax;height:1px;background:var(--line)}
html.preview[data-theme="light"] .preview-note{background:transparent}
/* primary actions in olive ink, secondary ones as outlined paper buttons */
html.preview[data-theme="light"] .btn-add{background:var(--accent);color:var(--on-accent)}
html.preview[data-theme="light"] :is(.btn:not(.primary):not(.danger):not(.accent):not(.empty-btn),.btn-line,.filter-btn,.viewtoggle){background:var(--surface);border-color:var(--line-strong);color:var(--text)}
html.preview[data-theme="light"] .btn.accent{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
html.preview[data-theme="light"] .inv-tabs button[aria-pressed="true"]{background:var(--accent-soft);color:var(--text)}
html.preview[data-theme="light"] .todo{background:var(--surface)}
html.preview[data-theme="light"] .todo .fault-text{background:var(--fault-bg);color:var(--fault)}
html.preview[data-theme="light"] .hf-health.ok{color:var(--ok)}
html.preview .app{overflow-x:clip}

/* adding people */
.tab-badge{display:inline-flex;min-width:18px;height:18px;padding:0 5px;margin-inline-start:6px;border-radius:9px;background:var(--danger);color:#fff;font-size:11.5px;font-weight:700;align-items:center;justify-content:center}
#manageBtn[data-badge]:not([data-badge=""])::after{content:attr(data-badge);display:inline-flex;min-width:17px;height:17px;padding:0 4px;margin-inline-start:6px;border-radius:9px;background:var(--danger);color:#fff;font-size:11px;font-weight:700;align-items:center;justify-content:center;vertical-align:1px}
.req-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap;padding:10px 0;border-bottom:1px solid var(--line);font-size:14.5px;color:var(--text)}
.req-row .who{flex:1 1 220px;display:flex;flex-direction:column;gap:2px;min-width:0}
.req-row .who small{color:var(--muted);font-size:12.5px}
.req-row select{width:auto;padding:6px 10px;font-size:14px}
.pill.approved{background:var(--ok-bg);color:var(--ok)} .pill.rejected{background:var(--danger-bg);color:var(--danger)}
.otp-overlay{position:fixed;inset:0;background:var(--scrim);display:flex;align-items:center;justify-content:center;z-index:3000;padding:16px}
.otp-overlay.force{background:var(--bg)}
.otp-card{width:min(460px,100%);background:var(--surface);border:1px solid var(--line);border-radius:16px;padding:22px;display:flex;flex-direction:column;gap:12px;box-shadow:var(--shadow)}
.otp-card h3{margin:0;font-size:19px}
.otp-card .sub{margin:0}
.otp-code{font-family:var(--mono);font-size:24px;letter-spacing:.08em;text-align:center;padding:12px;border-radius:10px;background:var(--surface-2);border:1px dashed var(--line-strong);user-select:all}
.otp-msg{font-size:13px}

/* notifications */
.bell{position:relative;width:40px;height:40px;flex:0 0 auto}
.bell[data-badge]:not([data-badge=""])::after{content:attr(data-badge);position:absolute;top:-3px;inset-inline-end:-3px;min-width:17px;height:17px;padding:0 4px;border-radius:9px;background:var(--danger);color:#fff;font-size:10.5px;font-weight:700;display:inline-flex;align-items:center;justify-content:center;line-height:1}
.note-h{margin:14px 0 6px;font-size:13px;color:var(--muted);font-weight:600}
.note-row{display:flex;gap:10px;align-items:flex-start;padding:10px 12px;border:1px solid var(--line);border-radius:10px;margin-bottom:8px;background:var(--surface);color:var(--text)}
.note-row.unread{border-color:var(--accent);box-shadow:inset -3px 0 0 var(--accent)}
.note-ico{font-size:17px;line-height:1.3}
.note-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:3px;font-size:14.5px}
.note-body{color:var(--muted);font-size:13.5px;line-height:1.45}
.note-txt small{color:var(--faint);font-size:12px}
.otp-mini{font-family:var(--mono);font-size:14px;padding:4px 8px;border:1px dashed var(--line-strong);border-radius:6px;background:var(--surface-2);user-select:all;white-space:nowrap}
.login-row .who small{display:block}

/* selects: our own chevron, with room between it and the edge of the box */
select:not(.inv-select){appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238A857B' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:left 14px center;background-size:12px;padding-left:38px}
.empty-btn{color:var(--danger);border-color:color-mix(in srgb,var(--danger) 45%,var(--line-strong));background:transparent}
.empty-btn:hover{background:var(--danger-bg)}

/* preview: inventory name is a title (switching only via "מעבר מלאי"); swap link beside the extruder name */
html.preview #inventorySelect{display:none}
.inv-title{margin:0;font-size:22px;font-weight:700;line-height:1.3}
html.preview .head-top{justify-content:flex-start}
html.preview .head-top .top-tag{margin-inline-start:auto}
html.preview .head-top .hf-swap{font-size:13px;padding:2px 6px;margin:-2px 0}
@container (max-width: 640px){ .inv-title{font-size:19px} html.preview .head-top .hf-swap{display:none} }

/* heads: the swap button sits where "תקין" was; a fault tag stays, with the button next to it */
html.preview .head-top .top-tag{display:inline-flex;align-items:center;gap:6px}
html.preview .head .tag.ok{display:none}
html.preview .head-top .hf-swap{font-size:13.5px;padding:3px 8px;margin:-3px -4px -3px 0;border-radius:6px}

/* management: sections instead of many tabs */
.mg-sec{padding:16px 0;border-top:1px solid var(--line)}
.mg-sec:first-child{border-top:none;padding-top:4px}
.mg-sec h4{margin:0 0 8px;font-size:15.5px}
.mg-fold>summary{cursor:pointer;font-weight:600;font-size:15px;color:var(--text);list-style:none;display:flex;align-items:center;gap:8px}
.mg-fold>summary::-webkit-details-marker{display:none}
.mg-fold>summary::before{content:"";width:8px;height:8px;border-inline-end:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(45deg);margin-top:-4px;transition:transform .15s}
.mg-fold[open]>summary::before{transform:rotate(225deg);margin-top:4px}
.mg-fold[open]>summary{margin-bottom:12px}
@container (max-width: 640px){ html.preview .head-top .top-tag{display:none} }

.inv-hello{font-size:13.5px;color:var(--muted);margin-bottom:2px}
.inv-hello:empty{display:none}
.pw-rules{list-style:none;margin:-4px 0 0;padding:0;display:flex;flex-direction:column;gap:4px;font-size:13.5px;color:var(--muted)}
.pw-rules li{display:flex;align-items:center;gap:7px}
.pw-rules li::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--line-strong);flex:0 0 auto}
.pw-rules li.ok{color:var(--ok)} .pw-rules li.ok::before{background:var(--ok)}
.pw-rules li.bad{color:var(--danger)} .pw-rules li.bad::before{background:var(--danger)}

/* management extras */
.mg-danger{margin-top:22px;padding-top:14px;border-top:1px solid var(--line)}
.mg-danger>summary{font-size:13.5px;font-weight:500;color:var(--muted)}
.user-row{display:flex;flex-wrap:wrap;align-items:center;gap:10px}
.user-row .who{flex:1 1 200px}
.user-row .flags{display:flex;flex-wrap:wrap;gap:6px 14px;flex:1 1 320px}
.user-acts{display:flex;gap:8px;flex-wrap:wrap}
.acc-panel{flex:1 1 100%;display:flex;flex-direction:column;gap:6px;margin-top:4px;padding:10px 12px;background:var(--surface-2);border:1px solid var(--line);border-radius:10px}
.acc-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.acc-row span{font-size:14.5px;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.acc-row select{width:auto;min-width:150px;padding-top:6px;padding-bottom:6px;font-size:14px}
.mi-head{display:flex;align-items:center;gap:8px;flex-wrap:wrap}
.mi-head select{width:auto;padding-top:4px;padding-bottom:4px;font-size:15px;font-weight:600}
#muIdleFold{margin-top:14px}

/* ---------- people: "משתמשים והרשאות" ---------- */
.ps-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:4px}
.ps-bar h4{margin:0}
.ps-body{display:flex;flex-direction:column;gap:14px}
.ps-group{border:1px solid var(--line);border-radius:10px;overflow:hidden}
.ps-group-head{display:flex;align-items:baseline;justify-content:space-between;gap:10px;padding:9px 12px;background:var(--surface-2);border-bottom:1px solid var(--line)}
.ps-group-head span{font-size:13px;color:var(--muted)}
.ps-group .ps-row{padding:9px 12px;margin:0;border-bottom:1px solid var(--line)}
.ps-group .ps-row:last-child{border-bottom:none}
.ps-row select{width:auto;min-width:140px;padding-top:6px;padding-bottom:6px;font-size:14px}
.ps-lock{width:58px}
.ps-empty{padding:10px 12px;margin:0}
.ps-user{border:1px solid var(--line);border-radius:10px;background:var(--surface)}
.ps-user.open{border-color:var(--line-strong)}
.ps-user-head{display:flex;align-items:center;gap:10px;width:100%;padding:10px 12px;background:none;border:none;cursor:pointer;text-align:start;color:inherit}
.ps-user-head .who{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:15px}
.ps-user-head .who small{color:var(--muted);font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.ps-level{font-size:12.5px;font-weight:600;padding:3px 9px;border-radius:99px;background:var(--surface-2);border:1px solid var(--line);white-space:nowrap}
.ps-level.lv6,.ps-level.lv5{color:var(--accent-text);border-color:color-mix(in srgb,var(--accent) 40%,var(--line));background:var(--accent-soft)}
.ps-chev{width:8px;height:8px;border-inline-start:2px solid var(--muted);border-bottom:2px solid var(--muted);transform:rotate(-45deg);transition:transform .15s}
.ps-user.open .ps-chev{transform:rotate(135deg)}
.ps-user-body{padding:4px 12px 12px;display:flex;flex-direction:column;gap:8px;border-top:1px solid var(--line)}
.ps-sub{font-size:12.5px;color:var(--muted);font-weight:600;margin-top:6px}
.ps-user-body .flags{display:flex;flex-wrap:wrap;gap:6px 14px}

/* switching inventory: the old one stays on screen, dimmed and untouchable, until the new one arrives */
#appView.switching .wrap > section{opacity:.45;pointer-events:none;transition:opacity .15s}
.lg-cell.jump-highlight{box-shadow:0 0 0 3px var(--accent)}

/* =====================================================================
   v5 — feel and accessibility (design review rounds 1–2)
   ===================================================================== */
/* ---------- tokens: amount bands (fill = the colour, ink = text that reads on a surface) ---------- */
:root, [data-theme="dark"]{
  --lv-red:#FF5A4E; --lv-orange:#FF9F1C; --lv-yellow:#F2D541; --lv-green:#3DDC84; --lv-unknown:#5BA4FF;
  --lv-red-ink:#FF6F64; --lv-orange-ink:#FFA733; --lv-yellow-ink:#F2D541; --lv-green-ink:#3DDC84; --lv-unknown-ink:#7AB5FF;
  --faint:#96928A;
  --glass:rgba(17,18,19,.72);
  --ease-out:cubic-bezier(.22,1,.36,1);
}
[data-theme="light"]{
  --lv-red:#D92D20; --lv-orange:#E07800; --lv-yellow:#D9B200; --lv-green:#16A34A; --lv-unknown:#2F6FD8;
  --lv-red-ink:#B42318; --lv-orange-ink:#A15C00; --lv-yellow-ink:#7A6200; --lv-green-ink:#11793A; --lv-unknown-ink:#2563C9;
  --faint:#65625A;
  --glass:rgba(251,250,246,.74);
}
html.preview[data-theme="light"]{ --faint:#65625A; --muted:#625F57; --glass:rgba(255,252,246,.74); }
.lv-red{--lvl:var(--lv-red);--lvl-ink:var(--lv-red-ink)} .lv-orange{--lvl:var(--lv-orange);--lvl-ink:var(--lv-orange-ink)}
.lv-yellow{--lvl:var(--lv-yellow);--lvl-ink:var(--lv-yellow-ink)} .lv-green{--lvl:var(--lv-green);--lvl-ink:var(--lv-green-ink)}
.lv-unknown{--lvl:var(--lv-unknown);--lvl-ink:var(--lv-unknown-ink)}

/* ---------- the same five colours everywhere ---------- */
/* shelf tiles, the product and extruder windows */
.amt[class*="lv-"]{color:var(--lvl-ink);background:color-mix(in srgb,var(--lvl) 16%,var(--amt-bg));box-shadow:0 0 0 1.5px color-mix(in srgb,var(--lvl) 70%,transparent)}
.amt[class*="lv-"] small{color:inherit;opacity:.85}
.amt.lv-unknown{font-family:var(--font)}
/* a thin bar: how full one spool is */
.lvl-bar{display:block;height:6px;border-radius:99px;background:color-mix(in srgb,var(--lvl,var(--line)) 18%,var(--line));overflow:hidden;margin-top:6px}
.lvl-bar i{display:block;height:100%;border-radius:inherit;background:var(--lvl,var(--muted))}
.lvl-bar.lv-unknown i{background:repeating-linear-gradient(135deg,var(--lvl) 0 5px,transparent 5px 9px);opacity:.7}
.ms-info .lvl-bar{max-width:240px}
.slot-bar{width:44px;height:4px;margin-top:-1px}
/* printer heads (v4 fill bar) */
html.preview .fill[class*="lv-"] .fill-bar i{background:var(--lvl)}
html.preview .fill[class*="lv-"] .fill-top b{color:var(--lvl-ink)}
html.preview .fill-top b{margin-inline-start:auto} html.preview .fill-top em{font-style:normal;font-size:12.5px;color:var(--muted);padding-inline-start:8px}
html.preview .fill-top em:empty{display:none}
html.preview .fill.lv-unknown .fill-bar{background:repeating-linear-gradient(135deg,color-mix(in srgb,var(--lvl) 40%,var(--line)) 0 6px,transparent 6px 10px)}
/* the ledger reads the same tokens (it had its own copies) */
.lg-cell.lv-red{--lvl:var(--lv-red)} .lg-cell.lv-orange{--lvl:var(--lv-orange)} .lg-cell.lv-yellow{--lvl:var(--lv-yellow)} .lg-cell.lv-green{--lvl:var(--lv-green)}
html[data-theme] .lg-cell.lv-red{--lvl:var(--lv-red)} html[data-theme] .lg-cell.lv-orange{--lvl:var(--lv-orange)} html[data-theme] .lg-cell.lv-yellow{--lvl:var(--lv-yellow)} html[data-theme] .lg-cell.lv-green{--lvl:var(--lv-green)}
html[data-theme] .lg-cell.unknown:not(.lvl){--lvl:var(--lv-unknown)}
html[data-theme="light"] .lg-cell.lvl .lg-amt b{color:color-mix(in srgb,var(--lvl) 70%,#000)}

/* ---------- weighing: one field, the answer live underneath ---------- */
.wg-head{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px}
.wg-sw{width:22px;height:22px;margin-top:4px}
.wg-titles{flex:1;min-width:0}
.wg-titles h3{margin:0 0 2px !important}
.wg-what{font-size:14.5px;font-weight:600;overflow-wrap:anywhere}
.wg-what .muted{font-weight:400}
.wg-field{display:flex;flex-direction:column;gap:8px;font-size:14px;color:var(--muted)}
.wg-input{position:relative;display:block}
.wg-input input{height:68px;font-family:var(--mono);font-size:34px;font-weight:600;text-align:center;padding:0 64px;border-radius:14px}
.wg-input input::placeholder{font-weight:400;color:var(--faint);opacity:.6}
.wg-input b{position:absolute;inset-inline-start:18px;top:50%;transform:translateY(-50%);font-size:15px;font-weight:500;color:var(--muted);pointer-events:none}
.wg-live{margin:14px 0 6px;padding:14px 16px;border-radius:14px;background:var(--surface-2);border:1px solid var(--line);min-height:84px}
.wg-num{display:flex;align-items:baseline;gap:10px}
.wg-num .wg-k{font-size:13.5px;color:var(--muted)}
.wg-num b{font-family:var(--mono);font-size:28px;font-weight:700;color:var(--lvl-ink,var(--text));margin-inline-start:auto;transition:color .2s}
.wg-num.is-prev b{font-size:20px;color:var(--muted)}
.wg-num .wg-p{font-family:var(--mono);font-size:15px;font-weight:600;color:var(--lvl-ink,var(--muted));min-width:44px;text-align:end}
.wg-live .lvl-bar{height:8px;margin-top:10px}
.wg-live .lvl-bar i{transition:width .35s var(--ease-out),background-color .2s}
.wg-live .wz-hint{margin:10px 0 0}
.wg-adv{margin-top:10px}
.wg-adv .form-grid{margin-top:2px}
.wg-flag{display:inline-block;margin-inline-start:8px;font-size:12px;font-weight:600;padding:1px 7px;border-radius:6px;color:var(--fault);background:var(--fault-bg)}
.wg-actions .btn.primary{min-width:140px}
.wg-end{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:22px;padding-top:14px;border-top:1px solid var(--line);font-size:13px;color:var(--muted)}
@media (max-width:640px){ .wg-actions .btn.primary{flex:1 1 100%;height:52px;font-size:16px} .wg-actions .btn.ghost{flex:1 1 100%} }
/* weigh mode: progress */
.wm-prog{display:flex;align-items:center;gap:12px;margin:6px 0 10px;font-size:13.5px;color:var(--muted)}
.wm-bar{flex:1;height:6px;border-radius:99px;background:var(--line);overflow:hidden}
.wm-bar i{display:block;height:100%;background:var(--ok);border-radius:inherit;transition:width .4s var(--ease-out)}
.wm-res{font-weight:700;color:var(--lvl-ink)}
.weigh-row .res{font-size:14px}

/* ---------- one primary action; the rarely used ones set apart ---------- */
.ms-foot{display:flex;gap:8px;flex-wrap:wrap;margin-top:14px;padding-top:12px;border-top:1px solid var(--line)}
.btn.quiet-warn{background:none;border-color:transparent;color:var(--fault)}
.btn.quiet-warn:hover{background:var(--fault-bg)}
.acc-out{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-top:26px;padding-top:16px;border-top:1px solid var(--line);font-size:13.5px;color:var(--muted)}
.inline-save{display:flex;gap:8px}
.inline-save input{flex:1;min-width:0}
.inline-save .btn{height:auto;align-self:stretch}
.ps-why{grid-column:1/-1;font-size:12.5px;color:var(--muted)}

/* ---------- windows: real handle, sheet geometry, copies that animate out ---------- */
.grab{display:none}
@media (max-width:640px){
  .modal::before{display:none}
  .modal .grab{display:block;position:sticky;top:-10px;z-index:2;height:24px;margin:-10px -18px 4px;background:linear-gradient(var(--surface) 60%,transparent)}
  .modal .grab::after{content:"";position:absolute;left:50%;top:9px;width:40px;height:5px;margin-left:-20px;border-radius:3px;background:var(--line-strong)}
  .modal{will-change:transform;padding-bottom:max(24px,env(safe-area-inset-bottom))}
  .dialog-card{border-radius:20px;margin:0 12px 12px;border-bottom:1px solid var(--line-strong)}
}
.ghost-overlay{pointer-events:none;z-index:999}
.ghost-overlay .modal{will-change:transform,opacity}
/* the small confirm dialog: a quick, soft entrance */
#dialogOverlay[style*="flex"] .dialog-card{animation:dlgIn .32s var(--ease-out)}
@keyframes dlgIn{from{transform:scale(.94);opacity:0}to{transform:none;opacity:1}}

/* ---------- toasts with an action ("ביטול") ---------- */
.toast{display:flex;align-items:center;gap:14px;transition:transform .32s var(--ease-out),opacity .2s}
.toast.has-action{pointer-events:auto;padding:6px 6px 6px 16px;padding-inline-start:18px}
.toast-act{height:40px;padding:0 16px;border-radius:8px;border:none;background:var(--accent-soft);color:var(--accent-text);font-weight:700;cursor:pointer;white-space:nowrap}
.toast-act:hover{filter:brightness(1.08)}
@media (max-width:640px){ .toast{bottom:calc(86px + env(safe-area-inset-bottom));max-width:calc(100vw - 24px);width:max-content} }

/* ---------- press feedback ---------- */
:is(.btn,.btn-add,.btn-line,.icon-btn,.avatar,.mtab,.cchip,.achip,.chip,.tab,.seg2 button,.filter-btn,.viewtoggle,.psum-toggle,.inv-tabs button,.menu-list button,.menu-list a,.list-row,.toast-act,.stepper button,.wz-dot,.sync){transition:transform .16s var(--ease-out),background-color .15s,border-color .15s,color .15s,filter .15s}
:is(.btn,.btn-add,.btn-line,.icon-btn,.avatar,.mtab,.cchip,.achip,.chip,.tab,.filter-btn,.viewtoggle,.psum-toggle,.inv-tabs button,.toast-act,.stepper button):active:not(:disabled){transform:scale(.96)}
:is(.menu-list button,.menu-list a,.list-row,.seg2 button):active{background:var(--surface-2)}
:is(.tile,.lg-cell,.head,.slot,.cb-card,.combo-card,.wish-card,.ms-row){transition:transform .2s var(--ease-out),box-shadow .2s,border-color .15s}
:is(.tile,.lg-cell,.head,.slot,.cb-card):active{transform:scale(.975)}
.tile:active .well{box-shadow:0 0 0 2px var(--line-strong)}

/* ---------- focus that can be seen on every control and card ---------- */
:is(.tile,.lg-cell,.head,.slot,.cb-card):focus-visible{outline:2.5px solid var(--focus);outline-offset:3px;border-radius:12px}
.tile:focus-visible{outline:none} .tile:focus-visible .well{box-shadow:0 0 0 2.5px var(--focus)}
:is(.btn,.icon-btn,.mtab,.cchip,.achip):focus-visible{outline:2.5px solid var(--focus);outline-offset:2px}

/* ---------- hit areas of at least 44px (the visible size stays) ---------- */
:is(.cchip,.achip,.chip,.mtab,.linkish,.sync,.hf-swap,.inv-tabs button,.wz-dot){position:relative}
:is(.cchip,.achip,.chip,.inv-tabs button)::after{content:"";position:absolute;inset:-6px -2px}
.linkish{min-height:44px;display:inline-flex;align-items:center}
.sync{min-height:32px;padding:6px 2px;display:inline-flex;align-items:center;gap:5px}
.sync::after{content:"";width:12px;height:12px;background:currentColor;opacity:.8;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.6M20 4v5h-5'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M20 12a8 8 0 1 1-2.3-5.6M20 4v5h-5'/%3E%3C/svg%3E") center/contain no-repeat}
.sync:empty::after{display:none}
.wz-dot{min-height:44px;justify-content:center}
.hf-swap{min-height:32px;display:inline-flex;align-items:center}
.hf-swap::after{content:"";position:absolute;inset:-6px -4px}
:is(.flags,.ps-user-body) label{min-height:44px;display:inline-flex;align-items:center;gap:8px}
.checkbox{min-height:44px}
.mini-actions .icon-btn{width:44px;height:44px}
.achip .x{width:26px;height:26px}
.stepper button{width:44px;height:44px}

/* ---------- material tabs: one row that scrolls, with fades at the edges ---------- */
html.preview .mtabs{flex-wrap:nowrap !important;overflow-x:auto !important;scroll-snap-type:x proximity;scroll-padding-inline:16px;gap:18px}
html.preview .mtab{scroll-snap-align:start;min-height:44px;padding-top:12px}
:is(.mtabs,.active-filters,.inv-tabs).fade-start{-webkit-mask-image:linear-gradient(to left,transparent,#000 36px);mask-image:linear-gradient(to left,transparent,#000 36px)}
:is(.mtabs,.active-filters,.inv-tabs).fade-end{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px);mask-image:linear-gradient(to right,transparent,#000 36px)}
:is(.mtabs,.active-filters,.inv-tabs).fade-start.fade-end{-webkit-mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent);mask-image:linear-gradient(to right,transparent,#000 36px,#000 calc(100% - 36px),transparent)}
@container (max-width: 640px){
  html.preview .mtabs{gap:8px;margin-inline:-16px;padding-inline:16px}
  html.preview .mtab{height:44px;padding:0 15px;font-size:14.5px}
  .cchip{height:44px}
  .achip{height:40px}
}

/* ---------- the compact bar at the top (computer) and the glass filter row (phone) ---------- */
.mini-bar{position:fixed;top:0;inset-inline:0;z-index:950;transform:translateY(-110%);transition:transform .34s var(--ease-out);
  background:var(--glass);-webkit-backdrop-filter:saturate(1.6) blur(18px);backdrop-filter:saturate(1.6) blur(18px);border-bottom:1px solid color-mix(in srgb,var(--line) 70%,transparent)}
.mini-bar.show{transform:none}
.mb-in{max-width:1440px;margin:0 auto;padding:8px 56px;display:flex;align-items:center;gap:14px;min-height:52px}
.mb-in b{font-size:16px;font-weight:700}
.mb-sub{font-size:13px;color:var(--muted)}
.mb-end{margin-inline-start:auto;display:flex;gap:8px}
body.modal-open .mini-bar{transform:translateY(-110%)}
.stick-sentinel{height:1px;margin-bottom:-1px}
@container (max-width: 640px){
  .controls{transition:background-color .2s,box-shadow .2s;margin-inline:-16px;padding-inline:16px}
  .controls.stuck{background:var(--glass);-webkit-backdrop-filter:saturate(1.6) blur(18px);backdrop-filter:saturate(1.6) blur(18px);box-shadow:0 1px 0 color-mix(in srgb,var(--line) 80%,transparent)}
}

/* ---------- smaller things ---------- */
/* numbers: no spinner arrows (a scale reading is typed, not clicked) */
input[type=number]{-moz-appearance:textfield;appearance:textfield}
input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{-webkit-appearance:none;margin:0}
/* nothing smaller than 12px */
.badge,.badge.count,.badge.slot,.badge.flag{font-size:12px}
@container (max-width: 640px){ .badge{font-size:12px;height:21px} }
.amt small,.pill,.lg-main .mono,.mtab i,.cchip i,.note-txt small,.member-row .who small,.tab-badge{font-size:12px}
.bell[data-badge]:not([data-badge=""])::after,#manageBtn[data-badge]:not([data-badge=""])::after{font-size:12px;min-width:19px;height:19px}
.slot .e,.slot .st{font-size:12.5px}
/* an empty extruder: a quiet, shorter card (computer) */
@container (min-width: 641px){
  .head:not([data-material]) .well.empty{aspect-ratio:auto;height:72px;margin-block:auto}
  .head:not([data-material]){background:transparent;border-style:dashed}
}
/* estimates are written out; a short legend under the shelves */
.est-note{font-size:13px;color:var(--muted);margin-top:14px}

/* ---------- accessibility settings ---------- */
@media (prefers-reduced-transparency: reduce){
  .mini-bar,.controls.stuck{background:var(--bg) !important;-webkit-backdrop-filter:none !important;backdrop-filter:none !important}
}
@media (prefers-contrast: more){
  :root, [data-theme], html.preview[data-theme="light"]{--faint:var(--muted);--line:var(--line-strong)}
  .btn,.cchip,.mtab,.tile .well,.lg-cell,.head{border-width:1.5px}
  .lvl-bar{outline:1px solid var(--line-strong)}
}
@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation:none !important;transition:none !important}
  :is(.btn,.tile,.lg-cell,.head,.slot,.cb-card,.mtab,.cchip):active{transform:none !important}
}
/* switching the theme: colours cross-fade for a moment */
html.theming, html.theming *, html.theming *::before, html.theming *::after{
  transition:background-color .35s ease,color .35s ease,border-color .35s ease,fill .35s ease,box-shadow .35s ease !important}
/* round 3 */
.wish-title{display:flex;align-items:center;gap:7px} .wish-title .sw{margin-top:0}
.mini-actions .icon-btn.del:hover{color:var(--danger);border-color:var(--danger)}
@media (max-width:640px){
  .weigh-row{grid-template-columns:14px minmax(0,1fr) 112px;row-gap:4px}
  .weigh-row .nm{overflow-wrap:anywhere}
  .weigh-row .res{grid-column:2 / -1;text-align:start}
  .weigh-row .res:empty{display:none}
  .weigh-row input{height:46px;font-size:18px}
}
/* placeholders are examples, not values: clearly lighter than typed text */
input::placeholder, textarea::placeholder{color:color-mix(in srgb,var(--faint) 62%,transparent)}

/* =====================================================================
   v5.1 (owner's notes, 2026-10-09)
   ===================================================================== */
/* no blue flash on tap (Android Chrome draws one on every tapped element) */
*{-webkit-tap-highlight-color:transparent}
/* light theme: the same soft corners as the dark one */
html.preview[data-theme="light"] .mtab{border-radius:0}
@container (max-width: 640px){ html.preview[data-theme="light"] .mtab{border-radius:999px} }
/* add-material: the label wraps only its field; the chips under it are separate buttons */
.wz-lab{display:flex;flex-direction:column;gap:7px}
.wz-field > .wz-chips{margin-top:2px}
/* the same product already exists */
.dup-box{display:flex;flex-direction:column;gap:6px;margin-top:14px;padding:12px 14px;border-radius:12px;border:1.5px solid var(--lv-orange);background:color-mix(in srgb,var(--lv-orange) 12%,var(--surface));font-size:14px}
.dup-box b{color:var(--lv-orange-ink)}
.dup-box span{color:var(--muted)}
.dup-acts{display:flex;gap:8px;flex-wrap:wrap;margin-top:4px}
/* extruder window: the material link sits under the name */
.ms-link{padding:0;margin-top:2px;font-size:14px}
/* notifications: a card at the top that doesn't block anything */
.note-banner{position:fixed;top:12px;left:50%;z-index:1500;width:min(460px,calc(100vw - 24px));display:flex;align-items:center;gap:12px;padding:12px 12px 12px 14px;
  border-radius:16px;border:1px solid var(--line-strong);background:var(--glass);-webkit-backdrop-filter:saturate(1.6) blur(18px);backdrop-filter:saturate(1.6) blur(18px);
  box-shadow:var(--shadow);transform:translate(-50%,-140%);transition:transform .38s var(--ease-out);pointer-events:none}
.note-banner.show{transform:translate(-50%,0);pointer-events:auto}
.nb-txt{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:14px}
.nb-txt span{color:var(--muted);font-size:13.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.nb-acts{display:flex;gap:6px;align-items:center}
@media (prefers-reduced-transparency: reduce){ .note-banner{background:var(--surface);-webkit-backdrop-filter:none;backdrop-filter:none} }
/* filter & sort on the phone: a half-height sheet, the list scrolls inside it, the buttons stay at the bottom */
@media (max-width:640px){
  .modal.sheet-half{max-height:62vh;display:flex;flex-direction:column;overflow:hidden;padding-bottom:0}
  .modal.sheet-half .sheet-body{overflow-y:auto;overscroll-behavior:contain;gap:16px;padding-bottom:6px;min-height:0;flex:1}
  .modal.sheet-half .sheet-foot{flex:0 0 auto;margin-top:8px;padding:10px 0 max(14px,env(safe-area-inset-bottom));background:var(--surface)}
  .modal.sheet-half .sheet-foot .btn{height:46px}
  .modal.sheet-half .fsec h4{font-size:13px}
  .modal.sheet-half .cchip{height:38px}
  .modal.sheet-half .seg2 button{height:40px}
}
html.preview[data-theme="light"] .btn.quiet-warn{background:none;border-color:transparent;color:var(--fault)}

/* =====================================================================
   v5.2 — owner's notes (2026-10-09, night)
   ===================================================================== */
/* a field that needs fixing: a short line under it, in the site's own colours */
.field-err{display:flex;align-items:center;gap:6px;font-size:13px;font-weight:500;color:var(--danger);animation:errIn .22s var(--ease-out)}
.field-err::before{content:"";width:6px;height:6px;border-radius:50%;background:currentColor;flex:0 0 auto}
input.bad,textarea.bad{border-color:var(--danger) !important;box-shadow:0 0 0 3px color-mix(in srgb,var(--danger) 16%,transparent) !important}
@keyframes errIn{from{opacity:0;transform:translateY(-3px)}to{opacity:1;transform:none}}
/* rows that scroll sideways move only sideways (their 44px hit areas made them drag up and down) */
.inv-tabs,.mtabs,.active-filters{overflow-y:hidden !important;touch-action:pan-x;overscroll-behavior-x:contain}
.inv-tabs{padding-block:5px}

/* ---------- breathing: one small thing at a time (js/motion.js decides which, and when) ---------- */
/* 1. the amount bar: a soft wave of light runs along the fill */
.lvl-bar i,html.preview .fill-bar i{position:relative;overflow:hidden}
.lvl-bar i::after,html.preview .fill-bar i::after{content:"";position:absolute;inset:0;opacity:0;pointer-events:none;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='48' height='10' viewBox='0 0 48 10' preserveAspectRatio='none'%3E%3Cpath d='M0 6 Q6 2 12 6 T24 6 T36 6 T48 6 V10 H0Z' fill='white'/%3E%3C/svg%3E") repeat-x 0 0/24px 100%}
.lvl-bar i.breathe::after,html.preview .fill-bar i.breathe::after{animation:waveRun 2.6s cubic-bezier(.45,0,.55,1) 1}
@keyframes waveRun{0%{opacity:0;background-position:0 0}25%{opacity:.24}75%{opacity:.24}100%{opacity:0;background-position:-72px 0}}
/* 2. the colour dot next to a name: a faint glow in its own colour */
.sw.breathe{animation:dotGlow 2.8s ease-in-out 1}
@keyframes dotGlow{0%,100%{box-shadow:0 0 0 1px rgba(128,128,128,.5)}50%{box-shadow:0 0 0 1px rgba(128,128,128,.35),0 0 7px 2px color-mix(in srgb,var(--sw) 55%,transparent)}}
/* 3. the main button: a small light travels once around its edge */
@property --glint{syntax:'<angle>';inherits:false;initial-value:0deg}
:is(.btn.primary,.btn-add).breathe{position:relative;isolation:isolate}
:is(.btn.primary,.btn-add).breathe::before{content:"";position:absolute;inset:-1.5px;border-radius:inherit;padding:1.5px;pointer-events:none;
  background:conic-gradient(from var(--glint),transparent 0deg,transparent 300deg,rgba(255,255,255,.75) 335deg,transparent 360deg);
  -webkit-mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);-webkit-mask-composite:xor;
  mask:linear-gradient(#000 0 0) content-box,linear-gradient(#000 0 0);mask-composite:exclude;
  animation:glint 2.4s cubic-bezier(.45,0,.55,1) 1}
@keyframes glint{0%{--glint:0deg;opacity:0}15%{opacity:1}85%{opacity:1}100%{--glint:360deg;opacity:0}}
@media (prefers-reduced-motion: reduce){ .breathe,.breathe::before,.breathe::after{animation:none !important} }
/* the printer: a bead of light flows along a loaded head's bar, toward the printer end (RTL: right → left) */
.lvl-bar i::before,html.preview .fill-bar i::before{content:"";position:absolute;top:0;bottom:0;width:38%;left:100%;opacity:0;pointer-events:none;border-radius:inherit;
  background:linear-gradient(90deg,transparent,rgba(255,255,255,.62) 55%,rgba(255,255,255,.85) 70%,transparent)}
.lvl-bar i.feed::before,html.preview .fill-bar i.feed::before{animation:feedRun 1.7s cubic-bezier(.45,.05,.4,1) 1}
@keyframes feedRun{0%{left:100%;opacity:0}18%{opacity:1}82%{opacity:1}100%{left:-38%;opacity:0}}
html[data-theme="light"] .lvl-bar i::before,html.preview[data-theme="light"] .fill-bar i::before{background:linear-gradient(90deg,transparent,rgba(255,255,255,.55) 55%,rgba(255,255,255,.75) 70%,transparent)}
@media (prefers-reduced-motion: reduce){ .feed::before{animation:none !important} }

/* =====================================================================
   v5.3 — from demo 2, the parts the owner liked (2026-10-09)
   ===================================================================== */
/* 1. colour families as dots; the name opens next to a dot while it is chosen */
.colors{display:flex;flex-wrap:nowrap;gap:6px;overflow-x:auto;scrollbar-width:none;touch-action:pan-x;overscroll-behavior-x:contain;padding-block:2px;margin-top:12px}
.colors::-webkit-scrollbar{display:none}
.dot-btn{flex:0 0 auto;display:inline-flex;align-items:center;min-height:44px;padding:0 5px;border:none;border-radius:999px;background:none;color:var(--text);cursor:pointer;transition:background-color .2s,padding .2s}
.dot-btn span{width:30px;height:30px;border-radius:50%;background:var(--fc);box-shadow:inset 0 0 0 1px rgba(128,128,128,.4),inset 0 -6px 10px rgba(0,0,0,.18);transition:transform .2s var(--ease-out)}
.dot-btn em{font-style:normal;font-weight:700;font-size:14px;max-width:0;overflow:hidden;white-space:nowrap;transition:max-width .25s var(--ease-out),margin .25s}
.dot-btn[aria-pressed="true"]{background:var(--surface-2);padding-inline:5px 12px;box-shadow:inset 0 0 0 1px var(--line-strong)}
.dot-btn[aria-pressed="true"] em{max-width:120px;margin-inline-start:8px}
.dot-btn:active span{transform:scale(.9)}
.dot-btn:disabled{opacity:.25;cursor:default}
@media (hover:hover) and (pointer:fine){ .dot-btn:not([aria-pressed="true"]):hover{background:var(--surface-2)} }
@container (max-width: 640px){ .colors{display:flex !important;margin-inline:-16px;padding-inline:16px} }

/* 2. the search: a soft pill that stays at the top while you scroll the shelves (phone) */
.search input[type=search],#searchInput{border-radius:999px;padding-inline:44px 16px;border:none;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line)}
.search{position:relative}
.search::before{content:"";position:absolute;right:16px;top:21px;width:16px;height:16px;transform:translateY(-50%);pointer-events:none;z-index:1;opacity:.6;background:currentColor;
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat;
  mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E") center/contain no-repeat}
@container (max-width: 640px){
  /* the search row floats on its own (sticky inside the whole inventory section) */
  .controls,.controls.stuck{display:contents}
  .search{position:sticky;top:10px;z-index:6}
  .search::before{top:23px}
  #searchInput{min-height:48px;background:color-mix(in srgb,var(--surface) 86%,transparent);-webkit-backdrop-filter:saturate(1.5) blur(14px);backdrop-filter:saturate(1.5) blur(14px);box-shadow:inset 0 0 0 1px var(--line),0 8px 24px -14px rgba(0,0,0,.45)}
}
@media (prefers-reduced-transparency: reduce){ #searchInput{background:var(--surface) !important} }

/* 3. phone: a bar at the bottom instead of the menu button and the floating "+" */
.tabbar{display:none}
@container (max-width: 640px){
  .menu-btn,.fab{display:none !important}
  .wrap{padding-bottom:120px}
  .tabbar{position:fixed;bottom:0;inset-inline:0;z-index:900;display:grid;grid-template-columns:repeat(5,1fr);align-items:center;
    padding:6px 8px calc(6px + env(safe-area-inset-bottom));background:var(--glass);-webkit-backdrop-filter:saturate(1.6) blur(20px);backdrop-filter:saturate(1.6) blur(20px);
    border-top:1px solid color-mix(in srgb,var(--line) 80%,transparent);transition:transform .3s var(--ease-out)}
  .tabbar button{display:flex;flex-direction:column;align-items:center;gap:2px;min-height:52px;border:none;background:none;color:var(--muted);font-size:12px;font-weight:700;cursor:pointer;transition:transform .16s var(--ease-out),color .15s}
  .tabbar button:active{transform:scale(.92)}
  .tabbar button[aria-current]{color:var(--text)}
  .tabbar .tab-add{justify-self:center;width:54px;height:54px;min-height:0;margin-top:-22px;border-radius:50%;background:var(--accent);color:var(--on-accent);box-shadow:0 10px 24px -8px rgba(0,0,0,.45)}
  body.modal-open .tabbar{transform:translateY(110%)}
  .toast{bottom:calc(84px + env(safe-area-inset-bottom)) !important}
}
@media (prefers-reduced-transparency: reduce){ .tabbar{background:var(--surface) !important} }
@container (max-width: 640px){ html.preview #matTabs{margin-top:10px} }

/* v5.4 (2026-10-09): the "+" sits in the middle of its circle; shelves/ledger switch back outside the filter sheet */
.tabbar .tab-add{justify-content:center;gap:0;padding:0}
.tabbar .tab-add svg{display:block}
.vseg{display:none}
@container (max-width: 640px){
  .vseg{display:inline-grid;grid-template-columns:1fr 1fr;margin-top:12px;padding:4px;border-radius:999px;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line)}
  .vseg button{min-height:36px;padding:0 18px;border:none;border-radius:999px;background:none;color:var(--muted);font-weight:700;font-size:14px;cursor:pointer}
  .vseg button[aria-pressed="true"]{background:var(--surface-2);color:var(--text);box-shadow:inset 0 0 0 1px var(--line-strong)}
}

/* the head's top line wraps instead of pushing "טען"/"החלף" out of the card (narrow windows, 2026-10-16) */
html.preview .head-top{flex-wrap:wrap;row-gap:6px;min-width:0}
html.preview .head-top .top-tag{flex-wrap:wrap;justify-content:flex-end;max-width:100%;min-width:0}
html.preview .head-top .hf-swap{margin:-3px 0}

/* =====================================================================
   v6 (2026-10-16) — demo 2's look on demo 1, owner's choice:
   demo 2's fonts (Rubik for names and titles, Assistant for text, JetBrains Mono for numbers),
   its colours (graphite / paper, one signal-orange accent), its desktop bar (text links, one
   theme button, bell, avatar, orange "חומר חדש") and its phone tab bar. The printer stays demo 1's.
   ===================================================================== */
html.preview, html.preview[data-theme]{
  --font:'Assistant', system-ui, sans-serif;
  --glass:color-mix(in srgb,var(--bg) 80%,transparent);
  --display:'Rubik', 'Assistant', system-ui, sans-serif;
  --mono:'JetBrains Mono', ui-monospace, monospace;
  --ease-out:cubic-bezier(.23,1,.32,1);
}
html.preview.palette-x, html.preview.palette-x[data-theme="dark"]{
  color-scheme:dark;
  --bg:#0D0F12; --surface:#15181D; --surface-2:#1C2027; --well:#1C2027; --field:#15181D;
  --line:#23272E; --line-strong:#343A43; --shelf:#2A2F37;
  --text:#ECEFF3; --muted:#9CA3AF; --faint:#8A919C;
  --accent:#FF6B3D; --accent-text:#FF8A63; --on-accent:#140803; --accent-soft:rgba(255,107,61,.14);
  --fault:#FF6B6B; --fault-bg:rgba(255,107,107,.13); --fault-line:rgba(255,107,107,.38);
  --danger:#FF6B6B; --danger-bg:rgba(255,107,107,.13);
  --ok:#4ADE80; --ok-bg:rgba(74,222,128,.12);
  --unknown:#7AB5FF; --unknown-line:rgba(91,164,255,.45); --unknown-bg:rgba(91,164,255,.08);
  --plan:#8FB4FF; --plan-bg:rgba(143,180,255,.13);
  --chip:#0A0C0F; --chip-text:#ECEFF3; --amt-bg:#252A32;
  --scrim:rgba(3,4,6,.62); --shadow:0 24px 60px -24px rgba(0,0,0,.85); --glass:rgba(17,19,23,.76);
  --bed:#252A32; --layer-2:#FF6B3D; --focus:#ECEFF3; --low-edge:#FF6B6B;
}
html.preview.palette-x[data-theme="light"]{
  color-scheme:light;
  --font:'Assistant', system-ui, sans-serif;
  --bg:#F2F1EE; --surface:#FFFFFF; --surface-2:#F4F3F0; --well:#F4F3F0; --field:#FFFFFF;
  --line:#E4E2DD; --line-strong:#CFCCC5; --shelf:#DDDAD4;
  --text:#121418; --muted:#5B616B; --faint:#636973;
  --accent:#E4501F; --accent-text:#C8441A; --on-accent:#FFFFFF; --accent-soft:rgba(228,80,31,.1);
  --fault:#C8321F; --fault-bg:#FBE3DE; --fault-line:rgba(200,50,31,.4);
  --danger:#C8321F; --danger-bg:#FBE3DE;
  --ok:#15803D; --ok-bg:#E3F2E8;
  --unknown:#2563C9; --unknown-line:rgba(37,99,201,.4); --unknown-bg:#E8EEF8;
  --plan:#3E5F96; --plan-bg:#E3E9F3;
  --chip:#121418; --chip-text:#FFFFFF; --amt-bg:#FFFFFF;
  --scrim:rgba(20,22,26,.34); --shadow:0 22px 50px -26px rgba(30,34,40,.35); --glass:rgba(255,255,255,.8);
  --bed:#DDDAD4; --layer-2:#E4501F; --focus:#121418; --low-edge:#C8321F;
}
html.preview body{font-family:var(--font);font-size:15.5px}
html.preview :is(h1,h2,h3,.inv-title,.sec-head h2,.shelf-head h3,.lg-head h3,.modal h3,.ms-head h3,.wz-title){font-family:var(--display);letter-spacing:-.01em}
html.preview :is(.tile .nm,.tile b,.head .who b,.lg-main b,.cb-txt b,.wish-card b){font-family:var(--display);font-weight:600}
html.preview :is(.num,.amt,.mono){font-family:var(--mono)}
/* the light theme loses its paper header band and olive buttons: one look, two palettes */
html.preview[data-theme="light"] header.top{background:none;box-shadow:none;clip-path:none;padding-bottom:0}
html.preview[data-theme="light"] header.top::after{display:none}
html.preview[data-theme="light"] :is(h1,h2,h3,.sec-head h2,.shelf-head h3,.lg-head h3,.inv-select){font-weight:700}

/* ---------- the header: hello line, a big name, then demo 2's bar ---------- */
html.preview header.top{flex-wrap:wrap;align-items:flex-end;row-gap:14px}
html.preview .inv-hello{font-size:13px;font-weight:600;letter-spacing:.02em;color:var(--muted)}
html.preview .inv-title{font-weight:800;font-size:clamp(30px,4.4vw,52px);line-height:1.02;letter-spacing:-.025em;margin:4px 0 8px}
html.preview .inv-sub{font-size:14px}
html.preview .nav{flex-wrap:wrap;justify-content:flex-end;gap:6px;margin-inline-start:auto}
html.preview .nav .nl{display:inline-flex;align-items:center;min-height:44px;padding:0 14px;border-radius:999px;font-weight:600;font-size:15px;color:var(--muted);transition:background-color .15s,color .15s}
html.preview .nav .nl:hover{background:var(--surface);color:var(--text)}
html.preview .nav .theme{display:none}
html.preview .theme-mini{display:flex}
html.preview .menu-btn{display:none}
html.preview :is(.icon-btn,.theme-mini,.nav .bell){width:44px;height:44px;border-radius:50%;border:none;background:var(--surface-2);transition:transform .16s var(--ease-out),background-color .18s}
html.preview :is(.icon-btn,.theme-mini):hover{background:var(--surface)}
html.preview :is(.icon-btn,.theme-mini):active{transform:scale(.94)}
html.preview .avatar{width:44px;height:44px;border-radius:14px;border:none;background:var(--surface-2);color:var(--text);font-weight:800;font-size:17px}
html.preview .btn-add{height:44px;padding:0 20px;border-radius:999px;background:var(--accent);color:var(--on-accent);font-weight:700}
html.preview[data-theme="light"] .btn-add{background:var(--accent);color:var(--on-accent)}
html.preview .demo-strip{border:none;border-radius:14px;background:var(--accent-soft)}
html.preview .demo-strip b{color:var(--accent)}
/* from 641px up the links stay visible (they wrap under the name when space runs out) */
@container (max-width: 1180px){ html.preview .nav .nl{display:inline-flex} html.preview .menu-btn{display:none} }
@container (max-width: 860px){ html.preview .nav .nl{padding:0 10px;font-size:14.5px} }
@container (max-width: 640px){
  html.preview .nav .nl{display:none}
  html.preview .inv-title{font-size:32px}
}

/* ---------- buttons, cards and sheets in demo 2's shapes ---------- */
html.preview .btn{border-radius:999px;border:none;background:var(--surface-2);color:var(--text);font-weight:600}
html.preview .btn:hover{background:var(--line)}
html.preview :is(.btn.accent,.btn.primary,.btn.teal,.btn.blue){background:var(--accent);color:var(--on-accent)}
html.preview[data-theme="light"] :is(.btn:not(.primary):not(.danger):not(.accent):not(.empty-btn),.btn-line,.filter-btn,.viewtoggle){background:var(--surface-2);border-color:transparent}
html.preview :is(.head,.todo,.psum,.combo-card,.wish-card,.cb-card,.lg-cell){border-radius:20px}
html.preview .modal{border-radius:28px;border:none}
html.preview :is(.filter-btn,.viewtoggle){border-radius:999px}

/* ---------- phone: demo 2's tab bar ---------- */
@container (max-width: 640px){
  html.preview .tabbar{background:var(--glass);border-top:1px solid var(--line)}
  html.preview .tabbar button{font-size:11.5px}
  html.preview .tabbar .tab-add{justify-content:center;gap:0;padding:0;background:var(--accent);color:var(--on-accent);box-shadow:0 10px 24px -8px color-mix(in srgb,var(--accent) 60%,transparent)}
}
/* phone: theme + bell sit beside the name, as in demo 2, not on a row of their own */
@container (max-width: 640px){
  html.preview header.top{align-items:flex-start}
  html.preview .inv{flex:1 1 200px}
  html.preview .nav{flex:0 0 auto;flex-wrap:nowrap;margin-top:22px}
}
/* narrower desktop heads: the amount stays on one line ("נותר בגליל" drops first) */
@container (max-width: 1100px){
  html.preview .head .fill-top span{display:none}
  html.preview .head .fill-top{justify-content:flex-start}
}
html.preview .head .fill-top b{white-space:nowrap}

/* v6.1 (2026-10-16): demo 2's header on the real site too — numbers as pills, inventory switch as pills */
html.preview .inv-sub{display:flex;flex-wrap:wrap;align-items:center;gap:6px}
html.preview .stats{display:contents}
html.preview .stat{display:inline-flex;align-items:baseline;gap:5px;padding:4px 11px;border-radius:999px;background:var(--surface);color:var(--muted);font-size:14px;white-space:nowrap}
html.preview .stat b{color:var(--text);font-weight:600}
html.preview .inv-sub .sync{margin-inline-start:4px;font-size:12.5px}
html.preview .inv-tabs{gap:6px}
html.preview .inv-tabs .lbl{display:none}
html.preview .inv-tabs button{height:40px;padding:0 16px;border-radius:999px;border:1px solid var(--line-strong);background:none;color:var(--muted)}
html.preview .inv-tabs button[aria-pressed="true"],html.preview[data-theme="light"] .inv-tabs button[aria-pressed="true"]{background:var(--text);color:var(--bg);border-color:var(--text)}

/* v6.2 (2026-10-16, owner): one side for the grams — always the left corner of the photo, Hebrew or numbers */
html.preview .well .amt{inset-inline-start:auto;inset-inline-end:auto;left:9px;right:auto}
@container (max-width: 640px){ html.preview .well .amt{left:5px} }
/* an empty head is just its frame: no small dashed box, no "אין גליל" (the phone row keeps the space so names line up) */
html.preview .head .well.void{display:none}
@container (max-width: 640px){ html.preview .head .well.void{display:block;visibility:hidden} }

/* "גלילים" in the phone bar lands the first shelf just under the floating search */
@container (max-width: 640px){ html.preview #grid :is(.shelf,.lg-cell,.tile){scroll-margin-top:78px} }

/* =====================================================================
   v6.3 (2026-10-16) — empty head, product sheet from demo 2, the combination board
   ===================================================================== */
/* an empty head: "ריק" and the fault text sit in the middle of the frame */
html.preview .head.is-empty .who{margin-top:auto;text-align:center}
html.preview .head.is-empty .why{margin-bottom:auto;text-align:center}
html.preview .head.is-empty .who:last-of-type{margin-bottom:auto}
html.preview .head.is-empty:not(:has(.why)) .who{margin-bottom:auto}

/* the product sheet */
.modal.ms-box{max-width:620px}
.ms-box .hero{position:relative;display:grid;grid-template-columns:auto minmax(0,1fr);align-items:center;gap:22px;margin:-22px -22px 18px;padding:26px 22px 22px;
  border-radius:inherit;border-bottom-left-radius:0;border-bottom-right-radius:0;background:linear-gradient(180deg,color-mix(in srgb,var(--c) 16%,var(--surface)),var(--surface))}
.ms-box .hero .ms-close{position:absolute;top:16px;inset-inline-end:16px;width:44px;height:44px;border-radius:50%;border:none;background:color-mix(in srgb,var(--surface) 70%,transparent)}
.ph{position:relative;display:block;aspect-ratio:1;border-radius:22px;overflow:hidden;
  background:radial-gradient(120% 90% at 50% 35%,color-mix(in srgb,var(--c) 14%,var(--surface-2)),color-mix(in srgb,var(--c) 5%,var(--surface-2)))}
.ph .well{position:absolute;inset:0;border-radius:0;background:none}
.ph .well img{width:100%;height:100%;padding:9%;object-fit:contain;filter:drop-shadow(0 10px 12px rgba(0,0,0,.28))}
.ph .well.nophoto{background:radial-gradient(circle,var(--surface-2) 0 11%,var(--sw) 11.5% 36%,transparent 36.5%)}
.ph.xl{width:148px;box-shadow:0 18px 34px -20px rgba(0,0,0,.6)}
.hero-id{min-width:0;padding-inline-end:40px}
.hero-eyebrow{margin:0;font-size:13px;font-weight:600;color:var(--muted)}
.hero-id h2{font-family:var(--display,inherit);font-weight:800;font-size:clamp(26px,3.6vw,34px);line-height:1.05;letter-spacing:-.015em;margin:6px 0 8px;overflow-wrap:anywhere}
.hero-amt{margin:0;font-size:22px;font-weight:600;color:var(--lvl-ink,var(--text))}
.hero-amt .u{font-size:13px;font-weight:500;color:var(--muted)}
.hero-amt small{font-size:14px;font-weight:500;color:var(--muted)}
.lvx{position:relative;display:block;height:5px;border-radius:3px;background:color-mix(in srgb,var(--text) 10%,transparent);overflow:hidden}
.lvx i{position:absolute;inset-block:0;inset-inline-start:0;border-radius:inherit;background:var(--lvl,var(--muted));transition:width .5s var(--ease-out)}
.lvx.lv-unknown i{background:repeating-linear-gradient(-45deg,var(--lv-unknown) 0 4px,transparent 4px 8px);opacity:.6}
.hero-lvl{margin-top:10px;max-width:240px;height:6px}
.ms-box .facts{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:1px;margin:0 0 18px;border-radius:14px;overflow:hidden;background:var(--line)}
.ms-box .facts div{padding:12px 14px;background:var(--surface-2)}
.ms-box .facts dt{font-size:12.5px;font-weight:700;color:var(--muted);margin-bottom:2px}
.ms-box .facts dd{margin:0;font-size:15.5px;font-weight:600;display:flex;align-items:center;gap:6px}
.ms-box .note{margin:0 0 18px}
.ms-box .sh-sec h4{font-size:15px;font-weight:800;margin:0 0 8px}
.ms-box .sh-sec h4 .muted{font-weight:500}
.rolls{list-style:none;margin:0;padding:0;display:flex;flex-direction:column}
.roll{display:grid;grid-template-columns:34px minmax(0,1fr) auto;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--line)}
.roll-n{width:30px;height:30px;display:grid;place-items:center;border-radius:9px;background:var(--surface-2);font-size:13px;font-weight:600}
.roll-txt{display:flex;flex-direction:column;gap:3px;min-width:0}
.roll-txt b{font-size:15.5px}
.roll-txt small{font-size:13px;color:var(--muted)}
.roll-txt .lvx{max-width:200px;margin-top:3px}
.roll-acts{display:flex;align-items:center;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.txt-danger{min-height:36px;padding:0 6px;border:none;background:none;color:var(--danger);font-weight:600;font-size:14px;cursor:pointer}
.ms-box .sh-actions{display:flex;flex-wrap:wrap;gap:10px;margin-top:22px;padding-top:18px;border-top:1px solid var(--line);align-items:center}
.ms-box .sh-actions .spacer{flex:1}
.ms-box .sh-actions .btn,.ms-box .roll-acts .btn{border-radius:999px}
.ms-box .sh-actions .btn{height:46px;padding:0 20px;font-weight:700;gap:8px}
.ms-box .sh-actions .btn.accent{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.ms-box .btn.ghost{background:transparent;border:1px solid var(--line-strong);color:var(--text)}
.ms-box .dz-btn{color:var(--danger) !important;border-color:color-mix(in srgb,var(--danger) 45%,var(--line-strong)) !important}
.ms-box .dz-btn[aria-expanded="true"]{background:var(--danger-bg) !important}
.dz-box{margin-top:14px;padding:14px 16px;border-radius:14px;background:var(--danger-bg)}
.dz-box p{margin:0 0 10px}
.dz-row{display:flex;flex-wrap:wrap;gap:8px}
.btn.quiet-danger{background:transparent;color:var(--danger);border:1px solid color-mix(in srgb,var(--danger) 40%,transparent)}
@media (max-width: 640px){
  .ms-box .hero{margin:-10px -18px 18px;padding:34px 18px 20px;gap:16px}
  .ph.xl{width:104px;border-radius:20px}
  .hero-id h2{font-size:26px}
  .roll{grid-template-columns:30px minmax(0,1fr)}
  .roll-acts{grid-column:1/-1;justify-content:flex-start;padding-inline-start:42px}
  .ms-box .sh-actions .spacer{display:none}
  .ms-box .sh-actions > .btn{flex:1 1 auto}
  .ms-box .sh-actions > .btn.accent{flex-basis:100%}
}

/* the combination board: tray, heads, "in hand" */
.modal.cl-box{max-width:780px}
.cl-top{display:flex;align-items:center;gap:12px;margin:10px 0 14px}
.cl-mode{width:260px;max-width:100%}
.cl-mats{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px}
.cl-mat{display:inline-flex;align-items:center;gap:10px;min-height:52px;padding:6px 14px 6px 10px;padding-inline:10px 16px;border-radius:999px;border:1px solid var(--line);background:var(--surface-2);color:var(--text);cursor:pointer;
  transition:transform .18s var(--ease-out),box-shadow .2s,opacity .2s,border-color .15s}
.cl-mat:active:not(:disabled){transform:scale(.97)}
.cl-sw{width:30px;height:30px;border-radius:50%;background:var(--c);box-shadow:inset 0 0 0 1px rgba(128,128,128,.4),inset 0 -5px 8px rgba(0,0,0,.18)}
.cl-mt{display:flex;flex-direction:column;text-align:start;line-height:1.2}
.cl-mt b{font-family:var(--display,inherit);font-weight:600}
.cl-mt small{color:var(--muted);font-size:12.5px}
.cl-mat.placed{opacity:.55}
.cl-mat[aria-pressed="true"]{opacity:1;border-color:var(--accent);box-shadow:0 0 0 3px var(--accent-soft),0 12px 24px -12px rgba(0,0,0,.6);transform:translateY(-3px)}
.cl-mat:disabled{opacity:.35;cursor:default}
.cl-heads{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:10px}
.cl-head{position:relative;display:flex;flex-direction:column;align-items:center;gap:6px;min-height:168px;padding:12px 8px 10px;border-radius:18px;border:1.5px solid var(--line);background:var(--surface-2);color:var(--text);cursor:pointer;
  transition:transform .18s var(--ease-out),border-color .15s,background-color .2s}
.cl-head:active:not(:disabled){transform:scale(.97)}
.cl-e{font:700 16px var(--mono);color:var(--muted)}
.cl-place{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;min-width:0;max-width:100%}
.cl-big{width:42px;height:42px;border-radius:50%;background:var(--c);box-shadow:inset 0 0 0 1px rgba(128,128,128,.4),inset 0 -6px 10px rgba(0,0,0,.2)}
.cl-place b{font-family:var(--display,inherit);font-weight:600;font-size:14px;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cl-free{font-size:13px;color:var(--faint)}
.cl-tag{font-style:normal;font-size:11.5px;font-weight:700;padding:1px 8px;border-radius:999px;background:var(--surface);color:var(--muted);box-shadow:inset 0 0 0 1px var(--line-strong)}
.cl-why{min-height:16px;font-size:11.5px;color:var(--muted);text-align:center;line-height:1.3}
.cl-now{display:flex;flex-direction:column;align-items:center;gap:4px;width:100%;font-size:11.5px;color:var(--faint)}
.cl-now span{max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cl-bar{display:block;width:70%;height:4px;border-radius:2px;background:var(--cur);box-shadow:0 0 0 1px var(--line)}
.cl-head.assigned{border-color:color-mix(in srgb,var(--c) 70%,var(--line-strong));background:color-mix(in srgb,var(--c) 9%,var(--surface-2))}
.cl-head.suggested{border-style:dashed}
.cl-head.ready{border-style:dashed;border-color:var(--accent)}
.cl-head.ready .cl-free{color:var(--accent-text,var(--accent));font-weight:700}
.cl-head.fault{opacity:.5;cursor:default}
.cl-bad{color:var(--danger);font-size:13px;font-weight:600}
.cl-head.flash .cl-big{animation:clIn .32s var(--ease-out)}
@keyframes clIn{from{transform:scale(.85);opacity:.4}to{transform:none;opacity:1}}
.cl-hand{display:flex;align-items:center;flex-wrap:wrap;gap:6px;min-height:48px;margin-top:14px;padding:8px 14px;border-radius:14px;background:var(--surface-2);font-size:14.5px}
.cl-hand b{font-family:var(--display,inherit)}
.cl-hand .linkish{margin-inline-start:auto}
.cl-hsw{width:18px;height:18px;border-radius:50%;background:var(--c);box-shadow:0 0 0 1px rgba(128,128,128,.45)}
.cl-acts{align-items:center;margin-top:16px}
.cl-acts .btn{border-radius:999px;height:46px;padding:0 20px;font-weight:700}
.cl-acts .btn.accent{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.cl-acts .btn:disabled{opacity:.45}
@media (hover:hover) and (pointer:fine){ .cl-head:not(:disabled):hover{border-color:var(--line-strong)} .cl-head.ready:hover{background:var(--accent-soft)} }
@media (prefers-reduced-motion: reduce){ .cl-head.flash .cl-big{animation:none} .cl-mat[aria-pressed="true"]{transform:none} }
@media (max-width: 640px){
  .cl-mats{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none;padding:4px 2px 6px;margin-inline:-2px}
  .cl-mat{flex:0 0 auto}
  .cl-heads{gap:6px}
  .cl-head{min-height:150px;padding:10px 4px 8px;border-radius:14px}
  .cl-big{width:32px;height:32px}
  .cl-place b{font-size:12px}
  .cl-why{display:none}
  .cl-acts{flex-wrap:wrap}
  .cl-acts .btn{flex:1 1 auto}
  .cl-acts #clSum{flex:1 1 100%}
}
.cl-top #clReset{white-space:nowrap;flex:0 0 auto}
@media (max-width: 640px){ .cl-mode{width:auto;flex:1 1 auto} }
html.preview .ms-box .ms-list .btn{border-radius:999px !important;background:var(--surface) !important;border:1px solid var(--line-strong) !important;color:var(--text) !important;font-weight:600}
/* demo strip */
.demo-strip{order:-1;flex:1 1 100%;display:flex;flex-wrap:wrap;align-items:center;gap:4px 12px;padding:6px 14px;border-radius:10px;border:1px dashed var(--accent);background:var(--accent-soft);font-size:13.5px;color:var(--text)}
.demo-strip b{color:var(--accent-text)} .demo-strip span{color:var(--muted);flex:1 1 260px}
/* combo → printer, round 2 (2026-10-17): what is on each head now is always visible, then what it becomes */
.cl-lbl{margin:0 0 8px;font-size:13px;font-weight:700;color:var(--text)}
.cl-lbl .muted{font-weight:400}
.cl-head{gap:4px;min-height:184px}
.cl-cur{display:flex;flex-direction:column;align-items:center;gap:3px;width:100%;padding:6px 4px 8px;border-radius:12px;background:var(--surface);box-shadow:inset 0 0 0 1px var(--line)}
.cl-cur small{font-size:11px;font-weight:700;color:var(--muted);letter-spacing:.02em}
.cl-cs{width:26px;height:26px;border-radius:50%;background:var(--cur);box-shadow:inset 0 0 0 1px rgba(128,128,128,.45),inset 0 -4px 7px rgba(0,0,0,.18)}
.cl-cur.none .cl-cs{background:none;box-shadow:inset 0 0 0 1.5px var(--line-strong);border:0}
.cl-cur b{font-size:12.5px;font-weight:600;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cl-cur.none b{color:var(--faint);font-weight:400}
.cl-to{min-height:16px;font-size:11.5px;font-weight:700;color:var(--muted)}
.cl-head.assigned .cl-to{color:var(--accent-text,var(--accent))}
.cl-keep{display:inline-flex;align-items:center;justify-content:center;width:34px;height:34px;border-radius:50%;background:var(--ok-bg,rgba(143,174,150,.15));color:var(--ok,#5d8a63);font-weight:800;font-size:17px}
.cl-done-msg{color:var(--ok,#5d8a63)}
.cl-acts .btn.cl-act{height:auto;min-height:52px;padding:7px 18px;flex-direction:column;align-items:flex-start;gap:1px;line-height:1.25;border-radius:16px;text-align:start}
.cl-act b{font-size:14.5px}
.cl-act small{font-size:12px;font-weight:500;opacity:.85}
@media (max-width: 640px){
  .cl-head{min-height:170px}
  .cl-cur{padding:5px 2px 6px}
  .cl-cs{width:22px;height:22px}
  .cl-cur b{font-size:11px}
  .cl-acts .btn.cl-act{flex:1 1 100%}
}
/* on/off switches (2026-10-17): inventory add-ons, user flags */
.mi-feats{margin:14px 0 4px;padding:12px 14px;border-radius:14px;background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--line)}
.mi-feats h5{margin:0 0 6px;font-size:13px;color:var(--muted);font-weight:700}
.switch-row{display:flex;align-items:center;gap:14px;min-height:52px;cursor:pointer}
.switch-row > span{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.switch-row b{font-weight:600;font-size:14.5px}
.switch-row small{color:var(--muted);font-size:12.5px;line-height:1.45}
input[type=checkbox][role=switch]{appearance:none;-webkit-appearance:none;flex:0 0 auto;width:46px;height:28px;margin:0;border-radius:999px;background:var(--line-strong);position:relative;cursor:pointer;transition:background .2s var(--ease-out,ease)}
input[type=checkbox][role=switch]::after{content:'';position:absolute;top:3px;inset-inline-start:3px;width:22px;height:22px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.3);transition:transform .22s var(--ease-out,ease)}
input[type=checkbox][role=switch]:checked{background:var(--ok)}
input[type=checkbox][role=switch]:checked::after{transform:translateX(-18px)}
[dir=ltr] input[type=checkbox][role=switch]:checked::after{transform:translateX(18px)}
input[type=checkbox][role=switch]:disabled{opacity:.45;cursor:default}
input[type=checkbox][role=switch]:focus-visible{outline:2px solid var(--focus,var(--accent));outline-offset:2px}
@media (prefers-reduced-motion: reduce){ input[type=checkbox][role=switch], input[type=checkbox][role=switch]::after{transition:none} }
.ps-name{display:flex;gap:8px;align-items:center;margin-bottom:6px}
.ps-name input{flex:1;min-width:0}

/* =====================================================================
   Demo 1 — the new "ניהול" (manage2.js, 2026-10-17)
   Settings-style grouped lists, drill-down screens, switches. One thing moves at a time: the
   screen that slides in (or out). Press feedback on every row.
   ===================================================================== */
.modal.mx-box{max-width:620px;padding:0;overflow:hidden;display:flex;flex-direction:column;max-height:min(88vh,860px)}
.mx{display:flex;flex-direction:column;min-height:0;flex:1}
.mx-bar{position:relative;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;min-height:60px;padding:8px 12px;border-bottom:1px solid var(--line);
  background:color-mix(in srgb,var(--surface) 82%,transparent);backdrop-filter:blur(18px) saturate(160%);-webkit-backdrop-filter:blur(18px) saturate(160%);z-index:2}
.mx-title{grid-column:2;margin:0;font-size:16.5px;font-weight:700;text-align:center;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:56vw;text-wrap:balance}
.mx-bar .icon-btn{grid-column:3;justify-self:end}
.mx-back{grid-column:1;justify-self:start;display:inline-flex;align-items:center;gap:2px;min-height:44px;max-width:100%;padding:0 6px 0 10px;border:0;background:none;color:var(--accent-text,var(--accent));font:inherit;font-size:15px;font-weight:600;cursor:pointer;border-radius:12px;touch-action:manipulation}
.mx-back span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:26vw}
.mx-back:active{opacity:.6}
.mx-stage{position:relative;flex:1;min-height:0;overflow:hidden}
.mx-scr{position:absolute;inset:0;overflow-y:auto;overscroll-behavior:contain;padding:14px 16px 28px;
  transition:transform .32s cubic-bezier(.32,.72,0,1),opacity .24s ease-out;will-change:transform}
.mx-scr.on{position:relative;inset:auto;height:100%;transform:none;opacity:1}
.mx-scr.from-l{transform:translateX(-36%);opacity:0}
.mx-scr.from-r{transform:translateX(36%);opacity:0}
.mx-scr.to-r{transform:translateX(30%);opacity:0;pointer-events:none}
.mx-scr.to-l{transform:translateX(-30%);opacity:0;pointer-events:none}
@media (prefers-reduced-motion: reduce){ .mx-scr{transition:opacity .15s ease} .mx-scr.from-l,.mx-scr.from-r,.mx-scr.to-l,.mx-scr.to-r{transform:none} }
.mx-loading{padding:40px;text-align:center;color:var(--muted)}

.mx-grp{margin:0 0 22px}
.mx-gh{display:flex;align-items:center;gap:8px;margin:0 6px 8px;font-size:13px;font-weight:700;color:var(--muted)}
.mx-count{font:600 12px var(--mono,ui-monospace);color:var(--faint);font-variant-numeric:tabular-nums}
.mx-badge{min-width:22px;height:22px;padding:0 7px;border-radius:99px;background:var(--danger);color:#fff;font-size:12px;display:inline-flex;align-items:center;justify-content:center;font-variant-numeric:tabular-nums}
.mx-list{border-radius:16px;background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--line);overflow:hidden}
.mx-foot{margin:8px 8px 0;font-size:12.5px;line-height:1.5;color:var(--muted)}
.mx-row{position:relative;display:flex;align-items:center;gap:12px;width:100%;min-height:56px;padding:9px 14px;border:0;background:none;color:var(--text);font:inherit;text-align:start;text-decoration:none;cursor:pointer;
  touch-action:manipulation;-webkit-tap-highlight-color:transparent;transition:background-color .12s ease}
.mx-row + .mx-row, .mx-list > * + *{box-shadow:inset 0 1px 0 var(--line)}
.mx-row:active:not(.ro):not(.mx-sw){background:color-mix(in srgb,var(--text) 7%,transparent)}
.mx-row:focus-visible{outline:2px solid var(--focus,var(--accent));outline-offset:-2px;border-radius:16px}
@media (hover:hover) and (pointer:fine){ .mx-row:not(.ro):not(.mx-sw):hover{background:color-mix(in srgb,var(--text) 4%,transparent)} }
.mx-row.ro{cursor:default}
.mx-row[hidden]{display:none}
.mx-txt{flex:1;display:flex;flex-direction:column;gap:2px;min-width:0}
.mx-txt b{font-weight:600;font-size:15px;line-height:1.3;overflow-wrap:anywhere}
.mx-txt small{font-size:12.5px;line-height:1.45;color:var(--muted);overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.mx-val{flex:0 1 auto;max-width:45%;font-size:14px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mx-row.ro .mx-val{color:var(--faint)}
.mx-faint{color:var(--faint)}
.mx-chev{flex:0 0 auto;color:var(--faint)}
.mx-me{display:inline-block;margin-inline-start:6px;padding:0 7px;border-radius:99px;font-size:11.5px;font-weight:600;color:var(--muted);background:var(--surface);box-shadow:inset 0 0 0 1px var(--line);vertical-align:2px}
.mx-ic{flex:0 0 auto;width:34px;height:34px;border-radius:10px;display:inline-flex;align-items:center;justify-content:center;background:var(--surface);color:var(--muted);box-shadow:inset 0 0 0 1px var(--line)}
.mx-add{color:var(--accent-text,var(--accent))}
.mx-add .mx-ic{background:var(--accent-soft);color:var(--accent-text,var(--accent));box-shadow:none}
.mx-add .mx-txt b{font-weight:700}
.mx-av{flex:0 0 auto;width:36px;height:36px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-weight:700;font-size:15px;
  color:hsl(var(--h) 45% 26%);background:hsl(var(--h) 55% 86%)}
[data-theme="dark"] .mx-av{color:hsl(var(--h) 60% 86%);background:hsl(var(--h) 30% 26%)}
.mx-av.big{width:64px;height:64px;font-size:26px}
.mx-hero{display:flex;align-items:center;gap:14px;margin:4px 6px 22px}
.mx-hero h2{margin:0;font-size:22px;line-height:1.2;letter-spacing:-.01em;overflow-wrap:anywhere}
.mx-hero p{margin:2px 0 0;color:var(--muted);font-size:13.5px;text-align:start}
.mx-hero .mx-note{color:var(--warn,var(--muted));font-size:12.5px}

/* waiting requests: the only coloured block, at the top */
.mx-wait .mx-list{box-shadow:inset 0 0 0 1.5px color-mix(in srgb,var(--accent) 45%,var(--line));background:color-mix(in srgb,var(--accent-soft) 60%,var(--surface-2))}
.mx-req{display:flex;align-items:center;gap:10px;min-height:60px;padding:9px 14px;flex-wrap:wrap}
.mx-req code{font:600 12.5px var(--mono,ui-monospace)}
.mx-req-acts{display:flex;gap:6px}
.mx-pill{min-height:40px;padding:0 15px;border-radius:99px;border:1px solid var(--line-strong);background:var(--surface);color:var(--text);font:inherit;font-size:14px;font-weight:600;cursor:pointer;touch-action:manipulation;transition:transform .12s ease-out}
.mx-pill:active{transform:scale(.96)}
.mx-pill.ok{background:var(--accent);border-color:var(--accent);color:var(--on-accent)}
.mx-pill:disabled{opacity:.5}

/* search */
.mx-search{display:flex;align-items:center;gap:8px;min-height:44px;margin:0 0 10px;padding:0 12px;border-radius:12px;background:var(--surface-2);box-shadow:inset 0 0 0 1px var(--line);color:var(--muted)}
.mx-search:focus-within{box-shadow:inset 0 0 0 1.5px var(--accent)}
.mx-search input{flex:1;min-width:0;border:0 !important;background:none !important;box-shadow:none !important;padding:0 !important;height:42px;font:inherit;color:var(--text);outline:none}
.mx-empty{padding:14px;color:var(--muted);font-size:14px;text-align:center}

/* switches inside rows */
.mx-sw{cursor:pointer}
.mx-sw.ro{cursor:default;opacity:.6}

/* a pick list: ✓ marks the chosen one */
.mx-opt[aria-checked="true"] .mx-txt b{color:var(--accent-text,var(--accent))}
.mx-tick{flex:0 0 auto;width:22px;color:var(--accent-text,var(--accent));display:inline-flex;justify-content:center}
.mx-opt[aria-checked="true"] .mx-tick svg{animation:mxTick .22s cubic-bezier(.23,1,.32,1)}
@keyframes mxTick{from{transform:scale(.6);opacity:0}to{transform:none;opacity:1}}
@media (prefers-reduced-motion: reduce){ .mx-opt .mx-tick svg{animation:none !important} }

/* danger: its own group, at the end, red text (no red fill until the final button) */
.mx-danger .mx-row.danger{justify-content:center;color:var(--danger);font-weight:700}
.mx-danger .mx-row.danger .mx-txt{flex:0 1 auto;align-items:center}
.mx-danger .mx-row.danger .mx-chev{display:none}
.mx-dz p{line-height:1.6}

/* forms in a screen */
.mx-pad{padding:0 4px;margin-bottom:16px}
.mx-pad .field{display:flex;flex-direction:column;gap:6px;font-size:13.5px;font-weight:600}
.mx-hint{margin:8px 2px 0;font-size:12.5px;line-height:1.5;color:var(--muted)}
.mx-actions{display:flex;justify-content:flex-end;gap:8px}
.mx-actions .btn{min-height:46px;padding:0 22px;border-radius:99px}

/* history: one sentence per line */
.mx-log{display:flex;gap:10px;align-items:flex-start;padding:11px 14px}
.mx-log p{margin:0;font-size:14px;line-height:1.55}
.mx-log small{display:block;color:var(--faint);font-size:12px}
.mx-dot{flex:0 0 auto;width:9px;height:9px;margin-top:7px;border-radius:50%;background:var(--faint)}
.mx-dot.approved{background:var(--ok)} .mx-dot.rejected{background:var(--danger)}
.mx-st{font-weight:700;margin-inline-start:4px}
.mx-st.approved{color:var(--ok)} .mx-st.rejected{color:var(--danger)}

@media (max-width: 640px){
  .modal.mx-box{max-height:92vh;border-radius:22px 22px 0 0}
  .mx-scr{padding:12px 12px calc(28px + env(safe-area-inset-bottom))}
  .mx-title{font-size:16px}
  .mx-back span{max-width:24vw}
  .mx-req-acts{width:100%}
  .mx-req-acts .mx-pill{flex:1}
}

/* "לא נשקל" (2026-10-17): when it's this head's turn in the printer relay, the stripes glide once toward
   the printer end and fade back — "waiting for a weight". Same slot in the relay as the bead of light. */
html.preview .fill.lv-unknown .fill-bar i{width:100% !important;background:transparent !important}
html.preview .fill.lv-unknown .fill-bar i::before{left:0;width:calc(100% + 28.284px);border-radius:0;
  background:repeating-linear-gradient(135deg,var(--lvl) 0 6px,transparent 6px 10px)}
html[data-theme="light"].preview .fill.lv-unknown .fill-bar i::before{background:repeating-linear-gradient(135deg,var(--lvl) 0 6px,transparent 6px 10px)}
html.preview .fill.lv-unknown .fill-bar i.feed::before{animation:hatchRun 1.7s cubic-bezier(.45,.05,.4,1) 1}
html.preview .fill.lv-unknown .fill-bar i::after{display:none}
@keyframes hatchRun{0%{transform:translateX(0);opacity:0}22%{opacity:.9}78%{opacity:.9}100%{transform:translateX(-28.284px);opacity:0}}
@media (prefers-reduced-motion: reduce){ html.preview .fill.lv-unknown .fill-bar i.feed::before{animation:none !important} }
.modal.mx-box{height:min(88vh,860px)}
.mx-ctx{display:flex;align-items:center;gap:10px;margin:2px 6px 16px}
.mx-ctx span{display:flex;flex-direction:column}
.mx-ctx b{font-size:16px}
.mx-ctx small{color:var(--muted);font-size:13px}
@media (max-width: 640px){ .modal.mx-box{height:92vh} .mx-actions .btn{flex:1} }
/* the login's "הצג" sits inside the password box (it was pushed under it by the hit-area rule) */
.pw #pwToggle{position:absolute;left:6px;top:50%;transform:translateY(-50%);min-width:44px;height:40px}
/* bed temperature (2026-10-28): the print step names its two pairs */
.wz-sub{margin:4px 0 -2px;font-size:13.5px;font-weight:700;color:var(--text)}
