/* Home Addition Planner — scoped to .hap-planner so the theme stays unaffected.
   To change colors, override these variables in Appearance > Customize > Additional CSS. */

.hap-planner {
	--hap-navy: #111827;        /* title box and buttons */
	--hap-navy-hover: #1f2a3d;
	--hap-ink: #0f172a;         /* headings and labels */
	--hap-text: #334155;
	--hap-muted: #64748b;       /* intro and helper text */
	--hap-line: #e2e8f0;        /* card borders */
	--hap-field-line: #cbd5e1;  /* input borders */
	--hap-bg-soft: #f8fafc;
	--hap-good: #15803d;
	--hap-danger: #b42318;
	--hap-radius-box: 28px;
	--hap-radius-field: 12px;
	--hap-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Helvetica, Arial, sans-serif;

	container-type: inline-size;
	font-family: var(--hap-font);
	color: var(--hap-text);
	font-size: 17px;
	line-height: 1.55;
	margin: 1.5em 0;
	-webkit-font-smoothing: antialiased;
}

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

.hap-planner h2,
.hap-planner h3,
.hap-planner h4,
.hap-planner button,
.hap-planner input,
.hap-planner textarea { font-family: var(--hap-font); }

.hap-planner .hap-hidden { display: none !important; }
.hap-planner .hap-print-only { display: none; }

/* ---------- title box ---------- */

.hap-planner .hap-hero {
	background: var(--hap-navy);
	color: #fff;
	border-radius: var(--hap-radius-box);
	padding: clamp(1.75em, 5cqi, 3.4em) clamp(1.4em, 4.5cqi, 3.6em);
	margin: 0 0 1.6em;
	box-shadow: 0 24px 48px -28px rgba(15, 23, 42, .45);
}
.hap-planner .hap-eyebrow {
	margin: 0 0 1em;
	font-size: .9em;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: #e2e8f0;
}
.hap-planner .hap-title {
	margin: 0 0 .45em;
	font-size: clamp(2.1rem, 6.4cqi, 4.6rem);
	font-weight: 500;
	line-height: 1.05;
	letter-spacing: -.035em;
	color: #fff;
}
.hap-planner .hap-hero .hap-lede {
	margin: 0 0 1em;
	max-width: 52em;
	font-size: clamp(1.05em, 2.1cqi, 1.45em);
	line-height: 1.6;
	color: #e5e7eb;
}
.hap-planner .hap-hero-note {
	margin: 0;
	max-width: 62em;
	font-size: clamp(.95em, 1.6cqi, 1.1em);
	line-height: 1.6;
	color: #cbd5e1;
}

/* ---------- white cards ---------- */

.hap-planner .hap-card,
.hap-planner .hap-section {
	background: #fff;
	border: 1px solid var(--hap-line);
	border-radius: var(--hap-radius-box);
	box-shadow: 0 16px 36px -28px rgba(15, 23, 42, .28);
}

.hap-planner .hap-actions {
	padding: 1.6em clamp(1.2em, 4cqi, 2.4em);
	margin: 0 0 1.6em;
}
.hap-planner .hap-actions--bottom { margin: 2em 0 1em; padding-top: 2em; }
.hap-planner .hap-actions__title {
	margin: 0 0 .35em;
	font-size: clamp(1.6em, 3.6cqi, 2.2em);
	font-weight: 500;
	line-height: 1.15;
	letter-spacing: -.03em;
	color: var(--hap-ink);
}
.hap-planner .hap-actions__text {
	margin: 0 0 1.3em;
	color: var(--hap-muted);
	font-size: 1.05em;
}

.hap-planner .hap-notice {
	margin: 0 0 1.2em;
	padding: .9em 1.1em;
	border-radius: var(--hap-radius-field);
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #7c2d12;
	font-size: .95em;
}

.hap-planner .hap-progress {
	display: flex;
	align-items: center;
	gap: .9em;
	margin: 0 0 1.2em;
}
.hap-planner .hap-progress__bar {
	flex: 1;
	height: 8px;
	background: #e2e8f0;
	border-radius: 99px;
	overflow: hidden;
}
.hap-planner .hap-progress__fill {
	display: block;
	height: 100%;
	width: 0;
	background: var(--hap-navy);
	border-radius: 99px;
	transition: width .3s ease;
}
.hap-planner .hap-progress__text {
	font-size: .9em;
	color: var(--hap-muted);
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

/* ---------- buttons ---------- */

.hap-planner .hap-toolbar {
	display: flex;
	flex-wrap: wrap;
	gap: .7em;
	margin: 0 0 .8em;
}
.hap-planner .hap-btn {
	appearance: none;
	font-size: 1em;
	font-weight: 700;
	line-height: 1.2;
	padding: .95em 1.45em;
	min-height: 48px;
	border-radius: 16px;
	border: 1px solid var(--hap-navy);
	background: var(--hap-navy);
	color: #fff;
	cursor: pointer;
	text-transform: none;
	letter-spacing: normal;
	text-decoration: none;
	box-shadow: none;
	transition: background .15s ease, border-color .15s ease, color .15s ease;
}
.hap-planner .hap-btn:hover { background: var(--hap-navy-hover); border-color: var(--hap-navy-hover); color: #fff; }
.hap-planner .hap-btn:focus-visible { outline: 3px solid #94a3b8; outline-offset: 2px; }
.hap-planner .hap-btn--danger { background: #fff; color: var(--hap-ink); border-color: var(--hap-field-line); }
.hap-planner .hap-btn--danger:hover { background: #fff; color: var(--hap-danger); border-color: var(--hap-danger); }

.hap-planner .hap-status {
	min-height: 1.4em;
	margin: 0;
	font-size: .88em;
	color: var(--hap-muted);
}
.hap-planner .hap-status--error { color: var(--hap-danger); font-weight: 600; }

/* ---------- sections ---------- */

.hap-planner .hap-section {
	margin: 0 0 1.1em;
	scroll-margin-top: 1.5em;
}
.hap-planner .hap-section__summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	padding: 1.25em clamp(1.2em, 4cqi, 2.4em);
	cursor: pointer;
	list-style: none;
}
.hap-planner .hap-section__summary::-webkit-details-marker { display: none; }
.hap-planner .hap-section__summary::after {
	content: "";
	flex: 0 0 auto;
	width: .6em;
	height: .6em;
	margin: 0 .2em .2em .4em;
	border-right: 2px solid var(--hap-ink);
	border-bottom: 2px solid var(--hap-ink);
	transform: rotate(45deg);
	transition: transform .15s ease;
}
.hap-planner .hap-section[open] > .hap-section__summary::after { transform: rotate(-135deg); margin-bottom: -.2em; }
.hap-planner .hap-section__summary:focus-visible { outline: 3px solid #94a3b8; outline-offset: -3px; border-radius: var(--hap-radius-box); }
.hap-planner .hap-section__title {
	flex: 1;
	margin: 0;
	font-size: clamp(1.3em, 3.2cqi, 1.9em);
	font-weight: 500;
	line-height: 1.2;
	letter-spacing: -.025em;
	color: var(--hap-ink);
}
.hap-planner .hap-section__count {
	font-size: .88em;
	color: var(--hap-muted);
	font-variant-numeric: tabular-nums;
}
.hap-planner .hap-section__count.is-complete { color: var(--hap-good); font-weight: 700; }
.hap-planner .hap-section__inner { padding: 0 clamp(1.2em, 4cqi, 2.4em) 1.8em; }
.hap-planner .hap-section__intro {
	margin: 0 0 1.4em;
	color: var(--hap-muted);
	font-size: 1.08em;
}

.hap-planner .hap-block { margin: 0 0 1.5em; }
.hap-planner .hap-block:last-child { margin-bottom: 0; }
.hap-planner .hap-block__title {
	margin: 1.6em 0 .7em;
	font-size: 1.2em;
	font-weight: 600;
	letter-spacing: -.01em;
	color: var(--hap-ink);
}

/* ---------- fields ---------- */

.hap-planner .hap-field { margin: 0 0 1.25em; }
.hap-planner .hap-label {
	display: block;
	margin: 0 0 .45em;
	font-weight: 600;
	font-size: 1em;
	color: var(--hap-ink);
}
.hap-planner .hap-input {
	display: block;
	width: 100%;
	max-width: 100%;
	margin: 0;
	padding: .75em .95em;
	font-size: 1em;
	line-height: 1.45;
	color: var(--hap-ink);
	background: #fff;
	border: 1px solid var(--hap-field-line);
	border-radius: var(--hap-radius-field);
	box-shadow: none;
}
.hap-planner .hap-input:focus {
	outline: none;
	border-color: var(--hap-navy);
	box-shadow: 0 0 0 3px rgba(17, 24, 39, .12);
}
.hap-planner .hap-input--area { resize: vertical; min-height: 3em; overflow: hidden; }
.hap-planner .hap-input--money { text-align: right; font-variant-numeric: tabular-nums; }
.hap-planner .hap-print-value { display: none; }

/* ---------- tables ---------- */

.hap-planner .hap-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	border: 1px solid var(--hap-line);
	border-radius: 18px;
}
.hap-planner .hap-table {
	width: 100%;
	border-collapse: collapse;
	margin: 0;
	font-size: .95em;
	border: 0;
}
.hap-planner .hap-table th,
.hap-planner .hap-table td {
	padding: .55em .75em;
	border: 0;
	border-bottom: 1px solid var(--hap-line);
	text-align: left;
	vertical-align: top;
	background: transparent;
}
.hap-planner .hap-table thead th {
	background: var(--hap-bg-soft);
	font-size: .85em;
	color: var(--hap-muted);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	white-space: nowrap;
}
.hap-planner .hap-table tbody th { font-weight: 500; color: var(--hap-ink); padding-top: .95em; }
.hap-planner .hap-table tbody tr:last-child th,
.hap-planner .hap-table tbody tr:last-child td { border-bottom: 0; }
.hap-planner .hap-table tfoot th,
.hap-planner .hap-table tfoot td {
	border-top: 2px solid var(--hap-ink);
	border-bottom: 0;
	font-weight: 700;
	color: var(--hap-ink);
	background: var(--hap-bg-soft);
}
.hap-planner .hap-table .hap-num { text-align: right; font-variant-numeric: tabular-nums; }
.hap-planner .hap-table .hap-input { border-radius: 10px; padding: .55em .7em; }
.hap-planner .hap-table--budget td { width: 9.5em; }
.hap-planner .hap-table--budget tfoot td { padding: .8em 1.4em; }
.hap-planner .hap-table--bids { min-width: 640px; }
.hap-planner .hap-table--bids tbody th { width: 30%; }
.hap-planner .hap-table--bids .hap-input--area { min-height: 2.6em; }

.hap-planner .hap-budget__diff { margin: .7em 0 0; font-size: .95em; font-weight: 600; }
.hap-planner .hap-budget__diff.is-over { color: var(--hap-danger); }
.hap-planner .hap-budget__diff.is-under { color: var(--hap-good); }

/* ---------- checklist ---------- */

.hap-planner .hap-checklist { list-style: none; margin: 0; padding: 0; }
.hap-planner .hap-checklist__item {
	display: flex;
	align-items: flex-start;
	gap: .75em;
	margin: 0;
	padding: .6em 0;
	border-bottom: 1px solid var(--hap-line);
	color: var(--hap-ink);
}
.hap-planner .hap-checklist__item:last-child { border-bottom: 0; }
.hap-planner .hap-check {
	flex: 0 0 auto;
	width: 1.25em;
	height: 1.25em;
	margin: .15em 0 0;
	accent-color: var(--hap-navy);
	cursor: pointer;
}
.hap-planner .hap-checklist__item label { cursor: pointer; }

.hap-planner .hap-footer {
	margin: 1.5em 0 0;
	font-size: .82em;
	color: var(--hap-muted);
}

/* ---------- small screens ---------- */

@container (max-width: 560px) {
	.hap-planner { --hap-radius-box: 22px; }
	.hap-planner .hap-btn { flex: 1 1 calc(50% - .7em); padding-left: .8em; padding-right: .8em; }
	.hap-planner .hap-btn:first-child { flex-basis: 100%; }
	.hap-planner .hap-table--budget td { width: 7.5em; }
}

/* ---------- print ---------- */

@media print {
	.hap-planner { font-size: 11pt; color: #000; margin: 0; }
	.hap-planner .hap-no-print,
	.hap-planner .hap-status,
	.hap-planner .hap-section__summary::after { display: none !important; }
	.hap-planner .hap-print-only { display: block; }
	.hap-planner .hap-hero { background: none; color: #000; padding: 0; margin: 0 0 12pt; box-shadow: none; border-radius: 0; }
	.hap-planner .hap-title { color: #000; font-size: 22pt; }
	.hap-planner .hap-print-meta { margin: 0 0 1em; color: #444; font-size: 9pt; }
	.hap-planner .hap-section { border: 0; border-radius: 0; box-shadow: none; margin: 0 0 1em; }
	.hap-planner .hap-section__summary { padding: 0; }
	.hap-planner .hap-section__title { font-size: 14pt; border-bottom: 2px solid #000; padding-bottom: 2pt; break-after: avoid; }
	.hap-planner .hap-section__inner { padding: 0; }
	.hap-planner .hap-section__intro { color: #444; margin-top: 6pt; }
	.hap-planner .hap-field { break-inside: avoid; margin-bottom: 8pt; }

	/* Answers print as text; blank answers print as write-in lines. */
	.hap-planner .hap-input { display: none !important; }
	.hap-planner .hap-print-value {
		display: block;
		white-space: pre-wrap;
		min-height: 1.6em;
		border-bottom: 1px solid #999;
		padding: 2pt 0;
	}
	.hap-planner .hap-field .hap-print-value:empty { min-height: 2.8em; }
	.hap-planner .hap-table-wrap { overflow: visible; border: 0; border-radius: 0; }
	.hap-planner .hap-table { min-width: 0 !important; font-size: 9.5pt; }
	.hap-planner .hap-table th,
	.hap-planner .hap-table td { border: 1px solid #999 !important; }
	.hap-planner .hap-table .hap-print-value { border: 0; min-height: 1.4em; }
	.hap-planner .hap-table tr { break-inside: avoid; }
	.hap-planner .hap-check { accent-color: #000; }
}
