/* InstaMortgage Loan Limits — uses btheme tokens (tokens.color.css / tokens.type.css) with fallbacks. */
.imll {
	--imll-brand: var(--base-800, #1459a3);
	--imll-brand-dark: var(--base-900, #0e3f75);
	--imll-brand-tint: var(--base-100, #eaf2fa);
	--imll-ink: var(--ink-primary, #1a2633);
	--imll-ink-2: var(--ink-secondary, #4a5866);
	--imll-ink-3: var(--ink-tertiary, #6b7785);
	--imll-canvas: var(--surface-canvas, #ffffff);
	--imll-band: var(--surface-band, #f5f7fa);
	--imll-line: var(--line-default, #e1e6ec);
	--imll-line-strong: var(--line-strong, #c5ced8);
	--imll-radius: 12px;
	color: var(--imll-ink);
	background: var(--imll-canvas);
	font-size: 16px;
	line-height: 1.5;
}
.imll *, .imll *::before, .imll *::after { box-sizing: border-box; }
.imll-container { max-width: 1140px; margin: 0 auto; padding: 0 16px; }

/* Hero */
.imll-hero { background: var(--imll-band); border-bottom: 1px solid var(--imll-line); padding: 40px 0 32px; }
.imll-hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 32px; align-items: center; }
@media (min-width: 900px) {
	.imll-hero { padding: 56px 0 48px; }
	.imll-hero-grid { grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 48px; }
}
.imll-eyebrow { margin: 0 0 8px; color: var(--imll-brand); font-weight: 700; font-size: 14px; letter-spacing: .02em; text-transform: uppercase; }
.imll h1 { margin: 0 0 16px; font-size: 28px; line-height: 1.2; font-weight: 700; color: var(--imll-ink); }
@media (min-width: 900px) { .imll h1 { font-size: 34px; } }
.imll-intro p { margin: 0 0 12px; color: var(--imll-ink-2); font-size: 17px; }
.imll-hero-media { margin: 0; }
.imll-hero-img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: var(--imll-radius); }

.imll-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin: 20px 0; padding: 0; }
.imll-stat { background: var(--imll-canvas); border: 1px solid var(--imll-line); border-radius: 10px; padding: 12px 14px; }
.imll-stat dt { font-size: 13px; color: var(--imll-ink-3); margin: 0 0 4px; }
.imll-stat dd { margin: 0; font-size: 18px; font-weight: 700; color: var(--imll-ink); font-variant-numeric: tabular-nums; }

.imll-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin: 0; }
.imll-btn { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 20px; border-radius: 8px; background: var(--imll-brand); color: #fff !important; font-weight: 700; font-size: 15px; text-decoration: none !important; border: 2px solid var(--imll-brand); transition: background .15s, border-color .15s; }
.imll-btn:hover, .imll-btn:focus-visible { background: var(--imll-brand-dark); border-color: var(--imll-brand-dark); }
.imll-btn--ghost { background: transparent; color: var(--imll-brand) !important; }
.imll-btn--ghost:hover, .imll-btn--ghost:focus-visible { background: var(--imll-brand-tint); color: var(--imll-brand-dark) !important; }

/* Body sections */
.imll-body { padding-top: 16px; padding-bottom: 56px; }
.imll-section { padding: 32px 0 8px; max-width: 860px; }
.imll-section.imll-limits { max-width: none; }
.imll-section h2 { margin: 0 0 12px; font-size: 24px; line-height: 1.25; font-weight: 700; color: var(--imll-ink); scroll-margin-top: 100px; }
.imll-section p, .imll-section li { color: var(--imll-ink-2); }
.imll-section a:not(.imll-btn) { color: var(--imll-brand); text-decoration: underline; text-underline-offset: 2px; }
.imll-limits { scroll-margin-top: 90px; }

/* Controls */
.imll-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 8px 0 16px; }
.imll-toggle { display: inline-flex; padding: 4px; gap: 4px; background: var(--imll-band); border: 1px solid var(--imll-line); border-radius: 999px; }
.imll-toggle button { appearance: none; border: 0; background: transparent; color: var(--imll-ink-2); font: inherit; font-weight: 700; font-size: 15px; padding: 8px 22px; min-height: 40px; border-radius: 999px; cursor: pointer; }
.imll-toggle button[aria-selected="true"] { background: var(--imll-brand); color: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.12); }
.imll-toggle button:focus-visible { outline: 2px solid var(--imll-brand); outline-offset: 2px; }
.imll-search input { width: 260px; max-width: 100%; min-height: 44px; padding: 8px 14px; border: 1px solid var(--imll-line-strong); border-radius: 8px; font: inherit; color: var(--imll-ink); background: var(--imll-canvas); }
.imll-search input:focus { outline: 2px solid var(--imll-brand); outline-offset: 1px; border-color: var(--imll-brand); }

/* Table */
.imll-js .imll-panel[data-inactive] { display: none; }
.imll-panel + .imll-panel { margin-top: 24px; }
.imll-js .imll-panel + .imll-panel { margin-top: 0; }
.imll-table { width: 100%; border-collapse: separate; border-spacing: 0; border: 1px solid var(--imll-line); border-radius: var(--imll-radius); overflow: hidden; background: var(--imll-canvas); font-variant-numeric: tabular-nums; }
.imll-table caption { caption-side: top; text-align: left; font-weight: 700; color: var(--imll-ink); padding: 0 0 10px; font-size: 16px; }
.imll-table th, .imll-table td { padding: 12px 16px; text-align: right; border-bottom: 1px solid var(--imll-line); white-space: nowrap; }
.imll-table thead th { position: sticky; top: 0; background: var(--imll-brand-tint); color: var(--imll-ink); font-size: 14px; font-weight: 700; z-index: 1; }
.imll-table th:first-child, .imll-table td:first-child { text-align: left; white-space: normal; }
.imll-table tbody th { font-weight: 500; color: var(--imll-ink); }
.imll-table tbody tr:nth-child(even) { background: var(--imll-band); }
.imll-table tbody tr:last-child > * { border-bottom: 0; }
.imll-table tbody tr:hover { background: var(--imll-brand-tint); }
.imll-table td { color: var(--imll-ink); }
.imll-table td:nth-child(2) { font-weight: 700; }
.imll-badge { display: inline-block; margin-left: 8px; padding: 1px 8px; border-radius: 999px; background: var(--imll-brand-tint); color: var(--imll-brand-dark); font-size: 12px; font-weight: 700; vertical-align: 1px; }

.imll-source { margin: 12px 0 0; font-size: 14px; color: var(--imll-ink-3) !important; }
.imll-source a { color: var(--imll-ink-2) !important; }
.imll-updated { display: inline-block; margin-left: 6px; }
.imll-empty { padding: 16px; text-align: center; color: var(--imll-ink-3); }

/* Mobile: each county becomes a card with a 2x2 grid of unit limits. */
@media (max-width: 640px) {
	.imll-controls { flex-direction: column; align-items: stretch; }
	.imll-toggle { display: flex; }
	.imll-toggle button { flex: 1; }
	.imll-search input { width: 100%; }
	.imll-table, .imll-table tbody, .imll-table tr, .imll-table th, .imll-table td { display: block; }
	.imll-table { border: 0; background: transparent; border-radius: 0; overflow: visible; }
	.imll-table caption { display: block; }
	.imll-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
	.imll-table tbody tr { display: grid; grid-template-columns: 1fr 1fr; margin: 0 0 10px; border: 1px solid var(--imll-line); border-radius: 10px; background: var(--imll-canvas) !important; overflow: hidden; }
	.imll-table tbody th { grid-column: 1 / -1; padding: 10px 14px; font-weight: 700; font-size: 16px; background: var(--imll-band); border-bottom: 1px solid var(--imll-line); }
	.imll-table tbody td { padding: 8px 14px; text-align: left; border-bottom: 0; font-size: 16px; }
	.imll-table tbody td::before { content: attr(data-label); display: block; font-size: 12px; font-weight: 500; color: var(--imll-ink-3); }
	.imll-table tbody td:nth-child(odd) { border-left: 1px solid var(--imll-line); }
	.imll-table tbody td:nth-child(n+4) { border-top: 1px solid var(--imll-line); }
	.imll-table tbody td[colspan] { grid-column: 1 / -1; border: 0; }
	.imll-table tbody td[colspan]::before { content: none; }
	.imll-section h2 { font-size: 21px; }
}

/* FAQs */
.imll-faq { border-bottom: 1px solid var(--imll-line); }
.imll-faq summary { list-style: none; cursor: pointer; padding: 18px 36px 18px 0; position: relative; }
.imll-faq summary::-webkit-details-marker { display: none; }
.imll-faq summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; margin-top: -7px; border-right: 2px solid var(--imll-brand); border-bottom: 2px solid var(--imll-brand); transform: rotate(45deg); transition: transform .15s; }
.imll-faq[open] summary::after { transform: rotate(-135deg); margin-top: -2px; }
.imll-faq summary h3 { display: inline; margin: 0; font-size: 18px; font-weight: 700; color: var(--imll-ink); }
.imll-faq summary:focus-visible { outline: 2px solid var(--imll-brand); outline-offset: 2px; }
.imll-faq-a { padding: 0 0 16px; }
.imll-faq-a p:first-child { margin-top: 0; }

.imll .screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

@media print {
	.imll-controls, .imll-hero-actions, .imll-hero-media { display: none !important; }
	.imll-js .imll-panel[data-inactive] { display: block; }
}
