/**
 * Self-contained neutral UI for the Ordinance or Law Gap Estimator.
 * Palette, type, and spacing are set here and do not follow the host theme.
 */

.olge#olge-estimator {
	--olge-ink: #1a2332;
	--olge-muted: #4a5568;
	--olge-line: #d5dde6;
	--olge-canvas: #f4f6f8;
	--olge-surface: #ffffff;
	--olge-accent: #1f4b73;
	--olge-accent-dark: #163654;
	--olge-focus: #0a66c2;
	--olge-warning-bg: #fbf6ea;
	--olge-warning-ink: #6b4e00;
	--olge-error: #8f1d3a;
	--olge-error-bg: #fdf2f4;
	box-sizing: border-box;
	max-width: 52rem;
	margin: 1.5rem auto;
	padding: 2rem 1.5rem 2.5rem;
	background: var(--olge-canvas);
	color: var(--olge-ink);
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 1.0625rem;
	line-height: 1.65;
	border: 1px solid var(--olge-line);
	border-radius: 12px;
}

.olge#olge-estimator *,
.olge#olge-estimator *::before,
.olge#olge-estimator *::after {
	box-sizing: border-box;
}

.olge#olge-estimator h1,
.olge#olge-estimator h2,
.olge#olge-estimator h3,
.olge#olge-estimator p,
.olge#olge-estimator ul,
.olge#olge-estimator ol,
.olge#olge-estimator figure,
.olge#olge-estimator blockquote {
	font-family: inherit;
	color: inherit;
	margin: 0;
}

.olge#olge-estimator h1 {
	font-size: 2rem;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.02em;
	margin-bottom: 1rem;
}

.olge#olge-estimator h2 {
	font-size: 1.45rem;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.015em;
	margin: 1.75rem 0 0.75rem;
}

.olge#olge-estimator h3 {
	font-size: 1.15rem;
	line-height: 1.35;
	font-weight: 700;
	margin: 0 0 0.6rem;
}

.olge#olge-estimator p,
.olge#olge-estimator ul,
.olge#olge-estimator ol {
	margin-bottom: 0.9rem;
}

.olge#olge-estimator ul,
.olge#olge-estimator ol {
	padding-left: 1.25rem;
}

.olge#olge-estimator li + li {
	margin-top: 0.45rem;
}

.olge#olge-estimator a {
	color: var(--olge-accent);
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.olge#olge-estimator a:hover {
	color: var(--olge-accent-dark);
}

.olge#olge-estimator strong {
	font-weight: 700;
}

.olge#olge-estimator :focus-visible {
	outline: 3px solid var(--olge-focus);
	outline-offset: 2px;
}

.olge#olge-estimator [hidden] {
	display: none !important;
}

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

.olge-editorial,
.olge-faq,
.olge-tool {
	margin: 0;
}

.olge-tool {
	margin-top: 1.75rem;
	padding: 1.25rem;
	background: var(--olge-surface);
	border: 1px solid var(--olge-line);
	border-radius: 10px;
}

.olge-tool h2 {
	margin-top: 0;
}

.olge-progress {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	list-style: none;
	margin: 0 0 1.25rem;
	padding: 0;
}

.olge-progress li {
	flex: 1 1 8rem;
	display: flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
	padding: 0.45rem 0.6rem;
	background: var(--olge-canvas);
	border: 1px solid var(--olge-line);
	border-radius: 8px;
	color: var(--olge-muted);
	font-size: 0.9rem;
	font-weight: 600;
}

.olge-progress li[aria-current="step"] {
	color: var(--olge-ink);
	border-color: var(--olge-accent);
	background: #eef4f9;
}

.olge-progress li.is-complete {
	color: var(--olge-accent);
}

.olge-progress-index {
	display: inline-grid;
	place-items: center;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 999px;
	background: #e4ebf2;
	font-size: 0.8rem;
}

.olge-progress li[aria-current="step"] .olge-progress-index {
	background: var(--olge-accent);
	color: #fff;
}

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

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

.olge#olge-estimator legend {
	font-weight: 700;
	padding: 0;
	margin-bottom: 0.45rem;
}

.olge#olge-estimator label,
.olge#olge-estimator legend {
	font-size: 1rem;
	line-height: 1.4;
}

.olge#olge-estimator label {
	display: inline-block;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.olge-help {
	color: var(--olge-muted);
	font-size: 0.95rem;
	margin-top: 0.35rem;
}

.olge#olge-estimator input[type="text"],
.olge#olge-estimator input[type="number"],
.olge#olge-estimator select {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: 0.7rem 0.75rem;
	background: #fff;
	color: var(--olge-ink);
	border: 1px solid #b7c3d0;
	border-radius: 8px;
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
	box-shadow: none;
}

.olge#olge-estimator input[type="radio"],
.olge#olge-estimator input[type="checkbox"] {
	width: 1.15rem;
	height: 1.15rem;
	margin: 0.15rem 0 0;
	accent-color: var(--olge-accent);
	flex: 0 0 auto;
}

.olge-options {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

.olge-option {
	display: flex;
	align-items: flex-start;
	gap: 0.6rem;
	margin: 0;
	padding: 0.65rem 0.75rem;
	background: #fff;
	border: 1px solid var(--olge-line);
	border-radius: 8px;
}

.olge-option label {
	margin: 0;
	font-weight: 600;
	flex: 1 1 auto;
}

.olge-option.is-selected {
	border-color: var(--olge-accent);
	background: #f3f7fb;
	box-shadow: inset 3px 0 0 var(--olge-accent);
}

.olge-error,
.olge-warning {
	margin: 0.4rem 0 0;
	padding: 0.45rem 0.65rem;
	border-radius: 6px;
	font-size: 0.95rem;
}

.olge-error {
	color: var(--olge-error);
	background: var(--olge-error-bg);
	border: 1px solid #f0c6d0;
}

.olge-warning {
	color: var(--olge-warning-ink);
	background: var(--olge-warning-bg);
	border: 1px solid #ead7a4;
}

.olge-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin-top: 0.5rem;
}

.olge#olge-estimator .olge-btn {
	appearance: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	margin: 0;
	padding: 0.6rem 1.1rem;
	border-radius: 8px;
	border: 1px solid transparent;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.2;
	cursor: pointer;
	text-decoration: none;
}

.olge#olge-estimator .olge-btn-primary {
	background: var(--olge-accent);
	color: #fff;
	border-color: var(--olge-accent);
}

.olge#olge-estimator .olge-btn-primary:hover {
	background: var(--olge-accent-dark);
	border-color: var(--olge-accent-dark);
	color: #fff;
}

.olge#olge-estimator .olge-btn-secondary {
	background: #fff;
	color: var(--olge-ink);
	border-color: #b7c3d0;
}

.olge#olge-estimator .olge-btn-secondary:hover {
	background: var(--olge-canvas);
	color: var(--olge-ink);
}

.olge-term {
	position: relative;
	display: inline-block;
}

.olge#olge-estimator .olge-tip-trigger {
	appearance: none;
	display: inline;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	font-weight: inherit;
	line-height: inherit;
	letter-spacing: inherit;
	text-align: inherit;
	text-decoration: underline dotted;
	text-underline-offset: 0.18em;
	cursor: help;
}

.olge-tip {
	display: none;
	position: absolute;
	z-index: 30;
	left: 0;
	top: calc(100% + 0.35rem);
	width: min(18rem, 70vw);
	padding: 0.65rem 0.75rem;
	background: var(--olge-ink);
	color: #fff;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.45;
	letter-spacing: 0;
	text-align: left;
	box-shadow: 0 8px 24px rgba(26, 35, 50, 0.18);
}

.olge-term:hover:not(.is-dismissed) .olge-tip,
.olge-term:focus-within:not(.is-dismissed) .olge-tip,
.olge-term.is-open .olge-tip {
	display: block;
}

.olge-results {
	margin-top: 1.5rem;
	padding-top: 0.25rem;
}

.olge-results h2 {
	margin-top: 0;
}

.olge-headline {
	margin: 0 0 0.9rem;
	padding: 1.1rem 1.15rem;
	background: #f7fafc;
	border: 1px solid var(--olge-line);
	border-radius: 10px;
}

.olge-lead {
	margin-bottom: 0.85rem;
}

.olge-figure {
	display: block;
	margin-top: 0.15rem;
	font-size: 1.7rem;
	line-height: 1.2;
	font-weight: 700;
	letter-spacing: -0.02em;
	font-variant-numeric: tabular-nums;
}

.olge-severity {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	margin: 0;
	padding: 0.3rem 0.65rem;
	border: 1px solid currentColor;
	border-radius: 999px;
	font-weight: 700;
	font-size: 0.95rem;
}

.olge-severity-icon {
	width: 1.15rem;
	height: 1.15rem;
	flex: 0 0 auto;
}

.olge-severity-none,
.olge-severity-low {
	color: #0f6b45;
	background: #e7f6ee;
}

.olge-severity-moderate {
	color: #8a5a12;
	background: #fbf4e6;
}

.olge-severity-high {
	color: #9a3412;
	background: #fbeee6;
}

.olge-severity-severe {
	color: #8f1d3a;
	background: #fbe8ec;
}

.olge-disclaimer,
.olge-itv {
	margin: 0 0 1.15rem;
	padding: 0.85rem 1rem;
	border: 1px solid var(--olge-line);
	border-radius: 8px;
	background: #fff;
}

.olge-disclaimer p,
.olge-itv p {
	margin: 0;
	font-weight: 400;
}

.olge-itv {
	background: var(--olge-warning-bg);
	border-color: #ead7a4;
}

.olge-block {
	margin: 0 0 1.25rem;
}

.olge-table-wrap {
	width: 100%;
	overflow-x: auto;
}

.olge#olge-estimator table {
	width: 100%;
	min-width: 36rem;
	border-collapse: collapse;
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

.olge#olge-estimator caption {
	caption-side: top;
	text-align: left;
}

.olge#olge-estimator th,
.olge#olge-estimator td {
	padding: 0.55rem 0.6rem;
	border-bottom: 1px solid var(--olge-line);
	text-align: left;
	vertical-align: top;
	font-weight: 400;
}

.olge#olge-estimator thead th {
	font-weight: 700;
	background: #eef3f7;
}

.olge#olge-estimator tbody th,
.olge#olge-estimator tfoot th {
	font-weight: 700;
}

.olge#olge-estimator tfoot th,
.olge#olge-estimator tfoot td {
	border-top: 2px solid var(--olge-ink);
	border-bottom: 0;
}

.olge-questions {
	margin-bottom: 0;
}

.olge-results-actions {
	margin-top: 0.25rem;
}

@media (max-width: 640px) {
	.olge#olge-estimator {
		margin: 0;
		padding: 1.25rem 0.9rem 1.75rem;
		border-radius: 0;
		border-left: 0;
		border-right: 0;
	}

	.olge#olge-estimator h1 {
		font-size: 1.55rem;
	}

	.olge#olge-estimator h2 {
		font-size: 1.25rem;
	}

	.olge-tool {
		padding: 0.9rem 0.75rem;
	}

	.olge-progress {
		flex-direction: column;
	}

	.olge-actions,
	.olge-results-actions {
		flex-direction: column;
	}

	.olge#olge-estimator .olge-btn {
		width: 100%;
	}

	.olge-figure {
		font-size: 1.35rem;
	}

	.olge#olge-estimator table {
		min-width: 32rem;
	}
}

@media (prefers-reduced-motion: reduce) {
	.olge#olge-estimator *,
	.olge#olge-estimator *::before,
	.olge#olge-estimator *::after {
		transition: none !important;
		animation: none !important;
	}
}
