/* Orders-only mobile composition. Desktop retains its existing renderer and styles. */
@media(max-width:520px){
.application-shell.mobile-commerce{grid-template-rows:0 minmax(0,1fr)}
.mobile-commerce>.top-toolbar{display:none}
.mobile-commerce>.page-content{padding:8px 10px calc(72px + env(safe-area-inset-bottom));min-width:0}
.mobile-orders-workspace{height:100%;gap:0;min-width:0}
.mobile-orders-header{display:flex;align-items:center;justify-content:space-between;min-height:40px;margin-bottom:4px}
.mobile-orders-header>div{display:flex;align-items:center;gap:8px}.mobile-orders-header h1{font-size:21px;line-height:26px}.mobile-orders-header small,.mobile-detail-status>small{font-size:10px;color:var(--muted);letter-spacing:.5px}
.mobile-icon,.mobile-call{display:inline-flex;align-items:center;justify-content:center;min-height:44px;min-width:44px;padding:5px;border:0;background:transparent;color:var(--secondary);border-radius:6px;flex-shrink:0;text-decoration:none}
.mobile-call svg{width:18px;height:18px;flex-shrink:0}.mobile-icon svg{width:18px;height:18px}.mobile-orders-search{display:flex;align-items:center;gap:6px;margin-bottom:4px}.mobile-orders-search .search-field{flex:1;min-width:0}.mobile-orders-search input{width:100%;min-width:0;font-size:16px;min-height:44px}.mobile-orders-search>.mobile-icon{border:1px solid var(--border);background:var(--surface)}[data-mobile-filter-count]:not(:empty){font-size:10px;color:var(--primary)}
.mobile-orders-workspace .filter-chips{display:flex;overflow-x:auto;flex-wrap:nowrap;flex-shrink:0;gap:3px;padding:0;min-height:0;margin:0}.mobile-orders-workspace .filter-chips:empty{display:none}.mobile-orders-workspace .filter-chips .chip{white-space:nowrap;font-size:11px;padding:3px 6px;min-height:36px;flex-shrink:0}
.mobile-orders-workspace .orders-table-scroll{margin:0;min-width:0;border:0;background:none}.mobile-orders-workspace .orders-grid-header{display:none}.mobile-orders-workspace .orders-grid-row{display:block;height:auto;margin:5px 0;padding:6px 9px;border-radius:8px;min-width:0;background:var(--surface);font-size:13px}
.mobile-card-meta{display:flex;align-items:center;gap:5px;min-height:24px;color:var(--muted);font-size:11px}.mobile-card-meta>span:first-of-type{flex:1;min-width:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mobile-card-meta time{margin-left:4px;font-size:10px}.mobile-card-meta>.mobile-icon{min-width:36px;width:36px;min-height:36px;height:36px;margin:-5px -7px -5px 0}.mobile-source{display:flex;align-items:center;gap:3px;font-size:11px;max-width:105px;overflow:hidden;white-space:nowrap}.mobile-source .channel-brand,.mobile-source .channel-brand svg{width:16px;height:16px}.mobile-card-meta .selection-hit{width:32px;min-width:32px;height:44px;padding:0}.mobile-card-meta input{margin:0;width:22px;height:22px}
.mobile-card-product{display:flex;gap:5px;align-items:center;min-width:0}.mobile-card-product>.mobile-product-link{flex:1;min-width:0}.mobile-product-count{display:flex;flex-direction:column;align-items:flex-end;flex-shrink:0}.mobile-product-count>small{font-size:11px;white-space:nowrap}.mobile-product-count .mobile-more-products{margin:0;white-space:nowrap;padding:2px 0;min-height:32px}
.mobile-product-link{display:flex;align-items:center;justify-content:flex-start;gap:7px;text-align:left;min-height:44px;min-width:0;padding:3px 0;border:0;background:transparent;color:var(--text);max-width:100%;font-size:14px;line-height:18px;font-weight:600}.mobile-product-link .product-thumb{width:32px;height:32px;flex-shrink:0}.mobile-product-link>span{min-width:0;overflow-wrap:break-word;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}.mobile-more-products{display:block;min-height:32px;padding:2px 6px;margin-left:33px;border:0;background:transparent;color:var(--primary);font-size:11px}.mobile-more-products svg{width:12px;height:12px}.mobile-extra-products>div{display:flex;align-items:center;gap:8px}.mobile-extra-products .mobile-product-link{flex:1}.mobile-extra-products small{white-space:nowrap}
.mobile-card-customer{display:flex;align-items:center;justify-content:space-between;gap:8px;min-height:30px}.mobile-card-customer strong{font-size:13px;font-weight:500;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.mobile-card-customer .mobile-call{min-width:44px;min-height:36px;height:36px;gap:4px;font-size:11px;margin-right:-6px}.mobile-card-customer .mobile-call span{display:none}
.mobile-card-delivery{color:var(--secondary);font-size:12px;line-height:16px}.mobile-card-delivery>span{display:flex;align-items:center;gap:4px;font-size:11px;color:var(--muted)}.mobile-card-delivery svg{width:13px;height:13px}.mobile-card-delivery p{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;line-height:16px;overflow-wrap:break-word}
.mobile-card-footer{display:flex;align-items:center;gap:5px;min-height:40px;margin-top:2px}.mobile-status-button{display:inline-flex;align-items:center;justify-content:flex-start;min-height:40px;min-width:44px;padding:0;border:0;background:transparent;max-width:48%;font-size:11px}.mobile-status-label{display:inline-flex;align-items:center;gap:3px;border-radius:4px;background:color-mix(in srgb,var(--status) 16%,transparent);color:var(--status);padding:4px 6px;min-width:0;line-height:14px;text-align:left}.mobile-status-label svg{width:11px;height:11px}.mobile-card-footer>div{margin-left:auto;text-align:right;white-space:nowrap;display:flex;flex-direction:column;gap:2px}.mobile-card-footer>div>strong{font-size:14px}.mobile-card-footer .badge{font-size:10px;padding:2px 5px;line-height:12px}.mobile-card-footer>.mobile-icon{min-width:32px;width:32px;min-height:40px;padding:3px;margin-right:-6px}
.mobile-orders-workspace .table-pagination{min-height:38px;height:38px;flex-shrink:0;padding:0;gap:5px;font-size:11px}.mobile-pagination .mobile-icon{min-width:38px;width:38px;min-height:38px;height:38px}.mobile-pagination>div{gap:6px}.mobile-pagination button:disabled{opacity:.3}
/* Bottom sheet shares the existing popover/form/status transition handlers. */
#overlay>.mobile-orders-sheet{top:auto;left:0;right:0;bottom:calc(64px + env(safe-area-inset-bottom));width:100%;max-width:none;max-height:calc(100dvh - 90px - env(safe-area-inset-bottom));border-radius:14px 14px 0 0;overflow:auto;padding:12px;z-index:80}.mobile-orders-sheet .panel-heading{margin-bottom:8px}.mobile-orders-sheet .form-grid{grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:9px}.mobile-orders-sheet .form-grid>label{min-width:0;font-size:12px}.mobile-orders-sheet input,.mobile-orders-sheet select{min-width:0;width:100%;font-size:16px}.mobile-orders-sheet details .field,.mobile-orders-sheet details label{display:block;margin-bottom:8px}.mobile-orders-sheet summary{min-height:40px;padding-top:10px}.mobile-orders-sheet .form-actions{position:sticky;bottom:-12px;background:var(--surface);padding:9px 0;gap:5px}.mobile-orders-sheet .form-actions button{font-size:12px;min-height:44px}.mobile-orders-sheet .status-option{width:100%;min-height:44px;padding:7px 9px}.mobile-orders-sheet .status-option>small{white-space:normal}.mobile-orders-sheet>.button{margin:3px 0;min-height:44px;max-width:100%}
/* Mobile detail: essentials before secondary operations; no duplicated desktop table. */
.mobile-order-detail{min-width:0}.mobile-detail-header{display:flex;align-items:center;gap:5px;min-height:48px}.mobile-detail-header>div{flex:1;min-width:0}.mobile-detail-header h1{font-size:19px;line-height:24px}.mobile-detail-header small{font-size:11px}.mobile-detail-header .mobile-icon{min-width:36px;width:36px}.mobile-detail-status{display:flex;align-items:center;justify-content:space-between;min-height:32px;margin:0 0 4px}.mobile-detail-status .mobile-status-button{max-width:52%;min-height:40px}.mobile-heading-payment{display:flex;flex-direction:column;align-items:flex-end;gap:2px;max-width:48%;min-width:0;margin-left:auto}.mobile-heading-payment strong{font-size:14px}.mobile-heading-payment .badge{font-size:10px;padding:2px 5px}.mobile-detail-contact,.mobile-detail-items,.mobile-detail-total{border:1px solid var(--border);background:var(--surface);border-radius:8px;margin-bottom:7px;padding:8px 10px}.mobile-detail-contact>div{display:flex;align-items:center;justify-content:space-between;gap:6px}.mobile-detail-contact strong{font-size:14px}.mobile-detail-contact .mobile-call{min-height:36px;gap:4px;font-size:12px}.mobile-detail-contact p{font-size:12px;line-height:17px;overflow-wrap:break-word}.mobile-detail-contact small{font-size:11px}.mobile-detail-items .panel-heading{margin:0;min-height:32px}.mobile-detail-items .panel-heading h2{font-size:13px}.mobile-detail-items .mobile-icon{min-height:36px;min-width:36px;width:36px}.mobile-detail-products>article{padding:5px 0;border-top:1px solid var(--border-subtle)}.mobile-detail-products>article>div:first-child{display:flex;justify-content:space-between;align-items:flex-start;gap:4px}.mobile-detail-products .mobile-product-link{flex:1;font-size:14px;min-width:0}.mobile-detail-products .mobile-product-link>span{-webkit-line-clamp:3}.mobile-line-price{display:flex;align-items:center;justify-content:space-between;font-size:12px;gap:6px;margin-left:39px}.mobile-line-price span{color:var(--secondary)}.mobile-line-price strong{white-space:nowrap}.mobile-detail-products summary{font-size:11px;color:var(--muted);min-height:30px;padding:7px 0}.mobile-detail-products dl{display:grid;grid-template-columns:80px minmax(0,1fr);font-size:12px;margin:6px 0;gap:4px}.mobile-detail-products dd{margin:0;overflow-wrap:break-word}
.mobile-detail-total>div{display:flex;gap:7px;align-items:center;flex-wrap:wrap}.mobile-detail-total h2{font-size:13px}.mobile-detail-total>div>strong{margin-left:auto;font-size:17px}.mobile-detail-total .badge{font-size:10px;padding:3px 5px}.mobile-detail-total>small{display:block;margin-top:5px;font-size:11px}.mobile-detail-total summary{font-size:11px;color:var(--muted);min-height:32px;padding-top:8px}
.mobile-secondary>details{border-bottom:1px solid var(--border-subtle);padding:0 3px}.mobile-secondary summary,.mobile-quick-ai summary{min-height:44px;padding:12px 0;font-size:13px;font-weight:500}.mobile-secondary details>dl{display:grid;grid-template-columns:90px minmax(0,1fr);gap:5px}.mobile-secondary dd{margin:0;overflow-wrap:break-word}.mobile-secondary p{font-size:12px;overflow-wrap:break-word}.mobile-secondary .button{margin:4px 2px;min-height:40px;max-width:100%;white-space:normal}.mobile-secondary .detail-tabs{position:static;overflow-x:auto;margin:0;max-width:100%;white-space:nowrap}.mobile-secondary .detail-tabs button{flex:0 0 auto;min-height:44px}.mobile-secondary #detail-tab-body{padding:8px 0;min-width:0}.mobile-secondary textarea{max-width:100%;min-width:0}.mobile-secondary .compact-totals{font-size:12px}
:root[data-theme=light] .mobile-status-label{color:color-mix(in srgb,var(--status) 70%,black)}.mobile-product-link:hover{background:transparent}
.mobile-quick header{min-height:44px;padding:7px 10px}.mobile-quick .drawer-body{padding:8px 10px}.mobile-quick footer{min-height:48px;padding:4px 10px}.mobile-quick footer .primary{min-height:40px;font-size:13px}.mobile-quick .mobile-detail-items .panel-heading>.mobile-icon{display:none}
}

/* Native details retain keyboard semantics with a consistent chevron. */
:is(.mobile-secondary>details,.mobile-quick-ai,.mobile-detail-products details,.mobile-orders-sheet details)>summary{list-style:none;display:flex;align-items:center;gap:8px}
:is(.mobile-secondary>details,.mobile-quick-ai,.mobile-detail-products details,.mobile-orders-sheet details)>summary::-webkit-details-marker{display:none}
:is(.mobile-secondary>details,.mobile-quick-ai,.mobile-detail-products details,.mobile-orders-sheet details)>summary::after{content:"";display:block;width:16px;height:16px;flex:0 0 16px;margin-left:auto;background:currentColor;-webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='black' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center/contain no-repeat;transform:rotate(0deg)}
:is(.mobile-secondary>details,.mobile-quick-ai,.mobile-detail-products details,.mobile-orders-sheet details)[open]>summary::after{transform:rotate(180deg)}
