/* Cifra Clara — identidad «la libreta». Ver BRAND.md */
:root {
  --tinta: #0F2A22;
  --tinta-2: #35493F;
  --gris: #5A6B62;
  --verde: #1F5C47;
  --verde-osc: #164535;
  --verde-claro: #E4EFE8;
  --papel: #F6F8F5;
  --blanco: #FFFFFF;
  --pauta: #D3E0D8;
  --sello: #B4382C;
  --laton: #A9823A;
  --f-ui: "Archivo", "Arial Narrow", system-ui, sans-serif;
  --f-read: "Literata", Georgia, serif;
  --max: 1180px;
  --read: 68ch;
  --r: 6px;
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
}

/* Superficies del navegador con la paleta de marca */
::selection { background: #BFE0CD; color: var(--tinta); }
html { scrollbar-color: #9DB8A9 var(--papel); -webkit-tap-highlight-color: transparent; }
input, textarea { caret-color: var(--verde); }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--f-ui); font-size: 1.0625rem; line-height: 1.55; color: var(--tinta); background: var(--papel); font-variant-numeric: tabular-nums; }
img, svg { max-width: 100%; display: block; }
a { color: var(--verde); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--verde-osc); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--verde); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

h1, h2, h3 { font-family: var(--f-ui); font-stretch: 80%; font-weight: 750; line-height: 1.02; letter-spacing: -.01em; color: var(--tinta); text-wrap: balance; }
h1 { font-size: clamp(2.6rem, 6.2vw, 4.6rem); margin: 0 0 .35em; }
h2 { font-size: clamp(1.75rem, 3.4vw, 2.4rem); margin: 1.9em 0 .5em; }
h3 { font-size: 1.35rem; font-stretch: 90%; font-weight: 700; margin: 1.6em 0 .35em; line-height: 1.15; }
p { margin: 0 0 1em; }

.container { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 1.25rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 1rem; top: -4rem; background: var(--tinta); color: #fff; padding: .6rem 1rem; z-index: 100; }
.skip-link:focus { top: 1rem; color: #fff; }

/* ---------- Cabecera ---------- */
.site-header { background: var(--papel); border-bottom: 2px solid var(--tinta); position: sticky; top: 0; z-index: 50; }
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 64px; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .55rem; text-decoration: none; color: var(--tinta); font-stretch: 78%; font-weight: 800; font-size: 1.5rem; letter-spacing: -.01em; }
.brand:hover { color: var(--tinta); }
.brand strong { color: var(--verde); font-weight: 800; }
.brand-mark { width: 30px; height: 30px; }
.main-nav { display: flex; gap: 1.6rem; }
.main-nav a { text-decoration: none; color: var(--tinta-2); font-weight: 500; min-height: 44px; display: inline-flex; align-items: center; border-bottom: 2px solid transparent; margin-bottom: -2px; }
.main-nav a:hover { color: var(--tinta); border-bottom-color: var(--pauta); }
.main-nav a[aria-current="page"] { color: var(--verde); font-weight: 650; border-bottom-color: var(--verde); }
.nav-toggle { display: none; background: none; border: 1px solid var(--pauta); border-radius: var(--r); width: 44px; height: 44px; align-items: center; justify-content: center; color: var(--tinta); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .nav-toggle { display: inline-flex; }
  .main-nav { display: none; position: absolute; left: 0; right: 0; top: 64px; background: var(--papel); flex-direction: column; gap: 0; padding: .25rem 1.25rem .75rem; border-bottom: 2px solid var(--tinta); }
  .main-nav.open { display: flex; }
  .main-nav a { border-bottom: 1px solid var(--pauta); margin: 0; }
  .main-nav a[aria-current="page"] { border-bottom-color: var(--pauta); }
}

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .7rem 1.3rem; border-radius: var(--r); font: inherit; font-weight: 650; text-decoration: none; border: 2px solid transparent; cursor: pointer; touch-action: manipulation; transition: background-color 150ms ease, color 150ms ease, transform 160ms var(--ease-out), box-shadow 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .btn:hover { transform: translateY(-1px); box-shadow: 0 6px 14px -8px rgba(15, 42, 34, .45); } }
.btn:active { transform: scale(.97); box-shadow: none; }
.btn-primary { background: var(--verde); color: #fff; }
.btn-primary:hover { background: var(--verde-osc); color: #fff; }
.btn-line { border-color: var(--tinta); color: var(--tinta); background: transparent; }
.btn-line:hover { background: var(--tinta); color: #fff; }
.btn-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.6rem; }

/* ---------- Portada: la libreta ---------- */
.hero { padding: clamp(2.5rem, 6vw, 5rem) 0 clamp(2.5rem, 6vw, 4.5rem); border-bottom: 1px solid var(--pauta); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 900px) { .hero-grid { grid-template-columns: 1fr; } }
.hero h1 { font-size: clamp(3rem, 7.5vw, 5.6rem); font-stretch: 72%; font-weight: 800; max-width: 11ch; }
.hero .lead { font-size: 1.2rem; color: var(--tinta-2); max-width: 40ch; }

.passbook { position: relative; background-color: var(--blanco); border: 1px solid var(--pauta); border-radius: var(--r); box-shadow: 0 1px 0 var(--pauta), 0 18px 40px -24px rgba(15, 42, 34, .35); padding: 1.6rem 1.6rem 1.3rem 3.1rem;
  background-image: linear-gradient(to right, transparent 2.1rem, rgba(180, 56, 44, .35) 2.1rem, rgba(180, 56, 44, .35) calc(2.1rem + 1px), transparent calc(2.1rem + 1px)),
                    repeating-linear-gradient(to bottom, transparent 0, transparent 2.2rem, var(--pauta) 2.2rem, var(--pauta) calc(2.2rem + 1px)); }
.passbook-sentence { font-family: var(--f-read); font-size: 1.28rem; line-height: 2.2rem; margin: 0; color: var(--tinta); }
.passbook-sentence input { font: inherit; font-family: var(--f-ui); font-weight: 700; font-stretch: 85%; color: var(--verde); width: 4.2ch; text-align: center; border: 0; border-bottom: 2px solid var(--verde); background: var(--verde-claro); border-radius: 3px 3px 0 0; padding: 0 .15em; line-height: 1.5; }
.passbook-sentence input.w-lg { width: 6ch; }
.passbook-sentence input:focus { outline: 2px solid var(--verde); outline-offset: 2px; }
.passbook-sentence input[aria-invalid="true"] { color: var(--sello); border-bottom-color: var(--sello); background: #F8E5E2; }
.passbook-total { font-stretch: 68%; font-weight: 800; font-size: clamp(3.4rem, 8vw, 5.4rem); line-height: 1; color: var(--verde); margin: .45rem 0 .7rem; letter-spacing: -.02em; }
.passbook-rows { margin: 0; display: grid; }
.passbook-rows div { display: flex; justify-content: space-between; gap: 1rem; border-top: 1px dashed var(--pauta); padding: .45rem 0; font-size: 1rem; }
.passbook-rows dt { color: var(--gris); }
.passbook-rows dd { margin: 0; font-weight: 650; }
.passbook-foot { font-size: .9rem; color: var(--gris); margin: .9rem 0 0; }

/* ---------- Secciones y libro de cuentas ---------- */
.section { padding: clamp(2.5rem, 6vw, 4.5rem) 0; }
.section + .section { border-top: 1px solid var(--pauta); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.2rem; }
.section-head h2 { margin: 0; }
.section-head p { margin: 0; color: var(--gris); max-width: 52ch; }

.ledger { list-style: none; margin: 0; padding: 0; border-top: 2px solid var(--tinta); counter-reset: fila; }
.ledger li { border-bottom: 1px solid var(--pauta); }
.ledger a { display: grid; grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) auto; gap: .4rem 2rem; align-items: baseline; padding: 1.05rem .25rem; text-decoration: none; color: var(--tinta); transition: background-color .15s; }
.ledger a:hover { background: var(--verde-claro); color: var(--tinta); }
.ledger-name { font-stretch: 85%; font-weight: 700; font-size: 1.3rem; line-height: 1.15; }
.ledger-desc { color: var(--tinta-2); }
.ledger-tag { font-size: .9rem; color: var(--gris); white-space: nowrap; }
.ledger-name { background: linear-gradient(currentColor, currentColor) 0 100% / 0 2px no-repeat; transition: background-size 220ms var(--ease-out), color 150ms ease; padding-bottom: 2px; justify-self: start; }
.ledger a:hover .ledger-name, .ledger a:focus-visible .ledger-name { color: var(--verde); background-size: 100% 2px; }
.ledger a:active { background: #D6E8DD; }
ol.ledger a { grid-template-columns: 2.6rem minmax(0, 15rem) minmax(0, 1fr) auto; }
ol.ledger li { counter-increment: fila; }
ol.ledger a::before { content: counter(fila); font-stretch: 70%; font-weight: 800; font-size: 1.8rem; line-height: 1; color: var(--verde); }
@media (max-width: 720px) {
  .ledger a, ol.ledger a { grid-template-columns: 1fr; gap: .2rem; }
  ol.ledger a { grid-template-columns: 2.4rem 1fr; }
  ol.ledger a > span { grid-column: 2; }
  ol.ledger a::before { grid-row: span 3; }
}

.method { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 2rem 4rem; }
@media (max-width: 860px) { .method { grid-template-columns: 1fr; } }
.method h2 { margin-top: 0; }
.method p { font-family: var(--f-read); font-size: 1.08rem; line-height: 1.7; max-width: var(--read); }

/* ---------- Cabecera de página ---------- */
.page-head { padding: clamp(2rem, 5vw, 3.4rem) 0 clamp(1.5rem, 4vw, 2.4rem); border-bottom: 1px solid var(--pauta); }
.page-head h1 { max-width: 18ch; }
.page-head .lead { font-family: var(--f-read); font-size: 1.2rem; line-height: 1.6; color: var(--tinta-2); max-width: 60ch; margin: 0; }
.breadcrumb { font-size: .92rem; color: var(--gris); margin-bottom: 1.1rem; }
.breadcrumb a { color: var(--gris); }
.byline { display: flex; flex-wrap: wrap; gap: .3rem 1.4rem; font-size: .92rem; color: var(--gris); margin-top: 1.3rem; padding-top: .9rem; border-top: 1px dashed var(--pauta); max-width: 60ch; }

/* ---------- Artículos ---------- */
.layout-article { display: grid; grid-template-columns: minmax(0, var(--read)) 250px; gap: 4rem; justify-content: space-between; padding: 2.6rem 1.25rem 4.5rem; max-width: var(--max); margin: 0 auto; }
@media (max-width: 980px) { .layout-article { grid-template-columns: minmax(0, 1fr); } .aside { display: none; } }
.prose { font-family: var(--f-read); font-size: 1.125rem; line-height: 1.72; }
.prose > :first-child { margin-top: 0; }
.prose h2, .prose h3 { font-family: var(--f-ui); }
.prose ul, .prose ol { padding-left: 1.25em; margin: 0 0 1.2em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--verde); font-family: var(--f-ui); font-weight: 700; }
.prose table { font-family: var(--f-ui); }
.aside { position: sticky; top: 88px; align-self: start; }
.toc { font-size: .95rem; border-top: 2px solid var(--tinta); padding-top: .8rem; }
.toc p { font-weight: 700; margin-bottom: .6rem; }
.toc ol { margin: 0; padding-left: 1.2em; }
.toc li { margin-bottom: .4rem; }
.toc li::marker { color: var(--gris); }

.callout { border: 1px solid #C5DACD; background: var(--verde-claro); padding: 1rem 1.25rem; margin: 1.8em 0; border-radius: var(--r); }
.callout p:last-child { margin-bottom: 0; }
.callout-title { font-family: var(--f-ui); font-weight: 750; font-stretch: 85%; font-size: 1.1rem; margin-bottom: .3rem; color: var(--verde-osc); }
.callout.info { border-color: var(--pauta); background: #EDF1EE; }
.callout.info .callout-title { color: var(--tinta); }
.formula { font-family: "Cambria Math", "Literata", serif; border-top: 1px solid var(--pauta); border-bottom: 1px solid var(--pauta); padding: .9rem 0; overflow-x: auto; font-size: 1.15rem; margin: 1.3em 0; text-align: center; }

.table-wrap { overflow-x: auto; margin: 1.5em 0; border-top: 2px solid var(--tinta); }
table { width: 100%; border-collapse: collapse; font-size: .98rem; font-family: var(--f-ui); }
th, td { padding: .6rem .7rem; text-align: right; border-bottom: 1px solid var(--pauta); white-space: nowrap; }
th:first-child, td:first-child { text-align: left; padding-left: 0; }
thead th { font-weight: 700; color: var(--tinta); background: var(--papel); position: sticky; top: 0; }
table.text-table td, table.text-table th { white-space: normal; text-align: left; vertical-align: top; }

.sources { margin-top: 3rem; padding-top: 1.2rem; border-top: 2px solid var(--tinta); font-size: 1rem; }
.sources h2 { font-size: 1.4rem; margin-top: 0; }
.related { margin-top: 2.2rem; }
.related h2 { font-size: 1.4rem; }

/* Publicidad: los huecos vacíos no ocupan espacio */
.ad-slot { margin: 2rem 0; min-height: 100px; display: flex; justify-content: center; align-items: center; }
.ad-slot:empty { display: none; }

/* ---------- Calculadoras ---------- */
.calc { display: grid; grid-template-columns: minmax(0, 360px) minmax(0, 1fr); gap: 2rem; margin: 2.2rem 0 1rem; align-items: start; }
@media (max-width: 860px) { .calc { grid-template-columns: 1fr; } }
.calc-form { background: var(--blanco); border: 1px solid var(--pauta); border-top: 3px solid var(--verde); border-radius: 0 0 var(--r) var(--r); padding: 1.4rem; }
.calc-output { background: var(--blanco); border: 1px solid var(--pauta); border-radius: var(--r); padding: 1.5rem 1.6rem; }
.calc-output:focus { outline: none; }
.field { margin-bottom: 1rem; }
.field label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .3rem; }
.hint, .field .hint { display: block; font-size: .87rem; color: var(--gris); margin-top: .3rem; }
.input-wrap { position: relative; display: flex; align-items: center; }
.input-wrap input, .field select { width: 100%; min-height: 48px; font: inherit; font-weight: 600; padding: .55rem 3.2rem .55rem .8rem; border: 1px solid #B9CCC1; border-radius: var(--r); background: var(--papel); color: var(--tinta); }
.input-wrap input:focus { border-color: var(--verde); background: #fff; outline: 2px solid var(--verde); outline-offset: 0; }
.input-wrap .unit { position: absolute; right: .8rem; color: var(--gris); font-size: .95rem; pointer-events: none; }
.input-wrap input[aria-invalid="true"] { border-color: var(--sello); }
.field-error { color: var(--sello); font-size: .87rem; margin-top: .3rem; display: block; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.calc-form .btn { width: 100%; margin-top: .3rem; }

/* Resultados con forma de asiento de libreta */
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 2rem; margin-bottom: 1.2rem; }
.result { border-bottom: 1px dashed var(--pauta); padding: .55rem 0; display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.result-label { font-size: .95rem; color: var(--gris); }
.result-value { font-weight: 700; font-size: 1.15rem; white-space: nowrap; }
.result.highlight { grid-column: 1 / -1; display: block; border-bottom: 2px solid var(--tinta); padding: 0 0 .7rem; margin-bottom: .3rem; }
.result.highlight .result-label { display: block; font-size: 1rem; color: var(--tinta-2); }
.result.highlight .result-value { display: block; font-stretch: 68%; font-weight: 800; font-size: clamp(2.8rem, 6vw, 4.2rem); line-height: 1.05; color: var(--verde); letter-spacing: -.02em; }
@media (max-width: 520px) { .results { grid-template-columns: 1fr; } }
.result-note { font-family: var(--f-read); font-size: 1rem; line-height: 1.6; color: var(--tinta-2); }
.chart { margin: 1.2rem 0 .5rem; }
.chart svg { width: 100%; height: auto; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: .9rem; color: var(--tinta-2); margin-top: .4rem; }
.chart-legend span { display: inline-flex; align-items: center; gap: .4rem; }
.chart-legend i { width: 12px; height: 12px; border-radius: 2px; display: inline-block; }
.calc-output details { margin-top: 1rem; border-top: 1px solid var(--pauta); }
.calc-output summary { cursor: pointer; font-weight: 650; color: var(--verde); min-height: 44px; display: flex; align-items: center; }
.calc-output .table-wrap { max-height: 420px; overflow-y: auto; margin-top: .4rem; }

.note-box { border-top: 2px solid var(--tinta); padding-top: 1rem; margin-top: 2.5rem; max-width: 70ch; }
.note-box p { font-family: var(--f-read); color: var(--tinta-2); }

/* ---------- Pie ---------- */
.site-footer { background: var(--tinta); color: #C6D4CC; padding: 3rem 0 1.5rem; font-size: .95rem; }
.site-footer a { color: #E6EEE9; text-decoration: none; display: block; padding: .3rem 0; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 2rem; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand { font-stretch: 78%; font-weight: 800; font-size: 1.6rem; color: #fff; margin-bottom: .4rem; }
.footer-brand strong { color: #8FC3AC; }
.footer-title { color: #fff; font-weight: 700; margin-bottom: .4rem; }
.footer-note { border-top: 1px solid #284A3F; margin-top: 2rem; padding-top: 1.3rem; font-size: .88rem; color: #9DB2A7; }

/* =========================================================
   Capa de movimiento e interacción (taste + impeccable + Emil)
   ========================================================= */

/* Cabecera: sombra solo cuando la página se ha desplazado */
.site-header { transition: box-shadow 200ms ease; }
.site-header.is-scrolled { box-shadow: 0 8px 20px -16px rgba(15, 42, 34, .5); }

/* Entrada única de la portada */
@keyframes enterUp { from { opacity: 0; transform: translateY(14px); } }
@keyframes enterSheet { from { opacity: 0; transform: translateY(22px) scale(.985); clip-path: inset(0 0 12% 0 round 6px); } to { clip-path: inset(0 0 0 0 round 6px); } }
[data-enter] h1, [data-enter] .lead, [data-enter] .btn-row { animation: enterUp 700ms var(--ease-out) both; }
[data-enter] .lead { animation-delay: 70ms; }
[data-enter] .btn-row { animation-delay: 130ms; }
[data-enter] .passbook { animation: enterSheet 900ms var(--ease-out) 120ms both; }

/* Pasos con teclado: indicación discreta */
.passbook-sentence input { transition: background-color 150ms ease, box-shadow 150ms ease; }
.passbook-sentence input:hover { background: #D5E8DC; }

/* Deslizadores sincronizados con cada campo */
.slider { -webkit-appearance: none; appearance: none; width: 100%; height: 28px; margin: .35rem 0 0; background: transparent; cursor: pointer; touch-action: pan-y; }
.slider::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(to right, var(--verde) var(--fill, 50%), var(--pauta) var(--fill, 50%)); }
.slider::-moz-range-track { height: 4px; border-radius: 4px; background: var(--pauta); }
.slider::-moz-range-progress { height: 4px; border-radius: 4px; background: var(--verde); }
.slider::-webkit-slider-thumb { -webkit-appearance: none; width: 20px; height: 20px; margin-top: -8px; border-radius: 50%; background: #fff; border: 2px solid var(--verde); box-shadow: 0 2px 6px rgba(15, 42, 34, .25); transition: transform 160ms var(--ease-out); }
.slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--verde); box-shadow: 0 2px 6px rgba(15, 42, 34, .25); transition: transform 160ms var(--ease-out); }
.slider:active::-webkit-slider-thumb { transform: scale(1.15); }
.slider:active::-moz-range-thumb { transform: scale(1.15); }
.slider:focus-visible { outline: 2px solid var(--verde); outline-offset: 2px; border-radius: 4px; }

/* Gráfico: crecimiento solo en la primera carga, foco al pasar el puntero */
.chart { position: relative; }
.chart .seg { transform-box: fill-box; transform-origin: 50% 100%; }
.chart.is-new .seg { animation: barGrow 760ms var(--ease-out) both; animation-delay: calc(var(--i) * 16ms); }
@keyframes barGrow { from { transform: scaleY(.02); opacity: .4; } }
.chart .bar { transition: opacity 150ms ease; }
@media (hover: hover) and (pointer: fine) {
  .chart svg:hover .bar { opacity: .4; }
  .chart svg:hover .bar.is-active { opacity: 1; }
}
.chart-tip { position: absolute; top: 0; left: 0; pointer-events: none; z-index: 5; min-width: 170px; background: var(--tinta); color: #E6EEE9; border-radius: var(--r); padding: .55rem .7rem; font-size: .88rem; line-height: 1.4; box-shadow: 0 10px 24px -12px rgba(15, 42, 34, .6); opacity: 0; transform: translateY(4px) scale(.97); transform-origin: 50% 100%; transition: opacity 125ms var(--ease-out), transform 125ms var(--ease-out); }
.chart-tip.is-on { opacity: 1; transform: none; }
.chart-tip strong { display: block; color: #fff; font-stretch: 85%; font-size: .95rem; margin-bottom: .15rem; }
.chart-tip span { display: flex; justify-content: space-between; gap: 1rem; }
.chart-tip b { font-weight: 650; color: #fff; }

/* El coste de esperar */
.wait-grid { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: clamp(2rem, 5vw, 4.5rem); align-items: center; }
@media (max-width: 900px) { .wait-grid { grid-template-columns: 1fr; } }
.wait-grid h2 { margin-top: 0; max-width: 14ch; }
.wait-grid > div > p { font-family: var(--f-read); font-size: 1.1rem; line-height: 1.65; color: var(--tinta-2); max-width: 46ch; }
.wait-card { background: var(--blanco); border: 1px solid var(--pauta); border-radius: var(--r); padding: 1.5rem 1.6rem 1.2rem; }
.wait-row + .wait-row { margin-top: 1.4rem; }
.wait-row label { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; font-weight: 600; }
.wait-row output { font-stretch: 80%; font-weight: 800; font-size: 1.5rem; color: var(--verde); }
.wait-bar { height: 44px; margin-top: .55rem; border-radius: 4px; background: repeating-linear-gradient(to right, var(--papel) 0 calc(10% - 1px), var(--pauta) calc(10% - 1px) 10%); overflow: hidden; position: relative; }
.wait-fill { position: absolute; inset: 0; background: var(--verde); transform-origin: 0 50%; transform: scaleX(.5); transition: transform 450ms var(--ease-out); }
.wait-row.is-b .wait-fill { background: var(--laton); }
.wait-value { position: absolute; right: .7rem; top: 50%; transform: translateY(-50%); font-stretch: 75%; font-weight: 800; font-size: 1.35rem; color: var(--tinta); z-index: 1; background: rgba(255, 255, 255, .88); padding: 0 .4rem; border-radius: 3px; }
.wait-note { font-family: var(--f-read); font-size: 1.08rem; line-height: 1.55; margin: 1.3rem 0 .4rem; padding-top: 1rem; border-top: 2px solid var(--tinta); }
.wait-note strong { color: var(--verde); font-family: var(--f-ui); font-stretch: 85%; font-size: 1.2rem; }

/* Lectura: barra de progreso e índice activo */
.read-progress { position: fixed; top: 0; left: 0; right: 0; height: 3px; background: var(--verde); transform-origin: 0 50%; transform: scaleX(0); z-index: 60; pointer-events: none; }
.toc a { text-decoration: none; color: var(--tinta-2); transition: color 150ms ease; }
.toc a:hover { color: var(--verde); text-decoration: underline; }
.toc a[aria-current="true"] { color: var(--verde); font-weight: 700; }
.toc li:has(a[aria-current="true"])::marker { color: var(--verde); }

@media (prefers-reduced-motion: reduce) {
  [data-enter] h1, [data-enter] .lead, [data-enter] .btn-row, [data-enter] .passbook, .chart.is-new .seg { animation: none !important; }
  .wait-fill, .chart-tip { transition: none !important; }
}
/* Botones de ejemplo (chips) */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: 0 0 1.1rem; }
.chip { font: inherit; font-size: .92rem; font-weight: 600; min-height: 40px; padding: .4rem .85rem; border-radius: 999px; border: 1px solid #B9CCC1; background: var(--papel); color: var(--tinta); cursor: pointer; touch-action: manipulation; transition: background-color 150ms ease, border-color 150ms ease, transform 160ms var(--ease-out); }
@media (hover: hover) and (pointer: fine) { .chip:hover { border-color: var(--verde); } }
.chip:active { transform: scale(.97); }
.chip[aria-pressed="true"] { background: var(--verde); border-color: var(--verde); color: #fff; }
.chips-label { font-weight: 600; font-size: .95rem; margin-bottom: .45rem; }

/* Comparación fija/variable */
.versus { margin: .4rem 0 1rem; }
.versus-row + .versus-row { margin-top: .8rem; }
.versus-label { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .1rem; }
.versus-row.is-b .wait-fill { background: var(--laton); }
.versus .wait-bar { margin-top: .3rem; }

/* Tests interactivos */
.quiz { background: var(--blanco); border: 1px solid var(--pauta); border-radius: var(--r); padding: clamp(1.2rem, 3vw, 2rem); max-width: 760px; margin: 2.2rem 0; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 1rem; font-size: .92rem; color: var(--gris); margin-bottom: .6rem; }
.quiz-track { height: 4px; background: var(--pauta); border-radius: 4px; overflow: hidden; margin-bottom: 1.4rem; }
.quiz-track span { display: block; height: 100%; background: var(--verde); transform-origin: 0 50%; transition: transform 300ms var(--ease-out); }
.quiz-q { font-stretch: 85%; font-weight: 750; font-size: clamp(1.4rem, 3vw, 1.9rem); line-height: 1.15; margin: 0 0 1.1rem; }
.quiz-step { animation: quizIn 260ms var(--ease-out) both; }
@keyframes quizIn { from { opacity: 0; transform: translateX(12px); } }
.quiz-opts { display: grid; gap: .6rem; }
.quiz-opt { display: flex; gap: .8rem; align-items: baseline; text-align: left; font: inherit; width: 100%; min-height: 52px; padding: .8rem 1rem; border: 1px solid #B9CCC1; border-radius: var(--r); background: var(--papel); color: var(--tinta); cursor: pointer; touch-action: manipulation; transition: border-color 150ms ease, background-color 150ms ease, transform 160ms var(--ease-out); }
.quiz-opt kbd { font: inherit; font-weight: 800; font-stretch: 75%; color: var(--verde); min-width: 1.2em; }
@media (hover: hover) and (pointer: fine) { .quiz-opt:hover { border-color: var(--verde); background: #fff; } }
.quiz-opt:active { transform: scale(.985); }
.quiz-opt.is-right { border-color: var(--verde); background: var(--verde-claro); }
.quiz-opt.is-wrong { border-color: var(--sello); background: #F8E5E2; }
.quiz-opt[disabled] { cursor: default; }
.quiz-nav { display: flex; justify-content: space-between; gap: .75rem; margin-top: 1.2rem; flex-wrap: wrap; }
.quiz-back { background: none; border: 0; color: var(--verde); font: inherit; font-weight: 600; cursor: pointer; min-height: 44px; padding: 0; text-decoration: underline; text-underline-offset: .2em; }
.quiz-feedback { font-family: var(--f-read); margin-top: 1rem; padding: .9rem 1.1rem; border-radius: var(--r); background: #EDF1EE; border: 1px solid var(--pauta); animation: quizIn 220ms var(--ease-out) both; }
.quiz-feedback strong { font-family: var(--f-ui); }
.quiz-msg { font-family: var(--f-read); background: var(--papel); border: 1px dashed #B9CCC1; border-radius: var(--r); padding: 1rem 1.1rem; margin: 0 0 1rem; }
.quiz-msg small { display: block; font-family: var(--f-ui); color: var(--gris); margin-bottom: .3rem; }
.quiz-result-name { font-stretch: 70%; font-weight: 800; font-size: clamp(2.6rem, 7vw, 4rem); line-height: 1; color: var(--verde); margin: .2rem 0 .8rem; }
.meter { position: relative; height: 10px; border-radius: 10px; background: linear-gradient(to right, #8FB8A4, var(--verde) 50%, var(--laton)); margin: 1.4rem 0 .4rem; }
.meter i { position: absolute; top: 50%; width: 22px; height: 22px; margin: -11px 0 0 -11px; border-radius: 50%; background: #fff; border: 3px solid var(--tinta); left: 0; transition: left 700ms var(--ease-out); }
.meter-labels { display: flex; justify-content: space-between; font-size: .88rem; color: var(--gris); }
@media (prefers-reduced-motion: reduce) { .quiz-step, .quiz-feedback { animation: none; } .meter i, .quiz-track span { transition: none; } }