/**
 * Self-contained worksheet for the Builders Risk Delay Estimator.
 * System fonts, neutral palette, no host-theme matching.
 */

.brde {
	--brde-ink: #1a2332;
	--brde-muted: #3d4856;
	--brde-paper: #f3f4f6;
	--brde-sheet: #ffffff;
	--brde-line: #d0d5dd;
	--brde-line-strong: #1f4b5a;
	--brde-focus: #0b6e8a;
	--brde-error: #6e1a24;
	--brde-warn-bg: #f8f1dc;
	--brde-warn-ink: #3f320e;
	--brde-covered: #1d5c45;
	--brde-gap: #7a3030;
	box-sizing: border-box;
	max-width: 72rem;
	margin: 0 auto;
	padding: 1.75rem 1.5rem 2.75rem;
	background: var(--brde-paper);
	color: var(--brde-ink);
	border: 1px solid var(--brde-line);
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	font-size: 1rem;
	line-height: 1.5;
	letter-spacing: normal;
}

.brde *,
.brde *::before,
.brde *::after {
	box-sizing: border-box;
}

.brde h1,
.brde h2,
.brde h3,
.brde p,
.brde ul,
.brde ol,
.brde dl,
.brde dd,
.brde figure,
.brde blockquote {
	margin: 0;
	padding: 0;
	color: inherit;
	font-family: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	background: transparent;
}

.brde h1,
.brde h2,
.brde h3 {
	font-weight: 650;
	line-height: 1.25;
	letter-spacing: -0.015em;
}

.brde a {
	color: #1a4d5c;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.16em;
}

.brde a:hover {
	color: #0f3340;
}

.brde [hidden] {
	display: none !important;
}

.brde :focus-visible {
	outline: 2px solid var(--brde-focus);
	outline-offset: 2px;
}

.brde-visually-hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.brde-masthead h1 {
	font-size: 1.85rem;
	margin-bottom: 0.4rem;
}

.brde-masthead p {
	max-width: 40rem;
	margin-bottom: 1.5rem;
	color: var(--brde-muted);
}

.brde-progress {
	display: flex;
	gap: 0.75rem;
	list-style: none;
	margin: 0 0 1.35rem;
	padding: 0;
	counter-reset: brde-step;
}

.brde-progress li {
	flex: 1;
	min-width: 0;
	padding-top: 0.45rem;
	border-top: 3px solid var(--brde-line);
	color: var(--brde-muted);
	font-size: 0.84rem;
	line-height: 1.3;
}

.brde-progress li::before {
	counter-increment: brde-step;
	content: counter(brde-step) ". ";
	font-variant-numeric: tabular-nums;
}

.brde-progress li[aria-current="step"] {
	border-top-color: var(--brde-line-strong);
	color: var(--brde-ink);
	font-weight: 650;
}

.brde-progress li.is-skipped {
	border-top-style: dashed;
}

.brde-workspace.is-split {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 17.5rem;
	gap: 1.5rem;
	align-items: start;
}

.brde-workspace > * {
	min-width: 0;
}

.brde-step-title {
	font-size: 1.35rem;
	margin-bottom: 1rem;
}

.brde fieldset {
	border: 0;
	margin: 0 0 1.15rem;
	padding: 0;
	min-inline-size: 0;
}

.brde legend {
	padding: 0;
	margin-bottom: 0.55rem;
	font-weight: 650;
	line-height: 1.4;
}

.brde-field {
	margin: 0 0 1.15rem;
}

.brde-label-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.15rem 0.35rem;
}

.brde label {
	font-weight: 650;
	line-height: 1.4;
}

.brde-hint,
.brde-note {
	display: block;
	margin-top: 0.35rem;
	color: var(--brde-muted);
	font-size: 0.92rem;
}

.brde-note {
	margin: 0 0 1rem;
	padding: 0.55rem 0.7rem;
	background: var(--brde-sheet);
	border-left: 3px solid var(--brde-line-strong);
	color: var(--brde-ink);
}

.brde input[type="text"],
.brde input[type="date"],
.brde select {
	display: block;
	width: 100%;
	max-width: 32rem;
	min-height: 44px;
	margin-top: 0.35rem;
	padding: 0.5rem 0.7rem;
	border: 1px solid #b7c0cc;
	border-radius: 0;
	background: var(--brde-sheet);
	color: var(--brde-ink);
	font: inherit;
	box-shadow: none;
}

.brde input[type="date"] {
	color-scheme: light;
}

.brde input[aria-invalid="true"],
.brde select[aria-invalid="true"] {
	border-color: var(--brde-error);
	border-width: 2px;
}

.brde-choice {
	display: flex;
	align-items: flex-start;
	gap: 0.65rem;
	min-height: 44px;
	margin: 0 0 0.45rem;
	padding: 0.65rem 0.75rem;
	border: 1px solid var(--brde-line);
	background: var(--brde-sheet);
	font-weight: 450;
	cursor: pointer;
}

.brde-choice input {
	width: 1.15rem;
	height: 1.15rem;
	margin-top: 0.2rem;
	flex: 0 0 auto;
	accent-color: var(--brde-line-strong);
}

.brde-choice:has(input:checked) {
	border-color: var(--brde-line-strong);
	background: #e7eef0;
}

.brde-choice:has(input[aria-invalid="true"]) {
	border-color: var(--brde-error);
}

.brde-error {
	margin-top: 0.35rem;
	color: var(--brde-error);
	font-size: 0.92rem;
}

.brde-warning {
	margin-top: 0.35rem;
	padding: 0.4rem 0.55rem;
	background: var(--brde-warn-bg);
	color: var(--brde-warn-ink);
	font-size: 0.92rem;
}

.brde-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem;
	margin-top: 0.4rem;
}

.brde-btn {
	min-height: 44px;
	min-width: 44px;
	padding: 0.55rem 1.1rem;
	border: 1px solid var(--brde-line-strong);
	border-radius: 0;
	background: var(--brde-sheet);
	color: var(--brde-ink);
	font: inherit;
	font-weight: 650;
	cursor: pointer;
}

.brde-btn-primary {
	background: var(--brde-line-strong);
	color: #ffffff;
}

.brde-btn:hover {
	background: #e7eef0;
}

.brde-btn-primary:hover {
	background: #163844;
	color: #ffffff;
}

.brde-tip-host {
	position: relative;
	display: inline-block;
	vertical-align: middle;
}

.brde-tip-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: 0;
	padding: 0;
	border: 1px solid #b7c0cc;
	border-radius: 0;
	background: var(--brde-sheet);
	color: var(--brde-ink);
	font: inherit;
	font-weight: 650;
	line-height: 1;
	cursor: help;
}

.brde-tip-btn[aria-expanded="true"] {
	border-color: var(--brde-line-strong);
	background: #e7eef0;
}

.brde-tip {
	position: absolute;
	z-index: 30;
	left: 0;
	top: calc(100% + 0.25rem);
	width: max-content;
	max-width: min(22rem, 80vw);
	padding: 0.65rem 0.75rem;
	background: var(--brde-ink);
	color: #f4f6f8;
	font-size: 0.9rem;
	font-weight: 450;
	line-height: 1.45;
	text-align: left;
	letter-spacing: normal;
}

.brde-glossary {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin: 0.15rem 0 0.75rem;
}

.brde-glossary .brde-tip-btn {
	width: auto;
	min-width: 44px;
	padding: 0 0.7rem;
	background: transparent;
	font-weight: 450;
	text-decoration: underline;
	text-decoration-style: dotted;
	text-underline-offset: 0.18em;
}

.brde-summary {
	position: sticky;
	top: 1rem;
	padding: 0.9rem 1rem 0.35rem;
	background: var(--brde-sheet);
	border-top: 3px solid var(--brde-line-strong);
}

.brde-summary h2 {
	font-size: 1.05rem;
	margin-bottom: 0.7rem;
}

.brde-summary dl {
	margin: 0;
}

.brde-summary dt {
	color: var(--brde-muted);
	font-size: 0.82rem;
}

.brde-summary dd {
	margin: 0 0 0.7rem;
	font-variant-numeric: tabular-nums;
}

.brde-results h2 {
	font-size: 1.55rem;
	margin-bottom: 0.45rem;
	font-variant-numeric: tabular-nums;
}

.brde-results > p {
	max-width: 42rem;
	margin-bottom: 0.85rem;
	font-variant-numeric: tabular-nums;
}

.brde-callout {
	padding: 0.75rem 0.85rem;
	background: var(--brde-sheet);
	border-left: 3px solid var(--brde-line-strong);
	font-weight: 650;
}

.brde-results h3 {
	font-size: 1.1rem;
	margin: 1.4rem 0 0.45rem;
}

.brde-timeline-text {
	max-width: 42rem;
}

.brde-timeline-bar {
	display: block;
	width: 100%;
	height: 0.9rem;
	margin: 0.65rem 0 0.45rem;
	background: var(--brde-line);
}

.brde-seg-waiting {
	fill: #c5ced6;
}

.brde-seg-covered {
	fill: #1f4b5a;
}

.brde-seg-beyond {
	fill: #c9a8a8;
}

.brde-timeline-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.45rem 1rem;
	list-style: none;
	margin: 0 0 0.4rem;
	padding: 0;
	font-variant-numeric: tabular-nums;
}

.brde-swatch {
	display: inline-block;
	width: 0.85rem;
	height: 0.85rem;
	margin-right: 0.35rem;
	vertical-align: -0.1rem;
	border: 1px solid var(--brde-ink);
}

.brde-swatch-waiting {
	background: #c5ced6;
}

.brde-swatch-covered {
	background: #1f4b5a;
}

.brde-swatch-beyond {
	background: #c9a8a8;
}

.brde-breakdown {
	margin: 0.4rem 0 0.2rem;
	overflow-x: auto;
}

.brde-table {
	width: 100%;
	min-width: 36rem;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.brde-table caption {
	caption-side: top;
	text-align: left;
	font-weight: 650;
	margin-bottom: 0.4rem;
}

.brde-table th,
.brde-table td {
	padding: 0.45rem 0.55rem;
	border-bottom: 1px solid var(--brde-line);
	text-align: right;
	vertical-align: bottom;
	background: var(--brde-sheet);
}

.brde-table th:first-child,
.brde-table td:first-child {
	text-align: left;
}

.brde-table thead th {
	font-weight: 650;
	background: #e7eaee;
}

.brde-table tfoot th,
.brde-table tfoot td {
	font-weight: 650;
	border-top: 2px solid var(--brde-ink);
	border-bottom: 0;
}

.brde-results ul {
	margin: 0.2rem 0 0.4rem;
	padding-left: 1.2rem;
	max-width: 42rem;
}

.brde-results li {
	margin-bottom: 0.3rem;
}

.brde-disclaimer {
	max-width: 42rem;
	margin-top: 0.35rem;
}

.brde-results .brde-btn {
	margin-top: 0.85rem;
}

.brde-sample {
	margin: 0 0 0.35rem;
}

.brde-sensitivity {
	width: 100%;
	max-width: 36rem;
	margin: 0.35rem 0 1rem;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.brde-sensitivity caption {
	caption-side: top;
	text-align: left;
	font-weight: 650;
	margin-bottom: 0.35rem;
}

.brde-sensitivity th,
.brde-sensitivity td {
	padding: 0.4rem 0.75rem 0.4rem 0;
	border-bottom: 1px solid var(--brde-line);
	text-align: right;
	vertical-align: baseline;
	background: transparent;
}

.brde-sensitivity th:first-child,
.brde-sensitivity td:first-child {
	text-align: left;
}

.brde-sensitivity tr.is-used th {
	font-weight: 650;
}

.brde-mitigation {
	margin-top: 1.6rem;
	padding-top: 0.2rem;
	border-top: 1px solid var(--brde-line);
}

.brde-mitigation h3 {
	font-size: 1.1rem;
	margin: 0.8rem 0 0.4rem;
}

.brde-mitigation-copy {
	max-width: 42rem;
	margin: 0 0 0.75rem;
}

.brde-editorial {
	max-width: 68ch;
	margin-top: 2.5rem;
}

.brde-editorial h2 {
	font-size: 1.35rem;
	margin-bottom: 0.75rem;
}

.brde-editorial p,
.brde-editorial li {
	margin-bottom: 0.8rem;
}

.brde-editorial ul {
	margin: 0 0 0.8rem;
	padding-left: 1.2rem;
}

.brde-faq h3 {
	font-size: 1.05rem;
	margin: 1.15rem 0 0.35rem;
}

@media (max-width: 720px) {
	.brde-workspace.is-split {
		grid-template-columns: minmax(0, 1fr);
	}

	.brde-summary {
		position: static;
	}
}

@media (max-width: 640px) {
	.brde {
		padding: 1rem 0.85rem 2rem;
	}

	.brde-masthead h1 {
		font-size: 1.55rem;
	}

	.brde-progress {
		flex-direction: column;
		gap: 0.35rem;
	}

	.brde-progress li {
		border-top: 0;
		border-left: 3px solid var(--brde-line);
		padding: 0.35rem 0 0.35rem 0.65rem;
	}

	.brde-progress li[aria-current="step"] {
		border-left-color: var(--brde-line-strong);
	}

	.brde-results h2 {
		font-size: 1.3rem;
	}

	.brde input[type="text"],
	.brde input[type="date"],
	.brde select {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.brde *,
	.brde *::before,
	.brde *::after {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}
}
