/* Shared W-2C / information-return workflow + review centered modals (Forms page) */

.w2c-master-data-change-confirmation {
    margin-top: 1rem;
    padding: 1rem;
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 0.5rem;
    background: var(--color-brand-blue-50);
}

/* Save was pressed without ticking the acknowledgment (AT-1311); pairs with a --error field hint. */
.w2c-master-data-change-confirmation--error {
    border-color: var(--tops-error);
}

.w2c-master-data-change-confirmation__message {
    white-space: normal;
}

.w2c-master-data-change-confirmation__view-forms {
    margin-top: 0.5rem;
}

/* MudBlazor dialogs default to ~z-index 1300; workflow overlays use 1400. */
body:has([data-cy="w2c-correction-workflow-overlay"]) .mud-overlay,
body:has([data-cy="w2c-correction-review-overlay"]) .mud-overlay,
body:has([data-cy="ir-amounts-correction-overlay"]) .mud-overlay,
body:has([data-cy="ir-unified-correction-overlay"]) .mud-overlay,
body:has([data-cy="ir-wrong-form-overlay"]) .mud-overlay {
    z-index: 1500 !important;
}

body:has([data-cy="w2c-correction-workflow-overlay"]) .mud-dialog-container,
body:has([data-cy="w2c-correction-review-overlay"]) .mud-dialog-container,
body:has([data-cy="ir-amounts-correction-overlay"]) .mud-dialog-container,
body:has([data-cy="ir-unified-correction-overlay"]) .mud-dialog-container,
body:has([data-cy="ir-wrong-form-overlay"]) .mud-dialog-container {
    z-index: 1501 !important;
    pointer-events: none;
}

body:has([data-cy="w2c-correction-workflow-overlay"]) .mud-dialog-container .mud-dialog,
body:has([data-cy="w2c-correction-review-overlay"]) .mud-dialog-container .mud-dialog,
body:has([data-cy="ir-amounts-correction-overlay"]) .mud-dialog-container .mud-dialog,
body:has([data-cy="ir-unified-correction-overlay"]) .mud-dialog-container .mud-dialog,
body:has([data-cy="ir-wrong-form-overlay"]) .mud-dialog-container .mud-dialog {
    pointer-events: auto;
}

.w2c-workflow-overlay-root {
    position: fixed;
    inset: 0;
    z-index: 1400;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding: calc(var(--helper-appbar-height, 3.5rem) + 1rem) 1rem 1rem;
    pointer-events: none;
}

.w2c-workflow-overlay-backdrop {
    position: absolute;
    inset: 0;
    background: var(--tops-overlay-bg);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease-out;
}

.w2c-workflow-overlay-backdrop--visible {
    opacity: 1;
    pointer-events: auto;
}

.w2c-workflow-overlay-panel {
    position: relative;
    z-index: 1;
    width: min(72rem, 100%);
    max-height: calc(100vh - var(--helper-appbar-height, 3.5rem) - 2rem);
    pointer-events: none;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--color-white-100);
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 0.5rem;
    box-shadow: 0 1.5rem 3rem color-mix(in srgb, var(--color-brand-blue-700) 18%, transparent);
    opacity: 0;
    transform: scale(0.98);
    transition: opacity 0.3s ease-out, transform 0.3s ease-out;
}

.w2c-workflow-overlay-panel--visible {
    opacity: 1;
    transform: scale(1);
    pointer-events: auto;
}

.w2c-workflow-overlay-panel--review {
    width: min(48rem, 100%);
}

/* AT-1943: print settings inside correction review need a definite panel height.
   The print shell uses flex-basis:0 / height:100%; without a parent height those
   rules collapse the settings (and Print Forms) to 0px. */
.w2c-workflow-overlay-panel--print {
    width: min(72rem, 100%);
    height: calc(100vh - var(--helper-appbar-height, 3.5rem) - 2rem);
    max-height: calc(100vh - var(--helper-appbar-height, 3.5rem) - 2rem);
}

.w2c-workflow-overlay-panel--print .w2c-workflow-overlay-scroll {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
}

.w2c-workflow-overlay-panel--print .w2c-workflow-overlay-inner--review {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    padding: 0;
    padding-bottom: 0;
}

.w2c-workflow-overlay-panel--print .submission-print-page {
    flex: 1 1 0;
    min-height: 0;
    height: 100%;
    max-height: 100%;
}

.w2c-workflow-overlay-inner--review {
    padding-bottom: 1rem;
}

.w2c-workflow-overlay-header--review {
    margin-bottom: 0;
}

.w2c-workflow-overlay-title--review {
    font-family: var(--adamstax-font-family-body, Inter, sans-serif);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--color-brand-blue-600);
}

.w2c-workflow-overlay-subtitle--review {
    color: var(--color-brand-blue-600);
}

.w2c-workflow-overlay-header-icon--review {
    width: 2.25rem;
    height: 2.25rem;
    background: color-mix(in srgb, var(--color-brand-blue-500) 16%, transparent);
    color: var(--color-brand-blue-700);
}

.w2c-review-overlay-documents-heading {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 1rem;
    margin: 0 0 1.25rem;
}

/* AT-1309: "Filing copies" spans the SSA Copy A parts, so it reads a step above their Part headings. */
.w2c-review-overlay-documents-heading--group {
    margin-bottom: 0.75rem;
}

.w2c-review-overlay-documents-heading--group .w2c-review-overlay-documents-heading__label {
    font-weight: 600;
    color: var(--color-brand-blue-700);
}

.w2c-review-overlay-documents-heading__line {
    display: block;
    height: 1px;
    background: var(--color-misty-grey-300);
}

.w2c-review-overlay-documents-heading__label {
    margin: 0;
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
    white-space: nowrap;
}

.w2c-review-overlay-documents {
    display: grid;
    gap: 1rem;
    margin-bottom: 1.25rem;
}

.w2c-review-overlay-document-card {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.25rem 1.125rem;
    border: 1px solid var(--color-stormy-grey-100);
    border-radius: 0.5625rem;
    background: var(--color-white-100);
}

.w2c-review-overlay-document-card--highlighted {
    border-width: 2px;
    border-color: var(--color-brand-blue-200);
    background: var(--color-brand-blue-100);
}

.w2c-review-overlay-document-card--efile {
    background: var(--color-brand-blue-50);
}

.w2c-review-overlay-document-card__content {
    flex: 1 1 auto;
    min-width: 0;
}

.w2c-review-overlay-document-card__title {
    margin: 0 0 0.25rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.6;
    color: var(--color-brand-blue-600);
}

.w2c-review-overlay-document-card__title--efile {
    color: var(--color-stormy-grey-600);
}

.w2c-review-overlay-document-card__description {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
}

.w2c-review-overlay-document-card__destination {
    margin: 0.25rem 0 0;
    font-size: 0.75rem;
    line-height: 1.5;
}

.w2c-review-overlay-document-card__destination-label {
    color: var(--color-stormy-grey-400);
}

.w2c-review-overlay-document-card__destination-value {
    color: var(--color-stormy-grey-600);
}

.w2c-review-overlay-retention {
    margin-bottom: 0.5rem;
    padding: 0.875rem 1.25rem;
    border-radius: 0.5rem;
    background: var(--color-brand-blue-50);
}

.w2c-review-overlay-retention__text {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
}

/* SecondaryButton Class on review document cards — global only (scoped CSS does not apply to child components). */
.w2c-review-overlay-document-card__action.mud-button-root {
    flex-shrink: 0;
    align-self: center;
    white-space: nowrap;
}

.w2c-workflow-context-card {
    margin: 0 0 1.5rem;
    padding: 1.25rem 1.25rem 1.125rem;
    border-radius: 0.5rem;
    background: var(--color-brand-blue-50);
}

.w2c-workflow-context-card__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.75rem;
    margin-bottom: 0.8125rem;
}

.w2c-workflow-context-card__transition {
    margin: 0;
    font-family: var(--tops-font-manrope);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    color: var(--color-brand-blue-600);
}

.w2c-workflow-context-card__transition-prefix {
    color: var(--color-brand-blue-600);
}

.w2c-workflow-context-card__efiled-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    min-height: 1.1875rem;
    padding: 0 0.625rem;
    border-radius: 1.0625rem;
    background: var(--color-white-100);
    font-size: 0.875rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--color-brand-blue-600);
}

.w2c-workflow-context-card__fields {
    display: flex;
    flex-direction: column;
    gap: 0.8125rem;
    margin: 0;
}

.w2c-workflow-context-card__field {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
    margin: 0;
}

.w2c-workflow-context-card__field dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-stormy-grey-700);
}

.w2c-workflow-context-card__field dt::after {
    content: ":";
}

.w2c-workflow-context-card__field dd {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    z-index: 2;
    box-sizing: border-box;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 9999px;
    background: var(--color-white-100);
    color: var(--color-stormy-grey-600);
    cursor: pointer;
}

.w2c-workflow-overlay-close:hover:not(:disabled) {
    background: var(--color-misty-grey-100);
    color: var(--color-brand-blue-700);
}

.w2c-workflow-overlay-close:focus-visible {
    outline: 2px solid var(--color-brand-blue-500);
    outline-offset: 2px;
}

.w2c-workflow-overlay-close:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.w2c-workflow-overlay-close-icon {
    display: block;
    width: 0.75rem;
    height: 0.75rem;
}

.w2c-workflow-overlay-scroll {
    flex: 1 1 auto;
    min-height: 0;
    /* Vertical scrollbar must not create a horizontal bar (width:100% content + gutter). */
    overflow-x: hidden;
    overflow-y: auto;
}

.w2c-workflow-overlay-inner {
    padding: 1.5rem 2rem 1.5rem;
}

.w2c-workflow-overlay-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.5rem;
    padding-right: 2rem;
}

.w2c-workflow-overlay-header-main {
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    min-width: 0;
}

.w2c-workflow-overlay-header-icon {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    background: color-mix(in srgb, var(--tops-success) 18%, transparent);
    color: var(--tops-success-700);
}

.w2c-workflow-overlay-title {
    margin: 0;
    font-family: var(--adamstax-font-family-display, Manrope, Inter, sans-serif);
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.25;
    color: var(--color-brand-blue-700);
}

.w2c-workflow-overlay-subtitle {
    margin: 0.25rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-stepper {
    margin: 0.75rem -2rem 1.25rem;
    padding: 0.875rem 2rem;
    background: var(--color-brand-blue-50);
    border-block: 1px solid var(--color-misty-grey-300);
}

.w2c-workflow-stepper__list {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
}

.w2c-workflow-stepper__step {
    flex: 0 0 auto;
}

.w2c-workflow-stepper__link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: inherit;
    cursor: default;
}

a.w2c-workflow-stepper__link {
    cursor: pointer;
}

.w2c-workflow-stepper__bubble {
    flex-shrink: 0;
    display: grid;
    place-items: center;
    width: 1.375rem;
    height: 1.375rem;
    border-radius: 50%;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1;
}

.w2c-workflow-stepper__label {
    font-family: var(--adamstax-font-family-display, Manrope, Inter, sans-serif);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

/* Review panel is 48rem while the viewport may be wider; multi-step flows (e.g. wrong-form) need wrap. */
.w2c-workflow-overlay-panel--review .w2c-workflow-stepper__list {
    flex-wrap: wrap;
    row-gap: 0.5rem;
    column-gap: 0.625rem;
}

.w2c-workflow-overlay-panel--review .w2c-workflow-stepper__label {
    font-size: 0.8125rem;
    white-space: normal;
}

.w2c-workflow-stepper__step[data-state="active"] .w2c-workflow-stepper__bubble {
    background: var(--color-brand-blue-600);
    border: none;
    color: var(--color-white-100);
}

.w2c-workflow-stepper__step[data-state="active"] .w2c-workflow-stepper__label {
    color: var(--color-brand-blue-600);
}

.w2c-workflow-stepper__step[data-state="idle"] .w2c-workflow-stepper__bubble,
.w2c-workflow-stepper__step[data-state="complete"] .w2c-workflow-stepper__bubble {
    background: var(--color-white-100);
    border: 1.5px solid var(--color-stormy-grey-300);
    color: var(--color-stormy-grey-300);
}

.w2c-workflow-stepper__step[data-state="idle"] .w2c-workflow-stepper__label,
.w2c-workflow-stepper__step[data-state="complete"] .w2c-workflow-stepper__label {
    color: var(--color-stormy-grey-300);
}

.w2c-workflow-stepper__separator {
    flex: 0 0 auto;
    width: 0.5rem;
    height: 0.5rem;
    list-style: none;
}

.w2c-workflow-stepper__separator::after {
    content: "";
    display: block;
    width: 0.375rem;
    height: 0.375rem;
    margin-inline: auto;
    border-right: 1.5px solid var(--color-stormy-grey-300);
    border-bottom: 1.5px solid var(--color-stormy-grey-300);
    transform: rotate(-45deg);
}

.w2c-workflow-metadata {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    min-height: 3.6875rem;
    padding: 0.625rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 0.5rem;
    background: var(--color-brand-blue-50);
}

.w2c-workflow-metadata__transition {
    margin: 0;
    flex: 0 0 auto;
    font-family: var(--tops-font-manrope);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--color-brand-blue-600);
}

.w2c-workflow-metadata__fields {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.75rem 1.5rem;
    margin: 0;
    flex: 1 1 auto;
    min-width: 0;
}

.w2c-workflow-metadata__item {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem;
    min-width: 0;
}

.w2c-workflow-metadata__item dt {
    margin: 0;
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.5;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--color-stormy-grey-700);
}

.w2c-workflow-metadata__item dt::after {
    content: ":";
}

.w2c-workflow-metadata__item dd {
    margin: 0;
    font-size: 0.8125rem;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: 0.04em;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-manual-guidance {
    margin-bottom: 1.25rem;
}

.w2c-workflow-overlay-manual-guidance__body {
    margin: 0.5rem 0 0;
    font-size: 0.875rem;
    line-height: 1.5;
}

.w2c-workflow-overlay-section {
    margin-bottom: 1.5rem;
}

/* The error region is a programmatic focus target so keyboard/screen-reader
   users land on the message when a save is rejected. The alert inside already
   conveys the error, so suppress the outline on the wrapper itself. */
.w2c-workflow-overlay-error-region {
    scroll-margin-top: 1rem;
}

.w2c-workflow-overlay-error-region:focus {
    outline: none;
}

.w2c-workflow-overlay-section__title {
    margin: 0 0 0.375rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-brand-blue-700);
}

.w2c-workflow-overlay-section__intro {
    margin: 0 0 1rem;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-section__group-title {
    margin: 0 0 0.75rem;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-brand-blue-700);
}

.w2c-workflow-overlay-table-wrap + .w2c-workflow-overlay-section__group-title {
    margin-top: var(--spacing-6);
}

.w2c-duplicate-correction-block {
    margin: var(--spacing-4) 0;
    padding: var(--spacing-4);
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 0.375rem;
    background: var(--color-white-100);
}

.w2c-duplicate-correction-block__heading {
    margin: 0 0 var(--spacing-2);
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--color-brand-blue-700);
}

.w2c-duplicate-correction-block__note {
    margin: 0 0 var(--spacing-3);
    font-size: 0.875rem;
    line-height: 1.45;
    color: var(--tops-neutral-700);
}

.w2c-duplicate-correction-confirm {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-3);
    margin-top: var(--spacing-4);
}

.w2c-duplicate-correction-confirm-statement {
    margin: 0 !important;
    padding: var(--spacing-4);
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 0.375rem;
    background: var(--color-white-100);
}

/* AT-981 AC3 — narrow-path "I also need to correct something else" confirmation. */
.w2c-narrow-path-confirm {
    margin-top: var(--spacing-4);
    padding: var(--spacing-4);
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 0.375rem;
    background: var(--color-white-100);
}

.w2c-narrow-path-confirm .w2c-workflow-overlay-manual-guidance {
    margin-top: var(--spacing-3);
    margin-bottom: 0;
}

.w2c-duplicate-correction-confirm-statement .mud-typography,
.w2c-duplicate-correction-confirm-statement .mud-checkbox .mud-button-label {
    font-weight: 700;
    color: var(--color-brand-blue-700);
}

.w2c-duplicate-correction-confirm-callout {
    padding: var(--spacing-4);
    border-radius: 0.375rem;
    border-left: 4px solid var(--color-brand-blue-600);
    background: var(--tops-status-info-bg);
}

.w2c-duplicate-correction-confirm-helper {
    margin: 0 0 var(--spacing-2);
    font-size: 0.875rem;
    font-weight: 500;
    line-height: 1.45;
    color: var(--color-brand-blue-700);
}

.w2c-duplicate-correction-wrong-w2-hint {
    margin: 0;
    font-size: 0.8125rem;
    line-height: 1.45;
    color: var(--tops-neutral-700);
}

.w2c-workflow-overlay-table-wrap {
    overflow-x: auto;
    border: 1px solid var(--color-misty-grey-300);
    border-radius: 0.375rem;
    background: var(--color-white-100);
}

.w2c-workflow-overlay-table {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
}

.w2c-workflow-overlay-table col.w2c-workflow-overlay-table__field-col {
    width: 28%;
}

.w2c-workflow-overlay-table col.w2c-workflow-overlay-table__reported-col {
    width: 36%;
}

.w2c-workflow-overlay-table col.w2c-workflow-overlay-table__corrected-col-width {
    width: 36%;
}

.w2c-workflow-overlay-table th,
.w2c-workflow-overlay-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--color-misty-grey-300);
    text-align: left;
    vertical-align: middle;
}

.w2c-workflow-overlay-table thead th {
    padding-top: 0.625rem;
    padding-bottom: 0.625rem;
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: uppercase;
    color: var(--color-brand-blue-600);
    background: var(--color-brand-blue-50);
    border-bottom: 1px solid var(--color-misty-grey-300);
}

.w2c-workflow-overlay-table tbody tr:last-child td,
.w2c-workflow-overlay-table tbody tr:last-child th {
    border-bottom: none;
}

.w2c-workflow-overlay-table td.w2c-workflow-overlay-table__reported-col {
    background: var(--color-misty-grey-100);
}

.w2c-workflow-overlay-table th.w2c-workflow-overlay-table__corrected-col,
.w2c-workflow-overlay-table td.w2c-workflow-overlay-table__corrected-col {
    background: var(--color-brand-blue-100);
}

.w2c-workflow-overlay-table thead th.w2c-workflow-overlay-table__reported-col {
    background: var(--color-brand-blue-50);
}

.w2c-workflow-overlay-table thead th.w2c-workflow-overlay-table__corrected-col {
    background: var(--color-brand-blue-200);
    color: var(--color-brand-blue-600);
}

.w2c-workflow-overlay-table th.w2c-workflow-overlay-table__field-label {
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    color: var(--color-brand-blue-700);
    background: var(--color-white-100);
}

.w2c-workflow-overlay-table__box-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    letter-spacing: normal;
    text-transform: none;
    line-height: 1.4;
    color: var(--color-brand-blue-700);
}

.w2c-workflow-overlay-table__box-number {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-table__reported-value {
    display: block;
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--color-stormy-grey-600);
}

/* Boolean box values render as a checkbox in both the reported and corrected columns. */
.w2c-workflow-overlay-table .w2c-workflow-overlay-table__bool {
    margin: -0.375rem 0 -0.375rem -0.5rem;
    pointer-events: none;
}

/* Read-only workflow step: nothing for the user to enter, so the whole section reads as disabled. */
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-section__title,
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-section__intro {
    color: var(--color-stormy-grey-500);
}

.w2c-workflow-overlay-readonly-note {
    display: block;
    margin: 0 0 0.75rem;
    padding: 0.5rem 0.75rem;
    border: 1px dashed var(--color-misty-grey-300);
    border-radius: 0.25rem;
    background: var(--color-misty-grey-100);
    font-size: 0.8125rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--color-stormy-grey-500);
}

.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table-wrap {
    background: var(--color-misty-grey-100);
}

.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table thead th,
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table thead th.w2c-workflow-overlay-table__reported-col,
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table thead th.w2c-workflow-overlay-table__corrected-col {
    background: var(--color-misty-grey-200);
    color: var(--color-stormy-grey-500);
}

.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table td.w2c-workflow-overlay-table__reported-col,
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table td.w2c-workflow-overlay-table__corrected-col {
    background: var(--color-misty-grey-100);
}

.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table__box-label,
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table__box-number,
.w2c-workflow-overlay-section--readonly .w2c-workflow-overlay-table__reported-value {
    color: var(--color-stormy-grey-500);
}

.w2c-workflow-overlay-amount-input {
    display: block;
    width: 100%;
    box-sizing: border-box;
    height: 2.25rem;
    padding: 0 0.625rem;
    border: 1px solid var(--color-stormy-grey-300);
    border-radius: 0.25rem;
    background: var(--color-white-100);
    font-size: 0.875rem;
    line-height: 1.4;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-amount-input:focus {
    outline: 2px solid color-mix(in srgb, var(--color-brand-blue-500) 45%, transparent);
    outline-offset: 1px;
    border-color: var(--color-brand-blue-500);
}

.w2c-workflow-overlay-footer {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--color-misty-grey-300);
    background: var(--color-white-100);
    border-radius: 0 0 0.5rem 0.5rem;
}

.w2c-workflow-overlay-footer-hint {
    margin: 0;
    max-width: 36rem;
    flex: 1 1 auto;
    min-width: 0;
    font-size: 0.8125rem;
    line-height: 1.5;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-field-hint {
    margin: 0.375rem 0 0;
    font-size: 0.8125rem;
    line-height: 1.4;
    color: var(--color-stormy-grey-600);
}

.w2c-workflow-overlay-field-hint--error {
    color: var(--tops-error);
}

/* A corrected-value box the filer still has to fill in (AT-1311 AC3); pairs with a --error field hint. */
.w2c-workflow-overlay-amount-input--error {
    border-color: var(--tops-error);
}

.w2c-workflow-overlay-footer-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-left: auto;
    flex-shrink: 0;
}

.w2c-workflow-overlay-footer-actions .mud-button-root {
    flex-shrink: 0;
    white-space: nowrap;
}

.w2c-workflow-overlay-loading {
    margin: 1rem 0;
}

@media (max-width: 768px) {
    .w2c-workflow-overlay-root {
        padding: var(--helper-appbar-height, 3.5rem) 0 0;
        align-items: stretch;
    }

    .w2c-workflow-overlay-panel {
        width: 100%;
        max-height: calc(100vh - var(--helper-appbar-height, 3.5rem));
        min-height: calc(100vh - var(--helper-appbar-height, 3.5rem));
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .w2c-workflow-overlay-inner {
        padding: 1rem;
    }

    .w2c-workflow-overlay-header {
        padding-right: 2rem;
    }

    .w2c-workflow-overlay-footer {
        flex-direction: column;
        align-items: stretch;
        padding: 1rem;
        border-radius: 0;
    }

    .w2c-workflow-overlay-footer-actions {
        width: 100%;
        margin-left: 0;
    }

    .w2c-workflow-metadata {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
    }

    .w2c-workflow-metadata__fields {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.625rem;
    }

    .w2c-workflow-stepper {
        margin-inline: -1rem;
        padding-inline: 1rem;
    }

    .w2c-workflow-stepper__list {
        flex-wrap: wrap;
        row-gap: 0.5rem;
    }

    .w2c-workflow-stepper__label {
        font-size: 0.8125rem;
        white-space: normal;
    }

    .w2c-review-overlay-document-card {
        flex-direction: column;
        align-items: stretch;
    }

    .w2c-review-overlay-documents-heading {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        text-align: center;
    }

    .w2c-review-overlay-documents-heading__line {
        display: none;
    }

    .w2c-review-overlay-document-card__action.mud-button-root {
        align-self: stretch;
        width: 100%;
    }

    .w2c-workflow-overlay-table {
        table-layout: auto;
    }
}

@media (prefers-reduced-motion: reduce) {
    .w2c-workflow-overlay-backdrop,
    .w2c-workflow-overlay-panel {
        transition: none;
    }
}
