/* Block: Home value calculator (bh/value-calculator) */
/* Anchor jumps (#calculator) leave the heading clear of the sticky header. */
.bh-vcalc { scroll-margin-top: 40px; }
.bh-vcalc:focus { outline: none; }
.bh-vcalc__head { margin-bottom: clamp(24px, 3vw, 36px); }
.bh-vcalc__title {
	margin-top: 10px;
	font: 300 clamp(1.875rem, 3.4vw, 2.75rem)/1.08 var(--wp--preset--font-family--display);
	letter-spacing: -.018em; color: var(--wp--preset--color--primary);
}
.bh-vcalc__head p { max-width: 60ch; margin-top: 10px; color: var(--wp--preset--color--body); }

.bh-vcalc__grid { display: grid; grid-template-columns: minmax(0, 1fr) 400px; gap: clamp(24px, 4vw, 48px); align-items: start; }
@media (max-width: 1023px) { .bh-vcalc__grid { grid-template-columns: minmax(0, 1fr); } }

/* Inputs */
.bh-vcalc__inputs {
	display: grid; gap: 26px; min-width: 0;
	padding: clamp(22px, 3vw, 36px);
	border-radius: var(--wp--custom--radius-lg, 6px);
	background: var(--wp--preset--color--white);
	box-shadow: 0 0 0 1px var(--wp--preset--color--line);
}
.bh-vcalc__q { display: grid; gap: 10px; min-width: 0; margin: 0; padding: 0; border: 0; }
fieldset.bh-vcalc__q { display: block; }
/* A floated legend sits in the flow, so the gap below it is a plain margin (10px like the other steps). */
fieldset.bh-vcalc__q > legend { float: left; width: 100%; margin: 0 0 10px; padding: 0; }
fieldset.bh-vcalc__q > legend + * { clear: both; }
.bh-vcalc__label {
	display: flex; align-items: center; min-height: 22px;
	font: 700 var(--wp--preset--font-size--x-small)/1.3 var(--wp--preset--font-family--body);
	letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--muted);
}
.bh-vcalc__n {
	display: inline-grid; place-items: center; flex-shrink: 0;
	width: 22px; height: 22px; margin-right: 8px; border-radius: 50%;
	background: var(--wp--preset--color--primary); color: var(--wp--preset--color--white);
	font: 700 11px/1 var(--wp--preset--font-family--body); letter-spacing: 0;
}
/* Bathrooms share step 4: an empty slot keeps both legends on the same line height. */
.bh-vcalc__n--blank { visibility: hidden; width: 0; margin-right: 0; }
.bh-vcalc__hint { font-size: .78125rem; color: var(--wp--preset--color--muted); }
/* Select and number field (own rules: listings.css is not loaded on this page) */
.bh-vcalc__select,
.bh-vcalc__unit input {
	width: 100%; min-height: 50px; padding: 0 14px;
	border: 1px solid var(--wp--preset--color--stone); border-radius: var(--wp--custom--radius);
	background-color: var(--wp--preset--color--white);
	font: 500 .9375rem/1.2 var(--wp--preset--font-family--body); color: var(--wp--preset--color--primary);
	transition: border-color var(--wp--custom--duration), box-shadow var(--wp--custom--duration);
}
.bh-vcalc__select {
	appearance: none; -webkit-appearance: none; padding-right: 38px; cursor: pointer;
	background-image: linear-gradient(45deg, transparent 50%, currentColor 50%), linear-gradient(135deg, currentColor 50%, transparent 50%);
	background-position: calc(100% - 20px) 55%, calc(100% - 14px) 55%;
	background-size: 6px 6px, 6px 6px; background-repeat: no-repeat;
}
.bh-vcalc__select:hover, .bh-vcalc__unit input:hover { border-color: var(--wp--preset--color--slate); }
.bh-block .bh-vcalc__select:focus-visible, .bh-block .bh-vcalc__unit input:focus-visible { outline: none; border-color: var(--wp--preset--color--primary); box-shadow: 0 0 0 1px var(--wp--preset--color--primary); }
.bh-vcalc__row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 559px) { .bh-vcalc__row { grid-template-columns: minmax(0, 1fr); gap: 26px; } }

/* Segments: home type, bedrooms, bathrooms */
.bh-vcalc__choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bh-vcalc__choices--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
@media (max-width: 559px) {
	.bh-vcalc__choices { grid-template-columns: 1fr 1fr; }
	.bh-vcalc__choices--5 { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
	.bh-vcalc__choices--5 span { padding: 0 4px; }
}
.bh-vcalc__choices label,
.bh-vcalc__cond label,
.bh-vcalc__extras label { position: relative; display: block; }
.bh-vcalc__choices input,
.bh-vcalc__cond input,
.bh-vcalc__extras input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.bh-vcalc__choices span {
	display: flex; align-items: center; justify-content: center;
	min-height: 46px; padding: 0 10px;
	border: 1px solid var(--wp--preset--color--stone); border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--white);
	font: 600 .875rem/1.2 var(--wp--preset--font-family--body); color: var(--wp--preset--color--slate);
	text-align: center;
	transition: background-color var(--wp--custom--duration), border-color var(--wp--custom--duration), color var(--wp--custom--duration);
}
.bh-vcalc__choices input:hover + span { border-color: var(--wp--preset--color--slate); }
.bh-vcalc__choices input:checked + span { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); color: var(--wp--preset--color--white); }

/* Condition cards */
.bh-vcalc__cond { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 699px) { .bh-vcalc__cond { grid-template-columns: 1fr 1fr; } }
.bh-vcalc__cond label { height: 100%; }
.bh-vcalc__cond span {
	display: block; height: 100%; padding: 12px 14px;
	border: 1px solid var(--wp--preset--color--stone); border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--white);
	transition: background-color var(--wp--custom--duration), border-color var(--wp--custom--duration);
}
.bh-vcalc__cond b { display: block; font-size: .875rem; font-weight: 700; color: var(--wp--preset--color--primary); }
.bh-vcalc__cond small { display: block; margin-top: 4px; font-size: .78125rem; line-height: 1.4; color: var(--wp--preset--color--muted); }
.bh-vcalc__cond input:hover + span { border-color: var(--wp--preset--color--slate); }
.bh-vcalc__cond input:checked + span { background: var(--wp--preset--color--primary); border-color: var(--wp--preset--color--primary); }
.bh-vcalc__cond input:checked + span b { color: var(--wp--preset--color--white); }
.bh-vcalc__cond input:checked + span small { color: color-mix(in srgb, var(--wp--preset--color--white) 75%, transparent); }

/* Extras */
.bh-vcalc__extras { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 559px) { .bh-vcalc__extras { grid-template-columns: 1fr 1fr; } }
.bh-vcalc__extras span {
	display: flex; align-items: center; gap: 10px;
	min-height: 46px; padding: 6px 12px;
	border: 1px solid var(--wp--preset--color--stone); border-radius: var(--wp--custom--radius);
	background: var(--wp--preset--color--white);
	font: 600 .875rem/1.25 var(--wp--preset--font-family--body); color: var(--wp--preset--color--slate);
	transition: background-color var(--wp--custom--duration), border-color var(--wp--custom--duration), color var(--wp--custom--duration);
}
.bh-vcalc__extras span::before {
	content: ""; flex-shrink: 0; width: 16px; height: 16px;
	border: 1.5px solid var(--wp--preset--color--slate); border-radius: 3px;
	background: var(--wp--preset--color--white) center / 10px no-repeat;
}
.bh-vcalc__extras input:hover + span { border-color: var(--wp--preset--color--slate); }
.bh-vcalc__extras input:checked + span { border-color: var(--wp--preset--color--primary); background: var(--wp--preset--color--light); color: var(--wp--preset--color--primary); }
.bh-vcalc__extras input:checked + span::before {
	border-color: var(--wp--preset--color--primary);
	background-color: var(--wp--preset--color--primary);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E");
}
.bh-vcalc__choices input:focus-visible + span,
.bh-vcalc__cond input:focus-visible + span,
.bh-vcalc__extras input:focus-visible + span { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }

/* Living area */
.bh-vcalc__sqft { display: grid; grid-template-columns: minmax(0, 1fr) 140px; gap: 14px; align-items: center; }
.bh-vcalc__range {
	-webkit-appearance: none; appearance: none;
	width: 100%; height: 4px; margin: 0; border-radius: 2px;
	background: linear-gradient(var(--wp--preset--color--primary), var(--wp--preset--color--primary)) 0 / var(--p, 30%) 100% no-repeat, var(--wp--preset--color--stone);
	cursor: pointer;
}
.bh-vcalc__range::-webkit-slider-thumb {
	-webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%;
	border: 2px solid var(--wp--preset--color--primary); background: var(--wp--preset--color--white);
	box-shadow: 0 1px 3px color-mix(in srgb, var(--wp--preset--color--primary) 20%, transparent); cursor: grab;
}
.bh-vcalc__range::-moz-range-thumb { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--wp--preset--color--primary); background: var(--wp--preset--color--white); cursor: grab; }
.bh-block .bh-vcalc__range:focus-visible { outline: none; }
.bh-vcalc__range:focus-visible::-webkit-slider-thumb { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.bh-vcalc__range:focus-visible::-moz-range-thumb { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.bh-vcalc__unit { position: relative; }
.bh-vcalc__unit input { padding-right: 52px; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.bh-vcalc__unit input::-webkit-inner-spin-button, .bh-vcalc__unit input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.bh-vcalc__unit em { position: absolute; top: 50%; right: 14px; transform: translateY(-50%); font-style: normal; font-size: .8125rem; color: var(--wp--preset--color--placeholder); pointer-events: none; }
@media (max-width: 379px) { .bh-vcalc__sqft { grid-template-columns: minmax(0, 1fr) 120px; gap: 10px; } }

/* Result panel */
.bh-vcalc__result {
	/* Under the sticky header (top bar + bar, about 115px on desktop), like the other sticky panels. */
	position: sticky; top: 136px;
	min-width: 0; padding: clamp(24px, 3vw, 32px);
	border-radius: var(--wp--custom--radius-lg, 6px);
	background: var(--wp--preset--color--primary);
	color: color-mix(in srgb, var(--wp--preset--color--light) 80%, transparent);
	box-shadow: var(--wp--preset--shadow--search);
}
@media (max-width: 1023px) { .bh-vcalc__result { position: static; } }
.bh-vcalc__result .bh-eyebrow { color: var(--wp--preset--color--accent-light); }
.bh-vcalc__where { margin-top: 6px; font-size: .875rem; }
.bh-vcalc__estimate {
	margin-top: 18px;
	font: 300 clamp(2.125rem, 3.4vw, 2.875rem)/1 var(--wp--preset--font-family--display);
	letter-spacing: -.02em; color: var(--wp--preset--color--light);
	font-variant-numeric: lining-nums tabular-nums;
}
.bh-vcalc__to { opacity: .5; }
.bh-vcalc__estimate small {
	display: block; margin-top: 10px;
	font: 500 .8125rem/1.4 var(--wp--preset--font-family--body); letter-spacing: 0;
	color: color-mix(in srgb, var(--wp--preset--color--light) 70%, transparent);
}
.bh-vcalc__band { position: relative; height: 8px; margin: 24px 0 8px; border-radius: 4px; background: color-mix(in srgb, var(--wp--preset--color--white) 12%, transparent); }
.bh-vcalc__band i {
	position: absolute; inset: 0 20%; border-radius: 4px;
	background: linear-gradient(90deg, color-mix(in srgb, var(--wp--preset--color--accent-light) 40%, transparent), var(--wp--preset--color--accent-light), color-mix(in srgb, var(--wp--preset--color--accent-light) 40%, transparent));
}
.bh-vcalc__band b { position: absolute; top: -5px; left: 50%; width: 2px; height: 18px; transform: translateX(-1px); background: var(--wp--preset--color--light); }
.bh-vcalc__band-l { display: flex; justify-content: space-between; padding-inline: 20% ; font-size: .75rem; color: color-mix(in srgb, var(--wp--preset--color--light) 60%, transparent); font-variant-numeric: tabular-nums; }
.bh-vcalc__band-l span { transform: translateX(-50%); }
.bh-vcalc__band-l span + span { transform: translateX(50%); }
.bh-vcalc__factors {
	display: grid; gap: 8px; margin: 22px 0 0; padding: 18px 0 0; list-style: none;
	border-top: 1px solid color-mix(in srgb, var(--wp--preset--color--white) 12%, transparent);
	font-size: .84375rem;
}
.bh-vcalc__factors li { display: flex; justify-content: space-between; gap: 12px; }
.bh-vcalc__factors b { flex-shrink: 0; font-weight: 600; color: var(--wp--preset--color--light); font-variant-numeric: tabular-nums; white-space: nowrap; }
.bh-vcalc__factors .is-up { color: color-mix(in srgb, var(--wp--preset--color--success) 45%, var(--wp--preset--color--white)); }
.bh-vcalc__factors .is-down { color: color-mix(in srgb, var(--wp--preset--color--error) 40%, var(--wp--preset--color--white)); }
.bh-vcalc__use { width: 100%; margin-top: 24px; }
.bh-vcalc__fine { margin-top: 14px; font-size: .75rem; line-height: 1.5; color: color-mix(in srgb, var(--wp--preset--color--light) 68%, transparent); }
.bh-vcalc__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 10px; font-size: .71875rem; color: color-mix(in srgb, var(--wp--preset--color--light) 55%, transparent); }
.bh-vcalc__sample { display: inline-flex; padding: 3px 8px; border: 1px dashed color-mix(in srgb, var(--wp--preset--color--accent-light) 60%, transparent); border-radius: var(--wp--custom--radius); color: var(--wp--preset--color--accent-light); cursor: help; }

/* Phone bar (view.js appends it to <body>) */
.bh-vcalc-bar {
	position: fixed; z-index: var(--z-float); left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom));
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	padding: 12px 14px 12px 18px;
	border-radius: var(--wp--custom--radius-lg, 6px);
	background: var(--wp--preset--color--primary); color: var(--wp--preset--color--light);
	box-shadow: var(--wp--preset--shadow--search);
	animation: bh-vcalc-bar-in 240ms var(--wp--custom--ease);
}
.bh-vcalc-bar[hidden] { display: none; }
.bh-vcalc-bar small { display: block; font: 700 .65625rem/1.3 var(--wp--preset--font-family--body); letter-spacing: .1em; text-transform: uppercase; color: var(--wp--preset--color--accent-light); }
.bh-vcalc-bar b { display: block; margin-top: 2px; font: 400 1.3125rem/1.1 var(--wp--preset--font-family--display); font-variant-numeric: lining-nums tabular-nums; }
.bh-vcalc-bar .bh-btn { min-height: 40px; padding: 0 16px; flex-shrink: 0; }
@media (min-width: 1024px) { .bh-vcalc-bar { display: none !important; } }
@keyframes bh-vcalc-bar-in { from { opacity: 0; transform: translateY(12px); } }
@media (prefers-reduced-motion: reduce) {
	.bh-vcalc-bar { animation: none; }
	.bh-vcalc__choices span, .bh-vcalc__cond span, .bh-vcalc__extras span { transition: none; }
}

/* "From the calculator" chip in the valuation form (view.js adds it) */
.bh-vchip {
	display: flex; align-items: center; justify-content: space-between; gap: 12px;
	margin-bottom: 20px; padding: 14px 16px;
	border: 1px solid color-mix(in srgb, var(--wp--preset--color--accent) 20%, transparent);
	border-radius: var(--wp--custom--radius);
	background: color-mix(in srgb, var(--wp--preset--color--accent) 8%, var(--wp--preset--color--white));
}
.bh-vchip[hidden] { display: none; }
.bh-vchip > div { min-width: 0; }
.bh-vchip small { display: block; font: 700 .6875rem/1.3 var(--wp--preset--font-family--body); letter-spacing: .08em; text-transform: uppercase; color: var(--wp--preset--color--accent); }
.bh-vchip b { display: block; margin-top: 2px; font: 400 1.375rem/1.2 var(--wp--preset--font-family--display); color: var(--wp--preset--color--primary); }
.bh-vchip span { display: block; margin-top: 2px; font-size: .78125rem; color: var(--wp--preset--color--muted); }
.bh-vchip button {
	flex-shrink: 0; min-height: var(--wp--custom--tap); padding: 0 4px;
	border: 0; background: none; cursor: pointer;
	font: 600 .8125rem/1 var(--wp--preset--font-family--body); color: var(--wp--preset--color--primary);
	text-decoration: underline; text-underline-offset: 3px;
}
.bh-vchip button:hover { color: var(--wp--preset--color--accent); }
