.app.onec-window-expanded > header,
.app.onec-window-expanded > nav.tabs,
.app.onec-window-expanded > nav.mobile-manager-nav { display:none !important; }
.manager-onec-window-bar { display:flex; align-items:center; justify-content:flex-end; min-width:0; min-height:32px; margin:0 0 6px; flex:0 0 auto; }
.manager-onec-window-buttons { display:flex; flex:0 0 auto; gap:0; margin-left:auto; }
.manager-onec-window-buttons > button { display:inline-flex; align-items:center; justify-content:center; box-sizing:border-box; flex:0 0 46px; width:46px; min-width:46px; height:32px; padding:0 !important; margin:0; border:0; border-radius:0; background:transparent; color:#303030; box-shadow:none; }
.manager-onec-window-buttons > button:hover { background:#e5e5e5; }
.manager-onec-window-buttons > button:active { background:#d5d5d5; }
.manager-onec-window-buttons > button:focus-visible { outline:2px solid #1976d2; outline-offset:-2px; }
.manager-onec-window-buttons > button[data-onec-window-action="close"]:hover,
.manager-onec-window-buttons > button[data-onec-window-action="close"]:active { background:#e81123; color:#fff; }
.manager-onec-window-buttons svg { width:16px; height:16px; pointer-events:none; }
.manager-onec-window-panel.has-onec-detail > .manager-onec-window-bar { display:flex !important; }
.manager-onec-window-panel .onec-card-close-button { display:none; }
.manager-onec-window-nom:not(.has-onec-detail) > .manager-onec-window-bar { display:none; }
.manager-onec-window-nom.has-onec-detail .onec-nom-window-controls { display:none; }
.manager-onec-window-status { color:#b42318; padding-right:10px; min-width:0; overflow-wrap:anywhere; }
.manager-onec-window-tab { background:var(--entity-tab-bg, #edf2f7); border-color:var(--entity-tab-border, #d2dbe8); color:var(--entity-tab-fg, #164e7a); }
.manager-onec-window-tab.active { box-shadow:inset 0 -2px 0 currentColor; }

/* Share document and counterparty list header rows with window controls; card headers stay unchanged. */
@media (min-width:900px) {
    #onecPostOrdersTab:not(.has-onec-detail) > .manager-onec-window-bar,
    #onecPostCounterpartiesTab:not(.has-onec-detail) > .manager-onec-window-bar,
    #onecPostSupplierInvoicesTab:not(.has-onec-detail) > .manager-onec-window-bar,
    #onecPostReceiptsTab:not(.has-onec-detail) > .manager-onec-window-bar { float:right; margin:0 0 0 12px; }
    #onecPostOrdersTab:not(.has-onec-detail) > .toolbar,
    #onecPostCounterpartiesTab:not(.has-onec-detail) > .toolbar,
    #onecPostSupplierInvoicesTab:not(.has-onec-detail) > .supplier-invoice-list-toolbar,
    #onecPostReceiptsTab:not(.has-onec-detail) > .supplier-invoice-list-toolbar { min-height:32px; min-width:0; }
    #onecPostSupplierInvoicesTab:not(.has-onec-detail) > .onec-ai-upload,
    #onecPostReceiptsTab:not(.has-onec-detail) > .manager-receipt-upd-upload { clear:both; }
}

/* Supplier invoice title/actions share the window-control row. Keep native DOM ownership
   so save/status/file handlers and the dirty-form guard continue to use the card root. */
#onecPostSupplierInvoicesTab.has-onec-detail:has(#onecPostSupplierInvoicesDetail > .onec-card-head) > .manager-onec-window-bar {
    position:relative; z-index:30; margin-bottom:-32px; transform:translate(-10px,10px); pointer-events:none;
}
#onecPostSupplierInvoicesTab.has-onec-detail > .manager-onec-window-bar .manager-onec-window-buttons { pointer-events:auto; }
#onecPostSupplierInvoicesTab.has-onec-detail #onecPostSupplierInvoicesDetail > .onec-card-head {
    padding-right:0; min-height:32px;
}
#onecPostSupplierInvoicesTab.has-onec-detail #onecPostSupplierInvoicesDetail > .onec-card-head > .onec-card-head-actions {
    margin-right:148px; min-height:32px;
}
@media(max-width:1100px) {
    #onecPostSupplierInvoicesTab.has-onec-detail #onecPostSupplierInvoicesDetail > .onec-card-head {
        grid-template-columns:minmax(0,1fr);
    }
    #onecPostSupplierInvoicesTab.has-onec-detail #onecPostSupplierInvoicesDetail > .onec-card-head > .onec-card-head-primary {
        padding-right:148px; flex-wrap:wrap;
    }
    #onecPostSupplierInvoicesTab.has-onec-detail #onecPostSupplierInvoicesDetail > .onec-card-head > .onec-card-head-actions {
        margin-right:0; justify-content:flex-start;
    }
}

/* Cover the detail scrollport padding as rows pass behind the sticky card header. */
#onecPostSupplierInvoicesTab.has-onec-detail #onecPostSupplierInvoicesDetail > .onec-card-head::before {
    content:""; position:absolute; inset:-10px -10px 0; background:#fff; z-index:-1; pointer-events:none;
}

/* Nomenclature path shares the window header with pin/expand/close controls. */
#onecPostNomDetail > [data-nom-card-path] { display:none; }
[data-nom-window-breadcrumbs] { flex:1 1 auto; min-width:0; margin-right:10px; }
[data-nom-window-breadcrumbs] .onec-post-nom-breadcrumbs { margin:0; align-items:center; min-height:32px; }
[data-nom-window-breadcrumbs] button { max-width:100%; white-space:normal; overflow-wrap:anywhere; }
