
:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",Meiryo,sans-serif;background:#f5f7fb;color:#192b43;--blue:#2563eb;--good:#087c54;--line:#e2e9f1}*{box-sizing:border-box}html{scroll-behavior:smooth}body{margin:0}button,input{font:inherit}button{cursor:pointer}button:disabled{opacity:.4;cursor:default}main{margin:0 auto;max-width:720px;padding-bottom:138px}
header.top{background:#214ca4;color:white;padding:16px 14px 16px;padding-top:max(16px,env(safe-area-inset-top));border-radius:0 0 14px 14px}header h1{font-size:22px;margin:1px 0 14px;letter-spacing:.01em}.eyebrow{font-size:11px;letter-spacing:.07em;opacity:.84;font-weight:700}.tabs{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:7px;margin-bottom:14px}.tab{display:flex;justify-content:space-between;align-items:center;text-align:left;background:#ffffff18;color:white;border:1px solid #ffffff64;border-radius:10px;padding:12px 10px;font-size:13px;font-weight:800;min-height:48px;line-height:1.2}.tab.active{background:white;color:#16479d;border-color:white}.tab small{font-size:10px;font-weight:700;opacity:.8;margin-left:3px}.topgrid{display:flex;align-items:center;justify-content:space-between;gap:6px}.datewrap{display:flex;gap:6px;align-items:center;font-size:12px;font-weight:800;white-space:nowrap}.datewrap input{width:147px;max-width:46vw;color:#1a3453;background:white;border:0;border-radius:8px;font-size:14px;padding:9px 7px;min-width:0}.headright{font-size:11px;text-align:right;line-height:1.4;color:#e5edff}.headright strong{display:block;color:white;font-size:18px;font-variant-numeric:tabular-nums}.progress{margin-top:12px;background:#ffffff45;height:5px;border-radius:10px;overflow:hidden}.progressbar{height:100%;background:#9dedc4;width:0}
.notice{margin:12px 12px 7px;background:#eef5ff;border:1px solid #d3e2fa;border-radius:10px;padding:10px 11px;color:#395b84;font-size:12px;line-height:1.6}.toolbar{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:0 12px;padding:9px 0}.toolbar small{color:#637994;font-size:11px}.toolbar button{font-size:12px;padding:8px 9px;color:#20519e;background:white;border:1px solid #c6d5eb;border-radius:8px;font-weight:800}.heads{display:grid;grid-template-columns:minmax(0,54fr) minmax(0,46fr);gap:8px;background:#e8eef8;margin:0 12px;padding:9px 11px;color:#3e5577;font-size:12px;font-weight:800;border-radius:10px 10px 0 0}.heads div:last-child{text-align:center}.list{background:#fff;margin:0 12px;border:1px solid #dce5ee;border-top:0;border-radius:0 0 12px 12px;overflow:hidden}.section{font-size:11px;font-weight:800;color:#5576a0;background:#f1f5fa;padding:8px 10px;border-top:1px solid #e1e8f0;border-bottom:1px solid #e1e8f0}.item{display:grid;grid-template-columns:minmax(0,54fr) minmax(0,46fr);align-items:center;gap:8px;padding:8px 9px;min-height:70px;border-bottom:1px solid #edf0f4;scroll-margin-top:20px;scroll-margin-bottom:145px}.item:last-child{border-bottom:0}.item:nth-of-type(even){background:#fafcff}.item.active{background:#eff6ff;box-shadow:inset 3px 0 0 var(--blue)}.item.finished:not(.active){background:#f9fffb}.item.cancelled{background:#f7f8fa;color:#94a0b0;min-height:55px}.productname{font-weight:750;font-size:13px;line-height:1.5;overflow-wrap:anywhere}.meta{display:flex;gap:7px;align-items:center;flex-wrap:wrap;color:#7d899d;font-size:11px;margin-top:4px}.num{font-variant-numeric:tabular-nums;font-weight:800;color:#6e8196}.dot{color:#c3cbd5;font-size:11px}.finished .dot{color:var(--good)}.strike{text-decoration:line-through}.warn{font-size:11px;color:#8993a2}.controls{min-width:0}.inputline{display:flex;align-items:center;gap:4px}.amount{width:100%;min-width:0;height:42px;padding:0 6px;color:#223b62;background:white;border:1px solid #bac9db;border-radius:8px;outline:none;text-align:right;font-weight:750;font-size:17px;font-variant-numeric:tabular-nums}.amount:focus{border:2px solid var(--blue);padding:0 5px}.amount::placeholder{color:#9caabc;font-size:12px;font-weight:500}.plus,.next{flex-shrink:0;display:grid;place-items:center;border:0;border-radius:7px;height:42px;font-weight:800}.plus{width:32px;font-size:22px;background:#e5efff;color:#255bbe}.next{width:36px;font-size:17px;background:#2563eb;color:white}.result{text-align:right;min-height:16px;margin-top:3px;font-size:11px;color:#8593a6;font-variant-numeric:tabular-nums}.result.valid{color:var(--good);font-weight:800}.result.invalid{color:#b73434;font-weight:750}
.extras{margin:17px 12px 8px;background:white;border:1px solid #e0e7f0;border-radius:12px;padding:14px 13px}.extras h2{font-size:15px;margin:0 0 6px}.extras p{font-size:12px;line-height:1.6;color:#63748c;margin:0 0 13px}.actions{display:flex;gap:8px;flex-wrap:wrap}.actions button,.importlabel{border:1px solid #c7d6e6;border-radius:8px;background:white;color:#25527d;padding:10px 11px;font-size:12px;font-weight:800;cursor:pointer}.actions .primary{background:var(--blue);color:white;border-color:var(--blue)}.actions .danger{color:#ac3c3c}.footnote{font-size:11px;color:#8392a4;line-height:1.6;margin:8px 13px 18px}
.bottom{position:fixed;bottom:0;left:0;right:0;z-index:20;background:white;border-top:1px solid #d6e0ed;box-shadow:0 -4px 15px #253b5014;display:flex;align-items:center;gap:7px;padding:10px max(12px,env(safe-area-inset-right)) max(11px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}.bottom>div{flex:1;min-width:0}.bottom small{font-size:11px;display:block;color:#708096}.bottom strong{font-size:12px;display:block;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.bottom button{border-radius:9px;padding:12px 10px;font-size:12px;font-weight:800;white-space:nowrap}.secondary{background:white;color:#2354a2;border:1px solid #c6d3e9}.bnext{background:var(--blue);border:1px solid var(--blue);color:white}.toast{position:fixed;top:12px;left:50%;transform:translateX(-50%);z-index:99;background:#19334e;color:white;font-size:12px;border-radius:10px;padding:10px 13px;max-width:90vw;box-shadow:0 3px 18px #0002;display:none}.toast.show{display:block}

/* iPhone標準キーボードの上に、入力式と合計を同期する専用バー */
.keypad-actions{display:none;position:fixed;z-index:90;left:8px;right:8px;bottom:8px;flex-direction:column;align-items:stretch;gap:5px;padding:7px 9px 8px;border:1px solid #cedbef;border-radius:13px;background:#fff;box-shadow:0 4px 22px #17345738;max-width:720px;margin:0 auto;touch-action:manipulation}
body.editing .keypad-actions{display:flex}
body.editing .bottom{display:none}
body.editing .item{scroll-margin-bottom:175px}
.keypad-top{display:flex;align-items:center;justify-content:space-between;gap:9px;min-width:0;min-height:15px}
.keypad-item{min-width:0;flex:1;display:flex;align-items:baseline;gap:5px}
.keypad-item strong{font-size:11px;line-height:1.25;display:block;color:#3f597a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.keypad-item small{font-size:10px;display:block;color:#8192a8;white-space:nowrap;flex-shrink:0}
.keypad-expression{display:flex;align-items:center;gap:6px;background:#f1f6ff;border:1px solid #e2ebfa;border-radius:8px;min-height:28px;padding:4px 9px;font-variant-numeric:tabular-nums;min-width:0}
.keypad-expression .formula-label{font-size:10px;font-weight:800;color:#7185a0;flex-shrink:0}
.keypad-formula{min-width:0;overflow:auto;white-space:nowrap;flex:1;font-size:14px;font-weight:850;color:#243e63;scrollbar-width:none;-ms-overflow-style:none}
.keypad-formula::-webkit-scrollbar{display:none}
.keypad-total{flex-shrink:0;max-width:45%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px;font-weight:900;color:#087c54}
.keypad-actions[data-state="empty"] .keypad-total{color:#8090a3;font-size:12px}
.keypad-actions[data-state="pending"] .keypad-total{color:#a46a12;font-size:12px}
.keypad-actions[data-state="invalid"] .keypad-total{color:#c23c35;font-size:12px}
.keypad-buttons{display:flex;align-items:center;gap:6px;width:100%}
.keypad-actions button{height:38px;border-radius:9px;padding:0 10px;font-size:13px;font-weight:850;border:1px solid #bdd0ed;background:#e7efff;color:#2056aa;white-space:nowrap;flex-shrink:0}
.keypad-actions button.keypad-back{background:#fff;color:#476789;border-color:#d0dbe9}
.keypad-actions button.keypad-plus{flex:1;font-size:17px}
.keypad-actions button.keypad-next{flex:1.45;background:#2563eb;color:#fff;border-color:#2563eb;font-size:14px}
/* Ver.8.3: 月間のみ割り算を表示。日々は従来の操作バーそのまま */
.keypad-buttons .keypad-divide{flex:.95;background:#fff5e7;border-color:#eed1a3;color:#a75a0a;font-size:15px}
.keypad-buttons .keypad-divide[hidden]{display:none!important}
.keypad-actions[data-monthly="true"] .keypad-buttons{gap:5px}
.keypad-actions[data-monthly="true"] .keypad-plus{flex:.85}
.keypad-actions[data-monthly="true"] .keypad-next{flex:1.35}
.keypad-actions[data-monthly="true"] .keypad-buttons button{padding-inline:5px;min-width:0}
@media(max-width:365px){.keypad-actions{left:5px;right:5px;gap:4px;padding:6px 7px}.keypad-actions button{font-size:12px;padding:0 7px}.keypad-actions button.keypad-next{font-size:13px}.keypad-item strong{font-size:10px}.keypad-formula{font-size:13px}.keypad-total{font-size:13px}}

@media(max-width:360px){.item{padding:8px 6px;gap:5px}.heads{gap:5px}.plus{width:29px}.next{width:31px}.inputline{gap:3px}.productname{font-size:12px}.amount{font-size:16px;padding:0 3px}.amount:focus{padding:0 2px}.datewrap input{max-width:137px}.bottom button{padding:11px 8px}.tab{font-size:12px}}
@media(min-width:600px){.item,.heads{grid-template-columns:minmax(0,1fr) 280px}.productname{font-size:14px}.amount{padding:0 10px}}

/* v6 一覧は商品名と最終数量を主役にし、式を検算用に残す。入力バーはv5のまま。 */
.heads{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:8px;align-items:center}
.heads div:last-child{text-align:right;min-width:94px}
.item{display:block;padding:11px 11px 10px;min-height:79px;scroll-margin-top:20px;scroll-margin-bottom:160px;cursor:pointer}
.item-head{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:12px;align-items:center;min-width:0}
.item-title{min-width:0}
.item-ident{display:flex;align-items:flex-start;gap:7px;min-width:0}
.item-ident .num{font-size:11px;flex:none;padding-top:3px}
.item-ident .productname{font-size:13px;line-height:1.5;font-weight:800;overflow-wrap:anywhere}
.item-amount{min-width:100px;max-width:44vw;text-align:right;font-variant-numeric:tabular-nums;white-space:nowrap;line-height:1.3}
.item-amount .number{font-size:21px;font-weight:900;letter-spacing:-.025em;color:var(--good)}
.item-amount .unit{font-size:12px;font-weight:850;color:var(--good);margin-left:4px}
.item-amount.pending .number,.item-amount.invalid .number,.item-amount.empty .number{font-size:12px;font-weight:750;letter-spacing:0}
.item-amount.empty .number{color:#8898aa}
.item-amount.pending .number{color:#a26d19}
.item-amount.invalid .number{color:#bb3f3f}
.item-formula{display:flex;align-items:flex-start;gap:7px;margin-top:7px;min-width:0;padding-left:22px}
.formula-tag{flex:none;font-size:11px;line-height:1.55;color:#798aa1;font-weight:700;white-space:nowrap}
.formula-edit{width:100%;min-width:0;min-height:22px;border:0;border-radius:4px;padding:1px 4px;margin:-1px -4px;font-size:12px;line-height:1.6;letter-spacing:.01em;font-weight:550;color:#536780;background:transparent;outline:none;text-align:left;resize:none;overflow:hidden;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;box-shadow:none;display:block;caret-color:var(--blue)}
.formula-edit:focus{background:#fff;border:1px solid #b5cfff;margin:-2px -5px;padding:1px 4px;box-shadow:0 0 0 2px #e1eeff}
.formula-edit::placeholder{color:#9baabd;font-weight:500}
.item.active{background:#edf5ff;box-shadow:inset 4px 0 0 var(--blue)}
.item.finished:not(.active){background:#f9fffb}
.item.cancelled{min-height:60px}
.item.cancelled .item-amount .number{color:#8994a3}
.item.cancelled .item-ident .productname{color:#8994a3}
.item.cancelled .item-formula{display:none}
.formula-print{display:none}
.print-header{display:none}
@media(max-width:360px){.item{padding:10px 8px}.item-head{gap:6px}.item-amount{min-width:78px}.item-amount .number{font-size:19px}.item-ident{gap:5px}.item-ident .productname{font-size:12px}.item-formula{padding-left:18px}}
@media(min-width:600px){.item{padding:12px 14px}.item-ident .productname{font-size:14px}.item-amount .number{font-size:22px}.item-formula{padding-left:23px}.item-amount{max-width:45%}}
@page{size:A4 portrait;margin:12mm 11mm}
@media print{
 :root{background:#fff;color:#17283c}
 html,body{background:#fff!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 body{font-size:11px}
 main{max-width:none;margin:0;padding:0}
 header.top,.notice,.toolbar,.extras,.footnote,.bottom,.keypad-actions,.toast{display:none!important}
 .print-header{display:block;margin:0 0 11px;padding:0 0 10px;border-bottom:2px solid #264875}
 .print-header h1{font-size:18px;margin:0 0 6px}
 .print-header .print-info{font-size:11px;color:#465c77}
 .heads{margin:0;padding:7px 10px;border-radius:0;background:#e7eef7;color:#243e63;font-size:11px}
 .list{margin:0;border-radius:0;border:1px solid #cdd7e2;border-top:0;overflow:visible}
 .section{padding:7px 10px;background:#f1f5fa!important;color:#436080;break-after:avoid}
 .item{break-inside:avoid;page-break-inside:avoid;padding:7px 10px;min-height:51px;background:#fff!important;border-bottom:1px solid #e2e7ed;box-shadow:none!important}
 .item-head{gap:12px}
 .item-ident .productname{font-size:11.5px;line-height:1.35}
 .item-ident .num{font-size:10px;padding-top:2px}
 .item-amount{max-width:none;min-width:95px}
 .item-amount .number{color:#152c46!important;font-size:17px!important;font-weight:900!important}
 .item-amount .unit{color:#152c46!important;font-size:11px}
 .item-amount.empty .number{color:#9da5b0!important;font-size:11px!important}
 .item-amount.pending .number,.item-amount.invalid .number{font-size:11px!important;color:#7e4334!important}
 .item-formula{margin-top:2px}
 .formula-tag{font-size:9.5px}
 .formula-edit{display:none!important}
 .formula-print{display:block!important;min-width:0;white-space:pre-wrap;overflow-wrap:anywhere;word-break:break-word;font-size:10px;line-height:1.35;color:#566578}
}

/* v7 商品管理画面：入力用固定バー・キーボード用バーは変更しない */
.toolbar-buttons{display:flex;gap:6px;align-items:center}
.toolbar .manage-open{background:#e8f1ff;border-color:#a9c6ef;color:#174ca5}
.manager[hidden]{display:none!important}
body.manager-open .heads,body.manager-open .list,body.manager-open .print-header,body.manager-open .extras,body.manager-open .footnote,body.manager-open .bottom,body.manager-open .notice{display:none!important}
body.manager-open .toolbar #jumpUnfinished,body.manager-open .toolbar #openManager{display:none}
body.manager-open main{padding-bottom:35px}
.manager{margin:0 12px 24px}
.manager-top{display:flex;justify-content:space-between;align-items:flex-start;gap:12px;margin:12px 0 14px}
.manager-top h2{margin:0 0 5px;font-size:20px}
.manager-top p{margin:0;line-height:1.65;color:#6a7f99;font-size:12px}
.manager-top button{flex-shrink:0;border:1px solid #bacee8;border-radius:9px;background:white;color:#2353a1;padding:10px 11px;font-size:12px;font-weight:800}
.manager-summary{display:flex;justify-content:space-between;align-items:center;gap:8px;margin:7px 0 10px}
.manager-summary b{font-size:14px}
.manager-add{border:0;border-radius:9px;background:var(--blue);color:#fff;font-size:13px;font-weight:800;padding:11px 13px}
.manager-help{font-size:11px;line-height:1.65;color:#718298;margin:0 0 10px}
.manager-items{background:#fff;border:1px solid #d8e3ee;border-radius:12px;overflow:hidden}
.manager-row{border-bottom:1px solid #ebeff4;padding:11px 10px;background:#fff}
.manager-row:last-child{border-bottom:0}
.manager-row.dragging{opacity:.65;background:#dceaff}
.manager-row.drop-target{box-shadow:inset 0 3px 0 #2563eb;background:#f4f8ff}
.manager-row-main{display:flex;gap:9px;align-items:center;min-width:0}
.manager-handle{touch-action:none;flex-shrink:0;width:34px;height:40px;border:1px solid #d9e3f1;border-radius:9px;background:#f4f8ff;color:#5b759a;font-size:21px}
.manager-row-text{flex:1;min-width:0}
.manager-row-text strong{display:block;font-size:13px;line-height:1.5;overflow-wrap:anywhere}
.manager-row-text small{display:block;margin-top:3px;font-size:11px;color:#72849a}
.manager-row button.mini,.manager-row select{border:1px solid #d3dfed;border-radius:7px;background:white;color:#28548b;min-height:34px;padding:6px 9px;font-size:12px;font-weight:750}
.manager-row .edit-btn{flex-shrink:0}
.manager-row-actions{display:flex;gap:6px;align-items:center;justify-content:flex-end;margin:7px 0 0 43px;flex-wrap:wrap}
.manager-row select{max-width:134px;margin-right:auto;background:#f9fbff}
.manager-row .archive-btn{color:#a14c37}
.manager-row .restore-btn{color:#0b7951}
.manager-row .mini:disabled{opacity:.35}
.manager-archive-heading{display:flex;align-items:center;gap:8px;margin:23px 0 8px}
.manager-archive-heading h3{font-size:15px;margin:0}
.manager-archive-heading span{color:#70829a;font-size:12px}
.manager-empty{padding:18px;color:#8190a2;font-size:12px}
.product-dialog{width:calc(100vw - 32px);max-width:470px;border:0;border-radius:16px;padding:22px 20px 18px;box-shadow:0 18px 70px #17294d5c}
.product-dialog::backdrop{background:#0d1f3d80}
.product-dialog h2{font-size:19px;margin:0 0 17px}
.product-dialog form{display:flex;flex-direction:column;gap:14px}
.product-dialog label{display:flex;flex-direction:column;gap:6px;font-weight:800;font-size:13px}
.product-dialog input{width:100%;padding:12px;border:1px solid #bdcadb;border-radius:9px;font-size:16px;color:#172c46}
.dialog-actions{display:flex;gap:9px;justify-content:flex-end;margin-top:4px}
.dialog-actions button{border-radius:9px;padding:12px 17px;font-size:13px;font-weight:850}
@media(max-width:380px){.toolbar{gap:5px;margin:0 9px}.toolbar small{font-size:10px}.toolbar button{font-size:11px;padding:8px 7px}.manager{margin:0 9px 20px}.manager-row-actions{margin-left:0}.manager-row select{max-width:128px}}
@media print{.manager,.product-dialog,.toolbar-buttons{display:none!important}}

/* Ver.8.1 — 日付の曜日表示：横幅を広げず二段に表示 */
.matrix thead th .date-day{display:block;font-weight:850;line-height:1.25}
.matrix thead th .date-weekday{display:block;font-size:10px;font-weight:750;line-height:1.25;margin-top:2px;color:#60738b}
.matrix thead th.sunday-head .date-weekday{color:#be4e50}
.matrix thead th.saturday-head .date-weekday{color:#2b6cb4}
/* Ver.8.2: 土日祝の区別。平日祝日も色と「祝」を併記 */
.matrix thead th.sunday-head:not(.holiday-head){background:#fff0f1;color:#a33445}
.matrix thead th.saturday-head:not(.holiday-head){background:#e8f2ff;color:#2256a4}
.matrix thead th.holiday-head{background:#ffe9ed;color:#a8293f}
.matrix thead th.holiday-head .date-weekday{color:#b02743}
.matrix tbody td.holiday-cell:not(.issue):not(.provisional){background:#fff4f6!important}
.matrix tbody td.sunday-cell:not(.holiday-cell):not(.issue):not(.provisional){background:#fffafa!important}
.matrix tbody td.saturday-cell:not(.holiday-cell):not(.issue):not(.provisional){background:#f4f9ff!important}
@media print{
 .print-report-sheet thead th.print-holiday-head{background:#ffdae1!important;color:#9e2439!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .print-report-sheet thead th.print-sunday-head{background:#fff0f1!important;color:#ab3747!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
 .print-report-sheet thead th.print-saturday-head{background:#e8f2ff!important;color:#23529b!important;-webkit-print-color-adjust:exact;print-color-adjust:exact}
}
/* Ver.8 — 結果マトリクス / 日別入出庫。元の入力バーは変更しない */
.view-nav{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px;margin:12px 12px 8px}
.view-nav button{border:1px solid #cdddf0;background:#fff;color:#305b90;border-radius:10px;padding:12px 4px;font-size:12px;font-weight:850;min-width:0}
.view-nav button.active{background:#2563eb;color:white;border-color:#2563eb}
body.report-view .notice,body.report-view .toolbar,body.report-view .heads,body.report-view .list,body.report-view .extras,body.report-view .footnote,body.report-view .bottom,body.report-view .print-header{display:none!important}
body.flow-view .notice,body.flow-view .toolbar,body.flow-view .heads,body.flow-view .list,body.flow-view .extras,body.flow-view .footnote,body.flow-view .bottom,body.flow-view .print-header{display:none!important}
body.manager-open .view-nav,body.manager-open .report-page,body.manager-open .flow-page{display:none!important}
body.report-view main,body.flow-view main{padding-bottom:28px}
.report-page[hidden],.flow-page[hidden]{display:none!important}
.report-page,.flow-page{margin:10px 12px 22px}
.page-card{background:#fff;border:1px solid #dee7f1;border-radius:13px;padding:13px;margin-bottom:12px}
.page-card h2{font-size:19px;margin:0 0 6px}
.page-description{font-size:12px;color:#637994;line-height:1.65;margin:4px 0 12px}
.period-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}
.period-actions input{min-width:0;max-width:175px;min-height:41px;border:1px solid #cbd7e9;border-radius:9px;font-size:16px;padding:7px 9px;color:#263d60;background:#fff}
.period-actions button,.report-actions button,.flow-actions button{min-height:41px;border:1px solid #cad8eb;border-radius:9px;padding:9px 12px;background:white;color:#2756a0;font-size:12px;font-weight:850}
.period-actions button{min-width:40px}.report-actions{display:flex;gap:8px;flex-wrap:wrap;margin-top:12px}.report-actions .primary,.flow-actions .primary{background:#2563eb;border-color:#2563eb;color:white}
.switch-small[hidden]{display:none!important}
.switch-small{display:inline-flex;gap:5px;padding:3px;border-radius:10px;background:#eef3fb}
.switch-small button{border:0;border-radius:8px;padding:9px 12px;background:transparent;color:#496487;font-size:13px;font-weight:800}
.switch-small button.active{background:white;color:#2059af;box-shadow:0 1px 5px #2c4d7018}
.matrix-scroll{overflow:auto;max-height:66vh;border:1px solid #d6e0eb;border-radius:11px;background:#fff;overscroll-behavior:contain;scrollbar-width:thin}
.matrix{border-collapse:separate;border-spacing:0;width:max-content;min-width:100%;font-size:11px;font-variant-numeric:tabular-nums}
.matrix th,.matrix td{border-bottom:1px solid #e7edf4;border-right:1px solid #e8edf4;padding:9px 8px;text-align:center;min-width:78px;white-space:nowrap;background:#fff}
.matrix thead th{background:#eaf1fb;font-weight:850;color:#365574;position:sticky;top:0;z-index:3}
.matrix th:first-child{position:sticky;left:0;z-index:2;min-width:160px;max-width:190px;text-align:left;white-space:normal;line-height:1.4;box-shadow:2px 0 4px #1a2a4111}
.matrix thead th:first-child{z-index:4;background:#e5edf9}
.matrix tbody tr:nth-child(even) td,.matrix tbody tr:nth-child(even) th{background:#f8fafe}
.matrix td.has-value{color:#153b65;font-weight:850}
.matrix td.provisional{color:#a46e17;background:#fffaf0!important}
.matrix td.issue{color:#b63131;background:#fff0f0!important;font-weight:850}
.matrix td.empty-value{color:#b4c1cf}.matrix td.today-cell,.matrix thead th.today-cell{box-shadow:inset 0 -2px 0 #93b8f4}
.matrix .subunit{font-size:10px;font-weight:500;color:#7c8a9b;display:block;margin-top:2px}
.matrix .cell-sub{font-size:9px;line-height:1.3;display:block;color:#a16e16;font-weight:700}
.report-legend{color:#71839a;font-size:11px;line-height:1.65;margin-top:10px}.report-stats{font-size:12px;color:#355e8a;font-weight:750;margin:8px 0}
.flow-day{font-size:12px;font-weight:750;color:#496583}.flow-actions{display:flex;gap:7px;flex-wrap:wrap;align-items:center;margin:9px 0}
.flow-status{font-size:12px;font-weight:850;color:#9a6b12;padding:8px 10px;background:#fff7dd;border-radius:8px}.flow-status.checked{color:#087c54;background:#e8f9f0}
.flow-grid{border:1px solid #d9e4ef;border-radius:11px;overflow:hidden}.flow-row{background:#fff;padding:11px;border-bottom:1px solid #e4ebf2}.flow-row:nth-child(even){background:#fafcff}.flow-row:last-child{border:0}
.flow-name{font-size:13px;font-weight:850;margin-bottom:6px}.flow-unit{font-size:11px;color:#778aa1}.flow-fields{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-top:7px}.flow-fields label{font-size:11px;color:#587192;font-weight:800;min-width:0}
.flow-fields input{display:block;margin-top:5px;width:100%;padding:9px 6px;border:1px solid #bdcee3;border-radius:8px;background:white;font-size:16px;text-align:center;color:#183454;min-height:43px;min-width:0}
.flow-fields input:focus{outline:2px solid #2563eb;outline-offset:0}.flow-math{display:flex;gap:8px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin-top:8px;font-size:11px;color:#657b94}
.flow-math strong{font-size:14px;color:#087c54}.flow-math strong.provisional{color:#aa741b}.flow-math strong.issue{color:#b52d2d}
.flow-note{font-size:11px;color:#6b8098;line-height:1.6}.print-report-only{display:none}
@media(max-width:395px){.matrix th:first-child{min-width:135px;max-width:150px}.matrix th,.matrix td{min-width:72px;padding:8px 6px}.view-nav button{font-size:11px}.page-card{padding:10px}.flow-fields{gap:5px}}
@media print{
 @page{size:A4 landscape;margin:10mm}
 body.report-view{background:white!important}body.report-view header.top,body.report-view .view-nav,body.report-view .page-card,body.report-view #reportScroll,body.report-view .report-legend,body.report-view .report-stats,body.report-view .toast{display:none!important}
 body.report-view main{max-width:none;margin:0;padding:0}body.report-view .report-page{margin:0;display:block!important}
 body.report-view .print-report-only{display:block!important}
 .print-report-sheet{page-break-after:always;break-after:page;margin:0 0 10px}.print-report-sheet:last-child{page-break-after:auto;break-after:auto}
 .print-report-sheet h2{margin:0 0 5px;font-size:15px}.print-report-sheet .print-context{margin-bottom:8px;font-size:10px;color:#567}
 .print-report-sheet table{width:100%;border-collapse:collapse;font-size:9px;table-layout:fixed}
 .print-report-sheet th,.print-report-sheet td{border:1px solid #cbd7e2;text-align:center;padding:4px 3px;word-break:break-word}
 .print-report-sheet th:first-child{width:25%;text-align:left}.print-report-sheet thead th{background:#e7f0fc}
 .print-report-sheet tbody tr:nth-child(even){background:#f5f8fd}
}


/* Ver.9: 発注準備マスターと業者営業日管理（棚卸し画面の既存レイアウトは維持） */
.view-nav{grid-template-columns:repeat(4,minmax(0,1fr))}
@media(max-width:400px){.view-nav{gap:4px}.view-nav button{font-size:11px;padding:10px 2px}}
body.order-view .notice,body.order-view .toolbar,body.order-view .heads,body.order-view .list,body.order-view .extras,body.order-view .footnote,body.order-view .bottom,body.order-view .print-header{display:none!important}
body.order-view main{padding-bottom:32px}
body.order-view .report-page,body.order-view .flow-page{display:none!important}
.order-page[hidden]{display:none!important}.order-page{margin:10px 12px 28px}
.order-tabs{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px;margin:12px 0}
.order-tabs button{background:#eef3fb;color:#345d92;border:1px solid #d3dff0;border-radius:10px;padding:11px 2px;font-size:12px;font-weight:850}
.order-tabs button.active{background:#2563eb;border-color:#2563eb;color:white}
.order-panel[hidden]{display:none!important}
.order-panel h3{font-size:16px;margin:0 0 8px}
.order-note{margin:8px 0 13px;font-size:12px;color:#57718e;line-height:1.65}
.order-toolbar{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:10px 0}
.order-toolbar input,.order-toolbar select,.order-toolbar button{min-height:40px;min-width:0;border:1px solid #bbcee5;border-radius:9px;padding:8px 10px;font-size:13px;color:#284c76;background:white}
.order-toolbar input{flex:1;min-width:128px}.order-toolbar button.strong{background:#2563eb;color:white;border-color:#2563eb;font-weight:850}
.order-toolbar select{max-width:100%}
.order-record{border:1px solid #dbe5f1;border-radius:12px;padding:12px;margin-bottom:8px;background:white}
.order-record.archived{background:#f6f7f9;color:#738095}
.order-record-head{display:flex;justify-content:space-between;gap:8px;align-items:start}
.order-record-title{font-size:14px;font-weight:850;overflow-wrap:anywhere}
.order-record-meta{font-size:11px;color:#7185a0;line-height:1.7;margin-top:5px;overflow-wrap:anywhere}
.order-record-actions{display:flex;gap:6px;flex-wrap:wrap;margin-top:9px}
.order-record-actions button{padding:8px 12px;border:1px solid #c7d8ea;border-radius:8px;background:#fff;color:#2858a0;font-size:12px;font-weight:800}
.order-record-actions button.archive{color:#a04848}.order-record-actions button.restore{color:#087c54}
.order-badge{border-radius:7px;padding:3px 7px;background:#eef3f9;color:#517092;font-size:10px;font-weight:800;white-space:nowrap}
.order-badge.on{background:#e9f8ef;color:#13734d}.order-badge.warn{background:#fff0ec;color:#ad4933}
.order-empty{border:1px dashed #b9cae0;border-radius:12px;padding:20px;text-align:center;color:#6a829d;font-size:13px;background:#fafcff}
.order-dialog{width:calc(100% - 24px);max-width:520px;max-height:calc(100dvh - 28px);overflow:auto;border:0;border-radius:15px;padding:17px 16px 20px;box-shadow:0 15px 55px #1b315654}
.order-dialog::backdrop{background:#101e3988}.order-dialog h3{margin:0 0 12px;font-size:18px}
.order-dialog form{display:grid;gap:12px}.order-dialog label{font-size:12px;font-weight:800;display:grid;gap:5px;color:#334d6e}
.order-dialog input,.order-dialog select,.order-dialog textarea{min-height:41px;width:100%;border:1px solid #bacbe2;border-radius:9px;padding:9px 10px;font-size:16px;background:white;color:#203957}
.order-dialog textarea{min-height:67px;font-family:inherit;resize:vertical}
.order-dialog .checkline{display:flex;gap:7px;align-items:center;font-weight:650}.order-dialog .checkline input{min-height:auto;width:auto;accent-color:#2563eb}
.order-checkgrid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
.order-checkgrid label{display:flex;justify-content:center;gap:4px;align-items:center;font-size:12px;padding:8px 3px;border-radius:8px;background:#f1f5fb}
.order-checkgrid input{min-height:auto;width:auto;accent-color:#2563eb}
.order-dialog .two-fields{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.order-dialog .subhelp{font-size:11px;color:#687d93;font-weight:450;line-height:1.55}
.order-dialog .dialog-actions{position:sticky;bottom:-20px;background:#fff;padding:10px 0 0;z-index:1}
.order-calendar-header{display:flex;gap:7px;align-items:center;flex-wrap:wrap;margin:10px 0}
.order-calendar-header select,.order-calendar-header input,.order-calendar-header button{min-height:40px;max-width:100%;border:1px solid #c5d4e8;border-radius:9px;background:white;padding:7px 9px;font-size:14px}
.order-calendar-header select{min-width:160px;flex:1}.order-calendar-header button{min-width:40px}
.order-calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.order-calendar .weekday{text-align:center;color:#617997;font-size:11px;font-weight:800;padding:7px 0}
.order-calendar .weekday.sun{color:#b63149}.order-calendar .weekday.sat{color:#2563bb}
.order-calendar button{min-height:70px;background:#fff;border:1px solid #d7e1ef;border-radius:9px;padding:6px 1px;display:flex;flex-direction:column;align-items:center;justify-content:start;gap:4px;color:#244263;min-width:0}
.order-calendar button:disabled{cursor:default;opacity:1;pointer-events:none}
.order-calendar button.closed{background:#f6f2f3;color:#a24a4c}
.order-calendar button.open{background:#ebf9f0;color:#146c47}
.order-calendar button.override{border:2px solid #2563eb}
.order-calendar button .day-num{font-size:14px;font-weight:850}
.order-calendar button .day-status{font-size:10px;font-weight:750}
.order-calendar button .holiday-flag{font-size:9px;line-height:1.1;max-width:100%;color:#b93246}
.order-calendar button .note-flag{font-size:10px;color:#235dc7}
.order-calendar .blank{min-height:70px}
.order-calendar-hint{font-size:11px;line-height:1.65;color:#687e95;margin:12px 0}
@media(max-width:390px){.order-dialog .two-fields{grid-template-columns:1fr 1fr}.order-calendar{gap:3px}.order-calendar button{min-height:64px}.order-calendar button .day-num{font-size:12px}.order-calendar button .day-status{font-size:9px}}
@media print{body.order-view .order-page,body.order-view .order-dialog{display:none!important}}


/* Ver.9.1: 業者・カテゴリで商品を絞り込み、編集中のカレンダー種別を可視化 */
#orderVendorFilter,#orderCategoryFilter,#orderStatusFilter{flex:1 1 130px;max-width:100%;min-width:0}
.order-active-caption{background:#eaf2ff;border:1px solid #c9dafe;border-radius:9px;padding:10px 12px;margin:0 0 12px;color:#204f94;font-size:12px;font-weight:800;line-height:1.55}
.order-dialog label.kind-active{background:#eaf2ff;border:2px solid #2563eb;border-radius:10px;padding:8px}
#calendarEditingContext{background:#f1f6ff;border-radius:8px;padding:9px 10px;margin:0 0 5px}
@media(max-width:360px){.order-toolbar select{font-size:12px}}

/* Ver.9.2: 2通りの発注商品グループ表示（登録データには影響しない） */
.order-mode-switch{display:grid;grid-template-columns:auto 1fr 1fr;gap:6px;align-items:center;margin:12px 0 9px}
.order-mode-label{font-size:12px;color:#536d90;font-weight:800;padding-right:3px;white-space:nowrap}
.order-mode-switch button{border:1px solid #c6d8f2;border-radius:10px;background:#edf3fb;color:#2b568a;padding:11px 6px;font-size:13px;font-weight:850;min-width:0}
.order-mode-switch button.active{background:#2563eb;border-color:#2563eb;color:white}
.order-group-vendor{border:1px solid #c9d9ef;border-radius:12px;overflow:hidden;margin:14px 0 15px;background:#fff}
.order-group-vendor>.order-group-title{background:#e7effd;color:#234f88;font-size:14px;font-weight:850;padding:11px 12px;display:flex;align-items:center;justify-content:space-between;gap:7px}
.order-group-category{margin:0;border-bottom:1px solid #d9e4f2}
.order-group-category:last-child{border-bottom:0}
.order-group-category>.order-category-title{background:#f4f7fb;color:#345778;font-size:12px;font-weight:850;padding:9px 12px;display:flex;align-items:center;justify-content:space-between;gap:7px}
.order-group-category>.order-category-title.main{background:#e7effd;color:#234f88;font-size:14px;padding:11px 12px}
.order-group-count{font-size:11px;color:#587698;white-space:nowrap}
.order-group-items{padding:8px 9px 1px}
.order-group-items .order-record{margin:0 0 8px}
.order-sub-vendor-title{font-size:12px;color:#345778;font-weight:850;padding:9px 12px 6px;background:#f4f7fb;display:flex;align-items:center;justify-content:space-between}
.order-group-category.mode-category{border:1px solid #c9d9ef;border-radius:12px;overflow:hidden;margin:14px 0 15px;background:white}
.order-vendor-subgroup{border-top:1px solid #d9e4f2}
.order-vendor-subgroup:first-of-type{border-top:0}
@media(max-width:360px){.order-mode-switch{grid-template-columns:auto 1fr 1fr;gap:4px}.order-mode-label{font-size:11px}.order-mode-switch button{font-size:12px;padding:10px 3px}}

/* 見出しをタップして展開・折りたたみ。見出しは全商品分を表示 */
.order-group-vendor>summary,.order-group-category>summary,.order-vendor-subgroup>summary{cursor:pointer;list-style:none}
.order-group-vendor>summary::-webkit-details-marker,.order-group-category>summary::-webkit-details-marker,.order-vendor-subgroup>summary::-webkit-details-marker{display:none}
.order-group-vendor>summary::after,.order-group-category>summary::after,.order-vendor-subgroup>summary::after{content:'⌄';font-size:15px;line-height:1;color:#3567a6;padding-left:5px;order:3}
.order-group-vendor:not([open])>summary::after,.order-group-category:not([open])>summary::after,.order-vendor-subgroup:not([open])>summary::after{content:'›'}
.order-group-category:not([open]){margin-bottom:0}
.order-vendor-subgroup{border-top:1px solid #d9e4f2}

/* Ver.10.0: 仕込み・発注候補 MVP */
.order-tabs.v10-tabs{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
.order-tabs.v10-tabs button{font-size:11px;padding:10px 2px;overflow-wrap:anywhere}
.v10-fieldset{background:#f7faff;border:1px solid #d5e2f3;border-radius:12px;padding:12px;margin:12px 0}
.v10-fieldset label{display:block;font-size:12px;color:#3d577b;font-weight:750;margin:8px 0 4px}
.v10-fieldset input,.v10-fieldset select,.v10-fieldset textarea{width:100%;font:inherit;border:1px solid #bfcee2;border-radius:9px;background:white;padding:10px;color:#183459;min-width:0}
.v10-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.v10-actions{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:10px 0}
.v10-actions button,.v10-actions select{border:1px solid #c0d5f0;border-radius:9px;padding:10px;background:#eef5ff;color:#25528e;font-weight:800;font-size:12px}
.v10-actions button.strong,.v10-actions button.active{background:#2563eb;color:white;border-color:#2563eb}
.v10-record{background:#fff;border:1px solid #d5e2ed;border-radius:12px;padding:13px;margin:10px 0;line-height:1.55}
.v10-record .v10-top{display:flex;justify-content:space-between;align-items:start;gap:8px}
.v10-record strong{font-size:14px;color:#263d5b}
.v10-record .v10-meta{font-size:11px;color:#687d99;margin-top:5px;overflow-wrap:anywhere}
.v10-record .v10-qty{font-size:18px;font-weight:900;color:#187454;white-space:nowrap}
.v10-record .v10-qty.warn{font-size:13px;color:#a55621}
.v10-head{font-size:14px;font-weight:850;color:#234d82;margin:15px 0 6px}
.v10-pill{border-radius:999px;background:#eaf1fb;color:#34577e;font-size:11px;font-weight:800;padding:4px 8px;white-space:nowrap}
.v10-pill.warn{background:#fff2e5;color:#9b591c}.v10-pill.good{background:#e9f8ed;color:#17704a}
.v10-notice{background:#fff8e9;border:1px solid #edd9b3;color:#78592a;padding:10px;border-radius:10px;font-size:12px;line-height:1.6;margin:12px 0}
.v10-status{background:#edf4fc;border-radius:10px;padding:12px;font-size:12px;color:#355880;line-height:1.65;margin:10px 0}
.v10-recipe-ing{display:grid;grid-template-columns:minmax(0,1.3fr) minmax(0,.65fr) minmax(0,.65fr) auto;align-items:end;gap:5px;margin:8px 0}
.v10-recipe-ing select,.v10-recipe-ing input{min-width:0;width:100%;border:1px solid #bfd1e5;border-radius:8px;padding:9px 5px;font-size:12px;background:white}
.v10-recipe-ing button{background:#fff0f0;border:1px solid #f0cccc;color:#aa3636;border-radius:8px;padding:9px 7px}
.v10-planrow{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,110px);gap:12px;align-items:center;margin:8px 0}
.v10-planrow input{width:100%;padding:9px;border-radius:8px;border:1px solid #bfd1e5;font-size:15px}
.v10-compact{font-size:12px;color:#617995;line-height:1.5}
.v10-group{border:1px solid #d3e0ef;border-radius:12px;margin:12px 0;overflow:hidden;background:white}
.v10-group>summary{padding:12px;background:#edf3fc;cursor:pointer;font-weight:850;color:#2a5789}
.v10-group .v10-subtitle{font-weight:800;color:#456485;padding:9px 12px;background:#f6f9fd;font-size:12px}
.v10-group .v10-record{margin:8px 10px}
.v10-checks{margin:12px 0;border-top:1px solid #d8e3ef;padding-top:10px}
.v10-checks select{width:100%;max-width:230px;padding:8px;border:1px solid #c4d3e5;border-radius:8px;background:white}
.v10-checks .v10-checkrow{display:grid;grid-template-columns:1fr 1fr;align-items:center;gap:9px;margin:9px 0;font-size:12px}
.v10-modal label{display:block;margin:8px 0;font-size:12px;font-weight:750;color:#365575}
.v10-modal input,.v10-modal textarea,.v10-modal select{width:100%;font:inherit;border:1px solid #c5d4e6;border-radius:8px;padding:10px;min-width:0;background:white;color:#183459}
@media(max-width:390px){.order-tabs.v10-tabs button{font-size:10px;padding:10px 1px}.v10-recipe-ing{gap:3px}.v10-recipe-ing input,.v10-recipe-ing select{font-size:11px;padding:9px 3px}.v10-checks .v10-checkrow{grid-template-columns:1fr 1fr}}
@media print{#orderPage,.v10-panel,.v10-modal{display:none!important}}

/* Ver.10.1: 仕込みの在庫・自動提案（既存の入力バーに変更なし） */
.v101-prep{border:1px solid #d9e4f1;background:#fff;border-radius:11px;margin:9px 0;padding:12px}
.v101-prep h4{margin:0 0 3px;font-size:14px}.v101-prep .sub{color:#74849a;font-size:11px;line-height:1.55}
.v101-metrics{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px;margin:10px 0}.v101-metric{background:#f3f6fa;border-radius:8px;padding:8px 5px;text-align:center;font-size:11px}.v101-metric strong{font-size:17px;display:block;color:#233952}.v101-metric small{font-size:10px;color:#718298}
.v101-inline{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin:9px 0}.v101-inline label{font-size:11px;color:#5c6e84;font-weight:700;display:block}.v101-inline input{width:100%;min-width:0;border-radius:8px;border:1px solid #c8d7e8;background:#fff;padding:10px;font-size:15px;color:#243c5e;margin-top:3px}
.v101-subrow{font-size:11px;line-height:1.6;padding:5px 0;border-bottom:1px solid #edf0f6}.v101-chip{font-size:11px;font-weight:700;color:#b15b27}.v101-danger{color:#ac3c3c}.v101-good{color:#087c54}
@media(max-width:360px){.v101-metric strong{font-size:15px}.v101-inline{gap:6px}}
/* v10.2 - lightweight daily preparation checklist */
.v102-board{border:1px solid #c8d8ee;border-radius:16px;background:#fff;padding:12px;margin:12px 0}
.v102-datebar{display:flex;align-items:center;gap:10px;justify-content:space-between;flex-wrap:wrap;margin-bottom:8px}
.v102-datebar label{font-weight:700;font-size:13px;color:#375779;display:flex;align-items:center;gap:8px}
.v102-datebar input{max-width:175px;min-height:39px;border:1px solid #bbcee5;padding:7px;border-radius:9px;color:#243c5b;background:#fff}
.v102-datebar .v10-status{margin:0;font-size:12px;padding:5px 8px}
.v102-table{border:1px solid #d7e1ee;border-radius:12px;overflow:hidden}
.v102-head,.v102-row{display:grid;grid-template-columns:39px minmax(80px,1fr) 133px 50px;align-items:center;column-gap:4px;padding:10px 8px}
.v102-head{background:#e9f0fa;font-size:12px;font-weight:800;color:#526d8f}
.v102-entry{border-top:1px solid #e1e7f0;background:#fff}
.v102-entry:nth-child(2n+1){background:#f8fafc}
.v102-entry.v102-warning{box-shadow:inset 3px 0 #d99826}
.v102-check{height:21px;width:21px;accent-color:#2563eb;justify-self:center}
.v102-name{min-width:0;display:flex;flex-direction:column;gap:4px;overflow-wrap:anywhere}
.v102-name strong{font-size:14px;line-height:1.4;color:#243c5b}
.v102-name small{font-size:11px;color:#7386a1}
.v102-stepper{display:flex;align-items:center;gap:3px;justify-content:center;min-width:0}
.v102-small{border:1px solid #cbd9eb;border-radius:8px;background:#edf3fe;color:#2156a3;font-size:18px;font-weight:800;min-height:34px;min-width:32px;padding:2px}
.v102-small:disabled{opacity:.35}
.v102-quantity{min-width:39px;text-align:center;font-weight:800;font-size:13px;color:#213958;white-space:nowrap}
.v102-detail{border:0;background:none;color:#1d5fb9;font-weight:700;font-size:12px;padding:6px 2px;min-height:36px}
.v102-detailbody{padding:10px 12px 12px 46px;border-top:1px dashed #cfdce9;background:#f5f8fe;display:flex;flex-direction:column;gap:8px}
.v102-caption{font-size:12px;color:#455d7e;line-height:1.6}
.v102-modes{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:5px}
.v102-modes button{border:1px solid #b9cce5;border-radius:8px;background:#fff;padding:8px 3px;font-size:12px;font-weight:700;color:#385c89;min-height:39px}
.v102-modes button.active{background:#2766df;color:#fff;border-color:#2766df}
.v102-muted{color:#8796a9;font-size:12px}
.v102-ingredient{font-size:13px;color:#304a70}
.v102-materials{border:1px solid #d5e2ed;border-radius:14px;background:#fff;padding:12px;margin-top:14px}
.v102-materialrow{display:flex;justify-content:space-between;align-items:center;gap:10px;border-top:1px solid #e6ebf2;padding:10px 0;font-size:13px}
.v102-materialrow>div{display:flex;flex-direction:column;gap:4px;min-width:0}
.v102-materialrow small{font-size:11px;color:#7085a2}
.v102-short{color:#aa4c11}
.v102-fold{margin:12px 0;border:1px solid #cbd8ea;border-radius:12px;padding:10px;background:#fff}
.v102-fold>summary{font-weight:800;color:#28507f;cursor:pointer;padding:7px 3px}
#v102Legacy{display:none!important}
@media(max-width:375px){.v102-board{padding:7px}.v102-head,.v102-row{grid-template-columns:31px minmax(62px,1fr) 118px 42px;gap:3px;padding:9px 4px}.v102-name strong{font-size:12px}.v102-small{min-width:29px}.v102-quantity{min-width:34px;font-size:12px}.v102-detail{font-size:11px}.v102-detailbody{padding-left:8px}}

/* Ver.10.3 — 月跨ぎ比較・月末列の左寄せ・振替の控えめな目印 */
.report-jump-actions{display:flex;align-items:center;flex-wrap:wrap;gap:7px;margin:10px 0 6px}
.report-jump-actions[hidden]{display:none!important}
.report-jump-actions button{border:1px solid #c9d9ed;border-radius:9px;background:#f7faff;color:#24558a;padding:9px 12px;font-size:12px;font-weight:850;min-height:39px}
.report-jump-actions button:active{background:#e7f2ff}
.report-jump-hint{font-size:10px;color:#7489a4}
.matrix th.matrix-end-space,.matrix td.matrix-end-space{min-width:var(--matrix-end-space, 260px)!important;width:var(--matrix-end-space, 260px)!important;padding:0!important;border-right:0!important;background:#fff!important;box-shadow:none!important;pointer-events:none}
.matrix thead th.matrix-end-space{position:static;z-index:auto}
.matrix th.reference-head{background:#f2f3f7!important;color:#54637a!important;border-right:2px solid #b5c8e0}
.matrix th.reference-head .date-weekday{color:#667892!important}
.matrix td.reference-cell:not(.issue){background:#f8f9fc!important;border-right:2px solid #b5c8e0}
.matrix .reference-label{display:block;font-size:9px;line-height:1.1;color:#64768a;margin:0 0 2px}
.transfer-mark{display:flex;align-items:center;justify-content:center;gap:3px;margin:5px auto 0;background:transparent;border:0;padding:0;cursor:pointer;line-height:1}
.transfer-mark span{display:inline-block;font-size:9px;font-weight:850;padding:3px 5px;border-radius:5px;border:1px solid #cbd8e5;background:#f4f7fa;color:#526983}
.transfer-mark .transfer-in{background:#eff8f6;border-color:#d3e9e2;color:#337668}
.transfer-mark .transfer-out{background:#f2f5fc;border-color:#d6e0f2;color:#486c9d}
.transfer-mark:focus-visible{outline:2px solid #2563eb;outline-offset:2px;border-radius:4px}
.flow-transfer-mark{display:inline-block;margin-left:7px;vertical-align:middle;padding:3px 6px;border-radius:5px;background:#eef4f8;color:#58728d;font-size:10px;font-weight:750}
.print-transfer-mark{font-size:7px;font-weight:700;color:#60758e}
@media print{.report-jump-actions{display:none!important}}

/* Ver.10.4 — 結果一覧の数量を見やすく（数値のみ強調）。
   商品名・日付・振替印・列幅・スクロール動作は維持する。 */
.report-page .matrix tbody td.has-value,
.report-page .matrix tbody td.provisional,
.report-page .matrix tbody td.issue {
  font-size:16px;
  font-weight:900;
  line-height:1.3;
  letter-spacing:-0.02em;
  font-variant-numeric:tabular-nums;
}
.report-page .matrix tbody td.has-value:not(.provisional):not(.issue){color:#143b68}
/* 「—」と補足は数値より控えめなままにする。 */
.report-page .matrix tbody td.empty-value{font-size:12px;font-weight:500}
.report-page .matrix tbody td .cell-sub{font-size:9px;letter-spacing:0}
/* 印刷では7日分の表がA4に収まる文字サイズを優先。 */
@media print{
  .print-report-sheet tbody td{font-size:10.5px;font-weight:800;line-height:1.25;color:#203e60}
  .print-report-sheet tbody td .print-transfer-mark{font-size:7px;font-weight:700}
}

/* Ver.10.5 — 数量はセルの真ん中を維持、振替「受・送」のみ右上端に配置。
   受・送がないセルの見た目、列幅、スクロール、計算・保存処理は変更しない。 */
.report-page .matrix tbody td.has-transfer { position:relative; }
.report-page .matrix tbody td.has-transfer .transfer-mark {
  position:absolute;
  top:2px;
  right:2px;
  display:flex;
  flex-direction:row;
  align-items:center;
  justify-content:center;
  gap:2px;
  width:max-content;
  max-width:calc(100% - 4px);
  margin:0;
  padding:0;
  line-height:1;
  background:transparent;
  border:0;
  z-index:1;
  cursor:pointer;
}
.report-page .matrix tbody td.has-transfer .transfer-mark span {
  display:inline-block;
  flex-shrink:0;
  font-size:9px;
  font-weight:900;
  line-height:1;
  padding:2px 4px;
  border-radius:5px;
}
.report-page .matrix tbody td.has-transfer .transfer-mark .transfer-in {
  color:#2364b8;
  background:#e8f2ff;
  border:1px solid #bbd7f9;
}
.report-page .matrix tbody td.has-transfer .transfer-mark .transfer-out {
  color:#ad5819;
  background:#fff0e4;
  border:1px solid #f3d3b1;
}
/* 印の見た目は小さく、タップ判定だけを見た目より広くする。 */
.report-page .matrix tbody td.has-transfer .transfer-mark::before {
  content:"";
  position:absolute;
  inset:-5px -3px -7px -7px;
}
.report-page .matrix tbody td.has-transfer .transfer-mark:focus-visible {
  outline:2px solid #2563eb;
  outline-offset:3px;
}
@media print {
  .print-report-sheet tbody td { position:relative; }
  .print-report-sheet tbody td .print-transfer-mark {
    position:absolute;
    top:1px;
    right:1px;
    margin:0;
    font-size:7px;
    line-height:1;
    color:#60758e;
  }
}
