/* Keep wide data within its own scroll area; let page content shrink. */
.main-shell,main,.workspace-grid,.data-grid,.search-card,.search-box,.field,.form-grid>*{min-width:0}
.mobile-menu{display:none}
@media(max-width:650px){
 html,body{overflow-x:visible;width:100%;max-width:100%}
 .sidebar{position:relative;padding:16px;max-width:100%}
 .brand{padding-right:78px;min-height:44px}
 .mobile-menu{display:inline-flex;position:absolute;right:16px;top:16px;background:#ffffff12;color:white;border-color:#ffffff50;min-height:44px}
 .sidebar nav{display:none;margin-top:16px;white-space:normal;overflow:visible;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
 .sidebar.menu-open nav{display:grid}
 .sidebar nav .nav-item{width:100%;min-width:0;white-space:normal;justify-content:flex-start;padding:12px 10px;min-height:44px}
 .topbar{padding:12px 16px;flex-wrap:wrap;gap:8px}.breadcrumb{flex:1;min-width:0}.breadcrumb strong{overflow-wrap:anywhere}.top-actions{gap:6px}
 main{padding:18px 14px 28px;max-width:100%;width:100%}
 .page-heading{padding:24px 18px;min-height:0}.page-heading h1{font-size:1.7rem}.page-heading:after{right:-200px}
 .heading-actions{width:100%;gap:8px}.heading-actions .button{flex:1 1 130px;white-space:normal;min-height:44px}
 .button,.button.compact,.icon-button{min-height:44px}.button{white-space:normal}.stat{min-width:0;gap:8px}.stat-label{overflow-wrap:anywhere}.stat-icon{flex-shrink:0}
 .search-box{flex-direction:column;overflow:visible}.search-box select{width:100%;border-right:0;border-bottom:1px solid #e0d5eb;min-height:44px;border-radius:4px 4px 0 0}.search-input{padding-left:10px}.search-input input{font-size:16px;min-height:48px;padding:10px}
 .filters{flex-wrap:wrap}.filters select{min-width:0;flex:1 1 120px;min-height:44px;font-size:16px}.ext-filters select{flex:1 1 100%;min-height:44px;font-size:16px}.ext-filters .button{flex:1 1 120px}
 .mobile-inventory{display:block;white-space:normal}.mobile-inventory thead{display:none}.mobile-inventory tbody{display:block;padding:0 14px 14px}.mobile-inventory tr{display:grid;grid-template-columns:minmax(0,1fr);border:1px solid #e7dfef;border-radius:12px;margin-top:14px;padding:8px 12px;background:white;position:relative}.mobile-inventory td{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border:0;padding:8px 0!important;white-space:normal;min-width:0;width:auto!important;overflow-wrap:anywhere}.mobile-inventory td::before{content:attr(data-label);color:#796988;font-size:.75rem;flex:0 0 84px;padding-top:3px}.mobile-inventory .asset-name{min-width:0;flex:1}.mobile-inventory .asset-name strong{overflow-wrap:anywhere}.mobile-inventory .owner-cell{flex:1;min-width:0}.mobile-inventory .select-cell{justify-content:flex-end}.mobile-inventory .select-cell::before{margin-right:auto}.select-cell input{height:22px;width:22px}.mobile-inventory .empty{display:block}.mobile-inventory .empty::before{display:none}
 .table-wrap{min-width:0;max-width:100%;overscroll-behavior-x:contain}.panel-foot{flex-wrap:wrap}
 dialog,.dialog-wide{width:calc(100% - 20px);max-width:calc(100% - 20px);max-height:calc(100dvh - 24px);margin:auto}.dialog-body,.dialog-wide .dialog-body{padding:18px 16px}.dialog-head{padding:16px;align-items:flex-start}.dialog-head h2{overflow-wrap:anywhere;min-width:0}.form-grid,.two-col-form,.detail-grid{grid-template-columns:minmax(0,1fr)}.field input,.field select,.field textarea,.toolbar-field input,.toolbar-field select{font-size:16px;min-width:0;max-width:100%}.form-actions{flex-wrap:wrap}.form-actions .button{flex:1 1 110px}.detail-banner{align-items:flex-start}.detail-banner>div{min-width:0}.detail-banner h3,.detail-banner p{overflow-wrap:anywhere}.asset-visual{flex-direction:column;text-align:center;gap:12px}.asset-visual-art{width:160px;max-width:100%}.asset-visual-label strong{overflow-wrap:anywhere}.permission-checkboxes{grid-template-columns:minmax(0,1fr)}.relationship-card{flex-wrap:wrap}.rack-layout{padding:16px}.location-node{flex-wrap:wrap;overflow-wrap:anywhere}.location-level-3{padding-left:36px}
 .chat-panel{left:10px;right:10px;width:auto;bottom:80px;max-height:calc(100dvh - 100px)}.chat-launcher{right:14px;bottom:16px;width:48px;height:48px}.chat-panel input{font-size:16px}.toast{max-width:calc(100% - 28px);width:max-content;overflow-wrap:anywhere}.notification-list li{padding:16px}.notification-list strong{overflow-wrap:anywhere}
}
@media(max-width:360px){.topbar{align-items:flex-start}.breadcrumb{flex-basis:100%}.top-actions{margin-left:auto}.stat-icon{display:none}.page-heading .heading-actions .button{flex-basis:100%}}

/* Camera preview size must not follow a phone camera's portrait resolution. */
.scanner-dialog{overflow:hidden}
.scanner-dialog .dialog-head{position:sticky;top:0;background:white;z-index:2}
.scanner-dialog .scan-video{display:block;width:100%;height:260px;min-height:0;max-height:36dvh;object-fit:contain;background:#1d122a;margin:12px 0}
.scanner-dialog .dialog-body{overflow-wrap:anywhere}
.scanner-dialog .field,.scanner-dialog select{min-width:0;max-width:100%}
@media(max-width:650px){
 .scanner-dialog[open]{display:flex;flex-direction:column;width:calc(100% - 16px);max-height:calc(var(--scanner-height,100dvh) - 16px);padding:0}
 .scanner-dialog #dialog-content{display:flex;flex-direction:column;min-height:0;overflow:hidden;max-height:inherit}
 .scanner-dialog .dialog-head{flex-shrink:0;padding:12px 16px;align-items:center}
 .scanner-dialog .dialog-head h2{font-size:1rem}
 .scanner-dialog .dialog-body{min-height:0;overflow-y:auto;overscroll-behavior:contain;padding:12px 16px 18px;-webkit-overflow-scrolling:touch}
 .scanner-dialog .dialog-body>p{font-size:.8rem;margin-bottom:12px}
 .scanner-dialog .heading-actions{margin-top:0;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));margin-bottom:12px}
 .scanner-dialog .heading-actions .button{padding:8px;font-size:.8rem;min-width:0}
 .scanner-dialog .scan-video{height:clamp(120px,28dvh,240px);max-height:calc(var(--scanner-height,100dvh) * .32);aspect-ratio:auto}
 .scanner-dialog .scan-status{margin:10px 0;font-size:.8rem}
 .scanner-dialog .form-actions{margin-top:12px}
 .scanner-dialog details{margin-top:16px;font-size:.8rem}
}
@media(max-height:500px) and (max-width:950px){.scanner-dialog .scan-video{height:120px;max-height:30dvh}.scanner-dialog{max-height:calc(var(--scanner-height,100dvh) - 12px)}}
