/* Shared screen density and visual hierarchy. Printed cargo labels keep their own layout. */
@media screen{
 :root{--line:#e8e1ee;--canvas:#f7f6fa;--muted:#74677e}
 body{background:#f7f6fa;line-height:1.5}
 body>header{min-height:88px;padding:14px max(3%,20px);border-bottom-width:3px;gap:16px;box-shadow:0 2px 10px #32104710}
 body>header .thai-logo{width:128px}body>header .thai-logo-panel{padding:9px 13px;border-radius:9px}
 body>header .service-brand{gap:18px}body>header .service-wordmark{padding-left:18px}body>header .service-wordmark h1{font-size:27px;margin-top:3px}
 main{max-width:1600px;padding:18px 24px 36px}
 #workspace>section,#workspace>.card{padding:18px 20px;margin:12px 0;border-radius:12px;box-shadow:0 2px 8px #32104703}
 h2{font-size:19px;margin-bottom:12px}h3{margin:18px 0 10px}p{margin:8px 0 12px}
 form,.control-row{gap:12px;margin:12px 0 18px}form>label,.control-row>label{gap:6px}
 input,select,textarea{padding:8px 10px;border-radius:8px}button,.button{padding:9px 14px;border-radius:8px}
 #workspace>nav{display:flex;flex-wrap:nowrap;overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:thin;scrollbar-color:#c9b5d7 transparent;gap:4px;padding:6px;margin:12px 0;background:#fff;border-radius:11px;position:relative;top:0;backdrop-filter:none;box-shadow:0 1px 4px #32104704}
 #workspace>nav button{flex:0 0 auto;white-space:nowrap;padding:8px 12px;min-height:42px;font-size:12px}
 #workspace>nav button[aria-current=page]{background:var(--purple);color:white;box-shadow:0 2px 5px #4b206e20}
 .stats{gap:10px}.stats .card{min-height:80px;padding:12px 16px;border-radius:11px;box-shadow:none}.stats b{font-size:29px;margin-top:5px}.stats .card::before{width:3px}
 #warehouse-context.card{display:grid;grid-template-columns:minmax(0,1fr) minmax(300px,500px);align-items:center;gap:8px 20px;padding:9px 16px;margin:0 0 12px;min-height:0;border-left:3px solid var(--gold);box-shadow:none}
 #warehouse-context>strong{font-size:14px;line-height:1.4;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #warehouse-context>label{display:block;margin:0;max-width:none;width:100%;min-width:0;font-size:0;line-height:0}
 #warehouse-context select{display:block;min-height:40px;height:40px;width:100%;font-size:14px;line-height:1.4;background:#fcfafd}
 #warehouse-context>p{grid-column:1/-1;margin:0;font-size:12px}
 #warehouse-context:empty{display:none}
 .shipment-toolbar{gap:12px;margin-bottom:12px}.shipment-pagination{gap:12px;padding-top:12px}.shipment-empty{padding:28px!important}
 th{padding:10px 12px;background:#f7f3fa;font-size:11px}td{padding:11px 12px}.scroll{border-radius:9px}.badge{padding:4px 8px;border-radius:6px}
 #scanreceiveform{gap:12px}#contactform,#shipping-register,#breakform,#splitform,.move-form{gap:12px}
 #scantitle{padding:9px 12px}#scanchoices label{margin:12px 0 4px}.form-actions{margin:12px 0 18px}
 #detail{border-radius:15px;box-shadow:0 16px 65px #260b3f38}#detail>h3{margin-top:20px}
 #login.auth-layout{margin-top:20px;margin-bottom:28px;box-shadow:0 12px 40px #3210470b}
 #userform,#password-reset-form,#chat-history-filter{margin-top:12px}
 #chat-history-panel details pre,#audit-log-panel pre{border-radius:8px;background:#faf8fc;padding:10px}
 #cargo-chat{box-shadow:0 8px 32px #34114e2b}.chat-header{gap:8px}.chat-queue-controls{padding:5px 10px}.chat-bubble{line-height:1.5}
 @media(max-width:1000px){main{padding:16px 18px 32px}#warehouse-context.card{grid-template-columns:minmax(0,1fr) minmax(260px,380px);gap:12px}.stats .card{min-height:76px;padding:11px 14px}}
 @media(max-width:700px){
  body>header{padding:14px 16px;min-height:0;gap:10px}body>header .thai-logo{width:92px}body>header .thai-logo-panel{padding:8px 10px}body>header .service-brand{gap:12px}body>header .service-wordmark{padding-left:12px}body>header .service-wordmark h1{font-size:24px}
  main{padding:12px 10px 28px}#workspace>section,#workspace>.card{padding:16px 14px;margin:10px 0;border-radius:11px}
  #warehouse-context.card{grid-template-columns:minmax(0,1fr);padding:10px 12px;gap:8px;margin-bottom:10px}#warehouse-context>strong{font-size:13px}#warehouse-context select{min-height:44px;height:44px;font-size:16px}
  #workspace>nav{display:flex;gap:4px;padding:5px;margin:10px 0}#workspace>nav button{min-height:44px;padding:8px 12px;font-size:12px}
  .stats{gap:8px;grid-template-columns:repeat(3,minmax(0,1fr))}.stats .card{min-height:74px;padding:10px 12px}.stats b{font-size:25px;margin-top:4px}.stats .muted{font-size:11px}
  input,select,textarea{font-size:16px;min-height:44px}button,.button{min-height:44px}form,.control-row{gap:12px}
  #masterform>button{min-height:48px}#detail{padding:15px}#login.auth-layout{margin-top:10px}
  #scanreceiveform{grid-template-columns:repeat(2,minmax(0,1fr))}
  #scanreceiveform>label{grid-column:span 1;min-width:0}
  #scanreceiveform>label:has(#scanuld),#scanreceiveform>label:has(#scanlocation){grid-column:1/-1}
 }
 @media(prefers-reduced-motion:reduce){*,*::before,*::after{scroll-behavior:auto!important;transition:none!important;animation:none!important}}
}
.stats:has(.quarantine-card){grid-template-columns:repeat(7,minmax(0,1fr))}
.stats .quarantine-card{background:#fff;color:var(--purple-dark);text-align:left;font:inherit;min-width:0;width:100%;display:block}
.stats .quarantine-card::before{background:#ae2344}
.stats .quarantine-card:hover{background:#fff5f8;border-color:#d48ba0}
.stats .quarantine-card:focus-visible{outline:3px solid #ae2344;outline-offset:2px}
.stats .quarantine-card small{display:block;font-size:11px;color:#866178;margin-top:3px}
@media(max-width:1000px){.stats:has(.quarantine-card){grid-template-columns:repeat(3,minmax(0,1fr))}}
