/* Must be NON-ISOLATED: ModalDialog portals its Content out of the parent's DOM subtree, so isolated ::deep selectors can't reach it. */

.start-modal-body,
.cancel-modal-body {
    --rwm-purple: #7c5cdb;
    --rwm-purple-hover: #6d4dcb;
    --rwm-purple-bg: #f3f0ff;
    --rwm-text: #1d1d1f;
    --rwm-text-secondary: #6e6e73;
    --rwm-text-muted: #86868b;
    --rwm-bg-alt: #f5f5f7;
    --rwm-border: #e5e5e7;
    --rwm-row-border: #f5f5f7;
    --rwm-success-bg: #d6ecdf;
    --rwm-success-text: #0f6b46;
    --rwm-warning: #a07020;
    --rwm-warning-bg: #f8eed5;
    --rwm-error: #d24d61;
    --rwm-error-bg: #f8dde2;
    --rwm-info-blue: #3a5fa8;
    --rwm-info-blue-bg: #dde6f5;
}

/* :has() scopes these overrides to the rollout modals only, leaving other Majorsoft modals untouched. */
.bmodal-content:has(.start-modal-body),
.bmodal-content:has(.cancel-modal-body),
.bmodal-content:has(.rfc-modal-body),
.bmodal-content:has(.pa-modal-body) {
    border-radius: 16px !important;
    border: none !important;
    box-shadow:
        0 24px 64px -12px rgba(15, 15, 25, 0.25),
        0 8px 16px -8px rgba(15, 15, 25, 0.12) !important;
    overflow: hidden;
}

/* Start / Cancel keep a faint header separator; Remove / Activity have none. */
.bmodal-content:has(.start-modal-body) .bmodal-header,
.bmodal-content:has(.cancel-modal-body) .bmodal-header {
    padding: 18px 22px 14px !important;
    border-bottom: 1px solid #f5f5f7 !important;
    align-items: flex-start;
}

.bmodal-content:has(.rfc-modal-body) .bmodal-header,
.bmodal-content:has(.pa-modal-body) .bmodal-header {
    padding: 18px 22px 0 !important;
    border-bottom: none !important;
    align-items: flex-start;
}

.bmodal-content:has(.start-modal-body) .bmodal-body,
.bmodal-content:has(.cancel-modal-body) .bmodal-body,
.bmodal-content:has(.rfc-modal-body) .bmodal-body,
.bmodal-content:has(.pa-modal-body) .bmodal-body {
    padding: 18px 22px !important;
}

.bmodal-content:has(.start-modal-body) .close,
.bmodal-content:has(.cancel-modal-body) .close,
.bmodal-content:has(.rfc-modal-body) .close,
.bmodal-content:has(.pa-modal-body) .close {
    width: 28px;
    height: 28px;
    background: transparent;
    border: 0;
    border-radius: 8px;
    color: #6e6e73;
    cursor: pointer;
    font-size: 22px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.12s, color 0.12s;
}

.bmodal-content:has(.start-modal-body) .close:hover,
.bmodal-content:has(.cancel-modal-body) .close:hover,
.bmodal-content:has(.rfc-modal-body) .close:hover,
.bmodal-content:has(.pa-modal-body) .close:hover {
    background: #f5f5f7;
    color: #1d1d1f;
}

.start-modal-title,
.cancel-modal-title {
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.2px;
    color: #1d1d1f;
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-family: 'Inter Tight', 'Inter', sans-serif;
}

.start-modal-title-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--rwm-purple-bg, #f3f0ff);
    color: var(--rwm-purple, #7c5cdb);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.start-modal-title-icon svg {
    width: 17px;
    height: 17px;
    stroke-width: 2;
}

.start-modal-body {
    font-size: 14px;
    color: var(--rwm-text);
}

.start-modal-qc {
    display: grid;
    grid-template-columns: 130px 1fr;
    gap: 10px 16px;
    padding: 12px 14px;
    background: var(--rwm-bg-alt);
    border-radius: 8px;
    font-size: 13px;
    margin: 8px 0 14px;
}

.start-modal-qc-k {
    color: var(--rwm-text-secondary);
}

.start-modal-qc-v {
    color: var(--rwm-text);
    font-weight: 500;
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.start-modal-qc-mono {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

.start-modal-dot {
    color: var(--rwm-text-muted);
}

.start-modal-aside {
    color: var(--rwm-text-muted);
    font-size: 11px;
    font-weight: 400;
}

.start-modal-muted {
    color: var(--rwm-text-muted);
}

.start-modal-warning {
    display: flex;
    gap: 10px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    background: var(--rwm-warning-bg);
    color: var(--rwm-warning);
    margin-bottom: 14px;
    align-items: flex-start;
}

.start-modal-warning svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    margin-top: 1px;
    stroke-width: 2;
}

.start-modal-explainer {
    color: var(--rwm-text-secondary);
    font-size: 13px;
    margin-bottom: 0;
}

.start-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 14px;
}

.start-modal-primary {
    background: var(--rwm-purple);
    color: white;
    border: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.start-modal-primary:hover:not(:disabled) {
    background: var(--rwm-purple-hover);
}

.start-modal-primary:disabled {
    background: #c4b5fd;
    cursor: not-allowed;
}

.start-modal-bulk-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-bottom: 14px;
    font-size: 13px;
}

.start-modal-bulk-table th {
    padding: 8px 10px;
    text-align: left;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--rwm-text-muted, #86868b);
    border-bottom: 1px solid var(--rwm-border);
}

.start-modal-bulk-table td {
    padding: 10px;
    font-size: 13px;
    color: var(--rwm-text, #1d1d1f);
    border-bottom: 1px solid var(--rwm-row-border);
    vertical-align: middle;
}

.start-modal-bulk-table th.cell-right,
.start-modal-bulk-table td.cell-right { text-align: right; }

.start-modal-bulk-range {
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-variant-numeric: tabular-nums;
}

.start-modal-bulk-cashout {
    font-size: 11px;
    color: var(--rwm-text-muted, #6e6e73);
    font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
    font-variant-numeric: tabular-nums;
    margin-top: 4px;
}

/* Markup references `pill-@CensusFreshness.ToLowerInvariant()` — handle all three. */
.pill {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

.pill-fresh,
.start-modal-body .pill-fresh,
.start-modal-bulk-table .pill-fresh {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--rwm-success-bg);
    color: var(--rwm-success-text);
}

.pill-aging,
.start-modal-body .pill-aging,
.start-modal-bulk-table .pill-aging {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--rwm-warning-bg);
    color: var(--rwm-warning);
}

.pill-stale,
.start-modal-body .pill-stale,
.start-modal-bulk-table .pill-stale {
    display: inline-block;
    padding: 2px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.6;
    letter-spacing: 0.02em;
    white-space: nowrap;
    background: var(--rwm-error-bg);
    color: var(--rwm-error);
}

.cancel-modal-body {
    font-size: 14px;
    color: var(--rwm-text);
}

.cancel-modal-warning {
    color: var(--rwm-text-secondary);
    font-size: 13px;
    margin-top: 0;
    margin-bottom: 14px;
    line-height: 1.55;
}

.cancel-modal-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--rwm-text);
    margin-bottom: 6px;
    text-transform: none;
    letter-spacing: 0;
}

.cancel-modal-required {
    color: var(--rwm-error);
}

.cancel-modal-textarea {
    min-height: 120px;
    resize: vertical;
}

.cancel-modal-helper {
    font-size: 11px;
    color: var(--rwm-text-muted);
    margin-top: 6px;
}

.cancel-modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    margin-top: 18px;
}

.cancel-modal-destructive {
    background: var(--rwm-error);
    color: white;
    border: none;
    padding: 7px 18px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.15s;
}

.cancel-modal-destructive:hover:not(:disabled) {
    background: #b9384a;
}

.cancel-modal-destructive:disabled {
    background: #f1b8c0;
    cursor: not-allowed;
}
