/* pronostico.fernandodilland.com
   Tipografía de fernandodilland.com (Instrument Serif + DM Sans) con una paleta sobria de grises.
   Sin frameworks: HTML, CSS y JS puro. Animaciones discretas que respetan prefers-reduced-motion. */

@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Serif"; src: url("/fonts/instrument-serif-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("/fonts/dm-sans.woff2") format("woff2"); font-weight: 400 700; font-style: normal; font-display: swap; }

:root {
  --bg: #f7f7f6;
  --surface: #ffffff;
  --panel: #f0efed;
  --panel-2: #e9e8e5;
  --line: #e2e0dc;
  --line-strong: #cfccc7;
  --text: #22211f;
  --text-2: #45423e;
  --muted: #706c67;
  --faint: #9a958f;
  --accent: #3d3a36;      /* tinta para botones */
  --accent-soft: #7a6f66; /* detalles tipográficos */
  --link: #3f5f7f;
  --grid: #edebe8;
  --axis: #cbc7c1;

  /* Datos: paleta categórica sobria, validada para daltonismo sobre #fff */
  --s1: #3f6fb0; --s2: #c8693f; --s3: #2f9c76; --s4: #c79a2e;
  --s5: #b0628f; --s6: #5a8233; --s7: #6c62b5; --s8: #b94a4a;
  /* Estados (siempre con texto e indicador) */
  --good: #0ca30c; --good-text: #2f6b2f; --warning: #e0a52a; --serious: #d9784f; --critical: #c23b3b;

  --serif: "Instrument Serif", Georgia, "Times New Roman", serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(34,33,31,.04), 0 4px 16px rgba(34,33,31,.05);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 84px; scroll-behavior: smooth; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--sans); font-size: 1rem; line-height: 1.6; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
code { font-size: .88em; background: var(--panel); padding: 1px 5px; border-radius: 4px; }

.wrap { max-width: 1180px; margin: 0 auto; padding-left: 28px; padding-right: 28px; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 12px; top: 12px; z-index: 50; background: var(--surface); padding: 6px 10px; border: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; border-radius: 4px; }

.label, .kicker, .btn, .site-header nav a, .chip, .tag { font-family: var(--sans); text-transform: uppercase; letter-spacing: .11em; }
.label { font-size: .72rem; font-weight: 500; color: var(--muted); }
.kicker { font-size: .7rem; font-weight: 600; color: var(--muted); }
.muted { color: var(--muted); }
.small { font-size: .86rem; }

/* ── Aviso ─────────────────────────────────────────────── */
.notice { background: #2a2826; color: #ecebe8; font-size: .86rem; line-height: 1.45; }
.notice .wrap { display: flex; align-items: flex-start; gap: 14px; padding-top: 10px; padding-bottom: 10px; }
.notice p { flex: 1; }
.notice a { color: #fff; text-underline-offset: 2px; }
.notice strong { color: #fff; font-weight: 600; }
.notice-close { flex: none; width: 30px; height: 30px; border-radius: 999px; border: 1px solid rgba(255,255,255,.25); background: transparent; color: #fff; cursor: pointer; font-size: 1.1rem; line-height: 1; }
.notice-close:hover { background: rgba(255,255,255,.1); }
.notice.is-hidden { display: none; }

/* ── Botones y controles ───────────────────────────────── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 18px; border-radius: 999px; font-size: .7rem; font-weight: 600; cursor: pointer; text-decoration: none; border: 1px solid transparent; background: none; transition: background-color .2s, border-color .2s, color .2s, transform .2s; }
.btn:active { transform: translateY(1px); }
.btn-dark { background: var(--accent); color: #fff; }
.btn-dark:hover { background: #1f1d1b; }
.btn-outline { border-color: var(--line-strong); background: var(--surface); }
.btn-outline:hover { border-color: var(--text); }
.btn-sm { height: 30px; padding: 0 12px; font-size: .64rem; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 999px; overflow: hidden; background: var(--surface); flex-wrap: wrap; }
.seg button { font-size: .78rem; padding: 6px 13px; border: 0; background: transparent; cursor: pointer; transition: background-color .2s, color .2s; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: #fff; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font-size: .64rem; font-weight: 600; padding: 6px 11px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; transition: all .2s; }
.chip[aria-pressed="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }

.stepper { display: inline-flex; align-items: stretch; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.stepper button { width: 34px; border: 0; background: var(--panel); cursor: pointer; font-size: 1.05rem; line-height: 1; transition: background-color .15s; }
.stepper button:hover { background: var(--panel-2); }
.stepper input { width: 92px; border: 0; text-align: center; padding: 6px 4px; font-variant-numeric: tabular-nums; background: transparent; -moz-appearance: textfield; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

input[type="range"] { width: 100%; accent-color: var(--accent); margin: 6px 0 0; }
select { width: 100%; padding: 7px 9px; border: 1px solid var(--line-strong); border-radius: 8px; background: var(--surface); font-size: .9rem; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > label, .field > .flabel { display: flex; justify-content: space-between; gap: 8px; font-size: .82rem; font-weight: 500; color: var(--text-2); }
.field output { font-variant-numeric: tabular-nums; font-weight: 600; color: var(--text); }
.field .hint { font-size: .72rem; color: var(--faint); line-height: 1.35; }
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: .86rem; cursor: pointer; }
.switch input { accent-color: var(--accent); width: 16px; height: 16px; }

/* ── Encabezado ────────────────────────────────────────── */
.site-header { position: sticky; top: 0; z-index: 20; background: rgba(247,247,246,.9); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 20px; height: 62px; }
.brand { font-family: var(--serif); font-size: 1.45rem; line-height: 1; text-decoration: none; white-space: nowrap; }
.brand em { color: var(--accent-soft); }
.site-header nav { display: flex; align-items: center; gap: 18px; overflow-x: auto; scrollbar-width: none; }
.site-header nav::-webkit-scrollbar { display: none; }
.site-header nav a { font-size: .64rem; font-weight: 600; text-decoration: none; color: var(--muted); white-space: nowrap; padding: 4px 0; border-bottom: 2px solid transparent; transition: color .2s, border-color .2s; }
.site-header nav a:hover, .site-header nav a[aria-current="true"] { color: var(--text); border-color: var(--text); }
.progress { position: absolute; left: 0; bottom: -1px; height: 2px; width: 0; background: var(--text); transition: width .1s linear; }

/* ── Portada ───────────────────────────────────────────── */
.hero { padding: 72px 0 36px; background: linear-gradient(180deg, #efeeec 0%, var(--bg) 100%); }
.hero h1 { margin-top: 16px; max-width: 980px; font-family: var(--serif); font-size: clamp(2.3rem, 5.2vw, 4.2rem); line-height: 1.04; letter-spacing: -.01em; }
.hero h1 em { font-style: italic; color: var(--accent-soft); }
.hero .abstract { margin-top: 22px; max-width: 720px; color: var(--text-2); font-size: 1.08rem; }
.ai-note { display: inline-flex; align-items: center; gap: 10px; margin-top: 18px; font-size: .82rem; color: var(--muted); background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 6px 14px 6px 8px; }
.ai-note .dot { width: 22px; height: 22px; border-radius: 50%; background: var(--panel); display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--text-2); }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }

.kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-top: 40px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 16px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); }
.kpi .k-label { font-size: .78rem; color: var(--muted); line-height: 1.35; }
.kpi .k-value { font-size: 1.85rem; font-weight: 600; letter-spacing: -.02em; line-height: 1.15; }
.kpi .k-note { font-size: .74rem; color: var(--faint); line-height: 1.4; }
.kpi .k-note a { color: var(--faint); }
.kpi.is-alert .k-value { color: #9d2f2f; }

/* ── Secciones ─────────────────────────────────────────── */
.section { padding-top: 84px; }
.section-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; margin-bottom: 22px; }
.section h2 { margin-top: 8px; font-family: var(--serif); font-size: clamp(2rem, 3.8vw, 2.8rem); line-height: 1.06; max-width: 860px; }
.lede { max-width: 720px; color: var(--text-2); font-size: 1.04rem; margin-top: 10px; }
.prose { max-width: 760px; color: var(--text-2); }
.prose p, .prose ul, .prose ol { margin: 0 0 1em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin: .3em 0; }
.prose h3 { font-family: var(--serif); font-size: 1.55rem; line-height: 1.15; margin: 1.6em 0 .5em; color: var(--text); }
.prose a, .link { color: var(--link); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.prose strong { color: var(--text); font-weight: 600; }

.cite { white-space: nowrap; font-size: .8em; color: var(--faint) !important; text-decoration: none !important; }
.cite::before { content: "["; } .cite::after { content: "]"; }
.cite:hover { color: var(--link) !important; }

/* Bloques plegables con el detalle (menos texto a la vista) */
details.more { margin-top: 14px; border-top: 1px solid var(--line); }
details.more > summary { cursor: pointer; list-style: none; padding: 12px 0; font-size: .84rem; font-weight: 600; color: var(--text-2); display: flex; align-items: center; gap: 8px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::before { content: "+"; display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line-strong); font-weight: 500; transition: transform .25s; }
details.more[open] > summary::before { content: "−"; }
details.more > div { padding: 4px 0 18px; animation: fadeUp .35s ease both; }

/* ── Tarjetas de figura ───────────────────────────────── */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.figure { margin: 18px 0 0; padding: 20px 20px 14px; }
.figure-head { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 10px 20px; margin-bottom: 10px; }
.figure-title { font-weight: 600; font-size: 1.02rem; line-height: 1.35; max-width: 720px; }
.figure-title .fig-n { color: var(--faint); font-weight: 600; margin-right: 6px; }
.figure-sub { color: var(--muted); font-size: .86rem; margin-top: 3px; max-width: 720px; }
.chart { width: 100%; height: 420px; overflow: hidden; }
.chart-tall { height: 540px; }
.chart-short { height: 320px; }
.figure-foot { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 8px 20px; margin-top: 8px; padding-top: 10px; border-top: 1px solid var(--line); }
.figure-source { font-size: .76rem; color: var(--faint); max-width: 820px; line-height: 1.5; }
.figure-source a { color: var(--muted); }
.figure-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.figure details { margin-top: 8px; }
.figure details > summary { cursor: pointer; font-size: .76rem; color: var(--muted); list-style: none; display: inline-block; }
.figure details > summary::-webkit-details-marker { display: none; }
.figure details > summary::before { content: "▸ "; }
.figure details[open] > summary::before { content: "▾ "; }
.table-scroll { overflow: auto; max-height: 420px; margin-top: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }

/* ── Termómetro y riesgos ─────────────────────────────── */
.thermo-wrap { display: grid; grid-template-columns: 1.05fr 1fr; gap: 16px; align-items: stretch; }
.gauge-card { padding: 22px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.gauge { width: 100%; max-width: 380px; }
.gauge .needle { transform-origin: 160px 160px; transition: transform 1.4s cubic-bezier(.2,.8,.2,1); }
.gauge-value { font-size: 2.2rem; font-weight: 600; letter-spacing: -.02em; margin-top: -6px; }
.gauge-label { font-size: .86rem; color: var(--muted); max-width: 320px; }
.meters { display: grid; gap: 10px; }
.meter { padding: 14px 16px; }
.meter-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.meter-name { font-weight: 600; font-size: .92rem; }
.meter-track { position: relative; height: 10px; border-radius: 999px; margin: 10px 0 6px; background: linear-gradient(90deg, #cfe3cf 0%, #f1e2b5 40%, #f0c9b5 70%, #eab0b0 100%); }
.meter-fill { position: absolute; top: -3px; width: 4px; height: 16px; border-radius: 2px; background: var(--text); left: 0; transition: left 1.2s cubic-bezier(.2,.8,.2,1); }
.meter p { font-size: .8rem; color: var(--muted); line-height: 1.4; }

.risk-toolbar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin: 26px 0 12px; }
.risks { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.risk { padding: 16px 16px 14px; display: flex; flex-direction: column; gap: 8px; transition: transform .25s, box-shadow .25s, opacity .3s; }
.risk:hover { transform: translateY(-2px); box-shadow: 0 2px 4px rgba(0,0,0,.04), 0 10px 24px rgba(0,0,0,.07); }
.risk[hidden] { display: none; }
.risk-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.risk h3 { font-family: var(--sans); font-weight: 600; font-size: .95rem; line-height: 1.3; }
.risk-prob { font-size: 1.7rem; font-weight: 600; letter-spacing: -.02em; line-height: 1; white-space: nowrap; }
.risk-bar { height: 6px; background: var(--panel); border-radius: 999px; overflow: hidden; }
.risk-bar i { display: block; height: 100%; width: 0; border-radius: 999px; transition: width 1.1s cubic-bezier(.2,.8,.2,1); }
.risk p { font-size: .8rem; color: var(--muted); line-height: 1.45; }
.tag { display: inline-block; font-size: .58rem; font-weight: 700; padding: 3px 7px; border-radius: 999px; background: var(--panel); color: var(--text-2); }
.tag-model { background: #e3ebf5; color: #2f4f75; }
.tag-judg { background: #f1ebe2; color: #6a5536; }

/* Estado con indicador + texto */
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: .8rem; white-space: nowrap; }
.status::before { content: ""; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.status-good::before { background: var(--good); } .status-good { color: var(--good-text); }
.status-warning::before { background: var(--warning); } .status-warning { color: #7a5600; }
.status-serious::before { background: var(--serious); } .status-serious { color: #8f4524; }
.status-critical::before { background: var(--critical); } .status-critical { color: #9d2f2f; }

/* Bloque de énfasis (colapso) */
.alert-band { margin-top: 18px; padding: 22px 24px; border-radius: var(--radius); background: #2a2826; color: #eceae6; }
.alert-band h3 { font-family: var(--serif); font-size: 1.6rem; color: #fff; margin-bottom: 8px; }
.alert-band ul { margin: 8px 0 0; padding-left: 1.1em; }
.alert-band li { margin: 6px 0; }
.alert-band strong { color: #fff; }

/* ── Controles de escenario ──────────────────────────── */
.controls { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px 20px; padding: 18px 20px; margin: 16px 0 4px; }
.controls-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; grid-column: 1 / -1; padding-top: 6px; border-top: 1px solid var(--line); }
.is-busy { opacity: .55; transition: opacity .2s; }

/* ── Calculadora ─────────────────────────────────────── */
.tabs { display: inline-flex; gap: 4px; padding: 4px; background: var(--panel); border-radius: 999px; margin-bottom: 14px; flex-wrap: wrap; }
.tabs button { border: 0; background: transparent; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-size: .86rem; font-weight: 600; color: var(--muted); transition: all .2s; }
.tabs button[aria-selected="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.calc { display: grid; grid-template-columns: 340px 1fr; gap: 16px; }
.calc-form { padding: 18px; display: flex; flex-direction: column; gap: 14px; align-self: start; }
.calc-results { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.outcomes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.outcome { padding: 14px 16px; }
.outcome .o-label { font-size: .7rem; color: var(--muted); text-transform: uppercase; letter-spacing: .09em; font-weight: 600; }
.outcome .o-value { font-size: 1.6rem; font-weight: 600; letter-spacing: -.02em; margin-top: 4px; }
.outcome .o-note { font-size: .74rem; color: var(--faint); }
.outcome.central { border-color: var(--text); }
.formula-live { padding: 14px 16px; overflow-x: auto; }
.formula-live .row { padding: 6px 0; border-bottom: 1px dashed var(--line); overflow-x: auto; }
.formula-live .row:last-child { border-bottom: 0; }
.formula-live .katex { font-size: 1em; }
.calc-disclaimer { font-size: .78rem; color: var(--text-2); background: #faf3e6; border: 1px solid #ecdcbc; border-radius: 8px; padding: 10px 12px; }
.calc-disclaimer a { color: var(--link); }
.flash { animation: flash .5s ease; }

/* ── Radar ───────────────────────────────────────────── */
.radar { display: grid; gap: 12px; }
.radar-item { padding: 16px 18px; display: grid; grid-template-columns: 120px 1fr; gap: 16px; }
.radar-date { font-size: .78rem; color: var(--muted); }
.radar-date strong { display: block; font-size: 1.05rem; color: var(--text); }
.radar-item h3 { font-family: var(--sans); font-weight: 600; font-size: 1rem; }
.radar-item blockquote { margin: 8px 0; padding: 8px 12px; border-left: 3px solid var(--line-strong); color: var(--text-2); font-size: .86rem; background: var(--panel); border-radius: 0 6px 6px 0; }
.radar-item ul { margin: 6px 0 0; padding-left: 1.1em; font-size: .86rem; color: var(--text-2); }
.radar-item details summary { cursor: pointer; color: var(--muted); margin-top: 6px; font-family: var(--sans); }
.radar-item[hidden] { display: none; }
.radar-links { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 8px; font-size: .78rem; }
.radar-links a { color: var(--link); }

/* Línea de tiempo */
.timeline { list-style: none; margin: 0; padding: 0; position: relative; }
.timeline::before { content: ""; position: absolute; left: 70px; top: 6px; bottom: 6px; width: 1px; background: var(--line-strong); }
.timeline li { display: grid; grid-template-columns: 62px 1fr; gap: 24px; padding: 8px 0; position: relative; font-size: .88rem; }
.timeline li::before { content: ""; position: absolute; left: 66px; top: 15px; width: 9px; height: 9px; border-radius: 50%; background: var(--surface); border: 2px solid var(--text-2); }
.timeline .t-year { font-weight: 600; text-align: right; font-variant-numeric: tabular-nums; }
.timeline .t-body { color: var(--text-2); }
.timeline .t-body a { color: var(--link); font-size: .8rem; }

/* Tablas */
table { border-collapse: collapse; width: 100%; font-size: .84rem; }
th, td { text-align: left; padding: 7px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-weight: 600; background: var(--panel); position: sticky; top: 0; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.data-table caption { caption-side: bottom; text-align: left; font-size: .76rem; color: var(--muted); padding: 8px; }

/* Fórmulas */
.eq { position: relative; margin: 1.1em 0; padding: 4px 56px; }
.eq .katex-display { margin: 0; overflow-x: auto; overflow-y: hidden; padding: 6px 0; }
.eq .eq-num { position: absolute; right: 0; top: 50%; transform: translateY(-50%); color: var(--faint); font-variant-numeric: tabular-nums; }
.katex { font-size: 1.05em; }
.where { font-size: .9rem; color: var(--text-2); }
.where dt { display: inline; font-weight: 500; } .where dd { display: inline; margin: 0; } .where div { margin: .2em 0; }

.callout { border-left: 3px solid var(--text-2); background: var(--surface); padding: 14px 18px; border-radius: 0 8px 8px 0; margin: 16px 0; font-size: .92rem; color: var(--text-2); }
.callout-title { font-weight: 600; margin-bottom: 4px; color: var(--text); }

/* Referencias */
.refs { padding: 0; margin: 0; list-style: none; columns: 2; column-gap: 32px; }
.refs li { break-inside: avoid; padding: 8px 0; border-bottom: 1px solid var(--line); font-size: .82rem; line-height: 1.45; }
.refs li:target { background: #fff4d6; }
.refs .ref-key { font-weight: 600; }
.refs a { color: var(--link); word-break: break-word; }
.refs .unofficial { color: #8f4524; font-size: .7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .08em; }

/* Pie */
.site-footer { margin-top: 84px; background: #ecebe8; color: var(--muted); font-size: .84rem; }
.site-footer .wrap { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px 40px; padding-top: 34px; padding-bottom: 40px; }
.site-footer a { color: var(--text-2); }
.site-footer p + p { margin-top: 8px; }

.not-found { padding: 18vh 28px; text-align: center; }
.not-found h1 { font-family: var(--serif); font-size: 3rem; }
.not-found p { margin-top: 12px; color: var(--muted); }
.not-found a { color: var(--link); }
.noscript { background: #fff4d6; padding: 12px 16px; border-radius: 8px; font-size: .9rem; margin-top: 16px; }

/* ── Animaciones discretas ───────────────────────────── */
.js .reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1); }
.js .reveal.is-visible { opacity: 1; transform: none; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes flash { 0% { background: #fff4d6; } 100% { background: transparent; } }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .gauge .needle, .meter-fill, .risk-bar i { transition: none; }
  details.more > div, .flash { animation: none; }
}

/* ── Responsive ──────────────────────────────────────── */
@media (max-width: 1040px) {
  .kpis { grid-template-columns: repeat(2, 1fr); }
  .risks { grid-template-columns: repeat(2, 1fr); }
  .calc { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
  .thermo-wrap, .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .refs { columns: 1; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .chart { height: 380px; }
  .chart-tall { height: 480px; }
  .radar-item { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 560px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 44px 0 24px; }
  .kpis { gap: 8px; }
  .kpi { padding: 13px; }
  .kpi .k-value { font-size: 1.35rem; }
  .risks { grid-template-columns: 1fr; }
  .outcomes { grid-template-columns: 1fr; }
  .figure { padding: 14px 12px 10px; }
  .chart { height: 340px; }
  .chart-tall { height: 440px; }
  .chart-short { height: 290px; }
  .section { padding-top: 60px; }
  .eq { padding: 0; }
  .eq .katex { font-size: .96em; }
  .eq .eq-num { position: static; display: block; transform: none; text-align: right; font-size: .82rem; margin-top: 2px; }
  .timeline::before { left: 48px; }
  .timeline li { grid-template-columns: 42px 1fr; gap: 20px; }
  .timeline li::before { left: 44px; }
  .site-header .wrap { height: 56px; }
  .brand { font-size: 1.25rem; }
}
@media print {
  .notice, .site-header, .controls, .figure-actions, .hero-actions, .risk-toolbar { display: none !important; }
  .reveal { opacity: 1; transform: none; }
}
