/* Weekly count (Stock tab sub-tab). Everything scoped to #stkWeek .wc.
   Built for an iPad: tap targets 44px+, number boxes 18px (16px+ stops Safari zooming), nothing
   hover-only. style.css styles bare button/th/td/input globally, so those are reset first. */
#stkWeek{padding:0;background:none;border:0;box-shadow:none}
#stkWeek .wc{
  --wc-ground:#F1EFF7;--wc-paper:#fff;--wc-soft:#F6F5F9;--wc-line:#E7E3EF;--wc-edge:#C9C3D8;--wc-ink:#1D1826;--wc-mut:#5F5970;--wc-faint:#7A7389;
  --wc-vi:#5E48B8;--wc-vid:#49389A;--wc-viw:#F0EDFA;--wc-vil:#CFC7EC;--wc-gold:#C0861E;
  --wc-good:#177550;--wc-goodw:#E6F3EC;--wc-att:#B45309;--wc-attw:#FCF0E3;--wc-bad:#B42318;--wc-badw:#FBEAE8;
  font-family:'Instrument Sans',system-ui,sans-serif;font-size:14px;line-height:1.45;color:var(--wc-ink);font-variant-numeric:tabular-nums;
  display:flex;flex-direction:column;gap:12px;-webkit-text-size-adjust:100%}
html[data-theme="dark"] #stkWeek .wc{
  --wc-ground:#14111C;--wc-paper:#1E1A29;--wc-soft:#262033;--wc-line:#2E2840;--wc-edge:#3D3452;--wc-ink:#F1EEF7;--wc-mut:#B9B0CC;--wc-faint:#9A91AE;
  --wc-vi:#8F7BE0;--wc-vid:#B7A8F0;--wc-viw:#2A2342;--wc-vil:#4A3F72;--wc-gold:#E0A84A;
  --wc-good:#5CC08F;--wc-goodw:#16301F;--wc-att:#E8A25A;--wc-attw:#33240F;--wc-bad:#F07A6E;--wc-badw:#3A1A17}
#stkWeek .wc *{box-sizing:border-box}
#stkWeek .wc button{font:inherit;color:inherit;background:none;border:0;padding:0;margin:0;cursor:pointer;text-align:left;box-shadow:none;border-radius:0;min-height:0;width:auto;text-transform:none;letter-spacing:normal;touch-action:manipulation;-webkit-tap-highlight-color:transparent}
#stkWeek .wc button:focus-visible,#stkWeek .wc input:focus-visible{outline:3px solid var(--wc-vil);outline-offset:2px}
#stkWeek .wc table{width:100%;min-width:0;border-collapse:collapse;background:none;margin:0}
#stkWeek .wc th{font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--wc-faint);text-align:left;padding:6px;background:none;border:0;position:static}
#stkWeek .wc td{padding:8px 6px;border:0;border-top:1px solid var(--wc-line);background:none;color:var(--wc-ink);vertical-align:middle}
#stkWeek .wc .r{text-align:right}
#stkWeek .wc h2,#stkWeek .wc h3{margin:0;font-family:'Bricolage Grotesque','Instrument Sans',sans-serif;letter-spacing:-.015em;color:var(--wc-ink)}

/* chips, buttons */
#stkWeek .wc-chip{display:inline-flex;align-items:center;gap:5px;font-size:12px;font-weight:600;padding:2px 9px;border-radius:99px;background:var(--wc-soft);color:var(--wc-mut);border:1px solid var(--wc-line);white-space:nowrap}
#stkWeek .wc-chip.g{background:var(--wc-goodw);color:var(--wc-good);border-color:transparent}
#stkWeek .wc-chip.a{background:var(--wc-attw);color:var(--wc-att);border-color:transparent}
#stkWeek .wc-chip.r{background:var(--wc-badw);color:var(--wc-bad);border-color:transparent}
#stkWeek .wc-chip.v{background:var(--wc-viw);color:var(--wc-vi);border-color:transparent}
#stkWeek .wc-chips{display:flex;gap:6px;flex-wrap:wrap}
#stkWeek .wc .wc-btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:46px;padding:0 18px;border-radius:12px;font-weight:600;font-size:15px;border:1px solid var(--wc-edge);background:var(--wc-paper);color:var(--wc-ink)}
#stkWeek .wc .wc-btn:active{transform:scale(.98)}
#stkWeek .wc .wc-btn.p{background:var(--wc-vi);border-color:var(--wc-vi);color:#fff}
#stkWeek .wc .wc-btn.sm{min-height:40px;padding:0 14px;font-size:14px}
#stkWeek .wc .wc-btn[disabled]{opacity:.45;cursor:not-allowed}
@media (hover:hover){#stkWeek .wc .wc-btn:hover{border-color:var(--wc-vi);color:var(--wc-vi)}#stkWeek .wc .wc-btn.p:hover{background:var(--wc-vid);color:#fff}}

/* where + week band */
#stkWeek .wc-where,#stkWeek .wc-week{background:var(--wc-paper);border:1px solid var(--wc-edge);border-radius:18px;padding:14px 16px}
#stkWeek .wc-where{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#stkWeek .wc-q{font-weight:700;font-size:15px}
#stkWeek .wc-q span{display:block;font-weight:400;font-size:12.5px;color:var(--wc-mut)}
#stkWeek .wc-seg{display:inline-flex;gap:4px;background:var(--wc-soft);border:1px solid var(--wc-edge);border-radius:14px;padding:4px;margin-left:auto}
#stkWeek .wc .wc-seg button{min-height:46px;min-width:110px;padding:0 18px;border-radius:11px;font-weight:700;font-size:15px;color:var(--wc-mut);display:inline-flex;align-items:center;justify-content:center;gap:8px}
#stkWeek .wc .wc-seg button[aria-pressed="true"]{background:var(--wc-ink);color:var(--wc-paper)}
#stkWeek .wc-seg.sm{margin:0;align-self:flex-start}
#stkWeek .wc-dot{width:10px;height:10px;border-radius:50%;display:inline-block}
#stkWeek .wc-week{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:18px;align-items:center}
#stkWeek .wc-ring{position:relative;width:76px;height:76px}
#stkWeek .wc-ring svg{width:76px;height:76px;transform:rotate(-90deg)}
#stkWeek .wc-ringt{position:absolute;inset:0;display:flex;flex-direction:column;align-items:center;justify-content:center;line-height:1.05}
#stkWeek .wc-ringt b{font-family:'Bricolage Grotesque',sans-serif;font-size:21px}
#stkWeek .wc-ringt span{font-size:10.5px;color:var(--wc-faint)}
#stkWeek .wc-wk h2{font-size:19px}
#stkWeek .wc-s{color:var(--wc-mut);font-size:13px;margin:3px 0 8px}
#stkWeek .wc-acts{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}

/* cards. Laid out to read across on a wide screen too: the product on the left, the three figures
   grouped on the right, and the racks and footer indented under the product name (not spread over
   the full width). */
/* Uses the whole width of the Stock tab: one column of cards, two on a wide desktop (below). */
#stkWeek .wc-list{display:flex;flex-direction:column;gap:12px}
#stkWeek .wc-card{background:var(--wc-paper);border:1px solid var(--wc-edge);border-radius:18px;overflow:clip;min-width:0;box-shadow:0 1px 2px rgba(27,22,38,.04)}
#stkWeek .wc-card.done{border-color:color-mix(in srgb,var(--wc-good) 40%,var(--wc-edge))}
#stkWeek .wc-card.part{border-color:color-mix(in srgb,var(--wc-att) 40%,var(--wc-edge))}
#stkWeek .wc-top{display:grid;grid-template-columns:72px minmax(0,1fr) auto;gap:16px;align-items:center;padding:16px 18px}
#stkWeek .wc-ph{position:relative;width:72px;height:72px;border-radius:14px;background:var(--wc-soft);border:1px solid var(--wc-line);display:grid;place-items:center;overflow:hidden;color:var(--wc-faint)}
#stkWeek .wc-ph img{position:absolute;inset:0;width:100%;height:100%;object-fit:contain;background:#fff}
#stkWeek .wc-ph.noimg img{display:none}
#stkWeek .wc-ph svg{width:32px;height:32px}
#stkWeek .wc-tk{position:absolute;z-index:1;right:-1px;bottom:-1px;width:24px;height:24px;border-radius:9px 0 13px 0;display:grid;place-items:center;font-size:12px;font-weight:800;background:var(--wc-good);color:#fff}
#stkWeek .wc-tk.no{background:var(--wc-edge);color:var(--wc-paper)}
#stkWeek .wc-pn{min-width:0}
#stkWeek .wc-pn>b{display:block;font-weight:600;font-size:16px;line-height:1.3;overflow-wrap:anywhere}
#stkWeek .wc-pn>span{display:block;font-size:12.5px;color:var(--wc-mut);margin-top:1px}
#stkWeek .wc-why{display:flex;gap:6px;flex-wrap:wrap;margin-top:7px}
#stkWeek .wc-done{font-size:12.5px;color:var(--wc-good);font-weight:600;margin-top:5px}
#stkWeek .wc-figs{display:flex;align-items:center;gap:22px}
#stkWeek .wc-fig{text-align:right;min-width:78px}
#stkWeek .wc-fig small,#stkWeek .wc-real small{display:block;font-size:10.5px;font-weight:600;letter-spacing:.07em;text-transform:uppercase;color:var(--wc-faint)}
#stkWeek .wc-fig b{display:block;font-family:'Bricolage Grotesque',sans-serif;font-size:20px;line-height:1.2}
#stkWeek .wc-realw{width:260px}
#stkWeek .wc-real{border-radius:14px;background:var(--wc-viw);border:1px solid var(--wc-vil);padding:8px 14px;text-align:right;display:flex;flex-direction:column;gap:1px}
#stkWeek .wc-real small{color:var(--wc-vi)}
#stkWeek .wc-real b{font-family:'Bricolage Grotesque',sans-serif;font-size:26px;line-height:1.1}
#stkWeek .wc-real>span{font-size:12px;color:var(--wc-mut)}
#stkWeek .wc-real.empty{background:var(--wc-soft);border:1px dashed var(--wc-edge)}
#stkWeek .wc-real.empty small{color:var(--wc-faint)}
#stkWeek .wc-real.empty b{color:var(--wc-faint)}
#stkWeek .wc-real .wc-rdiff{display:flex;gap:5px;flex-wrap:wrap;justify-content:flex-end;margin-top:4px}
#stkWeek .wc-real .wc-rdiff:empty{display:none}

/* racks */
/* the app's global table styles (polish.css / responsive.css) frame tables and size them to content; not here */
#stkWeek .wc table{width:100% !important;border:0 !important;border-radius:0 !important;box-shadow:none !important;background:none !important;overflow:visible !important}
#stkWeek .wc th,#stkWeek .wc td{border-left:0 !important;border-right:0 !important;box-shadow:none !important}
#stkWeek .wc thead th{border-bottom:0 !important;background:none !important}
/* responsive.css turns tables into stacked blocks on narrow screens; these stay real tables */
#stkWeek .wc table{display:table !important}#stkWeek .wc thead{display:table-header-group !important}#stkWeek .wc tbody{display:table-row-group !important}#stkWeek .wc tr{display:table-row !important}#stkWeek .wc th,#stkWeek .wc td{display:table-cell !important}#stkWeek .wc colgroup{display:table-column-group !important}#stkWeek .wc col{display:table-column !important}
#stkWeek .wc td::before{content:none !important;display:none !important}
/* Rack rows: a grid, not a <table> (the app frames and stacks tables on an iPad). The columns are
   fixed so a count box and its Matches button sit in the same place, row after row. */
#stkWeek .wc-racks{border-top:1px solid var(--wc-line);padding:4px 18px 12px 106px}
#stkWeek .wc-rk{display:grid;grid-template-columns:minmax(0,1fr) 110px 150px 132px;gap:14px;align-items:center;max-width:880px;padding:10px 0;border-bottom:1px solid var(--wc-line)}
#stkWeek .wc-rk.head{padding:10px 0 6px;font-size:11px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--wc-faint)}
#stkWeek .wc-loc{min-width:0}
#stkWeek .wc-loc>b{font-size:15.5px;font-weight:600;color:var(--wc-ink)}
#stkWeek .wc-says{text-align:right;font-size:16px;color:var(--wc-mut)}
#stkWeek .wc-incell{display:flex;justify-content:flex-end}
#stkWeek .wc-rk.head .wc-says{font-size:inherit;color:inherit;white-space:nowrap}
#stkWeek .wc-rk.saved .wc-says,#stkWeek .wc-rk.saved .wc-dcell{color:var(--wc-good)}
#stkWeek .wc-other{max-width:880px;color:var(--wc-mut);font-size:13px;padding:10px 0 0}
#stkWeek .wc-site{font-size:11.5px;font-weight:700;margin-left:4px}
#stkWeek .wc-sub{font-size:12px;color:var(--wc-mut);font-weight:400;margin-top:2px;white-space:normal}
#stkWeek .wc .wc-in{width:100%;max-width:140px;height:48px;border:1px solid var(--wc-edge);border-radius:12px;padding:0 12px;font:inherit;font-size:19px;font-weight:700;text-align:right;background:var(--wc-paper);color:var(--wc-ink);margin:0;box-shadow:none;min-width:0}
#stkWeek .wc .wc-in::placeholder{color:var(--wc-edge)}
#stkWeek .wc .wc-in:focus{outline:none;border-color:var(--wc-vi);box-shadow:0 0 0 4px var(--wc-viw)}
#stkWeek .wc .wc-in[disabled]{opacity:.5}
#stkWeek .wc-dcell{font-weight:700;font-size:16px;display:flex;align-items:center;min-width:0}
#stkWeek .wc .wc-dcell .wc-match{width:100%}
#stkWeek .wc .wc-match{min-height:44px;padding:0 14px;border-radius:12px;border:1px solid color-mix(in srgb,var(--wc-good) 55%,transparent);color:var(--wc-good);font-weight:700;font-size:14px;background:var(--wc-goodw);text-align:center;white-space:nowrap}
#stkWeek .wc-ok{color:var(--wc-good);font-size:19px}
#stkWeek .wc-off{color:var(--wc-att)}

/* footer: what to change, and save */
#stkWeek .wc-foot{border-top:1px solid var(--wc-line);background:var(--wc-soft);padding:12px 18px 14px 106px;display:flex;gap:16px;align-items:center;flex-wrap:wrap}
#stkWeek .wc-opts{display:flex;flex-direction:column;gap:8px;flex:1 1 420px;max-width:700px;min-width:0}
#stkWeek .wc-opt{display:flex;gap:12px;align-items:center;padding:10px 14px;border:1px solid var(--wc-line);border-radius:12px;background:var(--wc-paper);cursor:pointer;margin:0;min-height:52px;font-weight:400}
#stkWeek .wc-opt>span{flex:1 1 auto;min-width:0}
#stkWeek .wc-opt b{display:block;font-size:14.5px;font-weight:600}
#stkWeek .wc-opt span span{display:block;font-size:12.5px;color:var(--wc-mut)}
/* polish.css shrinks every checkbox with !important, so this one is drawn by hand at a touch size */
#stkWeek .wc .wc-opt input[type="checkbox"]{-webkit-appearance:none !important;appearance:none !important;width:26px !important;min-width:26px !important;height:26px !important;margin:0 !important;padding:0 !important;
  border:2px solid var(--wc-edge) !important;border-radius:8px !important;background:var(--wc-paper) !important;flex:none;cursor:pointer;display:grid;place-items:center;box-shadow:none !important}
#stkWeek .wc .wc-opt input[type="checkbox"]:checked{background:var(--wc-vi) !important;border-color:var(--wc-vi) !important}
#stkWeek .wc .wc-opt input[type="checkbox"]:checked::after{content:"";width:7px;height:12px;border:solid #fff;border-width:0 3px 3px 0;transform:translate(0,-1px) rotate(45deg)}
#stkWeek .wc-info{font-size:13.5px;color:var(--wc-mut);padding:4px 2px}
#stkWeek .wc-info b{color:var(--wc-ink)}
#stkWeek .wc-info.good b{color:var(--wc-good)}
#stkWeek .wc-btns{display:flex;gap:8px;flex-wrap:wrap;margin-left:auto}
#stkWeek .wc-btns .wc-btn.p{min-width:170px}
#stkWeek .wc-err{flex-basis:100%;color:var(--wc-bad);font-weight:600}
#stkWeek .wc-reopen{border-top:1px solid var(--wc-line);padding:8px 18px;display:flex;justify-content:flex-end}
#stkWeek .wc .wc-add{display:flex;gap:10px;align-items:center;min-height:56px;padding:12px 18px;border:1.5px dashed var(--wc-edge);border-radius:18px;color:var(--wc-mut);width:100%;font-size:15px}
#stkWeek .wc-add b{font-size:20px}
#stkWeek .wc-empty{padding:24px 18px;color:var(--wc-mut);background:var(--wc-paper);border:1px solid var(--wc-edge);border-radius:18px}
#stkWeek .wc-note{color:var(--wc-mut);font-size:13px;margin:6px 0}

/* history */
#stkWeek .wc-hhead{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
#stkWeek .wc-hhead h2{font-size:19px}
#stkWeek .wc-stats{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:12px}
#stkWeek .wc-stats div{background:var(--wc-paper);border:1px solid var(--wc-edge);border-radius:14px;padding:12px 14px}
#stkWeek .wc-stats b{display:block;font-family:'Bricolage Grotesque',sans-serif;font-size:24px}
#stkWeek .wc-stats span{font-size:12.5px;color:var(--wc-mut)}
#stkWeek .wc-hcard{background:var(--wc-paper);border:1px solid var(--wc-edge);border-radius:16px;overflow-x:auto;padding:4px 8px}
#stkWeek .wc-hcard td{vertical-align:top;padding:10px 8px}
#stkWeek .wc-g{color:var(--wc-good)}#stkWeek .wc-a{color:var(--wc-att)}
#stkWeek .wc-minus{color:var(--wc-bad)}#stkWeek .wc-plus{color:var(--wc-att)}
#stkWeek .wc-wrap{white-space:normal;min-width:160px}
#stkWeek .wc-pb{display:flex;gap:6px;flex-wrap:wrap;margin-top:6px}

/* add dialog */
#stkWeek .wc-dlg{position:fixed;inset:0;z-index:1000;background:rgba(20,17,28,.45);display:flex;justify-content:center;align-items:flex-start;padding:10vh 16px 16px}
#stkWeek .wc-dlgin{width:min(600px,100%);max-height:80vh;overflow:auto;background:var(--wc-paper);border:1px solid var(--wc-edge);border-radius:16px;padding:16px;display:flex;flex-direction:column;gap:10px}
#stkWeek .wc-dlgh{display:flex;align-items:center;gap:10px}
#stkWeek .wc-dlgh h3{font-size:17px;margin-right:auto}
#stkWeek .wc .wc-dq{height:50px;border:1px solid var(--wc-edge);border-radius:12px;padding:0 14px;font:inherit;font-size:17px;background:var(--wc-soft);color:var(--wc-ink);width:100%;margin:0}
#stkWeek .wc-res{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;align-items:center;padding:10px;border-radius:10px;min-height:56px;border-top:1px solid var(--wc-line)}

/* Wide desktop: two columns of cards so the screen is used edge to edge, each card laid out as on an iPad landscape. */
@container wc (min-width:1460px){
  #stkWeek .wc-list{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;gap:14px}
  #stkWeek .wc-rk,#stkWeek .wc-other{max-width:none}
}
/* iPad portrait and narrower: the three figures get their own row, racks and footer use the full width */
@container wc (max-width:940px){
  #stkWeek .wc-top{grid-template-columns:72px minmax(0,1fr);row-gap:12px}
  #stkWeek .wc-figs{grid-column:1 / -1;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr) minmax(0,1.6fr);gap:12px;align-items:stretch}
  #stkWeek .wc-fig{text-align:left;background:var(--wc-soft);border:1px solid var(--wc-line);border-radius:14px;padding:8px 12px;display:flex;flex-direction:column;justify-content:center}
  #stkWeek .wc-realw{width:auto}
  #stkWeek .wc-racks{padding:4px 14px 12px}
  #stkWeek .wc-rk,#stkWeek .wc-other{max-width:none}
  #stkWeek .wc-rk{grid-template-columns:minmax(0,1fr) 84px 132px 124px;gap:10px}
  #stkWeek .wc-foot{padding:12px}
  #stkWeek .wc-opts{flex-basis:100%;max-width:none}
  #stkWeek .wc-btns{margin-left:0;width:100%}
  #stkWeek .wc-btns .wc-btn{flex:1}
  #stkWeek .wc-seg{margin-left:0;width:100%}
  #stkWeek .wc .wc-seg button{flex:1;min-width:0}
  #stkWeek .wc-week{grid-template-columns:auto minmax(0,1fr)}
  #stkWeek .wc-acts{grid-column:1 / -1;justify-content:flex-start}
  #stkWeek .wc-stats{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@container wc (max-width:540px){
  #stkWeek .wc-top{grid-template-columns:56px minmax(0,1fr)}
  #stkWeek .wc-ph{width:56px;height:56px}
  #stkWeek .wc-figs{grid-template-columns:1fr 1fr}
  #stkWeek .wc-realw{grid-column:1 / -1}
  #stkWeek .wc-rk{grid-template-columns:minmax(0,1fr) 60px 100px 104px;gap:8px}
}
@media (prefers-reduced-motion:reduce){#stkWeek .wc *{transition:none!important}}

/* The Stock tab's figures and bars step aside while Weekly count is open (stock.js setWeekView). */
#stockInventory .stk-wc-off{display:none!important}

/* The layout follows the room it gets (see .wc-cq in weeklyCount.js), not the screen. */
#stkWeek .wc-cq{container-type:inline-size;container-name:wc;display:flex;flex-direction:column;gap:12px;min-width:0}
/* Floor tablet: the whole width, like the Warehouse screen (responsive.css caps .main > .tab at 820px up to 1180px). */
.main > #weeklyCountStation.tab{max-width:none}
#weeklyCountStation #stkWeek{width:100%}
