/* ===== Ventana de aceptación de los Términos de servicio (estilo Apple): lista de documentos, lectura dentro de la misma ventana y control de aceptación redondo ===== */
.trm-ov { position: fixed; inset: 0; z-index: 100060; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, .5); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); animation: cfmFade .16s ease-out; }
.trm-card, .trm-card * { box-sizing: border-box; }
.trm-card { width: min(500px, calc(96vw / var(--zv, 0.75))); max-height: calc((100vh - 32px) / var(--zv, 0.75)); display: flex; flex-direction: column; overflow: hidden; border-radius: 26px; background: var(--card, #fff); color: var(--ink, #0F172A); box-shadow: 0 0 0 .5px rgba(15, 23, 42, .1), 0 30px 80px rgba(15, 23, 42, .35); animation: trmIn .2s ease-out; }
.trm-card.leyendo { width: min(760px, calc(96vw / var(--zv, 0.75))); height: calc((100vh - 32px) / var(--zv, 0.75)); }
@keyframes trmIn { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
.trm-main { padding: 28px 26px 24px; display: flex; flex-direction: column; gap: 14px; }
.trm-main[hidden], .trm-read[hidden] { display: none; }
.trm-ico { width: 56px; height: 56px; border-radius: 16px; background: var(--blue-soft, #E0F2FE); color: var(--blue, #0284C7); display: grid; place-items: center; }
.trm-ico svg { width: 28px; height: 28px; }
.trm-card h4 { margin: 0; font-size: 1.45rem; line-height: 1.15; font-weight: 800; letter-spacing: -.02em; }
.trm-lead { margin: -6px 0 0; font-size: .95rem; line-height: 1.45; color: var(--muted, #5A6580); }
.trm-list { border: 1px solid var(--line, #E2E8F0); border-radius: 16px; overflow: hidden; }
.trm-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; margin: 0; padding: 10px 16px; border: 0; border-radius: 0; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: none; }
.trm-row + .trm-row { border-top: 1px solid var(--line, #E2E8F0); }
.trm-row:hover, .trm-row:focus-visible { background: var(--blue-soft, #F0F9FF); outline: 0; }
.trm-row-i { flex: none; width: 38px; height: 38px; border-radius: 11px; background: var(--blue-soft, #E0F2FE); color: var(--blue, #0284C7); display: grid; place-items: center; }
.trm-row-i svg { width: 20px; height: 20px; }
.trm-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.trm-row-t b { font-size: 1rem; font-weight: 700; }
.trm-row-t span { font-size: .8rem; color: var(--muted, #5A6580); }
.trm-row-c { flex: none; display: inline-flex; align-items: center; gap: 2px; font-size: .82rem; font-weight: 700; color: var(--blue, #0284C7); }
.trm-row-c svg { width: 18px; height: 18px; }
/* Control de aceptación: círculo grande que se llena de azul con la palomita (mismo lenguaje que el marcado de la planificación) */
.trm-acc { display: flex; align-items: flex-start; gap: 14px; width: 100%; min-height: 64px; margin: 0; padding: 14px 16px; border: 1.5px solid var(--line, #E2E8F0); border-radius: 16px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; box-shadow: none; transition: border-color .15s, background .15s; }
.trm-acc:hover { background: var(--blue-soft, #F0F9FF); border-color: var(--blue, #0284C7); }
:root[data-theme="dark"] .trm-acc:hover { background: rgba(56, 189, 248, .10); }
.trm-acc:focus-visible { outline: 2px solid var(--blue, #0284C7); outline-offset: 2px; }
.trm-acc.on { border-color: var(--blue, #0284C7); background: var(--blue-soft, #F0F9FF); }
.trm-box { flex: none; width: 30px; height: 30px; margin-top: 1px; border-radius: 50%; border: 2px solid #b8c3d6; background: var(--card, #fff); color: transparent; display: grid; place-items: center; transition: background .15s, border-color .15s, color .15s, transform .15s; }
.trm-box svg { width: 16px; height: 16px; }
.trm-acc.on .trm-box { background: var(--blue, #0284C7); border-color: var(--blue, #0284C7); color: #fff; transform: scale(1.04); }
.trm-acc-t { flex: 1; min-width: 0; font-size: .9rem; line-height: 1.45; font-weight: 600; }
.trm-err { margin: -4px 0 0; color: #dc2626; font-size: .85rem; font-weight: 600; }
.trm-acts { display: flex; gap: 10px; margin-top: 2px; }
.trm-acts button { flex: 1; min-height: 50px; margin: 0; padding: 0 18px; border-radius: 14px; font: inherit; font-size: 1rem; font-weight: 800; cursor: pointer; box-shadow: none; }
.trm-sec { flex: 0 0 auto !important; min-width: 110px; border: 1.5px solid var(--line, #E2E8F0); background: transparent; color: var(--ink, #0F172A); }
.trm-go { border: 0; background: var(--blue, #0284C7); color: #fff; }
.trm-go:disabled { background: #cbd5e1; color: #fff; cursor: not-allowed; }
/* Lectura dentro de la misma ventana */
.trm-read { flex: 1; min-height: 0; display: flex; flex-direction: column; }
.trm-rh { flex: none; display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--line, #E2E8F0); }
.trm-rh b { flex: 1; min-width: 0; font-size: 1rem; font-weight: 800; text-align: center; padding-right: 96px; }
.trm-back { flex: none; width: 96px; min-height: 44px; margin: 0; padding: 0 8px 0 4px; border: 0; background: transparent; color: var(--blue, #0284C7); font: inherit; font-size: .95rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: flex-start; gap: 2px; cursor: pointer; box-shadow: none; }
.trm-back svg { width: 20px; height: 20px; }
.trm-doc { flex: 1; min-height: 0; overflow-y: auto; padding: 18px 26px 26px; font-size: .95rem; line-height: 1.6; color: var(--ink, #0F172A); }
.trm-doc:focus { outline: 0; }
.trm-doc h1 { display: none; }
.trm-doc h2 { margin: 22px 0 8px; font-size: 1.1rem; font-weight: 800; }
.trm-doc p, .trm-doc li { margin: 0 0 10px; }
.trm-doc ol, .trm-doc ul { padding-left: 22px; margin: 0 0 12px; }
.trm-doc a { color: var(--blue, #0284C7); }
.trm-doc .version { color: var(--muted, #5A6580); font-size: .85rem; margin: 0 0 14px; }
.trm-doc .tabla { overflow-x: auto; margin: 8px 0 16px; }
.trm-doc table { border-collapse: collapse; width: 100%; font-size: .85rem; }
.trm-doc th, .trm-doc td { border: 1px solid var(--line, #E2E8F0); padding: 8px 10px; text-align: left; vertical-align: top; }
.trm-doc th { background: var(--blue-soft, #F1F5F9); }
.trm-estado { padding: 28px 0; text-align: center; color: var(--muted, #5A6580); }
@media (max-width: 620px) {
  .trm-ov { padding: 8px; align-items: flex-end; }
  .trm-card { width: 100%; border-radius: 24px; }
  .trm-main { padding: 22px 18px 18px; }
  .trm-card.leyendo { height: calc((100vh - 16px) / var(--zv, 1)); }
  .trm-doc { padding: 14px 18px 22px; }
  .trm-row-c span { display: none; }
}
@media (prefers-reduced-motion: reduce) { .trm-card, .trm-ov { animation: none; } }
html[data-theme="dark"] .trm-card { background: var(--card, #1c1c1e); color: #F5F5F7; box-shadow: 0 0 0 .5px rgba(255, 255, 255, .12), 0 30px 80px rgba(0, 0, 0, .6); }
html[data-theme="dark"] .trm-doc, html[data-theme="dark"] .trm-sec { color: #F5F5F7; }
html[data-theme="dark"] .trm-box { background: transparent; border-color: #636366; }
html[data-theme="dark"] .trm-go:disabled { background: #3a3a3c; color: #8e8e93; }

/* Reglas globales de botones: texto en una línea y alto fijo; aquí el texto se parte en líneas */
.trm-card .trm-row, .trm-card .trm-acc { white-space: normal; overflow: visible; height: auto; line-height: 1.4; }
.trm-card .trm-row-t, .trm-card .trm-row-t span, .trm-card .trm-acc-t { white-space: normal; overflow-wrap: anywhere; }
.trm-card .trm-row-c { white-space: nowrap; }
@media (max-width: 620px) {
  .trm-back { width: 84px; }
  .trm-rh b { font-size: .92rem; padding-right: 84px; }
}

/* Resumen «En pocas palabras» */
.trm-main { overflow-y: auto; min-height: 0; }
.trm-sum { border-radius: 16px; background: var(--soft, #F1F5F9); padding: 14px 16px 12px; }
.trm-sum-h { font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--blue, #0284C7); margin-bottom: 8px; }
.trm-sum ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.trm-sum li { font-size: .86rem; line-height: 1.45; color: var(--muted, #475569); }
.trm-sum li b { color: var(--ink, #0F172A); font-weight: 700; }
.trm-sum-n { margin: 10px 0 0; font-size: .78rem; color: var(--muted, #5A6580); }
html[data-theme="dark"] .trm-sum { background: rgba(255, 255, 255, .06); }
html[data-theme="dark"] .trm-sum li b { color: #F5F5F7; }
.trm-card .trm-sum li { padding: 0; margin: 0; }
.trm-card .trm-sum li::before, .trm-card .trm-sum li::marker { content: none; }
/* Botones siempre visibles abajo, aunque el contenido se desplace (pantallas bajas y celular) */
.trm-acts { position: sticky; bottom: -24px; margin: 2px -26px -24px; padding: 12px 26px 24px; background: var(--card, #fff); box-shadow: 0 -10px 14px -10px rgba(15, 23, 42, .12); }
html[data-theme="dark"] .trm-acts { background: var(--card, #1c1c1e); }
@media (max-width: 620px) { .trm-acts { bottom: -18px; margin: 2px -18px -18px; padding: 12px 18px 18px; } }

/* Versión ancha y compacta: resumen a dos columnas y los textos reducidos a dos enlaces junto a la casilla */
.trm-card { width: min(780px, calc(96vw / var(--zv, 0.75))); }
.trm-card.leyendo { width: min(780px, calc(96vw / var(--zv, 0.75))); }
.trm-main { padding: 24px 28px 22px; gap: 14px; }
.trm-hd { display: flex; align-items: center; gap: 16px; }
.trm-hd .trm-ico { flex: none; }
.trm-hdt { min-width: 0; }
.trm-hdt .trm-lead { margin: 4px 0 0; }
.trm-card .trm-sum { padding: 16px 20px 14px; }
.trm-card .trm-sum ul { grid-template-columns: 1fr 1fr; gap: 12px 26px; }
.trm-card .trm-sum li { font-size: .95rem; line-height: 1.45; }
.trm-card .trm-sum li:last-child:nth-child(odd) { grid-column: 1 / -1; }
.trm-docs { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.trm-card .trm-chip { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; margin: 0; padding: 0 14px; border: 1px solid var(--line, #E2E8F0); border-radius: 14px; background: transparent; color: var(--ink, #0F172A); font: inherit; font-size: .9rem; font-weight: 700; text-align: left; white-space: normal; cursor: pointer; box-shadow: none; }
.trm-chip:hover, .trm-chip:focus-visible { background: var(--blue-soft, #F0F9FF); outline: 0; }
.trm-chip svg { flex: none; width: 18px; height: 18px; color: var(--blue, #0284C7); }
.trm-chip span { flex: 1; min-width: 0; }
.trm-chip svg:last-child { width: 16px; height: 16px; }
@media (max-width: 700px) {
  .trm-main { padding: 20px 18px 18px; }
  .trm-card .trm-sum ul, .trm-docs { grid-template-columns: 1fr; }
  .trm-hd { align-items: flex-start; gap: 12px; }
}
