/*
 * Multicalc main stylesheet (mobile first).
 *
 * 1. Tokens            6. Search
 * 2. Base              7. Calculator app
 * 3. Layout            8. Content, FAQ, trust
 * 4. Header and nav    9. Cards and grids
 * 5. Buttons, chips   10. Ads, footer, utilities
 */

/* 1. Tokens ------------------------------------------------------------- */
@font-face {
	font-family: "IBM Plex Sans";
	src: url("../fonts/plex-latin-wght.woff2") format("woff2");
	font-weight: 100 700;
	font-style: normal;
	font-display: swap;
}

:root {
	--bg: #F4F6F9;
	--surface: #FFFFFF;
	--surface-2: #ECF0F5;
	--ink: #0C1B2C;
	--muted: #4E5C70;
	--line: #DCE2EA;
	--line-strong: #C2CBD7;
	--accent: #1746B8;
	--accent-strong: #10338A;
	--accent-soft: #E9EFFC;
	--danger: #B42318;
	--danger-soft: #FEF3F2;
	--chart-a: #A7B6CA;

	--font: "IBM Plex Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
	--mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

	--r-sm: 8px;
	--r-md: 12px;
	--r-lg: 16px;
	--shadow: 0 1px 2px rgba(15, 23, 34, .04), 0 12px 32px -12px rgba(15, 23, 34, .12);

	--container: 1160px;
	--gutter: 16px;
	--header-h: 64px;
}

@media (min-width: 768px) {
	:root { --gutter: 24px; }
}

/* 2. Base ---------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: 17px;
	line-height: 1.6;
	font-feature-settings: "tnum" 0;
	-webkit-font-smoothing: antialiased;
	overflow-x: hidden;
}

:where(h1, h2, h3, h4, p, ul, ol, dl, dd, figure, blockquote) { margin: 0; }
:where(h1, h2, h3, h4) { line-height: 1.15; font-weight: 600; letter-spacing: -0.015em; }
:where(ul, ol) { padding: 0; }
img, svg { max-width: 100%; height: auto; }
svg { flex-shrink: 0; }

a { color: var(--accent-strong); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { color: var(--ink); }

:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

button, input, select, textarea { font: inherit; color: inherit; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden; clip: rect(0 0 0 0);
	white-space: nowrap; border: 0;
}

.skip-link {
	position: absolute; left: 16px; top: -100px; z-index: 1000;
	background: var(--ink); color: #fff; padding: 12px 16px; border-radius: var(--r-sm);
	text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; color: #fff; }

.site-main:focus { outline: none; }

/* 3. Layout -------------------------------------------------------------- */
.container {
	width: 100%;
	max-width: calc(var(--container) + var(--gutter) * 2);
	margin-inline: auto;
	padding-inline: var(--gutter);
}
.container--narrow { max-width: calc(800px + var(--gutter) * 2); }

.page-header { padding: 20px 0 20px; }
.page-header__title { font-size: clamp(1.9rem, 5.5vw, 2.6rem); margin-top: 12px; }
.page-header__intro { margin-top: 12px; color: var(--muted); font-size: 1.075rem; max-width: 68ch; }
.page-header__intro p + p { margin-top: .6em; }
.page-header__meta { margin-top: 10px; color: var(--muted); font-size: .9rem; }

.home-section { margin: 48px 0; }
.home-section > h2, .section-head h2 { font-size: clamp(1.4rem, 3.5vw, 1.75rem); }
.home-section > h2 { margin-bottom: 20px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 20px; }
.section-head__link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; text-decoration: none; white-space: nowrap; }

.empty-state { color: var(--muted); background: var(--surface); border: 1px dashed var(--line-strong); border-radius: var(--r-md); padding: 20px; }

/* 4. Header and navigation ------------------------------------------------ */
.site-header {
	position: sticky; top: 0; z-index: 50;
	background: rgba(255, 255, 255, .92);
	-webkit-backdrop-filter: saturate(180%) blur(12px);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--line);
}
.admin-bar .site-header { top: 46px; }
@media (min-width: 783px) { .admin-bar .site-header { top: 32px; } }

.site-header__inner { display: flex; align-items: center; gap: 12px; height: var(--header-h); }

.site-logo { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 1.1rem; letter-spacing: -0.02em; margin-right: auto; }
.site-logo:hover { color: var(--ink); }
.site-logo__mark { color: var(--accent); }
.custom-logo-link { margin-right: auto; display: inline-flex; }
.custom-logo { max-height: 40px; width: auto; }

.site-header__actions { display: flex; align-items: center; gap: 8px; }

.search-trigger {
	display: inline-flex; align-items: center; gap: 8px;
	height: 44px; min-width: 44px; justify-content: center;
	padding: 0 12px; border-radius: var(--r-md);
	border: 1px solid var(--line); background: var(--surface);
	color: var(--muted); cursor: pointer; font-size: .95rem;
}
.search-trigger:hover { border-color: var(--line-strong); color: var(--ink); }
.search-trigger__text { display: none; }
@media (min-width: 640px) {
	.search-trigger { padding: 0 14px; min-width: 220px; justify-content: flex-start; }
	.search-trigger__text { display: inline; }
	.search-trigger__sr { display: none; }
}

.nav-toggle {
	display: inline-flex; align-items: center; justify-content: center;
	width: 44px; height: 44px; border-radius: var(--r-md);
	border: 1px solid var(--line); background: var(--surface); cursor: pointer;
}
.nav-toggle__open { display: inline-flex; }
.nav-toggle__close { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__open { display: none; }
.nav-toggle[aria-expanded="true"] .nav-toggle__close { display: inline-flex; }

.nav {
	display: none;
	position: absolute; left: 0; right: 0; top: 100%;
	background: var(--surface); border-bottom: 1px solid var(--line);
	box-shadow: var(--shadow);
	max-height: calc(100vh - var(--header-h)); overflow-y: auto;
}
.nav.is-open { display: block; }
.nav__list { list-style: none; padding: 8px var(--gutter) 16px; }
.nav__link, .nav__sublink {
	display: flex; align-items: center; justify-content: space-between; width: 100%;
	padding: 12px 4px; min-height: 48px;
	color: var(--ink); text-decoration: none; font-weight: 550;
	border: 0; background: none; cursor: pointer; text-align: left;
	border-bottom: 1px solid var(--line);
}
.nav__link[aria-current="page"], .nav__sublink[aria-current="page"] { color: var(--accent-strong); }
.nav__toggle .mc-icon { transition: transform .15s ease; }
.nav__toggle[aria-expanded="true"] .mc-icon { transform: rotate(180deg); }
.nav__sub { list-style: none; display: none; padding-left: 12px; }
.nav__sub.is-open { display: block; }
.nav__sublink { font-weight: 450; }

@media (min-width: 1080px) {
	.site-logo { margin-right: 8px; }
	.nav { display: block; position: static; background: none; border: 0; box-shadow: none; max-height: none; overflow: visible; margin-right: auto; }
	.nav__list { display: flex; align-items: center; gap: 2px; padding: 0; }
	.nav__item { position: relative; }
	.nav__link { padding: 8px 10px; min-height: 40px; border: 0; border-radius: var(--r-sm); font-size: .95rem; font-weight: 500; color: var(--muted); gap: 4px; }
	.nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--ink); background: var(--surface-2); }
	.nav__link[aria-current="page"] { color: var(--ink); }
	.nav__sub {
		position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px;
		background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
		box-shadow: var(--shadow); padding: 6px;
	}
	.nav__sublink { border: 0; border-radius: var(--r-sm); min-height: 40px; padding: 8px 12px; font-size: .95rem; }
	.nav__sublink:hover { background: var(--surface-2); }
	.nav-toggle { display: none; }
	.search-trigger { min-width: 0; }
}
@media (min-width: 1180px) {
	.search-trigger { min-width: 230px; }
}

/* 5. Buttons and chips ---------------------------------------------------- */
.mc-btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 52px; padding: 0 22px; border-radius: var(--r-md);
	font-weight: 600; font-size: 1.02rem; cursor: pointer; text-decoration: none;
	border: 1px solid transparent; transition: background-color .15s ease, border-color .15s ease;
}
.mc-btn--primary { background: var(--accent); color: #fff; }
.mc-btn--primary:hover { background: var(--accent-strong); color: #fff; }
.mc-btn--primary:active { transform: translateY(1px); }
.mc-btn--ghost { background: var(--surface); color: var(--ink); border-color: var(--line-strong); }
.mc-btn--ghost:hover { border-color: var(--ink); }
.mc-btn--small { min-height: 44px; padding: 0 16px; font-size: .95rem; }

.icon-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: var(--r-md); border: 1px solid var(--line); background: var(--surface); cursor: pointer; }

.chip-list, .hero__chips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
	display: inline-flex; align-items: center; gap: 6px; min-height: 40px;
	padding: 6px 14px; border-radius: 999px; background: var(--surface);
	border: 1px solid var(--line); color: var(--ink); text-decoration: none; font-size: .95rem; font-weight: 500;
}
.chip:hover { border-color: var(--accent); color: var(--ink); }

/* 6. Search ---------------------------------------------------------------- */
.search { position: relative; width: 100%; }
.search__box {
	display: flex; align-items: center; gap: 8px;
	background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--r-md);
	padding: 4px 4px 4px 14px; color: var(--muted);
	transition: border-color .15s ease, box-shadow .15s ease;
}
.search__box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.search__input {
	flex: 1; min-width: 0; height: 44px; border: 0; background: none; outline: none;
	font-size: 16px; color: var(--ink);
}
.search__input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search__submit {
	height: 44px; padding: 0 16px; border-radius: var(--r-sm); border: 0;
	background: var(--ink); color: #fff; font-weight: 600; cursor: pointer;
}
.search__submit:hover { background: #26303D; }
.search--lg .search__box { padding: 6px 6px 6px 18px; box-shadow: var(--shadow); }
.search--lg .search__input { height: 52px; font-size: 1.1rem; }
.search--lg .search__submit { height: 52px; padding: 0 22px; }
@media (max-width: 420px) {
	.search--lg .search__submit { padding: 0 14px; }
}

.search__results {
	list-style: none; margin-top: 8px;
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
	box-shadow: var(--shadow); padding: 6px; max-height: 60vh; overflow-y: auto;
	text-align: left;
}
.search--lg .search__results { position: absolute; left: 0; right: 0; z-index: 30; }
.search__option a {
	display: flex; justify-content: space-between; align-items: center; gap: 12px;
	padding: 12px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; min-height: 48px;
}
.search__option-cat { color: var(--muted); font-size: .85rem; white-space: nowrap; }
.search__option[aria-selected="true"] a, .search__option a:hover { background: var(--surface-2); }
.search__empty { padding: 12px; color: var(--muted); }

.search-dialog {
	width: min(640px, calc(100% - 24px)); max-width: none; max-height: calc(100vh - 48px);
	margin: 24px auto auto; padding: 0; border: 0; border-radius: var(--r-lg);
	background: var(--surface); color: var(--ink); box-shadow: 0 24px 64px rgba(15, 23, 34, .25);
}
.search-dialog::backdrop { background: rgba(15, 23, 34, .45); }
.search-dialog__panel { padding: 16px; }
.search-dialog__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.search-dialog__title { font-weight: 650; }
.search-dialog .search__results { box-shadow: none; }

/* 7. Calculator app ---------------------------------------------------------- */
.calc-page .page-header { padding-bottom: 16px; }

.mc-app {
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--r-lg);
	box-shadow: var(--shadow);
	display: grid;
	overflow: hidden;
}
.mc-form { padding: 20px 16px; }
@media (min-width: 480px) { .mc-form { padding: 24px; } }
@media (min-width: 920px) {
	.mc-app { grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); }
	.mc-form { padding: 32px; }
}

.mc-fields { display: grid; gap: 18px; }
.mc-row { display: grid; gap: 18px; grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr)); align-items: start; }
.mc-row__label { grid-column: 1 / -1; font-weight: 600; margin-bottom: -8px; color: var(--muted); font-size: .95rem; }
.mc-row[hidden], .mc-field[hidden] { display: none; }

.mc-field { min-width: 0; border: 0; padding: 0; margin: 0; }
.mc-label { display: block; font-weight: 600; font-size: .98rem; margin-bottom: 8px; padding: 0; }
.mc-label--sub { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.mc-help { margin-top: 6px; font-size: .88rem; color: var(--muted); line-height: 1.45; }

.mc-input-wrap { position: relative; display: flex; align-items: center; }
.mc-input {
	width: 100%; height: 52px; padding: 0 14px;
	font-size: 17px; font-variant-numeric: tabular-nums;
	background: var(--surface); color: var(--ink);
	border: 1px solid var(--line-strong); border-radius: var(--r-md);
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none; appearance: none;
}
.mc-input:hover { border-color: #9AA5B4; }
.mc-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.mc-input::placeholder { color: #8A94A3; }
.mc-input[type="date"] { min-width: 0; }
.has-suffix .mc-input { padding-right: 76px; }
.has-prefix .mc-input { padding-left: 40px; }
.mc-affix { position: absolute; color: var(--muted); font-size: .95rem; pointer-events: none; }
.mc-affix--suf { right: 14px; }
.mc-affix--pre { left: 14px; }

.mc-select-wrap { position: relative; }
.mc-select-wrap::after {
	content: ""; position: absolute; right: 16px; top: 50%; width: 8px; height: 8px;
	border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
	transform: translateY(-70%) rotate(45deg); pointer-events: none;
}
.mc-select { padding-right: 40px; cursor: pointer; text-overflow: ellipsis; }

.mc-segmented { display: flex; flex-wrap: wrap; gap: 4px; padding: 4px; background: var(--surface-2); border-radius: var(--r-md); }
.mc-segmented__input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.mc-segmented__label {
	flex: 1 1 auto; min-width: 64px; min-height: 44px;
	display: flex; align-items: center; justify-content: center; text-align: center;
	padding: 6px 12px; border-radius: var(--r-sm); cursor: pointer;
	font-weight: 550; color: var(--muted); font-size: .98rem;
}
.mc-segmented__label:hover { color: var(--ink); }
.mc-segmented__input:checked + .mc-segmented__label { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 34, .12), inset 0 0 0 1px var(--line-strong); }
.mc-segmented__input:focus-visible + .mc-segmented__label { outline: 3px solid var(--accent); outline-offset: 1px; }

.mc-check { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; font-size: .98rem; line-height: 1.45; min-height: 44px; padding-top: 2px; }
.mc-check input { width: 22px; height: 22px; margin: 0; flex-shrink: 0; accent-color: var(--accent); cursor: pointer; }

.mc-list { list-style: none; display: grid; gap: 10px; margin: 4px 0 12px; }
.mc-list__row { display: grid; grid-template-columns: 1fr 1fr 44px; gap: 10px; align-items: end; }
.mc-list__remove {
	width: 44px; height: 52px; border-radius: var(--r-md); border: 1px solid var(--line);
	background: var(--surface); color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
}
.mc-list__remove:hover { color: var(--danger); border-color: var(--danger); }
.mc-list .mc-error { grid-column: 1 / -1; }

.has-error .mc-input { border-color: var(--danger); border-width: 2px; }
.mc-error { margin-top: 6px; color: var(--danger); font-size: .9rem; font-weight: 550; display: flex; gap: 6px; }
.mc-error::before { content: "!"; flex-shrink: 0; display: inline-flex; align-items: center; justify-content: center; width: 18px; height: 18px; margin-top: 1px; border-radius: 50%; background: var(--danger); color: #fff; font-size: .75rem; font-weight: 700; }
.mc-error[hidden] { display: none; }

.mc-actions { display: grid; grid-template-columns: 1fr auto; gap: 10px; margin-top: 24px; }

.mc-result {
	background: var(--accent-soft);
	padding: 20px 16px 24px;
	border-top: 1px solid var(--line);
	min-width: 0;
}
.mc-result:focus { outline: none; }
@media (min-width: 480px) { .mc-result { padding: 24px; } }
@media (min-width: 920px) { .mc-result { border-top: 0; border-left: 1px solid var(--line); padding: 32px; } }
.mc-result__heading { font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; color: var(--accent-strong); font-weight: 700; margin-bottom: 12px; }
.mc-result__empty { color: var(--muted); }
.mc-result__primary { padding-bottom: 16px; border-bottom: 1px solid rgba(23, 70, 184, .18); margin-bottom: 8px; }
.mc-result__label { font-weight: 550; color: var(--ink); }
.mc-result__value {
	font-size: clamp(2rem, 8vw, 2.6rem); line-height: 1.1; font-weight: 700; letter-spacing: -0.02em;
	color: var(--accent-strong); font-variant-numeric: tabular-nums; margin-top: 4px; overflow-wrap: anywhere;
}
.mc-result__note { color: var(--muted); margin-top: 4px; font-size: .95rem; }
.mc-result__list { display: grid; }
.mc-result__row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 16px; padding: 10px 0; border-bottom: 1px solid rgba(23, 70, 184, .12); }
.mc-result__row dt { color: var(--muted); }
.mc-result__row dd { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right; overflow-wrap: anywhere; }
.mc-result__row.is-strong dt, .mc-result__row.is-strong dd { color: var(--ink); font-weight: 700; }
.mc-result__rownote { flex-basis: 100%; font-size: .85rem; color: var(--muted); }
.mc-result__summary { margin-top: 14px; font-size: .95rem; }
.mc-result__disclaimer { margin-top: 12px; font-size: .88rem; color: var(--muted); padding: 10px 12px; background: rgba(255, 255, 255, .7); border-radius: var(--r-sm); }
.mc-result__error { background: var(--surface); border: 2px solid var(--danger); border-radius: var(--r-md); padding: 12px 14px; }
.mc-result__error-title { color: var(--danger); font-weight: 600; }

.mc-details { margin-top: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.mc-details > summary { cursor: pointer; padding: 12px 14px; font-weight: 600; min-height: 48px; display: flex; align-items: center; }
.mc-details[open] > summary { border-bottom: 1px solid var(--line); }
.mc-block { margin-top: 16px; }
.mc-block__title { font-size: 1rem; margin-bottom: 8px; }
.mc-table-wrap { overflow: auto; max-height: 420px; -webkit-overflow-scrolling: touch; }
.mc-table { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums; }
.mc-table th, .mc-table td { padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
.mc-table th { position: sticky; top: 0; background: var(--surface-2); font-weight: 600; }
.mc-table .is-num { text-align: right; }

.mc-chart { margin-top: 16px; background: var(--surface); border-radius: var(--r-md); padding: 12px; border: 1px solid var(--line); }
.mc-chart__caption { font-weight: 600; font-size: .95rem; margin-bottom: 8px; }
.mc-chart__svg { display: block; width: 100%; height: auto; }
.mc-chart__grid { stroke: var(--line); stroke-width: 1; }
.mc-chart__a { fill: var(--chart-a); }
.mc-chart__b { fill: var(--accent); }
.mc-chart__label { font-size: 22px; fill: var(--muted); font-family: var(--font); }
.mc-chart__legend { list-style: none; display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: .85rem; color: var(--muted); }
.mc-chart__legend li { display: inline-flex; align-items: center; gap: 6px; }
.mc-chart__swatch { width: 12px; height: 12px; border-radius: 3px; background: var(--chart-a); }
.is-b .mc-chart__swatch { background: var(--accent); }

.notice-box {
	display: flex; gap: 12px; align-items: flex-start;
	margin-top: 16px; padding: 14px 16px; border-radius: var(--r-md);
	background: var(--surface); border: 1px solid var(--line-strong); color: var(--ink); font-size: .95rem;
}
.notice-box .mc-icon { color: var(--muted); margin-top: 2px; }
.notice-box p { margin: 0; }

/* 8. Content, FAQ, trust ------------------------------------------------------ */
.calc-article { max-width: 760px; margin: 48px auto 0; }

.prose { max-width: 72ch; }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: clamp(1.35rem, 3.5vw, 1.6rem); margin-top: 1.8em; }
.prose h3 { font-size: 1.15rem; margin-top: 1.5em; }
.prose > :first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .35em; }
.prose table { width: 100%; border-collapse: collapse; font-size: .95rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: 8px 10px; text-align: left; }
.prose th { background: var(--surface-2); }
.prose blockquote { padding: 12px 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.prose code { font-family: var(--mono); font-size: .92em; background: var(--surface-2); padding: 1px 5px; border-radius: 5px; }
.prose .example { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }

.content-section { margin-top: 40px; }
.content-section > h2 { font-size: clamp(1.35rem, 3.5vw, 1.6rem); margin-bottom: 14px; }
.formula { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 16px 18px; font-family: var(--mono); font-size: .95rem; line-height: 1.7; overflow-x: auto; }
.formula p + p { margin-top: .5em; }

.faq__list { border-top: 1px solid var(--line); }
.faq__item { border-bottom: 1px solid var(--line); }
.faq__q { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 16px 0; font-weight: 600; min-height: 56px; }
.faq__q::-webkit-details-marker { display: none; }
.faq__q .mc-icon { color: var(--muted); transition: transform .15s ease; }
.faq__item[open] .faq__q .mc-icon { transform: rotate(180deg); }
.faq__a { padding: 0 0 18px; color: #2B3440; max-width: 68ch; }

.trust-box { margin-top: 40px; padding: 18px 20px; border-radius: var(--r-md); background: var(--surface); border: 1px solid var(--line); font-size: .95rem; }
.trust-box__title { font-size: 1.05rem; margin-bottom: 8px; }
.trust-box ul { padding-left: 1.2em; color: var(--muted); }
.trust-box li + li { margin-top: 4px; }

.related { margin: 56px 0 24px; }
.related > h2 { font-size: clamp(1.35rem, 3.5vw, 1.6rem); margin-bottom: 16px; }

.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 4px; font-size: .88rem; color: var(--muted); }
.breadcrumbs li + li::before { content: "/"; margin-right: 4px; color: var(--line-strong); }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--ink); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--ink); }

.page-content { padding-bottom: 16px; }
.page-updated { color: var(--muted); font-size: .9rem; margin: 32px 0 48px; }
.mc-pending { background: #FFF4D6; color: #6B4E00; padding: 0 4px; border-radius: 4px; }

/* 9. Hero, cards and grids -------------------------------------------------------- */
.hero { background: var(--surface); border-bottom: 1px solid var(--line); }
.hero__inner { padding-top: 48px; padding-bottom: 40px; text-align: center; max-width: calc(760px + var(--gutter) * 2); }
.hero__title { font-size: clamp(2.1rem, 7vw, 3.4rem); letter-spacing: -0.03em; line-height: 1.05; }
.hero__subtitle { margin: 16px auto 28px; color: var(--muted); font-size: clamp(1.02rem, 2.5vw, 1.18rem); max-width: 56ch; }
.hero__chips { justify-content: center; margin-top: 18px; }
@media (min-width: 768px) { .hero__inner { padding-top: 72px; padding-bottom: 56px; } }

.card-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .card-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }

.calc-card {
	position: relative; display: flex; gap: 14px; align-items: flex-start;
	padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
	transition: border-color .15s ease;
}
.calc-card:hover { border-color: var(--accent); }
.calc-card:focus-within { border-color: var(--accent); }
.calc-card__icon { display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: var(--surface-2); color: var(--ink); flex-shrink: 0; }
.calc-card__body { flex: 1; min-width: 0; }
.calc-card__title { font-size: 1.02rem; line-height: 1.3; }
.calc-card__link { color: var(--ink); text-decoration: none; }
.calc-card__link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.calc-card__link:focus-visible { outline: none; }
.calc-card__link:focus-visible::after { outline: 3px solid var(--accent); outline-offset: 2px; }
.calc-card__text { margin-top: 4px; color: var(--muted); font-size: .92rem; line-height: 1.45; }
.calc-card__arrow { color: var(--line-strong); align-self: center; transition: color .15s ease; }
.calc-card:hover .calc-card__arrow { color: var(--accent); }
.calc-card--compact { align-items: center; padding: 12px 14px; }
.calc-card--compact .calc-card__icon { width: 36px; height: 36px; }

.cat-grid { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .cat-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.cat-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 18px; }
.cat-card__head { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; align-items: center; margin-bottom: 12px; }
.cat-card__icon { grid-row: span 2; display: inline-flex; align-items: center; justify-content: center; width: 42px; height: 42px; border-radius: 10px; background: var(--surface-2); }
.cat-card__title { font-size: 1.08rem; }
.cat-card__title a { color: var(--ink); text-decoration: none; }
.cat-card__title a:hover { text-decoration: underline; }
.cat-card__count { font-size: .85rem; color: var(--muted); }
.cat-card__list { list-style: none; display: grid; gap: 2px; }
.cat-card__list a { display: block; padding: 6px 0; color: var(--ink); text-decoration: none; font-size: .95rem; }
.cat-card__list a:hover { color: var(--accent-strong); text-decoration: underline; }
.cat-card__empty { color: var(--muted); font-size: .92rem; }

.intent-list { list-style: none; columns: 1; column-gap: 32px; }
@media (min-width: 640px) { .intent-list { columns: 2; } }
@media (min-width: 1000px) { .intent-list { columns: 3; } }
.intent-list li { break-inside: avoid; }
.intent-list a { display: block; padding: 10px 0; border-bottom: 1px solid var(--line); color: var(--ink); text-decoration: none; }
.intent-list a:hover { color: var(--accent-strong); }

.home-about { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 24px 20px; }
@media (min-width: 768px) { .home-about { padding: 40px; } }
.home-faq { max-width: 800px; margin-bottom: 48px; }

.directory-search { max-width: 760px; margin-bottom: 8px; }
.directory-group { margin-top: 28px; scroll-margin-top: calc(var(--header-h) + 16px); }
.directory-group__title { font-size: 1.1rem; margin-bottom: 12px; }
.directory-group__title a { color: var(--ink); }
.result-list { list-style: none; display: grid; gap: 8px; }
.result-list li { display: flex; justify-content: space-between; gap: 12px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); padding: 14px 16px; }
.result-list a { font-weight: 600; color: var(--ink); }
.result-list span { color: var(--muted); font-size: .9rem; }

/* 10. Ads, footer, utilities --------------------------------------------------------- */
.mc-ad { margin: 40px auto; max-width: 970px; text-align: center; clear: both; }
.mc-ad__label { display: block; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.mc-ad__inner { min-height: var(--mc-ad-h, 100px); display: flex; align-items: center; justify-content: center; overflow: hidden; }
@media (min-width: 768px) { .mc-ad__inner { min-height: var(--mc-ad-h-lg, 90px); } }
.mc-ad__inner > * { max-width: 100%; }
.mc-ad__placeholder { width: 100%; min-height: inherit; display: flex; align-items: center; justify-content: center; border: 1px dashed var(--line-strong); border-radius: var(--r-sm); color: var(--muted); font-size: .85rem; background: repeating-linear-gradient(45deg, transparent, transparent 8px, rgba(15, 23, 34, .025) 8px, rgba(15, 23, 34, .025) 16px); }
.prose .mc-ad { margin: 32px 0; }

.site-footer { background: #0C1B2C; color: #C5D0DE; margin-top: 64px; font-size: .95rem; }
.site-footer a { color: #F1F8F4; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.site-footer .site-logo { color: #fff; }
.site-footer .site-logo__mark { color: #3E73B8; }
.site-footer :focus-visible { outline-color: #8DB4E8; }
.site-footer__grid { display: grid; gap: 32px; padding-top: 48px; padding-bottom: 32px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .site-footer__grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .site-footer__grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.site-footer__tagline { margin-top: 12px; max-width: 32ch; }
.site-footer__title { font-size: .85rem; text-transform: uppercase; letter-spacing: .08em; color: #fff; margin-bottom: 12px; }
.site-footer ul { list-style: none; display: grid; gap: 4px; }
.site-footer li a { display: inline-block; padding: 4px 0; }
.footer__social { display: flex !important; flex-wrap: wrap; gap: 12px !important; margin-top: 16px; }
.site-footer__bottom { border-top: 1px solid rgba(255, 255, 255, .14); padding-top: 20px; padding-bottom: 28px; font-size: .88rem; color: #9AA9BD; }

/* 11. Category tones and refinements -------------------------------------------------- */
/* Soft tints identify categories at a glance. They only color icon tiles:
   the brand accent stays reserved for actions and results. */
.tone-neutral        { --tone-bg: var(--accent-soft); --tone-fg: var(--accent-strong); }
.tone-finanzas       { --tone-bg: #E3F3EB; --tone-fg: #0B6B4E; }
.tone-trabajo        { --tone-bg: #E6EEFB; --tone-fg: #2451A3; }
.tone-educacion      { --tone-bg: #FCF1DC; --tone-fg: #8A5300; }
.tone-matematicas    { --tone-bg: #E2F2F6; --tone-fg: #0B6379; }
.tone-fechas         { --tone-bg: #FCE8EA; --tone-fg: #A52A3A; }
.tone-vida-cotidiana { --tone-bg: #FDEEE3; --tone-fg: #A64B12; }
.tone-hogar          { --tone-bg: #EBF3E1; --tone-fg: #4A6F1C; }
.tone-tecnologia     { --tone-bg: #ECEFF4; --tone-fg: #3A4A60; }

.calc-card__icon, .cat-card__icon, .page-header__icon {
	background: var(--tone-bg, var(--surface-2));
	color: var(--tone-fg, var(--ink));
}

/* Hero: faint graph-paper grid fading from the center. */
.hero { position: relative; overflow: hidden; }
.hero::before {
	content: ""; position: absolute; inset: 0; pointer-events: none;
	background-image:
		linear-gradient(to right, rgba(15, 23, 34, .055) 1px, transparent 1px),
		linear-gradient(to bottom, rgba(15, 23, 34, .055) 1px, transparent 1px);
	background-size: 28px 28px;
	background-position: center top;
	-webkit-mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 25%, transparent 78%);
	mask-image: radial-gradient(ellipse 75% 70% at 50% 35%, #000 25%, transparent 78%);
}
.hero__inner { position: relative; }
.hero__title-em { color: var(--accent-strong); }
.hero__facts {
	list-style: none; display: flex; flex-wrap: wrap; justify-content: center;
	gap: 6px 22px; margin-top: 28px; color: var(--muted); font-size: .92rem;
}
.hero__facts li { display: inline-flex; align-items: center; gap: 7px; }
.hero__facts li::before {
	content: ""; width: 16px; height: 16px; flex-shrink: 0; border-radius: 50%;
	background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-4.8' fill='none' stroke='%2310338A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 16px no-repeat;
}
.hero__facts strong { color: var(--ink); font-weight: 650; font-variant-numeric: tabular-nums; }

/* Cards: full description clamped to two lines (no mid-word cuts). */
.calc-card__text {
	display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
}

/* Popular calculators: 2 feature cards + 6 regular (bento). */
.bento { display: grid; gap: 12px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .bento { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
	.bento { grid-template-columns: repeat(6, minmax(0, 1fr)); }
	.bento > .calc-card { grid-column: span 2; }
	.bento > .calc-card--feature { grid-column: span 3; }
}
.calc-card--feature {
	flex-direction: column; gap: 16px; padding: 22px;
	background: linear-gradient(140deg, var(--tone-bg) 0%, var(--surface) 62%);
}
.calc-card--feature .calc-card__icon { width: 52px; height: 52px; border-radius: 14px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.calc-card__cat { font-size: .82rem; font-weight: 600; color: var(--tone-fg, var(--muted)); margin-bottom: 4px; }
.calc-card--feature .calc-card__title { font-size: clamp(1.2rem, 2.4vw, 1.4rem); letter-spacing: -0.02em; }
.calc-card--feature .calc-card__text { -webkit-line-clamp: 3; line-clamp: 3; font-size: .98rem; margin-top: 6px; }
.calc-card__cta { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; font-size: .95rem; color: var(--accent-strong); }
.calc-card--feature:hover .calc-card__cta .mc-icon { transform: translateX(3px); }
.calc-card__cta .mc-icon { transition: transform .15s ease; }
@media (min-width: 1000px) { .calc-card--feature { padding: 28px; } }

/* Category cards: slightly stronger identity. */
.cat-card { transition: border-color .15s ease; }
.cat-card:hover { border-color: var(--line-strong); }
.cat-card__list a { position: relative; padding-left: 14px; }
.cat-card__list a::before { content: ""; position: absolute; left: 0; top: 50%; width: 5px; height: 5px; margin-top: -2.5px; border-radius: 50%; background: var(--tone-fg, var(--line-strong)); opacity: .55; }

/* Page header with icon (calculators and categories). */
.page-header__row { display: flex; align-items: center; gap: 16px; }
.page-header--icon .page-header__title { margin-top: 0; }
.page-header--icon .page-header__row { margin-top: 14px; }
.page-header__icon {
	display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
	width: 52px; height: 52px; border-radius: 14px;
}
@media (min-width: 768px) { .page-header__icon { width: 60px; height: 60px; border-radius: 16px; } }
.page-header__facts { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.page-header__facts li {
	display: inline-flex; align-items: center; gap: 6px; min-height: 32px;
	padding: 4px 12px 4px 10px; border-radius: 999px; font-size: .86rem; color: var(--muted);
	background: var(--surface); border: 1px solid var(--line);
}
.page-header__facts .mc-icon { color: var(--accent-strong); }

/* Calculator app: a touch more presence on large screens. */
@media (min-width: 920px) {
	.mc-result { background: linear-gradient(180deg, var(--accent-soft) 0%, #F2F6FD 100%); }
}

/* Empty result: a quiet silhouette of the result that is coming. */
.mc-result__placeholder { display: none; }
@media (min-width: 920px) {
	.mc-result__placeholder { display: grid; gap: 14px; margin: 8px 0 22px; }
}
.mc-skel { display: block; height: 12px; border-radius: 6px; background: rgba(23, 70, 184, .10); }
.mc-skel--label { width: 38%; }
.mc-skel--value { width: 62%; height: 40px; border-radius: 10px; background: rgba(23, 70, 184, .14); margin-bottom: 10px; }
.mc-skel--row { width: 100%; height: 10px; background: rgba(23, 70, 184, .08); }
.mc-skel--short { width: 70%; }
.mc-result__empty { font-size: .98rem; }

/* Mobile: keep the calculator close to the top. */
@media (max-width: 639px) {
	.page-header { padding: 14px 0 16px; }
	.page-header__intro { font-size: 1rem; margin-top: 10px; }
	.page-header__icon { width: 44px; height: 44px; border-radius: 12px; }
	.page-header__icon .mc-icon { width: 22px; height: 22px; }
	.page-header--icon .page-header__row { gap: 12px; margin-top: 10px; }
	.page-header__facts { margin-top: 12px; }
	.page-header__facts .is-secondary { display: none; }
	.page-header__facts li { font-size: .82rem; min-height: 28px; }
}

/* 12. Full redesign layer ------------------------------------------------------------ */

/* Hero: copy + real quick calculator side by side on large screens. */
.hero__inner { display: grid; gap: 36px; }
.hero__copy { min-width: 0; }
@media (min-width: 1000px) {
	.hero__inner {
		max-width: calc(var(--container) + var(--gutter) * 2);
		grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
		align-items: center; gap: 56px; text-align: left;
		padding-top: 72px; padding-bottom: 72px;
	}
	.hero__title { font-size: clamp(2.8rem, 4.6vw, 3.6rem); }
	.hero__subtitle { margin-left: 0; margin-right: 0; }
	.hero__chips, .hero__facts { justify-content: flex-start; }
}

.quick {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-lg);
	box-shadow: 0 1px 2px rgba(15, 23, 34, .04), 0 24px 48px -24px rgba(15, 23, 34, .22);
	padding: 20px; text-align: left; position: relative;
}
@media (min-width: 480px) { .quick { padding: 24px; } }
.quick__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.quick__title { font-size: 1.05rem; }
.quick__tabs { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2); border-radius: 10px; }
.quick__tab {
	border: 0; background: none; cursor: pointer; font-weight: 550; font-size: .9rem; color: var(--muted);
	min-height: 36px; padding: 0 12px; border-radius: 8px;
}
.quick__tab:hover { color: var(--ink); }
.quick__tab[aria-selected="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(15, 23, 34, .12), inset 0 0 0 1px var(--line-strong); }
.quick__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.quick__field { display: grid; gap: 6px; font-size: .88rem; font-weight: 600; color: var(--muted); }
.quick__input { position: relative; display: flex; align-items: center; }
.quick__input input, .quick__input select {
	width: 100%; height: 48px; padding: 0 34px 0 12px; font-size: 17px; font-weight: 500; color: var(--ink);
	font-variant-numeric: tabular-nums; background: var(--surface);
	border: 1px solid var(--line-strong); border-radius: var(--r-md); -webkit-appearance: none; appearance: none;
}
.quick__input select { cursor: pointer; }
.quick__input input:focus, .quick__input select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.quick__input em { position: absolute; right: 12px; font-style: normal; color: var(--muted); font-weight: 500; pointer-events: none; }
.quick__input--select::after { content: ""; position: absolute; right: 14px; top: 50%; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: translateY(-70%) rotate(45deg); pointer-events: none; }
.quick__result { display: grid; margin-top: 16px; padding: 16px 18px; border-radius: var(--r-md); background: var(--accent-soft); }
.quick__label { font-size: .82rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--accent-strong); }
.quick__value { font-size: clamp(1.9rem, 5vw, 2.3rem); line-height: 1.15; font-weight: 700; letter-spacing: -0.02em; color: var(--accent-strong); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.quick__sub { color: var(--muted); font-size: .92rem; }
.is-invalid .quick__value { color: var(--muted); }
.is-invalid .quick__sub { color: var(--danger); font-weight: 550; }
.quick__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 14px; font-weight: 600; font-size: .92rem; text-decoration: none; }
.quick__more:hover { text-decoration: underline; }
.quick__panel[hidden] { display: none; }

/* Cards: gentle lift on hover. */
.calc-card, .cat-card { transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease; }
.calc-card:hover, .cat-card:hover { transform: translateY(-1px); box-shadow: 0 10px 24px -14px rgba(15, 23, 34, .28); }

/* Category cards. */
.cat-card {
	display: flex; flex-direction: column;
	background: linear-gradient(180deg, var(--tone-bg) 0, var(--surface) 88px);
	padding: 20px;
}
.cat-card__head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.cat-card__icon { grid-row: auto; background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.cat-card__title { font-size: 1.1rem; }
.cat-card__list { flex: 1; }
.cat-card__list a { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 7px 0 7px 14px; border-bottom: 1px solid var(--line); }
.cat-card__list li:last-child a { border-bottom: 0; }
.cat-card__list a::after { content: "→"; color: var(--line-strong); transition: color .15s ease, transform .15s ease; }
.cat-card__list a:hover::after { color: var(--tone-fg); transform: translateX(2px); }
.cat-card__more { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px; font-size: .9rem; font-weight: 600; color: var(--tone-fg); text-decoration: none; }
.cat-card__more:hover { text-decoration: underline; color: var(--tone-fg); }

/* Intent list: category dot. */
.intent-list a { display: flex; align-items: center; gap: 10px; }
.intent-list a::before { content: ""; width: 8px; height: 8px; flex-shrink: 0; border-radius: 50%; background: var(--tone-fg, var(--line-strong)); opacity: .7; }
.intent-list a::after { content: "→"; margin-left: auto; color: var(--line-strong); transition: color .15s ease; }
.intent-list a:hover::after { color: var(--accent); }

/* About + trust panel. */
.home-about { display: grid; gap: 28px; }
@media (min-width: 1000px) {
	.home-about { grid-template-columns: minmax(0, 1fr) 340px; gap: 48px; align-items: start; }
}
.home-about__panel { background: var(--bg); border: 1px solid var(--line); border-radius: var(--r-md); padding: 22px; }
@media (min-width: 1000px) { .home-about__panel { position: sticky; top: calc(var(--header-h) + 24px); } }
.home-about__panel-title { font-size: 1.1rem; margin-bottom: 14px; }
.check-list { list-style: none; display: grid; gap: 12px; font-size: .95rem; color: #2B3440; }
.check-list li { position: relative; padding-left: 30px; line-height: 1.5; }
.check-list li::before {
	content: ""; position: absolute; left: 0; top: 1px; width: 20px; height: 20px; border-radius: 50%;
	background: var(--accent-soft) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4.5 8.3l2.3 2.2 4.7-4.8' fill='none' stroke='%2310338A' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.check-list strong { color: var(--ink); }
.check-list--compact { gap: 8px; color: var(--muted); }

/* FAQ: plus/minus indicator and split layout. */
.faq__icon { position: relative; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: var(--surface-2); }
.faq__icon::before, .faq__icon::after { content: ""; position: absolute; left: 50%; top: 50%; width: 10px; height: 2px; margin: -1px 0 0 -5px; background: var(--ink); border-radius: 2px; transition: transform .15s ease; }
.faq__icon::after { transform: rotate(90deg); }
.faq__item[open] .faq__icon::after { transform: rotate(0deg); }
.faq__item[open] .faq__icon { background: var(--accent-soft); }
.faq__q:hover { color: var(--accent-strong); }
.faq__head h2 { font-size: clamp(1.35rem, 3.5vw, 1.6rem); margin-bottom: 14px; }
.faq__aside { color: var(--muted); margin-bottom: 16px; }
.home-faq { max-width: none; }
@media (min-width: 1000px) {
	.faq--split { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 48px; align-items: start; }
	.faq--split .faq__head { position: sticky; top: calc(var(--header-h) + 24px); }
	.faq--split .faq__head h2 { font-size: 1.75rem; }
}

/* Calculator page: article + sticky index. */
.calc-body { display: grid; gap: 8px; margin-top: 48px; }
.calc-body .calc-article { margin: 0; max-width: 760px; width: 100%; }
@media (min-width: 1100px) {
	.calc-body { grid-template-columns: minmax(0, 1fr) 260px; gap: 64px; align-items: start; }
	.calc-body .calc-article { grid-column: 1; grid-row: 1; }
	.calc-body .toc { grid-column: 2; grid-row: 1; position: sticky; top: calc(var(--header-h) + 24px); }
}
.toc__details { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md); }
.toc__summary { cursor: pointer; list-style: none; display: flex; align-items: center; justify-content: space-between; min-height: 48px; padding: 0 16px; font-weight: 650; font-size: .95rem; }
.toc__summary::-webkit-details-marker { display: none; }
.toc__summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s ease; }
.toc__details[open] .toc__summary::after { transform: rotate(-135deg); }
.toc__list { list-style: none; padding: 4px 8px 10px; margin: 0; }
.toc__list a {
	display: block; padding: 7px 10px 7px 12px; border-radius: 8px; font-size: .92rem; line-height: 1.35;
	color: var(--muted); text-decoration: none; border-left: 2px solid transparent;
}
.toc__list a:hover { color: var(--ink); background: var(--surface-2); }
.toc__list a[aria-current="true"] { color: var(--ink); font-weight: 600; border-left-color: var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; }
@media (min-width: 1100px) {
	.toc__details { background: none; border: 0; }
	.toc__summary { padding: 0 10px; min-height: 36px; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); pointer-events: none; }
	.toc__summary::after { display: none; }
	.toc__list { padding: 4px 0 0; border-left: 1px solid var(--line); }
	.toc__list a { border-radius: 0; margin-left: -1px; }
	.toc__list a[aria-current="true"] { background: none; }
}

.prose h2, .content-section h2, .faq__head h2, .trust-box h2, #calculadora { scroll-margin-top: calc(var(--header-h) + 20px); }
.prose h2:first-child { margin-top: 0; }
.prose ul li::marker { color: var(--accent); }

.formula { position: relative; padding-top: 34px; background: #FBFCFD; }
.formula__label { position: absolute; top: 10px; left: 18px; font-family: var(--font); font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.formula p { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.formula p + p { margin-top: 0; }
.formula p:last-child { border-bottom: 0; }

.trust-box { background: linear-gradient(180deg, #FBFCFD, var(--surface)); }
.calc-page__more { margin: -8px 0 24px; }
.calc-page__more .section-head__link { white-space: normal; }

/* Result: copy action + reveal. */
.mc-result__actions { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.mc-copy {
	display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px;
	border-radius: 10px; border: 1px solid rgba(23, 70, 184, .35); background: var(--surface);
	color: var(--accent-strong); font-weight: 600; font-size: .9rem; cursor: pointer;
}
.mc-copy:hover { border-color: var(--accent); }
.mc-copy__status { font-size: .88rem; color: var(--accent-strong); font-weight: 600; }
.is-updated { animation: mc-reveal .18s ease-out; }
@keyframes mc-reveal { from { opacity: .35; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* Colored band header (category pages). */
.band { background: linear-gradient(180deg, var(--tone-bg) 0%, var(--bg) 100%); border-bottom: 1px solid var(--line); }
.band .page-header { padding-bottom: 32px; }
@media (min-width: 768px) { .band .page-header { padding-top: 28px; padding-bottom: 44px; } }
.band .page-header__icon { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

/* Directory groups. */
.directory-group__title { display: flex; align-items: center; gap: 10px; }
.directory-group__icon { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--tone-bg); color: var(--tone-fg); }
.directory-group__title a { text-decoration: none; }
.directory-group__title a:hover { text-decoration: underline; }
.directory-group__count { font-size: .8rem; font-weight: 600; color: var(--muted); background: var(--surface-2); border-radius: 999px; padding: 2px 9px; }

/* Footer call to action. */
.footer-cta { display: grid; gap: 18px; align-items: center; padding-top: 40px; padding-bottom: 40px; border-bottom: 1px solid rgba(255, 255, 255, .14); }
@media (min-width: 768px) { .footer-cta { grid-template-columns: 1fr auto; gap: 32px; } }
.footer-cta__title { color: #fff; font-size: clamp(1.3rem, 3vw, 1.6rem); }
.footer-cta__text { margin-top: 6px; color: #C5D0DE; max-width: 56ch; }
.site-footer a.footer-cta__btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 20px;
	border-radius: var(--r-md); background: #fff; color: var(--ink); font-weight: 650; text-decoration: none; white-space: nowrap;
}
.site-footer a.footer-cta__btn:hover { background: #E4ECF6; color: var(--ink); text-decoration: none; }

/* Header: clearer current page. */
@media (min-width: 1080px) {
	.nav__link[aria-current="page"] { background: var(--surface-2); }
}

/* Category list rows never stretch; full-width feature card. */
.cat-card__list { align-content: start; }
@media (min-width: 640px) { .bento > .calc-card--wide { grid-column: 1 / -1; } }
@media (min-width: 1000px) {
	.bento > .calc-card--wide { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 24px; }
	.calc-card--wide .calc-card__text { max-width: 70ch; }
}

/* Chips inherit their category tone for the icon. */
.chip .mc-icon { color: var(--tone-fg, var(--muted)); }

/* 13. Hipotecametro: serious financial look ------------------------------------------ */

/* Header: navy mark, calmer nav. */
.site-logo { font-weight: 650; letter-spacing: -0.01em; }
.site-logo__mark { color: var(--accent); }
@media (min-width: 1080px) {
	.nav { margin-left: auto; margin-right: 0; }
	.nav__link { font-weight: 500; color: #3C4A5E; }
	.nav__link[aria-current="page"] { color: var(--accent-strong); background: var(--accent-soft); }
}

/* Home hero: headline + calculator on a quiet navy band. */
.home-hero {
	background:
		radial-gradient(1200px 380px at 50% -120px, rgba(23, 70, 184, .10), transparent 70%),
		linear-gradient(180deg, #FFFFFF 0%, var(--bg) 100%);
	border-bottom: 1px solid var(--line);
	padding: 28px 0 32px;
}
@media (min-width: 768px) { .home-hero { padding: 48px 0 44px; } }
.home-hero__head { max-width: 760px; margin-bottom: 24px; }
.home-hero__kicker {
	display: inline-flex; align-items: center; gap: 8px; margin-bottom: 14px;
	font-size: .82rem; font-weight: 600; letter-spacing: .02em; color: var(--accent-strong);
	background: var(--accent-soft); border: 1px solid rgba(23, 70, 184, .18); border-radius: 999px; padding: 4px 12px;
}
.home-hero__title { font-size: clamp(2rem, 5.4vw, 3.1rem); letter-spacing: -0.025em; line-height: 1.08; }
.home-hero__intro { margin-top: 12px; color: var(--muted); font-size: clamp(1.02rem, 2.2vw, 1.15rem); max-width: 62ch; }
.home-hero__trust {
	list-style: none; display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px;
	color: var(--muted); font-size: .9rem;
}
.home-hero__trust li { display: inline-flex; align-items: center; gap: 8px; }
.home-hero__trust .mc-icon { color: var(--accent); }

/* Tools grid on the home page. */
.tools-grid { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 700px) { .tools-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.tools-grid .calc-card--feature { background: var(--surface); }
.tools-grid .calc-card--feature .calc-card__icon { background: var(--accent-soft); color: var(--accent-strong); box-shadow: none; }

/* Calculator panel: crisper, bank-grade. */
.mc-app { border-color: #D3DBE6; box-shadow: 0 1px 2px rgba(12, 27, 44, .05), 0 18px 40px -22px rgba(12, 27, 44, .28); }
.mc-result { background: linear-gradient(180deg, #F3F6FE 0%, #EAF0FC 100%); }
.mc-result__heading { color: var(--accent-strong); }
.mc-result__primary { border-bottom-color: rgba(23, 70, 184, .16); }
.mc-row__label { color: var(--ink); font-size: .9rem; text-transform: uppercase; letter-spacing: .06em; margin-top: 4px; }

/* Data tables inside content (tax rates). */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; display: table; }
.data-table th, .data-table td { padding: 10px 14px; border-bottom: 1px solid var(--line); text-align: left; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table thead th { background: var(--surface-2); font-weight: 600; font-size: .88rem; }
.data-table .is-num { text-align: right; white-space: nowrap; }
.prose .data-table { display: table; }
.table-note { font-size: .88rem; color: var(--muted); }

/* Footer with three columns. */
@media (min-width: 1000px) { .site-footer__grid--3 { grid-template-columns: 1.6fr 1fr 1fr; } }
.site-footer .site-logo { color: #fff; }
.site-footer__bottom p { max-width: 90ch; }

/* 14. Brand hipotecametro.es: logo, hero bands and polish ------------------------------ */

/* Grid columns may never grow past the viewport (wide tables inside the article). */
@media (max-width: 1099px) { .calc-body { grid-template-columns: minmax(0, 1fr); } }
.calc-body > * { min-width: 0; }

/* Brand strip and wordmark logo. */
.site-header { border-top: 3px solid var(--accent); }
.site-logo { display: inline-flex; align-items: center; margin-right: auto; line-height: 0; }
.site-logo__svg { display: block; width: auto; height: 26px; }
@media (min-width: 768px) { .site-logo__svg { height: 30px; } }
.site-footer .site-logo__svg { height: 30px; }
.site-header__inner { height: 68px; }

/* Home hero: headline + reference figures, calculator, trust line. */
.home-hero__grid { display: grid; grid-template-columns: minmax(0, 1fr); grid-template-areas: "head" "app" "figures" "trust"; column-gap: 40px; }
.home-hero__head { grid-area: head; }
.home-hero__grid > .mc-app { grid-area: app; }
.home-hero__figures { grid-area: figures; margin-top: 20px; }
.home-hero__trust { grid-area: trust; }
@media (min-width: 1000px) {
	.home-hero__grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "head figures" "app app" "trust trust"; align-items: center; }
	.home-hero__figures { margin: 0 0 24px; }
}
.home-hero__figures {
	background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-md);
	padding: 16px 18px;
}
.home-hero__figures-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 600; margin-bottom: 8px; }
.home-hero__figures dl { display: grid; gap: 0; }
.home-hero__figures dl > div { display: grid; grid-template-columns: 84px 1fr; gap: 12px; align-items: baseline; padding: 9px 0; border-top: 1px solid var(--line); }
.home-hero__figures dl > div:first-child { border-top: 0; }
.home-hero__figures dt { font-size: 1.3rem; font-weight: 700; color: var(--accent); font-variant-numeric: tabular-nums; letter-spacing: -0.01em; }
.home-hero__figures dd { font-size: .88rem; color: var(--muted); line-height: 1.4; }

/* Calculator pages share the hero band of the home page. */
.calc-hero .page-header { padding-top: 0; }
.calc-hero .notice-box { margin-top: 16px; }
.calc-page > .mc-ad:first-child { margin-top: 32px; }

/* Calculator: brand details. */
.mc-btn--primary { background: var(--accent); box-shadow: 0 1px 0 rgba(255, 255, 255, .15) inset, 0 6px 16px -8px rgba(23, 70, 184, .6); }
.mc-btn--primary:hover { background: var(--accent-strong); }
.mc-result__value { color: var(--accent-strong); }
.mc-chart__b { fill: var(--accent); }
.mc-chart__a { fill: #B8C6E3; }
.mc-chart__swatch { background: #B8C6E3; }

/* Tool cards: accent rule on hover, calmer shadow. */
.tools-grid .calc-card--feature { position: relative; overflow: hidden; }
.tools-grid .calc-card--feature::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--accent); opacity: 0; transition: opacity .15s ease; }
.tools-grid .calc-card--feature:hover::before, .tools-grid .calc-card--feature:focus-within::before { opacity: 1; }
.calc-card:hover { border-color: rgba(23, 70, 184, .45); }

/* Section rhythm. */
.home-section > .section-head h2, .related > h2 { letter-spacing: -0.015em; }

.footer-link-button { background: none; border: 0; padding: 4px 0; color: #F1F8F4; font: inherit; cursor: pointer; text-align: left; }
.footer-link-button:hover { color: #fff; text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media print {
	.site-header, .site-footer, .mc-ad, .search, .mc-actions, .related, .skip-link { display: none !important; }
	body { background: #fff; }
	.mc-app { box-shadow: none; }
}
