/* =====================================================================
   Memoria interactiva AFP Capital · línea visual Sustainalab
   (paleta, tipografías y barra superior de sustainalab.cl y de las
   plataformas Memoria Integrada CMF y Debida Diligencia DDHH)
   ===================================================================== */
:root {
  --bg: #EEF1F4; --panel: #FFFFFF; --surface-2: #F6F9FB;
  --ink: #0E1E2E; --ink-2: #42525F; --muted: #6F7D89; --borde: #DCE2E8;
  --accent: #FF6D66; --accent-soft: #FFF0EF; --teal: #0E8FA3; --teal-soft: #D9EEF2;
  --navy: #284170; --navy-soft: #E4E9F2; --orange: #F26921;
  --ok: #2E9E6B; --ok-soft: #DEF3E9; --warn: #C9871F; --warn-soft: #FBEFD6;
  --shadow: 0 1px 2px rgba(14,30,46,.06), 0 8px 24px rgba(14,30,46,.06);
  --shadow-lg: 0 18px 50px rgba(14,30,46,.18);
  --radio: 14px;
  --fs-display: 'Space Grotesk', ui-sans-serif, system-ui, sans-serif;
  --fs-body: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  --perfil: #FF6D66;
  color-scheme: light;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: var(--fs-body); background: var(--bg); color: var(--ink); font-size: 14.5px; line-height: 1.55; -webkit-font-smoothing: antialiased; overflow-x: hidden; }
h1, h2, h3, h4 { font-family: var(--fs-display); font-weight: 600; letter-spacing: -.015em; text-wrap: balance; margin: 0; }
p { margin: 0; }
a { color: var(--teal); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.ico { width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Barra superior (estilo sustainalab.cl) ---------- */
.sitebar { position: sticky; top: 0; z-index: 40; background: var(--ink); color: #fff; box-shadow: 0 2px 10px rgba(0,0,0,.15); }
.sitebar .in { max-width: 1180px; margin: 0 auto; padding: 0 20px; min-height: 64px; display: flex; align-items: center; gap: 18px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; min-width: 0; }
.brand-mark { width: 36px; height: 36px; border-radius: 10px; background: linear-gradient(135deg, var(--accent), var(--orange)); display: grid; place-items: center; font: 700 13px var(--fs-display); color: #fff; flex: none; }
.brand b { display: block; font: 600 15px var(--fs-display); line-height: 1.15; }
.brand small { display: block; font-size: 11px; color: #9FB0BF; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.nav { display: flex; gap: 22px; margin-left: auto; }
.nav a { color: #fff; text-decoration: none; font: 600 12.5px var(--fs-display); letter-spacing: .39px; text-transform: uppercase; padding: 6px 0; border-bottom: 2px solid transparent; transition: color .15s, border-color .15s; }
.nav a:hover { color: var(--accent); }
.nav a.activo { border-bottom-color: var(--accent); }
.perfil-chip { display: inline-flex; align-items: center; gap: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.18); color: #fff; padding: 6px 12px 6px 6px; border-radius: 99px; cursor: pointer; font: 600 12.5px var(--fs-display); white-space: nowrap; }
.perfil-chip:hover { border-color: var(--accent); }
.perfil-chip .av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--perfil); }
.perfil-chip .av .ico { width: 15px; height: 15px; }
.menu-btn { display: none; background: none; border: 0; color: #fff; padding: 6px; cursor: pointer; }
@media (max-width: 960px) {
  .menu-btn { display: inline-flex; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; background: var(--ink); flex-direction: column; gap: 0; padding: 4px 20px 14px; display: none; border-top: 1px solid rgba(255,255,255,.08); }
  .sitebar.open .nav { display: flex; }
  .nav a { padding: 12px 0; }
  .perfil-chip { margin-left: auto; }
  .perfil-chip .txt { display: none; }
  .perfil-chip { padding: 5px; }
}
@media (max-width: 520px) { .brand small { display: none; } }

/* ---------- Botones y elementos base ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--borde); background: #fff; color: var(--ink); padding: 10px 18px; border-radius: 10px; font: 600 13.5px var(--fs-display); cursor: pointer; text-decoration: none; transition: transform .15s, border-color .15s, background .15s, color .15s; }
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: #ff5a52; }
.btn.dark { background: var(--ink); border-color: var(--ink); color: #fff; }
.btn.ghost-light { background: transparent; border-color: rgba(255,255,255,.35); color: #fff; }
.btn.ghost-light:hover { border-color: #fff; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }
.eyebrow { font: 700 11px var(--fs-display); letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.eyebrow.light { color: #FFB3AE; }
.muted { color: var(--muted); }
.fuente { font-size: 11.5px; color: var(--muted); }
.tag { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 99px; font: 600 11px var(--fs-display); background: var(--surface-2); color: var(--ink-2); border: 1px solid var(--borde); white-space: nowrap; }
.tag.clave { background: var(--accent-soft); color: #c2423b; border-color: #ffd4d1; }
.tag.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.section { padding: 40px 0; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.section-head h2 { font-size: 26px; margin-top: 4px; }
.section-head p { color: var(--ink-2); max-width: 640px; margin-top: 6px; }
.card { background: var(--panel); border: 1px solid var(--borde); border-radius: var(--radio); box-shadow: var(--shadow); }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; color: #fff; background: radial-gradient(circle at 88% 12%, rgba(255,109,102,.35), transparent 42%), radial-gradient(circle at 8% 95%, rgba(14,143,163,.35), transparent 40%), linear-gradient(135deg, var(--ink) 0%, var(--navy) 100%); }
.hero .wrap { position: relative; display: grid; grid-template-columns: 1.15fr .85fr; gap: 30px; align-items: center; padding-top: 54px; padding-bottom: 64px; }
.hero h1 { font-size: clamp(32px, 4.6vw, 52px); line-height: 1.05; margin: 12px 0 16px; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero p.lead { font-size: 16.5px; color: #C9D5E0; max-width: 560px; }
.hero .acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 26px; }
.hero-art { width: 100%; max-width: 420px; justify-self: end; }
.hero-art svg { width: 100%; height: auto; display: block; }
@media (max-width: 860px) { .hero .wrap { grid-template-columns: 1fr; padding-top: 36px; padding-bottom: 44px; } .hero-art { max-width: 300px; justify-self: center; order: -1; } }

/* ---------- Selector de perfil ---------- */
.perfiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 14px; }
.perfil-card { --c: var(--accent); text-align: left; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; cursor: pointer; display: grid; grid-template-columns: 52px 1fr; gap: 4px 14px; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s, border-color .18s; position: relative; overflow: hidden; }
.perfil-card::after { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--c); }
.perfil-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--c); }
.perfil-card .pic { grid-row: span 2; width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: color-mix(in srgb, var(--c) 14%, #fff); color: var(--c); }
.perfil-card .pic .ico { width: 26px; height: 26px; }
.perfil-card b { font: 600 16px var(--fs-display); }
.perfil-card span { color: var(--ink-2); font-size: 13px; }
.perfil-card.todo { --c: var(--ink); background: var(--surface-2); text-decoration: none; color: inherit; }

/* ---------- KPIs ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 16px 16px 14px 18px; position: relative; overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; }
.kpi::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--kc, var(--navy)); }
.kpi .v { font: 700 27px var(--fs-display); line-height: 1.1; font-variant-numeric: tabular-nums; color: var(--ink); }
.kpi .l { font: 600 12.5px var(--fs-display); color: var(--ink-2); }
.kpi .d { font-size: 12px; color: var(--muted); }
.kpi .f { font-size: 10.5px; color: #98A5B1; margin-top: auto; padding-top: 4px; }
.kpis.dark .kpi { background: rgba(255,255,255,.06); border-color: rgba(255,255,255,.12); box-shadow: none; }
.kpis.dark .kpi .v { color: #fff; } .kpis.dark .kpi .l { color: #DCE6EE; } .kpis.dark .kpi .d { color: #9FB0BF; } .kpis.dark .kpi .f { color: #7F92A3; }
a.kpi { text-decoration: none; transition: transform .15s; } a.kpi:hover { transform: translateY(-2px); }

/* ---------- Hitos (carrusel) ---------- */
.carrusel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 1fr); gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 14px; scrollbar-width: thin; }
.hito { scroll-snap-align: start; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 18px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; text-decoration: none; color: inherit; transition: transform .15s; }
.hito:hover { transform: translateY(-2px); }
.hito .hic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.hito b { font: 600 15px var(--fs-display); }
.hito span { font-size: 13px; color: var(--ink-2); }

/* ---------- Capítulos ---------- */
.caps { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cap-card { --c: var(--navy); position: relative; display: flex; flex-direction: column; background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); overflow: hidden; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: transform .18s, box-shadow .18s; }
.cap-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.cap-card .banda { height: 96px; position: relative; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 55%, #0E1E2E)); color: #fff; padding: 14px 16px; display: flex; justify-content: space-between; align-items: flex-start; overflow: hidden; }
.cap-card .banda .num { font: 700 34px var(--fs-display); opacity: .95; line-height: 1; }
.cap-card .banda .ico { width: 44px; height: 44px; stroke-width: 1.5; opacity: .9; }
.cap-card .banda::after { content: ""; position: absolute; right: -30px; bottom: -50px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.08); }
.cap-card .cuerpo { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cap-card .cuerpo b { font: 600 16px var(--fs-display); }
.cap-card .cuerpo span { font-size: 13px; color: var(--ink-2); }
.cap-card .pie { display: flex; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; }
.cap-card .visto { position: absolute; top: 10px; right: 10px; z-index: 2; background: rgba(255,255,255,.95); color: var(--ok); border-radius: 99px; padding: 2px 8px; font: 700 10.5px var(--fs-display); display: inline-flex; align-items: center; gap: 4px; }
.cap-card .visto .ico { width: 12px; height: 12px; stroke-width: 3; }

/* ---------- Vista de perfil ---------- */
.perfil-hero { color: #fff; background: radial-gradient(circle at 90% 10%, color-mix(in srgb, var(--perfil) 45%, transparent), transparent 45%), linear-gradient(135deg, var(--ink), var(--navy)); }
.perfil-hero .wrap { padding-top: 38px; padding-bottom: 40px; display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; }
.perfil-hero h1 { font-size: clamp(26px, 3.6vw, 38px); margin: 8px 0 10px; }
.perfil-hero p { color: #C9D5E0; max-width: 640px; font-size: 15.5px; }
.perfil-hero .acciones { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 18px; }
.progreso { display: grid; place-items: center; text-align: center; gap: 6px; }
.progreso svg { width: 116px; height: 116px; }
.progreso small { color: #C9D5E0; font-size: 12px; max-width: 140px; }
@media (max-width: 700px) { .perfil-hero .wrap { grid-template-columns: 1fr; } .progreso { justify-self: start; grid-template-columns: auto 1fr; text-align: left; } .progreso svg { width: 80px; height: 80px; } }

.ruta { display: grid; gap: 10px; counter-reset: paso; }
.paso { display: grid; grid-template-columns: 44px 1fr auto; gap: 14px; align-items: center; background: #fff; border: 1px solid var(--borde); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: inherit; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.paso:hover { border-color: var(--perfil); transform: translateX(3px); }
.paso .n { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; color: #fff; font: 700 15px var(--fs-display); background: var(--c, var(--navy)); }
.paso b { font: 600 15px var(--fs-display); display: block; }
.paso span { font-size: 13px; color: var(--ink-2); }
.paso .estado { color: var(--muted); }
.paso.visto .estado { color: var(--ok); }
@media (max-width: 560px) { .paso { grid-template-columns: 40px 1fr; } .paso .estado { display: none; } }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--borde); background: #fff; padding: 8px 14px; border-radius: 99px; font: 600 13px var(--fs-display); color: var(--ink-2); cursor: pointer; text-align: left; transition: border-color .15s, background .15s, color .15s; }
a.chip { text-decoration: none; }
.chip:hover { border-color: var(--accent); color: var(--ink); }
.chip.activo { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip .ico { width: 16px; height: 16px; }

/* ---------- Gráficos ---------- */
.graficos { display: grid; grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); gap: 14px; }
.grafico { background: #fff; border: 1px solid var(--borde); border-radius: var(--radio); padding: 16px 18px 12px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.grafico h3 { font-size: 15.5px; }
.grafico .sub { font-size: 12.5px; color: var(--muted); }
.grafico .lienzo { position: relative; height: 260px; margin-top: 8px; }
.grafico.alto .lienzo { height: 320px; }
@media (max-width: 420px) { .graficos { grid-template-columns: 1fr; } .grafico .lienzo { height: 230px; } }

/* ---------- Capítulo ---------- */
.cap-hero { --c: var(--navy); color: #fff; background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 45%, #0E1E2E)); position: relative; overflow: hidden; }
.cap-hero::after { content: ""; position: absolute; right: -80px; top: -80px; width: 320px; height: 320px; border-radius: 50%; background: rgba(255,255,255,.07); }
.cap-hero .wrap { position: relative; z-index: 1; padding-top: 34px; padding-bottom: 38px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: center; }
.cap-hero .numgrande { font: 700 clamp(56px, 9vw, 104px) var(--fs-display); line-height: .9; opacity: .9; }
.cap-hero h1 { font-size: clamp(24px, 3.4vw, 36px); margin: 6px 0 8px; }
.cap-hero p { color: rgba(255,255,255,.85); max-width: 720px; font-size: 15px; }
.cap-hero .migas a { color: rgba(255,255,255,.75); text-decoration: none; font-size: 12.5px; }
.cap-hero .migas a:hover { color: #fff; }
.porque { display: flex; gap: 10px; align-items: flex-start; background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.2); border-radius: 12px; padding: 10px 14px; margin-top: 14px; font-size: 13.5px; max-width: 720px; }
.porque .ico { margin-top: 1px; }
@media (max-width: 600px) { .cap-hero .wrap { grid-template-columns: 1fr; gap: 6px; } }

.cap-grid { display: grid; grid-template-columns: 1fr 340px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .cap-grid { grid-template-columns: 1fr; } }
.bloque { padding: 20px 22px; }
.bloque h2 { font-size: 20px; margin-bottom: 10px; }
.esencial { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.esencial li { display: grid; grid-template-columns: 26px 1fr; gap: 10px; align-items: start; font-size: 14px; }
.esencial li .ck { width: 26px; height: 26px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.esencial li .ck .ico { width: 15px; height: 15px; stroke-width: 2.5; }
details.seccion { border-top: 1px solid var(--borde); }
details.seccion:first-of-type { border-top: 0; }
details.seccion summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 0; font: 600 15px var(--fs-display); }
details.seccion summary::-webkit-details-marker { display: none; }
details.seccion summary .ico { transition: transform .2s; color: var(--muted); }
details.seccion[open] summary .ico { transform: rotate(180deg); }
details.seccion .contenido { padding: 0 0 16px; color: var(--ink-2); }
details.seccion ul { margin: 0; padding-left: 18px; display: grid; gap: 5px; }
details.seccion li::marker { color: var(--accent); }
.cita { border-left: 4px solid var(--accent); padding: 14px 18px; background: #fff; border-radius: 0 12px 12px 0; box-shadow: var(--shadow); }
.cita p { font: 500 17px/1.4 var(--fs-display); color: var(--ink); }
.cita small { display: block; margin-top: 8px; color: var(--muted); }
.lado { display: grid; gap: 14px; position: sticky; top: 80px; }
@media (max-width: 960px) { .lado { position: static; } }
.lado .kpis { grid-template-columns: 1fr 1fr; }
.lado .kpi .v { font-size: 22px; }
.temas { display: grid; gap: 6px; }
.tema { display: flex; gap: 10px; align-items: center; font-size: 13.5px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); }
.tema .d { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; font: 700 12px var(--fs-display); color: #fff; flex: none; }
.navcap { display: flex; justify-content: space-between; gap: 10px; flex-wrap: wrap; margin-top: 8px; }

/* ---------- Cifras (tablero) ---------- */
.filtros { margin-bottom: 16px; }

/* ---------- Desafío (quiz) ---------- */
.quiz { max-width: 720px; margin: 0 auto; padding: 26px; }
.quiz .barra { height: 8px; border-radius: 99px; background: #e7edf2; overflow: hidden; margin: 10px 0 20px; }
.quiz .barra span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal), var(--accent)); transition: width .4s; }
.quiz h2 { font-size: 22px; margin-bottom: 16px; }
.opciones { display: grid; gap: 10px; }
.opcion { text-align: left; border: 1.5px solid var(--borde); background: #fff; border-radius: 12px; padding: 13px 16px; cursor: pointer; font: 500 14.5px var(--fs-body); display: flex; gap: 12px; align-items: center; transition: border-color .15s, background .15s; }
.opcion:hover:not(:disabled) { border-color: var(--accent); }
.opcion .letra { width: 28px; height: 28px; border-radius: 8px; background: var(--surface-2); display: grid; place-items: center; font: 700 13px var(--fs-display); flex: none; }
.opcion.correcta { border-color: var(--ok); background: var(--ok-soft); }
.opcion.correcta .letra { background: var(--ok); color: #fff; }
.opcion.incorrecta { border-color: #e9a29d; background: #FBE3E0; }
.opcion:disabled { cursor: default; }
.feedback { margin-top: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface-2); font-size: 14px; display: none; }
.feedback.on { display: block; animation: aparecer .3s ease; }
.resultado { text-align: center; }
.resultado .trofeo { width: 96px; height: 96px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: var(--warn-soft); color: var(--warn); }
.resultado .trofeo .ico { width: 48px; height: 48px; }
.resultado .puntaje { font: 700 48px var(--fs-display); }

/* ---------- Asistente (chat) ---------- */
.fab { position: fixed; right: 20px; bottom: 20px; z-index: 60; display: inline-flex; align-items: center; gap: 10px; background: var(--accent); color: #fff; border: 0; border-radius: 99px; padding: 12px 18px 12px 12px; font: 600 14px var(--fs-display); cursor: pointer; box-shadow: 0 10px 30px rgba(255,109,102,.45); transition: transform .2s; }
.fab:hover { transform: translateY(-2px) scale(1.02); }
.fab .bot { width: 34px; height: 34px; border-radius: 50%; background: #fff; color: var(--accent); display: grid; place-items: center; }
.fab .bot .ico { width: 20px; height: 20px; }
.fab .pulso { position: absolute; top: 4px; left: 36px; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); border: 2px solid #fff; }
body.chat-abierto .fab { display: none; }
@media (max-width: 560px) { .fab .txt { display: none; } .fab { padding: 10px; } }

.chat { position: fixed; right: 20px; bottom: 20px; z-index: 70; width: 400px; height: min(680px, calc(100vh - 100px)); background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); border: 1px solid var(--borde); display: none; flex-direction: column; overflow: hidden; }
.chat.on { display: flex; animation: subir .25s ease; }
.chat.pagina { position: static; width: 100%; height: calc(100vh - 64px - 1px); max-height: none; border-radius: 0; border: 0; box-shadow: none; display: flex; animation: none; }
@media (max-width: 560px) { .chat:not(.pagina) { right: 0; bottom: 0; width: 100%; height: 100%; border-radius: 0; } }
.chat-head { background: linear-gradient(135deg, var(--ink), var(--navy)); color: #fff; padding: 14px 14px 14px 16px; display: flex; align-items: center; gap: 12px; }
.chat-head .bot { width: 38px; height: 38px; border-radius: 12px; background: var(--accent); display: grid; place-items: center; flex: none; }
.chat-head b { display: block; font: 600 15px var(--fs-display); }
.chat-head small { display: block; color: #9FB0BF; font-size: 11.5px; }
.chat-head .acc { margin-left: auto; display: flex; gap: 4px; }
.icon-btn { background: rgba(255,255,255,.1); border: 0; color: #fff; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.icon-btn:hover { background: rgba(255,255,255,.2); }
.icon-btn .ico { width: 18px; height: 18px; }
.chat-cuerpo { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface-2); }
.chat.pagina .chat-cuerpo > * { width: 100%; max-width: 760px; margin-left: auto; margin-right: auto; }
.msg { max-width: 88%; padding: 11px 14px; border-radius: 14px; font-size: 14px; line-height: 1.5; animation: aparecer .25s ease; }
.msg.bot { background: #fff; border: 1px solid var(--borde); border-top-left-radius: 4px; align-self: flex-start; }
.msg.yo { background: var(--ink); color: #fff; border-top-right-radius: 4px; align-self: flex-end; }
.chat.pagina .msg.bot { margin-left: max(0px, calc((100% - 760px) / 2)); }
.msg .k { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.msg .k div { background: var(--surface-2); border-radius: 10px; padding: 7px 10px; border-left: 3px solid var(--accent); }
.msg .k b { display: block; font: 700 16px var(--fs-display); }
.msg .k span { font-size: 11.5px; color: var(--ink-2); }
.msg .mini { position: relative; height: 190px; margin-top: 10px; }
.msg .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 10px; font-size: 11.5px; color: var(--muted); }
.msg .meta a { font: 600 12px var(--fs-display); color: var(--teal); text-decoration: none; }
.sugs { display: flex; flex-wrap: wrap; gap: 6px; align-self: flex-start; animation: aparecer .3s ease; }
.sug { border: 1px solid #c8e3e8; background: #fff; color: var(--teal); border-radius: 99px; padding: 7px 12px; font: 600 12.5px var(--fs-display); cursor: pointer; text-align: left; display: inline-flex; gap: 6px; align-items: center; }
.sug:hover { background: var(--teal-soft); }
.sug.cat { color: var(--ink); border-color: var(--borde); }
.sug.cat .ico { width: 16px; height: 16px; color: var(--accent); }
.sug.nav { color: var(--muted); border-style: dashed; }
.chat-pie { border-top: 1px solid var(--borde); padding: 10px; display: flex; gap: 8px; background: #fff; }
.chat.pagina .chat-pie { justify-content: center; }
.chat-pie form { display: flex; gap: 8px; flex: 1; max-width: 760px; }
.chat-pie input { flex: 1; border: 1px solid var(--borde); border-radius: 10px; padding: 10px 12px; font: inherit; min-width: 0; }
.chat-pie input:focus { outline: none; border-color: var(--accent); }
.chat-pie button { border: 0; background: var(--accent); color: #fff; border-radius: 10px; width: 42px; display: grid; place-items: center; cursor: pointer; flex: none; }
.chat-nota { font-size: 11px; color: var(--muted); text-align: center; padding: 0 10px 8px; background: #fff; }
.escribiendo { display: inline-flex; gap: 4px; padding: 14px; }
.escribiendo i { width: 7px; height: 7px; border-radius: 50%; background: #B9C3CC; animation: punto 1s infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; } .escribiendo i:nth-child(3) { animation-delay: .3s; }

/* ---------- Modal ---------- */
.modal-fondo { position: fixed; inset: 0; z-index: 90; background: rgba(14,30,46,.55); display: none; place-items: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-fondo.on { display: grid; animation: aparecer .2s ease; }
.modal { background: #fff; border-radius: 18px; max-width: 760px; width: 100%; max-height: calc(100vh - 32px); overflow-y: auto; padding: 24px; box-shadow: var(--shadow-lg); position: relative; }
.modal h2 { font-size: 22px; margin: 4px 0 6px; }
.modal .cerrar { position: absolute; top: 14px; right: 14px; background: var(--surface-2); border: 0; width: 34px; height: 34px; border-radius: 10px; cursor: pointer; display: grid; place-items: center; }
.qr { display: grid; grid-template-columns: auto 1fr; gap: 20px; align-items: center; }
.qr .codigo { background: #fff; padding: 10px; border: 1px solid var(--borde); border-radius: 12px; width: 200px; height: 200px; display: grid; place-items: center; }
.qr .codigo svg, .qr .codigo img { width: 180px; height: 180px; }
.qr input { width: 100%; border: 1px solid var(--borde); border-radius: 8px; padding: 8px 10px; font-size: 12.5px; color: var(--ink-2); margin: 10px 0; }
@media (max-width: 560px) { .qr { grid-template-columns: 1fr; justify-items: center; text-align: center; } }

/* ---------- Pie de página ---------- */
.pie { background: var(--ink); color: #9FB0BF; margin-top: 50px; font-size: 12.5px; }
.pie .wrap { padding-top: 28px; padding-bottom: 90px; display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.pie .creditos { display: flex; align-items: center; gap: 12px; }
.pie .creditos img { height: 30px; width: auto; }
.pie p { max-width: 640px; }
.pie a { color: #fff; }

/* ---------- Animaciones ---------- */
.revelar { opacity: 0; transform: translateY(14px); transition: opacity .55s ease, transform .55s ease; }
.revelar.visible { opacity: 1; transform: none; }
@keyframes aparecer { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes subir { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }
@keyframes punto { 0%, 100% { opacity: .3; transform: translateY(0); } 50% { opacity: 1; transform: translateY(-3px); } }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.flota { animation: flotar 6s ease-in-out infinite; }
.flota.d2 { animation-delay: -2s; } .flota.d3 { animation-delay: -4s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .revelar { opacity: 1; transform: none; }
  html { scroll-behavior: auto; }
}

/* ---------- Índice normativo CMF (NCG N° 461/519) ---------- */
.chip.sm { padding: 5px 11px; font-size: 12px; }
.ncg-vig { margin-top: 6px; border-top: 1px solid var(--borde); padding-top: 8px; }
.ncg-vig summary, .ncg-det summary { cursor: pointer; list-style: none; display: inline-flex; align-items: center; gap: 6px; font: 600 13px var(--fs-display); color: var(--navy); }
.ncg-vig summary::-webkit-details-marker, .ncg-det summary::-webkit-details-marker { display: none; }
.ncg-vig summary .ico, .ncg-det summary .ico { width: 16px; height: 16px; }
.ncg-vig[open] summary .ico:last-child, .ncg-det[open] summary .ico { transform: rotate(180deg); }
.ncg-vig ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-2); display: grid; gap: 6px; }
.ncg-item { border: 1px solid var(--borde); border-left: 4px solid var(--teal); box-shadow: var(--shadow); border-radius: 12px; padding: 14px 16px; display: grid; gap: 10px; background: #fff; min-width: 0; }
.ncg-top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ncg-top b { font: 600 15px var(--fs-display); flex: 1 1 200px; }
.ncg-cod { font: 700 12px var(--fs-display); background: var(--ink); color: #fff; padding: 3px 9px; border-radius: 7px; white-space: nowrap; }
.ncg-dos { display: grid; grid-template-columns: 1fr 1.4fr; gap: 14px; }
.ncg-dos p { font-size: 13.2px; color: var(--ink-2); }
.ncg-dos .rot { display: block; font: 600 10.5px var(--fs-display); text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-bottom: 3px; }
.ncg-dos p:last-child { color: var(--ink); }
.ncg-ks { display: flex; flex-wrap: wrap; gap: 8px; }
.ncg-k { display: inline-flex; align-items: baseline; gap: 6px; background: var(--teal-soft); border-radius: 8px; padding: 4px 10px; font-size: 12px; color: var(--ink-2); }
.ncg-k b { font: 700 14px var(--fs-display); color: var(--ink); }
.ncg-det ul { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; }
.ncg-det li { display: flex; justify-content: space-between; gap: 12px; font-size: 12.8px; color: var(--ink-2); padding: 5px 0; border-bottom: 1px dashed var(--borde); }
.ncg-det li em { font-style: normal; color: var(--muted); white-space: nowrap; }
.ncg-pie { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.ncg-pie .tag .ico { width: 13px; height: 13px; }
@media (max-width: 860px) { .ncg-dos { grid-template-columns: 1fr; } }
.cmf-marco { padding: 18px 20px; margin-bottom: 12px; }
.cmf-marco p { color: var(--ink-2); font-size: 13.5px; margin-bottom: 8px; }
.paso .paso-caps { display: block; margin-top: 4px; font: 600 11.5px var(--fs-display); color: var(--teal); }
.rd { font-size: 12.5px; color: var(--muted); }

/* ---------- Reporte descargable ---------- */
.reporte { padding: 34px 38px; font-size: 13.5px; max-width: 980px; margin: 0 auto; }
.rcab { border-bottom: 3px solid var(--accent); padding-bottom: 16px; margin-bottom: 8px; }
.rmarca { display: flex; align-items: center; gap: 10px; font: 600 13px var(--fs-display); color: var(--ink-2); margin-bottom: 14px; }
.rmarca small { display: block; font: 400 11.5px var(--fs-body); color: var(--muted); }
.reporte .brand-mark { width: 34px; height: 34px; border-radius: 9px; background: linear-gradient(135deg, var(--accent), var(--orange)); display: grid; place-items: center; font: 700 12px var(--fs-display); color: #fff; flex: none; }
.reporte h1 { font-size: 26px; line-height: 1.2; margin-bottom: 8px; }
.rbaj { color: var(--muted); font-size: 12.5px; }
.reporte p { margin: 0 0 8px; color: var(--ink-2); }
.reporte ul { margin: 6px 0 10px; padding-left: 18px; color: var(--ink-2); display: grid; gap: 4px; }
.rh { font-size: 18px; margin: 26px 0 10px; color: var(--navy); border-bottom: 1px solid var(--borde); padding-bottom: 6px; }
.rs { font-size: 14.5px; margin: 18px 0 6px; }
.rs small { font: 400 12px var(--fs-body); color: var(--muted); }
.rt { width: 100%; border-collapse: collapse; font-size: 12.3px; margin: 6px 0 12px; }
.rt th { background: var(--ink); color: #fff; font: 600 11.5px var(--fs-display); text-align: left; padding: 7px 8px; vertical-align: bottom; }
.rt td { border-bottom: 1px solid var(--borde); padding: 7px 8px; vertical-align: top; color: var(--ink-2); }
.rt tbody tr:nth-child(even) td { background: #FAFBFC; }
.rt td.v { font: 600 12.5px var(--fs-display); color: var(--ink); white-space: nowrap; }
.rt td.f { color: var(--muted); font-size: 11.5px; }
.rt tr.tot td { font-weight: 700; color: var(--ink); border-top: 2px solid var(--ink); }
.rq { border-left: 3px solid var(--teal); padding: 6px 0 6px 12px; margin: 10px 0; }
.rq b { font-family: var(--fs-display); }
.rq p { margin: 4px 0; }
.rq small { color: var(--muted); }
.rpie { margin-top: 26px; padding-top: 12px; border-top: 1px solid var(--borde); font-size: 11px; color: var(--muted); }
@media (max-width: 700px) {
  .reporte { padding: 20px 16px; }
  .reporte h1 { font-size: 21px; }
  .rt { display: block; overflow-x: auto; }
}

/* ---------- Impresión (Descargar PDF) ---------- */
@page { size: A4; margin: 14mm 12mm; }
@media print {
  .sitebar, .pie, .fab, .chat, .modal-fondo, .no-print { display: none !important; }
  body { background: #fff; font-size: 12px; }
  .section { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  .reporte { box-shadow: none; border: 0; padding: 0; max-width: none; }
  .revelar { opacity: 1 !important; transform: none !important; }
  .rt th, .rcab, .reporte .brand-mark, .rt tbody tr:nth-child(even) td { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .rt tr, .rq { break-inside: avoid; }
  .rt thead { display: table-header-group; }
  .rh, .rs { break-after: avoid; }
  .rh.rompe { break-before: page; }
}
