/* ============================================================================
   HazCuentas · Hoja de estilos
   Mobile-first, sin dependencias. Modo claro por defecto y oscuro opcional.
   Un solo color de acento (verde). Sin degradados, glow ni desenfoques.
   ========================================================================== */

:root {
  color-scheme: light;
  --bg: #f7f7f7;
  --surface: #ffffff;
  --surface-2: #f3f3f3;
  --surface-3: #ebebeb;
  --text: #1a1a1a;
  --muted: #5f5f5f;
  --border: #e2e2e2;
  --border-strong: #c4c4c4;
  --primary: #0b6b4b;
  --primary-hover: #085a3e;
  --primary-fill: #0b6b4b;
  --primary-fill-hover: #085a3e;
  --primary-soft: #e9f3ef;
  --primary-line: #b5d6c7;
  --on-primary: #ffffff;
  --danger: #b42318;
  --danger-soft: #fdf0ef;
  --shadow: none;
  --shadow-soft: none;
  --radius: 10px;
  --radius-md: 8px;
  --radius-sm: 6px;
  --max: 1120px;
  --font: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1c1c1c;
  --surface: #242424;
  --surface-2: #2c2c2c;
  --surface-3: #333333;
  --text: #ececec;
  --muted: #a8a8a8;
  --border: #383838;
  --border-strong: #525252;
  --primary: #6dbb9a;
  --primary-hover: #8accb0;
  --primary-fill: #1f7a5a;
  --primary-fill-hover: #1a6a4e;
  --primary-soft: #2a3531;
  --primary-line: #466157;
  --on-primary: #ffffff;
  --danger: #f09a93;
  --danger-soft: #3a2a28;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

[id] {
  scroll-margin-top: 6.5rem;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
  display: block;
}

a {
  color: var(--primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.17em;
}

a:hover {
  color: var(--primary-hover);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

:where(a, button, input, select, summary):focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

::selection {
  background: var(--primary-fill);
  color: var(--on-primary);
}

h1,
h2,
h3,
h4 {
  font-weight: 650;
  line-height: 1.2;
  letter-spacing: -0.015em;
  margin: 0;
}

p {
  margin: 0;
}

ul,
ol {
  margin: 0;
}

.container {
  width: min(100% - 2rem, var(--max));
  margin-inline: auto;
}

.sr-only {
  position: absolute;
  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: 1rem;
  top: -100px;
  z-index: 100;
  background: var(--primary-fill);
  color: var(--on-primary);
  padding: 0.7rem 1rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  font-weight: 600;
  text-decoration: none;
}

.skip-link:focus {
  top: 0;
  color: var(--on-primary);
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 0.5rem 1rem;
  padding-block: 0.7rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: var(--text);
  text-decoration: none;
  font-size: 1.06rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  width: fit-content;
}

.brand:hover {
  color: var(--text);
}

.brand strong {
  font-weight: 700;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 1.8rem;
  height: 1.8rem;
  border-radius: var(--radius-sm);
  background: var(--primary-fill);
  color: var(--on-primary);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
}

.site-nav {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  align-items: center;
  gap: 0.15rem;
  overflow-x: auto;
  padding-bottom: 0.1rem;
  scrollbar-width: none;
}

.site-nav::-webkit-scrollbar {
  display: none;
}

.site-nav a {
  flex: 0 0 auto;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 0.4rem 0.6rem;
  border-radius: var(--radius-sm);
  white-space: nowrap;
}

.site-nav a:hover {
  color: var(--text);
  background: var(--surface-2);
}

.site-nav a[aria-current="page"] {
  color: var(--primary);
  background: var(--primary-soft);
}

.theme-toggle {
  grid-column: 2;
  grid-row: 1;
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--muted);
  padding: 0;
  transition: background 120ms ease, color 120ms ease;
}

.theme-toggle:hover {
  background: var(--surface-2);
  color: var(--text);
}

.theme-toggle svg {
  width: 1.05rem;
  height: 1.05rem;
}

.icon-sun {
  display: none;
}

.icon-moon {
  display: block;
}

[data-theme="dark"] .icon-sun {
  display: block;
}

[data-theme="dark"] .icon-moon {
  display: none;
}

/* --------------------------------------------------------------------------
   Hero de página y migas
   -------------------------------------------------------------------------- */

main {
  padding-bottom: 3rem;
}

.page-hero {
  padding-top: clamp(1.75rem, 4vw, 3rem);
  padding-bottom: 0.5rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  color: var(--muted);
  font-size: 0.8rem;
  margin-bottom: 1.25rem;
}

.breadcrumbs a {
  color: var(--muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.eyebrow {
  color: var(--primary);
  font-size: 0.84rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.page-hero h1,
.hero h1,
.home-hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.75rem);
  font-weight: 700;
  letter-spacing: -0.022em;
  line-height: 1.15;
  max-width: 26ch;
  text-wrap: balance;
}

.lead {
  color: var(--muted);
  font-size: clamp(1rem, 1.4vw, 1.1rem);
  line-height: 1.6;
  max-width: 70ch;
  margin-top: 1rem;
  text-wrap: pretty;
}

.lead strong {
  color: var(--text);
  font-weight: 600;
}

.updated {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 0.8rem;
}

.updated time {
  color: var(--text);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Layout de calculadora
   -------------------------------------------------------------------------- */

.calc-section {
  margin-top: 1.75rem;
}

.calc-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.calc-card,
.result-card {
  padding: clamp(1.1rem, 2.5vw, 1.75rem);
}

.calc-card h2 {
  font-size: 1.25rem;
}

.card-head p {
  color: var(--muted);
  font-size: 0.9rem;
  margin-top: 0.4rem;
}

.calc-form {
  margin-top: 1.35rem;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.1rem;
}

.form-grid--2 {
  grid-template-columns: 1fr;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  min-width: 0;
}

.field > label,
.field-label {
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.35;
}

.field-hint {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.45;
}

input[type="text"],
input[type="number"],
input[type="date"],
select {
  width: 100%;
  min-height: 2.75rem;
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  line-height: 1.2;
  transition: border-color 120ms ease;
}

input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

input:hover,
select:hover {
  border-color: var(--muted);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

input[aria-invalid="true"],
select[aria-invalid="true"] {
  border-color: var(--danger);
}

input[type="date"] {
  min-height: 2.75rem;
}

.money-input,
.unit-input {
  display: flex;
  align-items: center;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 120ms ease;
  overflow: hidden;
}

.money-input:hover,
.unit-input:hover {
  border-color: var(--muted);
}

.money-input:focus-within,
.unit-input:focus-within {
  border-color: var(--primary);
  box-shadow: 0 0 0 1px var(--primary);
}

.money-input > span,
.unit-input > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 500;
  padding-left: 0.75rem;
}

.unit-input > span {
  padding-left: 0;
  padding-right: 0.75rem;
}

.money-input input,
.unit-input input {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding-left: 0.4rem;
  min-height: 2.65rem;
}

.unit-input input {
  padding-left: 0.75rem;
}

.money-input input:focus,
.unit-input input:focus {
  box-shadow: none;
}

.choice-group {
  border: 0;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.choice-group legend {
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.choice {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.choice:hover {
  border-color: var(--muted);
}

.choice:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.choice input {
  accent-color: var(--primary-fill);
  margin-top: 0.22rem;
  flex: 0 0 auto;
}

.choice span {
  display: block;
  min-width: 0;
}

.choice strong {
  display: block;
  font-size: 0.9rem;
  font-weight: 600;
}

.choice small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.35;
  margin-top: 0.1rem;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.7rem 0.8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
}

.checkbox-field input {
  accent-color: var(--primary-fill);
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.15rem;
  flex: 0 0 auto;
}

.checkbox-field label {
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.4;
  cursor: pointer;
}

.checkbox-field small {
  display: block;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 400;
  margin-top: 0.15rem;
}

.form-actions {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.6rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.6rem 1.1rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  transition: background 120ms ease, border-color 120ms ease, color 120ms ease;
}

.btn:disabled {
  cursor: default;
  opacity: 0.75;
}

.btn-primary {
  background: var(--primary-fill);
  color: var(--on-primary);
}

.btn-primary:hover {
  background: var(--primary-fill-hover);
  color: var(--on-primary);
}

.btn-secondary {
  background: var(--surface);
  border-color: var(--border-strong);
  color: var(--text);
}

.btn-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.btn-copy {
  width: 100%;
  margin-top: 1rem;
}

.form-error {
  margin-top: 1rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--danger);
  border-radius: var(--radius-sm);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: 0.88rem;
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Resultado
   -------------------------------------------------------------------------- */

.result-card {
  position: relative;
  overflow: hidden;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.3rem 1rem;
  margin-bottom: 1rem;
}

.result-kicker {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
}

.result-head h2 {
  font-size: 1.05rem;
}

.result-empty {
  padding: 2rem 1rem;
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

.result-total {
  padding: 1rem 1.1rem;
  border-radius: var(--radius-sm);
  background: var(--primary-soft);
}

.result-label {
  display: block;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 500;
}

.result-amount {
  display: block;
  margin-top: 0.2rem;
  color: var(--primary);
  font-size: clamp(1.9rem, 6vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
  word-break: break-word;
}

.result-caption {
  display: block;
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.82rem;
}

.breakdown {
  margin: 1.1rem 0 0;
  padding: 0;
  border-top: 1px solid var(--border);
}

.breakdown-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}

.breakdown-row dt {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.breakdown-row dd {
  margin: 0;
  flex: 0 0 auto;
  font-size: 0.92rem;
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.breakdown-row--subtotal dt,
.breakdown-row--subtotal dd {
  color: var(--text);
  font-weight: 600;
}

.breakdown-row--total {
  border-bottom: 0;
  padding-top: 0.8rem;
  padding-bottom: 0.2rem;
}

.breakdown-row--total dt,
.breakdown-row--total dd {
  color: var(--text);
  font-size: 1rem;
  font-weight: 700;
}

.mini-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.6rem;
  margin-top: 1rem;
}

.mini-card {
  padding: 0.75rem 0.85rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.mini-card span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.mini-card strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1.1rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.mini-card small {
  display: block;
  color: var(--muted);
  font-size: 0.78rem;
  margin-top: 0.1rem;
}

.result-note {
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.5;
  margin-top: 0.9rem;
}

.result-body.is-updated {
  animation: result-in 150ms ease both;
}

@keyframes result-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.disclaimer {
  margin-top: 1rem;
  padding: 0.75rem 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.disclaimer strong {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Aviso publicitario reservado (sin código de anuncios)
   -------------------------------------------------------------------------- */

.ad-slot {
  margin: 2rem auto;
  min-height: 0;
  border-radius: var(--radius-md);
}

/* --------------------------------------------------------------------------
   Contenido editorial
   -------------------------------------------------------------------------- */

.content {
  margin-top: 2.75rem;
}

.prose {
  max-width: 72ch;
}

.prose h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
  margin-top: 2.5rem;
  margin-bottom: 0.65rem;
}

.prose h2:first-child {
  margin-top: 0;
}

.prose h3 {
  font-size: 1.1rem;
  margin-top: 1.6rem;
  margin-bottom: 0.4rem;
}

.prose p {
  margin: 0.85rem 0;
  color: var(--text);
}

.prose p,
.prose li {
  font-size: 1rem;
  line-height: 1.7;
}

.prose ul,
.prose ol {
  padding-left: 1.3rem;
  margin: 0.8rem 0;
}

.prose li {
  margin: 0.35rem 0;
}

.prose li::marker {
  color: var(--muted);
}

.prose strong {
  font-weight: 600;
}

code {
  padding: 0.1em 0.35em;
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.88em;
}

.formula {
  margin: 1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  font-family: var(--mono);
  font-size: 0.86rem;
  line-height: 1.6;
  overflow-x: auto;
  white-space: pre-wrap;
}

.callout {
  margin: 1.1rem 0;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.93rem;
  line-height: 1.55;
}

.callout strong {
  font-weight: 600;
}

.table-wrap {
  margin: 1rem 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
  min-width: 420px;
}

caption {
  padding: 0.7rem 0.85rem;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th,
td {
  padding: 0.6rem 0.85rem;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-2);
  color: var(--text);
  font-size: 0.84rem;
  font-weight: 600;
}

tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-2);
}

.table-num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

tr.is-active td {
  background: var(--primary-soft);
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   FAQ
   -------------------------------------------------------------------------- */

.faq-section {
  margin-top: 2.75rem;
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  margin-bottom: 1.1rem;
}

.section-head h2 {
  font-size: clamp(1.35rem, 2.6vw, 1.65rem);
}

.section-head p {
  color: var(--muted);
  font-size: 0.9rem;
}

.section-head .eyebrow {
  color: var(--primary);
  font-size: 0.84rem;
}

.faq-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
  overflow: hidden;
}

.faq {
  border-bottom: 1px solid var(--border);
}

.faq:last-child {
  border-bottom: 0;
}

.faq summary {
  position: relative;
  padding: 0.85rem 2.6rem 0.85rem 1rem;
  cursor: pointer;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.4;
  list-style: none;
}

.faq summary:hover {
  background: var(--surface-2);
}

.faq summary:focus-visible {
  outline-offset: -2px;
}

.faq summary::-webkit-details-marker {
  display: none;
}

.faq summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 400;
  line-height: 1;
}

.faq[open] summary::after {
  content: "−";
}

.faq p {
  padding: 0 1rem 1rem;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
  margin: 0;
}

/* --------------------------------------------------------------------------
   Inicio
   -------------------------------------------------------------------------- */

.home-hero {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  align-items: center;
  padding-top: clamp(2.25rem, 5vw, 4rem);
}

.home-hero h1 {
  max-width: 18ch;
}

.home-hero .lead {
  max-width: 56ch;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.35rem;
}

.hero-stats {
  padding: 1.15rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.hero-stats-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.5rem;
}

.hero-stats-head h2 {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0;
  color: var(--text);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.12rem 0.45rem;
  border-radius: 4px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.76rem;
  font-weight: 600;
}

.badge--accent {
  background: var(--surface-2);
  color: var(--muted);
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 1.1rem;
}

.stat {
  padding: 0.75rem 0;
  border-top: 1px solid var(--border);
}

.stat span {
  display: block;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 500;
}

.stat strong {
  display: block;
  margin-top: 0.1rem;
  font-size: 1.15rem;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.stat small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
  margin-top: 0.05rem;
}

.hero-stats .result-note {
  margin-top: 0.4rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 1rem;
  margin-top: 1.25rem;
  color: var(--muted);
  font-size: 0.84rem;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.trust-row svg {
  width: 0.95rem;
  height: 0.95rem;
  color: var(--primary);
}

.section {
  margin-top: 3rem;
}

.calc-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.8rem;
}

.calc-tile {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.2rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  text-decoration: none;
  color: var(--text);
  transition: border-color 120ms ease;
}

.calc-tile:hover {
  border-color: var(--primary);
  color: var(--text);
}

.icon-badge {
  display: block;
  color: var(--primary);
}

.icon-badge svg {
  width: 1.4rem;
  height: 1.4rem;
}

.calc-tile h3 {
  font-size: 1.08rem;
  font-weight: 600;
}

.calc-tile p {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  flex: 1;
}

.tile-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  color: var(--primary);
  font-size: 0.88rem;
  font-weight: 600;
}

.tile-link svg {
  width: 0.9rem;
  height: 0.9rem;
}

.feature-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.5rem;
}

.feature h3 {
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 600;
}

.feature p {
  margin-top: 0.3rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.feature .icon-badge {
  color: var(--muted);
}

.feature .icon-badge svg {
  width: 1.2rem;
  height: 1.2rem;
}

/* --------------------------------------------------------------------------
   Enlaces relacionados
   -------------------------------------------------------------------------- */

.related {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}

.related h2 {
  font-size: 1.1rem;
  margin-bottom: 0.7rem;
}

.related-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.related-links a {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 0.86rem;
  font-weight: 500;
  text-decoration: none;
}

.related-links a:hover {
  background: var(--surface-2);
  color: var(--text);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.site-footer {
  margin-top: 3.5rem;
  border-top: 1px solid var(--border);
  background: var(--surface);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.6rem;
  padding-block: 2.2rem 1.5rem;
}

.footer-brand p {
  margin-top: 0.7rem;
  max-width: 44ch;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.55;
}

.footer-disclaimer {
  font-size: 0.8rem;
  line-height: 1.5;
}

.footer-col h2 {
  color: var(--text);
  font-size: 0.88rem;
  font-weight: 600;
  letter-spacing: 0;
}

.footer-links {
  list-style: none;
  padding: 0;
  margin: 0.6rem 0 0;
  display: grid;
  gap: 0.35rem;
}

.footer-links a {
  color: var(--muted);
  font-size: 0.88rem;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--primary);
  text-decoration: underline;
}

.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-block: 1rem 1.3rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.8rem;
}

.footer-bottom span {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

/* --------------------------------------------------------------------------
   Páginas legales
   -------------------------------------------------------------------------- */

.legal {
  max-width: 76ch;
  margin-top: 1.5rem;
}

.legal h2 {
  font-size: 1.2rem;
  margin-top: 1.8rem;
  margin-bottom: 0.4rem;
}

.legal p,
.legal li {
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.7;
}

.legal p {
  margin: 0.6rem 0;
}

.legal ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0;
}

.legal li {
  margin: 0.3rem 0;
}

.legal strong {
  color: var(--text);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */

@media (min-width: 580px) {
  .form-grid--2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mini-grid {
    grid-template-columns: 1fr 1fr;
  }

  .calc-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .feature-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btn-copy {
    width: auto;
    min-width: 13rem;
  }
}

@media (min-width: 760px) {
  .header-inner {
    grid-template-columns: auto 1fr auto;
    gap: 1.2rem;
  }

  .site-nav {
    grid-column: auto;
    grid-row: auto;
    justify-content: flex-end;
    padding-bottom: 0;
  }

  .theme-toggle {
    grid-column: auto;
    grid-row: auto;
  }

  .footer-grid {
    grid-template-columns: 1.5fr 1fr 1fr;
    gap: 2rem;
  }

  .home-hero {
    grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
    gap: 3rem;
  }

  .hero-stats {
    padding: 1.3rem;
  }
}

@media (min-width: 940px) {
  .calc-layout {
    grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
    gap: 1.25rem;
  }

  .result-card {
    position: sticky;
    top: 5rem;
    max-height: calc(100vh - 6rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .feature-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 400px) {
  .container {
    width: min(100% - 1.25rem, var(--max));
  }

  .calc-card,
  .result-card {
    padding: 1rem;
  }

  .hero-actions .btn {
    width: 100%;
  }

  .stat-grid {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* --------------------------------------------------------------------------
   Impresión: que el resultado quede limpio
   -------------------------------------------------------------------------- */

@media print {
  :root,
  [data-theme="dark"] {
    color-scheme: light;
    --bg: #ffffff;
    --surface: #ffffff;
    --surface-2: #ffffff;
    --text: #000000;
    --muted: #333333;
    --border: #cccccc;
    --border-strong: #cccccc;
    --primary: #000000;
    --primary-soft: #f2f2f2;
  }

  body {
    background: #ffffff;
    color: #000000;
  }

  .site-header,
  .site-footer,
  .ad-slot,
  .calc-form,
  .theme-toggle,
  .skip-link,
  .related,
  .faq-section,
  .breadcrumbs,
  .hero-actions,
  .content {
    display: none !important;
  }

  .page-hero {
    padding-top: 0;
  }

  .calc-layout {
    display: block;
  }

  .card {
    border: 1px solid #999999;
    margin-bottom: 1rem;
  }

  .result-card {
    position: static;
    max-height: none;
    overflow: visible;
  }

  .result-amount {
    color: #000000;
  }

  a {
    color: #000000;
    text-decoration: none;
  }
}
