/* Everyday work uses the page's full height. Only dialogs have vertical limits. */
.plan-carton-usage { margin:5px 0 8px 68px; color:#526758; font-size:12px; line-height:1.5; text-align:left; white-space:normal; overflow-wrap:anywhere; }
.plan-carton-usage>span { display:block; }
.plan-carton-usage>span+span { margin-top:3px; }
.plan-carton-capacity { white-space:nowrap; }
.plan-carton-alternatives { font-style:italic; }
@media(max-width:700px) { .plan-carton-usage { margin-left:0; } }
:root { --sidebar: 246px; --ink:#203b2d; --muted:#596a60; }
main { max-width:none; padding-bottom:36px; }
.table-scroll, .entry-table-wrap, .preview-scroll, #mapping-table, #sourcing-table, #entry-table { max-height:none !important; height:auto; overflow-x:auto; }
.right-column { display:none; }
.sidebar .workspace { margin-bottom:22px; }
.sidebar .nav-item { font-size:15px; margin:3px 0; }
.sidebar-bottom { margin-top:auto; }
.nav-more { margin:24px 0 10px; border-top:1px solid var(--line); padding-top:16px; }
.nav-more summary { cursor:pointer; padding:10px 12px; color:var(--muted); font-size:15px; }
.nav-more[open] summary { margin-bottom:10px; }
.profile { display:none; }
.job-switch { display:flex; gap:6px; padding:5px; border-radius:12px; background:#e9eee8; width:fit-content; }
.job-switch button { padding:12px 20px; min-height:46px; border-radius:8px; color:#526557; font-size:16px; }
.job-switch button.selected { background:white; color:var(--forest); box-shadow:0 1px 5px #193a2412; font-weight:650; }
.action-summary { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:18px; }
.action-summary>button { text-align:left; padding:22px 24px; background:white; border:1px solid var(--line); border-radius:12px; }
.action-summary>button:hover { border-color:#597b5c; }
.action-summary span { font-size:17px; font-weight:600; }
.action-summary strong { display:block; font-size:34px; line-height:1.2; margin:12px 0 8px; }
.action-summary small { color:var(--muted); font-size:14px; line-height:1.5; }
.plan-notice { display:flex; align-items:center; flex-wrap:wrap; gap:12px; font-size:15px; line-height:1.55; }
.plan-notice>span:nth-child(2) { flex:1; min-width:220px; }
.demand-stages { display:flex; flex-wrap:wrap; }
.demand-stages button { flex:1; padding:13px 16px; }
.demand-stages small { font-size:13px; }
.daily-table { width:100%; min-width:0; table-layout:auto; }
.daily-table th { text-transform:none; letter-spacing:0; font-size:15px; color:#42594a; background:#f3f6f0; }
.daily-table td { vertical-align:middle; padding:19px 16px; }
.daily-table td:first-child { width:31%; }
.daily-table small { display:block; color:var(--muted); font-size:13px; line-height:1.5; margin-top:5px; white-space:normal; }
.daily-table .item-button { max-width:none; width:100%; gap:14px; }
.item-thumbnail,.item-initial { width:54px; height:58px; flex-shrink:0; object-fit:contain; border-radius:8px; background:#f4f5ef; }
.daily-table .item-name { font-size:16px; font-weight:600; }
.daily-table td.number { font-size:19px; font-weight:550; }
.daily-table .button { min-width:100px; font-weight:550; }
.plan-sort-bar { display:flex; align-items:center; flex-wrap:wrap; gap:12px 18px; padding:0 20px 16px; }
#demand-filters-toggle { display:none; }
.plan-presets { display:flex; border:1px solid var(--line); border-radius:8px; padding:3px; gap:3px; }
.plan-presets button { min-height:42px; padding:9px 14px; border-radius:6px; font-size:14px; }
.plan-presets .selected { background:#e8f0e2; color:var(--forest); font-weight:650; }
.plan-sort-controls { display:flex; align-items:center; flex-wrap:wrap; gap:8px; }
.plan-sort-controls label { font-size:14px; color:var(--muted); }
.plan-sort-controls select { min-height:44px; max-width:210px; }
.sort-direction { min-height:44px; padding:8px 12px; border:1px solid var(--line); border-radius:7px; font-size:14px; }
.plan-column-sort { display:inline-flex; align-items:center; justify-content:inherit; gap:6px; text-align:inherit; font:inherit; color:inherit; min-height:44px; width:100%; white-space:normal; }
.plan-column-sort span { flex-shrink:0; color:var(--muted); }
.stock-plan-table th.number .plan-column-sort { justify-content:flex-end; }
.stock-plan-table th[aria-sort="ascending"], .stock-plan-table th[aria-sort="descending"] { background:#e6efdf; color:var(--forest); }
.stock-plan-table td:first-child { width:26%; }
.stock-plan-table td:last-child { max-width:160px; }
.stock-plan-table .button { white-space:normal; }
.plan-status { display:inline-flex; align-items:center; font-size:12px; font-weight:600; padding:4px 8px; border-radius:5px; margin-top:9px; }
.plan-status-short { background:#fae6df; color:#883b22; }
.plan-status-estimate { background:#fff0d1; color:#765212; }
.plan-status-neutral { background:#f0f3ed; color:#596a60; }
.plan-status-covered { background:#e8f0e2; color:#2b5738; }
.stock-plan-table tr.has-shortage td:first-child { box-shadow:inset 3px 0 #c88b42; }
.stock-plan-table .shortage-share { color:#805029; }
.plan-contained-stock { margin-top:10px; padding-top:10px; border-top:1px solid var(--line); white-space:normal; }
.plan-contained-stock strong { display:block; font-size:18px; }
.plan-contained-stock small { font-weight:400; }
.stock-plan-table .plan-contained-stock .inline-link,
.stock-plan-table td[data-label="At Amazon"]>.inline-link { font-size:13px; line-height:1.4; white-space:normal; }
.plan-missing-value { font-size:14px; font-weight:500; }
.plan-notice .status-badge { white-space:normal; overflow-wrap:anywhere; }
.materials-plan-table { min-width:1120px; }
.materials-plan-table td:first-child { width:21%; min-width:190px; }
.materials-plan-table td:last-child { min-width:150px; }
.order-timing { display:block; font-size:14px; line-height:1.5; margin-bottom:6px; }
.order-timing~.button { margin-top:10px; }
.order-urgent { color:#91431f; }
.material-order-details { border-top:1px solid var(--line); margin-top:18px; }
@media(max-width:700px) {
 .materials-plan-table { min-width:0; }
 .materials-plan-table td:first-child,.materials-plan-table td:last-child { min-width:0; width:auto; }
 .plan-sort-bar { padding:0 14px 16px; gap:10px; }
 .plan-presets { width:100%; }
 .plan-presets button { flex:1; min-height:44px; }
 .plan-sort-controls { width:100%; display:grid; grid-template-columns:auto minmax(0,1fr); }
 .plan-sort-controls select { max-width:none; min-width:0; width:100%; font-size:16px; }
 .plan-sort-controls .sort-direction { grid-column:2; width:100%; }
 .stock-plan-table td:last-child { max-width:none; }
 .stock-plan-table tr.has-shortage td:first-child { box-shadow:none; }
 .stock-plan-table tr.has-shortage { border-left:3px solid #c88b42; }
 .plan-status { font-size:13px; }
}
.daily-empty { text-align:center; padding:38px !important; color:var(--muted); }
.channel-detail { margin-top:8px; font-size:13px; font-weight:400; color:var(--muted); }
.channel-detail summary { cursor:pointer; text-decoration:underline; text-underline-offset:3px; }
.channel-detail span { display:block; font-size:13px; white-space:nowrap; }
.demand-calculation h3 { font-size:17px; margin:24px 0 10px; }
.demand-contributions { list-style:none; padding:0!important; margin:0!important; }
.demand-contributions li { border-top:1px solid var(--line); padding:12px 0; margin:0!important; }
.demand-contributions .inline-link { text-align:left; white-space:normal; overflow-wrap:anywhere; }
.demand-equation { display:flex; justify-content:space-between; flex-wrap:wrap; gap:8px 16px; margin-top:7px; font-size:15px; }
.demand-equation strong { white-space:nowrap; }
.demand-contributions small, .calculation-note { font-size:13px; line-height:1.6; color:var(--muted); }
.material-plan-heading,.material-use-title { display:flex; align-items:center; gap:12px; flex-wrap:wrap; }
.material-plan-heading { font-size:18px; font-weight:600; }
.material-plan-numbers { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:20px 0; }
.material-plan-numbers>div { background:var(--surface-alt,#f5f7f2); border:1px solid var(--line); border-radius:10px; padding:14px; }
.material-plan-numbers small,.material-plan-numbers strong { display:block; }
.material-plan-numbers strong { font-size:22px; margin-top:8px; }
.material-plan-help summary,.material-usage summary { cursor:pointer; min-height:44px; display:flex; align-items:center; color:var(--green,#244a37); }
.material-plan-help p,.material-usage small { color:var(--muted); font-size:14px; }
.material-plan-actions { display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 24px; }
.material-blockers { display:grid; gap:10px; padding:16px 0; }
.material-blockers button { text-align:left; white-space:normal; }
.material-usage { list-style:none; padding:0!important; }
.material-usage>li { padding:20px 0; border-top:1px solid var(--line); }
.material-use-title .inline-link { text-align:left; white-space:normal; font-size:17px; }
.material-use-title strong { width:100%; font-size:15px; }
.material-use-counts { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:12px; margin:14px 0; }
.material-use-counts dt { font-size:13px; color:var(--muted); }
.material-use-counts dd { margin:5px 0; font-weight:600; }
.material-use-result { display:flex; flex-wrap:wrap; gap:8px 24px; }
.material-plan { overflow-wrap:anywhere; }
@media(max-width:600px) {
 .material-plan-numbers { grid-template-columns:1fr; gap:8px; }
 .material-plan-numbers>div { display:flex; justify-content:space-between; align-items:center; gap:16px; }
 .material-plan-numbers strong { margin:0; font-size:20px; text-align:right; }
 .material-plan-actions .button { width:100%; }
 .material-use-counts { gap:8px; }
}
.plan-method { font-size:15px; color:var(--muted); padding:8px 0; max-width:1000px; }
.plan-method summary { cursor:pointer; color:var(--forest); font-weight:600; }
.plan-method p { margin:14px 0; line-height:1.7; }
.work-actions { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:16px; }
.work-actions>button { display:flex; align-items:center; gap:14px; padding:22px; border:1px solid var(--line); border-radius:12px; text-align:left; background:white; }
.work-actions svg { width:27px; height:27px; flex-shrink:0; }
.work-actions strong { display:block; font-size:17px; }
.work-actions small { display:block; color:var(--muted); margin-top:8px; font-size:14px; line-height:1.5; }
.work-actions .selected { border:2px solid var(--forest); background:#f0f5ec; padding:21px; }
.work-links { display:flex; flex-wrap:wrap; gap:20px; font-size:15px; }
.mobile-views details { position:relative; }
.mobile-views summary { min-height:44px; padding:10px 12px; cursor:pointer; }
.mobile-more { position:absolute; right:0; top:45px; width:230px; padding:10px; background:white; box-shadow:0 6px 24px #1d3b2926; border:1px solid var(--line); border-radius:10px; z-index:6; display:grid; }
.mobile-more button { text-align:left; }
.recipe-tree .item-thumbnail { width:38px; height:42px; vertical-align:middle; margin-right:9px; }
#mapping-table .item-button { max-width:none; }
.workspace-view { gap:22px; }
#work-view .panel-heading { align-items:center; flex-wrap:wrap; gap:12px; }
@media(max-width:1100px) { :root{--sidebar:224px;} main{padding:25px;} .daily-table td,.daily-table th{padding:14px 10px;} .work-actions>button{padding:16px;} .daily-table .item-thumbnail{width:44px;height:50px;} }
@media(max-width:900px) { :root{--sidebar:0px;} .mobile-views{overflow:visible; flex-wrap:nowrap; justify-content:space-between;} .sidebar{display:none;} .app-shell{margin:0;} }
@media(max-width:700px) {
 main { padding:20px 14px; } .page-heading h1{font-size:30px;} .page-heading p{max-width:none;font-size:16px;} .page-heading .eyebrow{display:none;}
 .heading-actions{width:auto;} .job-switch{width:100%;} .job-switch button{flex:1;padding:10px;font-size:14px;}
 .action-summary{gap:8px;} .action-summary>button{padding:15px 11px;} .action-summary span{font-size:14px;} .action-summary strong{font-size:29px;} .action-summary small{font-size:12px;}
 .demand-stages{gap:6px;padding:0 12px 16px;} .demand-stages button{flex:1;display:block;text-align:center;padding:11px 6px;min-height:70px;font-size:13px;} .demand-stages svg{display:none;} .demand-stages span{display:block;} .demand-stages small{margin-top:6px;}
 .table-controls{padding:0 14px 16px;gap:10px;} .table-controls .search-box{flex-basis:100%;max-width:none;} .table-controls select{flex:1;max-width:none;min-width:0;font-size:14px;}
 .daily-table,.daily-table tbody{display:block;} .daily-table thead{display:none;} .daily-table tr{display:grid;grid-template-columns:1fr 1fr;gap:0;border-top:1px solid var(--line);padding:14px 10px;}
 .daily-table td{display:block;border:0!important;min-width:0;width:auto!important;padding:10px!important;white-space:normal;}
 .daily-table td:first-child{grid-column:1/-1;} .daily-table td.number{text-align:left;font-size:20px;}
 .daily-table td[data-label]::before{content:attr(data-label);display:block;font-size:13px;font-weight:500;color:var(--muted);margin-bottom:6px;}
 .daily-table .item-thumbnail{width:56px;height:60px;} .daily-table .item-name{font-size:17px;}
 .daily-table td:last-child{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;}
 .work-table td:last-child{grid-column:auto;display:block;} .daily-table small{font-size:14px;} .channel-detail{font-size:14px;}
 .work-actions{grid-template-columns:1fr;gap:10px;} .work-actions>button{padding:16px;} .work-actions small{margin-top:4px;}
 .plan-notice>span:nth-child(2){min-width:0;flex-basis:100%;} .plan-method p{font-size:15px;} .daily-empty{grid-column:1/-1;}
}
.title-with-help { display:flex; align-items:center; gap:12px; }
#page-notes, [data-page-help] { border:1px solid #b7c7bb; border-radius:50%; width:34px; height:34px; min-width:34px; min-height:34px; font-size:19px; font-weight:600; color:var(--forest); background:white; }
.section-actions { display:flex; align-items:center; gap:12px; }
.section-help { justify-self:end; }
.sku-summary>p, .sku-structure-grid .field-note { display:none; }
.sku-summary { grid-template-columns:1fr auto; align-items:center; gap:12px; }
.sku-summary .section-help { grid-column:2;grid-row:1; }
.sku-summary>.status-badge { grid-row:1;grid-column:1; }
.sku-summary>.button { grid-column:1/-1; }
[hidden] { display:none!important; }
/* Keep the plan above the fold; navigation already separates admin and ops. */
main { padding:24px 32px 36px; }
.page-heading .eyebrow, .page-heading>div>p, .job-switch { display:none; }
.page-heading h1 { margin:0; font-size:30px; }
.page-heading { align-items:center; margin-bottom:0; }
.workspace-view { margin-top:20px; gap:16px; }
.action-summary>button { padding:14px 18px; display:grid; grid-template-columns:1fr auto; align-items:center; gap:5px 12px; }
.action-summary strong { grid-column:2; grid-row:1/3; margin:0; font-size:30px; }
.action-summary small { grid-column:1; }
.action-summary span { font-size:16px; }
.demand-panel .panel-heading { padding:18px 22px; }
.demand-panel .panel-heading p { display:none; }
.demand-stages { padding:0 20px 14px; }
.demand-stages button { padding:10px 14px; }
.demand-panel .table-controls { padding:0 20px 16px; }
@media(max-width:700px) { main{padding:18px 14px;} .workspace-view{margin-top:16px;gap:14px;} .action-summary>button{padding:12px 10px;display:block;} .action-summary strong{font-size:25px;margin:7px 0 2px;} .action-summary span{font-size:13px;} .action-summary small{display:none;} .demand-panel .panel-heading{padding:15px;} .demand-stages{padding:0 12px 12px;} .demand-stages button{padding:9px 5px;min-height:54px;} .demand-stages small{display:none;} .demand-panel .table-controls{padding:0 12px 14px;} }
.workspace-view .workflow-intro>div, .workspace-view .workflow-intro:not(:has(>button)):not(:has(>a)), .workspace-view .mapping-explanation, .workspace-view .entry-note, .workspace-view .sourcing-note, .workspace-view .upload-steps, .workspace-view .sheets-panel ol, .workspace-view .sheets-panel p, #upload-description, #uploads-view .explanation, .photo-progress>p, #mappings-view .input-banner p, .catalogue-note p, .connection-disclaimer { display:none; }
.workspace-view .workflow-intro { justify-content:flex-end; }
@media(max-width:700px) { #record-stock{display:none!important;} .plan-notice{gap:8px;justify-content:space-between;font-size:14px;} .plan-notice>span:nth-child(2){display:none;} .plan-notice .status-badge{font-size:12px;} }
.missing-count-filter { display:flex;gap:10px;align-items:center;padding:0 22px 18px;color:var(--muted);font-size:15px; }
.missing-count-filter input { width:19px;height:19px;min-height:0;accent-color:var(--forest); }

/* Keep controls readable, and make every action practical with a thumb. */
#page-notes, [data-page-help], .icon-button { min-width:44px; min-height:44px; }
.title-with-help { min-width:0; }
.title-with-help h1 { overflow-wrap:anywhere; }
.search-box input, .table-controls select, .field input, .field select,
.photo-filter-grid input, .photo-filter-grid select { font-size:16px; }
input::placeholder, .search-box input::placeholder { color:#677468; opacity:1; }
.status-missing { color:#586353; background:#eef1e9; }
.status-covered { color:#496b3e; }
.source-caption, .filter-tabs button, .item-meta { color:#596a60; }
.unknown { color:#596a60!important; }
.inline-link { display:inline-flex; align-items:center; min-height:44px; }
.channel-detail summary { display:list-item; min-height:44px; padding:10px 0; }
.daily-table td { height:auto; }
#work-view .panel-heading p, .photo-tip, .photo-start-hint,
.photo-library .panel-heading p { display:none; }
.photo-progress { padding:14px 20px; }
.photo-progress>div { display:flex; align-items:baseline; flex-wrap:wrap; gap:8px 14px; }
.photo-progress strong { font-size:25px; }
.sourcing-panel { margin-top:0; }
.entry-controls { padding-bottom:18px; }
.entry-controls .field { margin-bottom:0; }
dialog .drawer-header { position:sticky; top:0; z-index:4; background:white; border-bottom:1px solid var(--line); }
.recipe-row label, #action-preview { color:var(--muted); }
.issues-dialog { width:min(820px,calc(100vw - 24px)); max-height:90dvh; overflow-y:auto; }
.issues-toolbar { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-bottom:18px; }
.issues-toolbar>p { display:none; }
.issues-toolbar>button:last-child { margin-left:auto; }
.issues-group { border:1px solid var(--line); border-radius:9px; margin:12px 0; overflow:hidden; }
.issues-group>summary { display:flex; align-items:center; justify-content:space-between; gap:14px; padding:14px 16px; cursor:pointer; color:var(--ink); background:#f4f7f1; min-height:52px; }
.issues-group>summary::before { content:'›'; font-size:24px; line-height:1; }
.issues-group[open]>summary::before { transform:rotate(90deg); }
.issues-group>summary>span { flex:1; font-weight:600; }
.issues-group>summary>strong { font-size:14px; white-space:nowrap; }
.issues-group>summary::-webkit-details-marker { display:none; }
.issues-list { list-style:none; margin:0!important; padding:0!important; }
.issues-list>li { display:flex; align-items:center; gap:18px; margin:0!important; padding:16px; border-top:1px solid var(--line); }
.issues-list>li>div { flex:1; min-width:0; }
.issues-list strong { display:block; color:var(--ink); font-weight:600; overflow-wrap:anywhere; }
.issues-list p { margin:5px 0 0!important; font-size:14px; line-height:1.5; color:var(--muted); overflow-wrap:anywhere; }
.issues-list>li>.button { flex-shrink:0; min-height:44px; }
.issues-empty { padding:12px 0; }
.amazon-plan { margin:16px 0; }
.amazon-plan>div { display:flex; justify-content:space-between; gap:18px; padding:12px 0; border-bottom:1px solid var(--line); }
.amazon-plan dd { margin:0; font-weight:600; color:var(--ink); text-align:right; }
#action-preview .production-checks { list-style:none; padding:0; margin:16px 0; }
.production-checks>li { border-top:1px solid #d4decf; margin:0; padding:14px 0; }
.production-checks>li>strong { display:block; color:var(--ink); }
.production-checks p { margin:4px 0 8px; line-height:1.5; }
.production-checks small { font-size:14px; }
.production-checks .button { margin:6px 6px 0 0; }
#add-component, #create-component { margin:4px 8px 4px 0; }

@media(max-width:700px) {
 .daily-table td { height:auto; min-height:0; }
 .daily-table td:last-child { flex-wrap:wrap; }
 .daily-table .inline-link { justify-content:flex-end; }
 .daily-table td:first-child .item-button { min-height:60px; }
 .daily-table .button.compact { min-height:44px; }
 .channel-detail span { white-space:normal; }
 .mobile-views button, .mobile-views a, .mobile-views summary { min-height:44px; }
 .work-actions { grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
 .work-actions>button, .work-actions>button.selected { flex-direction:column; align-items:center; justify-content:center; gap:8px; padding:12px 8px; text-align:center; min-height:98px; }
 .work-actions strong { font-size:14px; line-height:1.35; }
 .work-actions svg { width:23px; height:23px; }
 .entry-controls { grid-template-columns:repeat(2,minmax(0,1fr)); gap:14px 12px; padding:16px; }
 .entry-controls>.field:first-child, .entry-controls>.field:last-child { grid-column:1/-1; }
 .entry-controls .field label { font-size:14px; }
 .entry-controls input, .entry-controls select { min-width:0; max-width:100%; }
 .entry-controls .field:has(#entry-date) { grid-column:1/-1; }
 .entry-actions { gap:10px; padding:16px; }
 .entry-actions .button { flex:1; }
 .entry-actions>span { flex-basis:100%; }
 .sourcing-stats { padding:14px 16px; gap:8px 14px; font-size:14px; }
 .sourcing-stats strong { font-size:21px; }
 .sourcing-filters .field { margin-bottom:14px; }
 .sourcing-toggle, .photo-missing-toggle, .missing-count-filter { min-height:44px; }
 #mappings-view .input-banner { margin:0; padding:14px 16px; gap:8px; }
 #mappings-view .input-banner>div { flex:1; min-width:0; }
 #mappings-view .input-banner>button { margin-left:0; flex-basis:100%; justify-content:flex-start; }
 .filter-tabs { gap:2px 10px; padding:0 14px; }
 .filter-tabs button { padding-bottom:7px; }
 .photo-format-note { font-size:14px; line-height:1.5; }

 /* Keep the editable value and its action next to the item on a phone. */
 #entry-table table, #mapping-table table, #sourcing-table table,
 #entry-table tbody, #mapping-table tbody, #sourcing-table tbody { display:block; min-width:0; width:100%; white-space:normal; }
 #entry-table thead, #mapping-table thead, #sourcing-table thead { position:absolute; width:1px; height:1px; padding:0; margin:-1px; overflow:hidden; clip-path:inset(50%); white-space:nowrap; }
 #entry-table tr, #mapping-table tr, #sourcing-table tr { display:grid; grid-template-columns:minmax(0,1fr); padding:14px 16px; border-top:1px solid var(--line); gap:12px; }
 #entry-table td, #mapping-table td, #sourcing-table td { display:block; height:auto; min-height:0; min-width:0; max-width:none; width:auto; border:0; padding:0; text-align:left; overflow-wrap:anywhere; }
 #entry-table td[data-label]::before, #mapping-table td[data-label]::before, #sourcing-table td[data-label]::before { content:attr(data-label); display:block; font-size:13px; font-weight:600; line-height:1.5; color:var(--muted); margin-bottom:4px; }
 #entry-table td:first-child::before, #mapping-table td:first-child::before, #sourcing-table td:first-child::before { display:none; }
 #entry-table .item-button, #mapping-table .item-button, #sourcing-table .item-button { max-width:none; min-height:54px; width:100%; }
 #entry-table input { min-width:0; }
 #entry-table .item-thumbnail, #mapping-table .item-thumbnail, #sourcing-table .item-thumbnail { width:48px; height:52px; }
 #mapping-table .component-list li { margin-bottom:8px; }
 #mapping-table .component-list li:last-child { margin-bottom:0; }
 #mapping-table .inline-link { min-height:36px; }
 #mapping-table .button, #sourcing-table td:last-child>.button { width:100%; min-height:44px; }
 #sourcing-table .vendor-contact { min-width:0; max-width:none; }
 #sourcing-table .sourcing-chip { min-height:44px; }
 .recipe-row select, .recipe-row input { font-size:16px; }
 .recipe-row { grid-template-columns:minmax(0,1fr) 44px; gap:12px; }
 .recipe-row>div:first-child { grid-column:1/-1; }
 .recipe-row label { font-size:14px; }
 .recipe-row .remove-component { margin-top:16px; align-self:center; }
 .drawer-tabs { gap:14px; }
 .drawer-tabs button { min-height:44px; }
 .issues-dialog .drawer-header { gap:10px; padding:18px 16px; }
 .issues-dialog .drawer-header h2 { font-size:23px; }
 .issues-dialog .info-body { padding:0 14px 18px; }
 .issues-group>summary { padding:12px; gap:9px; font-size:15px; }
 .issues-list>li { flex-wrap:wrap; padding:14px 12px; gap:10px; }
 .issues-list>li>div { flex-basis:100%; }
 .issues-list>li>.button { width:100%; }
 .production-checks .button { min-height:44px; }
}

/* Phone navigation stays within reach while long stock lists scroll normally. */
@media(max-width:900px) {
 :root { --mobile-nav-height:72px; }
 main { padding-bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 28px); }
 .topbar { height:42px; padding:0 16px; }
 .topbar-note { display:none; }
 .mobile-views {
   position:fixed; inset:auto 0 0; z-index:15; display:grid;
   grid-template-columns:repeat(4,minmax(0,1fr)); align-items:stretch; gap:4px;
   height:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom));
   margin:0; padding:6px 8px calc(6px + env(safe-area-inset-bottom));
   background:#fff; border:0; border-top:1px solid #d6dfd5;
   box-shadow:0 -4px 18px #203b2d0a; overflow:visible;
 }
 .mobile-views>button, .mobile-views>details>summary {
   display:flex; justify-content:center; align-items:center; height:100%; min-height:48px;
   padding:7px 5px; border-radius:9px; white-space:normal; text-align:center;
   line-height:1.3; font-size:14px; color:#435e4b; font-weight:550;
 }
 .mobile-views>details { position:static; min-width:0; }
 .mobile-views>details>summary { list-style:none; cursor:pointer; }
 .mobile-views>details>summary::-webkit-details-marker { display:none; }
 .mobile-views>details>summary::after { content:'⌃'; margin-left:6px; }
 .mobile-views>details[open]>summary { background:#edf2e8; color:var(--forest); }
 .mobile-views .mobile-more {
   position:fixed; inset:auto 10px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 8px) auto;
   width:min(360px,calc(100vw - 20px)); max-height:calc(100dvh - var(--mobile-nav-height) - 36px);
   overflow-y:auto; overscroll-behavior:contain; padding:8px;
   border:1px solid #cfdaca; border-radius:12px; box-shadow:0 6px 30px #17372630;
 }
 .mobile-views .mobile-more button { min-height:48px; white-space:normal; text-align:left; font-size:16px; padding:12px; color:var(--ink); }
 .mobile-views .selected { background:#e8f0e2; color:#244d38; font-weight:700; }
 #toast { bottom:calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 12px); z-index:30; }
}

@media(max-width:700px) {
 main { padding:14px 12px calc(var(--mobile-nav-height) + env(safe-area-inset-bottom) + 28px); }
 #page-notes, [data-page-help], .icon-button { min-width:48px; min-height:48px; }
 .page-heading { flex-wrap:wrap; gap:12px; }
 .page-heading>div:first-child { min-width:0; max-width:100%; }
 .page-heading h1 { font-size:27px; line-height:1.2; letter-spacing:-.7px; }
 .heading-actions { flex-direction:row; flex-wrap:wrap; gap:8px; width:100%; }
 .heading-actions .button { flex:1; min-height:48px; font-size:14px; padding:10px; }
 main:has(>#work-view:not([hidden]))>.page-heading .heading-actions { width:auto; margin-left:auto; flex:0 0 auto; }
 main:has(>#work-view:not([hidden]))>.page-heading #add-button { background:white; border-color:#cfdaca; color:var(--forest); box-shadow:none; min-width:86px; }
 .action-summary { gap:7px; }
 .action-summary>button { padding:12px 10px; min-height:84px; }
 .action-summary span { font-size:14px; line-height:1.35; }
 .action-summary strong { font-size:27px; line-height:1.1; }
 .workspace-view { min-width:0; }
 .workspace-view>.panel { min-width:0; }
 .plan-notice .inline-link { font-size:14px; }
 .demand-stages { flex-wrap:nowrap; }
 .demand-stages button { min-width:0; min-height:54px; font-size:14px; line-height:1.3; }
 .demand-panel .table-controls, #work-view .table-controls { display:flex; flex-wrap:wrap; min-width:0; }
 .demand-panel .table-controls .search-box, #work-view .table-controls .search-box { flex:1 0 100%; width:100%; min-height:48px; }
 .demand-panel .table-controls select, #work-view .table-controls select { min-width:0; min-height:48px; font-size:16px; }
 #work-view .table-controls select, .demand-panel .table-controls:has(#demand-category) select { flex:1 0 100%; width:100%; }
 #demand-row-count { align-self:center; font-size:13px; }
 #demand-table, #work-table { overflow:visible; }
 .daily-table tr { padding:12px 8px; grid-template-columns:minmax(0,1fr) minmax(0,1fr); }
 .daily-table tr+tr { border-top:6px solid var(--paper); }
 .daily-table td { padding:9px 8px!important; }
 .daily-table .item-button { min-width:0; white-space:normal; text-align:left; }
 .daily-table .item-button>span:last-child { min-width:0; overflow-wrap:anywhere; }
 .daily-table .item-name { font-size:17px; line-height:1.4; }
 .daily-table td.number { font-size:21px; }
 .daily-table td[data-label]::before { font-size:14px; line-height:1.35; }
 .daily-table td:last-child { display:block; padding-top:12px!important; }
 .daily-table td:last-child>.button, .daily-table td:last-child>.inline-link { width:100%; min-height:48px; justify-content:center; font-size:15px; white-space:normal; }
 .daily-table td:last-child::before { display:none; }
 .daily-table .inline-link { min-height:44px; text-align:left; justify-content:flex-start; white-space:normal; line-height:1.4; font-size:14px; font-weight:550; }
 .daily-table .status-badge { display:inline-flex; min-height:36px; align-items:center; }
 .work-table td:last-child { align-self:center; padding-top:9px!important; }
 .work-actions>button, .work-actions>button.selected { min-height:102px; padding:12px 7px; }
 .work-actions strong { font-size:14px; }
 #work-view .panel-heading { align-items:flex-start; }
 #work-view .panel-heading>.button { width:100%; min-height:46px; }
 .work-links { display:grid; gap:6px; }
 .work-links .inline-link { min-height:46px; padding:4px 0; }
 .amazon-plan>div { display:grid; grid-template-columns:minmax(0,1fr) auto; gap:12px; }
 .amazon-plan dd { max-width:112px; overflow-wrap:anywhere; }
 /* Keep the first priorities within reach; filters expand only when needed. */
 .demand-panel .table-controls .search-box { flex:1 1 0; width:auto; min-width:0; }
 #demand-filters-toggle { display:inline-flex; flex:0 0 auto; min-height:48px; }
 .demand-panel .table-controls:not(.filters-open) #demand-category,
 .demand-panel .table-controls:not(.filters-open) #demand-attention { display:none; }
 .plan-sort-controls { grid-template-columns:auto minmax(0,1fr) auto; }
 .plan-sort-controls .sort-direction { grid-column:auto; width:44px; padding:8px; font-size:20px; }
 .sort-direction-text { display:none; }
 .action-summary small { display:block; font-size:11px; line-height:1.4; }
}
.receipt-document{flex-wrap:wrap;align-items:center}.receipt-document span{min-width:0;overflow-wrap:anywhere}.receipt-document .button{min-height:44px}#receipt-invoice-name{display:block;overflow-wrap:anywhere;font-size:14px;margin-top:8px}#receipt-fields input{width:100%;min-width:0;min-height:48px;font:inherit}#receipt-fields input[type=file]{font-size:14px}#receipt-fields small{display:block;margin-top:6px;color:var(--muted)}

/* Keep the item picker inside the form, including long supplier names. */
#purchase-form > .purchase-fields { grid-template-columns:minmax(0,1fr); min-width:0; }
#purchase-form > .purchase-fields > * { min-width:0; }
#purchase-form .purchase-supplier-actions button { min-height:44px; }

/* Receipt and count actions remain reachable while the fields scroll. */
#action-dialog[open] { display:flex; flex-direction:column; overflow:hidden; }
#action-dialog > .drawer-header { flex-shrink:0; }
#action-dialog > #action-form { min-height:0; overflow-y:auto; overscroll-behavior:contain; padding-bottom:0; scroll-padding-bottom:84px; }
#action-form > .drawer-actions { position:sticky; bottom:0; z-index:2; background:white; padding:12px 0; margin-bottom:0; }
#action-form > .drawer-actions .button { width:100%; min-height:48px; }

/* Count totals and receipts are different operations: keep this guidance visible. */
#entry-view .entry-note { display:block; color:var(--muted); font-size:15px; line-height:1.6; }

@media(max-width:700px) {
 /* Show pack sizes before a quantity can be entered; names may wrap naturally. */
 #work-table tr.mobile-entry > td:first-child,
 #packed-table tr.mobile-entry > td:first-child { height:auto!important; min-height:44px; overflow:visible; }
 #work-table tr.mobile-entry .item-button,
 #packed-table tr.mobile-entry .item-button { min-height:44px!important; }
 #work-table tr.mobile-entry .item-name,
 #packed-table tr.mobile-entry .item-name { white-space:normal!important; line-height:1.4!important; overflow:visible!important; text-overflow:clip; overflow-wrap:anywhere; }
 #packed-view .packed-filters { grid-template-columns:minmax(0,1fr); }
 #packed-view .packed-filters input[type=search] { grid-column:1; }
 #packed-view .packed-filters > label { min-height:44px; }
 #packed-view .packed-history > summary,
 #packed-view .packed-fields details > summary { min-height:44px; display:list-item; padding:10px 0; }
 #work-view .quick-actions .button { min-height:44px; }
}

/* One search above all stock types; preserve each type's stock-plan columns. */
.plan-search{padding:0 20px 16px}
.plan-search>label{display:block;font-weight:600;margin-bottom:8px}
.plan-search-input{display:flex;align-items:center;gap:10px;min-width:0}
.plan-search .search-box{flex:1;min-width:0;width:auto;max-width:none;min-height:48px}
#demand-search{width:100%;min-width:0;font-size:16px}
#demand-search-help{font-size:14px;color:var(--muted);margin:8px 0 0;line-height:1.5}
#demand-view .demand-stages{display:grid;grid-template-columns:repeat(3,minmax(0,1fr))}
#demand-view .demand-stages.searching{grid-template-columns:repeat(4,minmax(0,1fr))}
#demand-view .demand-stages button[hidden],#demand-clear-search[hidden],#demand-reset-filters[hidden]{display:none!important}
#demand-view .demand-stages small{display:block}
#demand-search-status{font-size:14px;color:var(--muted);line-height:1.5}
.plan-result-group>h3{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:0;padding:16px 20px;background:#eef3e9;font-size:18px;color:var(--forest);border-top:1px solid var(--line);border-bottom:1px solid var(--line)}
.plan-result-group>h3 span{font-size:14px;font-weight:400}
@media(max-width:700px){
 .plan-search{padding:8px 12px 12px}
 .plan-search-input{flex-wrap:wrap;gap:6px}
 .plan-search .search-box{flex:1 0 100%}
 #demand-clear-search{min-height:44px}
 #demand-view .demand-stages.searching{grid-template-columns:repeat(2,minmax(0,1fr))}
 #demand-view .demand-stages button{min-height:62px!important;font-size:14px!important}
 #demand-view .demand-stages small{margin-top:4px;font-size:12px}
 #demand-search-status{flex:1 0 100%}
 .plan-result-group>h3{padding:14px 12px;font-size:17px}
}
