/* ==========================================================================
   Projects detail workspace
   Service Desk detail-shell parity with Projects-owned semantics.
   ========================================================================== */

.entity-view-layout .module-content-region:has(.project-detail-layout) .workspace-main-body {
    min-height: 100%;
    display: flex;
    flex-direction: column;
    padding: var(--project-content-top-inset, 0.125rem) 1.25rem 1.5rem !important;
}

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

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

.project-detail-layout {
    display: grid;
    grid-template-columns: minmax(0, var(--nucleus-detail-main-ratio, 65fr)) minmax(var(--nucleus-detail-side-width, 420px), var(--nucleus-detail-side-ratio, 35fr));
    grid-template-rows: auto minmax(0, 1fr);
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    column-gap: var(--nucleus-detail-gap, 1rem);
    row-gap: 0.75rem;
}

.project-detail-layout__main-tabs {
    grid-column: 1;
    grid-row: 1;
    display: flex;
    align-items: flex-end;
    width: 100%;
    min-width: 0;
    min-height: 2.25rem;
}

.project-detail-layout .project-detail-main {
    grid-column: 1;
    grid-row: 2;
    display: flex;
    flex: 1 1 0;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.project-detail-layout .project-detail-main > .project-detail-tab-content {
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    padding: 0.25rem 0.125rem 1rem 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.project-detail-layout) {
    --project-content-top-inset: 0.125rem;
    --project-header-chrome-rhythm: 0.375rem;
    --project-title-chip-gap: 0.25rem;
    --project-header-section-padding-bottom: 0.25rem;
}

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

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

.project-detail-right-rail-card {
    grid-column: 2;
    grid-row: 1 / -1;
    display: flex;
    align-self: stretch;
    flex-direction: column;
    min-width: 0;
    min-height: 0;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
    overflow: hidden;
    border: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--nucleus-surface-bg, var(--mud-palette-surface));
    box-shadow: var(--nucleus-surface-shadow, 0 1px 2px color-mix(in srgb, var(--mud-palette-text-primary) 4%, transparent));
}

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

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

.project-detail-right-rail-card__tabs .project-context-panel-tab-group {
    width: 100%;
}

.project-detail-right-rail-card__body.nucleus-context-panel-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
}

.project-context-rail {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.75rem;
}

.project-context-rail .nucleus-surface-card {
    width: 100%;
}

/* Header geometry mirrors the detail split so actions align over the rail. */
.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.project-detail-layout) .module-header-section {
    display: grid;
    grid-template-columns: minmax(0, var(--nucleus-detail-main-ratio, 65fr)) minmax(var(--nucleus-detail-side-width, 420px), var(--nucleus-detail-side-ratio, 35fr));
    gap: var(--project-header-chrome-rhythm, 0.375rem) var(--nucleus-detail-gap, 1rem) !important;
    padding: 1rem 1.25rem var(--project-header-section-padding-bottom, 0.25rem) !important;
    overflow: visible;
    z-index: 0 !important;
}

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

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

.entity-view-layout--content-anchored-tabs.entity-view-layout:has(.project-detail-layout) .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, 420px), var(--nucleus-detail-side-ratio, 35fr));
    gap: var(--nucleus-detail-gap, 1rem) !important;
    align-items: start;
    width: 100%;
}

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

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

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

.entity-view-layout:has(.project-detail-layout) .home-quick-actions .project-header-workflow-actions {
    width: 100%;
    padding-block: 0.125rem;
}

/* Workflow equal-width / height owned by module.detail-shell.css (.nucleus-detail-header-workflow-actions) */

.entity-view-layout:has(.project-detail-layout) .entity-view-header-back-row {
    display: none !important;
}

.entity-view-layout:has(.project-detail-layout) .project-title-back-btn.mud-icon-button {
    width: 2rem;
    height: 2rem;
    min-width: 2rem !important;
    padding: 0 !important;
    flex-shrink: 0;
    border: 1px solid var(--mud-palette-lines-default) !important;
    border-radius: 50% !important;
    background: var(--mud-palette-surface) !important;
    color: var(--mud-palette-text-secondary) !important;
}

.entity-view-layout:has(.project-detail-layout) .project-title-back-btn.mud-icon-button:hover {
    background: var(--mud-palette-action-default-hover) !important;
    color: var(--mud-palette-text-primary) !important;
}

.entity-view-layout:has(.project-detail-layout) .entity-view-header-title-row {
    align-items: center;
    gap: 0.625rem;
}

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

.entity-view-layout:has(.project-detail-layout) .entity-view-header-with-border,
.entity-view-layout:has(.project-detail-layout) .module-header-section.has-scrollable-content {
    padding-bottom: var(--project-title-chip-gap, 0.25rem) !important;
    border-bottom: 0 !important;
    box-shadow: none !important;
}

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

.entity-view-layout:has(.project-detail-layout) .entity-view-header-record-row {
    margin-top: 0 !important;
}

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

.project-header-context {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.375rem;
}

.project-header-context__customer {
    color: var(--mud-palette-text-secondary);
}

/* Shared Projects tab surfaces. */
.project-kpi-strip {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.project-kpi-card {
    min-height: 5.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--nucleus-surface-bg, var(--mud-palette-surface));
    box-shadow: var(--nucleus-surface-shadow, 0 1px 2px color-mix(in srgb, var(--mud-palette-text-primary) 4%, transparent));
}

.project-kpi-card__label {
    margin-bottom: 0.375rem;
    color: var(--mud-palette-text-secondary);
    font-size: 0.75rem;
    line-height: 1.25;
}

.project-kpi-card__value {
    color: var(--mud-palette-text-primary);
    font-size: 1.25rem;
    font-weight: 650;
    line-height: 1.2;
}

.project-overview-grid,
.project-financial-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
}

.project-overview-grid__wide {
    grid-column: 1 / -1;
}

.project-overview-card {
    align-self: stretch;
    overflow: hidden;
}

.project-overview-card > .nucleus-surface-card__head {
    min-height: 2.75rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    background: color-mix(in srgb, var(--mud-palette-background-grey) 45%, var(--mud-palette-surface));
}

.project-overview-card > .nucleus-surface-card__body {
    padding: 0.75rem;
}

.project-stage-progress-row {
    padding: 0.25rem 0 0.625rem;
}

.project-stage-progress-row + .project-stage-progress-row {
    padding-top: 0.625rem;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.project-stage-progress-row:last-child {
    padding-bottom: 0;
}

.project-milestone-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.75rem;
    align-items: center;
    min-height: 2.5rem;
    padding: 0.375rem 0;
}

.project-milestone-row + .project-milestone-row {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.project-status-update__meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.625rem;
}

.project-status-update__summary {
    line-height: 1.5;
}

.project-status-update__next {
    padding-top: 0.625rem;
    margin-top: 0.625rem;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.project-rail-delivery-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding-top: 0.75rem;
    margin-top: 0.75rem;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.project-rail-delivery-actions .mud-button-root {
    flex: 1 1 8rem;
}

.project-embed-tab {
    min-height: 32rem;
}

.project-embed-tab > .embedded-inbox-panel {
    flex: 1 1 auto;
    min-height: 0;
}

.project-report-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    min-height: 2.75rem;
    padding: 0.5rem 0;
}

.project-report-row + .project-report-row {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.project-stage-card {
    padding: 0.875rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--nucleus-surface-bg, var(--mud-palette-surface));
}

.project-timeline {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    max-height: 32rem;
    margin-bottom: 0.75rem;
    padding: 0.75rem;
    overflow-y: auto;
    scrollbar-gutter: stable;
    border: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--nucleus-surface-bg, var(--mud-palette-surface));
}

.project-timeline__header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    padding-bottom: 0.5rem;
}

.project-timeline-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 0.375rem 0.875rem;
    color: var(--mud-palette-text-secondary);
    font-size: 0.6875rem;
}

.project-timeline-legend > span {
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.project-timeline-legend__bar {
    width: 1rem;
    height: 0.375rem;
    border-radius: 999px;
    background: var(--mud-palette-primary);
}

.project-timeline-legend__bar--allocated {
    background: var(--mud-palette-success);
}

.project-timeline-legend__bar--late {
    background: var(--mud-palette-error);
}

.project-timeline-legend__today {
    width: 1px;
    height: 0.875rem;
    background: var(--mud-palette-text-secondary);
}

.project-timeline-legend__milestone {
    width: 0.5rem;
    height: 0.5rem;
    margin: 0 0.25rem;
    border: 1px solid var(--mud-palette-surface);
    background: var(--mud-palette-secondary);
    transform: rotate(45deg);
}

.project-timeline-axis {
    display: grid;
    grid-template-columns: minmax(10rem, 13rem) 1fr;
    gap: 0.75rem;
    align-items: end;
    position: sticky;
    top: -0.75rem;
    z-index: 5;
    margin: 0 -0.75rem 0.5rem;
    padding: 0.5rem 0.75rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--nucleus-surface-bg, var(--mud-palette-surface));
}

.project-timeline-axis__spacer {
    min-height: 1rem;
}

.project-timeline-axis__track {
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
    position: relative;
    padding: 0 0.125rem;
    font-size: 0.75rem;
    line-height: 1.25;
    color: var(--mud-palette-text-secondary);
}

.project-timeline-today-label {
    position: absolute;
    top: 1.25rem;
    padding: 0.0625rem 0.25rem;
    border-radius: 999px;
    background: var(--mud-palette-surface);
    color: var(--mud-palette-text-secondary);
    font-size: 0.625rem;
    line-height: 1.2;
    transform: translateX(-50%);
    white-space: nowrap;
}

.project-timeline-stage {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    margin: 0.75rem -0.25rem 0.375rem;
    padding: 0.375rem 0.5rem;
    border-top: 1px solid var(--mud-palette-lines-default);
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: var(--mud-palette-background-grey);
}

.project-timeline-stage:first-of-type {
    margin-top: 0.25rem;
}

.project-timeline-stage__status {
    padding: 0.0625rem 0.375rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: 999px;
    color: var(--mud-palette-text-secondary);
    background: var(--mud-palette-surface);
    font-size: 0.625rem;
    line-height: 1.4;
}

.project-timeline-row {
    display: grid;
    grid-template-columns: minmax(10rem, 13rem) 1fr;
    gap: 0.75rem;
    align-items: center;
    min-height: 2rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid color-mix(in srgb, var(--mud-palette-lines-default) 60%, transparent);
}

.project-timeline-row--milestones {
    margin-bottom: 0.75rem;
    border-bottom: none;
}

.project-timeline-label {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    text-align: left;
    color: inherit;
    cursor: pointer;
}

.project-timeline-label:hover,
.project-timeline-label:focus-visible {
    color: var(--mud-palette-primary);
    outline: none;
}

.project-timeline-label--static {
    cursor: default;
}

.project-timeline-track {
    position: relative;
    height: 1.25rem;
    background: var(--mud-palette-background-grey);
    border-radius: 999px;
}

.project-timeline-today {
    position: absolute;
    top: -0.125rem;
    bottom: -0.125rem;
    width: 1px;
    background: var(--mud-palette-text-secondary);
    opacity: 0.55;
    pointer-events: none;
    z-index: 1;
}

.project-timeline-bar {
    position: absolute;
    top: 50%;
    height: 0.625rem;
    min-width: 0.5rem;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: var(--mud-palette-primary);
    transform: translateY(-50%);
    cursor: pointer;
    z-index: 2;
}

.project-timeline-bar:disabled {
    cursor: default;
}

.project-timeline-bar:not(:disabled):hover,
.project-timeline-bar:not(:disabled):focus-visible {
    filter: brightness(0.92);
    outline: 2px solid color-mix(in srgb, var(--mud-palette-primary) 35%, transparent);
    outline-offset: 1px;
}

.project-timeline-bar--late {
    background: var(--mud-palette-error);
}

.project-timeline-bar--done {
    background: var(--mud-palette-success);
}

.project-timeline-milestone {
    position: absolute;
    top: 50%;
    width: 1rem;
    height: 1rem;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    transform: translate(-50%, -50%);
    cursor: pointer;
    z-index: 3;
}

.project-timeline-milestone:disabled {
    cursor: default;
}

.project-timeline-milestone__mark {
    display: block;
    width: 0.625rem;
    height: 0.625rem;
    margin: 0.1875rem auto;
    background: var(--mud-palette-secondary);
    transform: rotate(45deg);
    border: 1px solid var(--mud-palette-surface);
}

.project-timeline-milestone--late .project-timeline-milestone__mark {
    background: var(--mud-palette-error);
}

.project-timeline-milestone:not(:disabled):hover .project-timeline-milestone__mark,
.project-timeline-milestone:not(:disabled):focus-visible .project-timeline-milestone__mark {
    outline: 2px solid color-mix(in srgb, var(--mud-palette-secondary) 40%, transparent);
    outline-offset: 1px;
}

.project-timeline-undated {
    margin-top: 0.5rem;
}

.project-timeline-undated-link {
    display: block;
    width: fit-content;
    margin: 0;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--mud-palette-primary);
    font: inherit;
    font-size: 0.75rem;
    text-align: left;
    cursor: pointer;
}

.project-timeline-undated-link:hover,
.project-timeline-undated-link:focus-visible {
    text-decoration: underline;
}

.project-plan-disclosure {
    margin-bottom: 0.75rem;
    overflow: hidden;
    border: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--nucleus-surface-bg, var(--mud-palette-surface));
}

.project-plan-disclosure > summary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    min-height: 2.75rem;
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
}

.project-plan-disclosure > summary::-webkit-details-marker {
    display: none;
}

.project-plan-disclosure > summary::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    margin-left: auto;
    border-right: 2px solid var(--mud-palette-text-secondary);
    border-bottom: 2px solid var(--mud-palette-text-secondary);
    transform: rotate(45deg);
    transition: transform 120ms ease;
}

.project-plan-disclosure[open] > summary::after {
    transform: rotate(225deg);
}

.project-plan-disclosure[open] > summary {
    border-bottom: 1px solid var(--mud-palette-lines-default);
}

.project-plan-disclosure__count {
    min-width: 1.4rem;
    padding: 0.0625rem 0.375rem;
    border-radius: 999px;
    background: var(--mud-palette-background-grey);
    color: var(--mud-palette-text-secondary);
    font-size: 0.6875rem;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
}

.project-plan-disclosure__body {
    padding: 0.75rem;
}

.project-plan-disclosure__actions {
    display: flex;
    justify-content: flex-end;
    margin: -0.375rem 0 0.375rem;
}

.project-workspace-toolbar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--mud-palette-surface);
}

.project-raid-register {
    overflow: hidden;
    border: 1px solid var(--nucleus-surface-border, var(--mud-palette-lines-default));
    border-radius: var(--nucleus-surface-radius, 4px);
    background: var(--mud-palette-surface);
}

.project-raid-register__summary {
    margin-bottom: 0;
    border: 0;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    border-radius: 0;
}

.project-raid-register__filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border-bottom: 1px solid var(--mud-palette-lines-default);
    background: color-mix(in srgb, var(--mud-palette-background-grey) 45%, var(--mud-palette-surface));
}

.project-raid-register__search {
    flex: 1 1 15rem;
    min-width: 12rem;
}

.project-raid-register__filter {
    flex: 0 1 9rem;
    min-width: 8rem;
}

.project-raid-register__closed-toggle {
    flex: 0 0 auto;
    margin-left: auto;
}

.project-raid-register__table .mud-table-head {
    background: var(--mud-palette-background-grey);
}

.project-raid-register__table .mud-table-cell {
    vertical-align: middle;
}

.project-raid-title-button {
    display: block;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
    border: 0;
    background: transparent;
    color: var(--mud-palette-primary);
    font: inherit;
    font-weight: 600;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    cursor: pointer;
}

.project-raid-title-button:hover,
.project-raid-title-button:focus-visible {
    text-decoration: underline;
}

.project-raid-register__description {
    display: -webkit-box;
    max-width: 28rem;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
}

.project-raid-register__owner {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    min-width: 0;
}

.project-raid-register__muted {
    color: var(--mud-palette-text-secondary);
}

.project-raid-register__actions,
.project-raid-register__actions-heading {
    width: 6rem;
    text-align: right;
    white-space: nowrap;
}

.project-raid-register__empty {
    display: flex;
    min-height: 10rem;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 1.5rem;
    color: var(--mud-palette-text-secondary);
}

.project-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin: 1rem 0 0.5rem;
}

.project-mobile-lifecycle-bar {
    display: none;
}

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

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

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

    .project-detail-right-rail-card {
        height: calc(100% + var(--nucleus-detail-side-overlap, 1.25rem));
        transform: translateY(calc(-1 * var(--nucleus-detail-side-overlap, 1.25rem)));
        z-index: 10;
        isolation: isolate;
    }

    .project-detail-right-rail-card::before {
        content: "";
        display: block;
        flex-shrink: 0;
        height: var(--nucleus-detail-side-overlap, 1.25rem);
    }

    /* Header workflow column stays beneath overlapping right-rail card */
    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.project-detail-layout) .entity-view-header-right-column,
    .entity-view-layout--content-anchored-tabs.entity-view-layout:has(.project-detail-layout) .entity-view-header-right-column .home-quick-actions {
        position: relative;
        z-index: 0;
    }
}

@media (max-width: 959.98px) {
    .entity-view-layout .module-content-region:has(.project-detail-layout) .workspace-main-body {
        padding-inline: 0.75rem !important;
    }

    .project-detail-layout {
        display: flex;
        flex-direction: column;
        overflow: visible;
    }

    .project-detail-layout .project-detail-main {
        overflow: visible;
    }

    .project-detail-layout .project-detail-main > .project-detail-tab-content {
        overflow: visible;
        padding-right: 0;
    }

    .project-detail-right-rail-card {
        min-height: 24rem;
        transform: none;
    }

    .project-overview-grid,
    .project-financial-grid {
        grid-template-columns: 1fr;
    }

    .project-overview-grid__wide {
        grid-column: auto;
    }

    .project-timeline-row,
    .project-timeline-axis {
        grid-template-columns: 1fr;
    }

    .project-timeline-axis__spacer {
        display: none;
    }
}

/* Mobile sticky action bar — matches MudHidden SmAndUp (below 600px) */
@media (max-width: 599px) {
    .project-raid-register__filters {
        align-items: stretch;
    }

    .project-raid-register__search,
    .project-raid-register__filter {
        flex: 1 1 100%;
        width: 100%;
    }

    .project-raid-register__closed-toggle {
        margin-left: 0;
    }

    .project-raid-register__actions,
    .project-raid-register__actions-heading {
        width: auto;
        text-align: left;
    }

    .project-mobile-lifecycle-bar {
        display: block;
        position: sticky;
        bottom: 0;
        z-index: 12;
        padding: 0.5rem;
        border-top: 1px solid var(--mud-palette-lines-default);
        background: color-mix(in srgb, var(--mud-palette-surface) 92%, transparent);
        backdrop-filter: blur(8px);
        box-shadow: 0 -6px 18px rgba(0, 0, 0, 0.08);
    }

    .project-mobile-lifecycle-bar .project-header-workflow-actions {
        justify-content: stretch;
        gap: 0.5rem;
    }

    .project-mobile-lifecycle-bar .project-header-workflow-actions .mud-button-root {
        flex: 1 1 auto;
    }

    .entity-view-layout:has(.project-detail-layout) .entity-view-header-right-column .project-header-workflow-actions {
        display: none;
    }

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