/* Projects forms share the Customer Connections spacing, theme and action hierarchy. */
.projects-form-page {
   color: var(--mud-palette-text-primary);
   min-width: 0;
}

.projects-form-page .app-page-title {
   font-weight: 600;
   line-height: 1.3;
   margin-bottom: 6px;
}

.projects-form-page .app-page-subtitle {
   color: var(--mud-palette-text-secondary);
   margin-bottom: 20px;
}

.projects-form-page .mud-paper-outlined {
   border-color: var(--mud-palette-lines-default);
   border-radius: 8px;
   box-shadow: none;
}

.projects-form-page .mud-paper-outlined > .mud-typography-h6,
.projects-form-page .mud-paper-outlined > .mud-stack:first-child > .mud-typography-h6 {
   font-weight: 600;
   color: var(--mud-palette-primary);
}

.projects-form-page .mud-form > .mud-paper-outlined,
.projects-form-page > .mud-paper-outlined {
   border-top: 3px solid var(--mud-palette-primary);
   background: linear-gradient(180deg, var(--mud-palette-primary-hover), transparent 80px),
      var(--mud-palette-surface);
}

.projects-form-page .mud-typography-caption {
   color: var(--mud-palette-text-secondary);
}

.projects-form-page .intake-journey {
   background: var(--mud-palette-background-grey);
   border-radius: 8px;
   padding: 16px 0;
}

.projects-form-page .mud-table-head .mud-table-cell {
   background: var(--mud-palette-background-grey);
   font-weight: 600;
}

.projects-form-page .mud-input-control {
   min-width: 0;
}

.projects-form-page .mud-button-root {
   border-radius: 4px;
}

@media (max-width: 600px) {
   .projects-form-page.mud-container {
      padding: 16px !important;
   }
}

/* Shared Customer Connections-style child workflow navigation. */
.project-workflow-layout {
   display: grid;
   grid-template-columns: 260px minmax(0, 1fr);
   align-items: start;
   gap: 24px;
   margin-bottom: 16px;
}
.project-workflow-rail {
   border: 1px solid var(--mud-palette-lines-default);
   border-top: 3px solid var(--mud-palette-primary);
   border-radius: 12px;
   background: var(--mud-palette-surface);
   padding: 16px;
}
.project-workflow-rail-title {
   font-size: 1rem;
   font-weight: 600;
   margin: 0 0 12px;
}
.project-workflow-content { min-width: 0; }
.project-workflow-layout .workflow-child-steps {
   position: relative;
   display: flex;
   flex-direction: column;
   gap: 8px;
   overflow: visible;
   padding: 0;
}
.project-workflow-layout .workflow-child-steps::before {
   content: "";
   position: absolute;
   top: 27px;
   bottom: 27px;
   left: 26px;
   width: 2px;
   background: var(--mud-palette-lines-default);
   pointer-events: none;
}
.project-workflow-layout .workflow-child-steps:has(> :only-child)::before {
   display: none;
}
.project-workflow-layout .intake-journey-node {
   flex: none;
   min-width: 0;
   text-align: left;
}
.project-workflow-layout .intake-journey-node::after { display: none; }
.project-workflow-layout .intake-step-link {
   position: relative;
   z-index: 1;
   width: 100%;
   justify-content: flex-start;
   padding: 12px;
   border: 1px solid transparent;
   border-radius: 8px;
   text-transform: none;
   text-align: left;
}
.project-workflow-layout .intake-step-link[aria-current="step"] {
   border-color: var(--mud-palette-primary);
   background: var(--mud-palette-primary-hover);
}
.project-workflow-layout .intake-step-link:focus-visible {
   outline: 2px solid var(--mud-palette-primary);
   outline-offset: 2px;
}
.project-workflow-layout .intake-journey-label {
   flex-direction: row;
   gap: 16px;
   align-items: center;
}
@media (max-width: 959.98px) {
   .project-workflow-layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
}
.project-workflow-layout .screening-step-number {
   display: inline-flex;
   align-items: center;
   justify-content: center;
   flex-shrink: 0;
   width: 28px;
   height: 28px;
   border: 1px solid var(--mud-palette-lines-default);
   border-radius: 50%;
   background: var(--mud-palette-surface);
}
.project-workflow-layout [aria-current="step"] .screening-step-number {
   color: var(--mud-palette-primary-text);
   background: var(--mud-palette-primary);
   border-color: var(--mud-palette-primary);
}
.project-workflow-layout .workflow-child-steps .intake-journey-label {
   display: flex;
}
.risk-definition-steps {
   display: flex;
   overflow-x: auto;
   padding: 4px 0;
}
.risk-definition-steps .risk-definition-step {
   flex: 1 0 140px;
   position: relative;
   text-transform: none;
   padding: 8px;
}
.risk-definition-step:not(:first-child)::before,
.risk-definition-step:not(:last-child)::after {
   content: "";
   position: absolute;
   top: 22px;
   width: calc(50% - 14px);
   height: 1px;
   background: var(--mud-palette-lines-default);
   pointer-events: none;
}
.risk-definition-step:not(:first-child)::before {
   left: 0;
}
.risk-definition-step:not(:last-child)::after {
   right: 0;
}
.risk-definition-step-label {
   display: flex;
   flex-direction: column;
   align-items: center;
   gap: 8px;
   white-space: nowrap;
}
.risk-definition-step:focus-visible {
   outline: 2px solid var(--mud-palette-primary);
   outline-offset: -2px;
}
.project-workflow-layout .risk-definition-step .screening-step-number.risk-definition-complete,
.project-workflow-layout .intake-step-link .screening-step-number.risk-definition-complete {
   background: var(--mud-palette-success);
   border-color: var(--mud-palette-success);
   color: var(--mud-palette-success-text);
}
.risk-definition-count {
   font-size: 0.75rem;
   color: var(--mud-palette-text-secondary);
}
.risk-definition-heading,
.risk-definition-row {
   display: grid;
   grid-template-columns: 48px minmax(0, 1fr);
   gap: 16px;
   align-items: start;
}
.risk-definition-heading {
   margin-top: 16px;
   color: var(--mud-palette-text-secondary);
   font-weight: 600;
}
.risk-definition-score {
   margin-top: 22px;
   text-align: center;
   color: var(--mud-palette-primary);
   font-weight: 600;
}

/* Keep the assessment navigation stationary as individual step content changes. */
.risk-assessment-dialog {
   height: 90vh;
   height: 90dvh;
   max-height: calc(100dvh - 32px);
}
.risk-assessment-dialog .mud-dialog-content {
   flex: 1 1 auto;
   min-height: 0;
   overflow-y: auto;
   scrollbar-gutter: stable;
}
.risk-assessment-dialog .mud-dialog-title,
.risk-assessment-dialog .mud-dialog-actions {
   flex-shrink: 0;
}

/* Keep scope surfaces neutral; reserve accent color for active controls. */
.projects-form-page.scope-clean-page .mud-paper,
.scope-clean-page .planning-workflow > aside {
   border-top: 1px solid var(--mud-palette-lines-default);
   background: var(--mud-palette-surface);
}
.scope-clean-page .planning-workflow .workflow-step.selected {
   border-color: transparent;
   background: var(--mud-palette-action-default-hover);
}

/* Compact PMO step content without shrinking input text or hiding validation. */
.project-workflow-content .mud-paper.pa-4,
.project-workflow-content .mud-paper.pa-5,
.workflow-body .mud-paper.pa-4,
.workflow-body .mud-paper.pa-5 {
   padding: 12px !important;
}
.project-workflow-content .mb-4,
.workflow-body .mb-4 { margin-bottom: 12px !important; }
.project-workflow-content .my-4,
.workflow-body .my-4 { margin-top: 10px !important; margin-bottom: 10px !important; }
.project-workflow-content .my-3,
.workflow-body .my-3 { margin-top: 8px !important; margin-bottom: 8px !important; }
.project-workflow-content .mt-4,
.workflow-body .mt-4 { margin-top: 12px !important; }
.project-workflow-content .mud-typography-h6,
.workflow-body .mud-typography-h6 { font-size: 1.05rem; line-height: 1.4; }
@media (min-width: 960px) {
   .project-workflow-layout { gap: 16px; }
}
