/* One stock pool per labelled block. Never squeeze explanatory prose between numbers. */
.plan-table-region { min-width:0; max-width:100%; }
.plan-table-scroll { max-width:100%; overflow-x:auto; overscroll-behavior-x:contain; }
.plan-table-scroll:focus-visible { outline:2px solid #557c62; outline-offset:-2px; }
.plan-scroll-hint { margin:0; padding:8px 16px; background:#f3f6f0; font-size:14px; color:#42594a; }
.plan-scroll-hint[hidden] { display:none; }
.stock-plan-table { min-width:1100px; }
.stock-plan-table td { vertical-align:top; padding:16px 12px; line-height:1.4; }
.stock-plan-table td:first-child { width:23%; min-width:230px; }
.stock-plan-table td[data-label="30-day demand"] { min-width:135px; }
.stock-plan-table td[data-label="At warehouse"] { min-width:116px; }
.stock-plan-table td[data-label="At Amazon"],.stock-plan-table td[data-label="On the way to Amazon"] { min-width:142px; }
.stock-plan-table td[data-label="To make / buy"],.stock-plan-table td[data-label="30-day shortage"] { min-width:126px; }
.stock-plan-table td[data-label="Next step"],.stock-plan-table td[data-label="When to order"] { min-width:176px; max-width:220px; text-align:left; }
.stock-plan-table td[data-label="Next step"]>.button,.stock-plan-table td[data-label="When to order"]>.button { display:flex; width:100%; min-height:38px; margin:0 0 8px; }
.stock-plan-table .plan-amazon-details { display:block; margin:2px 0 8px; font-size:14px; font-weight:500; }
.stock-plan-table td.number>small { font-weight:400; }
.stock-plan-table .plan-update-stock { display:block; margin:4px 0 0 auto; min-height:44px; font-size:14px; font-weight:500; white-space:nowrap; }
.plan-stock-actions { display:grid; gap:12px; }
.plan-stock-actions>.button { display:grid; grid-template-columns:minmax(0,1fr); gap:5px; padding:14px; min-height:64px; width:100%; text-align:left; white-space:normal; }
.plan-stock-actions strong { font-size:16px; }
.plan-stock-actions span { font-size:14px; font-weight:400; line-height:1.5; }
.stock-plan-table .channel-detail { font-weight:400; }
.plan-amazon-quantities { display:grid; gap:10px; text-align:left; }
.plan-direct-stock,.plan-contained-stock { display:grid; gap:3px; }
.stock-plan-table .plan-contained-stock { margin:0; padding:8px 0 0; border-top:1px solid #e3e9df; }
.plan-stock-label,.plan-stock-note { display:block; font-size:13px; font-weight:400; line-height:1.4; color:#526557; white-space:normal; }
.plan-stock-amount { display:flex; flex-wrap:wrap; align-items:baseline; gap:4px; line-height:1.35; }
.plan-stock-amount strong,.stock-plan-table .plan-contained-stock strong { display:block; font-size:20px; font-weight:650; line-height:1.35; white-space:nowrap; font-variant-numeric:tabular-nums; color:#294a37; }
.plan-stock-amount>span { font-size:13px; font-weight:400; white-space:nowrap; }
.plan-stock-amount .plan-stock-unknown { font-size:15px; font-weight:500; color:#596a60; }
.materials-plan-table { min-width:1180px; }
.materials-plan-table td[data-label="Days left"] { min-width:142px; }
.materials-plan-table td[data-label="Lead time"] { min-width:110px; }
@media(max-width:700px) {
 .plan-table-scroll { overflow:visible; }
 .plan-scroll-hint { display:none; }
 #demand-table .stock-plan-table td { min-width:0; max-width:100%; }
 #demand-table tr.mobile-entry>td.number { overflow-wrap:normal; }
 #demand-table tr.mobile-entry>td.number>button.plan-update-stock,
 #demand-table tr.mobile-entry:not(.mobile-open)>td.number>button.plan-update-stock { display:block; margin-left:0; }
 #demand-table .plan-amazon-quantities { gap:9px; }
 #demand-table .plan-stock-label,#demand-table .plan-stock-note { font-size:12px; }
 #demand-table .plan-stock-amount strong { font-size:19px; }
 #demand-table .plan-stock-amount .plan-stock-unknown { font-size:14px; }
 #demand-table .plan-stock-amount>span { font-size:12px; }
 #demand-table tr.mobile-entry.mobile-open>td[data-label="Next step"],#demand-table tr.mobile-entry.mobile-open>td[data-label="When to order"] { width:100%; max-width:none; }
}
/* Keep the same quantities and controls, arranged for scanning on a phone. */
@media(max-width:700px) {
 #demand-table tr.mobile-entry:not(.mobile-open) { grid-template-columns:repeat(6,minmax(0,1fr))!important; column-gap:10px!important; padding-bottom:44px!important; }
 #demand-table tr.mobile-entry:not(.mobile-open):not(:has(.plan-update-stock)) { padding-bottom:8px!important; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td.number,
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="Lead time"] { grid-column:span 2!important; padding:4px 0!important; font-size:18px; line-height:1.3; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="30-day demand"] { grid-column:1/3!important; grid-row:2; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="At warehouse"] { grid-column:3/5!important; grid-row:2; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="To make / buy"],
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="30-day shortage"] { grid-column:5/7!important; grid-row:2; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td.number:before,
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="Lead time"]:before { font-size:12px; line-height:1.3; margin-bottom:4px; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="At Amazon"],
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="On the way to Amazon"] { grid-column:span 3!important; border-top:1px solid #edf0e9!important; margin-top:4px; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="At Amazon"]:before,
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="On the way to Amazon"]:before { min-height:0; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td.number>small { font-size:12px; line-height:1.3; margin-top:2px; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td.number>.shortage-share { display:none; }
 #demand-table tr.mobile-entry:not(.mobile-open) .plan-direct-stock { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 6px; }
 #demand-table tr.mobile-entry:not(.mobile-open) .plan-stock-amount { gap:3px; }
 #demand-table tr.mobile-entry:not(.mobile-open) .plan-direct-stock>.plan-stock-note:not(.plan-stock-missing) { display:none; }
 #demand-table tr.mobile-entry:not(.mobile-open) .plan-contained-stock { display:flex; flex-wrap:wrap; align-items:baseline; gap:2px 6px; padding-top:4px; }
 #demand-table tr.mobile-entry:not(.mobile-open) .plan-contained-stock>.plan-stock-note { flex-basis:100%; }
 #demand-table tr.mobile-entry:not(.mobile-open) .plan-amazon-quantities { gap:4px; }
 #demand-table tr.mobile-entry:not(.mobile-open)>td.number>button.plan-update-stock { position:absolute; bottom:0; right:12px; margin:0; min-height:44px; }
}
@media(max-width:360px) {
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="30-day demand"]:before,
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="At warehouse"]:before,
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="To make / buy"]:before,
 #demand-table tr.mobile-entry:not(.mobile-open)>td[data-label="30-day shortage"]:before { min-height:31px; }
}
