:root{color-scheme:light;--ink:#111111;--sub:#8A8078;--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;--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}
.hidden{display:none!important}
.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{padding:18px 18px 14px;font-size:16px;font-weight:800;white-space:nowrap;overflow:hidden}
.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);margin-left:6px;white-space:nowrap;vertical-align:middle}
.qtybox{display:inline-flex;align-items:center;gap:4px}
.qtybtn{width:44px;height:44px;padding:0;border:1px solid var(--line2);border-radius:8px;background:#fff;font-size:18px;font-weight:800;line-height:1;flex:none}
.qtyfield{width:72px;height:44px;padding:0 2px;border:1px solid var(--line2);border-radius:8px;background:#fff;text-align:center;font-size:16px;font-weight:800;-moz-appearance:textfield}
.qtyfield::-webkit-outer-spin-button,.qtyfield::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.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-block{width:100%}
.btn[disabled]{opacity:.4;pointer-events:none}
.btn.sm{min-height:44px;padding:0 12px;font-size:12px;gap:5px}
.btn.sm svg{width:14px}
.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}
.sheet textarea{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)}}
.hq-table-wrap{overflow-x:auto;border:1px solid var(--line);border-radius:10px;background:#fff;margin-bottom:14px}
@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)}
.hqf-preview.good{background:var(--okbg);color:var(--ok)}
.hqf-error{margin:-4px 0 12px;padding:9px 12px;border-radius:8px;background:var(--redbg);color:var(--red);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}
.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;grid-template-columns:minmax(0,1fr) 46px 76px 54px;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;grid-template-columns:minmax(0,1fr) 46px 76px 54px;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-head span:nth-child(1){text-align:left}
.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)}
.hqb-diff.bad{color:var(--red)}
.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{grid-template-columns:minmax(0,1fr) 40px 68px 46px;gap:6px}}
.hqb-list.inout .hqb-row,.hqb-list.inout .hqb-head{grid-template-columns:minmax(0,1fr) 46px 76px 70px}
.hqb-list.inout .hqb-diff{white-space:normal;line-height:1.2}
.hqb-row.err{background:var(--redbg);border-radius:6px}
@media(max-width:767px){.hqb-list.inout .hqb-row,.hqb-list.inout .hqb-head{grid-template-columns:minmax(0,1fr) 40px 68px 60px}}
.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)}
.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:#C9C2BA}
.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)}
.hist-type.out{background:var(--goldbg);color:#B8763C}
.hist-type.adj{background:var(--surface);color:var(--sub)}
.hqhist-tablewrap{overflow-x:auto;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:17%}
.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:18%}
.hqhist-table col.c-memo{width:14%}
.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-prod{font-weight:700;white-space:normal}
.hqhist-ft{color:var(--sub);font-weight:600;white-space:normal}
.hqhist-up{color:var(--ok);text-align:right;font-weight:800;white-space:nowrap}
.hqhist-down{color:var(--red);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}}
.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{display:flex;flex-direction:column;gap:1px;min-width:0;text-align:left}
.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)}
.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}
.cam-box video{width:100%;height:100%;object-fit:cover;display:block}
.cam-guide{position:absolute;left:10%;right:10%;top:30%;bottom:30%;border:2px solid rgba(255,255,255,.85);border-radius:8px;pointer-events:none}
.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)}
.dcal-cell.dis{opacity:.3}
.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}
.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}
.hqf-lot-opt{min-height:44px}

/* ---- Phase 2：デモから流用 ---- */
.pill.green{background:var(--okbg);color:var(--ok);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}
.big-cta.done{background:var(--okbg);border-color:var(--okbg);color:var(--ok);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);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)}
.confirm-total{display:flex;justify-content:space-between;padding-top:10px;font-weight:800}
.hq-table-wrap{overflow-x:auto;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);font-weight:800}
.hq-cell.warn2{background:var(--warnbg);color:var(--warn);font-weight:800}
.hq-cell b{font-weight:800}

/* ============================================================
   Phase 2 追加：赤マーク・売上報告・売場在庫・売上集計・利用者
   ============================================================ */
.low1{color:var(--red)!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{min-width:0;font-weight:700;font-size:14px}
.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}
.big-cta{margin-top:4px}
.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-list{display:grid}
.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}
