/* =========================================================
   Fonemlab – Sitio público
   Fondo blanco + colores del logo:
   Azul "lab" #2161A9 · Celeste #20B8EA · Rojo #D23232 · Gris "Fonem" #444243
   ========================================================= */
:root {
  --white: #ffffff;
  --ink: #444243;
  --ink-strong: #2b2a2b;
  --muted: #6b6a6c;
  --line: #d5e3f1;
  --line-soft: #e8eff7;
  --brand: #2161a9;
  --brand-dark: #1b5190;
  --brand-soft: #eaf2fb;
  --cyan: #20b8ea;
  --cyan-ink: #0b7aa6;
  --cyan-soft: #e3f6fd;
  --red: #d23232;
  --red-dark: #b72a2a;
  --red-soft: #fce9e9;
  --stripe: linear-gradient(90deg, #2161a9 0 62%, #20b8ea 62% 86%, #d23232 86% 100%);
  --display: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  --body: "Source Sans 3", "Segoe UI", system-ui, sans-serif;
  --radius: 14px;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--white); color: var(--ink); font-family: var(--body); font-size: 17px; line-height: 1.6; }
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); }
h1, h2, h3, h4 { font-family: var(--display); line-height: 1.2; margin: 0; text-wrap: balance; color: var(--ink-strong); }
p { margin: 0 0 1em; }
.wrap { max-width: 1120px; margin: 0 auto; padding-inline: 20px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Encabezado ---------- */
.site-header { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--white); border-bottom: 1px solid var(--line); }
.site-header::before, .site-footer::before { content: ""; display: block; height: 5px; background: var(--stripe); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; }
.logo img { height: 54px; width: auto; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; padding: 8px 10px; border-radius: 8px; }
.nav a:hover { color: var(--brand); background: var(--brand-soft); }
.nav a.active { color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); border-radius: 0; }
.nav-toggle { display: none; background: none; border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; font: inherit; font-weight: 700; color: var(--brand); cursor: pointer; }

/* ---------- Botones ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; font-family: var(--display); font-weight: 700; font-size: .98rem; border: 0; border-radius: 10px; padding: 12px 20px; cursor: pointer; text-decoration: none; background: var(--brand); color: #fff; }
.btn:hover { background: var(--brand-dark); }
.btn-red { background: var(--red); }
.btn-red:hover { background: var(--red-dark); }
.btn-ghost { background: transparent; color: var(--brand); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--brand-soft); }
.link-more { font-family: var(--display); font-weight: 700; text-decoration: none; }
.link-more:hover { text-decoration: underline; }

/* ---------- Secciones y títulos ---------- */
section { padding-block: 64px; }
.page-head { padding-block: 48px 8px; }
.eyebrow { font-family: var(--display); font-size: .78rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--cyan-ink); display: inline-flex; align-items: center; gap: 18px; }
.eyebrow::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--red); box-shadow: 10px -4px 0 -1px var(--cyan); }
.section-title { font-size: clamp(1.6rem, 3vw, 2.2rem); font-weight: 800; color: var(--brand); margin-top: 6px; }
.section-title::after { content: ""; display: block; width: 56px; height: 4px; border-radius: 2px; margin-top: 12px; background: var(--stripe); }
.lead { color: var(--muted); max-width: 65ch; margin-top: 14px; }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 28px; }

/* ---------- Portada ---------- */
.hero { position: relative; overflow: hidden; isolation: isolate; padding-block: 56px 72px; }
.hero::after { content: ""; position: absolute; z-index: -1; width: 620px; height: 620px; right: -200px; top: -220px; border-radius: 50%; background: repeating-radial-gradient(circle, transparent 0 34px, rgba(32,184,234,.13) 34px 50px, transparent 50px 68px); }
.hero .wrap { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(2rem, 4.6vw, 3.2rem); font-weight: 800; letter-spacing: -.02em; margin-block: 12px 18px; color: var(--ink); }
.hero h1 span { color: var(--brand); }
.hero p { color: var(--muted); max-width: 60ch; }
.hero-actions { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; margin-top: 8px; }
.quote { background: var(--white); border: 2px solid var(--brand); border-radius: 16px; padding: 26px; box-shadow: 0 16px 36px -20px rgba(33,97,169,.45); min-width: 0; }
.quote .k { font-size: .85rem; color: var(--muted); }
.quote .big { font-family: var(--display); font-size: 2.3rem; font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; margin-block: 4px 14px; }
.quote dl { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; margin: 0; font-variant-numeric: tabular-nums; }
.quote dt { color: var(--muted); }
.quote dd { margin: 0; font-weight: 600; text-align: right; }

/* ---------- Beneficios ---------- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.benefit { background: var(--white); border: 1px solid #c9dbef; border-radius: var(--radius); padding: 22px; display: grid; grid-template-columns: 44px 1fr; gap: 14px; align-items: start; }
.benefit .ico { width: 44px; height: 44px; padding: 10px; border-radius: 12px; background: var(--brand-soft); color: var(--brand); }
.benefit .ico img { width: 24px; height: 24px; object-fit: cover; border-radius: 4px; }
.benefit:nth-child(3n+2) { border-color: #bfe9f8; }
.benefit:nth-child(3n+2) .ico { background: var(--cyan-soft); color: var(--cyan-ink); }
.benefit:nth-child(3n) { border-color: #f3cccc; }
.benefit:nth-child(3n) .ico { background: var(--red-soft); color: var(--red-dark); }
.benefit h3 { font-size: 1.05rem; color: var(--brand); margin-bottom: 4px; }
.benefit p { margin: 0; color: var(--muted); font-size: .96rem; }

/* ---------- Tablas ---------- */
.table-box { overflow-x: auto; border: 1px solid var(--brand); border-radius: var(--radius); background: var(--white); }
table { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
th, td { padding: 12px 16px; text-align: left; border-bottom: 1px solid var(--line-soft); white-space: nowrap; }
th { background: var(--brand); color: #fff; font-family: var(--display); font-size: .78rem; letter-spacing: .08em; text-transform: uppercase; }
tbody tr:last-child td { border-bottom: 0; }
.num { text-align: right; }
.lines tbody tr { cursor: pointer; }
.lines tbody tr:hover td { background: var(--brand-soft); }
.lines tbody tr.sel td { background: var(--cyan-soft); color: var(--brand); font-weight: 600; }
.lines tbody tr.sel td:first-child { box-shadow: inset 4px 0 0 var(--cyan); }
.rowbtn { background: none; border: 0; color: var(--brand); font: inherit; font-weight: 700; cursor: pointer; padding: 0; }

/* ---------- Simulador ---------- */
.sim { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: 24px; }
.panel { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: 26px; min-width: 0; }
.field { display: grid; gap: 6px; margin-bottom: 20px; }
label, .label { font-family: var(--display); font-weight: 700; font-size: .92rem; color: var(--ink-strong); }
input[type=text], input[type=email], input[type=tel], input[type=search], select, textarea {
  width: 100%; font: inherit; padding: 12px 14px; border: 1px solid #bcd2ea; border-radius: 10px; background: var(--white); color: var(--ink); }
textarea { min-height: 140px; resize: vertical; }
input[type=range] { width: 100%; accent-color: var(--red); }
.hint { font-size: .88rem; color: var(--muted); }
.plazo-row { display: flex; justify-content: space-between; align-items: baseline; }
.plazo-row output { font-family: var(--display); font-weight: 800; font-size: 1.3rem; color: var(--red); }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { font-size: .75rem; font-weight: 700; border: 1px solid #bcd2ea; background: var(--brand-soft); color: var(--brand); border-radius: 99px; padding: 3px 10px; text-decoration: none; }
.results { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.res { border: 1px solid var(--line); border-radius: 12px; padding: 16px; min-width: 0; }
.res .k { font-size: .88rem; color: var(--muted); }
.res .v { font-family: var(--display); font-weight: 800; font-size: 1.45rem; font-variant-numeric: tabular-nums; color: var(--ink-strong); }
.res.main { grid-column: 1 / -1; background: var(--brand); border-color: var(--brand); }
.res.main .k, .res.main .v { color: #fff; }
.res.main .v { font-size: 2.2rem; }
.note { margin-top: 16px; font-size: .92rem; color: var(--muted); border-left: 3px solid var(--red); padding-left: 12px; }
details { margin-top: 22px; }
summary { cursor: pointer; font-family: var(--display); font-weight: 700; color: var(--brand); }
.amort { max-height: 420px; overflow: auto; margin-top: 12px; }
.amort th { position: sticky; top: 0; }
.amort td, .amort th { padding: 9px 12px; font-size: .93rem; }

/* ---------- Tarjetas (noticias / actividades) ---------- */
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; min-width: 0; text-decoration: none; color: inherit; }
.card .band { height: 6px; background: var(--brand); }
.grid-3 > .card:nth-child(3n+2) .band { background: var(--cyan); }
.grid-3 > .card:nth-child(3n) .band { background: var(--red); }
.card .cover { aspect-ratio: 16 / 9; object-fit: cover; width: 100%; background: var(--brand-soft); }
.card .in { padding: 20px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.card h3 { font-size: 1.1rem; color: var(--brand); }
.card p { margin: 0; color: var(--muted); font-size: .96rem; flex: 1; }
.card:hover h3 { text-decoration: underline; }
.meta { font-size: .86rem; color: var(--muted); display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { font-size: .9rem; font-weight: 600; border: 1px solid #bcd2ea; background: var(--white); color: var(--brand); border-radius: 99px; padding: 6px 14px; text-decoration: none; }
.chip.on, .chip:hover { background: var(--brand); color: #fff; border-color: var(--brand); }
.empty { border: 2px dashed var(--line); border-radius: var(--radius); padding: 36px; text-align: center; color: var(--muted); }

/* ---------- Artículo ---------- */
.article { max-width: 780px; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); color: var(--brand); margin-block: 10px 14px; }
.article .cover { border-radius: var(--radius); margin-block: 24px; width: 100%; }
.prose { font-size: 1.05rem; }
.prose h2, .prose h3 { color: var(--brand); margin-block: 1.4em .5em; }
.prose img { border-radius: 10px; margin-block: 1em; }
.prose a { font-weight: 600; }
.back { display: inline-block; margin-bottom: 18px; font-weight: 700; text-decoration: none; }

/* ---------- Calendario ---------- */
.cal-layout { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 24px; align-items: start; }
.cal-nav { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.cal-nav h3 { color: var(--brand); text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--brand); border-radius: var(--radius); overflow: hidden; }
.cal-grid .dow { background: var(--brand); color: #fff; font-family: var(--display); font-size: .75rem; font-weight: 700; text-transform: uppercase; text-align: center; padding: 8px 2px; }
.cal-grid .day { min-height: 92px; border-top: 1px solid var(--line-soft); border-left: 1px solid var(--line-soft); padding: 6px; font-size: .85rem; min-width: 0; }
.cal-grid .day:nth-child(7n+1) { border-left: 0; }
.cal-grid .day.out { background: #fafcfe; color: #a9b3c0; }
.cal-grid .day.today .n { background: var(--red); color: #fff; border-radius: 99px; padding: 0 7px; }
.cal-grid .n { font-weight: 700; display: inline-block; }
.cal-grid .ev { display: block; margin-top: 4px; font-size: .78rem; line-height: 1.3; padding: 3px 6px; border-radius: 6px; background: var(--cyan-soft); color: var(--cyan-ink); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cal-grid .ev:hover { background: var(--brand); color: #fff; }
.agenda { display: grid; gap: 12px; }
.agenda-item { display: grid; grid-template-columns: 62px 1fr; gap: 14px; align-items: start; border: 1px solid var(--line); border-radius: 12px; padding: 12px; text-decoration: none; color: inherit; }
.agenda-item:hover { border-color: var(--brand); }
.date-box { text-align: center; border-radius: 10px; background: var(--brand); color: #fff; padding: 6px 4px; font-family: var(--display); }
.date-box .d { font-size: 1.4rem; font-weight: 800; line-height: 1; }
.date-box .m { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; }
.agenda-item h4 { color: var(--brand); font-size: 1rem; }

/* ---------- Documentos ---------- */
.doc-group { margin-bottom: 34px; }
.doc-group h3 { color: var(--brand); margin-bottom: 12px; font-size: 1.2rem; }
.doc { display: grid; grid-template-columns: 48px 1fr auto; gap: 14px; align-items: center; border: 1px solid var(--line); border-radius: 12px; padding: 14px 16px; margin-bottom: 10px; }
.doc .ext { width: 48px; height: 48px; border-radius: 10px; display: grid; place-items: center; font-family: var(--display); font-weight: 800; font-size: .75rem; background: var(--brand-soft); color: var(--brand); }
.doc .ext.pdf { background: var(--red-soft); color: var(--red-dark); }
.doc h4 { color: var(--ink-strong); font-size: 1rem; }
.doc .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.doc .actions a { font-size: .9rem; padding: 8px 14px; }
.search { display: flex; gap: 10px; max-width: 520px; }

/* ---------- Formularios ---------- */
.form-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 28px; align-items: start; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 18px; }
.form-grid .full { grid-column: 1 / -1; }
.check { display: flex; gap: 10px; align-items: flex-start; font-size: .92rem; color: var(--muted); }
.check input { margin-top: 5px; accent-color: var(--brand); width: 18px; height: 18px; flex: none; }
.error { color: var(--red-dark); font-size: .88rem; }
.alert { border-radius: 12px; padding: 16px 18px; margin-bottom: 22px; }
.alert-ok { background: var(--cyan-soft); border: 1px solid #9fdcf3; color: #0a5f82; }
.alert-err { background: var(--red-soft); border: 1px solid #f0b4b4; color: var(--red-dark); }
.hp { position: absolute; left: -9999px; }
.aside-box { border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; }
.aside-box h3 { color: var(--brand); font-size: 1.1rem; margin-bottom: 10px; }
.aside-box ul { margin: 0; padding-left: 18px; color: var(--muted); }

/* ---------- Próximamente ---------- */
.soon { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; border: 2px dashed var(--cyan); border-radius: 16px; padding: 28px; }
.soon h3 { color: var(--brand); margin-top: 10px; }
.soon p { margin: 6px 0 0; color: var(--muted); }

/* ---------- Pie ---------- */
.site-footer { margin-top: 32px; border-top: 1px solid var(--line); }
.site-footer .wrap { display: grid; grid-template-columns: 1.2fr 1fr 1fr; gap: 28px; padding-block: 36px; font-size: .95rem; }
.site-footer h4 { color: var(--brand); font-size: .95rem; margin-bottom: 8px; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.site-footer a { text-decoration: none; color: var(--ink); }
.site-footer a:hover { color: var(--brand); }
.site-footer .muted { color: var(--muted); }
.copy { border-top: 1px solid var(--line-soft); padding-block: 14px; font-size: .85rem; color: var(--muted); }

/* ---------- Paginación ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--line); border-radius: 8px; text-decoration: none; }
.pagination .on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .nav-toggle { display: inline-block; }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--line); flex-direction: column; align-items: stretch; padding: 10px 20px 18px; }
  .nav.open { display: flex; }
  .nav a.active { box-shadow: inset 3px 0 0 var(--brand); }
  .hero .wrap, .sim, .cal-layout, .form-layout { grid-template-columns: 1fr; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .site-footer .wrap { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 600px) {
  section { padding-block: 44px; }
  .grid-3, .results, .form-grid, .soon, .site-footer .wrap { grid-template-columns: 1fr; }
  .logo img { height: 44px; }
  .cal-grid .day { min-height: 64px; padding: 4px; }
  .cal-grid .ev { font-size: 0; padding: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--cyan); display: inline-block; margin-right: 2px; }
  .doc { grid-template-columns: 40px 1fr; }
  .doc .actions { grid-column: 1 / -1; }
}
.benefit .ico svg { width: 24px; height: 24px; }

/* ---------- Tabla de amortización (ancho completo) ---------- */
.amort-block { margin-top: 24px; border: 1px solid var(--line); border-radius: 16px; padding: 22px; }
.amort-head { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.amort-head h3 { color: var(--brand); font-size: 1.2rem; }
.amort-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.amort-block .amort { max-height: 560px; overflow: auto; margin-top: 18px; }
.amort-block table { min-width: 640px; }
.amort-block th { position: sticky; top: 0; z-index: 1; }
.amort-block td, .amort-block th { padding: 10px 16px; }
.amort-block tbody tr:nth-child(even) td { background: #f7fafd; }

/* ---------- Modal de actividad (calendario) ---------- */
html.modal-open { overflow: hidden; }
.ev-modal { padding: 0; border: 0; background: transparent; width: min(640px, calc(100% - 32px)); max-height: calc(100dvh - 48px); overflow: visible; color: var(--ink); }
.ev-modal::backdrop { background: rgba(19, 38, 66, .55); backdrop-filter: blur(4px); }
.ev-modal[open] { animation: evIn .22s cubic-bezier(.2, .8, .3, 1); }
.ev-modal[open]::backdrop { animation: evFade .22s ease; }
.ev-modal.closing { animation: evOut .16s ease forwards; }
.ev-modal.closing::backdrop { animation: evFadeOut .16s ease forwards; }
@keyframes evIn { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes evOut { to { opacity: 0; transform: translateY(10px) scale(.98); } }
@keyframes evFade { from { opacity: 0; } }
@keyframes evFadeOut { to { opacity: 0; } }

.ev-modal__card { position: relative; background: var(--white); border-radius: 20px; overflow: hidden; max-height: calc(100dvh - 48px); overflow-y: auto; box-shadow: 0 30px 80px -20px rgba(19, 38, 66, .55); }
.ev-modal__card::before { content: ""; display: block; height: 6px; background: var(--stripe); }
.ev-modal__close { position: absolute; top: 16px; right: 16px; z-index: 2; width: 38px; height: 38px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .92); color: var(--ink-strong); cursor: pointer; box-shadow: 0 2px 10px rgba(0, 0, 0, .12); }
.ev-modal__close:hover { background: var(--brand-soft); color: var(--brand); }
.ev-modal__image { width: 100%; max-height: 260px; object-fit: cover; }
.ev-modal__body { padding: 26px 28px 28px; }
.ev-modal__head { display: grid; grid-template-columns: 76px 1fr; gap: 18px; align-items: start; padding-right: 36px; }
.ev-modal__date { display: grid; text-align: center; border-radius: 14px; overflow: hidden; border: 1px solid var(--brand); font-family: var(--display); }
.ev-modal__date .m { background: var(--brand); color: #fff; font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; padding: 4px 0; }
.ev-modal__date .d { font-size: 2rem; font-weight: 800; color: var(--brand); line-height: 1.1; padding-top: 4px; }
.ev-modal__date .w { font-size: .7rem; color: var(--muted); padding-bottom: 6px; text-transform: capitalize; }
.ev-modal__tags { display: flex; gap: 6px; flex-wrap: wrap; min-height: 4px; margin-bottom: 6px; }
.pill-muted { background: #f1f3f6; color: var(--muted); border-color: var(--line); }
.ev-modal__title { font-size: clamp(1.3rem, 3vw, 1.7rem); font-weight: 800; color: var(--ink-strong); }
.ev-modal__info { list-style: none; margin: 22px 0 0; padding: 16px 18px; display: grid; gap: 10px; background: #f7fafd; border: 1px solid var(--line-soft); border-radius: 14px; }
.ev-modal__info li { display: grid; grid-template-columns: 22px 1fr; gap: 12px; align-items: start; }
.ev-modal__info li[hidden] { display: none; }
.ev-modal__info svg { width: 22px; height: 22px; fill: none; stroke: var(--brand); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ev-modal__info li:nth-child(2) svg { stroke: var(--cyan-ink); }
.ev-modal__info li:nth-child(3) svg { stroke: var(--red); }
.ev-modal__desc { margin: 20px 0 0; white-space: pre-line; color: var(--ink); }
.ev-modal__actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line-soft); }
.cal-grid .ev, .agenda-item { cursor: pointer; }

@media (max-width: 600px) {
  .ev-modal { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 92dvh; }
  .ev-modal__card { border-radius: 20px 20px 0 0; max-height: 92dvh; }
  .ev-modal[open] { animation: evUp .25s cubic-bezier(.2, .8, .3, 1); }
  @keyframes evUp { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
  .ev-modal__body { padding: 22px 20px 24px; }
  .ev-modal__head { grid-template-columns: 64px 1fr; gap: 14px; }
  .ev-modal__actions .btn { flex: 1; justify-content: center; }
}
@media (prefers-reduced-motion: reduce) {
  .ev-modal[open], .ev-modal[open]::backdrop, .ev-modal.closing, .ev-modal.closing::backdrop { animation: none; }
}

/* ---------- Modal de noticia (más ancho para contenidos largos) ---------- */
.post-modal { padding: 0; border: 0; background: transparent; width: min(980px, calc(100% - 32px)); max-height: calc(100dvh - 40px); overflow: visible; color: var(--ink); }
.post-modal::backdrop { background: rgba(19, 38, 66, .6); backdrop-filter: blur(4px); }
.post-modal[open] { animation: evIn .24s cubic-bezier(.2, .8, .3, 1); }
.post-modal[open]::backdrop { animation: evFade .24s ease; }
.post-modal.closing { animation: evOut .16s ease forwards; }
.post-modal.closing::backdrop { animation: evFadeOut .16s ease forwards; }
.post-modal__card { position: relative; display: flex; flex-direction: column; background: var(--white); border-radius: 20px; overflow: hidden; height: min(860px, calc(100dvh - 40px)); box-shadow: 0 30px 80px -20px rgba(19, 38, 66, .55); }
.post-modal__card::before { content: ""; display: block; height: 6px; background: var(--stripe); flex: none; }
.post-modal__bar { flex: none; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px 10px 20px; border-bottom: 1px solid var(--line-soft); background: var(--white); }
.post-modal__copy { padding: 8px 14px; font-size: .88rem; }
.post-modal__close { position: static; box-shadow: none; background: #f1f4f8; }
.post-modal__scroll { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.post-modal__cover { width: 100%; max-height: 420px; object-fit: cover; }
.post-modal__content { max-width: 760px; margin: 0 auto; padding: 32px 36px 48px; }
.post-modal__title { font-size: clamp(1.6rem, 3.4vw, 2.4rem); font-weight: 800; color: var(--brand); margin: 12px 0 14px; }
.post-modal__lead { font-size: 1.15rem; color: var(--muted); margin-bottom: 24px; padding-bottom: 22px; border-bottom: 1px solid var(--line-soft); }
.post-modal .prose { font-size: 1.06rem; line-height: 1.75; }
.post-modal .prose img { max-width: 100%; height: auto; }
.post-modal .prose table { display: block; overflow-x: auto; }

/* Esqueleto de carga */
.sk { background: linear-gradient(90deg, #eef3f9 0%, #f8fbfe 50%, #eef3f9 100%); background-size: 200% 100%; animation: skShine 1.2s ease-in-out infinite; border-radius: 8px; }
.sk-cover { height: 260px; border-radius: 0; }
.sk-title { height: 34px; width: 80%; margin: 16px 0 22px; }
.sk-line { height: 14px; width: 100%; margin-bottom: 12px; }
@keyframes skShine { to { background-position: -200% 0; } }

@media (max-width: 600px) {
  .post-modal { width: 100%; max-width: 100%; margin: auto 0 0; max-height: 96dvh; }
  .post-modal__card { height: 96dvh; border-radius: 20px 20px 0 0; }
  .post-modal[open] { animation: evUp .25s cubic-bezier(.2, .8, .3, 1); }
  .post-modal__content { padding: 22px 20px 36px; }
  .post-modal__cover { max-height: 240px; }
}
@media (prefers-reduced-motion: reduce) {
  .post-modal[open], .post-modal[open]::backdrop, .post-modal.closing, .post-modal.closing::backdrop, .sk { animation: none; }
}
