/*
 * Resolve 1.8.0 — Workstream C: financial diagnostic engine screens and the
 * printable report. Uses the shell's design tokens with fallbacks so the
 * standalone printable report renders without them. Logical properties only.
 */

.rfde {
	--rfde-line: var(--r-line, #d9dce6);
	--rfde-ink: var(--r-ink-1, #14172b);
	--rfde-ink-3: var(--r-ink-3, #4d5270);
	--rfde-paper: var(--r-paper, #fff);
	--rfde-accent: var(--r-accent, #3b55e6);
	color: var(--rfde-ink);
}

.rfde-head h1 { margin: 0 0 6px; }
.rfde-lede { margin: 0 0 18px; max-inline-size: 80ch; color: var(--rfde-ink-3); }

.rfde-panel {
	margin: 0 0 20px;
	padding: 16px 18px;
	border: 1px solid var(--rfde-line);
	border-radius: 8px;
	background: var(--rfde-paper);
}

.rfde-panel h2 { margin: 0 0 10px; font-size: 18px; }
.rfde-panel h3 { margin: 16px 0 8px; font-size: 15px; }
.rfde-subpanel { margin-block-start: 16px; padding-block-start: 12px; border-block-start: 1px solid var(--rfde-line); }

.rfde-note { margin: 0 0 10px; font-size: 13px; color: var(--rfde-ink-3); }
.rfde-caution { margin: 0 0 12px; padding: 10px 12px; border-inline-start: 3px solid #b26a00; background: #fff7e8; font-size: 13px; }
.rfde-help { margin: 4px 0 0; font-size: 12px; color: var(--rfde-ink-3); }

.rfde-notice { margin: 0 0 14px; padding: 10px 12px; border-radius: 6px; border: 1px solid var(--rfde-line); }
.rfde-notice--success { border-color: #2e7d32; background: #eef8ef; }
.rfde-notice--error { border-color: #b3261e; background: #fdeeee; }
.rfde-notice--warning { border-color: #b26a00; background: #fff7e8; }
.rfde-notice--info { border-color: var(--rfde-accent); background: #eef1fd; }
.rfde-errors { margin: -6px 0 14px; padding-inline-start: 20px; font-size: 13px; color: #b3261e; }

.rfde-tabs { margin: 0 0 18px; }
.rfde-tabs__title { margin: 0 0 8px; font-size: 13px; color: var(--rfde-ink-3); }
.rfde-tabs ul, .rfde-subnav ul { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.rfde-tabs a, .rfde-subnav a { display: inline-block; padding: 6px 10px; border: 1px solid var(--rfde-line); border-radius: 6px; text-decoration: none; color: inherit; font-size: 14px; }
.rfde-tabs a.is-current, .rfde-subnav a.is-current { border-color: var(--rfde-accent); color: var(--rfde-accent); font-weight: 600; }
.rfde-subnav { margin: 0 0 12px; }

.rfde-steps { margin: 0; padding-inline-start: 22px; }
.rfde-steps li { margin: 0 0 6px; }
.rfde-steps li.is-done { color: var(--rfde-ink-3); }

.rfde-form { margin: 0 0 12px; }
.rfde-field { margin: 0 0 12px; }
.rfde-field label, .rfde-field legend { display: block; margin: 0 0 4px; font-weight: 600; font-size: 14px; }
.rfde-field input[type="text"], .rfde-field input[type="number"], .rfde-field input[type="date"], .rfde-field input[type="email"], .rfde-field input:not([type]), .rfde-field select, .rfde-field textarea { inline-size: 100%; max-inline-size: 560px; padding: 7px 9px; border: 1px solid var(--rfde-line); border-radius: 6px; font: inherit; }
.rfde-field textarea[dir="ltr"] { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 13px; max-inline-size: 100%; }
.rfde-check { display: inline-flex; gap: 6px; align-items: baseline; margin: 4px 12px 4px 0; font-size: 14px; }
.rfde-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 0 0 10px; }
.rfde-actions form { margin: 0; }
.rfde-lever { margin: 0 0 8px; padding: 8px 10px; border: 1px solid var(--rfde-line); border-radius: 6px; }
.rfde-lever summary { cursor: pointer; font-weight: 600; }

.rfde-tablewrap { overflow-x: auto; margin: 0 0 10px; }
.rfde-table { border-collapse: collapse; inline-size: 100%; font-size: 13px; }
.rfde-table th, .rfde-table td { padding: 6px 8px; border-block-end: 1px solid var(--rfde-line); text-align: start; vertical-align: top; }
.rfde-table thead th { font-size: 12px; color: var(--rfde-ink-3); white-space: nowrap; }
.rfde-table--metrics tbody th { min-inline-size: 240px; font-weight: 500; }
.rfde-table--grid input { inline-size: 9.5em; padding: 4px 6px; border: 1px solid var(--rfde-line); border-radius: 4px; font: inherit; font-variant-numeric: tabular-nums; }
.rfde-table--form input, .rfde-table--form select { inline-size: 100%; min-inline-size: 7em; padding: 4px 6px; border: 1px solid var(--rfde-line); border-radius: 4px; font: inherit; }
.rfde-table tr.is-current { background: #f3f5fe; }
.rfde-table tr.is-decided { color: var(--rfde-ink-3); }
.rfde-na { color: var(--rfde-ink-3); text-align: center; }

.rfde-cell { color: inherit; text-decoration: none; }
.rfde-cell:hover, .rfde-cell:focus-visible { text-decoration: underline; }
.rfde-num { font-variant-numeric: tabular-nums; white-space: nowrap; }
.rfde-id { font-size: 11px; color: var(--rfde-ink-3); }
.rfde-label { font-size: 11px; color: var(--rfde-ink-3); text-decoration: none; border-block-end: 1px dotted currentColor; cursor: help; }
.rfde-mono { margin: 4px 0 0; padding-inline-start: 16px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12px; }

.rfde-status { display: inline-block; padding: 1px 7px; border-radius: 999px; font-size: 11px; line-height: 1.6; border: 1px solid currentColor; white-space: nowrap; }
.rfde-status--success { color: #2e7d32; }
.rfde-status--info { color: #2a4bd7; }
.rfde-status--neutral { color: #5f6377; }
.rfde-status--warning { color: #8a5300; }
.rfde-status--danger { color: #b3261e; }

.rfde-dl { margin: 0; }
.rfde-dl__row { display: grid; grid-template-columns: minmax(180px, 34%) 1fr; gap: 10px; padding: 5px 0; border-block-end: 1px solid var(--rfde-line); }
.rfde-dl__row dt { font-weight: 600; font-size: 13px; }
.rfde-dl__row dd { margin: 0; font-size: 14px; }

.rfde-diags, .rfde-indicators, .rfde-reviews, .rfde-list { margin: 0; padding-inline-start: 18px; }
.rfde-diags li, .rfde-indicators li, .rfde-reviews li, .rfde-list li { margin: 0 0 8px; }
.rfde-diag--priority { font-weight: 600; }
.rfde-diag__id, .rfde-diag__period { font-size: 12px; color: var(--rfde-ink-3); }
.rfde-diag__sev { display: block; font-size: 12px; color: var(--rfde-ink-3); }
.rfde-list--blocking li { color: #b3261e; }

.rfde-panel--needs { border-inline-start: 4px solid #2e7d32; }
.rfde-panel--inferred { border-inline-start: 4px solid #8a5300; }
.rfde-panel--scenario { border-style: dashed; }
.rfde-scenario + .rfde-scenario { margin-block-start: 14px; padding-block-start: 10px; border-block-start: 1px dashed var(--rfde-line); }

[dir="rtl"] .rfde-panel, [dir="rtl"] .rfde-note { line-height: 1.8; }

@media (max-width: 720px) {
	.rfde-dl__row { grid-template-columns: 1fr; gap: 2px; }
	.rfde-table--metrics tbody th { min-inline-size: 170px; }
}

@media print {
	.rfde-actions, .rfde-actions-panel, .rfde-tabs, .rfde-form { display: none !important; }
	.rfde-panel { border-color: #999; }
	a { color: inherit; text-decoration: none; }
}

/* 1.12.0 (Workstream M) — Financial Input Workspace: statements view. */
.rfde-meta { display: grid; grid-template-columns: minmax(140px, max-content) 1fr; gap: 4px 16px; margin: 0 0 16px; }
.rfde-meta dt { font-weight: 600; color: var(--rfde-ink-3); }
.rfde-meta dd { margin: 0; }
.rfde-table--statement td { text-align: end; white-space: nowrap; }
.rfde-table--statement th[scope="row"] { font-weight: 400; }
.rfde-table .rfde-group th { background: var(--rfde-ground, #f6f7fb); font-weight: 600; text-align: start; }
.rfde-st--missing, .rfde-st--not_applicable { color: var(--rfde-ink-3); }
.rfde-st--disputed, .rfde-st--invalid { color: #8a5300; }
.rfde-prov { display: block; font-size: 10px; letter-spacing: .02em; color: var(--rfde-ink-3); }
.rfde-check-row th, .rfde-check-row td { border-block-start: 2px solid var(--rfde-line); font-size: 12px; white-space: normal; }
.rfde-flag { color: #2e7d32; }
.rfde-flag--warn { color: #8a5300; }
.rfde-inputs > summary { cursor: pointer; font-weight: 600; }
.rfde-statements__sub { margin-block-start: 24px; }

/*
 * 1.14.0 — Financial Assessment (Fde\Fa). Same tokens; logical properties
 * only (right-to-left safe); every tone is accompanied by words.
 */
/* 1.15.0 — fifteen sections with completion state (green / yellow / red / grey). */
.rfa-nav .rfa-progress { margin: 4px 0 8px; font-size: 14px; }
.rfa-nav .rfa-jump { display: none; margin: 0 0 8px; align-items: center; gap: 6px; flex-wrap: wrap; }
.rfa-nav .rfa-jump select { max-width: 100%; }
.rfa-nav .rfa-tabs { display: grid; grid-template-columns: repeat(auto-fill, minmax(178px, 1fr)); gap: 6px; margin: 0 0 8px; padding: 0; list-style: none; counter-reset: none; }
.rfa-nav .rfa-tab a { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 6px; height: 100%; box-sizing: border-box; padding: 7px 9px; border: 1px solid var(--rfde-line, #d9dce6); border-inline-start-width: 4px; border-radius: 8px; text-decoration: none; color: inherit; background: var(--rfde-paper, #fff); }
.rfa-nav .rfa-tab.is-current a { box-shadow: inset 0 0 0 2px var(--rfde-accent, #3b55e6); }
.rfa-nav .rfa-tab__n { font-weight: 700; color: var(--rfde-accent, #3b55e6); }
.rfa-nav .rfa-tab__label { font-weight: 600; font-size: 13.5px; flex: 1 1 auto; }
.rfa-nav .rfa-tab__state { flex-basis: 100%; font-size: 12px; color: var(--rfde-ink-3, #4d5270); }
.rfa-nav .rfa-tabs .rfa-tab--complete > a { border-inline-start: 5px solid #1f8a4c; }
.rfa-nav .rfa-tabs .rfa-tab--incomplete > a, .rfa-nav .rfa-tabs .rfa-tab--attention > a { border-inline-start: 5px solid #d39a00; }
.rfa-nav .rfa-tabs .rfa-tab--invalid > a { border-inline-start: 5px solid #c0392b; }
.rfa-nav .rfa-tabs .rfa-tab--na > a, .rfa-nav .rfa-tabs .rfa-tab--unavailable > a { border-inline-start: 5px solid #9aa0b4; }
.rfa-nav .rfa-tab__state::before { content: ""; display: inline-block; width: 8px; height: 8px; margin-inline-end: 5px; border-radius: 50%; background: #9aa0b4; vertical-align: middle; }
.rfa-tab--complete .rfa-tab__state::before { background: #1f8a4c; }
.rfa-tab--incomplete .rfa-tab__state::before, .rfa-tab--attention .rfa-tab__state::before { background: #d39a00; }
.rfa-tab--invalid .rfa-tab__state::before { background: #c0392b; }
.rfa-nav .rfa-run-link { margin: 0 0 8px; }
.rfa-state { display: inline-block; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; border: 1px solid transparent; }
.rfa-state--complete { background: #e7f5ec; color: #14663a; border-color: #b7e0c6; }
.rfa-state--incomplete, .rfa-state--attention { background: #fff5dd; color: #7a5300; border-color: #f0d79a; }
.rfa-state--invalid { background: #fdecea; color: #962d22; border-color: #f2b8b1; }
.rfa-state--na, .rfa-state--unavailable { background: #f0f1f5; color: #4d5270; border-color: #d9dce6; }
.rfa-section-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 12px 0 10px; }
.rfa-section-head__title { margin: 0; font-size: 22px; }
.rfa-cell { position: relative; }
.rfa-cell--disputed input { border-color: #c98a00; background: #fffaf0; }
.rfa-cell--invalid input { border-color: #c0392b; background: #fdf3f2; }
.rfa-cell--not_applicable input { background: #f6f7fa; }
.rfa-cell__state { display: block; font-size: 11px; color: var(--rfde-ink-3, #4d5270); }
.rfa-cell__state--missing { color: #7a5300; }
.rfa-key { display: inline-block; padding: 0 5px; border-radius: 4px; font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .03em; background: #e8ecfd; color: #2b3fb0; }
.rfa-grid-group th { background: var(--rfde-soft, #f4f5f9); font-weight: 700; text-align: start; }
.rfa-chips { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 6px 0 10px; padding: 0; list-style: none; font-size: 13.5px; }
.rfa-defs { margin: 0 0 8px; padding-inline-start: 18px; }
.rfa-run { border-color: var(--rfde-accent, #3b55e6); }
.rfa-run .rfa-ticks { margin: 0 0 10px; border: 1px solid var(--rfde-line, #d9dce6); border-radius: 8px; padding: 8px 12px; }
.rfa-run__btn.is-busy { opacity: .75; cursor: progress; }
.rfa-blocked { margin: 8px 0 12px; padding: 10px 14px; border: 1px solid #f2b8b1; border-radius: 8px; background: #fdecea; }
.rfa-blocked h3 { margin: 0 0 4px; font-size: 15px; }
.rfa-intake-section__ref { display: inline-block; margin-inline-start: 6px; font-size: 12px; font-weight: 500; color: var(--rfde-ink-3, #4d5270); }
@media (max-width: 640px) {
	.rfa-nav .rfa-jump { display: flex; }
	.rfa-nav .rfa-tabs { display: flex; overflow-x: auto; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
	.rfa-nav .rfa-tab { flex: 0 0 158px; scroll-snap-align: start; }
}
.rfa-nav .rfa-more { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }

.rfa-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 10px; margin: 0 0 14px; padding: 0; list-style: none; }
.rfa-card { padding: 12px; border: 1px solid var(--rfde-line, #d9dce6); border-radius: 8px; background: var(--rfde-paper, #fff); }
.rfa-card__slot { margin: 0; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--rfde-ink-3, #4d5270); }
.rfa-card__name { margin: 2px 0 6px; font-weight: 600; font-size: 14px; }
.rfa-card__value { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.rfa-card--status .rfa-card__value { font-size: 14px; font-weight: 600; }
/* Large amounts: a smaller face, and a break only as a last resort — never an overflow. */
.rfa-card__value { overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.rfa-card--money .rfa-card__value { font-size: 18px; }
.rfa-card__sub { margin: 0 0 4px; font-size: 12px; color: var(--rfde-ink-3, #4d5270); }

.rfa-warnings { margin: 0 0 14px; padding: 0; list-style: none; }
.rfa-warning { margin: 0 0 8px; padding: 8px 10px; border-inline-start: 3px solid var(--rfde-line, #d9dce6); background: #fafbfd; font-size: 14px; }
.rfa-warning--priority { border-inline-start-color: #b3261e; }
.rfa-warning--watch { border-inline-start-color: #b26a00; }
.rfa-warning--data { border-inline-start-color: #2a4bd7; }
.rfa-warning__sev { display: inline-block; margin-inline-end: 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; }
.rfa-warning__figs { font-size: 13px; color: var(--rfde-ink-3, #4d5270); }

.rfa-details { margin: 0 0 10px; padding: 8px 12px; border: 1px solid var(--rfde-line, #d9dce6); border-radius: 8px; }
.rfa-details > summary { cursor: pointer; font-weight: 600; }
.rfa-details[open] > summary { margin-block-end: 8px; }
.rfa-details--engine { background: #fafbfd; }

.rfa-notes { margin: 0; padding: 0; list-style: none; }
.rfa-note { margin: 0 0 10px; padding: 10px; border: 1px solid var(--rfde-line, #d9dce6); border-radius: 6px; }
.rfa-decide { margin: 8px 0 14px; }
.rfa-rows input[type="text"], .rfa-rows input[type="date"], .rfa-rows select { min-inline-size: 110px; }
.rfa-choose { display: flex; flex-wrap: wrap; gap: 10px; margin: 0 0 10px; padding: 0; list-style: none; }

.rfa-intake-section { margin: 0 0 18px; padding-block-start: 12px; border-block-start: 1px solid var(--rfde-line, #d9dce6); }
.rfa-intake-section__title { margin: 0 0 10px; font-size: 16px; }
.rfa-intake-section__title span { color: var(--rfde-accent, #3b55e6); margin-inline-end: 4px; }
.rfa-dash .rfde-dl__row { grid-template-columns: minmax(150px, 38%) 1fr; }

@media (max-width: 640px) {
	.rfa-card__value { font-size: 18px; }
	.rfde-dl__row { grid-template-columns: 1fr; gap: 2px; }
}

@media print {
	.rfa-nav, .rfa-decide, .rfde-actions, .rfde-form { display: none !important; }
	.rfa-details { border: 0; padding: 0; }
	.rfa-details > summary { display: none; }
	.rfa-details:not([open]) > *:not(summary) { display: block; }
}

/* ---------------------------------------------------------------------------
 * 1.16.1 — the Altman score against its own model's bands.
 *
 * Readable with no colour at all: every zone carries its name and its
 * inequality as text, and the sentence under the scale repeats model, period,
 * score, band and both boundaries. Colour is confirmation, never the message.
 *
 * The scale itself is forced left-to-right in every language (the element
 * carries dir="ltr"): a number line runs low to high, and mirroring it in
 * Arabic would put distress on the right and invert what the picture says.
 * ------------------------------------------------------------------------- */

.rfde-zrange { margin: 16px 0 0; }

.rfde-zrange__scale {
	position: relative;
	display: flex;
	min-height: 64px;
	margin-top: 26px;
	border: 1px solid var(--resolve-rule, #c9ccd6);
	border-radius: 3px;
	overflow: visible;
}

.rfde-zband {
	flex: 1 1 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 2px;
	padding: 8px 10px;
	text-align: center;
	border-inline-end: 1px solid var(--resolve-rule, #c9ccd6);
}

.rfde-zband:last-child { border-inline-end: 0; }

.rfde-zband__label { font-weight: 600; font-size: 13px; letter-spacing: .02em; }
.rfde-zband__rule  { font-size: 12px; font-variant-numeric: tabular-nums; opacity: .85; }

/* Semantic tones, over labels that already say what they mean. Strong enough
   to read as DISTRESS / GREY / SAFE at a glance, light enough that the black
   label text on top stays well above contrast minimums. */
.rfde-zband--distress { background: #FBE3E0; }
.rfde-zband--grey     { background: #ECEEF2; }
.rfde-zband--safe     { background: #E0F0E8; }
.rfde-zband--distress .rfde-zband__label { color: #8C2F26; }
.rfde-zband--safe     .rfde-zband__label { color: #1E6B4A; }

/* The band the engine actually assigned: a weight change, not only a colour. */
.rfde-zband.is-current {
	box-shadow: inset 0 0 0 2px var(--resolve-accent, #5A68C4);
	font-weight: 700;
}

.rfde-zmark {
	position: absolute;
	top: -22px;
	bottom: 0;
	width: 0;
	border-inline-start: 2px solid var(--resolve-ink, #181818);
	transform: translateX(-1px);
}

.rfde-zmark__value {
	position: absolute;
	top: -4px;
	inset-inline-start: 50%;
	transform: translateX(-50%);
	white-space: nowrap;
	background: var(--resolve-ink, #181818);
	color: #fff;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
	padding: 1px 7px;
	border-radius: 2px;
}

/* A score outside the drawn window is pinned to the edge and said to be so;
   the number in the chip is still the exact engine score. */
.rfde-zmark--beyond { border-inline-start-style: dashed; }
.rfde-zmark--beyond .rfde-zmark__value::after { content: " \2192"; }
.rfde-zmark--beyond-low .rfde-zmark__value::after { content: " \2190"; }

.rfde-zbounds {
	display: flex;
	justify-content: space-between;
	list-style: none;
	margin: 4px 33.333% 0;
	padding: 0;
	font-size: 12px;
	font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
	.rfde-zrange__scale { min-height: 0; flex-direction: column; }
	.rfde-zband { border-inline-end: 0; border-bottom: 1px solid var(--resolve-rule, #c9ccd6); }
	.rfde-zband:last-child { border-bottom: 0; }
	/* Stacked, a horizontal marker position would be meaningless. */
	.rfde-zmark { display: none; }
	.rfde-zbounds { margin-inline: 0; }
}

@media print {
	/* The core result and its scale never break across a page. */
	.rfde-zrange { break-inside: avoid-page; page-break-inside: avoid; }
	.rfde-zband--distress, .rfde-zband--grey, .rfde-zband--safe { background: transparent; }
	.rfde-zband { border-inline-end: 1px solid #999; }
	.rfde-zband.is-current { box-shadow: inset 0 0 0 2px #000; }
	.rfde-zmark__value { background: #000; color: #fff; }
}

/*
 * 1.16.3 — onboarding step 4, "Enter Your Company's Financial Data": the
 * three intake method cards and their panels (Fa\Intake\StepFour), and the
 * request tracker. Existing tokens and fallbacks only; logical properties,
 * so the Arabic layout mirrors without a separate rule.
 */
.rfa-im-wrap { --rfa-im-line: var(--r-line, #d9dce6); --rfa-im-ink-3: var(--r-ink-3, #4d5270); --rfa-im-accent: var(--r-accent, #3b55e6); --rfa-im-paper: var(--r-paper, #fff); }
.rfa-im { margin: 0 0 18px; padding: 0; border: 0; min-inline-size: 0; }
.rfa-im__legend { margin: 0 0 10px; padding: 0; font-weight: 600; font-size: 16px; }
/* Three methods since 1.16.3.2 (the two paid cards became one door), so the
 * track count follows the available width rather than a fixed count. */
.rfa-im__cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin: 0 0 8px; padding: 0; list-style: none; }
.rfa-im-card { position: relative; display: flex; flex-direction: column; padding: 14px 14px 12px; border: 1px solid var(--rfa-im-line); border-radius: 10px; background: var(--rfa-im-paper); }
.rfa-im-card .rfa-im-radio { position: absolute; inset-block-start: 16px; inset-inline-end: 14px; inline-size: 18px; block-size: 18px; margin: 0; accent-color: var(--rfa-im-accent); }
.rfa-im-card__label { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; padding-inline-end: 28px; font-weight: 600; cursor: pointer; }
.rfa-im-card__label::after { content: ""; position: absolute; inset: 0; border-radius: 10px; }
.rfa-im-card__num { display: inline-grid; place-items: center; inline-size: 24px; block-size: 24px; border-radius: 50%; background: var(--rfa-im-accent); color: #fff; font-size: 13px; }
.rfa-im-card__body { margin-block-start: 8px; font-size: 14px; }
.rfa-im-card__body p { margin: 0 0 8px; }
.rfa-im-card__next { font-size: 12px; font-weight: 600; color: var(--rfa-im-ink-3); text-transform: uppercase; letter-spacing: .02em; }
.rfa-im-card__steps { margin: 0; padding-inline-start: 18px; font-size: 13px; color: var(--rfa-im-ink-3); }
.rfa-im-card__steps li { margin: 0 0 4px; }
.rfa-im-card:has(.rfa-im-radio:checked) { border-color: var(--rfa-im-accent); box-shadow: 0 0 0 2px var(--rfa-im-accent) inset; }
.rfa-im-card:has(.rfa-im-radio:focus-visible) { outline: 2px solid var(--rfa-im-accent); outline-offset: 2px; }
.rfa-im-card.is-unavailable { opacity: .7; }
.rfa-im-card.is-unavailable .rfa-im-card__label { cursor: not-allowed; }
.rfa-im-badge { display: inline-block; padding: 1px 8px; border-radius: 999px; background: #eef1fd; color: var(--rfa-im-accent); font-size: 12px; font-weight: 600; }
/* What a method costs, said on the card rather than discovered later. */
.rfa-im-cost { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.rfa-im-cost.is-free { background: #eef8ef; color: #2e7d32; }
.rfa-im-cost.is-paid { background: #fff7e8; color: #8a5300; }
.rfa-im-rec { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--rfa-im-accent); color: #fff; font-size: 12px; font-weight: 600; }
.rfa-im-card.is-recommended { border-color: var(--rfa-im-accent); }
.rfa-im__hint { margin: 0; }

.rfa-im-panel { margin: 0 0 18px; padding: 14px 16px; border: 1px solid var(--rfa-im-line); border-radius: 10px; }
.rfa-im-panel__title { margin: 0 0 10px; font-size: 16px; }
@supports selector(:has(*)) {
	.rfa-im-panel { display: none; }
	.rfa-im-wrap:has(.rfa-im-radio[value="manual"]:checked) .rfa-im-panel[data-rfa-method="manual"],
	.rfa-im-wrap:has(.rfa-im-radio[value="template"]:checked) .rfa-im-panel[data-rfa-method="template"],
	.rfa-im-wrap:has(.rfa-im-radio[value="service"]:checked) .rfa-im-panel[data-rfa-method="service"] { display: block; }
	.rfa-im-wrap:has(.rfa-im-radio:checked) .rfa-im__hint { display: none; }
}
.rfa-im-sub { margin: 0 0 6px; font-weight: 600; }
.rfa-im-box { margin: 10px 0; padding: 12px; border-radius: 8px; background: #f6f7fb; }
.rfa-im-steps { margin: 0; padding-inline-start: 20px; }
.rfa-im-steps > li { margin: 0 0 16px; }
.rfa-im-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.rfa-im-agree { display: flex; margin: 8px 0; }
.rfa-im-terms-list { margin: 8px 0; padding-inline-start: 18px; font-size: 13px; color: var(--rfa-im-ink-3); }
.rfa-im-files { margin: 0 0 8px; padding-inline-start: 18px; font-size: 13px; }
.rfa-im-errors { margin-block-start: 0; }
.rfa-im-checks { margin: 0 0 8px; padding-inline-start: 18px; font-size: 13px; color: #8a5300; }
.rfa-im-warnings, .rfa-im-lines, .rfa-im-history, .rfa-im-closed, .rfa-im-cancel { margin: 8px 0; font-size: 13px; }
.rfa-im-warnings summary, .rfa-im-lines summary, .rfa-im-history summary, .rfa-im-closed summary, .rfa-im-cancel summary { cursor: pointer; font-weight: 600; }
.rfa-im-preview { margin: 8px 0; padding: 12px; border: 1px solid var(--rfa-im-line); border-radius: 8px; }
.rfa-im-preview h4 { margin: 0 0 6px; font-size: 15px; }
.rfa-im-preview tr.is-conflict td, .rfa-im-conflicts td { background: #fff7e8; }
.rfde-conflict { color: #8a5300; font-weight: 600; }
.rfa-im-ready__count { margin: 0 0 6px; }
.rfa-im-ready__needs { margin: 0 0 8px; padding-inline-start: 18px; font-size: 13px; }
.rfa-im-ready__run.is-ok, .rfa-im-ready__latest.is-complete { color: #2e7d32; }
.rfa-im-ready__run.is-blocked, .rfa-im-ready__latest.is-partial { color: #8a5300; }
.rfa-im-req { margin: 10px 0; padding: 12px; border: 1px solid var(--rfa-im-line); border-radius: 8px; }
.rfa-im-req__head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.rfa-im-req__head h4 { margin: 0; font-size: 15px; }
.rfa-im-status { display: inline-block; padding: 2px 10px; border-radius: 999px; background: #eef1fd; color: var(--rfa-im-accent); font-size: 12px; font-weight: 600; }
.rfa-im-status--awaiting_company_input, .rfa-im-status--awaiting_approval { background: #fff7e8; color: #8a5300; }
.rfa-im-status--completed { background: #eef8ef; color: #2e7d32; }
.rfa-im-status--cancelled { background: #f1f1f4; color: var(--rfa-im-ink-3); }
.rfa-im-services ul { margin: 0; padding: 0; list-style: none; }
.rfa-im-svc { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 8px; padding: 10px; border: 1px solid var(--rfa-im-line); border-radius: 8px; }
.rfa-im-svc label { display: grid; gap: 2px; cursor: pointer; }
.rfa-im-svc__name { font-weight: 600; }
.rfa-im-svc__scope, .rfa-im-svc__terms { font-size: 13px; color: var(--rfa-im-ink-3); }
.rfa-im-svc:has(input:checked) { border-color: var(--rfa-im-accent); }
/* Manual entry: the fourteen sections shown as five short stages, one open
 * where the work is. Logical properties throughout, so Arabic mirrors. */
.rfa-im-stages { margin: 10px 0; }
.rfa-im-stage { margin: 0 0 6px; border: 1px solid var(--rfa-im-line); border-radius: 8px; background: var(--rfa-im-paper); }
.rfa-im-stage__title { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.rfa-im-stage__count { font-size: 12px; font-weight: 600; color: var(--rfa-im-ink-3); }
.rfa-im-stage[open] .rfa-im-stage__title { border-block-end: 1px solid var(--rfa-im-line); }
.rfa-im-stage__list { margin: 0; padding: 10px 12px; list-style: none; font-size: 14px; }
.rfa-im-stage__row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; margin: 0 0 6px; }
.rfa-im-stage__row:last-child { margin: 0; }
.rfa-im-stage__state { font-size: 12px; font-weight: 600; }
.rfa-im-stage__row.is-open .rfa-im-stage__state { color: #8a5300; }
.rfa-im-stage__row.is-done .rfa-im-stage__state { color: #2e7d32; }
/* A document request opened before the two paid cards became one. */
.rfa-im-legacy { margin: 0 0 14px; padding: 12px; border: 1px solid var(--rfa-im-line); border-radius: 8px; }
.rfa-im-form[hidden] { display: none; }
@media (max-width: 900px) {
	.rfa-im__cards { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
	.rfa-im-panel { padding: 12px; }
	.rfa-im-actions .resolve-btn { inline-size: 100%; }
}

/* ------------------------------------------------------------------
 * A2 (1.16.3.5) — the modal a refused import is announced in.
 *
 * <dialog> is used for what it already does correctly: it sits in the
 * top layer so nothing on the page can cover it, it centres itself, it
 * closes on Escape, it moves focus in and gives it back on close, and
 * it makes the rest of the page inert while it is open. None of that is
 * reimplemented here.
 *
 * The body scrolls rather than the dialog growing, because a workbook
 * can be refused for twenty reasons and all twenty are listed.
 * ------------------------------------------------------------------ */
.resolve-alert {
	inline-size: min(640px, calc(100vw - 32px));
	max-block-size: min(80vh, 760px);
	padding: 0;
	border: 1px solid var(--rfa-im-line, #d9dce6);
	border-radius: 12px;
	background: #fff;
	color: inherit;
	box-shadow: 0 24px 64px rgba(16, 20, 40, 0.28);
}
.resolve-alert::backdrop { background: rgba(16, 20, 40, 0.46); }
.resolve-alert__head {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 16px 18px 10px;
	border-block-end: 1px solid var(--rfa-im-line, #d9dce6);
}
.resolve-alert__title { margin: 0; flex: 1 1 auto; font-size: 18px; line-height: 1.3; }
.resolve-alert__close {
	flex: 0 0 auto;
	display: inline-flex;
	padding: 4px;
	border: 1px solid transparent;
	border-radius: 6px;
	background: none;
	color: inherit;
	cursor: pointer;
}
.resolve-alert__close:hover,
.resolve-alert__close:focus-visible { border-color: var(--rfa-im-line, #d9dce6); }
.resolve-alert__body { padding: 14px 18px; overflow-y: auto; max-block-size: calc(80vh - 150px); }
.resolve-alert__foot {
	display: flex;
	justify-content: flex-end;
	padding: 10px 18px 16px;
	border-block-start: 1px solid var(--rfa-im-line, #d9dce6);
}
/* Inside the dialog the block is the content, so it carries no frame. */
.resolve-alert .rfa-im-flash { margin: 0; }
.resolve-alert .rfa-im-flash__title { display: none; } /* the dialog's own title says it */

.rfa-im-flash__title { margin: 0 0 8px; font-size: 17px; }
.rfa-im-flash__lead { margin: 12px 0 6px; font-weight: 600; }
.rfa-im-flash__safe {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f6f7fb;
	font-size: 14px;
}

@media (max-width: 680px) {
	.resolve-alert { inline-size: calc(100vw - 20px); max-block-size: calc(100vh - 40px); }
	.resolve-alert__body { max-block-size: calc(100vh - 190px); }
}

/* ------------------------------------------------------------------
 * B2 (1.16.3.5) — the schedules as a labelled grid.
 *
 * Desktop: a table, one column per field the schedule actually defines,
 * so seventeen columns stay readable by scrolling the table rather than
 * the page. Phone: each record becomes a stacked card whose rows carry
 * their own label, because a seventeen-column table on a phone is not a
 * layout problem that column widths can solve.
 * ------------------------------------------------------------------ */
/*
 * min-inline-size:0 is what keeps the scroll container honest. A grid or
 * flex item's default minimum is its CONTENT, so a seventeen-column table
 * pushed its own parent wider than the page and the whole page scrolled
 * sideways instead of the table. The overflow belongs to the table.
 */
.rfde-sched { margin: 0 0 12px; max-inline-size: 100%; min-inline-size: 0; }
.rfde-sched__scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-inline-size: 100%; min-inline-size: 0; }
/* The table fills the scroll box when it fits and falls back to its own
 * minimum width when it does not, so the sideways scroll stays as short as
 * the columns require instead of expanding to every input's natural width. */
.rfde-sched__table { inline-size: 100%; border-collapse: collapse; font-size: 13px; }
.rfde-sched__table th {
	padding: 6px 8px;
	border-block-end: 1px solid var(--rfde-line, #d9dce6);
	text-align: start;
	white-space: nowrap;
	font-size: 12px;
	font-weight: 600;
}
.rfde-sched__table td { padding: 4px 4px; vertical-align: middle; }
.rfde-sched__input { inline-size: 100%; min-inline-size: 90px; padding: 5px 7px; font-size: 13px; }
.rfde-sched__rm { inline-size: 40px; }
.rfde-sched__rm .resolve-series__remove { block-size: 32px; }
.rfde-sched__actions { margin: 8px 0 0; }

@media (max-width: 860px) {
	.rfde-sched__table,
	.rfde-sched__table tbody,
	.rfde-sched__table tr,
	.rfde-sched__table td { display: block; inline-size: 100%; }
	.rfde-sched__table thead { position: absolute; inline-size: 1px; block-size: 1px; overflow: hidden; clip-path: inset(50%); }
	.rfde-sched__table tr {
		margin-block-end: 10px;
		padding: 8px;
		border: 1px solid var(--rfde-line, #d9dce6);
		border-radius: 8px;
	}
	.rfde-sched__table td {
		display: grid;
		grid-template-columns: minmax(110px, 38%) 1fr;
		gap: 8px;
		align-items: center;
		padding: 3px 0;
	}
	.rfde-sched__table td::before {
		content: attr(data-label);
		font-size: 12px;
		font-weight: 600;
		color: var(--rfde-ink-3, #4d5270);
	}
	.rfde-sched__table td.rfde-sched__rm { grid-template-columns: 1fr; justify-items: end; }
	.rfde-sched__table td.rfde-sched__rm::before { content: none; }
}

/* 1.16.3.5 (D2) — the method card's icon sits with its number and title on
 * one baseline, and inherits the card's colour like every other icon in the
 * set. It is aria-hidden: the title is still the card's name. */
.rfa-im-card__label { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rfa-im-card__icon { display: inline-flex; color: var(--rfde-accent, #3b55e6); }
