/* Shared touch controls; desktop keeps its sidebar, columns and data tables. */
[hidden]{display:none!important}
.topbar>.drawer-toggle,.mobile-menu-fallback{display:none}
.secondary-section{margin-top:24px;border-top:1px solid var(--line);padding-top:8px}.secondary-section>summary{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;list-style:none}.secondary-section>summary::after{content:"+";font-size:1.35rem}.secondary-section[open]>summary::after{content:"−"}.secondary-section>summary::-webkit-details-marker{display:none}.secondary-section .text-link{display:flex}.product-settings{margin-top:16px}
.icon-button{display:grid;place-items:center;width:48px;min-height:48px;border:0;border-radius:12px;background:var(--paper);color:var(--ink);font-size:1.6rem}
.stepper-label{margin-bottom:7px}
.quantity-stepper{display:grid;grid-template-columns:48px minmax(0,1fr) 48px;align-items:stretch;gap:8px;margin:0 0 20px}
.quantity-stepper input{margin:0;text-align:center}
.quantity-stepper button{border:1px solid var(--line);border-radius:10px;background:var(--paper);color:var(--green);font-size:1.7rem;min-height:48px;touch-action:manipulation}
.quantity-stepper button:disabled{opacity:.4;cursor:default}
.quantity-stepper button:active:not(:disabled){background:#dce8d4}
.mobile-history{display:none}

@media screen and (max-width:800px){
  :root{font-size:16px;--muted:#596d61}
  html{scroll-padding-top:90px;scroll-padding-bottom:calc(24px + env(safe-area-inset-bottom,0px))}
  body{min-height:100dvh}
  input,textarea,select,button{font-size:16px}
  input:not([type=checkbox]),select,textarea{font-size:16px;min-height:52px}
  input,select,textarea{scroll-margin-block:100px}
  label{font-size:.9rem}
  label .muted,summary span{font-size:.8rem}
  a,button,summary{-webkit-tap-highlight-color:#174f3f18}
  .topbar{position:sticky;top:0;height:calc(60px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) max(16px,env(safe-area-inset-right,0px)) 0 max(16px,env(safe-area-inset-left,0px));z-index:25}
  .brand{font-size:.9rem;gap:9px;min-height:48px}.brand img{width:30px;height:30px}.brand small{font-size:.48rem}
  .header-right{gap:8px}.header-right>.avatar{width:44px;height:44px}.user-switcher{margin-left:0}.user-switcher-toggle{width:44px;min-height:48px}
  .user-switcher-panel{position:fixed;top:calc(64px + env(safe-area-inset-top,0px));right:max(12px,env(safe-area-inset-right,0px));max-height:calc(100dvh - 160px - env(safe-area-inset-top,0px));width:min(360px,calc(100vw - 24px))}
  .user-switcher-search input{font-size:16px}.user-switcher-user-text strong{font-size:.9rem}.user-switcher-user-text small{font-size:.8rem}
  .app-shell{min-height:calc(100dvh - 60px);display:block}
  .main{padding:22px max(16px,env(safe-area-inset-right,0px)) calc(32px + env(safe-area-inset-bottom,0px)) max(16px,env(safe-area-inset-left,0px))}
  .page-heading{margin-bottom:18px}.page-heading h1{font-size:1.65rem;margin:0;overflow-wrap:anywhere}.page-heading .eyebrow{display:none}
  .main h2,.main h3{overflow-wrap:anywhere}
  .page-footer{display:none}.lead{font-size:.95rem;margin-bottom:18px}.panel{padding:20px 16px;border-radius:16px;margin-bottom:16px}
  .button{min-height:52px;font-size:.95rem;padding:12px 16px}.button.large{min-height:56px}.button.full{justify-content:center}
  .text-link,.text-button{display:inline-flex;align-items:center;min-height:48px;padding-block:8px;font-size:.9rem}
  .button-row{gap:8px}.button-row>.button{flex:1 1 auto}.back-link{margin-bottom:8px}
  summary{min-height:48px;font-size:.95rem}.check{min-height:48px;align-items:center;font-size:.9rem}.check input{width:24px;height:24px}
  .action-grid{grid-template-columns:1fr;gap:10px}
  .action-card{display:grid;grid-template-columns:44px minmax(0,1fr) 20px;grid-template-rows:auto auto;gap:2px 14px;min-height:88px;padding:14px 16px;border-radius:15px}
  .action-top{display:contents}.action-icon{grid-column:1;grid-row:1/3;align-self:center;width:44px;height:44px;font-size:1.65rem}.action-card .arrow{grid-column:3;grid-row:1/3;align-self:center;font-size:1.2rem}
  .action-card h2{grid-column:2;grid-row:1;font-size:1.02rem;letter-spacing:-.02em;margin:0;align-self:end}.action-card p{grid-column:2;grid-row:2;font-size:.82rem;line-height:1.4;align-self:start;color:#48634f}
  .action-card:hover{transform:none}.action-card:active{filter:brightness(.97)}
  .personal-strip{grid-template-columns:1fr 1fr;gap:16px;padding:20px;margin-top:20px}.personal-strip>div:first-child{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px}.personal-strip h2{font-size:1rem;margin:0}.personal-strip>div:nth-child(2){border:0;padding:0}.personal-strip>div:last-child{padding-left:20px}.personal-strip strong{font-size:1.8rem}.personal-strip span{font-size:.8rem}
  .product-grid{grid-template-columns:1fr;gap:12px}
  .product-card{display:grid;grid-template-columns:80px minmax(0,1fr);align-items:center;padding:12px;gap:12px;border-radius:15px}
  .product-card .item-visual,.product-card>.item-photo{width:80px;height:90px;border-radius:10px;padding:4px}.product-card .item-visual img{width:66px;height:70px}
  .product-body{min-width:0;padding:0}.product-card h2{font-size:1rem;margin:0 0 5px}.product-body .eyebrow{display:none}.product-body .stock-number{font-size:1.6rem;margin:2px 0}.product-body p,.stock-number small{font-size:.85rem}.badge{font-size:.75rem;white-space:normal}
  .selection-card{min-height:106px}.selection-card .float-right{float:right;display:inline;margin-top:0}.selection-card .item-visual,.selection-card>.item-photo{height:72px}
  .tabs{flex-wrap:nowrap;overflow-x:auto;gap:8px;margin:16px 0;padding-bottom:4px;scrollbar-width:thin}.tabs a{flex:none;min-height:48px;font-size:.85rem;padding:12px 15px}
  .search-bar{gap:8px}.search-bar input{min-height:52px}.search-bar .button{padding:12px 16px}
  .workflow{gap:14px}.selected-product{padding:14px;gap:8px 12px}.selected-product .item-visual,.selected-product .item-photo{width:56px;height:60px}.selected-product .item-visual img{width:50px;height:50px}.selected-product h2{font-size:1.15rem;margin:0;min-width:0;overflow-wrap:anywhere}.selected-product .text-link{margin-top:0}.selected-product .stock-number{font-size:1.65rem}
  .form-grid,.two-columns,.permission-grid,.packing-grid{grid-template-columns:1fr}.two-columns{gap:0}.packing-grid{gap:14px}.packing-card{margin-bottom:0}.packing-card .form-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.packing-card h3{font-size:1.2rem}.packing-total{margin-bottom:12px}.packing-materials{margin-top:6px}
  .quantity-stepper{grid-template-columns:52px minmax(0,1fr) 52px;gap:8px}.quantity-stepper input.quantity-input{height:64px!important;font-size:1.8rem!important}.quantity-stepper button{min-height:52px}
  .dispatch-item{grid-template-columns:60px minmax(0,1fr);gap:12px}.dispatch-item .item-visual,.dispatch-item>.item-photo{width:60px;height:70px}.dispatch-item .item-visual img{width:54px;height:54px}.dispatch-item h2{font-size:1rem}.dispatch-item p{font-size:.85rem}.dispatch-item .quantity-stepper{margin-bottom:0}
  .count-row{display:block}.count-row h2{margin-bottom:12px;font-size:1rem}.count-row label{margin:0}.count-row input{font-size:1.5rem}
  .material-row{grid-template-columns:minmax(0,1fr) auto;gap:12px;padding:16px;min-height:72px}.material-row>div{min-width:0}.material-row strong{font-size:.95rem;overflow-wrap:anywhere}.material-row small{font-size:.8rem}.material-row .text-link{display:none}.material-stock{font-size:.85rem}.filling-grid .material-row>span{white-space:normal}
  .filter-form{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.filter-form label{min-width:0}.filter-form label:first-of-type,.filter-form>.button{grid-column:1/-1}.filter-form label:first-of-type{flex-basis:auto}
  .history-table{display:none}.mobile-history{display:grid;gap:12px}.history-card{border:1px solid var(--line);border-radius:15px;padding:16px;background:white;min-width:0}.history-card header{display:flex;align-items:center;justify-content:space-between;gap:10px}.history-card h3{font-size:1rem;margin:0}.history-card p{margin:6px 0;font-size:.9rem;overflow-wrap:anywhere}.history-card small{font-size:.8rem;color:var(--muted)}.history-card .text-link{padding-block:0}.history-card .badge{flex:none}
  .table-wrap table{min-width:0}.table-wrap .responsive-table{display:block}.responsive-table thead{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border:0}.responsive-table tbody{display:block}.responsive-table tr{display:block;padding:12px;border-bottom:1px solid var(--line)}.responsive-table tr:last-child{border:0}.responsive-table td{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.4fr);gap:12px;padding:8px 0;border:0;font-size:.9rem;overflow-wrap:anywhere}.responsive-table td::before{content:attr(data-label);font-size:.8rem;color:var(--muted)}.responsive-table td a{min-height:44px;display:inline-flex;align-items:center}.responsive-table td small{grid-column:2}
  .recipe-line{grid-template-columns:minmax(0,1fr) minmax(0,1fr) 48px;gap:8px}.recipe-line label:first-child{grid-column:1/-1}.remove-line{min-width:48px;min-height:48px}.recipe-line label{font-size:.85rem}
  .detail-row{font-size:.9rem;flex-wrap:wrap;gap:8px}.detail-row>*{min-width:0;overflow-wrap:anywhere}.metadata-list{grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr);font-size:.9rem}.bar-label{flex-wrap:wrap;font-size:.9rem}
  .kpi{padding:16px}.kpi>span{font-size:.83rem}.kpi>strong{font-size:1.85rem}.kpi>small{font-size:.78rem}
  .alert{padding:16px;font-size:.95rem;overflow-wrap:anywhere}.info-banner{padding:16px}.info-banner p{font-size:.9rem}
  .audit-row summary{min-height:48px}
  dialog{max-height:calc(100dvh - 24px - env(safe-area-inset-top,0px) - env(safe-area-inset-bottom,0px));overflow-y:auto;overscroll-behavior:contain;padding:22px 18px;border-radius:20px;width:calc(100% - 24px)}dialog h2{font-size:1.25rem}dialog pre{max-height:40dvh;font-size:.95rem}dialog .button-row{position:sticky;bottom:-22px;background:white;padding:12px 0;margin-top:8px}
  .login-shell{min-height:100dvh;display:flex;flex-direction:column;align-items:stretch;justify-content:center;padding:max(24px,env(safe-area-inset-top,0px)) max(20px,env(safe-area-inset-right,0px)) max(24px,env(safe-area-inset-bottom,0px)) max(20px,env(safe-area-inset-left,0px));gap:22px;max-width:560px}.login-intro .brand{margin-bottom:22px}.login-intro h1{font-size:1.8rem;margin:0}.login-card{padding:24px 18px}.login-card h2{font-size:1.4rem}
  .delivery-note{padding:18px 12px}.delivery-note header{flex-direction:column;gap:14px;margin-bottom:25px}.delivery-note header>div:last-child{text-align:left}.delivery-note .two-columns{margin-bottom:15px}.delivery-note table{font-size:.8rem}.delivery-note th,.delivery-note td{padding:10px 5px;white-space:normal;overflow-wrap:anywhere}.delivery-note footer{margin-top:24px}
}
/* Focused phone workspace and collapsible navigation. */
@media screen and (max-width:800px){
  :root{--paper:#f2f4f0;--ink:#132f29;--green:#174e40;--muted:#53665d;--line:#e0e6df}
  body.drawer-open{overflow:hidden}
  .topbar{gap:14px;height:calc(76px + env(safe-area-inset-top,0px));background:var(--paper);border:0;padding-inline:max(20px,env(safe-area-inset-left,0px)) max(20px,env(safe-area-inset-right,0px))}
  .topbar>.drawer-toggle{display:grid;flex:none;background:#fff;border:1px solid var(--line);border-radius:16px;width:52px;height:52px;color:var(--ink)}
  .topbar>.brand{margin-right:auto;font-size:1rem;letter-spacing:.1em}.topbar>.brand small,.topbar>.brand>img,.header-right>.avatar{display:none}.header-right:empty{display:none}
  .user-switcher-toggle{background:transparent;border:1px solid var(--line);border-radius:14px;width:48px}.user-switcher-panel{top:calc(80px + env(safe-area-inset-top,0px))}
  .main{padding-top:22px;padding-left:max(20px,env(safe-area-inset-left,0px));padding-right:max(20px,env(safe-area-inset-right,0px))}
  .page-heading{margin-bottom:28px}.page-heading h1{font-size:clamp(1.9rem,8vw,2.4rem);line-height:1.1;letter-spacing:-.055em;font-weight:650}
  .mobile-quiet{display:none!important}
  .panel{border:1px solid #e2e8e0;background:#fff;border-radius:24px;padding:24px 20px;box-shadow:0 8px 28px #17382a04}
  .lead,label,.text-link,summary,.button{font-size:1rem}.small,small,label .muted,summary span{font-size:.9rem}
  .button{min-height:56px;border-radius:16px;font-weight:650;box-shadow:0 4px 12px #16392a0c}.button.secondary{box-shadow:none}
  .optional-fields{padding-top:8px;margin:18px 0;border-color:#edf0ea}.optional-fields summary{font-size:1rem}.optional-fields summary>span{display:none}
  .quantity-stepper{grid-template-columns:56px minmax(0,1fr) 56px;gap:12px;margin-bottom:20px}.quantity-stepper button{border:0;background:#edf2e9;border-radius:17px;font-size:1.7rem}.quantity-stepper input.quantity-input{background:white;border:1px solid var(--line);border-radius:17px;height:76px!important;font-size:2.4rem!important;font-weight:600}
  .action-grid{grid-template-columns:1fr 1fr;gap:14px}
  .action-card{grid-column:1/-1;grid-template-columns:52px minmax(0,1fr);grid-template-rows:1fr;min-height:116px;padding:24px;border:1px solid var(--line);border-radius:24px;background:#fff;box-shadow:0 6px 24px #17382a03;gap:18px}
  .action-card .action-icon{grid-column:1;grid-row:1;width:52px;height:52px;border-radius:17px;background:#edf2e9;color:var(--green)}
  .action-card h2{grid-row:1;align-self:center;font-size:1.35rem;line-height:1.2;letter-spacing:-.035em}.action-card p,.action-card .arrow{display:none}
  .action-card[data-action="produce"]{order:-2;min-height:156px;color:#fff;background:linear-gradient(135deg,#123b32,#215a43);border:0;box-shadow:0 12px 30px #143d3220}
  .action-card[data-action="produce"] h2{font-size:1.8rem}.action-card[data-action="produce"] .action-icon{background:#d9edbd;color:#173e32}
  .action-card[data-action="filling"]{order:-1}
  .action-card[data-action="receive"],.action-card[data-action="dispatch"]{grid-column:auto;display:grid;grid-template-columns:40px minmax(0,1fr);grid-template-rows:1fr;align-items:center;gap:10px;min-height:88px;padding:16px 14px;border-radius:20px;box-shadow:none}
  .action-card[data-action="receive"] h2,.action-card[data-action="dispatch"] h2{grid-column:2;grid-row:1;margin:0;font-size:1rem;line-height:1.25;align-self:center;letter-spacing:-.02em}.action-card[data-action="receive"] .action-icon,.action-card[data-action="dispatch"] .action-icon{grid-column:1;grid-row:1;width:40px;height:40px;border-radius:13px;align-self:center}
  .action-card[data-action="stocktake"],[data-page="home"] .personal-strip,[data-page="home"] .quiet-action{display:none}
  .filling-grid{margin-top:0;gap:20px}.filling-grid h2{font-size:1.4rem;margin-bottom:26px}.filling-grid .packing-card{padding:28px 22px}
  .secondary-section{margin-top:28px}.secondary-section>summary{font-size:1rem;min-height:56px}.secondary-section[open]>summary{margin-bottom:12px}
  .product-card{padding:18px;gap:16px;border-radius:22px;grid-template-columns:68px minmax(0,1fr);box-shadow:0 6px 24px #17382a03}.product-card .item-visual,.product-card>.item-photo{width:68px;height:80px;border-radius:16px}.product-card h2{font-size:1.1rem}.product-body .stock-number{font-size:1.8rem}.product-body .badge.healthy{display:none}.badge{font-size:.88rem}
  .selection-card{min-height:116px}.selection-card .float-right{display:none}.selection-card .product-body p{font-size:.95rem}.selected-product{border-radius:20px;padding:16px 18px}.selected-product h2{font-size:1.2rem}
  .section-toolbar{margin-bottom:20px}.section-toolbar:has(>.mobile-quiet)>.button{width:auto}.section-toolbar:has(>.mobile-quiet){align-items:flex-end}
  .catalog-section>h2{font-size:1.2rem}.catalog-count{font-size:1rem}.packing-card h3{font-size:1.35rem}.packing-card .form-grid label{font-size:1rem}.packing-card .form-grid{grid-template-columns:1fr;gap:0}.packing-total{background:#f2f5ee;border-radius:16px;font-size:1rem;padding:16px}.packing-total strong{font-size:1.6rem}
  .material-list{border-radius:20px}.material-row{padding:20px;gap:12px}.material-row strong{font-size:1rem}.material-row small,.material-stock{font-size:.9rem}.history-card{border-radius:22px;padding:20px}.history-card small{font-size:.9rem}.history-card h3{font-size:1.08rem}
  .credit-preview{border-radius:18px;padding:20px;font-size:1rem}.credit-preview strong{font-size:2rem}.check{line-height:1.5}.search-bar .button{box-shadow:none}.tabs a{border-radius:14px;font-size:.95rem}
  dialog.mobile-drawer{position:fixed;inset:0 auto 0 0;margin:0;padding:0;width:min(344px,calc(100vw - 40px));height:100dvh;max-height:none;max-width:none;overflow-y:auto;overscroll-behavior:contain;border:0;border-radius:0 28px 28px 0;background:#f9fbf7;color:var(--ink);box-shadow:20px 0 70px #0b241f30}
  .mobile-drawer[open]{display:flex;flex-direction:column;animation:drawer-enter .2s ease-out}
  .mobile-drawer::backdrop{background:#0b201966;backdrop-filter:blur(5px)}
  .drawer-heading{position:sticky;top:0;display:flex;align-items:center;justify-content:space-between;gap:12px;background:#f9fbf7;padding:calc(20px + env(safe-area-inset-top,0px)) 22px 22px;z-index:1}.drawer-heading>strong{font-size:1rem;letter-spacing:.12em}.drawer-heading .icon-button{background:#eaf0e5;border-radius:15px}
  .drawer-links{padding:0 16px 24px}.drawer-links>a,.drawer-group>a{display:flex;align-items:center;gap:16px;min-height:60px;padding:16px;border-radius:16px;font-size:1.08rem;font-weight:550;line-height:1.3;overflow-wrap:anywhere}
  .drawer-links>a[aria-current],.drawer-group>a[aria-current]{background:#174e40;color:white;box-shadow:0 6px 20px #17382a12}.drawer-links svg{flex:none;width:24px;height:24px}
  .drawer-group{border-top:1px solid var(--line);margin-top:22px;padding-top:8px}.drawer-group>summary{display:flex;align-items:center;justify-content:space-between;min-height:60px;padding:16px;list-style:none;font-size:1rem;color:var(--muted);font-weight:550}.drawer-group>summary::after{content:"+";font-size:1.4rem}.drawer-group[open]>summary::after{content:"−"}.drawer-group>summary::-webkit-details-marker{display:none}
  .drawer-account{margin-top:auto;padding:20px 28px max(24px,env(safe-area-inset-bottom,0px));border-top:1px solid var(--line)}.drawer-account>a{display:block;min-height:60px;font-size:1.05rem;font-weight:600;overflow-wrap:anywhere}.drawer-account>a>span{display:block;font-size:.95rem;font-weight:400;color:var(--muted);margin-top:8px}.drawer-account .text-button{font-size:1rem;margin-top:12px}
  .mobile-menu-fallback:target{display:block;padding:20px;border-radius:24px;background:#fff;margin-top:24px}
}
@keyframes drawer-enter{from{transform:translateX(-100%)}to{transform:translateX(0)}}
@media(prefers-reduced-motion:reduce){.mobile-drawer[open]{animation:none}}
@media print{.drawer-toggle,.mobile-drawer,.mobile-menu-fallback{display:none!important}}
@media screen and (max-width:360px){.main{padding-left:max(12px,env(safe-area-inset-left,0px));padding-right:max(12px,env(safe-area-inset-right,0px))}.packing-card .form-grid{grid-template-columns:1fr}.material-row{grid-template-columns:1fr}.material-stock{white-space:normal}.dispatch-item{grid-template-columns:1fr}.dispatch-item>.item-visual,.dispatch-item>.item-photo{display:none}.personal-strip>div:first-child{flex-wrap:wrap}}
@media print{.mobile-history{display:none!important}.history-table{display:block!important}.quantity-stepper button{display:none}}
