/* Opt-in scope is computed by the page; scene three and touch layouts retain VP-5. */
body[data-s2-desktop="true"] .s2-selection-card{position:absolute;z-index:17;width:248px;height:108px;box-sizing:border-box;padding:10px 12px;border:1px solid var(--wms-selected);border-left-width:3px;border-radius:8px;background:#fffffffa;box-shadow:0 4px 16px #23323b16;color:var(--wms-text);pointer-events:none;overflow:hidden}
.s2-selection-card[hidden]{display:none!important}
.s2-selection-card small{display:block;font:500 10px/1.4 system-ui;color:var(--wms-selected-text)}
.s2-selection-card strong{display:block;font:700 16px/1.6 ui-monospace,monospace}
.s2-selection-card .s2-card-material{display:block;font:500 11px/1.5 system-ui;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.s2-selection-card .s2-card-status{display:block;font:400 10px/1.4 system-ui;color:var(--wms-muted)}
/* Matrix is the sole vertical scroll owner while its tab is active. */
body[data-s2-desktop="true"] aside.side:not(.p3-active):has(.phase2-matrix:not([hidden])){display:flex;flex-direction:column;overflow:hidden}
body[data-s2-desktop="true"] aside.side:not(.p3-active):has(.phase2-matrix:not([hidden])) > :not(.phase2-matrix){flex-shrink:0}
body[data-s2-desktop="true"] aside.side:not(.p3-active):has(.phase2-matrix:not([hidden])) .phase2-source{max-height:26%;overflow:auto}
body[data-s2-desktop="true"] .phase2-matrix:not([hidden]){display:flex;flex-direction:column;flex:1;min-height:0;padding:12px}
body[data-s2-desktop="true"] .phase2-matrix > :not(.p2-grid-scroll){flex-shrink:0}
body[data-s2-desktop="true"] .p2-grid-scroll{flex:1;min-height:80px;max-height:none;padding:4px;scroll-padding-top:56px;scrollbar-gutter:stable}
body[data-s2-desktop="true"] .p2-rack[data-fit-desktop="true"]{min-width:0!important;border-spacing:2px;width:100%;margin-bottom:12px}
body[data-s2-desktop="true"] .p2-rack caption{position:sticky;top:0;height:26px;box-sizing:border-box;background:var(--wms-mutedSurface);z-index:4;padding:4px 6px;text-align:left}
body[data-s2-desktop="true"] .p2-rack thead th{top:26px}
body[data-s2-desktop="true"] .p2-rack th:first-child{width:28px}
body[data-s2-desktop="true"] .p2-cell{scroll-margin-top:62px}
body[data-s2-desktop="true"] .p2-map-help{max-height:64px;overflow:auto}
/* One header row, one search row; do not inherit the old column switcher. */
body[data-s2-desktop="true"] .topbar{align-items:center;flex-direction:row;flex-wrap:nowrap}
body[data-s2-desktop="true"] .topbar .scene-switcher{flex-direction:row;flex-wrap:nowrap;align-items:center;gap:12px;height:auto}
body[data-s2-desktop="true"] .scene-switcher-buttons{flex-shrink:0}
body[data-s2-desktop="true"] .scene-status:empty{display:none}
body[data-s2-desktop="true"] .searchSummary{white-space:nowrap;min-width:84px;display:flex;align-items:center;justify-content:flex-end}
body[data-s2-desktop="true"] .scene-settings{width:296px;box-sizing:border-box;gap:16px;padding:16px;max-height:calc(100dvh - 100px);overflow:auto}
body[data-s2-desktop="true"] .scene-inspection{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:8px}
body[data-s2-desktop="true"] .scene-tools{display:flex;align-items:center;justify-content:space-between;gap:12px}
body[data-s2-desktop="true"] .scene-tools label{display:flex;align-items:center;gap:6px;white-space:nowrap}
body[data-s2-desktop="true"] .quality-control{display:grid;grid-template-columns:64px minmax(0,1fr);align-items:center;gap:8px}
body[data-s2-desktop="true"] .scene-settings select{min-width:0;width:100%}
body[data-s2-desktop="true"] .cyber-command-rail{gap:4px;padding:6px;border-radius:12px}
body[data-s2-desktop="true"] .cyber-command-btn[data-cyber-action="data"]{margin-top:8px;position:relative}
body[data-s2-desktop="true"] .cyber-command-btn[data-cyber-action="data"]::before{content:"";display:block;position:absolute;top:-7px;left:8px;right:8px;bottom:auto;width:auto;height:1px;transform:none;box-shadow:none;border:0;background:var(--wms-line)}
body[data-s2-desktop="true"] .cyber-command-btn[data-cyber-action="data"][aria-expanded="true"]{background:var(--wms-blue-soft);border-color:var(--wms-blue);color:var(--wms-blue-text)!important}
body[data-s2-desktop="true"] .phase2-source{padding:8px 16px}
body[data-s2-desktop="true"] .phase2-source:not(:has(.p2-source-options[open])) #p2Updated{display:none}
body[data-s2-desktop="true"] .p2-source-options{margin-top:2px}
body[data-s2-desktop="true"] .p2-source-options summary{min-height:24px;line-height:24px}
body[data-s2-desktop="true"] .p2-tabs{padding:0 12px}
body[data-s2-desktop="true"] #p2SelectionSummary{margin:6px 0;line-height:1.5}
body[data-s2-desktop="true"] .p2-legend{gap:5px 9px;margin-top:8px}
body[data-s2-desktop="true"] .p2-grid-scroll{scrollbar-width:thin;scrollbar-color:#8c9da6 #edf2f4}
body[data-s2-desktop="true"] .p2-grid-scroll::-webkit-scrollbar{width:8px;height:8px}
body[data-s2-desktop="true"] .p2-grid-scroll::-webkit-scrollbar-thumb{background:#8c9da6;border:2px solid #edf2f4;border-radius:8px}
body[data-s2-desktop="true"] .p2-grid-scroll::-webkit-scrollbar-track{background:#edf2f4}

.s2-motion-tools{display:none}
body[data-s2-desktop="true"] .s2-motion-tools{display:grid;gap:8px;border-top:1px solid var(--wms-line);padding-top:12px}
body[data-s2-desktop="true"] .s2-motion-tools button{border:1px solid var(--wms-controlLine);border-radius:6px;background:var(--wms-surface);color:var(--wms-text);min-height:34px;font:500 12px system-ui}
body[data-s2-desktop="true"] #s2LiveFPS{font:400 11px/1.5 system-ui;color:var(--wms-muted)}

/* All six entries share one centre line; prevent legacy grid alignment and width caps. */
body[data-s2-desktop="true"] .cyber-command-rail{box-sizing:border-box;width:64px;align-items:stretch}
body[data-s2-desktop="true"] .cyber-command-btn{box-sizing:border-box;width:100%;max-width:none;flex:0 0 56px;align-items:center;align-content:normal;justify-content:center;text-align:center;margin-inline:0}
body[data-s2-desktop="true"] .cyber-command-btn i{display:grid;place-items:center;width:18px;height:18px;flex:0 0 18px;font-style:normal}
body[data-s2-desktop="true"] .cyber-command-btn svg{display:block;transform:none!important}
body[data-s2-desktop="true"] .cyber-command-btn b{display:block;width:100%;text-align:center;white-space:nowrap}

/* Warehouse-focused mode shares the inventory and selection model. */
.modern-wms .brand-logo{display:block;width:138px;height:auto;max-height:44px;object-fit:contain;flex-shrink:0;border-radius:3px}
.modern-wms .view-mode-switch{display:flex;align-items:center;gap:3px;padding:3px;border:1px solid var(--wms-controlLine);border-radius:7px;background:var(--wms-mutedSurface)}
.modern-wms .view-mode-switch button{min-width:44px;white-space:nowrap}
body[data-view-mode="simple"] .cyber-command-btn[hidden],body[data-view-mode="simple"] .p3-workspaces,body[data-view-mode="simple"] .p3-navigation,body[data-view-mode="simple"] .p3-panel,body[data-view-mode="simple"] .p3-label-layer,body[data-view-mode="simple"] .dt-mode-panel,body[data-view-mode="simple"] .s2-motion-tools,body[data-view-mode="simple"] #sceneInspection,body[data-view-mode="simple"] .scene-tools{display:none!important}
@media(max-width:767px){.modern-wms .brand-logo{width:100px;max-height:32px}.modern-wms .brand-copy strong{font-size:13px!important}.modern-wms .brand-copy small{font-size:9px!important}}
body[data-view-mode="simple"] .p2-trace-btn{display:none!important}

/* A wider warehouse workspace, with touch drawers unchanged. */
body.modern-wms[data-device="desktop"][data-view-mode="simple"] .app:not(.side-collapsed){grid-template-columns:minmax(0,1fr) clamp(420px,30vw,560px)}
body.modern-wms[data-device="desktop"][data-view-mode="simple"] .p2-cell{min-height:42px}
.modern-wms .render-status{display:block;white-space:nowrap;font:600 12px/1.4 ui-monospace,monospace;color:var(--wms-blue-text);padding:6px 8px;border:1px solid var(--wms-line);border-radius:6px;background:var(--wms-mutedSurface)}
