/* Cifralia · hoja de estilos única. Sin fuentes ni recursos de terceros. */
:root {
  --paper: #f4f7fb;
  --surface: #ffffff;
  --ink: #14202e;
  --ink-2: #44546a;
  --line: #d6dfea;
  --line-2: #e8eef5;
  --brand: #12304a;
  --brand-2: #1b4466;
  --blue: #1d5a8c;
  --blue-soft: #e6f0f9;
  --gold: #d9a032;
  --gold-ink: #6e4a00;
  --violet: #7b5ea7;
  --danger: #b42318;
  --danger-soft: #fdecea;
  --serif: Charter, "Bitstream Charter", "Sitka Text", Cambria, "Iowan Old Style", Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --wrap: 1120px;
  --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 1.0625rem/1.65 var(--sans); }
img, svg { max-width: 100%; }
a { color: var(--blue); text-underline-offset: 0.18em; }
a:hover { color: var(--brand); }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--ink-2); }
.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 1rem; }

.skip { position: absolute; left: 0.5rem; top: -4rem; background: #fff; color: var(--brand); padding: 0.6rem 1rem; border-radius: 6px; z-index: 10; font-weight: 600; }
.skip:focus { top: 0.5rem; }

/* Cabecera */
.site-header { background: var(--brand); color: #fff; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 0.5rem 2rem; flex-wrap: wrap; padding-top: 0.85rem; padding-bottom: 0.85rem; }
.brand { display: inline-flex; align-items: center; gap: 0.55rem; color: #fff; text-decoration: none; font: 700 1.5rem/1 var(--serif); letter-spacing: 0.01em; }
.brand:hover { color: #fff; }
.brand svg { width: 28px; height: 28px; }
.site-nav ul { display: flex; flex-wrap: wrap; gap: 0.25rem 1.4rem; list-style: none; margin: 0; padding: 0; }
.site-nav a { color: #dbe7f3; text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; font-weight: 500; }
.site-nav a:hover, .site-nav a[aria-current="page"] { color: #fff; border-bottom-color: var(--gold); }
.site-header :focus-visible { outline-color: #f2c260; }
@media (max-width: 560px) { .site-nav ul { gap: 0.1rem 1rem; } .site-nav a { font-size: 0.93rem; } .site-nav li:last-child { display: none; } }

/* Estructura */
main { display: block; padding-bottom: 3rem; }
.crumbs { font-size: 0.9rem; color: var(--ink-2); padding: 1.1rem 0 0; }
.crumbs ol { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; list-style: none; margin: 0; padding: 0; }
.crumbs li + li::before { content: "/"; margin-right: 0.5rem; color: #8a99ab; }
h1, h2, h3 { font-family: var(--serif); line-height: 1.2; color: var(--brand); margin: 0; }
h1 { font-size: clamp(2rem, 4.2vw, 2.9rem); letter-spacing: -0.01em; }
h2 { font-size: clamp(1.45rem, 2.6vw, 1.85rem); margin-top: 2.6rem; margin-bottom: 0.7rem; }
h3 { font-size: 1.2rem; margin-top: 1.6rem; margin-bottom: 0.4rem; }
p { margin: 0 0 1rem; }
.page-head { padding: 1.4rem 0 1.4rem; max-width: 52rem; }
.page-head .lead { font-size: 1.2rem; color: var(--ink-2); margin: 0.9rem 0 0.5rem; }
.disclaimer { font-size: 0.92rem; color: var(--ink-2); border-left: 3px solid var(--gold); padding: 0.1rem 0 0.1rem 0.8rem; margin: 0.9rem 0 0; }

/* Calculadora */
.calc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.25rem; margin: 0.5rem 0 1rem; }
@media (min-width: 920px) {
  .calc { grid-template-columns: minmax(300px, 400px) minmax(0, 1fr); align-items: start; }
  .calc-inputs { position: sticky; top: 1rem; }
}
.calc-inputs { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.calc-inputs h2 { font-size: 1.15rem; margin: 0 0 0.9rem; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: 0.95rem; margin-bottom: 0.3rem; color: var(--ink); }
.input-wrap { display: flex; align-items: stretch; border: 1px solid #9fb0c4; border-radius: 6px; background: #fff; }
.input-wrap:focus-within { border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.input-wrap input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 0.6rem 0.7rem; font: inherit; font-variant-numeric: tabular-nums; color: var(--ink); border-radius: 6px; }
.input-wrap input:focus { outline: none; }
.unit { display: flex; align-items: center; padding: 0 0.8rem; color: var(--ink-2); background: var(--line-2); border-left: 1px solid #c4d0de; border-radius: 0 6px 6px 0; font-size: 0.95rem; min-width: 2.6rem; justify-content: center; }
select { width: 100%; padding: 0.6rem 0.7rem; border: 1px solid #9fb0c4; border-radius: 6px; font: inherit; background: #fff; color: var(--ink); }
select:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px var(--blue-soft); }
.help { font-size: 0.86rem; color: var(--ink-2); margin: 0.3rem 0 0; line-height: 1.45; }
.err { font-size: 0.88rem; color: var(--danger); font-weight: 600; margin: 0.3rem 0 0; }
.field.invalid .input-wrap, .field.invalid select { border-color: var(--danger); }
.btn-quiet { background: none; border: 1px solid var(--line); border-radius: 6px; padding: 0.5rem 0.9rem; font: inherit; font-size: 0.92rem; color: var(--blue); cursor: pointer; }
.btn-quiet:hover { background: var(--blue-soft); }

.calc-results { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; min-width: 0; }
.result-main { background: var(--brand); color: #fff; padding: 1.2rem 1.5rem 1.3rem; }
.result-label { margin: 0; font-size: 0.98rem; color: #c9d9ea; }
.result-value { margin: 0.2rem 0 0; font: 700 clamp(2.1rem, 5vw, 3rem)/1.1 var(--serif); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.result-sub { margin: 0.35rem 0 0; font-size: 0.95rem; color: #c9d9ea; }
.result-rows { margin: 0; padding: 0.4rem 1.5rem 0.2rem; }
.result-rows > div { display: flex; justify-content: space-between; gap: 1.5rem; padding: 0.6rem 0; border-bottom: 1px solid var(--line-2); }
.result-rows > div:last-child { border-bottom: 0; }
.result-rows dt { color: var(--ink-2); }
.result-rows dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }
.result-note { margin: 0.4rem 1.5rem 0.8rem; padding: 0.6rem 0.8rem; background: #fff7e6; border-left: 3px solid var(--gold); font-size: 0.93rem; }
.result-error { padding: 1.2rem 1.5rem; background: var(--danger-soft); color: #5f1710; }
.result-error p { margin: 0 0 0.4rem; font-weight: 700; }
.result-error ul { margin: 0; padding-left: 1.2rem; }
.calc-results figure { margin: 0; padding: 0.9rem 1.5rem 0.4rem; border-top: 1px solid var(--line-2); }
.calc-results figcaption { font-weight: 600; font-size: 0.95rem; margin-bottom: 0.6rem; }
.calc-results figcaption .muted { font-weight: 400; font-size: 0.85rem; }
.share-bar { display: flex; height: 16px; border-radius: 8px; overflow: hidden; background: var(--line-2); }
.share-bar span { display: block; height: 100%; }
.legend { display: flex; flex-wrap: wrap; gap: 0.3rem 1.2rem; list-style: none; margin: 0.6rem 0 0.2rem; padding: 0; font-size: 0.9rem; }
.legend li { display: inline-flex; align-items: center; gap: 0.4rem; }
.sw { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.s1 { background: var(--blue); fill: var(--blue); }
.s2 { background: var(--gold); fill: var(--gold); }
.s3 { background: var(--violet); fill: var(--violet); }
.chart { overflow-x: auto; }
.chart-svg { display: block; min-width: 520px; width: 100%; height: auto; }
.chart-svg .grid { stroke: var(--line); stroke-width: 1; }
.chart-svg .axis { fill: var(--ink-2); font: 12px var(--sans); }
.chart-svg g:hover rect { opacity: 0.8; }
.result-table { border-top: 1px solid var(--line-2); padding: 0.2rem 1.5rem 0.8rem; }
.result-table summary { cursor: pointer; padding: 0.7rem 0; font-weight: 600; color: var(--blue); }
.table-wrap { overflow: auto; max-height: 26rem; border: 1px solid var(--line); border-radius: 6px; }
table { border-collapse: collapse; width: 100%; font-size: 0.93rem; font-variant-numeric: tabular-nums; }
th, td { padding: 0.5rem 0.75rem; text-align: right; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
thead th { position: sticky; top: 0; background: #eef3f9; color: var(--brand); font-weight: 700; }
tbody th { text-align: left; font-weight: 600; }
thead th:first-child { text-align: left; }
tbody tr:last-child th, tbody tr:last-child td { border-bottom: 0; }
.prose table { margin: 0 0 1.2rem; }
.table-wrap.text table { min-width: 34rem; }
.table-wrap.text th, .table-wrap.text td { text-align: left; white-space: normal; vertical-align: top; line-height: 1.5; }
.table-wrap.text tbody th { min-width: 9rem; }
.prose .table-wrap { margin: 0 0 1.4rem; max-height: none; }

/* Artículo y contenido */
.with-toc { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: 2rem; }
@media (min-width: 1000px) { .with-toc { grid-template-columns: minmax(0, 1fr) 230px; } .toc { position: sticky; top: 1rem; align-self: start; order: 2; } }
.toc { font-size: 0.95rem; border-left: 2px solid var(--line); padding-left: 1rem; }
.toc h2 { font: 700 1rem var(--sans); margin: 0 0 0.5rem; color: var(--ink); }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc li { margin: 0.35rem 0; }
.toc a { text-decoration: none; color: var(--ink-2); }
.toc a:hover { color: var(--blue); text-decoration: underline; }
.prose { max-width: 44rem; }
.prose > h2:first-child { margin-top: 0; }
.prose ul, .prose ol { padding-left: 1.3rem; margin: 0 0 1.2rem; }
.prose li { margin: 0.35rem 0; }
.formula, .steps-box { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 0 0 1.2rem; }
.formula pre { margin: 0; white-space: pre-wrap; font: 0.98rem/1.7 ui-monospace, "SFMono-Regular", Consolas, Menlo, monospace; overflow-wrap: anywhere; }
.vars { display: grid; gap: 0.2rem 1rem; grid-template-columns: max-content minmax(0, 1fr); margin: 0 0 1.2rem; }
.vars dt { font: 700 1rem var(--serif); color: var(--brand); }
.vars dd { margin: 0; }
.steps-box ol { margin: 0; padding-left: 1.2rem; }
.steps-box li { margin: 0.55rem 0; }
.steps-box .step-expr { display: block; font: 0.95rem/1.55 ui-monospace, "SFMono-Regular", Consolas, Menlo, monospace; color: var(--ink); overflow-wrap: anywhere; }
.steps-box h3 { margin-top: 0; font-size: 1.05rem; }
details.faq { border-bottom: 1px solid var(--line); }
details.faq summary { cursor: pointer; padding: 0.9rem 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
details.faq summary::-webkit-details-marker { display: none; }
details.faq summary::after { content: "+"; font-weight: 400; font-size: 1.4rem; line-height: 1; color: var(--blue); }
details.faq[open] summary::after { content: "−"; }
details.faq > div { padding: 0 0 0.6rem; }
.meta-line { font-size: 0.92rem; color: var(--ink-2); margin: 1.6rem 0 0; }
.related { display: grid; gap: 0.2rem 2rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); margin-top: 0.5rem; }
.related h3 { font-size: 1.05rem; margin-top: 0.8rem; }
.related ul { margin: 0; padding-left: 1.1rem; }
.callout { background: var(--blue-soft); border-radius: var(--radius); padding: 1rem 1.2rem; margin: 1.6rem 0; }
.callout p:last-child { margin-bottom: 0; }

/* Listados de herramientas y guías */
.tool-group { margin-top: 2.2rem; }
.tool-group > h3 { margin: 0; font-size: 1.35rem; }
.tool-group > p { margin: 0.2rem 0 0.7rem; color: var(--ink-2); }
.tool-list { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.tool-list li + li { border-top: 1px solid var(--line-2); }
.tool-list a { display: grid; gap: 0.3rem 1.5rem; padding: 1rem 1.25rem; text-decoration: none; color: inherit; }
@media (min-width: 720px) { .tool-list a { grid-template-columns: minmax(0, 1fr) 15rem; align-items: center; } }
.tool-list a:hover { background: #f7fafd; }
.tool-list a:hover .tool-name { text-decoration: underline; }
.tool-name { font: 700 1.15rem var(--serif); color: var(--blue); }
.tool-desc { display: block; color: var(--ink-2); font-size: 0.97rem; margin-top: 0.15rem; }
.tool-eg { font-size: 0.88rem; color: var(--ink-2); line-height: 1.4; }
@media (min-width: 720px) { .tool-eg { text-align: right; } }
.tool-eg strong { display: block; font: 700 1.3rem/1.2 var(--serif); color: var(--brand); font-variant-numeric: tabular-nums; }
.guide-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.9rem 2rem; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.guide-list a { text-decoration: none; display: block; padding: 0.2rem 0; }
.guide-list .tool-name { display: block; }
.guide-list a:hover .tool-name { text-decoration: underline; }
.matrix td, .matrix th { white-space: normal; text-align: left; }
.matrix th[scope="row"] { min-width: 10rem; }

/* Portada */
.hero { padding: 2rem 0 0.5rem; }
.hero h1 { max-width: 26ch; text-wrap: balance; }
.hero .lead { font-size: 1.2rem; max-width: 40rem; color: var(--ink-2); margin: 0.9rem 0 1rem; }
.quick { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.quick a { display: inline-block; padding: 0.55rem 1rem; border: 1px solid var(--blue); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 0.95rem; background: #fff; }
.quick a:hover { background: var(--blue); color: #fff; }
.proof { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; margin-top: 2.5rem; }
@media (min-width: 900px) { .proof { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; } }
.proof ul { padding-left: 1.2rem; }

/* Pie */
.site-footer { background: var(--brand); color: #c9d9ea; padding: 2.4rem 0 1.6rem; font-size: 0.95rem; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 1.6rem 2rem; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.footer-grid h2 { font: 700 1rem var(--sans); color: #fff; margin: 0 0 0.6rem; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; }
.footer-grid li { margin: 0.3rem 0; }
.footer-grid p { margin: 0 0 0.6rem; }
.site-footer :focus-visible { outline-color: #f2c260; }
.footer-bottom { margin-top: 1.8rem; padding-top: 1rem; border-top: 1px solid #2d4d6b; font-size: 0.88rem; }

@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; animation: none !important; } }
@media print { .site-header, .site-footer, .toc, .calc-inputs .btn-quiet { display: none; } body { background: #fff; } }

/* Bloques de AdSense */
.ad-slot{margin:2rem auto;max-width:100%;min-height:120px;text-align:center;clear:both;overflow:hidden}
.ad-slot .ad-label{display:block;font-size:.7rem;letter-spacing:.06em;text-transform:uppercase;color:#7a8794;margin-bottom:.35rem}
.ad-slot ins.adsbygoogle[data-ad-status="unfilled"]{display:none!important}
.calc-results .ad-slot,.prose .ad-slot{margin:1.75rem 0}
