:root {
  --fondo: #f3f6fa;
  --tarjeta: #ffffff;
  --campo: #ffffff;
  --texto: #132030;
  --suave: #5a6675;
  --borde: #dbe2ea;
  --borde-fuerte: #b9c4d0;
  --acento: #1b64a0;
  --acento-fuerte: #134d7c;
  --acento-texto: #ffffff;
  --verde: #1f8a5b;
  --resalte: #e9f2fa;
  --heroe-1: #e3effa;
  --heroe-2: #e8f6ee;
  --exito: #1e7a4c;
  --aviso: #fff7e6;
  --aviso-borde: #ecc66f;
  --error: #b42318;
  --degradado: linear-gradient(135deg, #1b64a0 0%, #1f8a5b 100%);
  --sombra: 0 1px 2px rgba(16, 32, 48, 0.05), 0 8px 24px rgba(16, 32, 48, 0.07);
  --sombra-alta: 0 2px 4px rgba(16, 32, 48, 0.06), 0 16px 40px rgba(16, 32, 48, 0.12);
}
@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0d1217;
    --tarjeta: #161d25;
    --campo: #0f151c;
    --texto: #e8edf2;
    --suave: #a2adb9;
    --borde: #29333e;
    --borde-fuerte: #3d4a58;
    --acento: #6fb6e8;
    --acento-fuerte: #a3d1f2;
    --acento-texto: #08121b;
    --verde: #5fd09b;
    --resalte: #19293a;
    --heroe-1: #122233;
    --heroe-2: #12261d;
    --exito: #6fd3a0;
    --aviso: #2a2416;
    --aviso-borde: #8a6d2c;
    --error: #ff8a80;
    --degradado: linear-gradient(135deg, #1d5d93 0%, #1b7a52 100%);
    --sombra: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.3);
    --sombra-alta: 0 2px 4px rgba(0, 0, 0, 0.35), 0 16px 40px rgba(0, 0, 0, 0.45);
  }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--fondo);
  color: var(--texto);
  font: 16px/1.6 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--acento); }
p { margin: 0 0 12px; }
h1 { font-size: clamp(1.8rem, 4.6vw, 2.75rem); line-height: 1.12; margin: 0 0 14px; letter-spacing: -0.02em; font-weight: 800; }
h2 { font-size: 1.22rem; line-height: 1.3; margin: 0 0 16px; letter-spacing: -0.01em; }
.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 16px; }

/* Cabecera fija con el menú de calculadoras */
.cabecera {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--tarjeta) 88%, transparent);
  -webkit-backdrop-filter: saturate(160%) blur(10px);
  backdrop-filter: saturate(160%) blur(10px);
  border-bottom: 1px solid var(--borde);
}
.cabecera .contenedor { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding-top: 10px; padding-bottom: 10px; }
.marca { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--texto); text-decoration: none; letter-spacing: -0.01em; }
.logo {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: var(--degradado); color: #fff; font-weight: 800; box-shadow: 0 4px 12px rgba(27, 100, 160, 0.3);
}
.menu { display: flex; flex-wrap: wrap; gap: 2px; margin-left: auto; }
.menu a {
  color: var(--suave); text-decoration: none; font-weight: 600; font-size: 0.86rem;
  padding: 5px 9px; border-radius: 999px; transition: background 0.15s, color 0.15s; white-space: nowrap;
}
.menu a:hover { background: var(--resalte); color: var(--texto); }
.menu a[aria-current="page"] { background: var(--acento); color: var(--acento-texto); }
.menu a.idioma { border: 1px solid var(--borde); margin-left: 4px; }

/* Portada de cada calculadora */
.heroe {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--heroe-1), var(--heroe-2));
  border-bottom: 1px solid var(--borde);
  padding: 48px 0 40px;
}
.heroe::before, .heroe::after {
  content: ""; position: absolute; border-radius: 50%; pointer-events: none; filter: blur(2px);
}
.heroe::before {
  width: 420px; height: 420px; right: -120px; top: -180px;
  background: radial-gradient(circle, rgba(27, 100, 160, 0.18), transparent 70%);
}
.heroe::after {
  width: 360px; height: 360px; right: 180px; bottom: -220px;
  background: radial-gradient(circle, rgba(31, 138, 91, 0.16), transparent 70%);
}
.heroe .contenedor { position: relative; }
.heroe h1 { max-width: 820px; }
.entradilla { color: var(--suave); font-size: 1.12rem; max-width: 720px; margin-bottom: 20px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.chips li {
  background: var(--tarjeta); border: 1px solid var(--borde); border-radius: 999px;
  padding: 5px 13px; font-size: 0.88rem; font-weight: 650; color: var(--texto); box-shadow: 0 1px 2px rgba(16, 32, 48, 0.05);
}
.chips li::before { content: "✓ "; color: var(--verde); font-weight: 800; }
.actualizado { margin: 16px 0 0; font-size: 0.86rem; color: var(--suave); }

main { padding: 32px 0 56px; }
.calculadora { display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; align-items: start; margin-bottom: 22px; }
@media (min-width: 900px) {
  .calculadora { grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr); }
  .calculadora > .resultado { position: sticky; top: 76px; }
  .calculadora.apilada { grid-template-columns: minmax(0, 1fr); }
  .calculadora.apilada > .resultado { position: static; }
}
.tarjeta {
  background: var(--tarjeta);
  border: 1px solid var(--borde);
  border-radius: 18px;
  padding: 26px;
  box-shadow: var(--sombra);
  margin-bottom: 22px;
}
.calculadora > .tarjeta { margin-bottom: 0; }
.tarjeta > h2:first-child { display: flex; align-items: center; gap: 10px; }
.tarjeta > h2:first-child::before {
  content: ""; width: 6px; height: 22px; border-radius: 3px; background: var(--degradado); flex: none;
}
.resultado { box-shadow: var(--sombra-alta); }

/* Formularios: los campos de una misma fila quedan a la misma altura aunque unos
   tengan texto de ayuda y otros no, porque la etiqueta ocupa el espacio sobrante. */
.rejilla { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 18px 18px; }
.rejilla > div { display: flex; flex-direction: column; }
.rejilla > div > label { flex: 1 1 auto; }
label { display: block; font-weight: 650; margin-bottom: 7px; }
.ayuda { display: block; font-weight: 400; font-size: 0.84rem; line-height: 1.45; color: var(--suave); margin-top: 3px; }
input[type="number"], select {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font: inherit;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--texto);
  background: var(--campo);
  border: 1.5px solid var(--borde-fuerte);
  border-radius: 12px;
  transition: border-color 0.15s, box-shadow 0.15s;
}
input[type="number"]::placeholder { color: var(--suave); font-weight: 400; }
input[type="number"]:hover, select:hover { border-color: var(--acento); }
input[type="number"]:focus, select:focus { border-color: var(--acento); box-shadow: 0 0 0 4px var(--resalte); outline: none; }
input:focus-visible, select:focus-visible, summary:focus-visible, a:focus-visible, button:focus-visible {
  outline: 2px solid var(--acento);
  outline-offset: 2px;
}
.casilla {
  display: flex; gap: 12px; align-items: flex-start; margin-top: 14px;
  padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--fondo);
}
.casilla:has(input:checked) { border-color: var(--acento); background: var(--resalte); }
.casilla input { margin-top: 4px; width: 19px; height: 19px; flex: none; accent-color: var(--acento); }
.casilla label { margin: 0; cursor: pointer; }
details { margin-top: 18px; border: 1px solid var(--borde); border-radius: 12px; padding: 12px 14px; }
summary { cursor: pointer; font-weight: 650; }
.segmentos { margin: 0 0 18px; padding: 0; border: 0; min-width: 0; }
.segmentos legend { font-weight: 650; margin-bottom: 8px; padding: 0; }
.pastilla {
  display: inline-flex; flex-wrap: wrap; gap: 4px; padding: 4px;
  border: 1px solid var(--borde); border-radius: 999px; background: var(--fondo);
}
.segmentos label {
  margin: 0; font-weight: 650; padding: 8px 16px; border-radius: 999px; cursor: pointer; color: var(--suave);
  transition: background 0.15s, color 0.15s;
}
.segmentos input { position: absolute; opacity: 0; pointer-events: none; }
.segmentos label:has(input:checked) { background: var(--acento); color: var(--acento-texto); box-shadow: 0 2px 8px rgba(27, 100, 160, 0.3); }
.segmentos label:has(input:focus-visible) { outline: 2px solid var(--acento); outline-offset: 2px; }
.nota { font-size: 0.9rem; color: var(--suave); margin: 18px 0 10px; }

/* Resultados: la cifra principal va destacada en color */
.total {
  background: var(--degradado);
  color: #fff;
  border-radius: 16px;
  padding: 20px 22px;
  margin-bottom: 18px;
  box-shadow: 0 10px 26px rgba(27, 100, 160, 0.28);
}
.total div:first-child { font-weight: 650; opacity: 0.92; }
.total .cifra { font-size: clamp(2.2rem, 6vw, 2.9rem); font-weight: 800; line-height: 1.12; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; margin: 4px 0; }
.total div:last-child:not(.cifra) { font-size: 0.93rem; opacity: 0.9; }
.barra { display: flex; height: 14px; border-radius: 999px; overflow: hidden; margin: 6px 0 10px; background: var(--borde); }
.barra span { display: block; height: 100%; }
.leyenda { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 0.86rem; color: var(--suave); margin-bottom: 16px; }
.leyenda i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
table { width: 100%; border-collapse: collapse; }
td, th { padding: 10px 0; border-bottom: 1px solid var(--borde); vertical-align: top; text-align: left; }
tbody tr:last-child td { border-bottom: 0; }
td:last-child, th:last-child { text-align: right; white-space: nowrap; padding-left: 12px; font-variant-numeric: tabular-nums; font-weight: 600; }
tr.fuerte td { font-weight: 800; color: var(--acento-fuerte); }
.tabla-ancha { overflow-x: auto; }
.tabla-ancha table { min-width: 560px; }
.tabla-ancha td, .tabla-ancha th { text-align: right; padding-left: 10px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.tabla-ancha td:first-child, .tabla-ancha th:first-child { text-align: left; padding-left: 0; font-weight: 700; }
.tabla-ancha th { font-size: 0.85rem; color: var(--suave); font-weight: 650; }
.trimestres { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.trimestres fieldset { border: 1px solid var(--borde); border-radius: 14px; padding: 12px 14px 14px; margin: 0; min-width: 0; background: var(--fondo); }
.trimestres legend {
  font-weight: 800; padding: 2px 10px; border-radius: 999px; background: var(--acento); color: var(--acento-texto); font-size: 0.9rem;
}
.trimestres label { font-size: 0.88rem; margin: 10px 0 5px; }
.error { color: var(--error); font-weight: 600; }

/* Bloques de contenido */
.aviso {
  background: var(--aviso);
  border: 1px solid var(--aviso-borde);
  border-radius: 14px;
  padding: 16px 18px;
  font-size: 0.93rem;
}
.aviso ul, .faq ul { margin: 6px 0 0; padding-left: 20px; }
.boton {
  display: inline-block;
  background: var(--degradado);
  color: #fff;
  text-decoration: none;
  font-weight: 750;
  padding: 13px 22px;
  border-radius: 12px;
  margin-top: 4px;
  box-shadow: 0 8px 20px rgba(27, 100, 160, 0.28);
  transition: transform 0.15s, box-shadow 0.15s;
}
.boton:hover { transform: translateY(-1px); box-shadow: 0 12px 26px rgba(27, 100, 160, 0.35); }
.boton::after { content: " →"; }
.ia { background: linear-gradient(135deg, var(--heroe-1), var(--tarjeta) 70%); }
.patrocinio { border-left: 5px solid var(--verde); }
.patrocinio .nota { margin-bottom: 0; }
.faq h3 { font-size: 1.04rem; margin: 22px 0 6px; }
.faq h3:first-of-type { margin-top: 4px; }
.otras { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.otras a {
  display: flex; gap: 12px; align-items: flex-start; height: 100%; padding: 16px; border: 1px solid var(--borde); border-radius: 14px;
  text-decoration: none; color: var(--texto); background: var(--fondo); transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.otras a:hover { border-color: var(--acento); transform: translateY(-2px); box-shadow: var(--sombra); }
.otras .icono {
  display: grid; place-items: center; width: 42px; height: 42px; flex: none; border-radius: 12px;
  background: var(--tarjeta); border: 1px solid var(--borde); font-size: 1.3rem;
}
.otras strong { display: block; color: var(--acento-fuerte); margin-bottom: 2px; }
.otras span { font-size: 0.9rem; color: var(--suave); }

.pie { border-top: 1px solid var(--borde); background: var(--tarjeta); color: var(--suave); font-size: 0.88rem; padding: 26px 0 34px; }
.pie p { margin: 0 0 6px; }

@media (max-width: 600px) {
  .cabecera { position: static; }
  .heroe { padding: 30px 0 28px; }
  .tarjeta { padding: 20px 18px; border-radius: 16px; }
  .menu {
    margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .menu::-webkit-scrollbar { display: none; }
  .total { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}

/* Descargas de plantillas */
.descargas { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; margin: 6px 0 22px; }
.descarga {
  display: flex; flex-wrap: wrap; gap: 12px 14px; align-items: center; padding: 18px; border: 1px solid var(--borde); border-radius: 16px;
  background: var(--fondo); color: var(--texto); text-decoration: none; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.descarga:hover { border-color: var(--acento); transform: translateY(-2px); box-shadow: var(--sombra); }
.descarga .icono {
  display: grid; place-items: center; width: 48px; height: 48px; flex: none; border-radius: 14px;
  background: var(--tarjeta); border: 1px solid var(--borde); font-size: 1.5rem;
}
.descarga > span:nth-child(2) { flex: 1 1 140px; }
.descarga strong { display: block; font-size: 1.08rem; color: var(--acento-fuerte); }
.descarga > span:nth-child(2) span { font-size: 0.9rem; color: var(--suave); }
.descarga .boton { margin-top: 0; }
.subtitulo { font-size: 1.04rem; margin: 6px 0 8px; }
.lista { margin: 0 0 8px; padding-left: 20px; }
.lista li { margin-bottom: 4px; }
.calendario td { white-space: normal; text-align: left; padding-left: 10px; vertical-align: top; }
.calendario td:first-child { white-space: nowrap; padding-left: 0; }
.calendario td:last-child { text-align: right; }
.calendario .ayuda { margin-top: 2px; }
.aviso-comunidad { margin: -6px 0 14px; }
.cabecera .contenedor { max-width: 1260px; }
@media (min-width: 601px) and (max-width: 1330px) {
  .marca .marca-texto { display: none; }
}
.calendario th { text-align: left; padding-left: 10px; }
.calendario th:first-child { padding-left: 0; }
.calendario th:last-child { text-align: right; }
@media (max-width: 900px) {
  .cabecera { position: static; }
  .menu {
    margin-left: 0; width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    -webkit-overflow-scrolling: touch; padding-bottom: 2px;
  }
  .menu::-webkit-scrollbar { display: none; }
  .marca .marca-texto { display: inline; }
}

/* Páginas de cada comunidad y tarifa plana */
.resultado h3 { font-size: 1.04rem; margin: 22px 0 6px; }
.cifras { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 12px; margin: 4px 0 18px; padding: 0; list-style: none; }
.cifras li { background: var(--resalte); border: 1px solid var(--borde); border-radius: 14px; padding: 14px 16px; }
.cifras strong { display: block; font-size: 1.45rem; line-height: 1.2; color: var(--acento-fuerte); font-variant-numeric: tabular-nums; margin-bottom: 4px; }
.cifras span { display: block; font-size: 0.88rem; color: var(--suave); line-height: 1.4; }
.comunidades { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 0; padding: 0; list-style: none; }
.comunidades a {
  display: block; height: 100%; padding: 12px 14px; border: 1px solid var(--borde); border-radius: 12px; background: var(--fondo);
  color: var(--acento-fuerte); font-weight: 700; text-decoration: none; transition: border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}
.comunidades a:hover { border-color: var(--acento); transform: translateY(-2px); box-shadow: var(--sombra); }
.comunidades span { display: block; margin-top: 2px; font-size: 0.85rem; font-weight: 500; color: var(--suave); }
.tarjeta h3.subtitulo { margin-top: 20px; }
@media (max-width: 600px) {
  .comunidades { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .comunidades a { padding: 10px 12px; font-size: 0.95rem; }
  .comunidades span { font-size: 0.8rem; }
  .cifras { gap: 8px; }
  .cifras li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; }
  .cifras strong { flex: none; min-width: 92px; font-size: 1.2rem; margin: 0; }
}

/* Diseño: iconos dibujados, ilustración de la portada y pie completo */
.otras .icono { color: var(--acento); background: var(--resalte); border-color: transparent; }
.otras a:hover .icono { background: var(--degradado); color: #fff; }
.otras .icono svg { display: block; }
@media (min-width: 1080px) {
  .heroe .contenedor { min-height: 280px; }
  .heroe .contenedor::after {
    content: ""; position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
    width: 340px; height: 264px; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 280'%3E %3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%231b64a0'/%3E%3Cstop offset='1' stop-color='%231f8a5b'/%3E%3C/linearGradient%3E %3Cfilter id='s' x='-25%25' y='-25%25' width='150%25' height='150%25'%3E%3CfeDropShadow dx='0' dy='10' stdDeviation='12' flood-color='%23102030' flood-opacity='0.14'/%3E%3C/filter%3E%3C/defs%3E %3Crect x='76' y='16' width='240' height='170' rx='18' fill='rgba(255,255,255,0.6)' filter='url(%23s)'/%3E %3Crect x='34' y='52' width='250' height='190' rx='20' fill='%23ffffff' filter='url(%23s)'/%3E %3Crect x='58' y='76' width='90' height='10' rx='5' fill='%23dbe2ea'/%3E %3Crect x='58' y='96' width='150' height='24' rx='8' fill='url(%23g)'/%3E %3Crect x='58' y='176' width='22' height='42' rx='5' fill='%23cfe0ef'/%3E %3Crect x='90' y='158' width='22' height='60' rx='5' fill='%23b5d1e9'/%3E %3Crect x='122' y='142' width='22' height='76' rx='5' fill='url(%23g)'/%3E %3Crect x='154' y='166' width='22' height='52' rx='5' fill='%23c6e6d7'/%3E %3Crect x='196' y='146' width='64' height='8' rx='4' fill='%23dbe2ea'/%3E %3Crect x='196' y='164' width='46' height='8' rx='4' fill='%23dbe2ea'/%3E %3Crect x='196' y='182' width='56' height='8' rx='4' fill='%23dbe2ea'/%3E %3Ccircle cx='292' cy='58' r='34' fill='url(%23g)' filter='url(%23s)'/%3E %3Cpath d='M302 44a17 17 0 1 0 0 28M276 54h20M276 63h20' stroke='%23fff' stroke-width='4.5' fill='none' stroke-linecap='round'/%3E %3Crect x='190' y='212' width='126' height='42' rx='21' fill='%23ffffff' filter='url(%23s)'/%3E %3Ccircle cx='213' cy='233' r='12' fill='%231f8a5b'/%3E %3Cpath d='M207 233l4.2 4.2 7.3-8' stroke='%23fff' stroke-width='2.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E %3Crect x='233' y='229' width='66' height='8' rx='4' fill='%23c6e6d7'/%3E %3C/svg%3E") no-repeat center / contain; pointer-events: none;
  }
  .heroe h1, .heroe .entradilla { max-width: min(780px, calc(100% - 380px)); }
}
@media (min-width: 1080px) and (prefers-color-scheme: dark) {
  .heroe .contenedor::after { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 280'%3E %3Cdefs%3E%3ClinearGradient id='g' x1='0' y1='0' x2='1' y2='1'%3E%3Cstop offset='0' stop-color='%231b64a0'/%3E%3Cstop offset='1' stop-color='%231f8a5b'/%3E%3C/linearGradient%3E %3Cfilter id='s' x='-25%25' y='-25%25' width='150%25' height='150%25'%3E%3CfeDropShadow dx='0' dy='10' stdDeviation='12' flood-color='%23102030' flood-opacity='0.5'/%3E%3C/filter%3E%3C/defs%3E %3Crect x='76' y='16' width='240' height='170' rx='18' fill='rgba(27,36,46,0.65)' filter='url(%23s)'/%3E %3Crect x='34' y='52' width='250' height='190' rx='20' fill='%231b242e' filter='url(%23s)'/%3E %3Crect x='58' y='76' width='90' height='10' rx='5' fill='%232e3a47'/%3E %3Crect x='58' y='96' width='150' height='24' rx='8' fill='url(%23g)'/%3E %3Crect x='58' y='176' width='22' height='42' rx='5' fill='%23233f58'/%3E %3Crect x='90' y='158' width='22' height='60' rx='5' fill='%232a5576'/%3E %3Crect x='122' y='142' width='22' height='76' rx='5' fill='url(%23g)'/%3E %3Crect x='154' y='166' width='22' height='52' rx='5' fill='%231d4a39'/%3E %3Crect x='196' y='146' width='64' height='8' rx='4' fill='%232e3a47'/%3E %3Crect x='196' y='164' width='46' height='8' rx='4' fill='%232e3a47'/%3E %3Crect x='196' y='182' width='56' height='8' rx='4' fill='%232e3a47'/%3E %3Ccircle cx='292' cy='58' r='34' fill='url(%23g)' filter='url(%23s)'/%3E %3Cpath d='M302 44a17 17 0 1 0 0 28M276 54h20M276 63h20' stroke='%23fff' stroke-width='4.5' fill='none' stroke-linecap='round'/%3E %3Crect x='190' y='212' width='126' height='42' rx='21' fill='%231b242e' filter='url(%23s)'/%3E %3Ccircle cx='213' cy='233' r='12' fill='%231f8a5b'/%3E %3Cpath d='M207 233l4.2 4.2 7.3-8' stroke='%23fff' stroke-width='2.8' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E %3Crect x='233' y='229' width='66' height='8' rx='4' fill='%231d4a39'/%3E %3C/svg%3E"); }
}
.pie { padding: 40px 0 34px; }
.pie-columnas { display: grid; grid-template-columns: 1.4fr repeat(3, 1fr); gap: 28px; padding-bottom: 26px; margin-bottom: 22px; border-bottom: 1px solid var(--borde); }
.pie-marca .marca { margin-bottom: 10px; font-size: 1rem; }
.pie-marca p { max-width: 340px; }
.pie h2 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--texto); margin: 6px 0 10px; }
.pie ul { list-style: none; margin: 0; padding: 0; }
.pie li { margin: 0 0 7px; }
.pie-columnas a:not(.marca) { color: var(--suave); text-decoration: none; }
.pie-columnas a:not(.marca):hover { color: var(--acento); text-decoration: underline; }
.pie-legal p { font-size: 0.82rem; }
@media (max-width: 900px) {
  .pie-columnas { grid-template-columns: repeat(3, 1fr); }
  .pie-marca { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  .pie-columnas { grid-template-columns: 1fr 1fr; gap: 20px; }
}
@media (max-width: 600px) {
  .pie li { margin-bottom: 11px; }
}

/* Migas de pan: dónde está la página dentro de la web */
.migas ol { display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0 0 14px; padding: 0; list-style: none; font-size: 0.86rem; color: var(--suave); }
.migas li + li::before { content: "›"; margin: 0 8px; color: var(--borde-fuerte); }
.migas a { color: var(--suave); text-decoration: none; font-weight: 600; }
.migas a:hover { color: var(--acento); text-decoration: underline; }
.migas [aria-current="page"] { color: var(--texto); font-weight: 650; }

/* Compartir, copiar el enlace o imprimir el resultado */
.acciones { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--borde); }
.acciones-titulo { font-weight: 700; font-size: 0.95rem; margin-bottom: 10px; }
.acciones-fila { display: flex; flex-wrap: wrap; gap: 8px; }
.accion {
  display: inline-flex; align-items: center; gap: 7px; padding: 9px 14px; border-radius: 10px;
  border: 1px solid var(--borde-fuerte); background: var(--tarjeta); color: var(--acento-fuerte);
  font: inherit; font-size: 0.9rem; font-weight: 650; cursor: pointer; transition: border-color 0.15s, background 0.15s;
}
.accion:hover { border-color: var(--acento); background: var(--resalte); }
.accion:focus-visible { outline: 2px solid var(--acento); outline-offset: 2px; }
.acciones-aviso { margin: 10px 0 0; font-size: 0.9rem; font-weight: 600; color: var(--exito); }
.acciones-aviso:empty { display: none; }
.acciones-aviso input { display: block; width: 100%; margin-top: 6px; font-size: 0.85rem; }
.acciones-nota { margin: 10px 0 0; font-size: 0.82rem; color: var(--suave); }
.solo-impresion { display: none; }

/* Botón para añadir los plazos del calendario fiscal */
.anadir-calendario {
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; margin: 4px 0 20px; padding: 16px 18px;
  border: 1px solid var(--borde); border-radius: 14px; background: var(--resalte);
}
.anadir-calendario .boton { display: inline-flex; align-items: center; gap: 8px; margin-top: 0; }
.anadir-calendario .boton::after { content: none; }
.anadir-calendario .nota { flex: 1 1 260px; margin: 0; }

/* Al imprimir o guardar en PDF: solo el cálculo, en claro y sin adornos */
@media print {
  :root {
    --fondo: #ffffff; --tarjeta: #ffffff; --campo: #ffffff; --texto: #000000; --suave: #333333;
    --borde: #bbbbbb; --borde-fuerte: #888888; --acento: #134d7c; --acento-fuerte: #134d7c; --acento-texto: #ffffff;
    --verde: #1f6b47; --resalte: #eef3f8; --heroe-1: #ffffff; --heroe-2: #ffffff; --exito: #1e5f3c;
    --aviso: #ffffff; --aviso-borde: #bbbbbb; --error: #9b1c12; --sombra: none; --sombra-alta: none;
  }
  body { background: #fff; color: #000; font-size: 12pt; }
  .cabecera, .migas, .chips, .pie, .acciones, .boton { display: none !important; }
  .heroe { padding: 0 0 8px; border: 0; background: none; }
  .heroe::before, .heroe::after, .heroe .contenedor::after { display: none !important; }
  .heroe .contenedor { min-height: 0; }
  .heroe h1, .heroe .entradilla { max-width: none; }
  .heroe h1 { font-size: 20pt; }
  main { padding: 8px 0 0; }
  body:has(#formulario) main .contenedor > :not(.calculadora):not(.aviso) { display: none; }
  .calculadora { display: block; }
  .calculadora > .resultado { position: static; }
  .tarjeta, .calculadora > .tarjeta { box-shadow: none; border: 1px solid #bbb; margin-bottom: 12px; }
  .resultado table, .total { break-inside: avoid; }
  /* Muchos navegadores no imprimen los fondos: sin esto, la cifra blanca del total quedaría invisible. */
  .total, .barra, .leyenda i { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .solo-impresion { display: block; margin: 14px 0 0; font-size: 9pt; color: #333; word-break: break-all; }
}

/* Calculadoras para insertar en otras webs */
body.widget { background: var(--fondo); }
.widget main { padding: 10px 0; }
.widget .contenedor { padding: 0 8px; }
.widget .calculadora { margin-bottom: 10px; }
.widget-pie { text-align: center; font-size: 0.86rem; color: var(--suave); margin: 0 0 4px; }
.opciones-widget { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 12px; margin-bottom: 18px; }
.opcion-widget {
  display: flex; gap: 10px; align-items: flex-start; padding: 14px; border: 1px solid var(--borde); border-radius: 14px;
  background: var(--fondo); cursor: pointer;
}
.opcion-widget:has(input:checked) { border-color: var(--acento); background: var(--resalte); }
.opcion-widget input { margin-top: 4px; accent-color: var(--acento); }
.opcion-widget strong { display: block; color: var(--acento-fuerte); }
.opcion-widget span { font-size: 0.9rem; color: var(--suave); }
.codigo {
  width: 100%; font: 0.82rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; padding: 12px; border-radius: 12px;
  border: 1px solid var(--borde-fuerte); background: var(--campo); color: var(--texto); resize: vertical; margin-bottom: 10px;
}
.vista-widget { width: 100%; border: 1px dashed var(--borde-fuerte); border-radius: 14px; background: var(--fondo); display: block; }
