/**
 * Nursing Home & Senior Living Loss Planner
 * Self-contained UI. Does not inherit host theme colors or type.
 */

.nhlp {
	--nhlp-bg: #f3f5f7;
	--nhlp-paper: #ffffff;
	--nhlp-ink: #1b2836;
	--nhlp-muted: #3e5163;
	--nhlp-line: #d3dce4;
	--nhlp-input-border: #b7c3cf;
	--nhlp-accent: #1c4e80;
	--nhlp-accent-dark: #163e66;
	--nhlp-focus: #0b57d0;
	--nhlp-danger: #8e1b1b;
	--nhlp-danger-bg: #fdecec;
	--nhlp-warn: #6f4500;
	--nhlp-warn-bg: #fff4dc;
	--nhlp-info: #18456e;
	--nhlp-info-bg: #e7f0f8;
	--nhlp-ok: #0f5c38;
	--nhlp-ok-bg: #e5f6ec;
	--nhlp-space: 8px;
	box-sizing: border-box;
	max-width: 760px;
	width: 100%;
	margin: 0 auto;
	padding: 24px 16px 40px;
	background: var(--nhlp-bg);
	color: var(--nhlp-ink);
	border: 1px solid var(--nhlp-line);
	border-radius: 2px;
	color-scheme: light;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	font-size: 16px;
	line-height: 1.5;
	overflow-x: clip;
}

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

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

.nhlp h2,
.nhlp h3,
.nhlp h4,
.nhlp p,
.nhlp ul,
.nhlp ol,
.nhlp table {
	color: inherit;
}

.nhlp h3,
.nhlp h4 {
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.nhlp :focus {
	outline: 3px solid var(--nhlp-focus);
	outline-offset: 2px;
}

.nhlp .nhlp-money input:focus {
	outline: none;
}

.nhlp-lead,
.nhlp-help,
.nhlp-step-status {
	color: var(--nhlp-muted);
	margin: 0 0 16px;
}

.nhlp-lead {
	margin-bottom: 24px;
}

.nhlp-progress {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	list-style: none;
	margin: 0 0 24px;
	padding: 0;
}

.nhlp-progress li {
	color: var(--nhlp-muted);
	padding-bottom: 4px;
	border-bottom: 2px solid transparent;
}

.nhlp-progress li[aria-current="step"] {
	color: var(--nhlp-accent);
	font-weight: 700;
	border-bottom-color: var(--nhlp-accent);
}

.nhlp-step-num {
	font-variant-numeric: tabular-nums;
}

.nhlp fieldset {
	border: 0;
	margin: 0 0 8px;
	padding: 0;
	min-inline-size: 0;
}

.nhlp legend {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 16px;
	float: none;
}

.nhlp legend h3 {
	margin: 0;
	font-size: 1.5rem;
}

.nhlp-q {
	font-weight: 700;
	margin: 16px 0 8px;
}

.nhlp-label-line {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.nhlp-field {
	margin: 16px 0 0;
}

.nhlp-field > label {
	display: block;
	font-weight: 700;
	margin-bottom: 8px;
}

.nhlp input[type="text"],
.nhlp select {
	display: block;
	width: 100%;
	max-width: 280px;
	min-height: 44px;
	padding: 8px 12px;
	border: 1px solid var(--nhlp-input-border);
	border-radius: 2px;
	background: var(--nhlp-paper);
	color: var(--nhlp-ink);
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.4;
}

.nhlp select {
	max-width: 100%;
}

.nhlp input.nhlp-invalid,
.nhlp select.nhlp-invalid,
.nhlp-money.nhlp-invalid {
	border-color: var(--nhlp-danger);
}

.nhlp-money {
	display: flex;
	align-items: center;
	gap: 4px;
	max-width: 280px;
	min-height: 44px;
	padding: 0 12px;
	border: 1px solid var(--nhlp-input-border);
	border-radius: 2px;
	background: var(--nhlp-paper);
}

.nhlp-money:focus-within {
	outline: 3px solid var(--nhlp-focus);
	outline-offset: 2px;
}

.nhlp-money input[type="text"] {
	border: 0;
	min-height: 42px;
	padding: 8px 0;
	max-width: none;
	background: transparent;
}

.nhlp-money-prefix {
	color: var(--nhlp-muted);
}

.nhlp-options {
	list-style: none;
	margin: 0 0 8px;
	padding: 0;
}

.nhlp-options li {
	display: flex;
	align-items: flex-start;
	gap: 8px;
	margin: 0;
	padding: 8px 0;
}

.nhlp-options input {
	width: 1.25rem;
	height: 1.25rem;
	margin-top: 2px;
	flex: 0 0 auto;
	accent-color: var(--nhlp-accent);
}

.nhlp-options label {
	flex: 1 1 auto;
	padding-top: 1px;
}

.nhlp-options.nhlp-invalid {
	outline: 2px solid var(--nhlp-danger);
	outline-offset: 4px;
}

.nhlp-error,
.nhlp-hint,
.nhlp-help {
	font-size: 0.9375rem;
	line-height: 1.45;
}

.nhlp-error {
	color: var(--nhlp-danger);
	margin: 8px 0 0;
}

.nhlp-hint {
	color: var(--nhlp-warn);
	margin: 8px 0 0;
}

.nhlp-derived {
	margin: 16px 0 0;
	padding: 12px 16px;
	background: var(--nhlp-paper);
	border: 1px solid var(--nhlp-line);
	font-weight: 700;
}

.nhlp-nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 16px 0 0;
}

.nhlp button {
	font-family: inherit;
	font-size: 1rem;
	line-height: 1.3;
	cursor: pointer;
}

.nhlp-primary,
.nhlp-back,
.nhlp-ghost {
	min-height: 44px;
	padding: 8px 16px;
	border-radius: 2px;
}

.nhlp-primary {
	background: var(--nhlp-accent);
	color: #ffffff;
	border: 1px solid var(--nhlp-accent);
	font-weight: 700;
}

.nhlp-primary:hover,
.nhlp-primary:focus {
	background: var(--nhlp-accent-dark);
	border-color: var(--nhlp-accent-dark);
	color: #ffffff;
}

.nhlp-primary:disabled,
.nhlp-back:disabled {
	background: #e6ebf0;
	color: var(--nhlp-muted);
	border-color: var(--nhlp-line);
	cursor: not-allowed;
}

.nhlp-back {
	background: var(--nhlp-paper);
	color: var(--nhlp-accent);
	border: 1px solid var(--nhlp-accent);
}

.nhlp-ghost {
	background: transparent;
	color: var(--nhlp-accent);
	border: 1px solid var(--nhlp-accent);
}

.nhlp-tip {
	width: 32px;
	height: 32px;
	min-width: 32px;
	padding: 0;
	border: 1px solid var(--nhlp-input-border);
	border-radius: 50%;
	background: var(--nhlp-paper);
	color: var(--nhlp-accent);
	font-weight: 700;
	line-height: 1;
}

.nhlp-tip-wrap {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	flex: 0 0 auto;
}

.nhlp-tip-bubble {
	position: absolute;
	z-index: 4;
	right: 0;
	left: auto;
	top: calc(100% + 8px);
	width: 1px;
	max-width: 1px;
	padding: 0;
	background: var(--nhlp-ink);
	color: #ffffff;
	border-radius: 2px;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.45;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	height: 1px;
	overflow: hidden;
	white-space: normal;
}

.nhlp-tip-wrap.is-open .nhlp-tip-bubble {
	clip: auto;
	clip-path: none;
	height: auto;
	width: min(280px, calc(100vw - 48px));
	max-width: 280px;
	padding: 8px 12px;
	overflow: visible;
}

.nhlp-results {
	margin-top: 32px;
	padding-top: 8px;
}

.nhlp-banner {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	padding: 12px 16px;
	font-weight: 700;
}

.nhlp-banner-attention {
	background: var(--nhlp-danger-bg);
	color: var(--nhlp-danger);
}

.nhlp-banner-review {
	background: var(--nhlp-warn-bg);
	color: var(--nhlp-warn);
}

.nhlp-banner-clear {
	background: var(--nhlp-ok-bg);
	color: var(--nhlp-ok);
}

.nhlp-trigger-info {
	background: var(--nhlp-info-bg);
	color: var(--nhlp-info);
}

.nhlp-hero {
	margin: 0 0 24px;
	font-size: 1.0625rem;
}

.nhlp-hero-value {
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -0.03em;
	line-height: 1.15;
	font-variant-numeric: tabular-nums;
}

.nhlp-stale {
	margin: 0 0 16px;
	color: var(--nhlp-warn);
}

.nhlp-trigger,
.nhlp-flags,
.nhlp-check {
	margin: 0 0 24px;
}

.nhlp-trigger {
	padding: 16px;
	background: var(--nhlp-paper);
	border: 1px solid var(--nhlp-line);
}

.nhlp-trigger h4,
.nhlp h4 {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 8px;
	font-size: 1.125rem;
}

.nhlp-trigger svg,
.nhlp-banner svg,
.nhlp-sev svg {
	width: 1.25rem;
	height: 1.25rem;
	flex: 0 0 auto;
}

.nhlp-trigger p:last-child,
.nhlp-flag p:last-child {
	margin-bottom: 0;
}

.nhlp-scroll {
	max-width: 100%;
	overflow-x: auto;
	margin: 0 0 24px;
	padding-bottom: 8px;
}

.nhlp-scroll-hint {
	margin: 0 0 8px;
	color: var(--nhlp-muted);
	font-size: 0.9375rem;
}

.nhlp table {
	width: 100%;
	min-width: 520px;
	border-collapse: collapse;
	background: var(--nhlp-paper);
	font-variant-numeric: tabular-nums;
}

.nhlp caption {
	caption-side: top;
	text-align: left;
	font-weight: 700;
	margin: 0 0 8px;
	padding: 0;
}

.nhlp th,
.nhlp td {
	padding: 8px 12px;
	border-bottom: 1px solid var(--nhlp-line);
	text-align: left;
	vertical-align: top;
}

.nhlp thead th {
	font-weight: 700;
}

.nhlp td,
.nhlp thead th:not(:first-child),
.nhlp tfoot td {
	text-align: right;
}

.nhlp tfoot th,
.nhlp tfoot td {
	font-weight: 700;
}

.nhlp table.nhlp-subtable {
	min-width: 0;
}

@media (min-width: 640px) {
	.nhlp-scroll-hint {
		display: none;
	}
}

.nhlp-flags {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nhlp-flag {
	margin: 0 0 8px;
	padding: 12px 16px;
	background: var(--nhlp-paper);
	border: 1px solid var(--nhlp-line);
	border-left-width: 4px;
}

.nhlp-flag-red {
	border-left-color: var(--nhlp-danger);
}

.nhlp-flag-amber {
	border-left-color: var(--nhlp-warn);
}

.nhlp-flag-info {
	border-left-color: var(--nhlp-info);
}

.nhlp-sev {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 4px;
	font-weight: 700;
}

.nhlp-flag-red .nhlp-sev {
	color: var(--nhlp-danger);
}

.nhlp-flag-amber .nhlp-sev {
	color: var(--nhlp-warn);
}

.nhlp-flag-info .nhlp-sev {
	color: var(--nhlp-info);
}

.nhlp-flag-title {
	margin: 0 0 4px;
	font-weight: 700;
}

.nhlp-flag-impact {
	margin: 8px 0 0;
	font-variant-numeric: tabular-nums;
}

.nhlp-flag ul,
.nhlp-check ul,
.nhlp-assumptions ul {
	margin: 8px 0 0;
	padding-left: 1.25rem;
}

.nhlp-check ul,
.nhlp-assumptions ul {
	margin: 0;
}

.nhlp-check li,
.nhlp-assumptions li,
.nhlp-flag li {
	margin: 0 0 8px;
}

.nhlp details {
	margin: 0 0 24px;
}

.nhlp summary {
	cursor: pointer;
	font-weight: 700;
	padding: 8px 0;
}

.nhlp-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 16px;
}

.nhlp-disclaimer {
	margin: 0;
	font-size: 1rem;
	line-height: 1.5;
	color: var(--nhlp-ink);
}

.nhlp-editorial {
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid var(--nhlp-line);
}

.nhlp-editorial section + section {
	margin-top: 40px;
}

.nhlp-editorial h2 {
	margin: 0 0 16px;
	font-size: 1.5rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.25;
}

.nhlp-editorial h3 {
	margin: 24px 0 8px;
	font-size: 1.125rem;
}

.nhlp-editorial p {
	margin: 0 0 16px;
	max-width: 65ch;
}

.nhlp-editorial a {
	color: var(--nhlp-accent);
	text-underline-offset: 2px;
}

.nhlp-editorial a:hover,
.nhlp-editorial a:focus {
	color: var(--nhlp-accent-dark);
}

@media (max-width: 480px) {
	.nhlp {
		padding: 16px 12px 32px;
	}

	.nhlp legend h3 {
		font-size: 1.35rem;
	}

	.nhlp-hero-value {
		display: block;
		margin: 4px 0;
	}

	.nhlp-nav button,
	.nhlp-actions button {
		flex: 1 1 100%;
	}
}

@media (min-width: 768px) {
	.nhlp {
		padding: 32px 32px 48px;
	}
}

.nhlp-time {
	margin: 16px 0 0;
}

.nhlp-time-track {
	display: flex;
	height: 18px;
	background: var(--nhlp-line);
	border-radius: 2px;
	overflow: hidden;
}

.nhlp-time-close,
.nhlp-time-rebuild {
	display: block;
	height: 100%;
}

.nhlp-time-close {
	background: var(--nhlp-accent);
}

.nhlp-time-wait {
	display: block;
	height: 100%;
	background: var(--nhlp-warn);
}

.nhlp-time-rebuild {
	background: var(--nhlp-ok);
}

.nhlp-time-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 8px 16px;
	margin-top: 8px;
}

.nhlp-swatch {
	display: inline-block;
	width: 12px;
	height: 12px;
	margin-right: 8px;
	border: 1px solid var(--nhlp-ink);
	vertical-align: -1px;
}

.nhlp-swatch-wait {
	background: var(--nhlp-warn);
}

.nhlp-swatch-close {
	background: var(--nhlp-accent);
}

.nhlp-swatch-rebuild {
	background: var(--nhlp-ok);
}

.nhlp-time ul,
.nhlp-closers ul,
.nhlp-ask ol {
	margin: 8px 0 0;
	padding-left: 1.25rem;
}

.nhlp-compare {
	margin-top: 8px;
	padding-top: 24px;
	border-top: 1px solid var(--nhlp-line);
}

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