

img.ph{width:56px;object-fit:contain;background:#fff;border-radius:8px;border:1px solid var(--line);flex:none;aspect-ratio:1/1;height:auto}
img.ph.sm{width:40px;height:auto;aspect-ratio:1/1}

/* ---- num1/num2 配色ユーティリティ ---- */

.updn{font-weight:800}
.updn.up{color:var(--ok-ink)}.updn.down{color:var(--red-ink)}
.pcell.num.muted{color:var(--sub);font-weight:600}
.qcell b.muted{color:var(--sub)}
.slip-row .pcell.num.muted{color:var(--sub);font-weight:600}

/* ---- 全体シェル：左サイドバー ---- */

.sb-item .dot-badge{margin-left:auto;min-width:16px;height:16px}

/* ---- ヘッダー ---- */

.brand{font-size:17px;font-weight:800;white-space:nowrap;flex:none}

.nav{display:none}
.tab{position:relative;flex:none;min-height:44px;padding:0 12px;border:1px solid var(--line2);border-radius:var(--radius-pill);background:#fff;color:var(--sub);font-size:13px;font-weight:800;white-space:nowrap}
.tab.on{background:var(--ink);border-color:var(--ink);color:#fff}
.dot-badge{min-width:16px;height:16px;padding:0 4px;margin-left:5px;border-radius:8px;display:inline-grid;place-items:center;background:var(--red);color:#fff;font-size:9px}

/* ---- サマリー・セグメント ---- */
.sumbar{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:14px}
.sumbar.big{grid-template-columns:repeat(4,1fr)}
.sumbar.big.six{grid-template-columns:repeat(6,1fr)}
.sumit{min-width:0;padding:12px 10px;border:1px solid var(--line);border-radius:10px;background:#fff}
.sumit .k{display:block;color:var(--sub);font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sumit b{display:block;margin-top:4px;font-size:19px;font-weight:900;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sumit small{display:block;margin-top:2px;color:var(--sub);font-size:12px;font-weight:700}
.sumit small.up{color:var(--ok-ink)}.sumit small.down{color:var(--red-ink)}
.sumit.warn{background:var(--warnbg);border-color:var(--warnbg)}.sumit.warn .k,.sumit.warn b{color:var(--warn-ink)}

/* ---- ① 今月のまとめ ---- */
.sum-cols{display:grid;grid-template-columns:minmax(0,1.4fr) minmax(0,1fr);gap:14px;align-items:start}
.sum-list{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
.sum-row{width:100%;min-height:56px;padding:10px 4px;display:flex;align-items:center;gap:10px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}
.sum-row:last-child{border-bottom:0}
.sum-row-l{display:flex;align-items:baseline;gap:6px;flex-wrap:wrap}
.sum-row-l b{font-size:15px}.sum-row-l small{color:var(--sub);font-size:11px;font-weight:600}
.sum-row-r{margin-left:auto;text-align:right}
.sum-row-r b{display:block;font-size:16px}.sum-row-r small{display:block;color:var(--sub);font-size:11px}
.sum-row-r b.pill,.sum-row-l .pill{margin-left:0;font-size:12px;padding:3px 10px}
.gochev{flex:none;color:var(--sub)}
.sum-bar{position:relative;height:8px;border-radius:4px;background:var(--surface);overflow:hidden}
.sum-bar i{display:block;height:100%;background:var(--gold);border-radius:4px}
/* ---- 売場ごとの納品と売上：PC1行／スマホ2段 ---- */
.sum-th{display:grid;grid-template-columns:120px 1fr 130px 130px;gap:14px;padding:0 4px 8px;border-bottom:1px solid var(--line);margin-bottom:2px;color:var(--sub);font-size:11px;font-weight:700}
.sum-th span:nth-child(3),.sum-th span:nth-child(4){text-align:right}
.sum-row3{width:100%;display:grid;grid-template-columns:120px 1fr 130px 130px;gap:14px;align-items:center;padding:10px 4px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}
.sum-row3:last-child{border-bottom:0}
.sr3-name{display:flex;flex-direction:column;gap:2px;min-width:0}
.sr3-name b{font-size:14px}
.sr3-name small{color:var(--sub);font-size:10px;font-weight:600}
.sr3-name .pill{margin:2px 0 0;align-self:flex-start}
.sr3-sales{text-align:right;font-size:14px;font-weight:800}
.sr3-deliver{text-align:right}
.sr3-deliver b{display:block;font-size:15px}
.sr3-deliver small{display:block;color:var(--sub);font-size:11px}
.sum-row3m{display:none}

/* ---- 案A 商品ごとの表（②） ---- */

.pill.gold{background:var(--goldbg);color:var(--gold-ink)}
.pill.blue{background:var(--bluebg);color:var(--blue)}

.ptable{padding:10px 16px}
.phead,.prow{display:grid;grid-template-columns:minmax(220px,2.4fr) 120px 130px 120px 140px;align-items:center;gap:2px 16px}
.phead{padding:0 8px 10px;border-bottom:2px solid var(--line);color:var(--sub);font-size:11px;font-weight:700}
.phead .pcell{text-align:right}.phead .pcell.name{text-align:left}
.phead .send-h{color:var(--ok-ink)}
.phead .pcell small{display:block;font-weight:600;color:var(--sub)}
.prow-wrap{border-bottom:1px solid var(--line)}.prow-wrap:last-child{border-bottom:0}
.prow{width:100%;min-height:64px;padding:9px 8px;border:0;background:#FBFAF7;text-align:left}
.pcell{min-width:0}
.pcell.name{display:flex;align-items:center;gap:10px;font-size:16px;font-weight:800;overflow:hidden}
.pcell.name span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.pcell.name .chev{margin-left:auto;flex:none;color:var(--sub);transition:transform .2s}
.pcell.name .chev.up{transform:rotate(180deg)}
.pcell.op{text-align:center;color:#8C847C;font-weight:400}
.pcell.num{text-align:right;font-size:18px;font-weight:800;white-space:nowrap}
.pcell.num.short{color:var(--red-ink)}
.pcell.num.zero{color:#8C847C;font-weight:500}
.pcell.num.send{background:var(--okbg);color:var(--ok-ink);font-weight:900;border-radius:6px;padding:4px 8px;display:flex;align-items:center;justify-content:flex-end;gap:4px;flex-wrap:wrap}
.pcell.num.remain{color:var(--ink)}
.pcell.num.remain.neg{color:var(--red-ink)}
.pcell.num.remain.warn2{color:var(--warn-ink)}
.pcell.qcell-pc{display:flex;align-items:center;justify-content:flex-end;gap:6px;flex-wrap:wrap}

.msum{margin-top:2px}
.msub2{margin-top:7px;font-size:11px;color:var(--sub)}
.msub2 b{font-weight:800;color:var(--ink)}
.lot-mobile{display:block;margin-top:5px;color:var(--sub);font-size:11px}

/* ---- 4マス／3マス+2マス（スマホ） ---- */
.quad2{display:grid;grid-template-columns:1fr 1fr;gap:2px;margin-top:2px}
.quad3{display:grid;grid-template-columns:1fr 12px 1fr 12px 1fr;align-items:stretch;gap:0 2px}
.qcell{min-width:0;padding:5px 3px;border-radius:6px;background:var(--surface);text-align:center}
.qcell small{display:block;color:var(--sub);font-size:9px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.qcell b{display:block;font-size:16px;font-weight:900;margin-top:2px}
.qcell b.short{color:var(--red-ink)}.qcell b.zero{color:#8C847C}
.qcell.send{background:var(--okbg)}.qcell.send b{color:var(--ok-ink)}
.qcell.neg b{color:var(--red-ink)}
.qcell.remain.neg b{color:var(--red-ink)}
.qcell.remain.warn2 b{color:var(--warn-ink)}
.qcell.qinput{background:var(--okbg)}
.qop{align-self:center;text-align:center;color:#8C847C;font-weight:700;font-size:13px}
.qwait{margin-top:5px}

/* ---- 数量入力欄 ---- */

.qtybox.edited .qtyfield{border-color:var(--warn);background:var(--warnbg)}

.qtybox.gauge{margin-top:4px}
.qcell.qinput .qtybox{margin-top:2px}

.psub-list{padding:2px 4px 12px}
.psub-subhead{padding:2px 8px 6px;color:var(--sub);font-size:11px;font-weight:700}
.psub.only-pc{display:grid;grid-template-columns:minmax(220px,2.4fr) 120px 130px 120px 140px;align-items:center;gap:2px 16px;padding:9px 8px;border-bottom:1px solid var(--line)}
.psub.only-pc:last-of-type{border-bottom:0}
.pcell.name.sub{font-size:14px;font-weight:700;gap:6px;flex-wrap:wrap}
.pcell.name.sub small{color:var(--sub);font-weight:600;font-size:11px;margin-right:2px}
.scalc-mini{flex-basis:100%;color:var(--sub);font-size:11px;font-weight:600}
.pcell.waitcell{display:flex;align-items:center;justify-content:flex-end}
.psub-rest{color:var(--sub);font-size:13px;padding:9px 8px 2px;border-bottom:0}
.stags{display:inline-flex;gap:4px;flex-wrap:wrap}
.psub.only-mobile{padding:10px 4px;border-bottom:1px solid var(--line)}
.psub-actions{padding:8px 8px 0}

/* ---- スマホの売場1行（msrow） ---- */
.msrow{display:flex;align-items:center;gap:10px}
.msrow-name{flex:0 0 auto;min-width:56px;display:flex;flex-direction:column;gap:1px}
.msrow-name b{font-size:14px}
.msrow-name small{color:var(--sub);font-size:10px;font-weight:600}
.msrow-name .pill{margin:2px 0 0;align-self:flex-start}
.msrow-calc{flex:1;min-width:0;display:flex;align-items:baseline;gap:3px;font-size:14px;font-weight:800;justify-content:center}
.msrow-calc .op{color:#8C847C;font-weight:400;font-size:12px}
.msrow-calc .short{color:var(--red-ink)}.msrow-calc .zero{color:#8C847C}
.msrow-qty{flex:0 0 auto;text-align:center}
.msrow-qty small{display:block;color:var(--sub);font-size:9px;font-weight:700;margin-bottom:2px}
.btn{min-height:44px;padding:0 16px;border:1px solid var(--line2);border-radius:var(--radius);display:inline-flex;align-items:center;justify-content:center;gap:7px;background:#fff;font-size:14px;font-weight:800}
.btn svg{width:16px}
.btn-primary{background:var(--ink);border-color:var(--ink);color:#fff}
.btn-dark{background:var(--ink);border-color:var(--ink);color:#fff}
.btn-dark.done{background:var(--okbg);border-color:var(--okbg);color:var(--ok-ink)}
.btn-block{width:100%}
.btn[disabled],.btn-dark[disabled]{opacity:.4;pointer-events:none}
.btn.sm{min-height:44px;padding:0 12px;font-size:12px;gap:5px}
.btn.sm svg{width:14px}
.prod-toolbar{display:flex;gap:8px;margin-bottom:10px}

/* ---- 工場カード（③）・期限注意カード（②） ---- */
.fac-box{margin-bottom:12px;border:1px solid var(--line);border-radius:10px;overflow:hidden}
.fac-box:last-child{margin-bottom:0}
.fac-head{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 12px;background:var(--surface);border-bottom:1px solid var(--line)}
.fac-head b{font-size:14px;font-weight:800}
.fac-list{border:0}
.fac-item{display:flex;align-items:center;gap:10px;padding:11px 12px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.fac-item:last-child{border-bottom:0}
.fac-item.fac-noneed{opacity:.75}
.fac-noneed-toggle{width:100%;min-height:44px;padding:0 12px;display:flex;align-items:center;justify-content:space-between;border:0;border-bottom:1px solid var(--line);background:none;color:var(--sub);font-size:13px;font-weight:700;text-align:left}
.fac-noneed-toggle:last-child{border-bottom:0}
.fac-noneed-toggle .chev{color:var(--sub);transition:transform .2s}
.fac-noneed-toggle .chev.up{transform:rotate(180deg)}
.fac-mid{min-width:0;flex:1}.fac-mid b{display:block;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.fac-mid small{color:var(--sub);font-size:11px}
.fac-nums{display:flex;flex-wrap:wrap;gap:10px 16px;margin-top:5px}
.fac-nums span{display:block}
.fac-nums small{display:block;color:var(--sub);font-size:10px;white-space:nowrap}
.fac-nums b{font-size:14px}
.fac-r{text-align:right;flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:2px}
.fac-r small{display:block;color:var(--sub);font-size:10px}
.move-item{display:flex;align-items:center;gap:10px;padding:8px 0;flex-wrap:wrap}
.move-card{padding:14px 0;border-bottom:1px solid var(--line)}
.move-card:last-child{border-bottom:0}
.move-card.rejected{opacity:.6}
.move-left{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.move-left-mid{display:flex;flex-direction:column;gap:1px}
.move-left-mid b{font-size:14px}
.move-left-mid small{color:var(--sub);font-size:11px}
.move-nums{display:flex;flex-wrap:wrap;gap:10px 20px;margin-bottom:12px;padding:10px 12px;border-radius:8px;background:var(--surface)}
.move-nums span{display:block}
.move-nums small{display:block;color:var(--sub);font-size:10px;white-space:nowrap}
.move-nums b{font-size:15px}
.move-candidates{display:grid;grid-template-columns:minmax(0,1fr);gap:6px;margin-bottom:10px}
.move-cand{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid var(--line2);border-radius:8px;cursor:pointer;flex-wrap:wrap}
.move-cand.on{border:2px solid var(--ink);background:var(--surface)}
.move-cand input{margin:0;flex:none}
.move-cand b{font-size:14px;flex:none}
.move-cand small{color:var(--sub);font-size:11px;margin-left:auto}
.move-cand .ok-txt2{color:var(--ok-ink);font-size:11px;font-weight:800;white-space:nowrap}
.move-cand .ng-txt2{color:var(--red-ink);font-size:11px;font-weight:800;white-space:nowrap}
.move-qty-row{display:flex;align-items:center;gap:10px;margin-bottom:12px}
.move-qty-row small{color:var(--sub);font-size:12px;font-weight:700}
.move-actions{display:flex;gap:10px}
.move-actions .btn{flex:1}
.move-status{display:flex;align-items:center;gap:10px}
.ship-bar{position:sticky;bottom:10px;z-index:5;margin-top:14px}

.ship-warn{margin-top:8px;padding:8px 12px;border-radius:8px;background:var(--warnbg);color:var(--warn-ink);font-size:12px;font-weight:700;text-align:center}

/* ---- 案B 売場ごとの納品書 ---- */
.bwrap{display:grid;grid-template-columns:260px minmax(0,1fr);gap:18px;align-items:start}
.stores-list{display:grid;gap:6px}
.st-item{display:flex;align-items:center;flex-wrap:wrap;gap:4px 6px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff;text-align:left;font-weight:700}
.st-item.on{border:2px solid var(--ink)}
.st-item b{font-size:15px}.st-item small{color:var(--sub);font-weight:600}
.st-item .c{margin-left:auto;color:var(--ok-ink);font-size:13px;font-weight:800}
.st-item .c.zero{color:var(--sub);font-weight:600}
.slip{border:1px solid var(--line);border-radius:12px;padding:16px 18px;background:#fff}
.slip h3{margin:0 0 4px;font-size:19px}.slip .meta{color:var(--sub);font-size:12px;margin-bottom:12px}
.slip-head,.slip-row{display:grid;grid-template-columns:minmax(130px,1.8fr) 54px 12px 54px 12px 76px 150px 180px;align-items:center;gap:2px 10px}
.slip-head{padding-bottom:8px;border-bottom:2px solid var(--line);color:var(--sub);font-size:11px;font-weight:700}
.slip-head .send-h{color:var(--ok-ink)}
.slip-head .pcell{text-align:right}.slip-head .pcell.name{text-align:left}
.slip-row{padding:9px 0;border-bottom:1px solid var(--line)}
.slip-row .pcell.lot{font-size:11px;color:var(--sub);text-align:right}
.slip-total{display:flex;align-items:center;justify-content:flex-end;gap:14px;margin-top:12px;font-size:15px;font-weight:800}
.slip-total .send{padding:5px 12px;border-radius:8px;font-size:18px}

/* ---- 案C ゲージ ---- */
.gchips{display:flex;gap:6px;overflow-x:auto;padding-bottom:10px;margin-bottom:10px}
.gchip{width:48px;height:48px;flex:none;padding:2px;border:2px solid transparent;border-radius:8px;background:#fff}
.gchip.on{border-color:var(--ink)}
.gchip img{width:100%;height:100%;object-fit:contain}
.ghead{display:flex;align-items:center;gap:14px;margin-bottom:8px}
.ghead b{font-size:17px}
.legend{display:flex;gap:16px;flex-wrap:wrap;color:var(--sub);font-size:12px;margin-bottom:10px}
.legend .lg{width:16px;height:10px;display:inline-block;margin-right:5px;vertical-align:-1px;border-radius:2px}
.legend .lg.have{background:#7A726B}
.legend .lg.add{background:repeating-linear-gradient(135deg,#8FD0A6 0 4px,#C6E8D1 4px 8px);border:1px solid var(--ok)}
.legend .lg.wait{background:transparent;border:2px dashed var(--red)}
.legend .lg.line{width:3px;background:var(--ink)}
.grows{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
.grow{display:grid;grid-template-columns:104px minmax(0,1fr) 176px;gap:12px;align-items:center;padding:8px 0;border-bottom:1px solid var(--line)}
.grow:last-child{border-bottom:0}
.grow .n{display:flex;flex-direction:column;font-weight:800;font-size:13px}
.grow .n small{color:var(--sub);font-weight:600;font-size:11px}
.gbar{position:relative;height:26px;background:#F1EEEA;border-radius:6px}
.gbar i{position:absolute;top:0;bottom:0;display:flex;align-items:center;justify-content:center;font-style:normal;font-size:11px;font-weight:800;overflow:hidden}
.gbar .have{left:0;background:#7A726B;color:#fff;border-radius:6px 0 0 6px}
.gbar .add{background:repeating-linear-gradient(135deg,#8FD0A6 0 6px,#C6E8D1 6px 12px);color:var(--ok-ink);border:2px solid var(--ok)}
.gbar .waitbox{box-sizing:border-box;border:2px dashed var(--red);background:rgba(200,75,60,.06);color:var(--red-ink);border-radius:0;font-size:10px}
.gbar .line{width:3px;background:var(--ink);top:-5px;bottom:-5px}
.gbar .lbl{position:absolute;top:-19px;font-size:10px;color:var(--ink);font-weight:800;transform:translateX(-50%);white-space:nowrap}
.gval{font-size:14px;font-weight:800;text-align:right;white-space:nowrap;display:flex;flex-direction:column;align-items:flex-end;gap:4px;flex-wrap:wrap}
.gval .send{color:var(--ok-ink)}.gval .ok-txt{color:var(--sub);font-weight:600;font-size:12px}
.factory-eq{margin-top:16px;padding-top:14px;border-top:2px solid var(--ink);display:flex;align-items:center;gap:10px;flex-wrap:wrap;font-size:13px;font-weight:700}
.factory-eq b{font-size:20px}
.factory-eq b.neg{color:var(--red-ink)}
.factory-eq .op{color:var(--sub);font-weight:600;font-size:12px}

/* ---- 一覧表（スプレッドシート風） ---- */
.list-toolbar{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:10px;margin-bottom:12px}
.lt-scroll{border:1px solid var(--line);border-radius:10px;background:#fff;max-width:100%}
.lt-table{border-collapse:collapse;width:max-content;min-width:100%;font-size:13px}
.lt-table th,.lt-table td{padding:8px 10px;border-bottom:1px solid var(--line);border-right:1px solid var(--line);text-align:right;white-space:nowrap}
.lt-table th:last-child,.lt-table td:last-child{border-right:0}
.lt-table thead th{background:var(--surface);color:var(--sub);font-weight:700;font-size:11px;position:sticky;top:0;z-index:2}
.lt-table thead th small{display:block;color:var(--sub);font-weight:600;font-size:10px}
.lt-table th.lt-sticky,.lt-table td.lt-sticky{position:sticky;left:0;z-index:1;background:#fff;text-align:left;font-weight:700;min-width:160px}
.lt-table thead th.lt-sticky{z-index:3;background:var(--surface)}
.lt-thumb{width:24px;height:auto;aspect-ratio:1/1;object-fit:contain;vertical-align:middle;margin-right:6px;border-radius:4px;border:1px solid var(--line);background:#fff}
.lt-table td.lt-center{text-align:center}
.lt-cell{font-variant-numeric:tabular-nums}
.lt-give{color:var(--ok-ink);font-weight:800}
.lt-zero{background:var(--redbg)}
.lt-warn-row{background:var(--warnbg)}
.lt-neg{color:var(--red-ink);font-weight:800}
.lt-total{font-weight:800}
.lt-foot{font-weight:800;background:var(--surface)}
.lt-foot .lt-sticky{background:var(--surface)}
.lt-master td:first-child,.lt-master th:first-child{text-align:left}

/* ---- 取込 ---- */
.drop{min-height:170px;padding:22px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:5px;border:2px dashed var(--line2);border-radius:12px;background:#fff;cursor:pointer}
.drop.over{border-color:var(--blue);background:var(--bluebg)}
.drop svg{width:30px;color:var(--blue)}
.drop .t{font-weight:800}.drop .d{color:var(--sub);font-size:12px}
.drop-actions{margin-top:8px}
.file-card,.file-line{width:100%;min-height:52px;margin-top:12px;padding:10px 13px;display:flex;align-items:center;gap:10px;border:1px solid var(--line);border-radius:10px;background:#fff;text-align:left}
.file-card svg,.file-line svg{width:20px;color:var(--blue);flex:none}
.file-card span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-weight:700}
.file-card b{margin-left:auto;flex:none;color:var(--blue);font-size:13px}
.read-sum{display:grid;grid-template-columns:repeat(3,1fr);margin:16px 0}
.read-sum>div{min-width:0;text-align:center;border-left:1px solid var(--line)}
.read-sum>div:first-child{border-left:0}
.read-sum b{display:block;font-size:24px}.read-sum small{color:var(--sub)}
.read-sum2{display:flex;align-items:center;justify-content:space-between;padding:10px 12px;margin-bottom:14px;border-radius:8px;background:var(--surface);font-size:13px}
.read-sum2 b{font-size:14px}
.chg-h{margin:14px 0 7px;font-size:13px;font-weight:800}
.chg-list{border-top:1px solid var(--line)}
.chg-row{padding:9px 0;display:grid;grid-template-columns:minmax(0,1fr) minmax(84px,1.25fr) 46px;gap:8px;align-items:center;border-bottom:1px solid var(--line)}
.cl{min-width:0;display:flex;align-items:center;gap:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:12px;font-weight:700}
.cb{display:grid;gap:4px}.cb span{height:8px;display:flex;align-items:center;gap:4px}
.cb i{height:6px;min-width:2px;display:block;border-radius:3px}
.b8{background:#B9B1A9}.b9.up{background:var(--ok)}.b9.down{background:var(--red)}
.cb em{font-style:normal;font-size:10px}
.cp{text-align:right;font-size:12px;font-weight:900}
.cp.up{color:var(--ok-ink)}.cp.down{color:var(--red-ink)}

/* ---- シート・オーバーレイ ---- */

.sheet input.subj,.sheet textarea{width:100%;padding:10px 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px;margin-bottom:4px}

/* ---- タブレット：サイドバーをアイコンだけに ---- */

/* ---- レスポンシブ：スマホ（横スクロールさせない） ---- */
@media(max-width:767px){

  .nav{display:none}

  .tbb-badge{position:absolute;top:6px;left:calc(50% + 8px);width:8px;height:8px;min-width:0;padding:0}

  .sumbar{grid-template-columns:repeat(2,1fr)}
  .sumit b{white-space:normal;font-size:16px;line-height:1.3}
  .sumit .k{white-space:normal;font-size:10.5px;line-height:1.3}
  .ptable{padding:6px 10px}
  .prow{grid-template-columns:1fr;min-height:0;padding:12px 4px}
  .pcell.name{font-size:15px}
  .psub-list{padding:0 4px 10px 4px}
  .bwrap{grid-template-columns:1fr}
  .stores-list{grid-auto-flow:column;grid-auto-columns:minmax(110px,auto);overflow-x:auto;padding-bottom:6px}
  .st-item{flex-direction:column;align-items:flex-start;gap:2px}
  .st-item .c{margin-left:0}
  .slip{padding:14px}
  .slip-head{display:none}
  .slip-row{grid-template-columns:1fr;padding:10px 0}
  .slip-total{flex-wrap:wrap}
  .grow{grid-template-columns:1fr;gap:6px}
  .gval{align-items:flex-start;text-align:left}
  .factory-eq{font-size:12px}
  .factory-eq b{font-size:17px}
  .fac-nums{gap:8px 12px}
  .fac-r{align-items:flex-start;width:100%;flex-direction:row;justify-content:space-between;margin-top:6px}
  .sum-row-r{text-align:right}
  .ship-bar{bottom:calc(var(--tabh) + 10px)}
  
  .sumbar.big.six{grid-template-columns:repeat(2,1fr)}
  .sum-cols{grid-template-columns:1fr}
  .move-nums{gap:8px 14px}
  .move-cand{flex-direction:column;align-items:flex-start;gap:4px}
  .move-cand small{margin-left:0}
  .list-toolbar{flex-direction:column;align-items:stretch}
  .lt-table{font-size:12px}
  .lt-table th,.lt-table td{padding:6px 8px}
  .sum-row3m{display:block;width:100%;padding:10px 4px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}
  .sum-row3m:last-child{border-bottom:0}
  .sr3m-top{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
  .sr3m-top b{font-size:15px;flex:none}
  .sr3m-bottom{display:flex;align-items:center;gap:8px}
  .sr3m-bottom .sum-bar{flex:1}
  .sr3m-bottom .num{font-size:12px;color:var(--sub);white-space:nowrap;flex:none}
}
@media(min-width:700px) and (max-width:1023px){
  .phead,.prow{grid-template-columns:minmax(180px,2fr) 100px 110px 100px 120px}
}

/* ============================================================
   v6 追加：ダッシュボード／売場／本社倉庫／受払台帳／売上・経費／一覧表
   ============================================================ */

/* ---- ダッシュボードKPI ---- */
.kpi-grid{display:grid;grid-template-columns:repeat(6,1fr);gap:8px;margin-bottom:16px}
.kpi-card{min-width:0;padding:13px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
.kpi-card .k{display:block;color:var(--sub);font-size:11px;font-weight:700;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.kpi-card .v{display:block;margin-top:5px;font-size:19px;line-height:1.2}
.kpi-card .v2{display:block;margin-top:2px;font-size:11.5px}
.kpi-card .v3{display:block;margin-top:3px;font-size:11px;color:var(--sub);font-weight:700}

.dash-grid{display:grid;grid-template-columns:minmax(0,1.5fr) minmax(0,1fr);gap:14px;align-items:start}
.chart-card{padding:16px}
.chart-card .ch-sub{margin:-8px 0 10px;color:var(--sub);font-size:11.5px;font-weight:600}
.chart-wrap{position:relative;height:230px}
.chart-wrap.sm{height:170px}
.legend-row{display:flex;gap:14px;flex-wrap:wrap;margin-bottom:8px;color:var(--sub);font-size:11.5px;font-weight:700}
.legend-row .lg{width:12px;height:12px;display:inline-block;margin-right:5px;border-radius:3px;vertical-align:-1px}

.report-status-table{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
.rst-row{display:grid;grid-template-columns:minmax(0,1fr) 90px 70px;align-items:center;gap:8px;padding:7px 2px;border-bottom:1px solid var(--line);font-size:12.5px}
.rst-row:last-child{border-bottom:0}
.rst-row b{font-size:13px}
.rst-row .rst-days{text-align:right;font-weight:800}
.rst-row .rst-days.warn2{color:var(--warn-ink)}
.rst-badge{justify-self:end;font-size:10px;padding:2px 7px}

/* ---- 売場（一覧・詳細） ---- */
.shelf-table{width:100%;border-collapse:collapse}
.shelf-table th{padding:8px 10px;border-bottom:2px solid var(--line);color:var(--sub);font-size:11px;font-weight:700;text-align:right;white-space:nowrap}
.shelf-table th:first-child{text-align:left}
.shelf-table td{padding:11px 10px;border-bottom:1px solid var(--line);text-align:right;font-size:13.5px;white-space:nowrap}
.shelf-table td:first-child{text-align:left}
.shelf-table tr.shelf-row{cursor:pointer}
.shelf-table tr.shelf-row:hover td{background:var(--surface)}
.shelf-name{display:flex;align-items:center;gap:8px;font-weight:800;font-size:14px}
.shelf-name small{color:var(--sub);font-weight:600;font-size:11px}
.shelf-amt{font-size:16px}

/* ---- 売場一覧：スマホはカード化 ---- */
.shelf-cards{grid-template-columns:minmax(0,1fr);gap:8px}
.shelf-card{width:100%;padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;text-align:left}
.shelf-card-top{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.shelf-card-top b{font-size:15px}
.shelf-card-top small{color:var(--sub);font-weight:600;font-size:11px}
.shelf-card-main{display:flex;align-items:baseline;justify-content:space-between;padding-bottom:8px;margin-bottom:8px;border-bottom:1px solid var(--line)}
.shelf-card-main .k{color:var(--sub);font-size:11px;font-weight:700}
.shelf-card-main .v{font-size:19px}
.shelf-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px}
.shelf-card-grid .k{display:block;color:var(--sub);font-size:10.5px;font-weight:700}
.shelf-card-grid .v{display:block;font-size:13.5px;margin-top:1px}

.shelf-detail-head{display:flex;align-items:center;gap:12px;margin-bottom:14px;flex-wrap:wrap}
.shelf-detail-head h1{margin:0}
.back-link{display:inline-flex;align-items:center;gap:4px;color:var(--sub);font-size:12.5px;font-weight:700;border:0;background:none;padding:0;margin-bottom:8px}
.shelf-kpi{display:grid;grid-template-columns:repeat(5,1fr);gap:8px;margin-bottom:14px}
/* 売上報告を切り離している間（売上のカードが無い時）の列数 */
.kpi-grid.kpi-5{grid-template-columns:repeat(5,1fr)}
.shelf-kpi.kpi-4{grid-template-columns:repeat(4,1fr)}

.shelf-ptable{width:100%;border-collapse:collapse}
.shelf-ptable th{padding:8px 8px;border-bottom:2px solid var(--line);color:var(--sub);font-size:10.5px;font-weight:700;text-align:right}
.shelf-ptable th:first-child{text-align:left}
.shelf-ptable td{padding:9px 8px;border-bottom:1px solid var(--line);text-align:right;font-size:13px;vertical-align:middle}
.shelf-ptable td:first-child{text-align:left}
.shelf-ptable .pname{display:flex;align-items:center;gap:8px;font-weight:700}
.stockmonth-cell{border-radius:6px;font-weight:800;padding:4px 8px;display:inline-block;min-width:34px}
.stockmonth-0{background:var(--redbg);color:var(--red-ink)}
.stockmonth-low{background:var(--warnbg);color:var(--warn-ink)}
.stockmonth-over{background:var(--overbg);color:#3D5E9E}
.spark{display:block;overflow:visible}

/* ---- 売場詳細：スマホは商品カード化 ---- */
.shelf-pcards{grid-template-columns:minmax(0,1fr);gap:8px}
.shelf-pcard{padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff}
.shelf-pcard-top{display:flex;align-items:center;gap:8px;margin-bottom:10px;flex-wrap:wrap}
.shelf-pcard-top .name{font-weight:800;font-size:14px}
.shelf-pcard-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;padding-bottom:10px;margin-bottom:10px;border-bottom:1px solid var(--line)}
.shelf-pcard-grid .k{display:block;color:var(--sub);font-size:9.5px;font-weight:700;white-space:nowrap}
.shelf-pcard-grid .v{display:block;margin-top:2px;font-size:14px}
.shelf-pcard-grid .v.big{font-size:20px}
.shelf-pcard-grid .stockmonth-cell{margin-top:2px;font-size:13px}
.shelf-pcard-bottom{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap}
.shelf-pcard-bottom .k{display:block;color:var(--sub);font-size:9.5px;font-weight:700;margin-bottom:4px}
.qty-wrap{text-align:right}

/* ---- 本社倉庫 ---- */
.hq-head{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.hq-select{min-height:44px;padding:0 30px 0 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px;font-weight:800;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8078' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:16px}

/* ---- 在庫受払台帳 ---- */
.ledger-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.ledger-filters select{min-height:44px;padding:0 30px 0 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px;font-weight:700;appearance:none;-webkit-appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238A8078' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");background-repeat:no-repeat;background-position:right 8px center;background-size:16px}
.ledger-table{width:100%;border-collapse:collapse;margin-bottom:16px}
.ledger-table th{padding:8px 9px;border-bottom:2px solid var(--line);color:var(--sub);font-size:11px;font-weight:700;text-align:right;white-space:nowrap}
.ledger-table th:first-child{text-align:left}
.ledger-table td{padding:9px;border-bottom:1px solid var(--line);text-align:right;font-size:13px}
.ledger-table td:first-child{text-align:left;font-weight:700}
.ledger-table tr{cursor:pointer}
.ledger-table tr.on td{background:var(--surface)}
.ledger-detail{border:1px solid var(--line);border-radius:10px;padding:14px 16px;background:#fff}
.ledger-detail h3{margin:0 0 10px;font-size:14px}
.ledger-tr-row{display:grid;grid-template-columns:100px 100px minmax(0,1fr) minmax(0,1fr);gap:8px;padding:7px 0;border-bottom:1px solid var(--line);font-size:12.5px;align-items:center}
.ledger-tr-row:last-child{border-bottom:0}

/* ---- 売上・成績 ---- */
.rank-list{grid-template-columns:minmax(0,1fr);gap:2px;display:grid}
.rank-row{display:flex;align-items:center;gap:10px;padding:9px 2px;border-bottom:1px solid var(--line)}
.rank-row:last-child{border-bottom:0}

.rank-row .pname{flex:1;min-width:0;font-size:13.5px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.rank-row .amt{flex:none;font-size:14px}

/* ---- 経費 ---- */
.exp-table{width:100%;border-collapse:collapse;margin-top:14px}
.exp-table th{padding:8px 9px;border-bottom:2px solid var(--line);color:var(--sub);font-size:11px;font-weight:700;text-align:right}
.exp-table th:first-child{text-align:left}
.exp-table td{padding:9px;border-bottom:1px solid var(--line);text-align:right;font-size:13px}
.exp-table td:first-child{text-align:left;font-weight:700}
.exp-table tr.exp-total td{font-weight:800;border-top:2px solid var(--line);border-bottom:0}

/* ---- 経費：スマホはカード化 ---- */
.exp-cards{grid-template-columns:minmax(0,1fr);gap:8px;margin-top:14px}
.exp-card{padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff}
.exp-card.total{background:var(--surface)}
.exp-card-top{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:8px;padding-bottom:8px;border-bottom:1px solid var(--line)}
.exp-card-top b{font-size:14px}
.exp-card-top .v{font-size:17px}
.exp-card-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px 10px}
.exp-card-grid .k{display:block;color:var(--sub);font-size:10.5px;font-weight:700}
.exp-card-grid .v{display:block;font-size:13.5px;margin-top:1px}

/* ---- 工場ガント ---- */
.gantt-card{padding:16px 16px 10px}
.gantt-axis{display:flex;justify-content:space-between;padding:0 0 6px;margin-bottom:8px;border-bottom:1px solid var(--line);color:var(--sub);font-size:10.5px;font-weight:700}
.gantt-rows{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
.gantt-row{display:grid;grid-template-columns:200px minmax(0,1fr);gap:12px;align-items:center}
.gantt-row .glabel{font-size:12.5px;font-weight:700;min-width:0}
.gantt-row .glabel .gname{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gantt-row .glabel small{display:block;color:var(--sub);font-weight:600;font-size:10.5px;line-height:1.4;white-space:normal}
.gantt-track{position:relative;height:26px;background:var(--surface);border-radius:6px}
.gantt-bar{position:absolute;top:4px;height:18px;border-radius:5px;display:flex;align-items:center;padding:0 8px;font-size:10.5px;font-weight:800;color:#fff;white-space:nowrap;overflow:hidden}
.gantt-bar.done{background:var(--blue)}
.gantt-bar.plan{background:repeating-linear-gradient(135deg,var(--blue) 0 6px,#7C97C4 6px 12px);opacity:.92;text-shadow:0 0 2px rgba(17,17,17,.75),0 0 1px rgba(17,17,17,.9)}
.gantt-today{position:absolute;top:-4px;bottom:-4px;width:2px;background:var(--ink);z-index:1}
.gantt-row:first-child .gantt-today:after{content:"今日";position:absolute;top:-16px;left:50%;transform:translateX(-50%);font-size:9.5px;font-weight:800;color:var(--ink);white-space:nowrap}

/* ---- 一覧表 v2 ---- */
.lt-modebar{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.lt-cellnum{font-weight:800;font-variant-numeric:tabular-nums}
.lt-monthcell{border-radius:6px;padding:3px 6px;display:inline-block;min-width:26px}

/* ---- 未取込バッジ（サイドバー内） ---- */

@media(max-width:1023px){
  .kpi-grid{grid-template-columns:repeat(3,1fr)}
  .dash-grid{grid-template-columns:1fr}
  .shelf-kpi{grid-template-columns:repeat(3,1fr)}
  .kpi-grid.kpi-5{grid-template-columns:repeat(3,1fr)}
  .kpi-grid.kpi-5 .kpi-card:last-child{grid-column:span 2}
  .shelf-kpi.kpi-4{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:767px){
  .kpi-grid{grid-template-columns:repeat(2,1fr)}
  .shelf-kpi{grid-template-columns:repeat(2,1fr)}
  .kpi-grid.kpi-5{grid-template-columns:repeat(2,1fr)}
  .kpi-grid.kpi-5 .kpi-card:last-child{grid-column:1/-1}
  .gantt-row{grid-template-columns:1fr}

  .ledger-tr-row{grid-template-columns:1fr 1fr}
  .shelf-cards.only-mobile{display:grid}
  .exp-cards.only-mobile{display:grid}
  .shelf-pcards.only-mobile{display:grid}
  
}

/* ============================================================
   v7 追加：本社倉庫の入出庫（フォーム・ロットパネル・履歴・棒グラフ）
   ============================================================ */

.hq-top-kpi{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-bottom:16px}
.hq-top-kpi .kpi-card{padding:14px 14px}
.hq-top-kpi .v{font-size:22px}

/* ---- 右からのシート（PC）／下からのシート（スマホ＝既存.sheetを流用） ---- */

/* ---- 入庫・出庫・棚卸フォーム ---- */

/* ---- 棚卸（まとめて・全商品） ---- */

.hqb-row .ph{width:32px;height:32px;border-radius:6px;object-fit:cover;flex:none}

/* ---- 入庫/出庫（まとめて）：棚卸と同じ作り。最後列（入力後）だけ少し広く・折返し可 ---- */

/* ---- 自作カレンダー ---- */

/* ---- 商品別 入出庫（本社倉庫） ---- */

/* ---- ロット詳細パネル ---- */

.lo-group-btn{width:100%;margin:0;padding:0;border:0;background:none;text-align:left;cursor:pointer;font:inherit}
.lo-group-btn .chev{flex:none;color:var(--sub);transition:transform .2s}
.lo-group-btn .chev.up{transform:rotate(180deg)}
.lo-group-detail{margin-top:8px;padding:8px 10px;border-radius:8px;background:var(--surface)}
.lo-group-item{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:4px 0;font-size:12px}
.lo-group-item b{color:var(--red-ink);font-weight:800}

/* ---- 入出庫の履歴 ---- */

.hist-list{display:grid;gap:2px}
.hist-row{width:100%;display:grid;grid-template-columns:96px 76px minmax(0,1.6fr) 64px 70px minmax(0,1fr) minmax(0,1fr);align-items:center;gap:6px 10px;padding:9px 4px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left;font-size:12.5px}
.hist-list.compact .hist-row{grid-template-columns:64px 66px minmax(0,1.6fr) 56px}
.hist-list.ships .hist-row{grid-template-columns:66px minmax(0,1.2fr) minmax(0,1fr)}
.hist-row:last-child{border-bottom:0}
button.hist-row{cursor:pointer}

.hist-type.pending{background:none;border:1px dashed var(--sub);color:var(--sub)}
.hist-date{white-space:nowrap}
.hist-flow{min-width:0;display:flex;align-items:center;gap:6px;font-weight:700}
.hist-flow small{display:block;color:var(--sub);font-weight:600;font-size:10.5px;white-space:normal;line-height:1.3}
.hist-qty{text-align:right;white-space:nowrap}
.hist-qty.up{color:var(--ok-ink)}.hist-qty.down{color:var(--red-ink)}
.hist-after{text-align:right}
.hist-track,.hist-memo{color:var(--sub);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.linklike-row:hover{background:var(--surface)}
.hist-row.pending,.linklike-row.pending{opacity:.7}
.pill.pending-note{background:var(--surface);color:var(--sub);border:1px dashed var(--line2)}
.hist-pending-wrap{margin-bottom:14px;border:1px dashed var(--line2);border-radius:10px;overflow:hidden;background:var(--surface)}
.hist-pending-toggle{width:100%;min-height:44px;padding:0 14px;display:flex;align-items:center;justify-content:space-between;border:0;background:none;text-align:left}
.hist-pending-toggle .chev{color:var(--sub);transition:transform .2s}
.hist-pending-toggle .chev.up{transform:rotate(180deg)}
.hist-pending-wrap .hqhist-tablewrap,.hist-pending-wrap .hqhist-cards{margin:0 12px 12px;border-radius:8px}

/* ---- 入出庫の履歴：本表（見出しつき・列を分ける） ---- */

.hqhist-table tr.pending{background:repeating-linear-gradient(135deg,rgba(138,128,120,.05) 0 10px,rgba(138,128,120,.09) 10px 20px)}

.hqhist-prod{font-weight:700;white-space:normal}

/* ---- 入出庫の履歴：スマホはカード ---- */

.hqhist-card.pending{background:var(--surface);border-style:dashed}

/* ---- ダッシュボード：入庫元別・出庫先別の横棒 ---- */
.hqbar-group{margin-bottom:14px}
.hqbar-group:last-child{margin-bottom:0}
.hqbar-h{margin-bottom:6px;font-size:11.5px;font-weight:800;color:var(--sub)}
.hqbar-row{display:grid;grid-template-columns:100px minmax(0,1fr) 88px;align-items:center;gap:8px;padding:4px 0}
.hqbar-label{font-size:12px;font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hqbar-track{position:relative;height:10px;border-radius:5px;background:var(--surface);overflow:hidden}
.hqbar-track i{display:block;height:100%;border-radius:5px;background:var(--blue)}
.hqbar-group.out .hqbar-track i{background:var(--ok)}

@media(max-width:1023px){
  .hq-top-kpi{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:767px){
  .hq-top-kpi{grid-template-columns:repeat(1,1fr)}

  .hist-row{grid-template-columns:1fr 1fr;font-size:11.5px}
  .hist-list.compact .hist-row,.hist-list.ships .hist-row{grid-template-columns:1fr}
  .hist-after,.hist-track,.hist-memo{display:none}
  
}

/* v7i：スマホの本社倉庫（表を画面幅に収める・ロットはカード） */

@media(max-width:767px){

  .hq-prow-btn .lt-thumb{width:28px;height:28px;flex:none}

}

.page-head{display:flex;align-items:center;justify-content:space-between;gap:8px 12px;flex-wrap:wrap;margin-bottom:14px}
.page-head .h1{margin:2px 0 0}

/* ======== 本番版の追加・上書き（デモのCSSの後ろに重ねる） ======== */
:root{color-scheme:light;--ink:#111111;--sub:#6E655E;--line:rgba(26,22,20,.1);--line2:rgba(26,22,20,.16);--page:#FAF8F5;--surface:#F4F0EA;--ok:#2F7A4B;--okbg:#E2F1E7;--red:#C84B3C;--redbg:#F8E1DC;--blue:#2F5E9A;--bluebg:#E3ECF7;--gold:#B8916A;--goldbg:#F1E6D8;--warn:#D89B3C;--warn-ink:#8F5D0E;--red-ink:#A83A2D;--ok-ink:#276A40;--gold-ink:#7E5E38;--warnbg:#FBF0D2;--over:#4C6FB0;--overbg:#E7ECF7;--radius:8px;--radius-pill:999px;--tabh:60px;--sidebar-w:220px;--sidebar-w-sm:64px;--sidebar-bg:#1F2328;--sidebar-line:rgba(255,255,255,.09);--sidebar-sub:#9AA1AC}
*{box-sizing:border-box}
html,body{overflow-x:hidden}
html{-webkit-text-size-adjust:100%}
body{margin:0;background:var(--page);color:var(--ink);font-family:"Hiragino Sans","Noto Sans JP",Inter,system-ui,sans-serif;font-size:15px;-webkit-font-smoothing:antialiased}
button,input,textarea{font:inherit;color:inherit}
button{cursor:pointer}
svg{display:block}

.num{font-variant-numeric:tabular-nums}
.muted{color:var(--sub);font-size:13px}
.only-mobile{display:none}
.num1{color:var(--ink);font-weight:800;font-variant-numeric:tabular-nums}
.num2{color:var(--sub);font-weight:500;font-variant-numeric:tabular-nums}
.shell{display:flex;min-height:100vh}
.sidebar{flex:none;width:var(--sidebar-w);background:var(--sidebar-bg);color:#fff;display:flex;flex-direction:column;position:fixed;left:0;top:0;bottom:0;height:100vh;overflow-y:auto;z-index:10}
.sb-brand{font-size:16px;font-weight:800;white-space:nowrap}
.sb-nav{flex:1;padding:6px 10px}
.sb-group{margin:14px 0 4px;padding:0 8px;font-size:10.5px;font-weight:800;letter-spacing:.04em;color:var(--sidebar-sub);white-space:nowrap;overflow:hidden}
.sb-item{position:relative;width:100%;min-height:44px;padding:0 10px;margin-bottom:2px;display:flex;align-items:center;gap:10px;border:0;border-radius:8px;background:none;color:#D8DCE2;font-size:13.5px;font-weight:700;text-align:left;white-space:nowrap;overflow:hidden}
.sb-item svg{flex:none;width:18px;height:18px;opacity:.85}
.sb-item span.lbl{overflow:hidden;text-overflow:ellipsis}
.sb-item:hover{background:rgba(255,255,255,.06)}
.sb-item.on{background:#fff;color:var(--ink)}
.sb-item.on svg{opacity:1;color:var(--ink)}
.sb-foot{padding:12px 16px 16px;border-top:1px solid var(--sidebar-line);color:var(--sidebar-sub);font-size:10.5px;line-height:1.7}
.sb-foot b{display:block;color:#D8DCE2;font-weight:700}
.main-col{flex:1;min-width:0;display:flex;flex-direction:column;margin-left:var(--sidebar-w)}
.top{position:sticky;top:0;z-index:20;border-bottom:1px solid var(--line);background:rgba(250,248,245,.94);backdrop-filter:blur(8px)}
.top-in{min-height:56px;padding:10px 20px;margin:auto;display:flex;align-items:center;gap:10px;width:100%}
.screen-title{font-size:16px;font-weight:800;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.asof{margin-left:auto;color:var(--sub);font-size:12px;white-space:nowrap;flex:none}
.icon-btn{width:44px;height:44px;padding:0;display:grid;place-items:center;border:1px solid var(--line2);border-radius:var(--radius);background:#fff;flex:none}
.icon-btn svg{width:19px}
.tabbar{display:none}
main{max-width:1320px;margin:0;padding:18px 22px 48px;width:100%}
.h1{margin:2px 0 14px;font-size:20px;font-weight:800}
.card{margin-bottom:14px;padding:16px;border:1px solid var(--line);border-radius:12px;background:#fff}
.ch{margin:0 0 12px;font-size:16px;font-weight:800}
.empty{color:var(--sub);font-size:13px}
.seg{display:inline-flex;gap:2px;margin-bottom:14px;padding:3px;border:1px solid var(--line2);border-radius:var(--radius-pill);background:var(--surface)}
.seg-b{min-height:44px;padding:0 16px;border:0;border-radius:var(--radius-pill);background:none;color:var(--sub);font-size:13px;font-weight:800}
.seg-b.on{background:#fff;color:var(--ink);box-shadow:0 1px 3px rgba(26,22,20,.15)}
.pill{display:inline-flex;align-items:center;font-size:10px;font-weight:800;padding:2px 8px;border-radius:99px;background:var(--redbg);color:var(--red-ink);margin-left:6px;white-space:nowrap;vertical-align:middle}
.qtybox{display:inline-flex;align-items:center;gap:6px}
.qtybtn{padding:0;border:1px solid var(--line2);border-radius:8px;background:#fff;font-weight:800;line-height:1;flex:none;width:44px;height:44px;font-size:18px}
.qtyfield{padding:0 2px;border:1px solid var(--line2);border-radius:8px;background:#fff;text-align:center;font-weight:800;-moz-appearance:textfield;width:60px;height:44px;font-size:16px}
.qtyfield::-webkit-outer-spin-button,.qtyfield::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.skel{height:12px;margin-top:13px;border-radius:8px;background:linear-gradient(90deg,var(--surface),#fff,var(--surface));animation:shimmer 1.1s infinite}
.sheet-actions{display:flex;gap:10px;margin-top:16px}
.sheet-actions .btn{flex:1}
.overlay{position:fixed;inset:0;background:rgba(26,22,20,.4);z-index:50;opacity:0;pointer-events:none;transition:opacity .25s}
.overlay.show{opacity:1;pointer-events:auto}
.sheet{position:fixed;left:0;right:0;bottom:0;z-index:51;background:var(--page);border-radius:16px 16px 0 0;max-height:88vh;overflow:auto;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;transform:translateY(105%);transition:transform .28s cubic-bezier(.2,.8,.2,1);padding:8px 16px calc(20px + env(safe-area-inset-bottom));box-shadow:0 -8px 24px rgba(26,22,20,.1);pointer-events:none}
.sheet.show{transform:none;pointer-events:auto}
@media(min-width:768px){.sheet{left:50%;right:auto;width:560px;bottom:auto;top:50%;border-radius:14px;transform:translate(-50%,-46%);opacity:0;transition:opacity .2s,transform .2s;max-height:86vh;padding:14px 22px 22px}
.sheet.show{transform:translate(-50%,-50%);opacity:1}
.grab{display:none}}
.grab{width:38px;height:4px;margin:0 auto 16px;border-radius:4px;background:var(--line2)}
.sheet h3{margin:0 0 14px;font-size:18px}

.sheet textarea{width:100%;padding:10px 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px;margin-bottom:4px;min-height:220px;line-height:1.6}
.pick-list{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
.pick-list button{min-height:44px;padding:0 8px;display:flex;align-items:center;gap:10px;border:0;border-radius:6px;background:none;text-align:left;font-weight:700}
.pick-list svg{width:18px;height:18px;flex:none;color:var(--sub)}
.toast{position:fixed;z-index:49;left:50%;bottom:24px;max-width:calc(100% - 32px);padding:12px 18px;border-radius:10px;transform:translate(-50%,20px);background:var(--ink);color:#fff;font-size:14px;font-weight:700;opacity:0;pointer-events:none;transition:all .25s}
.toast.show{transform:translate(-50%,0);opacity:1}
@keyframes shimmer{to{background-position:180px 0}}
@media(min-width:768px) and (max-width:1023px){.sidebar{width:var(--sidebar-w-sm)}
.main-col{margin-left:var(--sidebar-w-sm)}
.sb-brand{font-size:0;padding:18px 0;text-align:center}
.sb-brand:before{content:"在";font-size:16px}
.sb-group{display:none}
.sb-item{justify-content:center;padding:0}
.sb-item span.lbl{display:none}
.sb-foot{display:none}}
@media(max-width:767px){.sidebar{display:none}
.main-col{margin-left:0}
.only-pc{display:none!important}
.only-mobile{display:block}
.top-in{padding:10px 14px}
.tabbar{position:fixed;z-index:30;left:0;right:0;bottom:0;height:calc(var(--tabh) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);display:grid;grid-template-columns:repeat(5,1fr);background:#fff;border-top:1px solid var(--line2)}
.tbb{position:relative;border:0;background:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;color:var(--sub);font-size:10px;font-weight:700}
.tbb svg{width:21px;height:21px}
.tbb.on{color:var(--ink)}
.tbb.on:before{content:"";position:absolute;top:0;width:34px;height:3px;background:var(--ink);border-radius:0 0 3px 3px}
main{padding:12px 12px calc(var(--tabh) + 28px)}
.h1{font-size:17px}
.toast{bottom:calc(var(--tabh) + 16px)}}

@media(max-width:767px){.shell{display:block}
.main-col{min-height:100vh}
.hqhist-cards.only-mobile{display:grid}}
.hq-toolbar{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:10px}
.hq-toolbar-btns{display:flex;gap:8px;flex-wrap:wrap}
@media(min-width:768px){.sheet.side{left:auto;right:0;top:0;bottom:0;width:440px;max-width:92vw;height:100vh;max-height:100vh;border-radius:0;transform:translateX(105%);transition:transform .28s cubic-bezier(.2,.8,.2,1);opacity:1;padding:20px 22px 22px}
.sheet.side.show{transform:translateX(0)}}
.hqf-row{display:flex;flex-direction:column;gap:5px;margin-bottom:12px}
.hqf-row label{color:var(--sub);font-size:12px;font-weight:700}
.hqf-row.block{gap:8px}
.hqf-select,.hqf-input{width:100%;min-height:44px;padding:0 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px}
textarea.hqf-input{min-height:64px;padding:10px 12px;line-height:1.5}
.hqf-preview{margin:4px 0 12px;padding:12px 14px;border-radius:10px;background:var(--surface);font-size:14px;font-weight:700;text-align:center}
.hqf-preview b{font-size:20px;font-weight:900;margin:0 4px}
.hqf-preview.bad{background:var(--redbg);color:var(--red-ink)}
.hqf-preview.good{background:var(--okbg);color:var(--ok-ink)}
.hqf-error{margin:-4px 0 12px;padding:9px 12px;border-radius:8px;background:var(--redbg);color:var(--red-ink);font-size:12.5px;font-weight:700}
.hqf-lots{display:grid;gap:6px;max-height:220px;overflow-y:auto}
.hqf-lot-opt{display:flex;align-items:center;gap:8px;padding:9px 10px;border:1px solid var(--line2);border-radius:8px;font-size:12.5px;font-weight:700;min-height:44px}
.hqf-lot-opt input{margin:0;flex:none}
.hqf-lot-opt.on{border:2px solid var(--ink);background:var(--surface)}
.hqf-advtoggle{width:100%;justify-content:center;margin-bottom:12px;background:var(--surface);border-color:var(--surface);color:var(--sub)}
.hqf-adv{padding-top:2px}
.hqf-datewrap{display:flex;gap:8px;flex-wrap:wrap}
.hqb-list{display:flex;flex-direction:column;gap:0;margin:2px 0 4px;border:1px solid var(--line);border-radius:10px;padding:2px 6px;max-height:48vh;overflow-y:auto;-webkit-overflow-scrolling:touch}
.hqb-row{display:grid;align-items:center;gap:8px;padding:7px 0;border-bottom:1px solid var(--line)}
.hqb-row:last-child{border-bottom:0}
.hqb-name{font-size:12.5px;font-weight:700;line-height:1.25;overflow-wrap:anywhere}
.hqb-head{display:grid;gap:8px;padding:6px 0 2px;font-size:10.5px;font-weight:700;color:var(--sub);position:sticky;top:0;background:var(--page);z-index:1}
.hqb-head span{text-align:right}

.hqb-book{text-align:right;color:var(--sub);font-weight:700;font-size:12.5px}
.hqb-input{width:100%;min-height:44px;padding:0 8px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px;font-weight:800;text-align:right}
.hqb-diff{text-align:right;font-size:12px;font-weight:800;color:var(--sub);white-space:nowrap}
.hqb-diff.good{color:var(--ok-ink)}
.hqb-diff.bad{color:var(--red-ink)}
.hqb-summary{margin:10px 0 2px;padding:11px 14px;border-radius:10px;background:var(--surface);font-size:13px;font-weight:700;text-align:center}
.hqb-summary b{font-weight:900}
@media(max-width:767px){.hqb-row,.hqb-head{gap:6px}}

.hqb-list.inout .hqb-diff{white-space:normal;line-height:1.2}
.hqb-row.err{background:var(--redbg);border-radius:6px}

.datecal{margin:6px 0 14px;padding:10px;border:1px solid var(--line2);border-radius:10px;background:#fff}
.datecal-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:8px;font-size:13px;font-weight:800}
.datecal-head .btn{min-height:44px;min-width:44px;padding:0 10px}
.datecal-wd{display:grid;grid-template-columns:repeat(7,1fr);margin-bottom:2px;color:var(--sub);font-size:10.5px;font-weight:700;text-align:center}
.datecal-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:2px}
.dcal-cell{min-height:44px;border:0;border-radius:6px;background:none;font-size:12.5px;font-weight:700;text-align:center}
.dcal-cell.empty{visibility:hidden}
.dcal-cell.today{color:var(--blue);font-weight:900}
.dcal-cell.sel{background:var(--ink);color:#fff}
.hq-prod-table{width:100%;border-collapse:collapse;font-size:13px}
.hq-prod-table th,.hq-prod-table td{padding:9px 10px;border-bottom:1px solid var(--line);text-align:right}
.hq-prod-table th:first-child,.hq-prod-table td:first-child{text-align:left}
.hq-prod-table thead th{background:var(--surface);color:var(--sub);font-size:11px;font-weight:700}
.hq-prow-btn{width:100%;min-height:44px;padding:8px 10px;display:flex;align-items:center;gap:8px;border:0;background:none;text-align:left;font-weight:700}
.hq-prow-btn .chev{margin-left:auto;color:var(--sub);transition:transform .2s}
.hq-prow-btn .chev.up{transform:rotate(180deg)}
.hq-prow-detail td{padding:12px 14px 16px;background:var(--surface)}
.hq-origin-breakdown{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:10px}
.hq-origin-chip{padding:6px 10px;border-radius:99px;background:#fff;border:1px solid var(--line2);font-size:12px;font-weight:700}
.hq-origin-chip b{margin-right:6px;font-weight:800}
.hq-lot-table{border-collapse:collapse;width:max-content;min-width:100%;font-size:12.5px;background:#fff}
.hq-lot-table th,.hq-lot-table td{padding:7px 9px;border-bottom:1px solid var(--line);text-align:right;white-space:nowrap}
.hq-lot-table th:first-child,.hq-lot-table td:first-child{text-align:left}
.hq-lot-table thead th{background:var(--surface);color:var(--sub);font-weight:700;font-size:10.5px}
.hq-lot-row.warn td{background:var(--warnbg)}
.hq-lot-row.exp-mid td,.hq-lot-row.exp-mid .linklike{color:var(--red-ink)}
.hq-lot-row.exp-hi td,.hq-lot-row.exp-hi .linklike{color:var(--red-ink);font-weight:800}
.linklike{border:0;background:none;padding:0;color:var(--blue);font-weight:800;text-decoration:underline;font-size:inherit}
@keyframes hqflash{0%{background:var(--warnbg)}100%{background:transparent}}
.hq-prow.flash-row td{animation:hqflash 1.6s ease-out}
.lotpanel-sec{margin-bottom:14px}
.lotpanel-h{margin-bottom:8px;font-size:13px;font-weight:800;color:var(--sub)}
.lotpanel-origin{display:grid;grid-template-columns:repeat(2,1fr);gap:8px 12px;padding:12px;border-radius:10px;background:var(--surface)}
.lotpanel-origin .k{display:block;color:var(--sub);font-size:10.5px;font-weight:700}
.lotpanel-origin b{display:block;font-size:14px;margin-top:1px}
.lotpanel-flow{display:flex;align-items:center;gap:6px;margin-bottom:14px;padding:10px 4px}
.fnode{flex:1;min-width:0;min-height:52px;padding:8px;border:1px solid var(--line2);border-radius:8px;display:flex;flex-direction:column;align-items:center;justify-content:center;text-align:center;font-size:11.5px;font-weight:800;white-space:normal;word-break:break-word;line-height:1.3}
.fnode.main{background:var(--ink);color:#fff;border-color:var(--ink)}
.fnode small{display:block;margin-top:3px;font-weight:600;color:var(--sub)}
.fnode.main small{color:#8C847C}
.farrow{flex:none;color:var(--sub);font-weight:800}
.lotpanel-out-row{padding:9px 0;border-bottom:1px solid var(--line)}
.lotpanel-out-row:last-child{border-bottom:0}
.lo-top{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:700;flex-wrap:wrap}
.lo-top span{flex:1;min-width:80px;color:var(--sub);font-weight:600}
.lo-track{margin-top:3px;color:var(--sub);font-size:11px}
.lo-track a{color:var(--blue);font-weight:700;text-decoration:underline}
.lo-memo{margin-top:2px;color:var(--sub);font-size:11px}
.hist-count{margin-bottom:8px;color:var(--sub);font-size:11.5px;font-weight:700}
.hist-filters{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:12px}
.hist-filters select,.hist-filters input{min-height:44px;padding:0 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:16px}
.hist-filters input{flex:1;min-width:160px}
.hist-filters select{max-width:100%;min-width:0}
.hist-type{display:inline-flex;justify-self:start;padding:3px 8px;border-radius:99px;font-size:10.5px;font-weight:800;white-space:nowrap}
.hist-type.in{background:var(--okbg);color:var(--ok-ink)}
.hist-type.out{background:var(--goldbg);color:#8A5526}
.hist-type.adj{background:var(--surface);color:var(--sub)}
.hqhist-tablewrap{border:1px solid var(--line);border-radius:10px;background:#fff}
.hqhist-table{border-collapse:collapse;table-layout:fixed;width:100%;min-width:900px;font-size:12.5px}
.hqhist-table th,.hqhist-table td{padding:9px 8px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle;overflow-wrap:break-word}
.hqhist-table thead th{background:var(--surface);color:var(--sub);font-weight:700;font-size:11px;line-height:1.3}
.hqhist-table tbody tr:last-child td{border-bottom:0}
.hqhist-table col.c-type{width:10%}
.hqhist-table col.c-date{width:10%}
.hqhist-table col.c-prod{width:26%}
.hqhist-table col.c-ft{width:16%}
.hqhist-table col.c-qty{width:6%}
.hqhist-table col.c-after{width:9%}
.hqhist-table col.c-track{width:14%}
.hqhist-table col.c-memo{width:9%}
.hqhist-table td:nth-child(2){white-space:nowrap}
.hqhist-table td:nth-child(7),.hqhist-table td:nth-child(7) a{white-space:nowrap;word-break:normal}

.hqhist-ft{color:var(--sub);font-weight:600;white-space:normal}
.hqhist-up{color:var(--ok-ink);text-align:right;font-weight:800;white-space:nowrap}
.hqhist-down{color:var(--red-ink);text-align:right;font-weight:800;white-space:nowrap}
.hqhist-table td.num1{text-align:right}
.hqhist-table a{color:var(--blue);font-weight:700;text-decoration:underline;white-space:normal;word-break:break-all}
.hqhist-cards{gap:8px}
.hqhist-card{padding:11px 13px;border:1px solid var(--line);border-radius:10px;background:#fff}
.hqhist-card-top{display:flex;align-items:center;justify-content:space-between;margin-bottom:7px}
.hqhist-card-prod{font-weight:700;font-size:13.5px;margin-bottom:4px}
.hqhist-card-ft{color:var(--sub);font-size:11.5px;font-weight:600;margin-bottom:6px}
.hqhist-card-nums{display:flex;align-items:center;gap:12px;font-size:14px}
.hqhist-card-track{margin-top:6px;color:var(--sub);font-size:11px}
.hqhist-card-track a{color:var(--blue);font-weight:700;text-decoration:underline}
@media(max-width:767px){.hq-toolbar{flex-direction:column;align-items:stretch}
.hq-toolbar-btns .btn{flex:1}
.lotpanel-origin{grid-template-columns:1fr}}
.only-mobile-br{display:none}
@media(max-width:767px){.only-mobile-br{display:inline}
.pc-no{display:none}
.hq-prod-table{table-layout:fixed;font-size:12px}
.hq-prod-table col,.hq-prod-table th:nth-child(1){width:auto}
.hq-prod-table th:nth-child(2),.hq-prod-table td:nth-child(2){width:58px}
.hq-prod-table th:nth-child(3),.hq-prod-table td:nth-child(3),.hq-prod-table th:nth-child(4),.hq-prod-table td:nth-child(4){width:52px}
.hq-prod-table th,.hq-prod-table td{padding:8px 6px}
.hq-prod-table thead th{line-height:1.25}
.hq-prow-btn{padding:8px 6px;gap:6px;font-size:13px;line-height:1.25;overflow-wrap:anywhere}
.hq-prow-detail td{padding:8px 6px!important}
.hq-prow-detail .hq-table-wrap{overflow:visible;border:0;background:none}
.hq-lot-table{width:100%;min-width:0;background:none}
.hq-lot-table thead{display:none}
.hq-lot-table,.hq-lot-table tbody{display:block}
.hq-lot-table tr.hq-lot-row{display:grid;grid-template-columns:1fr 1fr;gap:4px 12px;margin-bottom:8px;padding:10px 12px;border:1px solid var(--line);border-radius:10px;background:#fff}
.hq-lot-table tr.hq-lot-row td{display:block;width:auto;min-width:0;padding:0;border:0;background:none!important;text-align:left;white-space:normal;font-size:12.5px}
.hq-lot-table tr.hq-lot-row td:first-child{grid-column:1/-1;font-size:14px}
.hq-lot-table tr.hq-lot-row td[data-k]::before{content:attr(data-k);display:block;color:var(--sub);font-size:10.5px;font-weight:700}
.hq-lot-table tr.hq-lot-row.warn{border-color:#E9C46A}
.hq-lot-table tr.hq-lot-row.exp-mid,.hq-lot-table tr.hq-lot-row.exp-hi{border-color:#E8B4AC}}
.hist-lots{font-size:11.5px;font-weight:600;color:var(--sub);margin-top:2px;line-height:1.5}
.hist-lots .linklike{font-size:11.5px;font-weight:700}
.hqhist-card .hist-lots{margin:2px 0 4px}

/* ============================================================
   本番版 追加（ログイン・商品の指定・商品マスタ・状態表示）
   ============================================================ */
.login-wrap{min-height:100vh;display:grid;place-items:center;padding:20px}
.login-card{width:100%;max-width:380px;padding:24px 20px;margin:0}
.login-brand{margin-bottom:18px;font-size:20px;font-weight:800;text-align:center}
.login-card .btn-block{margin-top:6px}
.state-box{padding:22px 18px;border:1px solid var(--line);border-radius:12px;background:#fff}
.state-box.err{border-color:rgba(200,75,60,.35);background:var(--redbg)}
.state-box.err b{display:block;margin-bottom:6px;color:#9C3423}
.state-box.err p{margin:0 0 12px;color:#9C3423;font-size:13.5px;line-height:1.6}
.stale-bar{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px;padding:8px 12px;border-radius:8px;background:var(--warnbg);color:#8A5E14;font-size:13px;font-weight:700}
.hq-prow-name{text-align:left;display:flex;flex-direction:row;align-items:center;gap:10px;min-width:0}
.hq-prow-name small{font-size:10.5px;font-weight:600}
.hqf-fixed{min-height:44px;padding:0 12px;display:flex;align-items:center;gap:6px;border-radius:8px;background:var(--surface);font-size:15px;font-weight:700}
.hqf-fixed small{color:var(--sub);font-weight:600;font-size:12px}
.hqb-name small{display:block;font-size:10.5px;font-weight:600}
.pk-row{display:flex;gap:8px;flex-wrap:wrap}
.pk-row .hqf-input{flex:1;min-width:140px}
.pk-msg{margin-top:8px;padding:9px 12px;border-radius:8px;font-size:13px;font-weight:700;line-height:1.55}
.pk-msg.hint{background:var(--surface);color:var(--sub)}
.pk-msg.bad{background:var(--redbg);color:#9C3423}
.pk-msg.warn{background:var(--warnbg);color:#8A5E14}
.pk-msg.ok{background:var(--okbg);color:var(--ok-ink)}
.pk-cands{display:grid;gap:6px;margin-top:8px}
.pk-cand{min-height:44px;display:flex;align-items:center;gap:10px;padding:8px 12px;border:1px solid var(--line2);border-radius:8px;background:#fff;text-align:left}
.pk-cand b{font-size:15px}
.pk-cand span{flex:1;min-width:0;font-weight:700}
.pk-cand small{color:var(--sub)}
.pk-sel{margin-top:8px;padding:12px 14px;border:2px solid var(--ink);border-radius:10px;background:#fff}
.pk-sel-name{font-size:16px;font-weight:800}
.pk-sel-sub{margin-top:4px;font-size:12px;line-height:1.6}
.pill.exc{background:var(--warnbg);color:#8A5E14}
.cam-box{position:relative;overflow:hidden;border-radius:10px;background:#111;aspect-ratio:4/3;max-width:560px;margin-left:auto;margin-right:auto}
.cam-box video{width:100%;height:100%;object-fit:cover;display:block}
.cam-guide{position:absolute;border:2px solid rgba(255,255,255,.85);border-radius:8px;pointer-events:none;left:5%;right:5%;top:25%;bottom:25%}
.party-edit{margin:-4px 0 14px;padding:10px;border:1px dashed var(--line2);border-radius:10px;background:var(--surface)}
.party-edit-row{display:flex;gap:6px;margin-bottom:8px;align-items:center}
.party-edit-row .hqf-input{flex:1;min-width:0}
.btn-danger{color:#9C3423;border-color:rgba(200,75,60,.45)}

.mst-table{border-collapse:collapse;width:100%;min-width:760px;font-size:13px}
.mst-table th,.mst-table td{padding:9px 10px;border-bottom:1px solid var(--line);text-align:left;vertical-align:middle}
.mst-table thead th{background:var(--surface);color:var(--sub);font-weight:700;font-size:11px}
.mst-table tbody tr:last-child td{border-bottom:0}
.mst-name{font-weight:700}
.mst-table td{white-space:nowrap}
.mst-table td.mst-name{white-space:normal;min-width:240px}
.mst-act{display:flex;gap:8px;justify-content:flex-end}
.mst-act-m{display:flex;gap:8px;margin-top:10px}
.mst-act-m .btn{flex:1}
.del-msg{margin:0 0 12px;line-height:1.7}
input[type=search]{-webkit-appearance:none;appearance:none}
.hqf-lot-opt input[type=checkbox]{width:22px;height:22px}

/* ---- Phase 2：デモから流用 ---- */
.pill.green{background:var(--okbg);color:var(--ok-ink);gap:4px}
.pill.green svg{width:11px}
.big-cta{min-height:54px;box-shadow:0 7px 18px rgba(26,22,20,.18);font-size:15px;margin-top:4px}
.big-cta.done{background:var(--okbg);border-color:var(--okbg);color:var(--ok-ink);box-shadow:none}
.done-banner{display:flex;align-items:center;gap:8px;margin-bottom:12px;padding:12px 14px;border-radius:10px;background:var(--okbg);color:var(--ok-ink);font-size:14px;font-weight:800}
.done-banner svg{width:20px}
.confirm-list{display:grid;grid-template-columns:minmax(0,1fr);gap:2px}
.confirm-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.confirm-row small{color:var(--sub)}.confirm-row .num{margin-left:auto;font-weight:800;color:var(--ok-ink)}
.confirm-total{display:flex;justify-content:space-between;padding-top:10px;font-weight:800}
.hq-table-wrap{border:1px solid var(--line);border-radius:10px;background:#fff;margin-bottom:14px}
.hq-table{border-collapse:collapse;width:max-content;min-width:100%;font-size:12.5px}
.hq-table th,.hq-table td{padding:7px 9px;border-bottom:1px solid var(--line);border-right:1px solid var(--line);text-align:right;white-space:nowrap}
.hq-table th:last-child,.hq-table td:last-child{border-right:0}
.hq-table thead th{background:var(--surface);color:var(--sub);font-weight:700;font-size:10.5px}
.hq-table th.hq-sticky,.hq-table td.hq-sticky{position:sticky;left:0;z-index:1;background:#fff;text-align:left;font-weight:700;min-width:150px;cursor:pointer}
.hq-table thead th.hq-sticky{z-index:2;background:var(--surface)}
.hq-table td.hq-sticky.on{color:var(--blue)}
.hq-cell{position:relative}
.hq-cell.neg{background:var(--redbg);color:var(--red-ink);font-weight:800}
.hq-cell.warn2{background:var(--warnbg);color:var(--warn-ink);font-weight:800}
.hq-cell b{font-weight:800}

/* ============================================================
   Phase 2 追加：赤マーク・売上報告・売場在庫・売上集計・利用者
   ============================================================ */
.low1{color:var(--red-ink)!important}
.low0{color:#8E1B10!important;font-weight:900}
.pill.low{background:var(--redbg);color:#9C3423;margin-left:6px}
.hq-cell.low1{background:var(--redbg)}
.hq-cell.low0{background:#F1C4BC}
.hq-table.matrix th{white-space:normal;min-width:84px}
.low-list{display:grid;gap:0}
.low-row{display:flex;align-items:center;gap:12px;padding:11px 2px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.low-row:last-child{border-bottom:0}
.low-name{flex:1;min-width:150px;display:flex;flex-direction:column;gap:2px}
.low-name small{font-size:11px}
.low-stock{font-size:17px}
.low-th{font-size:12px;white-space:nowrap}
.th-edit{margin-top:12px}
.th-edit label{display:block;margin-bottom:6px;color:var(--sub);font-size:12px;font-weight:700}
.store-tabs{display:flex;gap:6px;overflow-x:auto;padding-bottom:6px;margin-bottom:10px;-webkit-overflow-scrolling:touch}
.store-tab{flex:none;border:1px solid var(--line2);background:#fff;border-radius:var(--radius-pill);white-space:nowrap}
.store-tab.on{background:var(--ink);border-color:var(--ink);color:#fff}
.sales-shell main{max-width:560px;margin:0 auto;padding:12px 12px 60px;width:100%}
.sa-store{margin:2px 0 12px;font-size:18px;font-weight:800}
.sa-card{margin-bottom:12px}
.sa-h{margin-bottom:10px;font-size:15px;font-weight:800}
.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap}
.sa-card .hqf-row:last-child{margin-bottom:0}
.cart-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:8px 10px;padding:10px 0;border-bottom:1px solid var(--line)}
.cart-row:last-child{border-bottom:0}
.cart-name{font-weight:700;font-size:14px;display:flex;align-items:center;gap:10px;min-width:0}
.cart-name small{display:block;font-size:10.5px;font-weight:600}
.cart-warn{margin-top:4px;padding:5px 8px;border-radius:6px;background:var(--warnbg);color:#8A5E14;font-size:11.5px;font-weight:700;line-height:1.4}
.cart-row.warn{background:rgba(251,240,210,.35)}
.cart-del{padding:0;min-width:44px}
.cart-empty{padding:6px 0}

.rep-card{padding:12px 14px;border:1px solid var(--line);border-radius:10px;background:#fff;margin-bottom:8px}
.rep-card.voided{background:var(--surface);border-style:dashed}
.rep-top{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.rep-top .num2{flex:1}
.rep-items{font-size:13.5px;line-height:1.7}
.rep-sum{margin-top:6px;font-size:12px}
.voided .vstrike,.voided .hqhist-up,.voided .hqhist-down{text-decoration:line-through;color:var(--sub)}
.rep-card.voided .rep-items{text-decoration:line-through;color:var(--sub)}
.hqhist-row.voided td{background:var(--surface)}
.void-note{margin-top:4px;color:#9C3423;font-size:11.5px;font-weight:700}
.hist-type.sale{background:var(--bluebg);color:var(--blue)}
.hqhist-card.voided{background:var(--surface);border-style:dashed}
.hqhist-table.has-act col.c-act{width:9%}
.hqhist-table td:last-child .btn{white-space:nowrap}
.confirm-row.over b{color:#8A5E14}
.stat-kpis{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin-bottom:12px}
.stat-kpi{padding:14px;border:1px solid var(--line);border-radius:10px;background:#fff}
.stat-kpi .k{display:block;color:var(--sub);font-size:11px;font-weight:700}
.stat-kpi b{display:block;margin-top:4px;font-size:22px}
.stat-kpi small{display:block;margin-top:2px;font-size:11px}
.stat-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.stat-table{width:100%;min-width:0}
.stat-table th:not(:first-child),.stat-table td:not(:first-child){text-align:right}

.rank-row2{width:100%;min-height:56px;display:flex;align-items:center;gap:10px;padding:8px 2px;border:0;border-bottom:1px solid var(--line);background:none;text-align:left}
.rank-no{flex:none;width:22px;color:var(--sub);font-size:12px;font-weight:800;text-align:center}
.rank-name{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px;font-size:14px}
.rank-name small{font-size:11px}
.rank-qty{flex:none;font-size:15px}
.rank-amt{flex:none;min-width:84px;text-align:right}
.rank-row2 .chev{flex:none;color:var(--sub);transition:transform .2s}
.rank-row2 .chev.up{transform:rotate(180deg)}
.rank-detail{padding:4px 8px 10px 34px;background:var(--surface);border-bottom:1px solid var(--line)}
.rank-kid{display:flex;align-items:center;gap:10px;padding:6px 0;font-size:12.5px}
.rank-kid span:first-child{flex:1;min-width:0}
.rank-kid span:last-child{min-width:84px;text-align:right}
@media(max-width:767px){
  .rank-amt{min-width:70px;font-size:12px}
  .rank-name{font-size:13px}
}
.re-note{margin-top:4px;color:#8A5E14;font-size:11px;font-weight:700}

/* ======== Phase 3：デモ v7l と同等にするための追加（写真・売場チップ・設定ほか） ======== */
.ph.xs{width:32px}.ph.sm{width:40px}.ph.md{width:56px}
.ph-none{display:inline-block;background:var(--surface);border:1px dashed var(--line2);border-radius:8px;flex:none}

.hq-prow-txt{display:flex;flex-direction:column;min-width:0;text-align:left}
.pk-sel-ph{display:flex;gap:12px;align-items:center}.pk-sel-body{min-width:0}
.cart-name-txt{display:flex;flex-direction:column;min-width:0}
.hqhist-card-prod,.hqhist-prod>div{display:flex;align-items:center;gap:8px}
.low-row .ph{margin-right:10px}
.mst-name-in{display:flex;align-items:center;gap:10px;min-width:0}.mst-name-in .ph{flex:none}.mst-nm{min-width:0;overflow-wrap:anywhere}
.mst-table td.mst-note{white-space:normal;overflow-wrap:anywhere;min-width:120px}.mst-table .mst-notecol{width:20%}.mst-table .mst-wide{width:34%}
.pill.neutral{background:var(--surface);color:var(--sub);border:1px solid var(--line)}
.hq-sel-name{display:flex;align-items:center;gap:6px;min-width:0}
.hqb-row,.hqb-head{grid-template-columns:32px minmax(0,1fr) 46px 76px 54px}
.hqb-head span:nth-child(1){text-align:left}.hqb-head span:nth-child(2){text-align:left}
.hqb-list.inout .hqb-row,.hqb-list.inout .hqb-head{grid-template-columns:32px minmax(0,1fr) 46px 76px 70px}
@media(max-width:767px){.hqb-row,.hqb-head{grid-template-columns:28px minmax(0,1fr) 40px 68px 46px}.hqb-list.inout .hqb-row,.hqb-list.inout .hqb-head{grid-template-columns:28px minmax(0,1fr) 40px 68px 60px}}
.pf-photo{display:flex;align-items:center;gap:12px}.pf-photo-act{display:flex;gap:8px;flex-wrap:wrap}
label.btn.disabled{opacity:.5;pointer-events:none}
.hidden{display:none!important}
/* 売場の選び方：全売場が一目で見えて押せるチップ */
.store-chips{display:flex;flex-wrap:wrap;gap:8px;margin:0 0 12px}
.chip{min-height:44px;padding:0 14px;border:1px solid var(--line2);border-radius:var(--radius-pill);background:#fff;color:var(--ink);font-size:13px;font-weight:800;white-space:nowrap}
.chip.on{background:var(--ink);border-color:var(--ink);color:#fff}
/* 設定のお願い・工場・入荷 */
.setup-banner{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;margin:0 0 14px;padding:12px 14px;border:1px solid var(--warn);background:var(--warnbg);border-radius:var(--radius);color:var(--warn-ink,#8A5E14);font-size:13px}
.setup-banner b{font-weight:800}.setup-banner small{color:var(--sub)}
.hqf-date{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.hqf-date-btn{min-width:180px;justify-content:flex-start}
.dcal-cell.dis{color:var(--sub);opacity:.35}
.ord-list{display:flex;flex-direction:column}
.ord-row{display:flex;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--line)}
.ord-row:last-child{border-bottom:0}
.ord-mid{flex:1;min-width:0;display:flex;flex-direction:column}.ord-mid small{color:var(--sub);font-size:11.5px}
.ord-act{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.fac-assign{display:flex;flex-direction:column}
.fac-assign-row{display:flex;align-items:center;gap:10px;padding:8px 0;border-bottom:1px solid var(--line)}
.fac-assign-row:last-child{border-bottom:0}
.fa-name{flex:1;min-width:0;font-weight:700;font-size:13px}
.fac-assign-row .hq-select{max-width:46%}
.set-grid{display:block}
.set-h{margin:16px 0 4px;font-size:14px;font-weight:800}
.mail-actions{flex-wrap:wrap}
.lt-low{background:var(--redbg)}
.linklike-row.pname{display:flex;align-items:center;gap:10px;text-align:left;background:none;border:0;padding:0;min-height:44px;font-weight:700}
/* 数量の入力：指で押せる大きさ（44px） */

.qtybox.sm .qtybtn{width:44px;height:44px}.qtybox.sm .qtyfield{width:58px;height:44px;font-size:16px}
.subj,#zMailBody{width:100%;font-size:16px}
#zMailBody{min-height:180px}
span.ph-none{width:56px;aspect-ratio:1/1;height:auto}
span.ph-none.sm{width:40px}span.ph-none.xs{width:32px}span.ph-none.md{width:56px}
.lt-thumb.ph-none{width:24px;aspect-ratio:1/1;display:inline-block;vertical-align:middle;margin-right:6px;border-radius:4px}
.gchip .ph-none{display:block;width:100%;aspect-ratio:1/1}

/* サイドバーの見出し：上が切れないようにする（デモと同じ見え方） */
.sb-brand{flex:none;line-height:1.5;padding:18px 18px 14px;overflow:visible}
/* カメラ読み取り：タブレット（768〜1024px）・横向きでも枠が大きくなりすぎない／読めなかった時の候補 */

@media (orientation:landscape) and (max-height:520px){.cam-box{aspect-ratio:auto;height:52vh;max-width:70vw}}
@media (min-width:768px) and (max-width:1024px){.cam-box{max-width:480px}.sheet .sheet-actions{flex-wrap:wrap}}
.scan-cand-q{margin:10px 0 6px;font-weight:800;font-size:14px}
.scan-cand-one{margin-top:8px}
.scan-cand-big{display:flex;align-items:center;gap:12px;width:100%;min-height:72px;padding:10px 12px;border:2px solid var(--accent-dark,#8B6F4E);border-radius:12px;background:#fff;text-align:left}
.scan-cand-big span{flex:1;min-width:0;display:flex;flex-direction:column}
.scan-cand-big b{font-size:16px;font-weight:800}.scan-cand-big small{color:var(--sub);font-size:11.5px}
.scan-cand-big em{font-style:normal;font-weight:800;color:#fff;background:var(--ink);border-radius:var(--radius-pill);padding:10px 14px;white-space:nowrap}

/* 表の見出しは折り返さない（「少な/い基/準」のように縦に崩れるのを防ぐ）。列の幅は内容に合わせ、広すぎる表は枠の中で横にスクロールする */
table th,.phead .pcell,.slip-head .pcell,.hqb-head span{white-space:nowrap}
.hqhist-tablewrap,.hq-table-wrap,.lt-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* 利用者の画面ごとの権限 */
.perm-grid{display:flex;flex-direction:column;border:1px solid var(--line);border-radius:10px;margin-bottom:8px}
.perm-row{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:6px 10px;border-bottom:1px solid var(--line);flex-wrap:wrap}
.perm-row:last-child{border-bottom:0}
.perm-name{font-weight:700;font-size:13px;min-width:9em}
.perm-seg{display:inline-flex;gap:4px}
.perm-b{min-height:44px;padding:0 10px;border:1px solid var(--line2);border-radius:8px;background:#fff;color:var(--sub);font-size:12.5px;font-weight:800;white-space:nowrap}
.perm-b.on{background:var(--ink);border-color:var(--ink);color:#fff}
.perm-b.on.none{background:#6E655E;border-color:#6E655E}
.perm-b.on.edit{background:var(--accent-dark,#8B6F4E);border-color:var(--accent-dark,#8B6F4E)}
/* メール送信 */
.mail-grp{margin:6px 0}.mail-grp>b{display:block;font-size:12.5px;margin-bottom:2px}
.mail-pre{white-space:pre-wrap;word-break:break-word;background:var(--surface);border-radius:8px;padding:10px;font-size:13px;margin:0;max-height:40vh;overflow:auto}
@media(max-width:1100px){.mst-table{min-width:0}.mst-table td.mst-name{min-width:150px}.mst-table td{padding:9px 6px}.mst-act{flex-wrap:wrap}.mst-table th{white-space:nowrap}}
@media(max-width:900px){.mst-table td{white-space:normal}.mst-table td.num1,.mst-table td:last-child{white-space:nowrap}.mst-table td.num2{overflow-wrap:anywhere}.mst-act .btn{padding-left:8px;padding-right:8px}}
/* スマホ幅：細い列に文字が1〜2字ずつ折り返さないようにする */
.gbar .waitbox{white-space:nowrap;justify-content:safe center}
@media(max-width:767px){
  .mail-actions{display:grid;grid-template-columns:1fr 1fr}
  .mail-actions .btn{min-width:0;padding:0 8px}
  .mail-actions .btn-primary{grid-column:1/-1;order:-1}
  .ord-row{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;column-gap:10px;row-gap:12px}
  .ord-row>.ph{grid-area:1/1}
  .ord-row>.ord-mid{grid-area:1/2/2/4}
  .ord-row>.num1{grid-area:2/1/3/3}
  .ord-row>.ord-act{grid-area:2/3}
  .confirm-row:has(>.ph){flex-wrap:wrap}
  .confirm-row>.ph~b{flex:1 1 calc(100% - 52px);min-width:0}
  .confirm-row>.ph~small{margin-left:52px}
  .scan-actions{flex-wrap:wrap}
  .scan-actions [data-act="scanFlip"]{flex-basis:100%;order:1}
}
/* 履歴表の商品セル：写真｜商品名を1段目、ロット・注記は商品名の下に並べる（名前を細く折り返させない） */
.hqhist-prod>div{display:grid;grid-template-columns:auto minmax(0,1fr);column-gap:8px;row-gap:2px;align-items:center}
.hqhist-prod>div>*+*+*{grid-column:2}
/* 棚卸・入出庫（まとめて）の右シートは、長い商品名が4行以上にならないよう広げる */
@media(min-width:768px){.sheet.side:has(.hqb-list){width:580px}}
.hqhist-table .hist-lots .linklike{white-space:nowrap;word-break:normal;overflow-wrap:normal}

/* 発送依頼・届く荷物（販売員さん）／売場からの発送依頼（本社） */
.sa-tabs{display:flex;gap:2px;margin-bottom:14px;padding:3px;border:1px solid var(--line2);border-radius:var(--radius-pill);background:var(--surface)}
.sa-tabs .seg-b{flex:1;padding:0 6px;white-space:nowrap}
.sa-dest{font-size:22px;line-height:1.3;padding:12px 14px;border-radius:10px;background:var(--ink);color:#fff}
.ship-lead{margin:-4px 0 12px;font-size:13px}
.ship-card .ship-dest{font-size:17px;font-weight:800;margin-bottom:6px}
.ship-track{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin-top:10px}
.ship-track.none{color:var(--sub);font-size:13px}
.ship-carrier{font-size:13px;font-weight:800}
.ship-tracklink{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;width:100%;min-height:52px;padding:8px 12px;text-decoration:none;text-align:center;color:#fff}
.ship-tracklink b{font-size:17px;letter-spacing:.03em;color:#fff}
.ship-tracklink small{font-size:11px;font-weight:600;opacity:.85}
.ship-tracknum{font-size:14px}
.req-memo{margin-top:6px;font-size:13px;color:var(--sub)}
.req-shipped{margin-top:8px;padding:10px 12px;border-radius:8px;background:var(--okbg);color:var(--ok-ink);font-size:13px;font-weight:700}
.req-shipped .ship-track{margin-top:6px}
.req-card .req-row{padding:12px 0;border-top:1px solid var(--line)}
.req-card .req-row:first-of-type{border-top:0}
.req-row-head{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:6px}
.req-store{font-size:16px}
.req-items{font-size:14px;line-height:1.7}
.req-total{margin-top:4px}
.req-act{display:flex;gap:8px;flex-wrap:wrap;margin-top:10px}
.req-banner{margin:0 0 12px;padding:10px 12px;border-radius:8px;background:var(--bluebg);color:var(--blue);font-size:13px;line-height:1.6}

.nw{white-space:nowrap}
.req-by{font-size:13px;color:var(--sub);font-weight:700}
.rep-top .req-by{flex:1;min-width:0}
@media (max-width:480px){.rep-card .rep-top .req-by{order:3;flex-basis:100%;margin-top:-2px}.rep-card .rep-top .pill{margin-left:auto}}
