/* Snap BAH Calculator — v1.2.0 — 2026-11-28 11:20 */
.sbah {
	--sbah-accent: #0B1D3A;
	--sbah-on-accent: #ffffff;
	--sbah-ink: #0B1D3A;
	--sbah-text: #111827;
	--sbah-muted: #374151;
	--sbah-line: #6b7280;
	--sbah-soft: #f3f4f6;
	color: var(--sbah-text);
	font-size: 1rem;
	line-height: 1.6;
	max-width: 960px;
	margin: 0 auto;
}
.sbah *, .sbah *::before, .sbah *::after { box-sizing: border-box; }

.sbah-card {
	background: #ffffff;
	color: var(--sbah-text);
	border: 1px solid #d1d5db;
	border-top: 6px solid var(--sbah-accent);
	border-radius: 12px;
	padding: 1.5rem;
	margin: 0 0 1.5rem;
}
.sbah-title, .sbah-card > h2 { margin: 0 0 .5rem; font-size: 1.6rem; font-weight: 700; line-height: 1.25; color: var(--sbah-ink); }
.sbah-lead { margin: 0 0 1.25rem; color: var(--sbah-muted); }

.sbah-form { display: flex; flex-wrap: wrap; gap: 1rem; align-items: flex-end; margin: 0 0 1rem; }
.sbah-form-stack { flex-direction: column; align-items: stretch; }
.sbah-form-stack .sbah-field, .sbah-form-stack .sbah-check { flex: 0 0 auto; }
.sbah-form-stack .sbah-field-btn { align-self: flex-start; }
.sbah-field { flex: 1 1 200px; min-width: 0; }
.sbah-field-q { flex: 2 1 230px; }
.sbah-field-q + .sbah-field { flex: 1 1 150px; }
.sbah-field-q label { margin-bottom: 0; }
.sbah-field-q .sbah-help { margin: 0 0 .35rem; }
.sbah-field-year { flex: 0 1 120px; }
.sbah-combo { position: relative; }
.sbah-list {
	position: absolute;
	z-index: 50;
	top: calc(100% + 4px);
	left: 0;
	right: 0;
	max-height: 320px;
	overflow-y: auto;
	margin: 0;
	padding: .25rem 0;
	list-style: none;
	background: #ffffff;
	color: var(--sbah-text);
	border: 2px solid var(--sbah-ink);
	border-radius: 8px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
}
.sbah-list[hidden] { display: none; }
.sbah-list-head { padding: .4rem .75rem .2rem; font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--sbah-muted); }
.sbah-option { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .1rem .75rem; min-height: 44px; padding: .55rem .75rem; cursor: pointer; background: #ffffff; color: var(--sbah-text); }
.sbah-option-name { font-weight: 600; }
.sbah-option-place { color: var(--sbah-muted); font-size: .92rem; }
.sbah-option:hover { background: var(--sbah-soft); color: var(--sbah-text); }
.sbah-option[aria-selected="true"] { background: var(--sbah-accent); color: var(--sbah-on-accent); }
.sbah-option[aria-selected="true"] .sbah-option-place { color: var(--sbah-on-accent); }
.sbah-status-ok { color: #064e3b; font-weight: 600; }
.sbah-status-bad { color: #7f1d1d; font-weight: 700; }
.sbah-bases-wrap { max-height: 420px; overflow: auto; border: 1px solid #d1d5db; border-radius: 8px; margin: 0 0 1rem; }
.sbah-bases-wrap thead th { position: sticky; top: 0; }
.sbah-field-btn { flex: 0 0 auto; }
.sbah-field label, .sbah-check label { display: block; font-weight: 600; margin: 0 0 .35rem; color: var(--sbah-text); }
.sbah-field input[type="text"],
.sbah-field input[type="number"],
.sbah-field input[type="file"],
.sbah-field textarea,
.sbah-field select {
	width: 100%;
	min-height: 48px;
	padding: .6rem .75rem;
	font-size: 1rem;
	color: var(--sbah-text);
	background: #ffffff;
	border: 2px solid var(--sbah-line);
	border-radius: 8px;
}
.sbah-field input[type="color"] { width: 72px; height: 48px; padding: 2px; border: 2px solid var(--sbah-line); border-radius: 8px; background: #ffffff; }
.sbah-field input[aria-invalid="true"], .sbah-field select[aria-invalid="true"] { border-color: #991b1b; }
.sbah-check { display: flex; gap: .6rem; align-items: flex-start; }
.sbah-check input { width: 22px; height: 22px; margin-top: .2rem; flex: 0 0 auto; }
.sbah-check label { margin: 0; font-weight: 500; }
.sbah-help { margin: .35rem 0 0; font-size: .9rem; color: var(--sbah-muted); }

.sbah-btn,
.sbah a.sbah-btn:link,
.sbah a.sbah-btn:visited {
	display: inline-block;
	min-height: 48px;
	padding: .7rem 1.4rem;
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.4;
	text-decoration: none;
	cursor: pointer;
	background: var(--sbah-accent);
	color: var(--sbah-on-accent);
	border: 2px solid var(--sbah-accent);
	border-radius: 8px;
}
.sbah-btn:hover,
.sbah a.sbah-btn:hover,
.sbah a.sbah-btn:visited:hover {
	background: #ffffff;
	color: var(--sbah-ink);
	border-color: var(--sbah-ink);
}
.sbah-btn:active,
.sbah a.sbah-btn:active {
	background: var(--sbah-soft);
	color: var(--sbah-ink);
	border-color: var(--sbah-ink);
}
.sbah-btn[disabled] { background: #e5e7eb; color: #1f2937; border-color: #6b7280; cursor: progress; }
.sbah-btn-ghost { background: #ffffff; color: var(--sbah-ink); border-color: var(--sbah-ink); }
.sbah-btn-ghost:hover { background: var(--sbah-accent); color: var(--sbah-on-accent); border-color: var(--sbah-accent); }
.sbah-btn-small { min-height: 44px; padding: .4rem .9rem; font-size: .9rem; }

.sbah :focus-visible { outline: 3px solid #1d4ed8; outline-offset: 3px; }
.sbah-results:focus { outline: none; }

.sbah-error { flex: 1 1 100%; margin: 0; min-height: 0; color: #991b1b; font-weight: 600; }
.sbah-error:empty { display: none; }
.sbah-notice, .sbah-msg:not(:empty) {
	margin: 0 0 1rem;
	padding: .9rem 1rem;
	background: #eff6ff;
	color: #1e3a8a;
	border-left: 6px solid #1e3a8a;
	border-radius: 6px;
}
.sbah-notice-warn, .sbah-msg.is-error:not(:empty) { background: #fef2f2; color: #7f1d1d; border-left-color: #7f1d1d; }
.sbah-msg.is-ok:not(:empty) { background: #ecfdf5; color: #064e3b; border-left-color: #064e3b; }

.sbah-result-title { margin: 1rem 0 .25rem; font-size: 1.3rem; font-weight: 700; color: var(--sbah-ink); }
.sbah-area { margin: 0 0 1rem; color: var(--sbah-muted); }
.sbah-amounts { display: flex; flex-wrap: wrap; gap: 1rem; margin: 0 0 1rem; }
.sbah-amount { flex: 1 1 240px; padding: 1.1rem 1.25rem; background: var(--sbah-soft); color: var(--sbah-text); border: 1px solid #d1d5db; border-radius: 10px; }
.sbah-amount p { margin: 0; }
.sbah-amount-label { font-weight: 700; }
.sbah-amount-value { font-size: 2.2rem; font-weight: 800; line-height: 1.2; color: var(--sbah-ink); }
.sbah-per { font-size: 1rem; font-weight: 600; color: var(--sbah-muted); }
.sbah-amount-year { color: var(--sbah-muted); }
.sbah-cta { margin: 0 0 1rem; }

.sbah-details { border: 1px solid #d1d5db; border-radius: 8px; margin: 0 0 .6rem; background: #ffffff; color: var(--sbah-text); }
.sbah-details summary { padding: .85rem 1rem; min-height: 48px; font-weight: 700; cursor: pointer; color: var(--sbah-ink); }
.sbah-details > p { margin: 0; padding: 0 1rem 1rem; }
.sbah-table-wrap { overflow-x: auto; }
.sbah-details .sbah-table-wrap { padding: 0 1rem 1rem; }
.sbah-table { width: 100%; border-collapse: collapse; font-size: .97rem; }
.sbah-table caption { text-align: left; font-weight: 700; padding: .5rem 0; color: var(--sbah-text); }
.sbah-table th, .sbah-table td { padding: .55rem .7rem; text-align: left; border-bottom: 1px solid #d1d5db; }
.sbah-table td { font-variant-numeric: tabular-nums; }
.sbah-table thead th { background: var(--sbah-accent); color: var(--sbah-on-accent); }
.sbah-row-current th, .sbah-row-current td { background: #fef3c7; color: #111827; font-weight: 700; }

.sbah-source { margin: 1rem 0 0; font-size: .9rem; color: var(--sbah-muted); }
.sbah a:link { color: #1e40af; text-decoration: underline; }
.sbah a:visited { color: #5b21b6; text-decoration: underline; }
.sbah a:hover, .sbah a:visited:hover { color: #111827; text-decoration: underline; }
.sbah a:active { color: #111827; }

.sbah-content { margin: 0 0 1.5rem; }
.sbah-content h2 { font-size: 1.4rem; margin: 0 0 .75rem; color: var(--sbah-ink); }
.sbah-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.sbah-dialog { max-width: min(92vw, 480px); padding: 1.5rem; border: 2px solid var(--sbah-ink); border-radius: 12px; background: #ffffff; color: var(--sbah-text); }
.sbah-dialog::backdrop { background: rgba(0, 0, 0, .6); }
.sbah-dialog h2 { margin: 0 0 .5rem; font-size: 1.25rem; color: var(--sbah-ink); }
.sbah-dialog-url { word-break: break-all; font-weight: 600; }
.sbah-dialog-actions { display: flex; flex-wrap: wrap; gap: .75rem; justify-content: flex-end; }

.sbah-manager-meta { color: var(--sbah-muted); }
.sbah-or { margin: 1rem 0; }
.sbah-test-list { list-style: none; margin: 0; padding: 0; }
.sbah-test-list li { padding: .4rem 0; border-bottom: 1px solid #e5e7eb; }
.sbah-pass { color: #064e3b; font-weight: 700; }
.sbah-fail { color: #7f1d1d; font-weight: 700; }

@media (max-width: 600px) {
	.sbah-card { padding: 1rem; }
	.sbah-title, .sbah-card > h2 { font-size: 1.35rem; }
	.sbah-field, .sbah-field-q, .sbah-field-year, .sbah-field-btn { flex: 1 1 100%; }
	.sbah-field-btn .sbah-btn { width: 100%; }
	.sbah-amount-value { font-size: 1.9rem; }
	.sbah-details .sbah-table-wrap { padding: 0 .5rem .75rem; }
	.sbah-table { font-size: .9rem; }
	.sbah-table th, .sbah-table td { padding: .5rem .4rem; }
}
@media (prefers-reduced-motion: no-preference) {
	.sbah-btn { transition: background-color .15s, color .15s; }
}

/* ----- v1.2.0: header, popular bases, promo ----- */
.sbah-hero {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem 2rem;
	margin: 0 0 1.5rem;
	padding: 1.75rem;
	background: var(--sbah-accent);
	color: var(--sbah-on-accent);
	border-radius: 16px;
}
.sbah-hero-text { flex: 1 1 280px; min-width: 0; }
.sbah-hero-media { flex: 0 1 270px; min-width: 0; }
.sbah-hero-media img { display: block; width: 100%; height: auto; border-radius: 12px; border: 3px solid var(--sbah-on-accent); }
.sbah-eyebrow { display: inline-block; margin: 0 0 .75rem; padding: .3rem .75rem; font-size: .85rem; font-weight: 700; letter-spacing: .03em; background: var(--sbah-on-accent); color: var(--sbah-accent); border-radius: 999px; }
.sbah .sbah-hero-title { margin: 0 0 .6rem; font-size: clamp(1.9rem, 4.5vw, 2.6rem); line-height: 1.1; font-weight: 700; color: var(--sbah-on-accent); }
.sbah-hero-sub { margin: 0 0 1rem; font-size: 1.15rem; color: var(--sbah-on-accent); }
.sbah-hero-facts { margin: 0; padding: 0; list-style: none; color: var(--sbah-on-accent); }
.sbah-hero-facts li { position: relative; margin: 0 0 .35rem; padding-left: 1.6rem; }
.sbah-hero-facts li::before { content: ""; position: absolute; left: .15rem; top: .45em; width: .55rem; height: .9rem; border: solid var(--sbah-on-accent); border-width: 0 3px 3px 0; transform: translateY(-25%) rotate(45deg); }
.sbah-has-hero .sbah-card { box-shadow: 0 6px 24px rgba(11, 29, 58, .10); }

.sbah-popular .sbah-table th a:link { font-weight: 700; }
.sbah-popular-area { display: block; font-weight: 400; font-size: .88rem; color: var(--sbah-muted); }
.sbah-popular .sbah-table-wrap { background: #ffffff; color: var(--sbah-text); border: 1px solid #d1d5db; border-radius: 12px; }
.sbah-popular .sbah-table tbody tr:last-child th, .sbah-popular .sbah-table tbody tr:last-child td { border-bottom: 0; }

.sbah-promo { max-width: none; }
.sbah-promo-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: .5rem 1.25rem;
	margin: 0;
	padding: .75rem 1rem;
	background: #F4C95D;
	color: #111827;
	text-align: center;
}
.sbah-promo-bar p { margin: 0; color: #111827; }
.sbah-promo-bar .sbah-btn,
.sbah.sbah-promo-bar a.sbah-btn:link,
.sbah.sbah-promo-bar a.sbah-btn:visited { background: #0B1D3A; color: #ffffff; border-color: #0B1D3A; }
.sbah-promo-bar .sbah-btn:hover,
.sbah.sbah-promo-bar a.sbah-btn:hover,
.sbah.sbah-promo-bar a.sbah-btn:visited:hover { background: #ffffff; color: #0B1D3A; border-color: #0B1D3A; }
.sbah-promo-card {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 1.5rem;
	max-width: 960px;
	margin: 2rem auto;
	padding: 1.5rem;
	background: #ffffff;
	color: var(--sbah-text);
	border: 1px solid #d1d5db;
	border-top: 6px solid var(--sbah-accent);
	border-radius: 12px;
}
.sbah-promo-card img { flex: 1 1 240px; min-width: 0; max-width: 340px; width: 100%; height: auto; border-radius: 10px; }
.sbah-promo-body { flex: 2 1 320px; min-width: 0; }
.sbah-promo-body h2 { margin: 0 0 .4rem; font-size: 1.5rem; color: var(--sbah-ink); }
.sbah-promo-body p { margin: 0 0 1rem; }

@media (max-width: 600px) {
	.sbah-hero { padding: 1.25rem; }
	.sbah-hero-media { flex: 1 1 100%; }
	.sbah-hero-media img { aspect-ratio: 2 / 1; object-fit: cover; }
	.sbah-popular .sbah-table { font-size: .85rem; }
}
