/* ===========================================================
   Tlanemi — sistema visual
   Fondo cálido por defecto (maíz/crema); el añil oscuro se reserva
   para bienvenida, grabación, modo escucha y certificación.
   La luz de cocuy (oro) sólo marca estados vivos: progreso, logro,
   contenido recién documentado.
   =========================================================== */

:root {
  --crema: #F7F0E4;
  --papel: #FFFDF8;
  --tinta: #2B211A;
  --tinta-60: rgba(43, 33, 26, .6);
  --tinta-45: rgba(43, 33, 26, .45);
  --tinta-12: rgba(43, 33, 26, .12);
  --tinta-08: rgba(43, 33, 26, .08);
  --barro: #B4552F;
  --barro-osc: #8A3C1E;
  --barro-claro: #C96A3D;
  --anil: #16232E;
  --anil-2: #1D3040;
  --anil-hondo: #0D161E;
  --oro: #F0C04A;
  --oro-claro: #FFE39A;
  --verde: #4C6B4F;
  --alerta: #E0563D;
  --crema-86: rgba(247, 240, 228, .86);
  --crema-55: rgba(247, 240, 228, .55);
  --crema-10: rgba(247, 240, 228, .1);

  --esc: 1;             /* escala de letra, la controla la persona usuaria */
  --r-s: 12px;
  --r-m: 16px;
  --r-l: 20px;
  --sombra: 0 2px 10px rgba(43, 33, 26, .07);
  --sombra-alta: 0 10px 30px rgba(22, 35, 46, .22);
  --sans: Karla, "Segoe UI", system-ui, -apple-system, sans-serif;
  --serif: Newsreader, Georgia, "Times New Roman", serif;
  --barra: calc(72px + env(safe-area-inset-bottom, 0px));
}

* { box-sizing: border-box; -webkit-tap-highlight-color: rgba(180, 85, 47, .14); }

html { font-size: calc(16px * var(--esc)); }

body {
  margin: 0;
  background: var(--anil-hondo);
  color: var(--tinta);
  font-family: var(--sans);
  font-size: 1rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

button, input, select, textarea { font: inherit; color: inherit; }
button { border: 0; background: none; cursor: pointer; }
a { color: var(--barro); text-decoration: none; }
img { max-width: 100%; display: block; }

/* Marco: en escritorio la app vive en una columna tipo teléfono. */
#marco {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--crema);
  position: relative;
  overflow-x: hidden;
  box-shadow: 0 0 60px rgba(0, 0, 0, .45);
}
@media (min-width: 560px) {
  #marco { min-height: 100dvh; }
  body { background: radial-gradient(1000px 600px at 20% -10%, rgba(180, 85, 47, .25), transparent 60%), #14100E; }
}

#app { min-height: 100dvh; display: flex; flex-direction: column; }
.pantalla { flex: 1; display: flex; flex-direction: column; min-height: 100dvh; }
.scroll { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.con-barra { padding-bottom: var(--barra); }

/* ---------- tipografía ---------- */
.t-h1 { font: 400 1.7rem/1.18 var(--serif); margin: 0; letter-spacing: .005em; }
.t-h2 { font: 400 1.45rem/1.2 var(--serif); margin: 0; }
.t-h3 { font: 500 1.08rem/1.25 var(--serif); margin: 0; }
.t-serif { font-family: var(--serif); font-weight: 400; }
.t-cuerpo { font-size: .97rem; line-height: 1.68; color: rgba(43, 33, 26, .82); text-wrap: pretty; }
.t-meta { font-size: .8rem; line-height: 1.4; color: var(--tinta-60); }
.t-mini { font-size: .72rem; line-height: 1.35; color: var(--tinta-45); }
.t-etq { font: 600 .63rem/1 var(--sans); letter-spacing: .13em; text-transform: uppercase; color: var(--barro); }
.claro .t-etq { color: var(--oro); }

/* ---------- cabeceras ---------- */
.top {
  padding: calc(18px + env(safe-area-inset-top, 0px)) 20px 16px;
  background: linear-gradient(180deg, var(--anil), var(--anil-2));
  color: var(--crema);
}
.top-claro {
  padding: calc(16px + env(safe-area-inset-top, 0px)) 20px 12px;
  background: var(--papel);
  border-bottom: 1px solid var(--tinta-08);
  position: sticky; top: 0; z-index: 6;
}
.top-fila { display: flex; align-items: center; gap: 12px; }
.top .t-h1, .top .t-h2 { color: var(--crema); }

.btn-icono {
  width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(43, 33, 26, .07); color: var(--tinta); flex: none;
}
.btn-icono.oscuro { background: rgba(247, 240, 228, .12); color: var(--crema); }
.btn-icono:active { transform: scale(.94); }

/* ---------- botones ---------- */
.btn {
  min-height: 54px; border-radius: var(--r-m); padding: 0 20px;
  display: flex; align-items: center; justify-content: center; gap: 9px;
  font: 600 1rem/1 var(--sans); background: var(--barro); color: #FFF6E8;
  width: 100%; text-align: center; transition: transform .12s, background .15s;
}
.btn:active { transform: scale(.985); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: .45; }
.btn-anil { background: var(--anil); color: var(--crema); }
.btn-oro { background: var(--oro); color: var(--anil); }
.btn-linea { background: transparent; border: 1.6px solid var(--barro); color: var(--barro); }
.btn-suave { background: rgba(43, 33, 26, .07); color: var(--tinta); }
.btn-suave-osc { background: rgba(247, 240, 228, .09); color: var(--crema-86); }
.btn-chico { min-height: 44px; font-size: .88rem; padding: 0 15px; border-radius: var(--r-s); }
.btn-fila { display: flex; gap: 10px; }

.chip {
  flex: none; min-height: 40px; padding: 0 15px; border-radius: 20px;
  display: inline-flex; align-items: center; gap: 6px;
  font: 500 .82rem/1 var(--sans); background: transparent;
  border: 1px solid var(--tinta-12); color: var(--tinta-60); white-space: nowrap;
}
.chip[aria-pressed="true"] { background: var(--anil); border-color: var(--anil); color: var(--crema); }
.chip-tag { background: rgba(180, 85, 47, .1); border: 0; color: var(--barro-osc); font-weight: 500; min-height: 34px; }

.fila-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 20px 6px;
  scrollbar-width: none; scroll-snap-type: x proximity;
}
.fila-scroll::-webkit-scrollbar { display: none; }
.fila-scroll > * { scroll-snap-align: start; }

/* ---------- tarjetas ---------- */
.pad { padding: 0 20px; }
.seccion { padding: 22px 20px 8px; }
.seccion-tit { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.ver-mas { font: 500 .82rem/1 var(--sans); color: var(--barro); padding: 14px 4px 14px 14px; margin: -14px -4px -14px 0; }

.card {
  background: var(--papel); border: 1px solid var(--tinta-08); border-radius: var(--r-m);
  box-shadow: var(--sombra); overflow: hidden; width: 100%; text-align: left; display: block;
}
.card:active { transform: scale(.995); }
.card-fila { display: flex; gap: 13px; padding: 12px; align-items: stretch; }
.card-mini { width: 84px; height: 84px; border-radius: var(--r-s); flex: none; object-fit: cover; background: var(--tinta-08); }
.card-txt { flex: 1; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 4px; }
.card-tit { font: 400 1.06rem/1.22 var(--serif); color: var(--tinta); }
.lista { display: flex; flex-direction: column; gap: 11px; padding: 14px 20px 24px; }

.destacada { flex: none; width: 240px; border-radius: 18px; overflow: hidden; background: var(--anil); box-shadow: 0 4px 16px rgba(43, 33, 26, .16); text-align: left; }
.destacada-img { height: 150px; position: relative; }
.destacada-img img { width: 100%; height: 100%; object-fit: cover; }
.destacada-sombra { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(22, 35, 46, .05) 30%, rgba(22, 35, 46, .9)); }
.destacada-cuerpo { padding: 13px 14px 15px; }
.destacada-cuerpo .card-tit { color: var(--crema); }
.edad {
  position: absolute; top: 11px; left: 11px; display: flex; align-items: center; gap: 6px;
  background: rgba(180, 85, 47, .94); border-radius: 8px; padding: 5px 9px;
  font: 600 .63rem/1 var(--sans); color: #FFF6E8; letter-spacing: .05em;
}
.punto-vivo { width: 6px; height: 6px; border-radius: 50%; background: var(--oro-claro); animation: rec 1.6s ease-in-out infinite; }

.cat-card {
  flex: none; width: 112px; height: 116px; border-radius: var(--r-m); padding: 13px;
  display: flex; flex-direction: column; justify-content: space-between; text-align: left;
  box-shadow: 0 2px 8px rgba(43, 33, 26, .08);
}
.cat-glifo { width: 38px; height: 38px; border-radius: 11px; background: rgba(255, 255, 255, .55); display: grid; place-items: center; font: 400 1.2rem/1 var(--serif); }
.cat-nom { font: 600 .78rem/1.25 var(--sans); }

.medalla {
  position: absolute; bottom: 6px; left: 6px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(255, 253, 248, .94); display: grid; place-items: center;
  font-size: .7rem; color: var(--barro-osc);
}
.env { position: relative; flex: none; }

.stats { display: flex; gap: 10px; }
.stat { flex: 1; background: var(--papel); border: 1px solid var(--tinta-08); border-radius: 14px; padding: 12px; text-align: center; }
.stat-n { font: 400 1.3rem/1 var(--serif); color: var(--barro); }
.stat-l { font-size: .68rem; line-height: 1.3; color: var(--tinta-60); margin-top: 5px; }

.barra-prog { height: 8px; border-radius: 5px; background: rgba(43, 33, 26, .1); overflow: hidden; }
.barra-prog > i { display: block; height: 100%; border-radius: 5px; background: linear-gradient(90deg, var(--barro), var(--oro)); transition: width .4s; }
.barra-prog.clara { background: rgba(255, 246, 232, .24); }
.barra-prog.clara > i { background: var(--oro); }

/* ---------- barra inferior ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px;
  background: rgba(255, 253, 248, .97); backdrop-filter: blur(14px);
  border-top: 1px solid rgba(43, 33, 26, .09);
  padding: 7px 4px calc(8px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: flex-end; z-index: 30;
}
.tab { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 4px 0; color: rgba(43, 33, 26, .42); }
.tab[aria-current="page"] { color: var(--barro); }
.tab span { font: 600 .66rem/1 var(--sans); }
.tab-fab { flex: 1; display: flex; justify-content: center; }
.fab {
  width: 64px; height: 64px; border-radius: 50%; margin-top: -24px;
  background: linear-gradient(150deg, var(--barro-claro), var(--barro-osc));
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(138, 60, 30, .45), 0 0 0 5px var(--papel);
}
.fab:active { transform: scale(.94); }

/* ---------- cocuy ---------- */
.cocuy-btn {
  position: fixed; right: max(16px, calc(50vw - 244px)); z-index: 34;
  bottom: calc(var(--barra) + 14px);
  width: 66px; height: 66px; display: grid; place-items: center;
  animation: flotar 4.4s ease-in-out infinite;
}
.cocuy-btn.sin-barra { bottom: calc(24px + env(safe-area-inset-bottom, 0px)); }
.cocuy-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.cocuy-grande { width: 190px; height: 190px; display: grid; place-items: center; }

.cocuy-tip {
  position: fixed; right: max(16px, calc(50vw - 244px)); bottom: calc(var(--barra) + 80px);
  z-index: 34; max-width: 265px; background: var(--anil);
  border: 1px solid rgba(240, 192, 74, .3); border-radius: 16px 16px 4px 16px;
  padding: 14px 15px; box-shadow: var(--sombra-alta); animation: aparecer .22s;
}
.cocuy-tip.sin-barra { bottom: calc(90px + env(safe-area-inset-bottom, 0px)); }
.cocuy-tip p { margin: 8px 0 0; font-size: .87rem; line-height: 1.55; color: var(--crema-86); text-wrap: pretty; }
.cocuy-tip .acciones { display: flex; gap: 14px; margin-top: 11px; }
.cocuy-tip .acciones button { font: 600 .78rem/1 var(--sans); color: var(--oro); display: flex; align-items: center; gap: 6px; }

/* ---------- hoja inferior y modal ---------- */
.velo { position: fixed; inset: 0; background: rgba(11, 19, 25, .62); backdrop-filter: blur(4px); z-index: 40; animation: aparecer .18s; }
.hoja {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 0; width: 100%; max-width: 520px;
  background: var(--papel); border-radius: 24px 24px 0 0; z-index: 41;
  padding: 12px 20px calc(22px + env(safe-area-inset-bottom, 0px));
  box-shadow: 0 -10px 34px rgba(22, 35, 46, .3); animation: subir .28s cubic-bezier(.2, .8, .2, 1);
  max-height: 82dvh; overflow-y: auto;
}
.asa { width: 44px; height: 5px; border-radius: 3px; background: var(--tinta-12); margin: 0 auto 14px; }
.modal {
  position: fixed; inset: 0; z-index: 42; display: grid; place-items: center; padding: 24px;
}
.modal-caja { width: 100%; max-width: 420px; background: var(--papel); border-radius: 22px; padding: 24px 22px;
  position: relative; overflow: hidden; animation: entrar .34s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 26px 60px rgba(0, 0, 0, .4); }

/* ---------- formularios ---------- */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font: 600 .78rem/1 var(--sans); color: var(--tinta-60); margin-bottom: 7px; }
.campo input, .campo textarea, .campo select {
  width: 100%; min-height: 52px; border-radius: var(--r-s); border: 1.5px solid var(--tinta-12);
  background: var(--papel); padding: 12px 14px; font-size: 1rem; color: var(--tinta);
}
.campo textarea { min-height: 110px; resize: vertical; line-height: 1.55; }
.campo input:focus, .campo textarea:focus, .campo select:focus { outline: 2px solid var(--barro); outline-offset: 1px; border-color: transparent; }
.oscuro .campo > span { color: var(--crema-55); }
.oscuro .campo input, .oscuro .campo textarea {
  background: rgba(247, 240, 228, .08); border-color: rgba(247, 240, 228, .16); color: var(--crema);
}
.buscador {
  display: flex; align-items: center; gap: 10px; min-height: 52px; border-radius: 14px;
  background: rgba(247, 240, 228, .12); border: 1px solid rgba(247, 240, 228, .2); padding: 0 14px; width: 100%;
}
.buscador input { flex: 1; background: none; border: 0; outline: 0; color: var(--crema); min-height: 50px; font-size: .95rem; }
.buscador input::placeholder { color: rgba(247, 240, 228, .5); }
.buscador-claro { background: var(--papel); border-color: var(--tinta-12); }
.buscador-claro input { color: var(--tinta); }
.buscador-claro input::placeholder { color: var(--tinta-45); }

.ajuste { display: flex; align-items: center; gap: 14px; padding: 14px 0; border-bottom: 1px solid var(--tinta-08); }
.ajuste:last-child { border-bottom: 0; }
.ajuste-txt { flex: 1; min-width: 0; }
.ajuste-txt b { display: block; font: 600 .95rem/1.3 var(--sans); }
.ajuste-txt span { display: block; font-size: .78rem; color: var(--tinta-60); margin-top: 3px; }
.switch { width: 54px; height: 32px; border-radius: 17px; background: var(--tinta-12); position: relative; flex: none; transition: background .2s; }
.switch[aria-checked="true"] { background: var(--verde); }
.switch i { position: absolute; top: 3px; left: 3px; width: 26px; height: 26px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 4px rgba(0, 0, 0, .25); }
.switch[aria-checked="true"] i { transform: translateX(22px); }
input[type="range"] { width: 100%; accent-color: var(--barro); height: 40px; }

/* ---------- transcripción ---------- */
.linea { display: flex; gap: 11px; padding: 10px; border-radius: 10px; background: transparent; text-align: left; width: 100%; transition: background .2s; }
.linea b { font: 500 .72rem/1.8 var(--sans); color: var(--tinta-45); flex: none; width: 36px; }
.linea p { margin: 0; font-size: .93rem; line-height: 1.62; color: rgba(43, 33, 26, .78); text-wrap: pretty; }
.linea.viva { background: rgba(240, 192, 74, .24); }
.linea.viva b { color: var(--barro-osc); }
.linea.viva p { color: var(--tinta); }

.aviso {
  display: flex; gap: 10px; align-items: flex-start; background: rgba(240, 192, 74, .18);
  border-radius: var(--r-s); padding: 11px 13px; font-size: .82rem; line-height: 1.45; color: rgba(43, 33, 26, .78);
}
.aviso.alerta { background: rgba(224, 86, 61, .12); color: #8A3020; }

/* ---------- pantallas oscuras ---------- */
.oscuro { background: linear-gradient(180deg, var(--anil), var(--anil-hondo)); color: var(--crema); }
.oscuro .t-h1, .oscuro .t-h2, .oscuro .t-h3 { color: var(--crema); }
.oscuro .t-cuerpo { color: var(--crema-86); }
.oscuro .t-meta { color: var(--crema-55); }
.pant-oscura {
  min-height: 100dvh; display: flex; flex-direction: column;
  padding: calc(28px + env(safe-area-inset-top, 0px)) 22px calc(24px + env(safe-area-inset-bottom, 0px));
}

.onda { display: flex; align-items: flex-end; gap: 3px; height: 52px; justify-content: center; }
.onda i { width: 4px; border-radius: 2px; background: rgba(247, 240, 228, .22); transition: height .12s, background .2s; }
.onda i.on { background: var(--oro); }

.rec-btn {
  width: 104px; height: 104px; border-radius: 50%; background: var(--barro);
  display: grid; place-items: center; box-shadow: 0 0 0 10px rgba(180, 85, 47, .16), 0 12px 30px rgba(0, 0, 0, .35);
  transition: background .2s, transform .12s;
}
.rec-btn[data-on="1"] { background: var(--alerta); }
.rec-btn:active { transform: scale(.96); }
.rec-btn i { display: block; width: 40px; height: 40px; border-radius: 50%; background: #FFF6E8; transition: all .2s; }
.rec-btn[data-on="1"] i { width: 28px; height: 28px; border-radius: 6px; }
.rec-tiempo { font: 600 1.55rem/1 var(--serif); color: var(--crema); font-variant-numeric: tabular-nums; }

.burbuja {
  flex: 1; background: rgba(247, 240, 228, .08); border: 1px solid rgba(240, 192, 74, .22);
  border-radius: 18px 18px 18px 6px; padding: 16px 17px;
}
.burbuja h2 { margin: 0; font: 400 1.25rem/1.35 var(--serif); color: var(--oro-claro); text-wrap: pretty; }

.paso { display: flex; align-items: center; gap: 11px; background: rgba(247, 240, 228, .06); border-radius: 13px; padding: 13px 14px; }
.paso i { width: 22px; height: 22px; border-radius: 50%; background: rgba(247, 240, 228, .14); display: grid; place-items: center; flex: none; font: 700 .68rem/1 var(--sans); color: var(--anil); font-style: normal; }
.paso.ok i { background: var(--oro); }
.paso span { font: 500 .85rem/1.3 var(--sans); color: rgba(247, 240, 228, .45); }
.paso.ok span { color: var(--crema); }

/* ---------- mapa ---------- */
.mapa-env { flex: 1; position: relative; overflow: hidden; background: #B9CCC6; }
#mapa { position: absolute; inset: 0; z-index: 1; }
.mapa-svg { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; }
.mapa-top { position: absolute; top: calc(14px + env(safe-area-inset-top, 0px)); left: 14px; right: 14px; z-index: 600; display: flex; flex-direction: column; gap: 9px; }
.mapa-leyenda { position: absolute; left: 14px; bottom: calc(var(--barra) + 12px); z-index: 600; background: rgba(22, 35, 46, .9); border-radius: 13px; padding: 10px 13px; pointer-events: none; }
.mapa-zoom { position: absolute; right: 14px; top: calc(120px + env(safe-area-inset-top, 0px)); z-index: 600; display: flex; flex-direction: column; gap: 1px; border-radius: var(--r-s); overflow: hidden; box-shadow: 0 4px 14px rgba(22, 35, 46, .2); }
.mapa-zoom button { width: 44px; height: 44px; background: rgba(255, 253, 248, .96); display: grid; place-items: center; font-size: 1.2rem; color: var(--tinta); }
.leaflet-container { background: #B9CCC6; font-family: var(--sans); }
.leaflet-tile-pane { filter: sepia(.42) saturate(.82) brightness(1.03) contrast(.95); }
.leaflet-control-attribution { font: 400 8.5px/1.4 var(--sans) !important; background: rgba(255, 253, 248, .7) !important; }
.tl-pin { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; }
.tl-pin-b { min-width: 34px; height: 34px; border-radius: 17px; border: 2.5px solid #FFFDF8; box-shadow: 0 4px 12px rgba(22, 35, 46, .36); display: flex; align-items: center; justify-content: center; padding: 0 9px; font: 700 .8rem/1 var(--sans); color: #FFF6E8; }
.tl-pin-l { font: 600 .62rem/1 var(--sans); color: var(--tinta); background: rgba(255, 253, 248, .92); border-radius: 5px; padding: 3px 5px; white-space: nowrap; }
.tl-pin-on .tl-pin-b { transform: scale(1.14); box-shadow: 0 0 0 6px rgba(240, 192, 74, .4), 0 4px 12px rgba(22, 35, 46, .36); }

/* ---------- utilidades ---------- */
.fila { display: flex; align-items: center; gap: 12px; }
.entre { justify-content: space-between; }
.crece { flex: 1; min-width: 0; }
.centro { text-align: center; }
.oculto { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.h8 { height: 8px; } .h14 { height: 14px; } .h20 { height: 20px; } .h28 { height: 28px; } .h40 { height: 40px; }
.vacio { padding: 40px 24px; text-align: center; color: var(--tinta-60); }
.vacio p { margin: 10px 0 0; font-size: .9rem; line-height: 1.6; }

.pill-off { display: inline-flex; align-items: center; gap: 6px; background: rgba(76, 107, 79, .14); color: #33502F; border-radius: 12px; padding: 5px 10px; font: 600 .68rem/1 var(--sans); }
.pill-propio { background: rgba(240, 192, 74, .22); color: #7A5A18; }

#brindis {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barra) + 22px);
  z-index: 60; background: var(--anil); color: var(--crema); border-radius: 14px;
  padding: 13px 18px; font-size: .88rem; box-shadow: var(--sombra-alta);
  max-width: 88%; text-align: center; animation: aparecer .2s;
}

.barra-voz {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(var(--barra) + 22px); z-index: 60;
  background: var(--barro); color: #FFF6E8; border-radius: 16px; padding: 14px 18px;
  display: flex; align-items: center; gap: 12px; box-shadow: var(--sombra-alta); max-width: 92%;
}

/* ---------- animaciones ---------- */
@keyframes brillo { 0%, 100% { opacity: .55; transform: scale(.94); } 50% { opacity: 1; transform: scale(1.08); } }
@keyframes pulso { 0%, 100% { box-shadow: 0 0 14px 4px rgba(240, 192, 74, .45); } 50% { box-shadow: 0 0 26px 10px rgba(240, 192, 74, .8); } }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
@keyframes alaI { 0%, 100% { transform: translate(-13px, -9px) rotate(-26deg) scaleY(1); } 50% { transform: translate(-13px, -9px) rotate(-42deg) scaleY(.7); } }
@keyframes alaD { 0%, 100% { transform: translate(13px, -9px) rotate(26deg) scaleY(1); } 50% { transform: translate(13px, -9px) rotate(42deg) scaleY(.7); } }
@keyframes rec { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
@keyframes subir { from { transform: translate(-50%, 110%); } to { transform: translate(-50%, 0); } }
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes entrar { from { opacity: 0; transform: scale(.9) translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes destello { 0% { transform: translateX(-120%) rotate(18deg); } 100% { transform: translateX(320%) rotate(18deg); } }
.destello { position: absolute; top: 0; left: 0; width: 60px; height: 200%; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .7), transparent); animation: destello 2.6s ease-in-out .3s infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---------- alto contraste ---------- */
.contraste {
  --crema: #FFFDF6; --papel: #FFFFFF; --tinta: #1A130D;
  --tinta-60: rgba(26, 19, 13, .78); --tinta-45: rgba(26, 19, 13, .62);
  --tinta-12: rgba(26, 19, 13, .34); --tinta-08: rgba(26, 19, 13, .24);
  --barro: #8A3C1E; --oro: #C98F10;
}
.contraste .t-meta, .contraste .t-mini { color: rgba(26, 19, 13, .8); }
.contraste .card { border-width: 1.6px; }
.contraste .btn { outline: 2px solid rgba(0, 0, 0, .25); outline-offset: -2px; }

:focus-visible { outline: 3px solid var(--barro); outline-offset: 2px; border-radius: 6px; }
.oscuro :focus-visible, .pant-oscura :focus-visible { outline-color: var(--oro); }

/* ---------- respuesta de Cocuy ---------- */
.ia-caja {
  background: linear-gradient(150deg, rgba(240, 192, 74, .16), rgba(180, 85, 47, .07));
  border: 1px solid rgba(240, 192, 74, .42);
  border-radius: var(--r-m); padding: 15px 16px;
}
.ia-caja.apagada { background: rgba(43, 33, 26, .04); border-color: var(--tinta-12); }
.ia-top { display: flex; align-items: center; gap: 8px; color: var(--barro-osc); }
.ia-top span { font: 600 .63rem/1 var(--sans); letter-spacing: .13em; }
.ia-pie { display: flex; gap: 10px; margin-top: 13px; }
.ia-puntos { display: flex; gap: 6px; margin-top: 14px; }
.ia-puntos i { width: 8px; height: 8px; border-radius: 50%; background: var(--barro); opacity: .3; animation: latir 1.1s ease-in-out infinite; }
.ia-puntos i:nth-child(2) { animation-delay: .18s; }
.ia-puntos i:nth-child(3) { animation-delay: .36s; }
@keyframes latir { 0%, 100% { opacity: .25; transform: scale(.85); } 50% { opacity: 1; transform: scale(1); } }

/* ---------- contenido de lección ---------- */
.bloque {
  margin-top: 16px; padding: 14px 15px; border-radius: var(--r-s);
  background: var(--papel); border: 1px solid var(--tinta-08);
}
.lista-puntos, .lista-pasos { margin: 9px 0 0; padding-left: 20px; }
.lista-puntos li, .lista-pasos li { font-size: .93rem; line-height: 1.6; color: rgba(43, 33, 26, .82); margin-bottom: 6px; text-wrap: pretty; }
.lista-puntos li::marker { color: var(--barro); }
.lista-pasos li::marker { color: var(--barro); font-weight: 700; }
.lista-puntos li:last-child, .lista-pasos li:last-child { margin-bottom: 0; }

/* ---------- fotografía ---------- */
/* El tratamiento cálido unifica la foto documental con el resto del sistema
   visual, y el fondo evita el salto en blanco mientras la imagen llega. */
.foto {
  background: linear-gradient(150deg, #C9743F, #7A3218);
  filter: sepia(.26) saturate(1.14) contrast(1.02);
  object-fit: cover;
}
.contraste .foto { filter: saturate(1.06) contrast(1.12); }

/* La imagen debe llenar su caja, nunca imponerla: sin esto, el atributo height
   del <img> estira el contenedor y la portada se desborda. */
.foto-llena { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.foto-circulo { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.foto-chica { width: 52px; height: 52px; border-radius: 11px; object-fit: cover; flex: none; }
.credito { margin-top: 14px; font-size: .7rem; line-height: 1.5; color: var(--tinta-45); }
.credito a { color: var(--barro); text-decoration: underline; }

/* ---------- logotipo ---------- */
/* La palabra estilizada con el punto de la «i» encendido por Cocuy.
   Se reserva para los momentos de identidad: arranque, bienvenida,
   certificado y pie de ajustes. Nunca compite con el contenido. */
.logotipo { display: block; margin: 0 auto; max-width: 100%; height: auto; }
