/* Source-faithful eCFR rating schedules retain a narrow percentage column and
 * bounded hierarchy instead of expanding descriptions to max-content. */
/* Source graphics use the same bounded reading width as CFR rating tables.
 * Height remains intrinsic so diagrams are enlarged without distortion. */
.nva-authority__graphic {
	width: 100%;
}

/* Non-rating authority tables wrap inside the available reading region. Their
 * column-count class selects a bounded narrow-view minimum, so avoidable
 * desktop overflow disappears while horizontal scrolling remains available
 * when a viewport is genuinely too narrow. */
.nva-authority-table--responsive:not(.nva-authority-table--matrix) table {
	width: 100%;
	table-layout: auto;
}

.nva-authority-table--responsive:not(.nva-authority-table--matrix) th,
.nva-authority-table--responsive:not(.nva-authority-table--matrix) td {
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
}

.nva-authority-table--responsive.nva-authority-table--columns-1 table,
.nva-authority-table--responsive.nva-authority-table--columns-2 table {
	min-width: 36rem;
}

.nva-authority-table--responsive.nva-authority-table--columns-3 table,
.nva-authority-table--responsive.nva-authority-table--columns-4 table {
	min-width: 48rem;
}

/* Dense source matrices may use the wider authority-table region, but their
 * columns wrap within that region instead of expanding to max-content. A
 * bounded minimum preserves horizontal scrolling only on narrower views. */
.nva-authority-table--matrix table {
	width: 100%;
	min-width: 48rem;
	table-layout: fixed;
}

.nva-authority-table--matrix th,
.nva-authority-table--matrix td {
	white-space: normal;
	overflow-wrap: anywhere;
	word-break: normal;
}

.nva-authority-table--matrix tr:first-child > :first-child:not(:only-child) {
	width: 20%;
}

.nva-authority-table--rating {
	width: 100%;
	max-width: 100%;
	margin-inline: 0;
	transform: none;
}

.nva-authority-table--rating table {
	width: 100%;
	min-width: 0;
	table-layout: fixed;
}

.nva-authority-table--rating tr > :first-child {
	overflow-wrap: anywhere;
}

.nva-authority-table--rating tr > :last-child:not([colspan]) {
	box-sizing: border-box;
	width: var(--nva-authority-rating-column-width, calc(6ch + 1rem + 2px));
	white-space: nowrap;
}

/* Fixed-layout tables otherwise distribute spare width across every declared
 * column. Give the leading description cell the exact remainder so a verified
 * rating width remains an actual width instead of only a minimum. */
.nva-authority-table--rating-columns-1 tr:first-child > :first-child:not(:last-child) {
	width: calc(100% - var(--nva-authority-rating-column-width));
}

.nva-authority-table--rating thead tr > :last-child:not([colspan]) {
	text-align: center;
}

.nva-authority-table--rating tbody tr > :last-child:not([colspan]),
.nva-authority-table--rating tfoot tr > :last-child:not([colspan]) {
	text-align: right;
}

/* Some approved mirror packages retain column scope but flatten thead into
 * tbody. Scope is the stable semantic cue for the Rating column heading. */
.nva-authority-table--rating tr > :last-child[scope="col"]:not([colspan]) {
	text-align: center;
}

/* Grouped rating columns share the largest verified header/value requirement;
 * the description column receives every remaining pixel. */
.nva-authority-table--rating-columns-2 tr > :last-child[colspan="2"] {
	box-sizing: border-box;
	width: calc(var(--nva-authority-rating-column-width) + var(--nva-authority-rating-column-width));
	text-align: center;
}

.nva-authority-table--rating-columns-2 tr:first-child > :first-child[rowspan] {
	width: calc(100% - var(--nva-authority-rating-column-width) - var(--nva-authority-rating-column-width));
}

.nva-authority-table--rating-columns-2 tr > :nth-last-child(-n+2):not([colspan]):not([rowspan]) {
	box-sizing: border-box;
	width: var(--nva-authority-rating-column-width);
	white-space: nowrap;
}

.nva-authority-table--rating-columns-2 tbody tr > :nth-last-child(-n+2):not([colspan]):not([rowspan]),
.nva-authority-table--rating-columns-2 tfoot tr > :nth-last-child(-n+2):not([colspan]):not([rowspan]) {
	text-align: right;
}

.nva-authority-table--rating-columns-2 tr > :nth-last-child(-n+2)[scope="col"]:not([colspan]):not([rowspan]) {
	text-align: center;
}

.nva-authority-table--rating-width-2 { --nva-authority-rating-column-width: calc(2ch + 1rem + 2px); }
.nva-authority-table--rating-width-3 { --nva-authority-rating-column-width: calc(3ch + 1rem + 2px); }
.nva-authority-table--rating-width-4 { --nva-authority-rating-column-width: calc(4ch + 1rem + 2px); }
.nva-authority-table--rating-width-5 { --nva-authority-rating-column-width: calc(5ch + 1rem + 2px); }
.nva-authority-table--rating-width-6 { --nva-authority-rating-column-width: calc(6ch + 1rem + 2px); }
.nva-authority-table--rating-width-7 { --nva-authority-rating-column-width: calc(7ch + 1rem + 2px); }
.nva-authority-table--rating-width-8 { --nva-authority-rating-column-width: calc(8ch + 1rem + 2px); }
.nva-authority-table--rating-width-9 { --nva-authority-rating-column-width: calc(9ch + 1rem + 2px); }
.nva-authority-table--rating-width-10 { --nva-authority-rating-column-width: calc(10ch + 1rem + 2px); }
.nva-authority-table--rating-width-11 { --nva-authority-rating-column-width: calc(11ch + 1rem + 2px); }
.nva-authority-table--rating-width-12 { --nva-authority-rating-column-width: calc(12ch + 1rem + 2px); }
.nva-authority-table--rating-width-13 { --nva-authority-rating-column-width: calc(13ch + 1rem + 2px); }
.nva-authority-table--rating-width-14 { --nva-authority-rating-column-width: calc(14ch + 1rem + 2px); }
.nva-authority-table--rating-width-15 { --nva-authority-rating-column-width: calc(15ch + 1rem + 2px); }
.nva-authority-table--rating-width-16 { --nva-authority-rating-column-width: calc(16ch + 1rem + 2px); }

.nva-authority-table--rating tbody th {
	font-weight: 400;
	background: transparent;
}

.nva-authority-table--rating tbody th[colspan] {
	font-weight: 700;
	background: var(--wp--preset--color--mist);
}

.nva-authority-table .nva-authority-cell--left {
	text-align: left;
}

.nva-authority-table .nva-authority-cell--center {
	text-align: center;
}

.nva-authority-table .nva-authority-cell--right {
	text-align: right;
}

/* Numeric CFR subparagraphs are the second level beneath lettered paragraphs.
 * The approved mirror flattens these siblings, so restore the visible outline. */
.nva-authority__content > .nva-authority__outline--numeric {
	padding-inline-start: 2rem;
}

.nva-authority__node--p > .nva-authority__outline--numeric-inline {
	display: block;
	margin-block-start: 0.5rem;
	padding-inline-start: 2rem;
}

.nva-authority__content > .nva-authority__outline--roman {
	padding-inline-start: 4rem;
}

.nva-authority__outline--numeric > .nva-authority__outline--roman-inline {
	display: block;
	margin-block-start: 0.5rem;
	padding-inline-start: 2rem;
}

.nva-authority-table [class*="nva-authority-cell--indent-"] {
	padding-inline-start: var(--nva-authority-source-indent);
	text-indent: -1rem;
}

.nva-authority-cell--indent-1 {
	--nva-authority-source-indent: 3rem;
}

.nva-authority-cell--indent-2 {
	--nva-authority-source-indent: 5rem;
}

.nva-authority-cell--indent-3 {
	--nva-authority-source-indent: 7rem;
}

.nva-authority-cell--indent-4 {
	--nva-authority-source-indent: 9rem;
}

.nva-authority-cell--indent-5 {
	--nva-authority-source-indent: 11rem;
}

.nva-authority-cell--indent-6 {
	--nva-authority-source-indent: 13rem;
}

.nva-authority-cell--indent-7 {
	--nva-authority-source-indent: 15rem;
}

.nva-authority-cell--indent-8 {
	--nva-authority-source-indent: 17rem;
}

.nva-authority-cell--indent-9 {
	--nva-authority-source-indent: 19rem;
}

.nva-authority-cell--indent-10 {
	--nva-authority-source-indent: 21rem;
}

.nva-authority-cell--indent-11 {
	--nva-authority-source-indent: 23rem;
}

.nva-authority-cell--indent-12 {
	--nva-authority-source-indent: 25rem;
}

@media (max-width: 600px) {
	.nva-authority__content > .nva-authority__outline--numeric {
		padding-inline-start: 1.25rem;
	}

	.nva-authority__node--p > .nva-authority__outline--numeric-inline {
		padding-inline-start: 1.25rem;
	}

	.nva-authority__content > .nva-authority__outline--roman {
		padding-inline-start: 2.5rem;
	}

	.nva-authority__outline--numeric > .nva-authority__outline--roman-inline {
		padding-inline-start: 1.25rem;
	}

	.nva-authority-table .nva-authority-cell--indent-1 {
		--nva-authority-source-indent: 2rem;
	}

	.nva-authority-table .nva-authority-cell--indent-2 {
		--nva-authority-source-indent: 3rem;
	}

	.nva-authority-table .nva-authority-cell--indent-3 {
		--nva-authority-source-indent: 4rem;
	}

	.nva-authority-table .nva-authority-cell--indent-4 {
		--nva-authority-source-indent: 5rem;
	}

	.nva-authority-table .nva-authority-cell--indent-5 {
		--nva-authority-source-indent: 6rem;
	}

	.nva-authority-table .nva-authority-cell--indent-6,
	.nva-authority-table .nva-authority-cell--indent-7,
	.nva-authority-table .nva-authority-cell--indent-8,
	.nva-authority-table .nva-authority-cell--indent-9,
	.nva-authority-table .nva-authority-cell--indent-10,
	.nva-authority-table .nva-authority-cell--indent-11,
	.nva-authority-table .nva-authority-cell--indent-12 {
		--nva-authority-source-indent: 7rem;
	}
}

@media print {
	.nva-authority-table--responsive table {
		min-width: 0;
	}

	.nva-authority-table .nva-authority-cell--indent-1 {
		--nva-authority-source-indent: 1.5rem;
	}

	.nva-authority-table .nva-authority-cell--indent-2 {
		--nva-authority-source-indent: 2.5rem;
	}

	.nva-authority-table .nva-authority-cell--indent-3 {
		--nva-authority-source-indent: 3.5rem;
	}

	.nva-authority-table .nva-authority-cell--indent-4 {
		--nva-authority-source-indent: 4.5rem;
	}

	.nva-authority-table .nva-authority-cell--indent-5 {
		--nva-authority-source-indent: 5.5rem;
	}

	.nva-authority-table .nva-authority-cell--indent-6,
	.nva-authority-table .nva-authority-cell--indent-7,
	.nva-authority-table .nva-authority-cell--indent-8,
	.nva-authority-table .nva-authority-cell--indent-9,
	.nva-authority-table .nva-authority-cell--indent-10,
	.nva-authority-table .nva-authority-cell--indent-11,
	.nva-authority-table .nva-authority-cell--indent-12 {
		--nva-authority-source-indent: 6.5rem;
	}
}
