/* ========================================================================
   Brixzly Home Advisor — Frontend Styles
   ======================================================================== */

:root {
	--bha-primary:       #4f46e5;
	--bha-primary-dark:  #3730a3;
	--bha-primary-light: #ede9fe;
	--bha-success:       #16a34a;
	--bha-warn:          #d97706;
	--bha-danger:        #dc2626;
	--bha-gray-50:       #f9fafb;
	--bha-gray-100:      #f3f4f6;
	--bha-gray-200:      #e5e7eb;
	--bha-gray-400:      #9ca3af;
	--bha-gray-600:      #4b5563;
	--bha-gray-700:      #374151;
	--bha-gray-900:      #111827;
	--bha-radius:        10px;
	--bha-radius-sm:     6px;
	--bha-shadow:        0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
	--bha-shadow-md:     0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
}

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.bha-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 15px;
	color: var(--bha-gray-700);
	/* max-width: 860px; */
	margin: 0 auto;
}

/* ── Notice ──────────────────────────────────────────────────────────────── */

.bha-notice {
	padding: 12px 16px;
	border-radius: var(--bha-radius-sm);
	margin-bottom: 16px;
	font-size: 14px;
}
.bha-notice--error {
	background: #fef2f2;
	border: 1px solid #fca5a5;
	color: var(--bha-danger);
}
.bha-notice--error a {
	color: #1d4ed8;
	text-decoration: underline;
	font-weight: 600;
}
.bha-notice--error a:hover {
	color: #1e40af;
}
.bha-notice--warning {
	background: #fffbeb;
	border: 1px solid #fcd34d;
	color: var(--bha-warn);
}
.bha-notice--info {
	background: #eff6ff;
	border: 1px solid #bfdbfe;
	color: #1e40af;
}

/* ── Guest pre-notice (top of new-analysis panel) ───────────────────────── */

.bha-guest-pre-notice {
	display: flex;
	align-items: center;
	gap: 10px;
	margin-bottom: 20px;
	line-height: 1.5;
}
.bha-guest-pre-notice__icon {
	font-size: 18px;
	flex-shrink: 0;
}
.bha-guest-pre-notice a {
	color: #1d4ed8;
	font-weight: 600;
	text-decoration: underline;
}
.bha-guest-pre-notice a:hover {
	color: #1e40af;
}

/* ── Tabs ────────────────────────────────────────────────────────────────── */

.bha-tabs {
	display: flex;
	gap: 4px;
	border-bottom: 2px solid var(--bha-gray-200);
	margin-bottom: 24px;
}
.bha-tab {
	background: none;
	border: none;
	padding: 10px 18px;
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	color: var(--bha-gray-600);
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	display: flex;
	align-items: center;
	gap: 6px;
	transition: color .15s, border-color .15s;
}
.bha-tab:hover { color: var(--bha-primary); }
.bha-tab--active {
	color: var(--bha-primary);
	border-bottom-color: var(--bha-primary);
}
.bha-tab-count {
	background: var(--bha-primary-light);
	color: var(--bha-primary);
	border-radius: 99px;
	padding: 1px 8px;
	font-size: 12px;
	font-weight: 600;
}


/* ── Step indicators ─────────────────────────────────────────────────────── */

.bha-steps {
	display: flex;
	align-items: center;
	gap: 0;
	margin-bottom: 28px;
	counter-reset: step;
}
.bha-step {
	display: flex;
	align-items: center;
	gap: 8px;
	flex: 1;
	position: relative;
}
.bha-step:not(:last-child)::after {
	content: '';
	flex: 1;
	height: 2px;
	background: var(--bha-gray-200);
	margin: 0 8px;
}
.bha-step.is-done:not(:last-child)::after { background: var(--bha-primary); }

.bha-step__num {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--bha-gray-200);
	color: var(--bha-gray-600);
	font-size: 13px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	transition: background .15s, color .15s;
}
.bha-step.is-active .bha-step__num {
	background: var(--bha-primary);
	color: #fff;
}
.bha-step.is-done .bha-step__num {
	background: var(--bha-primary);
	color: #fff;
}
.bha-step__label {
	font-size: 12px;
	font-weight: 500;
	color: var(--bha-gray-600);
	white-space: nowrap;
}
.bha-step.is-active .bha-step__label { color: var(--bha-primary); font-weight: 600; }
.bha-step.is-done  .bha-step__label  { color: var(--bha-primary-dark); }

/* ── Wizard form ─────────────────────────────────────────────────────────── */

.bha-step-title {
	font-size: 20px;
	font-weight: 700;
	color: var(--bha-gray-900);
	margin: 0 0 6px;
}
.bha-step-sub {
	font-size: 14px;
	color: var(--bha-gray-600);
	margin: 0 0 24px;
}
.bha-required { color: var(--bha-danger); }
.bha-optional { color: var(--bha-gray-400); font-size: 12px; font-weight: normal; }

/* ── Space grid ──────────────────────────────────────────────────────────── */

/* ── Category card grid (3 cards: Single Room / Multi-Room / Full Rehab) ─── */

.bha-category-grid {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 20px;
}

/* Shared base for both expandable and direct-select category cards */
.bha-category-card {
	border: 2px solid var(--bha-gray-200);
	border-radius: var(--bha-radius);
	background: #fff;
	transition: border-color .15s, background .15s;
	overflow: hidden;
	position: relative;
	display: block;
}
.bha-category-card input[type="radio"] {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
/* Direct-select card: highlight when radio is checked */
.bha-category-card--direct:has(input:checked) {
	border-color: var(--bha-primary);
	background: var(--bha-primary-light);
}
.bha-category-card--direct:hover:not(.is-locked),
.bha-category-card--expandable:hover {
	border-color: var(--bha-primary);
	cursor: pointer;
}
/* Expandable card: highlight when open (button clicked) or sub-room is checked */
.bha-category-card--expandable.is-open,
.bha-category-card--expandable:has(input:checked) {
	border-color: var(--bha-primary);
	background: var(--bha-primary-light);
}
.bha-category-card.is-locked {
	opacity: .55;
	cursor: not-allowed;
}

/* Header row (icon + text + chevron) */
.bha-category-card__header {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 14px 18px;
	width: 100%;
	background: none;
	border: none;
	text-align: left;
	cursor: pointer;
}
/* For direct-select cards the header is a div, not a button — still flex */
.bha-category-card--direct .bha-category-card__header {
	cursor: inherit;
}
.bha-category-card__icon {
	font-size: 26px;
	flex-shrink: 0;
	line-height: 1;
}
.bha-category-card__text {
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 2px;
}
.bha-category-card__title {
	font-size: 15px;
	font-weight: 700;
	color: var(--bha-gray-900);
	line-height: 1.2;
}
.bha-category-card__desc {
	font-size: 13px;
	color: var(--bha-gray-500);
	line-height: 1.3;
}
.bha-category-card__chevron {
	font-size: 22px;
	color: var(--bha-gray-400);
	transition: transform .2s;
	line-height: 1;
	flex-shrink: 0;
}
.bha-category-card--expandable.is-open .bha-category-card__chevron {
	transform: rotate(90deg);
}

/* Sub-room grid inside Single Room */
.bha-sub-rooms {
	padding: 4px 14px 14px;
	border-top: 1px solid var(--bha-primary);
}
.bha-sub-room-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
	gap: 8px;
	padding-top: 12px;
}
.bha-sub-room-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 12px 8px;
	border: 1.5px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	cursor: pointer;
	transition: border-color .15s, background .15s;
	position: relative;
	background: #fff;
}
.bha-sub-room-card input[type="radio"] { position: absolute; opacity: 0; }
.bha-sub-room-card:has(input:checked) {
	border-color: var(--bha-primary);
	background: var(--bha-primary);
}
.bha-sub-room-card:has(input:checked) .bha-sub-room-card__label,
.bha-sub-room-card:has(input:checked) .bha-sub-room-card__icon {
	color: #fff;
}
.bha-sub-room-card:hover:not(.is-locked) { border-color: var(--bha-primary); }
.bha-sub-room-card.is-locked {
	opacity: .5;
	cursor: not-allowed;
}
.bha-sub-room-card__icon { font-size: 22px; }
.bha-sub-room-card__label {
	font-size: 12px;
	font-weight: 500;
	color: var(--bha-gray-700);
	text-align: center;
	line-height: 1.2;
}

/* Legacy space-card lock badge (reused on category cards) */
.bha-space-card__locked {
	font-size: 10px;
	background: var(--bha-warn);
	color: #fff;
	padding: 2px 6px;
	border-radius: 99px;
}

/* ── In-card Photo Tip ───────────────────────────────────────────────────── */

/* Hidden by default; CSS :has() reveals it when the relevant radio is checked */
.bha-card-tip {
	display: none;
	background: #f0f9ff;
	/* border-top: 1.5px solid #bae6fd; */
	padding: 12px 18px 14px;
	animation: bhaFadeIn .2s ease;
	margin-top: 10px;
	border-radius: 6px;
}
/* Single Room: show tip when any sub-room radio is checked */
.bha-sub-rooms:has(input:checked) .bha-card-tip { display: block; }
/* Multi-Room / Full Home Rehab: show tip when their radio is checked */
.bha-category-card--direct:has(input:checked) .bha-card-tip { display: block; margin: 14px 14px; }

.bha-tip-card__head {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.bha-tip-card__cam { font-size: 18px; line-height: 1; flex-shrink: 0; }
.bha-tip-card__title {
	font-size: 13px;
	font-weight: 700;
	color: #0369a1;
}
.bha-hint-text {
	margin: 0 0 4px;
	font-size: 13px;
	color: var(--bha-gray-700);
	line-height: 1.5;
}
.bha-tip-card__text {
	margin: 0;
	font-size: 13px;
	color: var(--bha-gray-700);
	line-height: 1.5;
}

/* ── Other Room name input (inside tip card) ─────────────────────────────── */

.bha-other-room-name {
	margin-top: 12px;
	padding-top: 12px;
	border-top: 1px solid #bae6fd;
}
.bha-other-room-name .bha-label {
	display: block;
	font-size: 13px;
	font-weight: 600;
	color: var(--bha-gray-700);
	margin-bottom: 6px;
}
.bha-other-room-name .bha-required {
	color: var(--bha-danger, #dc2626);
	margin-left: 2px;
}
.bha-other-room-name .bha-input {
	width: 100%;
	padding: 9px 12px;
	border: 1.5px solid #93c5fd;
	border-radius: var(--bha-radius-sm);
	font-size: 14px;
	color: var(--bha-gray-900);
	background: #fff;
	box-sizing: border-box;
	transition: border-color .15s;
}
.bha-other-room-name .bha-input:focus {
	outline: none;
	border-color: var(--bha-primary);
	box-shadow: 0 0 0 3px rgba(59,130,246,.15);
}
.bha-other-room-name .bha-field-hint {
	margin: 6px 0 0;
	font-size: 12px;
	color: var(--bha-gray-500);
}

@keyframes bhaFadeIn {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ── Field layout ────────────────────────────────────────────────────────── */

.bha-field-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 16px;
	margin-bottom: 24px;
}
.bha-field { display: flex; flex-direction: column; gap: 5px; }
.bha-field--full { grid-column: 1 / -1; }
.bha-field--half { }

.bha-field label {
	font-size: 13px;
	font-weight: 600;
	color: var(--bha-gray-700);
}
.bha-field input[type="text"],
.bha-field input[type="number"],
.bha-field select,
.bha-field textarea {
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	padding: 8px 12px;
	font-size: 14px;
	color: var(--bha-gray-900);
	background: #fff;
	transition: border-color .15s, box-shadow .15s;
	width: 100%;
	box-sizing: border-box;
}
.bha-field select {
	appearance: none;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	padding-right: 32px;
	cursor: pointer;
}
.bha-field input:focus,
.bha-field select:focus,
.bha-field textarea:focus {
	outline: none;
	border-color: var(--bha-primary);
	box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}
.bha-field textarea { resize: vertical; min-height: 100px; }

.bha-input-prefix {
	display: flex;
	align-items: center;
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	overflow: hidden;
	background: #fff;
}
.bha-input-prefix span {
	padding: 8px 10px;
	background: var(--bha-gray-100);
	border-right: 1px solid var(--bha-gray-200);
	color: var(--bha-gray-600);
	font-size: 14px;
}
.bha-input-prefix input {
	border: none !important;
	box-shadow: none !important;
	flex: 1;
	border-radius: 0 !important;
}

/* ── Goal grid ───────────────────────────────────────────────────────────── */

.bha-goal-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 10px;
}
.bha-goal-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 10px;
	border: 2px solid var(--bha-gray-200);
	border-radius: var(--bha-radius);
	cursor: pointer;
	transition: border-color .15s, background .15s;
	text-align: center;
	position: relative;
}
.bha-goal-card input[type="radio"] { position: absolute; opacity: 0; }
.bha-goal-card:has(input:checked) {
	border-color: var(--bha-primary);
	background: var(--bha-primary-light);
}
.bha-goal-card:hover { border-color: var(--bha-primary); }
.bha-goal-card__icon { font-size: 24px; }
.bha-goal-card__label { font-size: 13px; font-weight: 500; color: var(--bha-gray-700); }

/* ── Dropzone ────────────────────────────────────────────────────────────── */

.bha-dropzone {
	border: 2px dashed var(--bha-gray-300, #d1d5db);
	border-radius: var(--bha-radius);
	padding: 32px 20px;
	text-align: center;
	cursor: pointer;
	background: var(--bha-gray-50);
	transition: border-color .15s, background .15s;
	margin-bottom: 16px;
}
.bha-dropzone.is-dragging {
	border-color: var(--bha-primary);
	background: var(--bha-primary-light);
}
.bha-dropzone__inner { pointer-events: none; }
.bha-file-input { display: none; }
.bha-dropzone__text {
	margin: 10px 0 6px;
	font-size: 14px;
	color: var(--bha-gray-600);
}
.bha-dropzone__browse {
	background: none;
	border: none;
	color: var(--bha-primary);
	font-weight: 600;
	cursor: pointer;
	font-size: 14px;
	text-decoration: underline;
	padding: 0;
	pointer-events: all;
}
.bha-dropzone__hint { font-size: 12px; color: var(--bha-gray-400); margin: 0; }

/* ── Photo preview grid ──────────────────────────────────────────────────── */

.bha-photo-preview-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-bottom: 16px;
}
.bha-thumb {
	position: relative;
	width: 80px;
	height: 80px;
	border-radius: var(--bha-radius-sm);
	overflow: hidden;
	border: 2px solid var(--bha-gray-200);
}
.bha-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bha-thumb__remove {
	position: absolute;
	top: 2px;
	right: 2px;
	background: rgba(0,0,0,.6);
	color: #fff;
	border: none;
	border-radius: 50%;
	width: 20px;
	height: 20px;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}
.bha-thumb__name {
	position: absolute;
	bottom: 0; left: 0; right: 0;
	background: rgba(0,0,0,.55);
	color: #fff;
	font-size: 9px;
	padding: 2px 3px;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── Step nav ────────────────────────────────────────────────────────────── */

.bha-step-nav {
	display: flex;
	gap: 10px;
	margin-top: 24px;
	align-items: center;
}

/* ── Buttons ─────────────────────────────────────────────────────────────── */

.bha-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	border-radius: var(--bha-radius-sm);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	border: 2px solid transparent;
	transition: background .15s, color .15s, border-color .15s, box-shadow .15s;
	white-space: nowrap;
	text-decoration: none;
}
.bha-btn--primary {
	background: var(--bha-primary);
	color: #fff;
	border-color: var(--bha-primary);
}
.bha-btn--primary:hover { background: var(--bha-primary-dark); border-color: var(--bha-primary-dark); }

.bha-btn--next {
	background: var(--bha-primary);
	color: #fff;
	border-color: var(--bha-primary);
	margin-left: auto;
}
.bha-btn--next:hover { background: var(--bha-primary-dark); }

.bha-btn--submit {
	margin-left: auto;
	font-size: 15px;
	padding: 12px 24px;
}

.bha-btn--back {
	background: none;
	color: var(--bha-gray-600);
	border-color: var(--bha-gray-200);
}
.bha-btn--back:hover { border-color: var(--bha-gray-400); color: var(--bha-gray-900); }

.bha-btn--outline {
	background: none;
	color: var(--bha-primary);
	border-color: var(--bha-primary);
}
.bha-btn--outline:hover { background: var(--bha-primary-light); }

.bha-btn--sm { padding: 6px 12px; font-size: 13px; }

.bha-btn--danger-ghost {
	background: none;
	color: var(--bha-danger);
	border-color: transparent;
}
.bha-btn--danger-ghost:hover { background: #fef2f2; }

.bha-btn--danger-outline {
	background: none;
	color: var(--bha-danger);
	border-color: var(--bha-danger);
}
.bha-btn--danger-outline:hover { background: #fef2f2; }

/* ── Loading ─────────────────────────────────────────────────────────────── */

.bha-loading {
	text-align: center;
	padding: 60px 20px;
	color: var(--bha-gray-600);
}
.bha-loading__sub { font-size: 13px; color: var(--bha-gray-400); margin-top: 6px; }

.bha-spinner {
	width: 44px;
	height: 44px;
	border: 4px solid var(--bha-gray-200);
	border-top-color: var(--bha-primary);
	border-radius: 50%;
	animation: bha-spin 0.8s linear infinite;
	margin: 0 auto 16px;
}
@keyframes bha-spin { to { transform: rotate(360deg); } }

/* ── Result ──────────────────────────────────────────────────────────────── */

.bha-result-wrap { display: flex; flex-direction: column; gap: 0; margin-top: 20px; }

.bha-result-header {
	background: linear-gradient(135deg, var(--bha-primary) 0%, var(--bha-primary-dark) 100%);
	color: #fff;
	padding: 24px 28px;
	border-radius: var(--bha-radius) var(--bha-radius) 0 0;
	margin-bottom: 0;
}
.bha-result-header__space {
	display: flex;
	align-items: center;
	gap: 10px;
	font-size: 13px;
	font-weight: 600;
	opacity: .8;
	margin-bottom: 6px;
	text-transform: uppercase;
	letter-spacing: .05em;
}
/* Slightly larger badge inside the result header */
.bha-result-header__space .bha-space-badge {
	width: 40px;
	height: 40px;
	font-size: 12px;
	border-radius: 10px;
	opacity: 1;
}
.bha-result-header__title {
	font-size: 22px;
	font-weight: 700;
	margin: 0 0 14px;
	color: #fff;
}
.bha-result-condition {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-wrap: wrap;
}
.bha-result-condition__label {
	font-size: 14px;
	opacity: .9;
}
.bha-result-era {
	margin-top: 8px;
	font-size: 13px;
	opacity: .7;
}

/* Stars */
.bha-stars { display: flex; align-items: center; gap: 3px; }
.bha-star { font-size: 18px; color: rgba(255,255,255,.3); }
.bha-star.is-filled { color: #fbbf24; }
.bha-stars__label { font-size: 13px; opacity: .8; margin-left: 4px; }

/* ── Sections ────────────────────────────────────────────────────────────── */

.bha-section {
	background: #fff;
	border: 1px solid var(--bha-gray-200);
	border-top: none;
	padding: 20px 24px;
}
.bha-section:last-of-type {
	border-radius: 0 0 var(--bha-radius) var(--bha-radius);
}
.bha-section-title {
	font-size: 16px;
	font-weight: 700;
	color: var(--bha-gray-900);
	margin: 0 0 14px;
}

/* ── Observations ────────────────────────────────────────────────────────── */

.bha-obs-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 10px;
}
.bha-obs {
	display: flex;
	flex-direction: column;
	gap: 4px;
	padding: 10px 12px;
	border-radius: var(--bha-radius-sm);
	border: 1px solid var(--bha-gray-200);
	background: var(--bha-gray-50);
}
.bha-obs__category {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	color: var(--bha-gray-400);
}
.bha-obs__desc { font-size: 13px; color: var(--bha-gray-700); }
.bha-obs__sev { font-size: 11px; font-weight: 600; }
.bha-sev--high   { color: var(--bha-danger); }
.bha-sev--moderate { color: var(--bha-warn); }
.bha-sev--low    { color: var(--bha-success); }

/* ── Flags ───────────────────────────────────────────────────────────────── */

.bha-flags { }
.bha-flags__title { font-size: 14px; font-weight: 700; color: var(--bha-warn); margin: 0 0 10px; }
.bha-flag {
	padding: 8px 12px;
	border-radius: var(--bha-radius-sm);
	font-size: 13px;
	border-left: 3px solid transparent;
	margin-bottom: 6px;
}
.bha-flag--high     { background: #fef2f2; border-color: var(--bha-danger); }
.bha-flag--moderate { background: #fffbeb; border-color: var(--bha-warn); }
.bha-flag--low      { background: #f0fdf4; border-color: var(--bha-success); }
.bha-flag__sev { font-weight: 700; font-size: 11px; margin-right: 6px; }

/* ── Scenarios ───────────────────────────────────────────────────────────── */

.bha-scenarios {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
}
.bha-scenario {
	border: 2px solid var(--bha-gray-200);
	border-radius: var(--bha-radius);
	padding: 16px;
	display: flex;
	flex-direction: column;
	gap: 8px;
	position: relative;
	background: #fff;
	transition: box-shadow .15s;
}
.bha-scenario:hover { box-shadow: var(--bha-shadow-md); }
.bha-scenario--recommended {
	border-color: var(--bha-primary);
	background: #fafafe;
}
.bha-scenario__badge {
	font-size: 11px;
	font-weight: 700;
	color: var(--bha-primary);
	text-transform: uppercase;
	letter-spacing: .05em;
	margin-bottom: 2px;
}
.bha-scenario__name { font-size: 16px; font-weight: 700; color: var(--bha-gray-900); margin: 0; }
.bha-scenario__scope { font-size: 12px; color: var(--bha-gray-600); }
.bha-scenario__numbers {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 6px;
}
.bha-num-block {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
	min-width: 80px;
}
.bha-num-block__label { font-size: 10px; font-weight: 700; text-transform: uppercase; color: var(--bha-gray-400); letter-spacing: .05em; }
.bha-num-block__value { font-size: 14px; font-weight: 700; color: var(--bha-gray-900); }
.bha-num-block--roi .bha-num-block__value { color: var(--bha-primary); font-size: 20px; }

.bha-scenario__note { font-size: 12px; color: var(--bha-gray-600); font-style: italic; }
.bha-scenario__when { font-size: 12px; color: var(--bha-gray-700); }

/* ── Recommendation section ──────────────────────────────────────────────── */

.bha-rec-section { background: #fafafe; }
.bha-rec-section .bha-section-title { color: var(--bha-primary); }

/* ── Over-improvement ────────────────────────────────────────────────────── */

.bha-over-improve {
	display: flex;
	gap: 12px;
	align-items: flex-start;
	padding: 12px 14px;
	border-radius: var(--bha-radius-sm);
	font-size: 13px;
}
.bha-over-improve__icon { font-size: 20px; flex-shrink: 0; }
.bha-over-improve--low      { background: #f0fdf4; border: 1px solid #bbf7d0; }
.bha-over-improve--medium   { background: #fffbeb; border: 1px solid #fde68a; }
.bha-over-improve--high     { background: #fef2f2; border: 1px solid #fca5a5; }

/* ── Market context ──────────────────────────────────────────────────────── */

.bha-market-context {
	background: var(--bha-gray-50);
	border-radius: var(--bha-radius-sm);
	padding: 14px;
	font-size: 14px;
}
.bha-market-context h4 { font-size: 14px; margin: 0 0 6px; color: var(--bha-gray-900); }
.bha-market-context p  { margin: 0; color: var(--bha-gray-700); }

/* ── Key drivers ─────────────────────────────────────────────────────────── */

.bha-drivers {
	margin: 0;
	padding-left: 20px;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 6px 16px;
}
.bha-drivers li { font-size: 14px; color: var(--bha-gray-700); }

/* ── Disclaimer ──────────────────────────────────────────────────────────── */

.bha-disclaimer {
	background: var(--bha-gray-50);
	border: 1px solid var(--bha-gray-200);
	border-radius: 0 0 var(--bha-radius) var(--bha-radius);
	padding: 14px 20px;
	font-size: 12px;
	color: var(--bha-gray-400);
	line-height: 1.5;
}

/* ── Result actions ──────────────────────────────────────────────────────── */

.bha-result-actions {
	display: flex;
	gap: 10px;
	padding: 16px 0 4px;
	flex-wrap: wrap;
}

.bha-result-actions--top {
	padding: 12px 0 14px;
	margin-bottom: 4px;
	border-bottom: 1px solid #e5e7eb;
}

/* ── History ─────────────────────────────────────────────────────────────── */

.bha-history-header {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 16px;
	flex-wrap: wrap;
}
.bha-history-header h3 { margin: 0; font-size: 18px; flex: none; }
.bha-history-controls {
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
	margin-left: auto;
}
.bha-history-search {
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	padding: 6px 10px;
	font-size: 13px;
	width: 180px;
}
.bha-history-filter {
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	padding: 6px 10px;
	font-size: 13px;
}

.bha-history-empty {
	text-align: center;
	padding: 40px;
	color: var(--bha-gray-400);
}

.bha-history-grid {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.bha-history-card {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 14px;
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius);
	background: #fff;
	transition: box-shadow .15s;
}
.bha-history-card:hover { box-shadow: var(--bha-shadow); }
.bha-history-card__check { flex-shrink: 0; }
.bha-history-card__icon { flex-shrink: 0; }

/* Space-type initial badges in history cards */
.bha-space-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 8px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: .02em;
	color: #fff;
	background: #6366f1;
}
.bha-space-badge--kitchen     { background: #f97316; }
.bha-space-badge--bathroom    { background: #0ea5e9; }
.bha-space-badge--basement    { background: #78716c; }
.bha-space-badge--exterior    { background: #22c55e; }
.bha-space-badge--living_room { background: #a855f7; }
.bha-space-badge--full_rehab  { background: #ef4444; }
.bha-space-badge--other_room  { background: #64748b; }
.bha-space-badge--multi_room  { background: #8b5cf6; }
.bha-history-card__body { flex: 1; min-width: 0; }

/* Name row: title text + pencil icon side by side */
.bha-history-card__name-row {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
}
.bha-history-card__title {
	font-weight: 600;
	font-size: 14px;
	color: var(--bha-gray-900);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	flex: 1;
	min-width: 0;
}

/* Pencil rename button — hidden until card is hovered */
.bha-rename-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	width: 26px;
	height: 26px;
	border-radius: 6px;
	border: 1px solid var(--bha-gray-200);
	background: transparent;
	color: var(--bha-gray-400);
	cursor: pointer;
	transition: background .15s, color .15s, border-color .15s, opacity .15s;
	opacity: 0;
}
.bha-history-card:hover .bha-rename-btn,
.bha-rename-btn:focus { opacity: 1; }
.bha-rename-btn:hover { background: var(--bha-gray-50); color: var(--bha-primary); border-color: var(--bha-primary); }
.bha-rename-btn svg { width: 13px; height: 13px; pointer-events: none; }

/* Save button (green check) */
.bha-rename-btn--save { color: #16a34a; border-color: #16a34a; opacity: 1; }
.bha-rename-btn--save:hover { background: #16a34a; color: #fff; }

/* Cancel button (×) */
.bha-rename-btn:not(.bha-rename-btn--save) { font-size: 16px; }

/* Inline editor row — hidden by default, shown as flex by JS */
.bha-history-inline-editor {
	display: none;
	align-items: center;
	gap: 6px;
	margin-top: 2px;
}
.bha-history-inline-editor .bha-title-input {
	flex: 1;
	min-width: 0;
	padding: 4px 8px;
	font-size: 13px;
	font-family: inherit;
	border: 1.5px solid var(--bha-primary);
	border-radius: 6px;
	outline: none;
	color: var(--bha-gray-900);
}
.bha-title-status { font-size: 12px; color: #dc2626; }
.bha-history-inline-editor .bha-rename-btn { opacity: 1; }

.bha-history-card__meta { font-size: 12px; color: var(--bha-gray-400); margin-top: 2px; }
.bha-history-card__recommendation { margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.bha-history-card__actions { display: flex; gap: 6px; flex-shrink: 0; }

.bha-badge {
	font-size: 11px;
	font-weight: 600;
	padding: 2px 8px;
	border-radius: 99px;
}
.bha-badge--full_remodel { background: var(--bha-primary-light); color: var(--bha-primary-dark); }
.bha-badge--mid_range    { background: #dcfce7; color: #166534; }
.bha-badge--cosmetic     { background: #fef9c3; color: #854d0e; }
.bha-badge-roi { font-size: 12px; font-weight: 700; color: var(--bha-success); }

/* ── Inline title edit ───────────────────────────────────────────────────── */

.bha-title-input {
	border: 1px solid var(--bha-primary);
	border-radius: 4px;
	padding: 2px 6px;
	font-size: 14px;
	font-weight: 600;
	width: 100%;
	box-sizing: border-box;
}

/* ── Progress (status card) ──────────────────────────────────────────────── */

.bha-progress {
	height: 6px;
	background: var(--bha-gray-200);
	border-radius: 99px;
	overflow: hidden;
	margin: 6px 0;
}
.bha-progress__fill {
	height: 100%;
	background: var(--bha-primary);
	border-radius: 99px;
	transition: width .4s ease;
}
.bha-progress__fill.is-warning { background: var(--bha-warn); }
.bha-progress__fill.is-full    { background: var(--bha-danger); }

/* ── Status card [brixzly_roi_status] ───────────────────────────────────── */

.bha-sc {
	background: #fff;
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius);
	box-shadow: var(--bha-shadow);
	font-size: 14px;
	max-width: 380px;
	overflow: hidden;
}

/* Header */
.bha-sc__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 14px 16px 10px;
	border-bottom: 1px solid var(--bha-gray-100);
}
.bha-sc__header-left { display: flex; align-items: center; gap: 10px; }
.bha-sc__icon { font-size: 22px; line-height: 1; }
.bha-sc__title { font-weight: 700; font-size: 14px; color: var(--bha-gray-900); }
.bha-sc__level { font-size: 11px; color: var(--bha-primary); font-weight: 600; margin-top: 1px; text-transform: uppercase; letter-spacing: .04em; }

.bha-sc__refresh {
	background: none;
	border: 1px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	padding: 5px 7px;
	cursor: pointer;
	color: var(--bha-gray-400);
	line-height: 1;
	transition: color .15s, border-color .15s, background .15s;
}
.bha-sc__refresh:hover { color: var(--bha-primary); border-color: var(--bha-primary); background: var(--bha-primary-light); }
.bha-sc__refresh.is-spinning svg { animation: bha-spin .6s linear infinite; }
@keyframes bha-spin { to { transform: rotate(360deg); } }

/* Gate (plan disabled) */
.bha-sc__gate {
	padding: 16px;
	font-size: 13px;
	color: var(--bha-gray-600);
	text-align: center;
}

/* Item list */
.bha-sc__items { padding: 6px 0; }

.bha-sc__item {
	padding: 10px 16px;
	border-bottom: 1px solid var(--bha-gray-100);
}
.bha-sc__item:last-child { border-bottom: none; }
.bha-sc__item--warn { background: #fff7ed; }

.bha-sc__item--simple {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
}

.bha-sc__item-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin-bottom: 4px;
}

.bha-sc__label { font-size: 13px; color: var(--bha-gray-700); }
.bha-sc__period { color: var(--bha-gray-400); font-size: 11px; margin-left: 3px; }

.bha-sc__value { font-size: 13px; font-weight: 600; color: var(--bha-gray-900); white-space: nowrap; }
.bha-sc__value--unlimited { color: var(--bha-success); }
.bha-sc__value--warn      { color: var(--bha-warn); }

/* Progress bar */
.bha-sc__bar {
	height: 5px;
	background: var(--bha-gray-200);
	border-radius: 99px;
	overflow: hidden;
	margin: 4px 0;
}
.bha-sc__bar-fill {
	height: 100%;
	background: var(--bha-primary);
	border-radius: 99px;
	transition: width .4s ease;
}
.bha-sc__bar-fill--caution { background: var(--bha-warn); }
.bha-sc__bar-fill--warn    { background: var(--bha-danger); }

.bha-sc__remaining { font-size: 11px; color: var(--bha-gray-400); }
.bha-sc__warn-text { color: var(--bha-danger); font-weight: 600; }
.bha-sc__reset     { color: var(--bha-gray-400); }

/* Badges */
.bha-sc__badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 99px;
	line-height: 1.6;
}
.bha-sc__badge--ok  { background: #dcfce7; color: #166534; }
.bha-sc__badge--off { background: #fee2e2; color: #991b1b; }

/* Footer */
.bha-sc__footer {
	padding: 10px 16px;
	border-top: 1px solid var(--bha-gray-100);
	background: var(--bha-gray-50);
	text-align: right;
}
.bha-sc__upgrade {
	font-size: 12px;
	font-weight: 600;
	color: var(--bha-primary);
	text-decoration: none;
}
.bha-sc__upgrade:hover { text-decoration: underline; }
.bha-sc__footer-sep { color: var(--bha-gray-400); font-size: 12px; }

/* ── Responsive ──────────────────────────────────────────────────────────── */

@media ( max-width: 600px ) {
	.bha-field-grid { grid-template-columns: 1fr; }
	.bha-field--half { grid-column: auto; }
	.bha-sub-room-grid { grid-template-columns: repeat(2, 1fr); }
	.bha-goal-grid  { grid-template-columns: repeat(2, 1fr); }
	.bha-scenarios  { grid-template-columns: 1fr; }
	.bha-drivers    { grid-template-columns: 1fr; }
	.bha-steps .bha-step__label { display: none; }
	.bha-history-header { flex-direction: column; align-items: flex-start; }
	.bha-history-controls { margin-left: 0; }
}

/* ── Comp Snapshot ───────────────────────────────────────────────────────── */

.bha-comp-loading {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: var(--bha-gray-600);
	padding: 10px 0;
}
.bha-comp-spinner {
	display: inline-block;
	width: 14px;
	height: 14px;
	border: 2px solid var(--bha-gray-200);
	border-top-color: var(--bha-primary);
	border-radius: 50%;
	animation: bha-spin 0.7s linear infinite;
	flex-shrink: 0;
}

.bha-comp-card {
	background: #f0f9ff;
	border: 1px solid #bae6fd;
	border-radius: var(--bha-radius);
	padding: 16px;
	font-size: 13px;
}
.bha-comp-card__header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 12px;
	font-size: 14px;
}
.bha-comp-card__src { color: var(--bha-gray-400); font-size: 11px; margin-left: auto; }

.bha-comp-badge {
	font-size: 10px;
	font-weight: 700;
	padding: 2px 7px;
	border-radius: 99px;
	text-transform: uppercase;
	letter-spacing: .04em;
}
.bha-comp-badge--rm { background: #dbeafe; color: #1e40af; }
.bha-comp-badge--hc { background: #f3e8ff; color: #6b21a8; }

.bha-comp-card__stats {
	display: flex;
	gap: 16px;
	flex-wrap: wrap;
	margin-bottom: 14px;
	padding-bottom: 14px;
	border-bottom: 1px solid #bae6fd;
}
.bha-comp-stat {
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 120px;
}
.bha-comp-stat__label { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: #0369a1; }
.bha-comp-stat__value { font-size: 17px; font-weight: 800; color: var(--bha-gray-900); }

.bha-comp-table-wrap { overflow-x: auto; margin-bottom: 10px; }
.bha-comp-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 12px;
}
.bha-comp-table th {
	text-align: left;
	padding: 5px 8px;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #0369a1;
	border-bottom: 1px solid #bae6fd;
	white-space: nowrap;
}
.bha-comp-table td {
	padding: 6px 8px;
	border-bottom: 1px solid #e0f2fe;
	color: var(--bha-gray-700);
	vertical-align: top;
}
.bha-comp-table tr:last-child td { border-bottom: none; }
.bha-comp-addr { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.bha-comp-card__note {
	font-size: 11px;
	color: #0369a1;
	margin: 0;
	font-style: italic;
}

/* ── Room-grouped upload ─────────────────────────────────────────────────── */

.bha-room-upload { margin-top: 4px; }

.bha-room-list {
	display: flex;
	flex-direction: column;
	gap: 14px;
	margin-bottom: 14px;
}

.bha-room-group {
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
	background: #fff;
	transition: box-shadow .15s;
}
.bha-room-group:focus-within { box-shadow: 0 0 0 3px rgba(99,102,241,.15); border-color: var(--bha-primary); }

.bha-room-group__header {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px 14px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

.bha-room-group__num {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--bha-primary);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.bha-room-name-input {
	flex: 1;
	border: 1px solid #d1d5db;
	border-radius: 7px;
	padding: 6px 10px;
	font-size: 14px;
	font-weight: 600;
	font-family: inherit;
	color: var(--bha-gray-900);
	background: #fff;
	outline: none;
	transition: border-color .15s;
}
.bha-room-name-input:focus { border-color: var(--bha-primary); }

.bha-room-remove {
	background: none;
	border: none;
	cursor: pointer;
	color: #9ca3af;
	font-size: 16px;
	line-height: 1;
	padding: 4px 6px;
	border-radius: 5px;
	transition: color .15s, background .15s;
	flex-shrink: 0;
}
.bha-room-remove:hover { color: #ef4444; background: #fee2e2; }

/* Dropzone empty state */
.bha-room-dropzone--empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	padding: 22px 16px;
	cursor: pointer;
	transition: background .15s;
}
.bha-room-dropzone--empty:hover { background: #f5f3ff; }
.bha-room-dropzone--empty.is-dragging { background: #ede9fe; border-color: var(--bha-primary); }
.bha-room-dz-icon { font-size: 26px; line-height: 1; }
.bha-room-dz-text { font-size: 13px; color: var(--bha-gray-500); }
.bha-room-browse {
	background: none;
	border: none;
	cursor: pointer;
	color: var(--bha-primary);
	font-weight: 600;
	padding: 0;
	font-size: inherit;
	font-family: inherit;
	text-decoration: underline;
}

/* Dropzone with files */
.bha-room-dropzone--has-files { padding: 10px 14px; }
.bha-room-dropzone--has-files.is-dragging { background: #ede9fe; }

.bha-room-previews {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.bha-room-thumb {
	position: relative;
	width: 64px;
	height: 64px;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid #e2e8f0;
	flex-shrink: 0;
}
.bha-room-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.bha-room-thumb__remove {
	position: absolute;
	top: 2px; right: 2px;
	width: 18px; height: 18px;
	border-radius: 50%;
	background: rgba(0,0,0,.55);
	color: #fff;
	border: none;
	cursor: pointer;
	font-size: 12px;
	line-height: 18px;
	text-align: center;
	padding: 0;
	opacity: 0;
	transition: opacity .15s;
}
.bha-room-thumb:hover .bha-room-thumb__remove { opacity: 1; }

.bha-room-add-more {
	background: #f5f3ff;
	border: 1px dashed var(--bha-primary);
	border-radius: 8px;
	color: var(--bha-primary);
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	padding: 0 10px;
	height: 64px;
	white-space: nowrap;
	transition: background .15s;
}
.bha-room-add-more:hover { background: #ede9fe; }

.bha-room-file-count {
	font-size: 11px;
	color: var(--bha-gray-400);
	margin-top: 6px;
}

.bha-add-room {
	width: 100%;
	margin-top: 2px;
}

/* ── Full Home Rehab ─────────────────────────────────────────────────────── */

.bha-scenarios--rehab { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }

.bha-room-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
	gap: 14px;
}
.bha-room-card {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 14px;
}
.bha-room-card__header {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-bottom: 8px;
}
.bha-room-card__name {
	font-weight: 700;
	font-size: 14px;
	flex: 1;
}
.bha-room-card__cond {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	padding: 2px 7px;
	border-radius: 99px;
}
.bha-room-cond--poor      { background: #fee2e2; color: #991b1b; }
.bha-room-cond--fair      { background: #fef9c3; color: #854d0e; }
.bha-room-cond--good      { background: #dcfce7; color: #166534; }
.bha-room-cond--excellent { background: #d1fae5; color: #065f46; }

.bha-room-card__cost {
	font-size: 13px;
	font-weight: 700;
	color: var(--bha-primary);
	margin-bottom: 8px;
}
.bha-room-card__issues {
	margin: 0;
	padding-left: 18px;
	font-size: 12px;
	color: var(--bha-gray-600);
	line-height: 1.6;
}

.bha-priority-list {
	margin: 0;
	padding-left: 22px;
	font-size: 14px;
	line-height: 2;
	color: var(--bha-gray-700);
}

.bha-flip-score {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 12px;
	padding: 14px 18px;
	border-radius: 10px;
	border: 1px solid #e2e8f0;
}
.bha-flip-score--high { background: #f0fdf4; border-color: #86efac; }
.bha-flip-score--mid  { background: #fefce8; border-color: #fde047; }
.bha-flip-score--low  { background: #fafafa; border-color: #d1d5db; }
.bha-flip-score__label { font-size: 14px; font-weight: 700; }
.bha-flip-score__value {
	font-size: 22px;
	font-weight: 900;
	color: var(--bha-primary);
	margin-left: auto;
}
.bha-flip-score__note {
	flex-basis: 100%;
	margin: 0;
	font-size: 13px;
	color: var(--bha-gray-600);
	line-height: 1.5;
}

/* ── Full-rehab progress UI ─────────────────────────────────────────────── */

.bha-rehab-progress {
	max-width: 480px;
	margin: 0 auto;
	padding: 8px 0;
	text-align: left;
}
.bha-rp-title {
	font-size: 18px;
	font-weight: 700;
	color: var(--bha-dark);
	margin: 0 0 6px;
	text-align: center;
}
.bha-rp-sub {
	font-size: 13px;
	color: var(--bha-gray-600);
	margin: 0 0 20px;
	text-align: center;
	line-height: 1.5;
}
.bha-rp-rooms {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-bottom: 18px;
}
.bha-rp-room {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1.5px solid #e5e7eb;
	background: #fafafa;
	transition: background 0.2s, border-color 0.2s;
}
.bha-rp-room--uploading,
.bha-rp-room--analyzing {
	border-color: var(--bha-primary);
	background: #eef2ff;
}
.bha-rp-room--done {
	border-color: #86efac;
	background: #f0fdf4;
}
.bha-rp-icon {
	width: 28px;
	height: 28px;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	flex-shrink: 0;
}
.bha-rp-room--done .bha-rp-icon {
	color: #16a34a;
	font-size: 18px;
	font-weight: 700;
}
.bha-rp-body {
	display: flex;
	flex-direction: column;
	gap: 2px;
	flex: 1;
}
.bha-rp-name {
	font-size: 14px;
	font-weight: 600;
	color: var(--bha-dark);
}
.bha-rp-status {
	font-size: 12px;
	color: var(--bha-gray-600);
}
.bha-rp-room--uploading .bha-rp-status,
.bha-rp-room--analyzing .bha-rp-status {
	color: var(--bha-primary);
}
.bha-rp-room--done .bha-rp-status {
	color: #16a34a;
	font-weight: 600;
}

/* Synthesis row */
.bha-rp-synthesis {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 14px;
	border-radius: 8px;
	border: 1.5px dashed #d1d5db;
	background: #f9fafb;
	margin-bottom: 16px;
	transition: border-color 0.2s, background 0.2s;
}
.bha-rp-synthesis--active {
	border-color: var(--bha-primary);
	border-style: solid;
	background: #eef2ff;
}
.bha-rp-syn-icon {
	font-size: 18px;
	color: var(--bha-gray-600);
	flex-shrink: 0;
	width: 28px;
	text-align: center;
}
.bha-rp-synthesis--active .bha-rp-syn-icon {
	color: var(--bha-primary);
}
.bha-rp-syn-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--bha-dark);
	flex: 1;
}
.bha-rp-syn-status {
	font-size: 12px;
	color: var(--bha-gray-600);
}
.bha-rp-synthesis--active .bha-rp-syn-status {
	color: var(--bha-primary);
}

/* Spinner shared by room rows + synthesis row */
.bha-rp-spinner {
	display: inline-block;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(79, 70, 229, 0.25);
	border-top-color: var(--bha-primary);
	border-radius: 50%;
	animation: bha-spin 0.7s linear infinite;
}

.bha-rp-estimate {
	font-size: 12px;
	color: var(--bha-gray-600);
	text-align: center;
	margin: 0;
}

/* ── Multi-Room result UI ────────────────────────────────────────────────── */

.bha-room-card--multi .bha-room-card__summary {
	font-size: 13px;
	color: var(--bha-gray-600);
	margin: 6px 0 8px;
	line-height: 1.45;
}
.bha-room-card--multi .bha-room-card__standalone {
	font-size: 13px;
	color: var(--bha-gray-700);
	margin-bottom: 8px;
}
.bha-room-card--multi .bha-room-card__standalone-label {
	color: var(--bha-gray-500);
}
.bha-room-card--multi .bha-room-card__roi {
	font-size: 12px;
	color: var(--bha-success, #16a34a);
	font-weight: 600;
	margin-left: 4px;
}

/* combined analysis block */
.bha-multi-combined {
	background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
	border: 1.5px solid #86efac;
	border-radius: var(--bha-radius);
	padding: 20px 22px;
}
.bha-multi-combined__grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	margin: 16px 0 12px;
}
.bha-num-block--savings .bha-num-block__value {
	color: var(--bha-gray-900);
}
.bha-num-block--highlight {
	background: #dcfce7;
	border-radius: 8px;
	padding: 6px 12px;
}
.bha-num-block--highlight .bha-num-block__label { color: #15803d; font-weight: 600; }
.bha-num-block--highlight .bha-num-block__value { color: #166534; font-size: 20px; }
.bha-multi-combined__why {
	font-size: 13px;
	color: var(--bha-gray-600);
	margin: 0;
	line-height: 1.5;
}

/* budget tiers */
.bha-budget-tiers {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.bha-budget-tier {
	position: relative;
	padding: 14px 18px;
	border: 1.5px solid var(--bha-gray-200);
	border-radius: var(--bha-radius-sm);
	background: #fff;
}
.bha-budget-tier--best {
	border-color: var(--bha-primary);
	background: #eff6ff;
}
.bha-budget-tier__range {
	font-size: 13px;
	font-weight: 700;
	color: var(--bha-primary);
	margin-bottom: 4px;
}
.bha-budget-tier__rec {
	font-size: 15px;
	font-weight: 600;
	color: var(--bha-gray-900);
	margin-bottom: 6px;
}
.bha-budget-tier__reason {
	font-size: 13px;
	color: var(--bha-gray-600);
	line-height: 1.45;
	margin-bottom: 6px;
}
.bha-budget-tier__roi {
	font-size: 12px;
	font-weight: 600;
	color: var(--bha-success, #16a34a);
}

/* sequencing */
.bha-sequencing {
	background: #fafaf9;
	border-left: 3px solid var(--bha-primary);
	border-radius: 0 var(--bha-radius-sm) var(--bha-radius-sm) 0;
	padding: 14px 18px;
}
.bha-sequencing h4 {
	margin: 0 0 8px;
	font-size: 14px;
	font-weight: 700;
	color: var(--bha-gray-900);
}
.bha-sequencing p {
	margin: 0;
	font-size: 14px;
	color: var(--bha-gray-700);
	line-height: 1.55;
}

/* ── Guest save notice ───────────────────────────────────────────────────── */

.bha-guest-save-notice {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 24px;
	padding: 14px 18px;
	background: #fffbeb;
	border: 1.5px solid #fde68a;
	border-radius: 10px;
	flex-wrap: wrap;
}
.bha-guest-save-notice__icon {
	font-size: 22px;
	flex-shrink: 0;
}
.bha-guest-save-notice__body {
	flex: 1;
	font-size: 14px;
	color: #78350f;
	line-height: 1.5;
	min-width: 200px;
}
.bha-guest-save-notice__body strong {
	display: block;
	margin-bottom: 2px;
	color: #92400e;
}
.bha-guest-save-notice__actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
}

/* ── Quota lockout banner + deactivated form ─────────────────────────────── */

/* Banner shown above the locked form */
.bha-quota-banner {
	display: flex;
	align-items: center;
	gap: 14px;
	padding: 16px 20px;
	margin-bottom: 16px;
	background: #fef2f2;
	border: 1.5px solid #fca5a5;
	border-radius: var(--bha-radius-sm);
	flex-wrap: wrap;
}

.bha-quota-banner__icon {
	font-size: 22px;
	flex-shrink: 0;
}

.bha-quota-banner__body {
	flex: 1;
	min-width: 200px;
	font-size: 14px;
	color: #374151;
	line-height: 1.5;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bha-quota-banner__body strong {
	color: #991b1b;
	font-size: 15px;
}

.bha-quota-banner__body a {
	color: #1d4ed8;
	font-weight: 600;
	text-decoration: underline;
}

.bha-quota-banner__body a:hover {
	color: #1e40af;
}

.bha-quota-banner__actions {
	display: flex;
	gap: 8px;
	flex-shrink: 0;
	flex-wrap: wrap;
}

/* The form beneath the banner: non-interactive and visually deactivated */
.bha-panel__inner--locked {
	pointer-events: none;
	user-select: none;
	opacity: 0.38;
	filter: grayscale(40%);
}

/* ── Property Valuation (AVM) card ─────────────────────────────────────── */

.bha-avm-card {
	background: #f0fdf4;
	border: 1px solid #bbf7d0;
	border-radius: 10px;
	padding: 20px 24px;
}

.bha-avm-card .bha-section-title {
	margin-top: 0;
	margin-bottom: 14px;
	font-size: 1rem;
	color: #166534;
}

.bha-avm-grid {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.bha-avm-block {
	flex: 1 1 180px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.bha-avm-block--estimate {
	border-right: 1px solid #bbf7d0;
	padding-right: 20px;
}

.bha-avm-block__label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #15803d;
}

.bha-avm-block__value {
	font-size: 1.6rem;
	font-weight: 700;
	color: #14532d;
	line-height: 1.1;
}

.bha-avm-block__range {
	font-size: 0.82rem;
	color: #166534;
}

.bha-avm-block__note {
	font-size: 0.72rem;
	color: #15803d;
	margin-top: 2px;
}

.bha-avm-diff {
	font-size: 0.82rem;
	font-weight: 600;
	margin-top: 4px;
}

.bha-avm-diff--above { color: #16a34a; }
.bha-avm-diff--below { color: #dc2626; }

.bha-avm-card__note {
	margin: 14px 0 0;
	font-size: 0.72rem;
	color: #4b7c5e;
	line-height: 1.5;
}

/* ── Valuation discrepancy note ─────────────────────────────────────────── */

.bha-valuation-note {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #fffbeb;
	border: 1px solid #fde68a;
	border-left: 4px solid #f59e0b;
	border-radius: 8px;
	padding: 14px 16px;
}

.bha-valuation-note__icon {
	font-size: 1.1rem;
	flex-shrink: 0;
	margin-top: 1px;
}

.bha-valuation-note__text {
	margin: 0;
	font-size: 0.875rem;
	color: #78350f;
	line-height: 1.6;
}

/* ── Property Details card ───────────────────────────────────────────────── */

.bha-prop-details {
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 20px 24px;
}

.bha-prop-details__grid {
	display: grid;
	grid-template-columns: repeat( auto-fill, minmax( 220px, 1fr ) );
	gap: 14px 24px;
	margin-top: 12px;
}

.bha-prop-details__item {
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.bha-prop-details__label {
	font-size: 0.72rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: #64748b;
}

.bha-prop-details__value {
	font-size: 0.95rem;
	color: #1e293b;
	font-weight: 500;
	word-break: break-word;
}

/* Comp Notes spans full width */
.bha-prop-details__item:last-child:nth-child(odd) {
	grid-column: 1 / -1;
}

/* ── Print ───────────────────────────────────────────────────────────────── */

@media print {
	.bha-tabs, .bha-steps, .bha-step-nav, .bha-result-actions,
	.bha-history-header, .bha-history-controls,
	.bha-btn, .bha-dropzone { display: none !important; }
	.bha-result-header { background: #4f46e5 !important; -webkit-print-color-adjust: exact; }
}

/* ============================================================
   Guest Registration Gate (post-analysis conversion modal)
   ============================================================ */
.bha-register-overlay {
	position: fixed;
	inset: 0;
	background: rgba(15, 23, 42, 0.65);
	backdrop-filter: blur(2px);
	-webkit-backdrop-filter: blur(2px);
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	animation: bha-reg-fade-in 180ms ease-out;
}
@keyframes bha-reg-fade-in {
	from { opacity: 0; }
	to   { opacity: 1; }
}
.bha-register-modal {
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
	width: 100%;
	max-width: 440px;
	padding: 28px 28px 22px;
	animation: bha-reg-pop-in 220ms cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes bha-reg-pop-in {
	from { opacity: 0; transform: translateY(12px) scale(0.96); }
	to   { opacity: 1; transform: translateY(0)    scale(1); }
}
.bha-register-modal__header {
	text-align: center;
	margin-bottom: 18px;
	padding-bottom: 14px;
	border-bottom: 1px solid #e2e8f0;
}
.bha-register-modal__header h3 {
	font-size: 20px;
	margin: 0 0 6px;
	color: #0f172a;
}
.bha-register-modal__subtitle {
	font-size: 14px;
	color: #475569;
	margin: 0;
	line-height: 1.45;
}
.bha-register-form {
	display: flex;
	flex-direction: column;
	gap: 12px;
}
.bha-register-modal__row {
	display: flex;
	flex-direction: column;
	gap: 4px;
}
/* Honeypot: keep in the DOM and visible to naive bots, but hide from
   sighted users. Off-screen positioning rather than display:none —
   sophisticated bots skip display:none fields. */
.bha-register-hp {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}
.bha-register-turnstile-row {
	margin-top: 4px;
	align-items: center;
	min-height: 65px;
}
.bha-register-turnstile-row .cf-turnstile {
	display: flex;
	justify-content: center;
}
.bha-register-modal__row label {
	font-size: 12px;
	font-weight: 600;
	color: #334155;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}
.bha-register-modal__row .bha-req {
	color: #dc2626;
	margin-left: 2px;
}
.bha-register-modal__row input {
	padding: 10px 12px;
	font-size: 14px;
	border: 1px solid #cbd5e1;
	border-radius: 6px;
	background: #fff;
	transition: border-color 120ms ease, box-shadow 120ms ease;
	width: 100%;
	box-sizing: border-box;
}
.bha-register-modal__row input:focus {
	outline: none;
	border-color: #4f46e5;
	box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}
.bha-register-modal__hint {
	font-size: 11px;
	color: #64748b;
}
.bha-register-modal__error {
	background: #fef2f2;
	border: 1px solid #fecaca;
	color: #b91c1c;
	border-radius: 6px;
	padding: 10px 12px;
	font-size: 13px;
	line-height: 1.4;
}
.bha-register-modal__actions {
	margin-top: 6px;
}
.bha-register-modal__actions .bha-btn--primary {
	width: 100%;
	padding: 12px 16px;
	font-size: 15px;
	font-weight: 600;
}
.bha-register-modal__actions .bha-btn--primary[disabled] {
	opacity: 0.6;
	cursor: not-allowed;
}
.bha-register-modal__login {
	text-align: center;
	margin: 4px 0 0;
	font-size: 13px;
	color: #64748b;
}
.bha-register-modal__login a {
	color: #4f46e5;
	text-decoration: none;
	font-weight: 600;
	margin-left: 4px;
}
.bha-register-modal__login a:hover { text-decoration: underline; }

@media (max-width: 480px) {
	.bha-register-modal { padding: 22px 18px 18px; }
	.bha-register-modal__header h3 { font-size: 18px; }
}
