/* NEXAKOR ONE V4.32 — UI Stability, Window Workspace & Icon Cleanroom */
html.nx-v432-prepaint body{visibility:hidden!important}
html.nx-v432-atomic-style *,html.nx-v432-prepaint *{transition:none!important;animation:none!important}

/* Never hide the current module during a section switch. V4.16 used visibility:hidden for two frames. */
#page.nx-v416-switching [data-section],
#page.nx-v416-switching [data-fin-section],
#page.nx-v416-switching [data-treasury-section],
#page.nx-v416-switching [data-org-section]{visibility:visible!important}
#page.nx-v416-switching:after{display:none!important;animation:none!important}

/* Canonical icons V4.32: transparent, centered and contained. No crop enlargement. */
.nx431-icon-stack{display:grid!important;place-items:center!important;width:100%!important;height:100%!important;overflow:visible!important;background:transparent!important;line-height:0!important}
.nx431-icon-asset{inset:50% auto auto 50%!important;width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;background:transparent!important;filter:none!important;transform:translate(-50%,-50%)!important}
html[data-nav-family="dock"] .nx431-icon-asset{width:100%!important;height:100%!important}
.nx-v426-icon,.nx-rich-nav-icon,.nx-v430-mini-icon{overflow:visible!important;background:transparent!important}
.nx-v432-preview-icons .nx-v430-mini-icon{display:grid!important;place-items:center!important;overflow:hidden!important;background:transparent!important}
.nx-v432-preview-icons img{width:100%!important;height:100%!important;max-width:100%!important;max-height:100%!important;object-fit:contain!important;object-position:center!important;display:block!important;background:transparent!important}

/* The session/window bar already identifies the module. Keep the operational toolbar, not a duplicate page title. */
html.embedded-mode .embedded-content .page-head>.page-title,
html.embedded-mode .embedded-content>.page>.page-head>.page-title,
html.embedded-mode .nx-v381-records-first>.page-head>.page-title{display:none!important}
html.embedded-mode .embedded-content .page-head{min-height:0!important;margin-top:0!important}

/* Restore the ERP desktop metaphor for comparison work. */
.workspace-window{min-width:520px!important;min-height:340px!important;border-radius:12px!important;resize:none!important;will-change:left,top,width,height;contain:layout paint style}
.workspace-window-head{height:38px!important;min-height:38px!important;cursor:grab!important;touch-action:none!important;background:var(--surface)!important;border-bottom:1px solid var(--line2)!important}
.workspace-window-head:active{cursor:grabbing!important}
.workspace-window-title strong{font-size:12px!important;font-weight:800!important}
.workspace-window-route{display:none!important}
.workspace-window-actions{display:flex!important;visibility:visible!important;opacity:1!important;gap:3px!important}
.workspace-window-actions .window-btn{display:grid!important;visibility:visible!important;opacity:1!important;width:30px!important;height:28px!important;border-radius:7px!important;border:1px solid transparent!important;color:var(--ink)!important}
.workspace-window-actions .window-btn:hover{background:var(--surface2)!important;border-color:var(--line2)!important}
.workspace-resize-handle{display:block!important;width:22px!important;height:22px!important;opacity:.9!important;z-index:12!important}
.workspace-window.maximized .workspace-resize-handle{display:none!important}
.workspace-dock{display:flex!important;min-height:38px!important;padding:4px 8px!important}
.workspace-dock:empty{display:none!important}
.workspace-dock-item{height:30px!important;min-width:120px!important}

/* Avoid abrupt color contamination between shell and module surfaces. */
html[data-nexakor-theme] .workspace-window-body,
html[data-nexakor-theme] .workspace-window-body iframe,
html[data-nexakor-theme] .embedded-shell,
html[data-nexakor-theme] .embedded-content{background:var(--bg)!important}

/* Theme changes should be atomic, not animated across hundreds of controls. */
html[data-nexakor-theme] body,
html[data-nexakor-theme] .app-shell,
html[data-nexakor-theme] .main,
html[data-nexakor-theme] .content,
html[data-nexakor-theme] .sidebar,
html[data-nexakor-theme] .topbar,
html[data-nexakor-theme] .card,
html[data-nexakor-theme] .panel,
html[data-nexakor-theme] .data-grid,
html[data-nexakor-theme] .workspace-window{transition:background-color .08s linear,border-color .08s linear,color .08s linear!important}
html.nx-v432-atomic-style body,
html.nx-v432-atomic-style .app-shell,
html.nx-v432-atomic-style .main,
html.nx-v432-atomic-style .content,
html.nx-v432-atomic-style .sidebar,
html.nx-v432-atomic-style .topbar,
html.nx-v432-atomic-style .card,
html.nx-v432-atomic-style .panel,
html.nx-v432-atomic-style .data-grid,
html.nx-v432-atomic-style .workspace-window{transition:none!important}

/* Responsive: desktop multiwindow only where there is enough room. */
@media(max-width:900px){
 .workspace-stage,.workspace-dock{display:none!important}
 .workspace-window{min-width:0!important;min-height:0!important}
}
@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}.workspace-window,.workspace-window-head{transition:none!important}}
