/* ASMS Unified Workspace UI – TRICC + Technical */
:root{
  --asms-bg:#f6f8fb;--asms-panel:#fff;--asms-text:#0f172a;--asms-muted:#64748b;--asms-line:#e5ebf2;
  --asms-dark:#0f172a;--asms-green:#166534;--asms-red:#9f1239;--asms-amber:#9a3412;--asms-radius:16px;
  --asms-shadow:0 10px 30px rgba(15,23,42,.055)
}
.workspace-search{display:flex;align-items:center;gap:8px;margin:0 0 16px;padding:12px;background:#fff;border:1px solid var(--asms-line);border-radius:14px;box-shadow:var(--asms-shadow)}
.workspace-search .field,.workspace-search input,.workspace-search select{min-width:0;flex:1;width:100%;border:1px solid #dbe3ec;border-radius:10px;padding:10px 11px;background:#fff;color:var(--asms-text);outline:none}
.workspace-search .btn{flex:0 0 auto;white-space:nowrap}
.workspace-search .hint{font-size:10px;color:var(--asms-muted)}
.asms-summary-strip{display:flex;gap:8px;flex-wrap:wrap;margin-bottom:14px}.asms-summary-strip .mini{background:#fff;border:1px solid var(--asms-line);border-radius:12px;padding:9px 12px;font-size:11px}.asms-summary-strip .mini b{font-size:16px;margin-right:5px}
.asms-callout{padding:12px 14px;border:1px solid var(--asms-line);border-radius:13px;background:#f8fafc;color:#475569;font-size:11px;line-height:1.55}.asms-callout.warn{background:#fff7ed;border-color:#fed7aa;color:#9a3412}.asms-callout.bad{background:#fff1f2;border-color:#fecdd3;color:#9f1239}.asms-callout.good{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
.asms-bulkbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;padding:10px 12px;background:#f8fafc;border:1px solid var(--asms-line);border-radius:12px;margin:10px 0}.asms-bulkbar select{min-width:240px;max-width:100%}.asms-bulkbar .selected-count{font-weight:800;font-size:11px;color:#334155;margin-right:auto}
.asms-checkbox{width:17px;height:17px;accent-color:#0f172a}.asms-table-collapsible summary{cursor:pointer;list-style:none;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:14px 16px;font-weight:800}.asms-table-collapsible summary::-webkit-details-marker{display:none}.asms-table-collapsible summary:after{content:'▾';color:#64748b}.asms-table-collapsible:not([open]) summary:after{content:'▸'}
.scanner-shell{max-width:460px;margin:12px auto 0}.scanner-frame{position:relative;border-radius:15px;overflow:hidden;background:#020617;border:1px solid #1e293b}.scanner-frame video{display:block!important;width:100%;aspect-ratio:4/3;object-fit:cover;margin:0!important;border:0!important;border-radius:0!important;max-height:none!important}.scanner-guide{pointer-events:none;position:absolute;inset:20% 16%;border:2px solid rgba(255,255,255,.9);border-radius:12px;box-shadow:0 0 0 9999px rgba(2,6,23,.28)}.scanner-guide:before,.scanner-guide:after{content:'';position:absolute;width:34px;height:34px;border-color:#22c55e}.scanner-guide:before{left:-2px;top:-2px;border-left:4px solid #22c55e;border-top:4px solid #22c55e;border-radius:8px 0 0 0}.scanner-guide:after{right:-2px;bottom:-2px;border-right:4px solid #22c55e;border-bottom:4px solid #22c55e;border-radius:0 0 8px 0}.scanner-tools{display:flex;gap:7px;flex-wrap:wrap;margin-top:8px;justify-content:center}.scanner-tools button{min-width:90px}.scanner-status{font-size:10px;color:#64748b;text-align:center;margin-top:7px;line-height:1.45}
.hold-panel{border:1px solid #fed7aa;background:#fff7ed;border-radius:14px;padding:14px;margin-top:12px}.hold-panel h4{margin:0 0 5px;color:#9a3412}.hold-panel p{margin:0;color:#9a3412;font-size:11px}
.status-dot{display:inline-block;width:7px;height:7px;border-radius:50%;margin-right:5px;background:#94a3b8}.status-dot.good{background:#22c55e}.status-dot.warn{background:#f59e0b}.status-dot.bad{background:#ef4444}
.public-check-card{margin-top:14px;padding-top:14px;border-top:1px solid #edf1f5}.public-result{margin-top:12px;border:1px solid var(--asms-line);background:#f8fafc;border-radius:12px;padding:12px;font-size:11px;line-height:1.55}.public-result strong{font-size:13px}.public-result.sold{background:#fff1f2;border-color:#fecdd3;color:#9f1239}.public-result.ok{background:#f0fdf4;border-color:#bbf7d0;color:#166534}
@media(max-width:820px){
  .workspace-search{flex-wrap:wrap;padding:10px}.workspace-search .field,.workspace-search input,.workspace-search select{flex:1 1 100%}.workspace-search .btn{flex:1 1 auto;min-height:40px}
  .asms-bulkbar{align-items:stretch}.asms-bulkbar select{width:100%;min-width:0;flex:1 1 100%}.asms-bulkbar .btn{flex:1}.scanner-shell{max-width:320px}.scanner-guide{inset:22% 13%}
}
@media(max-width:520px){.scanner-shell{max-width:285px}.scanner-guide{inset:23% 12%}}

/* ASMS V4.3 – universal bulk scan + responsive hardening */
html,body{width:100%;max-width:100%;overflow-x:hidden}
img,svg,canvas,video{max-width:100%}
input,select,textarea,button{box-sizing:border-box;max-width:100%}
.bulk-scan-card,.bulk-scan-form{min-width:0;max-width:100%}
.bulk-serial-input{width:100%;min-height:150px;resize:vertical;font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;line-height:1.55;white-space:pre-wrap;overflow-wrap:normal}
.serial-tools{display:flex;align-items:flex-end;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:9px}
.serial-tools>div:first-child{min-width:0;flex:1 1 320px}
.serial-add-tools,.bulk-scan-actions{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.bulk-preview-table{width:100%;min-width:760px}
.table-wrap{width:100%;max-width:100%;overflow-x:auto!important;-webkit-overflow-scrolling:touch;overscroll-behavior-x:contain}
.table-wrap table{max-width:none}
.panel,.body,.content,.hero,.workspace-search,.public-check-card,.public-result,.asms-callout{min-width:0;overflow-wrap:anywhere}
.actions,.scanner-tools,.public-actions{max-width:100%}
.scanner-shell{width:min(100%,460px);max-width:100%}
.scanner-frame video{width:100%;height:auto}
.public-results-list{display:grid;gap:10px;margin-top:12px}
.public-result-grid{min-width:0}

@media (max-width:1024px){
  .serial-tools{align-items:stretch}
  .serial-add-tools,.bulk-scan-actions{flex:1 1 100%}
  .serial-add-tools .btn,.bulk-scan-actions .btn{flex:1 1 160px;min-height:42px}
  .asms-summary-strip .mini{flex:1 1 130px}
}
@media (max-width:768px){
  input,select,textarea{font-size:16px!important}
  .bulk-serial-input{min-height:170px}
  .serial-tools{display:block}
  .serial-add-tools,.bulk-scan-actions{display:grid!important;grid-template-columns:1fr 1fr;gap:8px;margin-top:10px;width:100%}
  .serial-add-tools .btn,.bulk-scan-actions .btn{width:100%;min-height:44px;margin:0}
  .scanner-shell{width:100%!important;max-width:360px!important;margin-left:auto!important;margin-right:auto!important}
  .scanner-tools{display:grid;grid-template-columns:1fr 1fr;width:100%}
  .scanner-tools .btn{width:100%;min-height:44px}
  .asms-summary-strip{display:grid!important;grid-template-columns:1fr 1fr;width:100%}
  .asms-summary-strip .mini{width:100%;margin:0}
  .workspace-search{display:grid!important;grid-template-columns:1fr!important}
  .workspace-search .btn,.workspace-search .field,.workspace-search input,.workspace-search select{width:100%!important;max-width:none!important}
  .actions{align-items:stretch}
  .actions>.btn,.actions>button,.actions>select,.actions>input,.actions>form{max-width:100%}
  .actions>form{width:100%}
  .actions>form .btn,.actions>form select,.actions>form input{width:100%!important;max-width:none!important}
}
@media (max-width:520px){
  .serial-add-tools,.bulk-scan-actions{grid-template-columns:1fr!important}
  .asms-summary-strip{grid-template-columns:1fr 1fr!important}
  .bulk-serial-input{min-height:190px}
  .scanner-shell{max-width:100%!important}
  .scanner-guide{inset:24% 10%!important}
  .public-result-grid{grid-template-columns:1fr!important}
  .public-actions{grid-template-columns:1fr!important}
  .btn,button{min-height:44px}
}


/* ASMS V4.4 – universal phone/tablet scan layout */
.bulk-scan-card,.bulk-scan-form{width:100%!important;min-width:0!important;max-width:100%!important}
.bulk-scan-card .serial-tools,.bulk-scan-form .serial-tools{min-height:0!important;height:auto!important;max-height:none!important;position:static!important}
.bulk-scan-card .bulk-serial-input,.bulk-scan-form .bulk-serial-input{display:block!important;min-width:0!important;max-width:100%!important;margin:0!important;position:static!important;inset:auto!important;-webkit-appearance:none;appearance:none}
@media(max-width:768px){
  .bulk-scan-card .serial-tools,.bulk-scan-form .serial-tools{display:block!important;margin:0 0 10px!important;padding:0!important}
  .bulk-scan-card .serial-tools>div:first-child,.bulk-scan-form .serial-tools>div:first-child{display:block!important;width:100%!important;min-width:0!important;max-width:100%!important;min-height:0!important;height:auto!important;flex:none!important;margin:0!important;padding:0!important}
  .bulk-scan-card .serial-add-tools,.bulk-scan-form .serial-add-tools,.bulk-scan-card .bulk-scan-actions,.bulk-scan-form .bulk-scan-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;width:100%!important;margin:10px 0 0!important;gap:8px!important}
  .bulk-scan-card .bulk-serial-input,.bulk-scan-form .bulk-serial-input{height:clamp(150px,25dvh,210px)!important;min-height:150px!important;max-height:210px!important;resize:vertical!important;overflow:auto!important;font-size:16px!important;line-height:1.45!important;padding:12px!important}
  .scanner-shell{max-height:none!important}
}
@media(max-width:360px){
  .bulk-scan-card .serial-add-tools,.bulk-scan-form .serial-add-tools,.bulk-scan-card .bulk-scan-actions,.bulk-scan-form .bulk-scan-actions{grid-template-columns:1fr!important}
}

/* ASMS V4.6 - Public collection share controls */
.batch-share-actions{display:flex;gap:7px;flex-wrap:wrap;justify-content:flex-end}.batch-share-actions form{margin:0}.public-share-link-row{display:grid;grid-template-columns:minmax(0,1fr) auto auto;gap:8px;align-items:center}.public-share-link-row .field{min-width:0}.public-share-created{border-color:#bbf7d0}.batch-status-stack{align-items:flex-end}
@media(max-width:760px){.batch-status-stack{width:100%;align-items:stretch}.batch-share-actions{width:100%;justify-content:stretch}.batch-share-actions form{flex:1 1 150px}.batch-share-actions .btn{width:100%;justify-content:center}.public-share-link-row{grid-template-columns:1fr}.public-share-link-row .btn{width:100%;justify-content:center}.unified-progress-row .progress-top{align-items:flex-start;gap:12px}.unified-progress-row .batch-status-stack{margin-top:3px}}
