/* ==========================================================================
   Nucleus detail shell (content-anchored layout + aligned flush rail)
   --------------------------------------------------------------------------
   Shared chrome for Service Desk / Accounts / Projects (and future modules).
   Domain surfaces stay in module.{service-desk|accounts|projects}-detail.css.

   Contract (Workspace flat + alignment polish):
   - Main column is transparent canvas; definition/profile sections are hairline
     (transparent, no box border / radius / ambient shadow) — separation via
     section headers, MudDivider, and tab-content gap.
   - Section body padding is vertical-only (no extra L/R inset) so fields align
     with the title / tab strip inside the shared page gutter.
   - Right rail is a flush column on the page surface — not an inset floating card.
   - Edge-rail: full-width header; rail is a grid column of the detail shell below it
     (page surface, top + left hairline, no shadow). The line under the rail header
     is full-bleed and shares Y with the main tab rule.
   - Body: L gutters match header; edge-rail column-gap is 0; bottom bleeds.
   - No header overlap (translateY / ::before retired).
   - Cards remain only for true interaction surfaces (conversation, ModernCard).
   - Title-row back uses NucleusDetailTitleBackButton (chevron-only, not Outlined).
   ========================================================================== */

/* Host fill chain — L/R gutters match header; bottom bleeds */
.entity-view-layout .module-content-region:has(.nucleus-detail-shell) .workspace-main-body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    /* V3.5 page gutter so tabs and the title share one left edge. */
    padding: var(--nx-space-2, 0.5rem) var(--nx-page-gutter-x, 24px) 0 var(--nx-page-gutter-x, 24px) !important;
}

.entity-view-layout .module-content-region:has(.nucleus-detail-shell) .workspace-main-body > * {
    flex: 1 1 0;
    min-height: 0;
}

.nucleus-detail-host {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    overflow: visible;
    outline: none;
}

.nucleus-detail-shell .nucleus-detail-shell__main {
    padding-bottom: var(--nx-page-gutter-y-bottom, 48px);
}

@media (min-width: 960px) {
    .entity-view-layout .module-content-region:has(.nucleus-detail-shell) {
        display: flex !important;
        flex-direction: column !important;
        min-height: 0;
    }

    .entity-view-layout .module-content-region:has(.nucleus-detail-shell) .workspace-main-body {
        flex: 1 1 0;
        min-height: 0;
    }

    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .workspace-main-body,
    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .nucleus-detail-host {
        overflow: visible !important;
    }

    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel,
    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .nucleus-detail-shell.nucleus-detail-split-layout--independent-scroll {
        overflow: visible;
    }
}

/* Shell chrome — full-width by default; 65/35 only when a side panel is mounted */
.nucleus-detail-shell {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    row-gap: 0.75rem;
}

.nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel {
    display: grid;
    grid-template-columns: minmax(0, var(--nucleus-detail-main-ratio, 65fr)) minmax(var(--nucleus-detail-side-width, 360px), var(--nucleus-detail-side-ratio, 35fr));
    grid-template-rows: auto minmax(0, 1fr);
    column-gap: var(--nucleus-detail-gap, 1rem);
}

.nucleus-detail-shell__main-tabs {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: flex-end;
    justify-content: flex-start;
    min-width: 0;
    /* Shared chrome band with edge-rail — lock height so hairlines share one Y */
    min-height: var(--nucleus-detail-chrome-band-min-height, 2.75rem);
    height: var(--nucleus-detail-chrome-band-min-height, 2.75rem);
    max-height: var(--nucleus-detail-chrome-band-min-height, 2.75rem);
    width: 100%;
    overflow: visible;
    padding-top: var(--nucleus-detail-chrome-band-pad-top, 0.35rem);
    box-sizing: border-box;
}

/* Main tab strip — left-start (content edge aligned with title/chips) */
.nucleus-detail-shell__main-tabs .mud-tabs,
.nucleus-detail-shell__main-tabs .mud-tabs-toolbar,
.nucleus-detail-shell__main-tabs .mud-tabs-tabbar,
.nucleus-detail-shell__main-tabs .mud-tabs-tabbar-inner,
.nucleus-detail-shell__main-tabs .mud-tabs-tabbar-wrapper,
.nucleus-detail-shell__main-tabs .mud-tabs-tabbar-content,
.nucleus-detail-shell__main-tabs .mud-tabs-scroll-wrapper {
    justify-content: flex-start !important;
    width: 100%;
}

.nucleus-detail-shell__main-tabs .nucleus-detail-simple-mud-tabs .mud-tab:first-child {
    padding-left: 0 !important;
    margin-inline-start: 0 !important;
}

.nucleus-detail-shell__main-tabs .nucleus-detail-main-mud-tabs-host {
    width: 100%;
    min-width: 0;
    overflow: visible;
}

.nucleus-detail-shell .nucleus-detail-simple-mud-tabs.mud-tabs,
.nucleus-detail-shell .nucleus-detail-simple-mud-tabs .mud-tabs-toolbar,
.nucleus-detail-shell .nucleus-detail-simple-mud-tabs .mud-tabs-tabbar,
.nucleus-detail-shell .nucleus-detail-simple-mud-tabs .mud-tabs-tabbar-inner,
.nucleus-detail-shell .nucleus-detail-simple-mud-tabs .mud-tabs-tabbar-wrapper {
    overflow: visible !important;
}

.nucleus-detail-shell .nucleus-detail-simple-mud-tabs .mud-tab {
    overflow: visible !important;
}

.nucleus-detail-shell .nucleus-detail-shell__main,
.nucleus-detail-shell .service-desk-main,
.nucleus-detail-shell .account-detail-main,
.nucleus-detail-shell .contact-detail-main,
.nucleus-detail-shell .project-detail-main,
.nucleus-detail-shell .opportunity-detail-main,
.nucleus-detail-shell .contract-detail-main,
.nucleus-detail-shell .template-detail-main,
.nucleus-detail-shell .catalogue-detail-main,
.nucleus-detail-shell .order-detail-main,
.nucleus-detail-shell .governance-risk-detail-main,
.nucleus-detail-shell .governance-policy-detail-main,
.nucleus-detail-shell .governance-control-detail-main,
.nucleus-detail-shell .governance-standard-detail-main {
    grid-column: 1;
    grid-row: 2;
    /* Canvas shows through — white cards live inside the scroll body */
    background: transparent;
    border-radius: 0;
    min-width: 0;
    min-height: 0;
}

body.theme-dark .nucleus-detail-shell .nucleus-detail-shell__main,
body.theme-dark .nucleus-detail-shell .service-desk-main,
body.theme-dark .nucleus-detail-shell .account-detail-main,
body.theme-dark .nucleus-detail-shell .contact-detail-main,
body.theme-dark .nucleus-detail-shell .project-detail-main,
body.theme-dark .nucleus-detail-shell .opportunity-detail-main,
body.theme-dark .nucleus-detail-shell .contract-detail-main,
body.theme-dark .nucleus-detail-shell .template-detail-main,
body.theme-dark .nucleus-detail-shell .catalogue-detail-main,
body.theme-dark .nucleus-detail-shell .order-detail-main,
body.theme-dark .nucleus-detail-shell .governance-risk-detail-main,
body.theme-dark .nucleus-detail-shell .governance-policy-detail-main,
body.theme-dark .nucleus-detail-shell .governance-control-detail-main,
body.theme-dark .nucleus-detail-shell .governance-standard-detail-main {
    background: transparent;
}

/* Main-column scrollbar keeps a gap so cards do not sit against the thumb. */
@media (min-width: 960px) {
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .capability-workspace-tab-content,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .entity-view-body,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .service-desk-tab-content,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .conversation-thread-panel,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .account-detail-main > .account-detail-tab-content,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contact-detail-main > .contact-detail-tab-content,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .project-detail-main > .project-detail-tab-content,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contract-detail-main > .contract-detail-tab-content,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto .opportunity-detail-main,
    .capability-workspace-detail-layout .capability-workspace-main > .capability-workspace-tab-content,
    .capability-workspace-detail-layout .capability-workspace-main > .entity-view-body,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto > .nucleus-detail-split-layout__main-content {
        padding-right: var(--nucleus-detail-gap, 1rem);
        scrollbar-gutter: stable;
        scrollbar-width: thin;
        scrollbar-color: var(--nx-scrollbar-thumb) transparent;
    }

    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .capability-workspace-tab-content::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .entity-view-body::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .service-desk-tab-content::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .conversation-thread-panel::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .account-detail-main > .account-detail-tab-content::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contact-detail-main > .contact-detail-tab-content::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .project-detail-main > .project-detail-tab-content::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contract-detail-main > .contract-detail-tab-content::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto .opportunity-detail-main::-webkit-scrollbar,
    .capability-workspace-detail-layout .capability-workspace-main > .capability-workspace-tab-content::-webkit-scrollbar,
    .capability-workspace-detail-layout .capability-workspace-main > .entity-view-body::-webkit-scrollbar,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto > .nucleus-detail-split-layout__main-content::-webkit-scrollbar {
        width: 8px;
    }

    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .capability-workspace-tab-content::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .entity-view-body::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .service-desk-tab-content::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .conversation-thread-panel::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .account-detail-main > .account-detail-tab-content::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contact-detail-main > .contact-detail-tab-content::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .project-detail-main > .project-detail-tab-content::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contract-detail-main > .contract-detail-tab-content::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto .opportunity-detail-main::-webkit-scrollbar-track,
    .capability-workspace-detail-layout .capability-workspace-main > .capability-workspace-tab-content::-webkit-scrollbar-track,
    .capability-workspace-detail-layout .capability-workspace-main > .entity-view-body::-webkit-scrollbar-track,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto > .nucleus-detail-split-layout__main-content::-webkit-scrollbar-track {
        background: transparent;
    }

    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .capability-workspace-tab-content::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .entity-view-body::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .service-desk-tab-content::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .conversation-thread-panel::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .account-detail-main > .account-detail-tab-content::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contact-detail-main > .contact-detail-tab-content::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .project-detail-main > .project-detail-tab-content::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contract-detail-main > .contract-detail-tab-content::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto .opportunity-detail-main::-webkit-scrollbar-thumb,
    .capability-workspace-detail-layout .capability-workspace-main > .capability-workspace-tab-content::-webkit-scrollbar-thumb,
    .capability-workspace-detail-layout .capability-workspace-main > .entity-view-body::-webkit-scrollbar-thumb,
    .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto > .nucleus-detail-split-layout__main-content::-webkit-scrollbar-thumb {
        background: var(--nx-scrollbar-thumb);
        border-radius: 2px;
    }
}

/* Ensure active-tab underline is not clipped */
.nucleus-detail-shell__main-tabs .nucleus-detail-main-mud-tabs-host,
.nucleus-detail-shell__main-tabs .mud-tabs-toolbar,
.nucleus-detail-shell__main-tabs .mud-tabs-tabbar {
    overflow: visible !important;
}

/* Header-only MudTabs bodies */
.nucleus-detail-shell .nucleus-detail-mud-tabs-panels-collapsed,
.nucleus-detail-rail-card .nucleus-detail-mud-tabs-panels-collapsed {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    overflow: hidden !important;
}

/* Underline MudTabs look: wwwroot/css/module.tabs.css */

/* Content-anchored chrome — header overlap on rail is retired */
.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) {
    --nucleus-detail-rail-header-overlap: 0;
    --nucleus-detail-side-overlap: 0;
    --nucleus-detail-content-top-inset: 0.125rem;
    --nucleus-detail-header-chrome-rhythm: 0.25rem;
    --nucleus-detail-title-chip-gap: 0.25rem;
    /* Match Service Desk: tight title→chips, header bottom before body tabs */
    --nucleus-detail-header-section-padding-bottom: 0.25rem;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-main-column {
    overflow: visible;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-content-region {
    position: relative;
    z-index: 101 !important;
    overflow: visible;
}

/* Rail column — page surface, left hairline. Top stroke lives on the edge-rail header
   so it does not shift the shared chrome band. Domain *-right-rail-card classes
   are layout modifiers. Tab underline Y stays locked via chrome-band tokens. */
.nucleus-detail-rail-card {
    --nucleus-detail-rail-card-border: var(--nucleus-detail-side-card-border, var(--nx-border-subtle, var(--mud-palette-lines-default)));
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    flex-direction: column;
    align-self: stretch;
    min-height: 0;
    min-width: 0;
    height: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: none;
    border-left: 1px solid var(--nucleus-detail-rail-card-border);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
    transform: none;
}

@media (min-width: 960px) {
    .nucleus-detail-rail-card {
        z-index: 10;
        isolation: isolate;
    }

    .nucleus-detail-rail-card::before {
        content: none;
        display: none;
    }

    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column,
    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column .home-quick-actions {
        position: relative;
        z-index: 0;
    }
}

body.theme-dark .nucleus-detail-rail-card {
    --nucleus-detail-rail-card-border: var(--mud-palette-lines-default);
    background: transparent;
    border-left-color: var(--nucleus-detail-rail-card-border);
    box-shadow: none;
}

.nucleus-detail-rail-card > .nucleus-detail-side-panel {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    max-width: none;
    height: 100%;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.nucleus-detail-rail-card__tabs.nucleus-context-panel-tabs,
.nucleus-detail-rail-card__tabs {
    flex-shrink: 0;
    display: flex;
    align-items: flex-end;
    min-width: 0;
    min-height: 2.25rem;
    padding: 0 0.875rem;
    border-bottom: none;
    margin: 0;
    background: transparent;
}

/* Collapse reserved tab chrome when no strip is rendered (e.g. empty Tabs slot) */
.nucleus-detail-rail-card__tabs:empty,
.nucleus-detail-rail-card__tabs:not(:has(.mud-tabs, .nucleus-detail-simple-mud-tabs, .nucleus-detail-rail-mud-tabs, [role="tablist"], .nucleus-detail-edge-rail-title, .nucleus-detail-edge-rail-rule)):not(.nucleus-detail-edge-rail-header):not(.asset-detail-rail-header) {
    display: none;
    min-height: 0;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
}

.nucleus-detail-rail-card__tabs.nucleus-detail-edge-rail-header,
.nucleus-detail-rail-card__tabs.asset-detail-rail-header,
.service-desk-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.service-desk-right-rail-card__tabs.asset-detail-rail-header,
.service-desk-right-rail-card__tabs.nucleus-context-panel-tabs.nucleus-detail-edge-rail-header,
.capability-workspace-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.capability-workspace-right-rail-card__tabs.asset-detail-rail-header,
.account-detail-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.account-detail-right-rail-card__tabs.nucleus-context-panel-tabs.nucleus-detail-edge-rail-header,
.contact-detail-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.project-detail-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.contract-detail-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.order-detail-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.strategy-detail-right-rail-card__tabs.nucleus-detail-edge-rail-header,
.business-flow-workspace-right-rail-card__tabs.nucleus-detail-edge-rail-header {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    /* Same band as .nucleus-detail-shell__main-tabs — hairline at bottom of this box */
    justify-content: flex-end;
    min-height: var(--nucleus-detail-chrome-band-min-height, 2.75rem) !important;
    height: var(--nucleus-detail-chrome-band-min-height, 2.75rem) !important;
    max-height: var(--nucleus-detail-chrome-band-min-height, 2.75rem) !important;
    box-sizing: border-box;
    /* Pad-top matches main tabs. The hairline lives on the toolbar so it
       starts at Details. Top stroke is desktop-only (overrides). */
    padding: var(--nucleus-detail-chrome-band-pad-top, 0.35rem) 0 0 0 !important;
    margin: 0;
    overflow: visible;
    border-bottom: none !important;
    background: transparent;
}

/* Non-interactive title when the rail has no overlay tabs — same band as tabs, no underline. */
.nucleus-detail-edge-rail-title,
.nucleus-detail-edge-rail-rule {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    flex: 1 1 auto;
    min-height: var(--nucleus-detail-chrome-band-min-height, 2.75rem);
    height: 100%;
    margin-left: var(--nucleus-detail-column-edge-inset, 0.75rem);
    width: calc(100% - var(--nucleus-detail-column-edge-inset, 0.75rem));
    padding: 0.5rem 0.75rem 0.5rem 0;
    box-sizing: border-box;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.35;
    color: var(--nx-text-heading, #1d3d55);
    text-transform: none;
    border-bottom: none;
}

/* Hairline only when the rail band is a rule, not a title. Tabs keep their own underline. */
.nucleus-detail-edge-rail-rule {
    border-bottom: 1px solid var(--nx-border-default, #DFE7ED);
}

/* Overlay tab strip — match left main tabs (no vertical dividers, content-start labels) */
.nucleus-detail-edge-rail-toolbar {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    flex: 1 1 auto;
    min-height: 2.25rem; /* match .mud-tab */
    height: 100%;
    box-sizing: border-box;
    margin-top: 0;
    margin-left: var(--nucleus-detail-column-edge-inset, 0.75rem);
    width: calc(100% - var(--nucleus-detail-column-edge-inset, 0.75rem));
    padding-left: 0;
    padding-right: 0.75rem;
    /* Same inset from the vertical divider as the main tab rule */
    border-bottom: 1px solid var(--mud-palette-lines-default, #F3F4F6);
}

.nucleus-detail-edge-rail-toolbar > .mud-button-root,
.nucleus-detail-edge-rail-toolbar .mud-button-root.nucleus-detail-edge-rail-toolbar__btn {
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
    min-height: 2.25rem !important; /* match .mud-tab */
    height: 100% !important;
    flex: 0 0 auto;
    justify-content: center;
    align-self: stretch;
    padding: 0.5rem 0.75rem !important;
    margin: 0 !important;
    margin-inline-end: var(--nucleus-detail-tab-gap, 0.25rem) !important;
    border-radius: 0 !important;
    border: none !important;
    border-left: none !important;
    text-transform: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

.nucleus-detail-edge-rail-toolbar > .mud-button-root:first-child,
.nucleus-detail-edge-rail-toolbar .mud-button-root.nucleus-detail-edge-rail-toolbar__btn:first-child {
    padding-left: 0 !important;
    margin-inline-start: 0 !important;
}

.nucleus-detail-edge-rail-toolbar > .mud-button-root:hover,
.nucleus-detail-edge-rail-toolbar .mud-button-root.nucleus-detail-edge-rail-toolbar__btn:hover {
    background: transparent !important;
}

.nucleus-detail-edge-rail-toolbar .mud-button-root.nucleus-detail-edge-rail-toolbar__btn--active,
.nucleus-detail-edge-rail-toolbar > .mud-button-root.nucleus-detail-edge-rail-toolbar__btn--active {
    background: transparent !important;
    box-shadow: inset 0 -2px 0 var(--mud-palette-primary) !important;
}

/* Decorative underline retired — hairline is border-bottom on the edge-rail header tabs. */
.nucleus-detail-edge-rail-header__underline,
.asset-detail-rail-header__underline {
    display: none;
}

.nucleus-detail-edge-rail-header__row,
.asset-detail-rail-header__row {
    display: none;
}

.nucleus-detail-rail-card__tabs .nucleus-detail-rail-mud-tabs,
.nucleus-detail-rail-card__tabs .nucleus-detail-simple-mud-tabs {
    width: 100%;
    min-width: 0;
}

.nucleus-detail-rail-card__body.nucleus-context-panel-content,
.nucleus-detail-rail-card__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    overscroll-behavior: contain;
    padding: 0;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: var(--nx-scrollbar-thumb) transparent;
    display: flex;
    flex-direction: column;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-with-border {
    border-bottom: none !important;
}

.entity-view-layout:has(.nucleus-detail-shell) .module-header-section.has-scrollable-content {
    border-bottom: none !important;
}

/* Header geometry mirrors split so workflow actions sit over the rail column */
.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-header-section {
    display: grid;
    grid-template-columns: minmax(0, var(--nucleus-detail-main-ratio, 65fr)) minmax(var(--nucleus-detail-side-width, 360px), var(--nucleus-detail-side-ratio, 35fr));
    gap: var(--nucleus-detail-header-chrome-rhythm, 0.375rem) var(--nucleus-detail-gap, 1rem) !important;
    padding: var(--nx-page-gutter-y-top, 20px) var(--nx-page-gutter-x, 24px) var(--nucleus-detail-header-section-padding-bottom, 0.25rem) !important;
    overflow: visible;
    z-index: 0 !important;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-header-section > * {
    grid-column: 1 / -1;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-header-section > :last-child {
    margin-bottom: 0 !important;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-top-row {
    display: grid !important;
    grid-template-columns: minmax(0, var(--nucleus-detail-main-ratio, 65fr)) minmax(var(--nucleus-detail-side-width, 360px), var(--nucleus-detail-side-ratio, 35fr));
    gap: var(--nucleus-detail-gap, 1rem) !important;
    align-items: start;
    width: 100%;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-left {
    min-width: 0;
    align-items: stretch;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column {
    grid-column: 2;
    width: 100%;
    min-width: 0;
    align-items: stretch !important;
}

/* Below 1050px the two-column header crushes the title. One column: title, purpose, meta, actions. */
@media (max-width: 1050px) {
    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-header-section {
        grid-template-columns: minmax(0, 1fr) !important;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .home-header-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: stretch !important;
        min-width: 0;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-top-row {
        display: contents !important;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-left {
        order: 1;
        min-width: 0;
        width: 100%;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-record-row {
        order: 2;
        width: 100%;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column {
        order: 3;
        grid-column: 1 !important;
        width: 100%;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .nucleus-page-title-band__title,
    .entity-view-layout:has(.nucleus-detail-shell) .nucleus-page-title-band__title-inner {
        overflow: visible;
        white-space: normal !important;
        text-overflow: clip;
    }
}

.entity-view-layout:has(.nucleus-detail-shell) .home-quick-actions {
    width: 100%;
    align-items: stretch;
    flex-wrap: nowrap;
    column-gap: 0;
    row-gap: 0;
}

.entity-view-layout:has(.nucleus-detail-shell) .home-quick-actions .nucleus-detail-header-workflow-actions {
    width: auto;
    margin-left: auto;
    padding-block: 0.125rem;
}

/* Record actions size to the Mud button. FullWidth is how a button stretches. */
.nucleus-detail-header-workflow-actions,
.service-desk-header-workflow-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    width: auto;
    margin-left: auto;
    min-width: 0;
}

.nucleus-detail-header-workflow-actions > *,
.service-desk-header-workflow-actions > *,
.nucleus-detail-header-workflow-actions > .mud-menu,
.service-desk-header-workflow-actions > .mud-menu,
.nucleus-detail-header-workflow-actions > .mud-menu .mud-menu-activator,
.service-desk-header-workflow-actions > .mud-menu .mud-menu-activator {
    flex: 0 0 auto;
    width: auto;
    min-width: 0;
    max-width: none;
}

.nucleus-detail-header-workflow-actions > .mud-menu,
.service-desk-header-workflow-actions > .mud-menu,
.nucleus-detail-header-workflow-actions > .mud-menu .mud-menu-activator,
.service-desk-header-workflow-actions > .mud-menu .mud-menu-activator {
    display: flex;
}

/* Icon-only overflow menu (Service Desk secondary actions) */
.nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu {
    flex: 0 0 auto;
    max-width: 2.5rem;
}

.nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu .mud-button-root {
    min-width: var(--nx-control-height-standard, 36px);
    padding: 0 0.25rem !important;
}

/* Keep workflow bar above rail card edge when actions sit in header overlap */
.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column .nucleus-detail-header-workflow-actions {
    position: relative;
    z-index: 12;
}

/* Chevron-only title-row back; hide text “Back to …” row when shell is active */
.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-back-row {
    display: none !important;
}

a.nucleus-detail-title-back-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
    color: var(--mud-palette-text-primary);
    text-decoration: none;
    line-height: 1;
    cursor: pointer;
}

a.nucleus-detail-title-back-btn:hover,
.nucleus-detail-title-back-btn:hover {
    color: var(--mud-palette-text-primary);
    background: transparent;
    opacity: 0.72;
}

a.nucleus-detail-title-back-btn:focus-visible,
.nucleus-detail-title-back-btn:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.nucleus-detail-title-back-btn__icon.mud-icon-root,
.nucleus-detail-title-back-btn .mud-icon-root {
    /* Match PageTitle / Typo.h4 optical size */
    font-size: 1.5rem !important;
    width: 1.5rem !important;
    height: 1.5rem !important;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-title-row {
    align-items: center;
    gap: var(--nx-space-1, 0.25rem);
    width: 100%;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-leading {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
}

.entity-view-layout:has(.nucleus-detail-shell) .home-greeting,
.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-title-inner.home-greeting {
    margin-bottom: 0 !important;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-with-border {
    border-bottom: none !important;
    padding-bottom: var(--nucleus-detail-title-chip-gap, 0.25rem) !important;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-with-border .home-header-content {
    gap: 0.25rem !important;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-subtitle-slot {
    margin-top: var(--nucleus-detail-title-chip-gap, 0.25rem) !important;
    margin-bottom: 0 !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
}

.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-trailing {
    margin-left: auto;
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
}

/* Rail field rows — fixed label column, left-aligned values */
.nucleus-detail-rail-dashboard,
.nucleus-detail-shell {
    --nucleus-rail-label-width: 7.5rem;
}

.nucleus-rail-field-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
    min-width: 0;
    padding: 8px 0;
}

.nucleus-rail-field-row__label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.35;
    color: var(--nx-text-secondary, #687C8F);
    justify-self: start;
    padding-top: 0;
}

.nucleus-rail-field-row__value {
    font-size: 12px;
    line-height: 1.62;
    color: var(--nx-text-primary, #1B3449);
    text-align: left;
    min-width: 0;
    word-break: break-word;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 0.35rem;
}

/* Sellable rail rows: label left, value right (Maintenance / usage rhythm). */
.nucleus-detail-rail-dashboard .sellable-rail-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    min-height: 1.625rem;
    min-width: 0;
}

.nucleus-detail-rail-dashboard .sellable-rail-row__label {
    font-size: var(--nx-font-meta, 11px);
    font-weight: 500;
    line-height: 1.35;
    color: var(--mud-palette-text-disabled);
    min-width: 0;
}

.nucleus-detail-rail-dashboard .sellable-rail-row__value {
    font-size: var(--nx-font-secondary, 13px);
    font-weight: 500;
    line-height: 1.35;
    color: var(--mud-palette-text-primary);
    text-align: right;
    min-width: 0;
}

.nucleus-detail-rail-dashboard .sellable-rail-row__value--success {
    color: var(--mud-palette-success);
}

.nucleus-detail-rail-dashboard .sellable-rail-row__value--warning {
    color: var(--mud-palette-warning);
}

.nucleus-detail-rail-dashboard .sellable-rail-row__link.mud-button-root {
    min-height: 0;
    padding: 0;
    text-transform: none;
}

/* Shared header meta chips */
.nucleus-detail-header-chips {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.nucleus-detail-header-chip {
    display: inline-flex;
    align-items: center;
    min-height: 1.625rem;
    padding: 0 0.625rem;
    border-radius: var(--nx-radius-medium, var(--nucleus-surface-radius, 4px));
    font-size: var(--nx-font-meta, 11px);
    font-weight: 500;
    line-height: 1.25;
    color: var(--mud-palette-text-primary);
    background: var(--mud-palette-background-grey, var(--mud-palette-drawer-background));
    border: 1px solid var(--mud-palette-lines-default);
}

.nucleus-detail-header-chip--outlined {
    background: transparent;
}

.nucleus-detail-header-chip--status,
.nucleus-detail-header-chip--filled {
    border-color: transparent;
    background: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text, #fff);
}

.nucleus-detail-header-chip--danger,
.nucleus-detail-header-chip--sla-breach {
    background: var(--mud-palette-error);
    color: var(--mud-palette-error-text, #fff);
    border-color: transparent;
}

.nucleus-detail-header-chip {
    font-weight: 600;
    line-height: 1.25;
    max-width: min(16rem, 100%);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nucleus-detail-header-chip--status {
    max-width: min(18rem, 100%);
}

.nucleus-detail-header-chip--outlined-warning {
    border: 1px solid var(--mud-palette-warning);
    background-color: transparent;
    color: var(--mud-palette-warning);
}

.nucleus-detail-header-chip--outlined-error {
    border: 1px solid var(--mud-palette-error);
    background-color: transparent;
    color: var(--mud-palette-error);
}

.nucleus-detail-header-chip--filled-primary {
    border: none;
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text, #fff);
}

.nucleus-detail-header-chip--filled-success {
    border: none;
    background-color: var(--mud-palette-success);
    color: var(--mud-palette-success-text, #fff);
}

.nucleus-detail-header-chip--filled-warning {
    border: none;
    background-color: var(--mud-palette-warning);
    /* Dark amber fills need light on-color text for legible contrast. */
    color: var(--mud-palette-warning-text, #fff);
}

.nucleus-detail-header-chip--filled-error {
    border: none;
    background-color: var(--mud-palette-error);
    color: var(--mud-palette-error-text, #fff);
}

.nucleus-detail-header-chip--filled-default {
    border: none;
    background-color: var(--mud-palette-grey-default);
    color: var(--mud-palette-text-primary);
}

/* Ensure status / filled base also prefer high-contrast on-color text. */
.nucleus-detail-header-chip--status,
.nucleus-detail-header-chip--filled {
    color: var(--mud-palette-primary-text, #fff);
}

a.nucleus-detail-header-chip {
    text-decoration: none;
    cursor: pointer;
    color: inherit;
}

a.nucleus-detail-header-chip--outlined:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 8%, transparent);
    border-color: color-mix(in srgb, var(--mud-palette-primary) 40%, var(--mud-palette-lines-default));
}

/* --------------------------------------------------------------------------
   Main column sections on canvas (Workspace flat parity)
   EntityV2 / definition sections are hairline — no discrete white cards.
   Scoped to shell mains so index / non-shell pages keep their own section chrome.
   -------------------------------------------------------------------------- */
.nucleus-detail-shell .nucleus-detail-shell__main .nucleus-definition-section,
.nucleus-detail-shell .nucleus-detail-shell__main .nucleus-definition-section,
.nucleus-detail-shell .nucleus-detail-shell__main .entity-v2-detail-section,
.nucleus-detail-shell .nucleus-detail-shell__main .asset-detail-section,
.nucleus-detail-shell .service-desk-main .nucleus-definition-section,
.nucleus-detail-shell .service-desk-main .nucleus-definition-section,
.nucleus-detail-shell .account-detail-main .nucleus-definition-section,
.nucleus-detail-shell .account-detail-main .nucleus-definition-section,
.nucleus-detail-shell .contact-detail-main .nucleus-definition-section,
.nucleus-detail-shell .contact-detail-main .nucleus-definition-section,
.nucleus-detail-shell .project-detail-main .nucleus-definition-section,
.nucleus-detail-shell .project-detail-main .nucleus-definition-section,
.nucleus-detail-shell .opportunity-detail-main .nucleus-definition-section,
.nucleus-detail-shell .opportunity-detail-main .nucleus-definition-section,
.nucleus-detail-shell .contract-detail-main .nucleus-definition-section,
.nucleus-detail-shell .contract-detail-main .nucleus-definition-section,
.nucleus-detail-shell .template-detail-main .nucleus-definition-section,
.nucleus-detail-shell .template-detail-main .nucleus-definition-section,
.nucleus-detail-shell .catalogue-detail-main .nucleus-definition-section,
.nucleus-detail-shell .catalogue-detail-main .nucleus-definition-section,
.nucleus-detail-shell .order-detail-main .nucleus-definition-section,
.nucleus-detail-shell .order-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-risk-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-risk-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-policy-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-policy-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-control-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-control-detail-main .nucleus-definition-section,
.nucleus-detail-shell .governance-standard-detail-main .nucleus-definition-section {
    margin-bottom: 0;
    /* Vertical rhythm only — horizontal 0 so body aligns with title / tabs.
       1.25rem above and below centers the sibling hairline between sections. */
    padding: 1.25rem 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

.nucleus-detail-shell .assets-v2-main,
.nucleus-detail-shell .entity-v2-overview-main,
.nucleus-detail-shell .service-desk-tab-content,
.nucleus-detail-shell .account-detail-tab-content,
.nucleus-detail-shell .contact-detail-tab-content,
.nucleus-detail-shell .capability-workspace-tab-content {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    background: transparent;
    min-width: 0;
    width: 100%;
}

/* Definition stacks: padding on each section centers the hairline. No flex gap. */
.nucleus-detail-shell .assets-v2-main,
.nucleus-detail-shell .entity-v2-overview-main {
    gap: 0;
}

/* Beat utility gap (gap-3 / MudStack) so the hairline stays centered between sections. */
.nucleus-detail-shell .nucleus-detail-shell__main :is(.flex-column, .mud-stack):has(
        > :is(
            .nucleus-definition-section,
            .entity-v2-detail-section,
            .asset-detail-section
        )
    ) {
    gap: 0 !important;
}

/* Already-carded / profile hosts: keep nested definition sections flat (no double chrome) */
.nucleus-detail-shell .nucleus-surface-card .nucleus-definition-section,
.nucleus-detail-shell .nucleus-surface-card .nucleus-definition-section,
.nucleus-detail-shell .nucleus-surface-card .entity-v2-detail-section,
.nucleus-detail-shell .modern-card .nucleus-definition-section,
.nucleus-detail-shell .modern-card .nucleus-definition-section,
.nucleus-detail-shell .mud-paper.nucleus-surface-card .nucleus-definition-section,
.nucleus-detail-shell .mud-paper.nucleus-surface-card .nucleus-definition-section,
.nucleus-detail-shell .nucleus-surface-card .asset-detail-section,
.nucleus-detail-shell .modern-card .asset-detail-section,
.nucleus-detail-shell .mud-paper.nucleus-surface-card .asset-detail-section {
    margin-bottom: 0;
    padding: 0;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Dynamic-field / legacy overview bands without EntityV2 wrapper */
.nucleus-detail-shell .assets-v2-main > .property-details-section,
.nucleus-detail-shell .entity-v2-overview-main > .property-details-section {
    margin: 0;
    padding: 1rem 0;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Asset Overview profile — flat stack. Hairline is the sibling border below, not a bottom rule. */
.nucleus-detail-shell .assets-v2-main > .asset-overview-profile-card,
.nucleus-detail-shell .entity-v2-overview-main > .asset-overview-profile-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin: 0;
    padding: 0;
    width: 100%;
    max-width: none;
    box-sizing: border-box;
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
}

/* Grouping wrappers are not bands. Their sections join the profile-card flex stack. */
.nucleus-detail-shell .asset-overview-profile-card > #asset-overview-narrative,
.nucleus-detail-shell .asset-overview-profile-card > .asset-overview-profile-card__layout,
.nucleus-detail-shell .asset-overview-profile-card .record-dynamic-fields-display--v2 {
    display: contents;
}

.nucleus-detail-shell .asset-overview-profile-card .section-gap,
.nucleus-detail-shell .asset-overview-profile-card #asset-overview-narrative,
.nucleus-detail-shell .asset-overview-profile-card .asset-overview-snapshot {
    margin: 0;
}

.nucleus-detail-shell .asset-overview-narrative-text {
    font-size: var(--nx-font-secondary, 13px) !important;
    line-height: 1.6 !important;
    color: var(--mud-palette-text-secondary) !important;
}

/* --------------------------------------------------------------------------
   Flat main-column section rhythm
   One hairline between sections, centered in 1.25rem + 1.25rem padding.
   No border under the last section. No rule under the heading on this stack.
   Cards, expansion panels, and the rail keep their own heading rule.
   -------------------------------------------------------------------------- */
.nucleus-detail-shell .nucleus-detail-shell__main :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) {
    border-top: 1px solid var(--mud-palette-lines-default, #F3F4F6);
    border-bottom: none;
}

/* Profile-card bands that are not DOM siblings (wrapper still in the tree). */
.nucleus-detail-shell .asset-overview-profile-card > * + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ),
.nucleus-detail-shell .asset-overview-profile-card > * + * :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ):first-child,
.nucleus-detail-shell .entity-v2-overview-main > .asset-overview-profile-card + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ),
.nucleus-detail-shell .assets-v2-main > .asset-overview-profile-card + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) {
    border-top: 1px solid var(--mud-palette-lines-default, #F3F4F6);
    border-bottom: none;
}

/* Sellable overview: each band is wrapped, so the sibling section rule never fires.
   Paint the hairline on the section inside the next band. No line on the first band. */
.nucleus-detail-shell .sellable-overview-profile {
    gap: 0 !important;
}

.nucleus-detail-shell .sellable-overview-profile .section-gap {
    margin: 0;
}

.nucleus-detail-shell .sellable-overview-profile > .sellable-overview-band + .sellable-overview-band :is(
        .nucleus-definition-section,
        .entity-v2-detail-section
    ):first-child {
    border-top: 1px solid var(--mud-palette-lines-default, #F3F4F6);
    border-bottom: none;
}

.nucleus-detail-shell .sellable-overview-profile > .sellable-overview-band + .mud-alert.sellable-overview-band {
    border-top: 1px solid var(--mud-palette-lines-default, #F3F4F6);
    border-radius: 0;
    margin: 0;
    padding-top: 1.25rem;
    padding-bottom: 1.25rem;
    background: transparent;
}

.nucleus-detail-shell .nucleus-detail-shell__main :is(
        .nucleus-definition-section__divider
    ) {
    display: none;
}

.nucleus-detail-shell .nucleus-detail-shell__main :is(
        .nucleus-surface-card,
        .modern-card,
        .sd-dash-card,
        .mud-expand-panel,
        .mud-expansion-panel,
        .expansion-panel-card
    ) :is(
        .nucleus-definition-section__divider
    ),
.nucleus-detail-shell .nucleus-detail-side-panel :is(
        .nucleus-definition-section__divider
    ),
.nucleus-detail-rail-dashboard :is(
        .nucleus-definition-section__divider
    ),
.nucleus-detail-rail-card :is(
        .nucleus-definition-section__divider
    ) {
    display: block;
}

.nucleus-detail-shell .nucleus-detail-shell__main :is(
        .nucleus-surface-card,
        .modern-card,
        .sd-dash-card,
        .mud-expand-panel,
        .mud-expansion-panel,
        .expansion-panel-card
    ) :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ),
.nucleus-detail-shell .nucleus-detail-side-panel :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ),
.nucleus-detail-rail-dashboard :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) + :is(
        .nucleus-definition-section,
        .entity-v2-detail-section,
        .asset-detail-section
    ) {
    border-top: none;
}

/* Main-column field labels match the rail section titles (Maintenance, Warranty, Resilience).
   Section titles on the left stay text-primary. Values stay text-primary. */
.nucleus-detail-shell .nucleus-detail-shell__main .nucleus-definition-row__label,
.nucleus-detail-shell .nucleus-detail-shell__main .nucleus-definition-row__label,
.nucleus-detail-shell .nucleus-detail-shell__main .nucleus-definition-section .modern-field-label,
.nucleus-detail-shell .nucleus-detail-shell__main .nucleus-definition-section .modern-field-label,
.nucleus-detail-shell .nucleus-detail-shell__main .overview-detail-section .modern-field-label,
.nucleus-detail-shell .nucleus-detail-shell__main .property-details-section .modern-field-label,
.nucleus-detail-shell .nucleus-detail-shell__main .detail-section-field-grid .modern-field-label,
.nucleus-detail-shell .nucleus-detail-shell__main .assets-v2-main .detail-section-field-grid .modern-field-label,
.nucleus-detail-shell .nucleus-detail-shell__main .entity-v2-overview-main .detail-section-field-grid .modern-field-label {
    color: var(--nx-text-secondary, #687C8F) !important;
    font-size: var(--nx-font-micro, 11px);
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

/* Stacked cards / ModernCard inside overview keep their own chrome; tighten gap */
.nucleus-detail-shell .assets-v2-main > .section-gap,
.nucleus-detail-shell .entity-v2-overview-main > .section-gap,
.nucleus-detail-shell .assets-v2-main .modern-card.section-gap,
.nucleus-detail-shell .entity-v2-overview-main .modern-card.section-gap {
    margin-bottom: 0;
}

/* Rail dashboard: flat sections with hairline dividers (Service Desk parity) */
.nucleus-detail-rail-dashboard {
    display: flex;
    flex-direction: column;
    gap: 0;
    /* Same inset from the vertical divider, and the same gap under the tab rule, as the main column. */
    padding: var(--nucleus-detail-below-tabs-gap, 0.75rem) var(--nucleus-detail-column-edge-inset, 0.75rem) 0.75rem var(--nucleus-detail-column-edge-inset, 0.75rem);
    border: none;
    background: transparent;
    box-shadow: none;
    border-radius: 0;
}

/* Pages nest a second dashboard inside the edge-rail dashboard. Drop the inner inset so titles share the Details left edge. */
.nucleus-detail-rail-dashboard .nucleus-detail-rail-dashboard {
    padding: 0;
}

/* When rail has no tab strip, first section title baseline ≈ main tab labels */
.nucleus-detail-rail-card:not(:has(.nucleus-detail-rail-card__tabs .mud-tabs, .nucleus-detail-rail-card__tabs .nucleus-detail-simple-mud-tabs, .nucleus-detail-rail-card__tabs [role="tablist"])) .nucleus-detail-rail-dashboard {
    padding-top: 0.35rem;
}

.nucleus-detail-rail-dashboard .sd-dash-card,
.nucleus-detail-rail-dashboard .nucleus-surface-card.sd-dash-card,
.nucleus-detail-rail-dashboard .nucleus-surface-card {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    border: none !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    /* Match main tabbar / rail vertical divider hairline */
    border-bottom: 1px solid var(--nucleus-detail-side-card-border, var(--nx-border-subtle, var(--mud-palette-lines-default))) !important;
    padding: 0.875rem 0;
    margin: 0;
    min-width: 0;
    overflow: hidden;
    width: 100%;
}

/*
 * Drop trailing divider on the last section only.
 * Do NOT use `> :last-child .sd-dash-card` — EntityDetailEdgeRail wraps content in an outer
 * .nucleus-detail-rail-dashboard, and that broad selector stripped every nested section border.
 */
.nucleus-detail-rail-dashboard > .sd-dash-card:last-child,
.nucleus-detail-rail-dashboard > .nucleus-surface-card:last-child,
.nucleus-detail-rail-dashboard > .nucleus-surface-card.sd-dash-card:last-child {
    border-bottom: none !important;
}

/* Single-card wrappers as the last direct child (status reports / active work / etc.) */
.nucleus-detail-rail-dashboard > *:last-child:not(.nucleus-detail-rail-dashboard) > .sd-dash-card:only-child,
.nucleus-detail-rail-dashboard > *:last-child:not(.nucleus-detail-rail-dashboard) > .nucleus-surface-card:only-child {
    border-bottom: none !important;
}

body.theme-dark .nucleus-detail-rail-dashboard .sd-dash-card,
body.theme-dark .nucleus-detail-rail-dashboard .nucleus-surface-card {
    box-shadow: none !important;
}

/* Section titles — caps, secondary (readable; empty muted cards stay disabled) */
.nucleus-detail-rail-dashboard .sd-dash-card__title,
.nucleus-detail-rail-dashboard .sd-dash-section__title {
    font-size: var(--nx-font-micro, 10px) !important;
    font-weight: 600 !important;
    line-height: 1.35;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary) !important;
}

.nucleus-detail-rail-dashboard .sd-dash-card__head {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    min-height: 1.5rem;
    margin-bottom: 0.125rem;
}

.nucleus-detail-rail-dashboard .sd-dash-card__body {
    min-width: 0;
}

/* Shared label/value density when SD field-row pattern is reused */
.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row__label,
.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row--close > .service-desk-sidebar-field-row__label,
.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row--spread > .service-desk-sidebar-field-row__label {
    font-size: var(--nx-font-meta, 11px);
    font-weight: 500;
    color: var(--mud-palette-text-secondary);
}

.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row--close > .service-desk-sidebar-field-row__value,
.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row--close > .service-desk-sidebar-field-row__value-stack,
.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row--spread > .service-desk-sidebar-field-row__value {
    font-size: var(--nx-font-secondary, 13px);
    font-weight: 500;
    color: var(--mud-palette-text-primary);
}

.nucleus-detail-rail-dashboard .service-desk-sidebar-field-row--spread {
    min-height: 1.625rem;
}

.nucleus-detail-rail-dashboard .service-desk-rail-action-link,
.nucleus-detail-rail-dashboard a.service-desk-rail-action-link {
    font-weight: 500;
    text-decoration: none;
}

.nucleus-detail-rail-dashboard .service-desk-rail-action-link:hover,
.nucleus-detail-rail-dashboard a.service-desk-rail-action-link:hover {
    text-decoration: underline;
}

/* Mobile lifecycle bar */
.nucleus-detail-mobile-lifecycle-bar {
    position: sticky;
    bottom: 0;
    z-index: 12;
    display: block;
    padding: 0.5rem 0.75rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-surface) 94%, transparent);
    backdrop-filter: blur(8px);
    box-shadow: none;
}

.nucleus-detail-mobile-lifecycle-bar .nucleus-detail-header-workflow-actions {
    justify-content: stretch;
    gap: 0.375rem;
    flex-wrap: nowrap;
    max-height: none;
}

@media (max-width: 959px) {
    .entity-view-layout .module-content-region:has(.nucleus-detail-shell) .workspace-main-body {
        padding: var(--nx-space-2, 0.5rem) var(--nx-page-gutter-x, 24px) var(--nx-page-gutter-y-bottom, 48px) var(--nx-page-gutter-x, 24px) !important;
    }

    .nucleus-detail-shell {
        display: flex;
        flex-direction: column;
        overflow: auto;
        height: auto;
        min-height: 0;
    }

    .nucleus-detail-shell__main-tabs,
    .nucleus-detail-shell .nucleus-detail-shell__main,
    .nucleus-detail-shell .service-desk-main,
    .nucleus-detail-shell .account-detail-main,
    .nucleus-detail-shell .contact-detail-main,
    .nucleus-detail-shell .project-detail-main,
    .nucleus-detail-shell .opportunity-detail-main,
    .nucleus-detail-shell .contract-detail-main,
    .nucleus-detail-shell .template-detail-main,
    .nucleus-detail-shell .catalogue-detail-main,
    .nucleus-detail-shell .order-detail-main,
    .nucleus-detail-shell .governance-risk-detail-main,
    .nucleus-detail-shell .governance-policy-detail-main,
    .nucleus-detail-shell .governance-control-detail-main,
    .nucleus-detail-shell .governance-standard-detail-main,
    .nucleus-detail-rail-card {
        grid-column: auto;
        grid-row: auto;
        width: 100%;
    }

    .nucleus-detail-rail-card {
        height: auto;
        transform: none;
        border: 1px solid var(--nucleus-detail-side-card-border, var(--nx-border-subtle, var(--mud-palette-lines-default)));
        border-radius: var(--nucleus-detail-side-card-radius, var(--nx-radius-surface, 8px));
    }

    .nucleus-detail-rail-card::before {
        display: none;
    }

    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .module-header-section {
        display: block;
    }

    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-top-row {
        display: flex !important;
        flex-direction: column;
        gap: 0.75rem !important;
    }

    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column {
        grid-column: auto;
        width: 100%;
    }
}

@media (max-width: 599px) {
    .entity-view-layout:has(.nucleus-detail-shell) .entity-view-header-right-column .nucleus-detail-header-workflow-actions {
        display: none;
    }

    .entity-view-layout:has(.nucleus-detail-shell) .module-content-region {
        padding-bottom: 4.5rem;
    }
}

/* Dual-class alias: legacy module layout roots still match shell when co-emitted */
.service-desk-detail-layout.nucleus-detail-shell,
.account-detail-layout.nucleus-detail-shell,
.contact-detail-layout.nucleus-detail-shell,
.people-detail-layout.nucleus-detail-shell,
.department-detail-layout.nucleus-detail-shell,
.location-detail-layout.nucleus-detail-shell,
.project-detail-layout.nucleus-detail-shell,
.opportunity-detail-layout.nucleus-detail-shell,
.capability-workspace-detail-layout.nucleus-detail-shell,
.business-flow-workspace-detail-layout.nucleus-detail-shell,
.contract-detail-layout.nucleus-detail-shell,
.template-detail-layout.nucleus-detail-shell,
.catalogue-detail-layout.nucleus-detail-shell,
.order-detail-layout.nucleus-detail-shell,
.governance-risk-detail-layout.nucleus-detail-shell,
.governance-policy-detail-layout.nucleus-detail-shell,
.governance-control-detail-layout.nucleus-detail-shell,
.governance-standard-detail-layout.nucleus-detail-shell {
    /* shell rules already apply via .nucleus-detail-shell */
}

/* People employee record: full-width main column; definition rows stay packed */
.people-detail-page .people-detail-body {
    width: 100%;
    max-width: none;
}

@media (min-width: 960px) {
    .people-detail-page .people-detail-overview__pair {
        display: grid;
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 2.5rem;
        align-items: start;
    }
}

.people-detail-page .people-detail-fields .nucleus-definition-row {
    justify-content: flex-start;
}

.people-detail-page .people-detail-fields .nucleus-definition-row__label-wrap {
    flex: 0 0 auto;
    max-width: none;
}

.people-detail-page .people-detail-fields .nucleus-definition-row__value-wrap {
    flex: 1 1 auto;
    justify-content: flex-start;
    text-align: left;
}

.people-detail-page .people-membership-pair {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0.5rem;
    align-items: start;
}

@media (min-width: 960px) {
    .people-detail-page .people-membership-pair {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        column-gap: 1.5rem;
    }
}

.people-detail-page .people-membership-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.people-detail-page .people-membership-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border-radius: 2px;
    background: var(--nx-tint-selected);
    color: inherit;
    text-decoration: none;
}

a.people-membership-row:hover,
.people-detail-page .people-membership-row:hover {
    background: var(--nx-tint-selected-strong);
}

.people-detail-page .people-membership-row__main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.people-detail-page .people-membership-row__title {
    font-weight: 600;
    line-height: 1.3;
}

.people-detail-page .people-membership-row__meta {
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.3;
}

.people-detail-page .people-membership-row__aside {
    display: grid;
    grid-template-columns: 5rem 6.75rem 2.75rem 1rem;
    align-items: center;
    justify-items: end;
    column-gap: 0.5rem;
    flex-shrink: 0;
    color: var(--mud-palette-text-secondary);
    font-size: 0.8125rem;
    font-weight: 400;
    white-space: nowrap;
}

.people-detail-page .people-membership-row__state {
    font-size: 0.75rem;
    font-weight: 400;
}

.people-detail-page .people-membership-row__chevron {
    color: var(--mud-palette-text-secondary);
}

.people-detail-page .people-membership-row__remove {
    flex-shrink: 0;
    min-width: 0;
    padding-inline: 0.25rem;
}

.people-detail-page .people-membership-empty {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 0.75rem;
    border: 1px dashed var(--mud-palette-lines-default, #e0e0e0);
    border-radius: var(--nucleus-surface-radius, 4px);
    color: var(--mud-palette-text-secondary);
    font-size: 0.875rem;
}

.people-detail-page .people-membership-empty__help {
    font-size: 0.75rem;
}

.people-access-rail-card .people-access-status {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

.people-access-rail-card .nucleus-definition-row {
    justify-content: flex-start;
    gap: 0.75rem;
}

.people-access-rail-card .nucleus-definition-row__label-wrap {
    flex: 0 0 auto;
    width: auto;
    max-width: none;
}

.people-access-rail-card .nucleus-definition-row__value-wrap,
.people-access-rail-card .nucleus-definition-row__value-wrap,
.people-access-rail-card .nucleus-definition-row__value--custom {
    flex: 0 1 auto;
    margin-left: 0;
    justify-content: flex-start;
    text-align: left;
}

.people-access-rail-card .people-access-roles {
    margin-top: 0.5rem;
}

.people-access-rail-card .people-access-roles .mud-chip {
    border-radius: var(--nucleus-surface-radius, 4px);
}

.people-detail-page .people-section-rule {
    border-top: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    margin-top: 1rem;
    padding-top: 0.75rem;
}

.people-access-rail-card .people-access-actions {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 0.375rem;
    margin-top: 0.75rem;
}

.people-access-rail-card .people-access-actions .mud-button-root {
    justify-content: center;
    min-width: 0;
    padding-inline: 0.5rem;
    border: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    border-radius: var(--nucleus-surface-radius, 4px);
}

.people-access-rail-card .people-access-more {
    margin-top: 0.375rem;
}

.people-access-rail-card .people-access-more .mud-menu,
.people-access-rail-card .people-access-more .mud-menu-activator {
    display: flex;
    width: 100%;
}

.people-access-rail-card .people-access-more .mud-button-root {
    justify-content: center;
    border: 1px solid var(--mud-palette-lines-default, #e0e0e0);
    border-radius: var(--nucleus-surface-radius, 4px);
}

/* --------------------------------------------------------------------------
   Detail edge-rail standard (full page)
   Grid column flush to the workspace edge (no page-gutter strip, no elevation).
   Width ~⅓ body. Ask AI overlays fill the rail cell, not the page.
   Canonical: nucleus-detail-layout--edge-rail. Asset aliases kept for cutover.
   -------------------------------------------------------------------------- */

/* Host + overlay chrome (shared by EntityDetailEdgeRail) */
.nucleus-detail-edge-rail-host,
.asset-detail-rail-host {
    position: relative;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
}

.nucleus-detail-edge-rail-host > .nucleus-detail-side-panel,
.asset-detail-rail-host > .nucleus-detail-side-panel {
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
}

/* Legacy absolute overlay (full host) — kept for any residual hosts */
.nucleus-detail-edge-rail-overlay:not(.nucleus-detail-edge-rail-overlay--in-body),
.asset-detail-rail-ask-ai-overlay {
    position: absolute;
    inset: 0;
    z-index: 5;
    display: flex;
    flex-direction: column;
    min-height: 0;
    background: var(--nx-surface-card, var(--mud-palette-surface));
}

/* Peer-tab panels: fill the side-panel body under the shared Details | Ask AI | … strip */
.nucleus-detail-edge-rail-overlay.nucleus-detail-edge-rail-overlay--in-body {
    position: relative;
    inset: auto;
    z-index: auto;
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    height: 100%;
    width: 100%;
    background: transparent;
}

.nucleus-detail-edge-rail-overlay__header,
.asset-detail-rail-ask-ai-overlay__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    flex-shrink: 0;
    box-sizing: border-box;
    /* Same horizontal band as main tabs + rail toolbar */
    min-height: var(--nucleus-detail-chrome-band-min-height, 2.75rem);
    padding: var(--nucleus-detail-chrome-band-pad-top, 0.35rem) 0.75rem 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.nucleus-detail-edge-rail-overlay__title,
.asset-detail-rail-ask-ai-overlay__title {
    font-size: var(--nx-font-meta, 11px);
    font-weight: 600;
    line-height: 1.35;
    color: var(--mud-palette-text-primary);
}

.nucleus-detail-edge-rail-overlay__body,
.asset-detail-rail-ask-ai-overlay__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Overlay hosts (Ask AI / Research / Time) must fill the body so their inner
   scroll regions get a height cap — content is nested, not a direct rail child. */
.nucleus-detail-edge-rail-overlay__body > *,
.asset-detail-rail-ask-ai-overlay__body > * {
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
    height: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Side panel stays visible — tabs are peer chrome; body swaps Details vs overlay content.
   Overlay panels own their scroll (Ask AI / Research / Time). */
.nucleus-detail-edge-rail-host--overlay-open .nucleus-detail-rail-card__body {
    overflow: hidden;
}

/* Legacy ask-ai-open host (pre–in-body) still hides the panel under a full-bleed overlay. */
.asset-detail-rail-host--ask-ai-open > .nucleus-detail-side-panel {
    visibility: hidden;
    pointer-events: none;
}

@media (min-width: 960px) {
    .entity-view-layout.nucleus-detail-layout--edge-rail,
    .entity-view-layout.asset-detail-layout--edge-rail {
        /* Main 2/3, rail 1/3. Same token drives the header action band. */
        --nucleus-detail-edge-rail-width: 33.333%;
        --nucleus-detail-side-width: var(--nucleus-detail-edge-rail-width);
        /* Shared horizontal band: main tabs ↔ rail toolbar / title / overlay header */
        --nucleus-detail-chrome-band-min-height: 2.75rem;
        --nucleus-detail-chrome-band-pad-top: 0.35rem;
        /* Same inset as the left page gutter, on both sides of the vertical divider. */
        --nucleus-detail-column-edge-inset: var(--nx-page-gutter-x, 24px);
        /* Same distance from the tab rule down to the first content on both sides. */
        --nucleus-detail-below-tabs-gap: 0.75rem;
        /* Rail top is relative to the detail shell (below full-width header, aligned with tabs). */
        --nucleus-detail-edge-rail-top: 0px;
        /* Temporary Asset aliases */
        --asset-detail-edge-rail-width: var(--nucleus-detail-edge-rail-width);
        --asset-detail-edge-rail-top: var(--nucleus-detail-edge-rail-top);
    }

    /* Tighten tab strip → Overview content gap (asset edge-rail only) */
    .entity-view-layout.asset-detail-layout--edge-rail
        .capability-workspace-main > .capability-workspace-tab-content,
    .entity-view-layout.asset-detail-layout--edge-rail
        .capability-workspace-main > .entity-view-body {
        padding-top: 0.5rem;
    }

    /*
     * Grid containing block for the rail column (below the full-width header).
     * Header spans the workspace; the shell is a two-column grid with no gap
     * so the tab hairline and the rail hairline meet.
     */
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-main-column,
    .entity-view-layout.asset-detail-layout--edge-rail .module-main-column {
        position: relative;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region,
    .entity-view-layout.asset-detail-layout--edge-rail .module-content-region {
        position: static !important;
        overflow: visible !important;
        flex: 1 1 0;
        min-height: 0;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region .workspace-main-body,
    .entity-view-layout.asset-detail-layout--edge-rail .module-content-region .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-host,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-detail-keyboard-host,
    .entity-view-layout.nucleus-detail-layout--edge-rail .capability-workspace-detail-host {
        position: static !important;
        transform: none !important;
        filter: none !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .module-header-section,
    .entity-view-layout.asset-detail-layout--edge-rail .module-header-section {
        grid-template-columns: minmax(0, 1fr) !important;
        padding-right: var(--nx-page-gutter-x, 24px) !important;
        padding-left: var(--nx-page-gutter-x, 24px) !important;
        border-bottom: none !important;
        box-shadow: none !important;
    }

    /*
     * Title | HeaderActions — right column width matches the edge-rail so
     * domain commands sit top-right above the inspector (never mid-title).
     */
    .entity-view-layout.nucleus-detail-layout--edge-rail .entity-view-header-top-row,
    .entity-view-layout.asset-detail-layout--edge-rail .entity-view-header-top-row {
        display: grid !important;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
        column-gap: 0;
        row-gap: 0.5rem;
        align-items: start;
        width: 100%;
        flex-wrap: nowrap;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .entity-view-header-left,
    .entity-view-layout.asset-detail-layout--edge-rail .entity-view-header-left {
        min-width: 0;
        padding-right: var(--nucleus-detail-gap, 1rem);
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .entity-view-header-right-column,
    .entity-view-layout.asset-detail-layout--edge-rail .entity-view-header-right-column {
        display: flex !important;
        width: 100%;
        max-width: none;
        min-width: 0;
        box-sizing: border-box;
        align-items: center !important;
        justify-content: stretch;
        padding-inline: 0.75rem;
        grid-column: unset;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .entity-view-header-right-column .home-quick-actions,
    .entity-view-layout.asset-detail-layout--edge-rail .entity-view-header-right-column .home-quick-actions {
        width: auto;
        max-width: none;
        margin-left: auto;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
    }

    /* Record actions size to their labels and sit at the end of the band. */
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-header-workflow-actions,
    .entity-view-layout.asset-detail-layout--edge-rail .service-desk-header-workflow-actions {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: flex-end;
        align-items: center;
        width: auto;
        max-height: none;
        margin-left: auto;
        gap: 8px;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions > *,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions > *,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-header-workflow-actions > *,
    .entity-view-layout.asset-detail-layout--edge-rail .service-desk-header-workflow-actions > *,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions > .mud-menu,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions > .mud-menu,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-header-workflow-actions > .mud-menu,
    .entity-view-layout.asset-detail-layout--edge-rail .service-desk-header-workflow-actions > .mud-menu,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions > .mud-menu .mud-menu-activator,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions > .mud-menu .mud-menu-activator,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-header-workflow-actions > .mud-menu .mud-menu-activator,
    .entity-view-layout.asset-detail-layout--edge-rail .service-desk-header-workflow-actions > .mud-menu .mud-menu-activator {
        flex: 0 0 auto !important;
        width: auto !important;
        min-width: 0;
        max-width: none;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow {
        display: flex;
        align-items: stretch;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > *,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > * {
        flex: 0 1 auto;
        width: auto;
        min-width: 0;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu {
        flex: 0 0 var(--nx-control-height-standard, 36px);
        width: var(--nx-control-height-standard, 36px);
        min-width: var(--nx-control-height-standard, 36px);
        max-width: var(--nx-control-height-standard, 36px);
        align-self: stretch;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu .mud-menu-activator,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu .mud-menu-activator,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu .mud-button-root,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-header-workflow-actions--compact-overflow > .mud-menu .mud-button-root {
        width: 100%;
        height: 100%;
        min-height: var(--nx-control-height-standard, 36px);
        min-width: 0;
        padding: 0 !important;
    }

    /*
     * Kill the standard L/R page gutter on the right. Domain detail CSS (SD / Capability / etc.)
     * loads after this file and sets padding: … 1.25rem … !important — beat it with equal or
     * higher specificity so the rail can sit flush to the column edge.
     */
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region .workspace-main-body,
    .entity-view-layout.asset-detail-layout--edge-rail .module-content-region .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.nucleus-detail-shell) .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.service-desk-detail-layout) .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.capability-workspace-detail-layout) .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.account-detail-layout) .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.contact-detail-layout) .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.project-detail-layout) .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .module-content-region:has(.contract-detail-layout) .workspace-main-body,
    .entity-view-layout.asset-detail-layout--edge-rail .module-content-region:has(.nucleus-detail-shell) .workspace-main-body,
    .entity-view-layout.asset-detail-layout--edge-rail .module-content-region:has(.capability-workspace-detail-layout) .workspace-main-body {
        padding-right: 0 !important;
        padding-left: var(--nx-page-gutter-x, 24px) !important;
        padding-bottom: 0 !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel,
    .entity-view-layout.nucleus-detail-layout--edge-rail .capability-workspace-detail-layout.nucleus-detail-split-layout--with-side-panel,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-detail-layout.nucleus-detail-split-layout--with-side-panel,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel,
    .entity-view-layout.asset-detail-layout--edge-rail .capability-workspace-detail-layout.nucleus-detail-split-layout--with-side-panel {
        display: grid !important;
        grid-template-columns: minmax(0, 2fr) minmax(0, 1fr) !important;
        grid-template-rows: auto minmax(0, 1fr) !important;
        padding-right: 0 !important;
        column-gap: 0 !important;
        position: relative !important;
        min-height: 0;
        min-width: 0;
        overflow: hidden !important;
        transform: none !important;
        filter: none !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-shell__main-tabs,
    .entity-view-layout.nucleus-detail-layout--edge-rail .capability-workspace-detail-layout__main-tabs,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-shell__main-tabs,
    .entity-view-layout.asset-detail-layout--edge-rail .capability-workspace-detail-layout__main-tabs {
        grid-column: 1;
        grid-row: 1;
        width: 100%;
        max-width: 100%;
        min-width: 0;
    }

    /* Tab hairline stops the same distance short of the vertical divider as the rail rule starts after it. */
    .entity-view-layout:is(.nucleus-detail-layout--edge-rail, .asset-detail-layout--edge-rail) .nucleus-detail-shell__main-tabs .mud-tabs-tabbar {
        width: calc(100% - var(--nucleus-detail-column-edge-inset, 0.75rem)) !important;
        max-width: calc(100% - var(--nucleus-detail-column-edge-inset, 0.75rem)) !important;
        margin-right: var(--nucleus-detail-column-edge-inset, 0.75rem) !important;
        align-self: flex-start;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-shell__main,
    .entity-view-layout.nucleus-detail-layout--edge-rail .capability-workspace-main,
    .entity-view-layout.nucleus-detail-layout--edge-rail .service-desk-main,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-shell__main,
    .entity-view-layout.asset-detail-layout--edge-rail .capability-workspace-main {
        grid-column: 1;
        grid-row: 2;
        width: 100%;
        max-width: 100%;
        min-width: 0;
        min-height: 0;
    }

    /*
     * Structural column: same row band as the main tabs, full height of the shell.
     * Page surface, left hairline, no elevation. The header draws the top stroke.
     * transform:none stops Strategy translate from sliding the column out of the grid.
     */
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-split-layout__side-panel-host.nucleus-detail-edge-rail-card,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card.nucleus-detail-rail-card,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-split-layout__side-panel-host.asset-detail-edge-rail-card,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-split-layout__side-panel-host.asset-detail-edge-rail-card,
    .entity-view-layout.asset-detail-layout--edge-rail .asset-detail-edge-rail-card.nucleus-detail-rail-card,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-edge-rail-card.nucleus-detail-rail-card {
        position: relative !important;
        top: auto !important;
        right: auto !important;
        bottom: auto !important;
        left: auto !important;
        inset: auto !important;
        width: auto !important;
        height: 100% !important;
        max-height: none !important;
        margin: 0 !important;
        z-index: 2;
        grid-column: 2 !important;
        grid-row: 1 / -1 !important;
        min-width: 0;
        min-height: 0;
        border-radius: 0 !important;
        border-top-left-radius: 0 !important;
        border-top-right-radius: 0 !important;
        border-top: none !important;
        border-right: none !important;
        border-bottom: none !important;
        border-left: 1px solid var(--mud-palette-lines-default, var(--nucleus-detail-rail-card-border, var(--nx-border-subtle))) !important;
        background: transparent !important;
        box-shadow: none !important;
        transform: none !important;
        filter: none !important;
    }

    body.theme-dark .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-split-layout__side-panel-host.nucleus-detail-edge-rail-card,
    body.theme-dark .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card.nucleus-detail-rail-card,
    body.theme-dark .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-split-layout__side-panel-host.asset-detail-edge-rail-card,
    body.theme-dark .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-split-layout__side-panel-host.asset-detail-edge-rail-card,
    body.theme-dark .entity-view-layout.asset-detail-layout--edge-rail .asset-detail-edge-rail-card.nucleus-detail-rail-card,
    body.theme-dark .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-edge-rail-card.nucleus-detail-rail-card {
        background: transparent !important;
        border-left-color: var(--mud-palette-lines-default) !important;
        box-shadow: none !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card > .nucleus-detail-side-panel,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card .nucleus-detail-edge-rail-host,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card .asset-detail-rail-host,
    .entity-view-layout.asset-detail-layout--edge-rail .asset-detail-edge-rail-card > .nucleus-detail-side-panel,
    .entity-view-layout.asset-detail-layout--edge-rail .asset-detail-edge-rail-card .asset-detail-rail-host,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-edge-rail-card .nucleus-detail-edge-rail-host {
        height: 100%;
        min-height: 0;
        width: 100%;
    }

    /*
     * Edge-rail has no channel between the columns. Drop the stable gutter and the
     * extra 1rem inset; keep a thin thumb over a small content inset.
     */
    .entity-view-layout:is(.nucleus-detail-layout--edge-rail, .asset-detail-layout--edge-rail) :is(
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .capability-workspace-tab-content,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .nucleus-detail-shell__main > .entity-view-body,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .service-desk-tab-content,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .service-desk-main > .conversation-thread-panel,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .account-detail-main > .account-detail-tab-content,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contact-detail-main > .contact-detail-tab-content,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .project-detail-main > .project-detail-tab-content,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel .contract-detail-main > .contract-detail-tab-content,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto .opportunity-detail-main,
        .capability-workspace-detail-layout .capability-workspace-main > .capability-workspace-tab-content,
        .capability-workspace-detail-layout .capability-workspace-main > .entity-view-body,
        .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel.nucleus-detail-split-layout--main-scroll-auto > .nucleus-detail-split-layout__main-content
    ) {
        padding-right: var(--nucleus-detail-column-edge-inset, 0.75rem);
        scrollbar-gutter: auto;
        scrollbar-width: thin;
    }

    /* Overlay scrollbars + stable gutter read as a white strip on the rail’s right edge. */
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card .nucleus-detail-rail-card__body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card .service-desk-right-rail-card__body,
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card .capability-workspace-right-rail-card__body,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-edge-rail-card .nucleus-detail-rail-card__body,
    .entity-view-layout.asset-detail-layout--edge-rail .asset-detail-edge-rail-card .nucleus-detail-rail-card__body {
        scrollbar-gutter: auto;
    }

    /*
     * On-demand inspectors (Business Flow Story / Strategy): when the rail is closed,
     * do not reserve ~⅓ padding — that left an empty white column on Overview.
     */
    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.business-flow-workspace-detail-layout--rail-closed),
    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.strategy-detail-shell--rail-closed) {
        --nucleus-detail-edge-rail-width: 0px;
        --nucleus-detail-side-width: 0px;
        --asset-detail-edge-rail-width: 0px;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.business-flow-workspace-detail-layout--rail-closed) .module-header-section,
    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.strategy-detail-shell--rail-closed) .module-header-section {
        padding-right: var(--nx-page-gutter-x, 1.25rem) !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.business-flow-workspace-detail-layout--rail-closed) .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel,
    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.strategy-detail-shell--rail-closed) .nucleus-detail-shell.nucleus-detail-split-layout--with-side-panel {
        padding-right: 0 !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.business-flow-workspace-detail-layout--rail-closed) .module-content-region .workspace-main-body,
    .entity-view-layout.nucleus-detail-layout--edge-rail:has(.strategy-detail-shell--rail-closed) .module-content-region .workspace-main-body {
        padding-right: var(--nx-page-gutter-x, 1.25rem) !important;
    }

    /* Story tab, rail closed: inline step inspector should sit near the viewport edge. */
    .bf-detail-page-shell--story .entity-view-layout.nucleus-detail-layout--edge-rail:has(.business-flow-workspace-detail-layout--rail-closed) .module-content-region .workspace-main-body {
        padding-right: 0.5rem !important;
    }

    .entity-view-layout.nucleus-detail-layout--edge-rail .business-flow-workspace-detail-layout--rail-closed .nucleus-detail-edge-rail-card,
    .entity-view-layout.nucleus-detail-layout--edge-rail .strategy-detail-shell--rail-closed .nucleus-detail-edge-rail-card {
        width: 0 !important;
        min-width: 0 !important;
        border: none !important;
        pointer-events: none !important;
    }
}

@media (max-width: 959px) {
    .entity-view-layout.nucleus-detail-layout--edge-rail .nucleus-detail-edge-rail-card.nucleus-detail-rail-card,
    .entity-view-layout.nucleus-detail-layout--edge-rail .asset-detail-edge-rail-card.nucleus-detail-rail-card,
    .entity-view-layout.asset-detail-layout--edge-rail .asset-detail-edge-rail-card.nucleus-detail-rail-card,
    .entity-view-layout.asset-detail-layout--edge-rail .nucleus-detail-edge-rail-card.nucleus-detail-rail-card {
        position: relative;
        top: auto;
        right: auto;
        bottom: auto;
        width: 100%;
        height: auto;
        /* Stacked under the body: top rule separates the column; no elevation */
        border-top: 1px solid var(--nucleus-detail-rail-card-border, var(--mud-palette-lines-default));
        box-shadow: none;
    }
}

/* Keyboard focus. Link colour comes from Mud Color.Info. */
.nucleus-detail-shell a:focus-visible,
.nucleus-detail-shell button:focus-visible,
.nucleus-detail-shell [tabindex]:focus-visible,
.nucleus-detail-rail-dashboard a:focus-visible,
.nucleus-detail-rail-dashboard button:focus-visible,
.nucleus-detail-rail-dashboard [tabindex]:focus-visible {
    outline: 2px solid var(--nx-border-focus, #315F86);
    outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Supplier workspace — rail attention (main column uses the shared section rhythm)
   -------------------------------------------------------------------------- */
.nucleus-detail-shell.supplier-workspace-layout .supplier-overview-notes .nucleus-definition-row {
    max-width: 100%;
}

.supplier-rail-details-stack {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    min-height: 100%;
}

.supplier-rail-attention {
    margin-top: auto;
    padding: 0.65rem 0.75rem;
    border-radius: var(--nx-radius-surface, 4px);
    border: 1px solid color-mix(in srgb, var(--mud-palette-warning) 35%, var(--mud-palette-lines-default));
    background: color-mix(in srgb, var(--mud-palette-warning) 8%, var(--mud-palette-surface));
}

.supplier-rail-attention--error {
    border-color: color-mix(in srgb, var(--mud-palette-error) 35%, var(--mud-palette-lines-default));
    background: color-mix(in srgb, var(--mud-palette-error) 7%, var(--mud-palette-surface));
}

.supplier-rail-attention__header {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    margin-bottom: 0.35rem;
}

.supplier-rail-attention__title {
    font-size: var(--nx-font-meta, 11px);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.supplier-rail-attention__list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: var(--nx-font-secondary, 13px);
    line-height: 1.4;
    color: var(--mud-palette-text-primary);
}

.supplier-rail-attention__list li + li {
    margin-top: 0.25rem;
}

.supplier-rail-next-steps {
    padding: 0.65rem 0.75rem;
    border-radius: var(--nx-radius-surface, 4px);
    border: 1px solid var(--mud-palette-lines-default, #E5E7EB);
    background: var(--mud-palette-surface);
}

.supplier-rail-next-steps__header {
    margin-bottom: 0.2rem;
}

.supplier-rail-next-steps__title {
    font-size: var(--nx-font-meta, 11px);
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
}

.supplier-rail-next-steps__actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.4rem;
}

.twin-inspect-host {
    min-width: 0;
    outline: none;
}

.twin-inspect-header {
    padding: 0 0 0.75rem;
    margin-bottom: 0.75rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.twin-inspect-header__chrome {
    display: flex;
    align-items: center;
    gap: 0.15rem;
    margin-bottom: 0.35rem;
    min-height: 2rem;
}

.twin-inspect-header__chrome .mud-icon-button {
    color: var(--mud-palette-text-secondary);
}

.twin-inspect-header__type {
    font-size: var(--nx-font-micro, 10px);
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--mud-palette-text-secondary);
    line-height: 1;
    padding-left: 0.15rem;
}

.twin-inspect-header__title {
    margin: 0;
    font-size: var(--nx-font-section, 1.125rem);
    font-weight: 700;
    line-height: 1.3;
    color: var(--nx-text-heading, var(--mud-palette-text-primary));
    word-break: break-word;
}

.twin-inspect-header__role {
    margin: 0.35rem 0 0;
    font-size: var(--nx-font-meta, 11px);
    color: var(--mud-palette-text-secondary);
    line-height: 1.35;
}

/* Main column of every detail shell shares one left edge with the title and tabs. */
.nucleus-detail-shell .nucleus-detail-shell__main,
.nucleus-detail-shell .service-desk-main,
.nucleus-detail-shell .account-detail-main,
.nucleus-detail-shell .contact-detail-main,
.nucleus-detail-shell .project-detail-main,
.nucleus-detail-shell .opportunity-detail-main,
.nucleus-detail-shell .contract-detail-main,
.nucleus-detail-shell .template-detail-main,
.nucleus-detail-shell .catalogue-detail-main,
.nucleus-detail-shell .order-detail-main,
.nucleus-detail-shell .governance-risk-detail-main,
.nucleus-detail-shell .governance-policy-detail-main,
.nucleus-detail-shell .governance-control-detail-main,
.nucleus-detail-shell .governance-standard-detail-main {
    text-align: left;
    padding-left: 0;
}

.nucleus-detail-shell .nucleus-detail-shell__main .mud-tab-panel,
.nucleus-detail-shell .service-desk-main .mud-tab-panel,
.nucleus-detail-shell .account-detail-main .mud-tab-panel,
.nucleus-detail-shell .contact-detail-main .mud-tab-panel,
.nucleus-detail-shell .project-detail-main .mud-tab-panel,
.nucleus-detail-shell .contract-detail-main .mud-tab-panel,
.nucleus-detail-shell .opportunity-detail-main .mud-tab-panel {
    padding-left: 0 !important;
    padding-right: 0 !important;
    text-align: left;
}

.service-desk-detail-layout .conversation-reply-panel--expanded .add-update-tabs,
.service-desk-detail-layout .conversation-thread-toolbar,
.service-desk-detail-layout .conversation-thread-scroll {
    padding-left: 0 !important;
    text-align: left;
}
