/* Agenda de Mamá — estilo pop de los 60, sensación de app nativa de iPhone */

@font-face {
  font-family: 'Righteous';
  src: url('fuentes/righteous.woff2') format('woff2');
  font-display: swap;
}

:root {
  --fondo: #FFF4DC;
  --fondo2: #FFE9BF;
  --tarjeta: #FFFFFF;
  --tarjeta2: #FFF8EA;
  --texto: #1E1B3A;
  --texto2: #6B6488;
  --linea: rgba(30, 27, 58, .10);
  --amarillo: #FFC21A;
  --amarillo-osc: #E5A400;
  --rojo: #E8453C;
  --naranja: #FF8A1F;
  --turquesa: #14A89C;
  --magenta: #D9338C;
  --azul: #2F5BEA;
  --violeta: #7B4FD6;
  --acento: #D9338C;
  --sobre-amarillo: #1E1B3A;
  --sombra: 0 1px 2px rgba(30, 27, 58, .06), 0 6px 20px rgba(30, 27, 58, .08);
  --sombra-alta: 0 10px 40px rgba(30, 27, 58, .22);
  --vidrio: rgba(255, 248, 234, .78);
  --radio: 20px;
  --titulo: 'Righteous', ui-rounded, -apple-system, system-ui, sans-serif;
  --cuerpo: -apple-system, BlinkMacSystemFont, 'SF Pro Text', system-ui, 'Segoe UI', Roboto, sans-serif;
  --sup: env(safe-area-inset-top, 0px);
  --inf: env(safe-area-inset-bottom, 0px);
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --fondo: #0F1330;
    --fondo2: #171C45;
    --tarjeta: #1B2150;
    --tarjeta2: #232A60;
    --texto: #FFF4DC;
    --texto2: #B4B0D6;
    --linea: rgba(255, 244, 220, .12);
    --acento: #FF6FB5;
    --azul: #7C9BFF;
    --sombra: 0 1px 2px rgba(0, 0, 0, .3), 0 6px 20px rgba(0, 0, 0, .25);
    --vidrio: rgba(23, 28, 69, .78);
  }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--fondo);
  color: var(--texto);
  font: 17px/1.4 var(--cuerpo);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
  overscroll-behavior-y: none;
  -webkit-user-select: none;
  user-select: none;
}
input, textarea, select, button { font: inherit; color: inherit; }
input, textarea, [contenteditable] { -webkit-user-select: text; user-select: text; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
img { -webkit-user-drag: none; -webkit-touch-callout: none; }
[hidden] { display: none !important; }

/* ───────── vistas ───────── */
#vistas { position: fixed; inset: 0; }
.vista {
  position: absolute; inset: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: calc(var(--sup) + 8px) 16px calc(var(--inf) + 110px);
  opacity: 0; pointer-events: none; transform: translateY(8px);
  transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
.vista.activa { opacity: 1; pointer-events: auto; transform: none; }
#vista-hoy { padding-top: 0; }

.titulo-grande {
  font: 34px/1.1 var(--titulo);
  margin: 14px 4px 14px;
  letter-spacing: .3px;
}
.titulo-grande small { display: block; font: 600 15px var(--cuerpo); color: var(--texto2); letter-spacing: 0; margin-top: 4px; }
.seccion {
  font: 13px var(--titulo); text-transform: uppercase; letter-spacing: 1.2px;
  color: var(--texto2); margin: 26px 6px 10px; display: flex; align-items: center; gap: 8px;
}
.seccion .pildora { margin-left: auto; }

/* ───────── héroe de Hoy ───────── */
.heroe {
  position: relative; margin: 0 -16px; padding: calc(var(--sup) + 22px) 22px 64px;
  min-height: 250px; color: #fff; overflow: hidden;
  border-radius: 0 0 36px 36px;
  background: #F5A623 center / cover no-repeat;
}
.heroe::after {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15, 19, 48, .30) 0%, rgba(15, 19, 48, 0) 45%, rgba(15, 19, 48, .45) 100%);
}
.heroe > * { position: relative; z-index: 1; }
.heroe .fecha { font: 600 15px var(--cuerpo); opacity: .95; text-shadow: 0 1px 6px rgba(0, 0, 0, .35); }
.heroe h1 { font: 38px/1.05 var(--titulo); margin: 6px 0 4px; text-shadow: 0 2px 14px rgba(0, 0, 0, .35); }
.heroe .lema { font: italic 600 15px var(--cuerpo); opacity: .95; text-shadow: 0 1px 6px rgba(0, 0, 0, .4); }

.asistente {
  position: relative; z-index: 2; margin: -44px 0 0;
  background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra);
  padding: 16px;
}
.asistente .resumen { display: flex; gap: 12px; align-items: flex-start; }
.asistente .avatar {
  flex: none; width: 46px; height: 46px; border-radius: 50%;
  background: var(--amarillo) url('iconos/icono-192.png') center / cover;
  box-shadow: 0 0 0 3px var(--tarjeta), 0 0 0 5px var(--amarillo);
}
.asistente .burbuja { font-size: 17px; line-height: 1.38; padding-top: 2px; }
.asistente .burbuja b { color: var(--acento); }

.dictado { margin-top: 14px; display: flex; gap: 8px; align-items: center; }
.dictado input {
  flex: 1; min-width: 0; height: 52px; border-radius: 26px; border: 2px solid var(--linea);
  background: var(--tarjeta2); padding: 0 18px; font-size: 17px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.dictado input:focus { border-color: var(--amarillo); box-shadow: 0 0 0 4px rgba(255, 194, 26, .25); }
.boton-redondo {
  flex: none; width: 52px; height: 52px; border-radius: 50%;
  background: var(--amarillo); color: var(--sobre-amarillo);
  display: grid; place-items: center; box-shadow: 0 4px 12px rgba(229, 164, 0, .35);
  transition: transform .15s;
}
.boton-redondo:active { transform: scale(.9); }
.boton-redondo svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }
.vista-previa { margin: 10px 4px 0; font-size: 15px; color: var(--texto2); min-height: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.vista-previa:empty { display: none; }
.ejemplos { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px -4px; padding: 0 16px 4px; scrollbar-width: none; }
.ejemplos::-webkit-scrollbar { display: none; }

/* ───────── chips y píldoras ───────── */
.chip {
  flex: none; display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-size: 15px; font-weight: 600;
  background: var(--tarjeta2); border: 1.5px solid var(--linea); white-space: nowrap;
  transition: transform .12s, background .2s, border-color .2s;
}
.chip:active { transform: scale(.95); }
.chip.on { background: var(--amarillo); border-color: var(--amarillo); color: var(--sobre-amarillo); }
.etiqueta {
  display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px;
  background: var(--fondo2); color: var(--texto); font-size: 14px; font-weight: 600;
}
.pildora { font: 600 13px var(--cuerpo); padding: 3px 10px; border-radius: 999px; background: var(--amarillo); color: var(--sobre-amarillo); text-transform: none; letter-spacing: 0; }

/* ───────── tarjetas de eventos ───────── */
.lista { display: flex; flex-direction: column; gap: 10px; }
.evento {
  position: relative; display: flex; gap: 14px; align-items: center; width: 100%; text-align: left;
  background: var(--tarjeta); border-radius: 18px; padding: 14px 14px 14px 18px; box-shadow: var(--sombra);
  overflow: hidden; transition: transform .15s ease;
}
.evento::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 6px; background: var(--color, var(--amarillo)); }
.evento:active { transform: scale(.98); }
.evento .emoji {
  flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; font-size: 24px;
  background: color-mix(in srgb, var(--color, var(--amarillo)) 18%, transparent);
}
.evento .info { flex: 1; min-width: 0; }
.evento .t { font-weight: 700; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evento .s { color: var(--texto2); font-size: 15px; margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.evento .hora { flex: none; text-align: right; font: 18px var(--titulo); }
.evento .hora small { display: block; font: 600 12px var(--cuerpo); color: var(--texto2); }
.evento.hecho .t { text-decoration: line-through; opacity: .5; }
.evento.hecho .emoji { filter: grayscale(1); opacity: .6; }
.evento.pasado:not(.hecho) { opacity: .62; }
.evento .clip { font-size: 13px; color: var(--texto2); }
.evento.ahora { box-shadow: 0 0 0 2.5px var(--amarillo), var(--sombra); }
.evento.ahora .hora small { color: var(--acento); }

.marcar {
  flex: none; width: 30px; height: 30px; border-radius: 50%; border: 2.5px solid var(--color, var(--amarillo));
  display: grid; place-items: center; transition: background .2s, transform .15s;
}
.marcar svg { width: 16px; height: 16px; stroke: #fff; stroke-width: 3.2; fill: none; opacity: 0; stroke-linecap: round; stroke-linejoin: round; }
.evento.hecho .marcar { background: var(--color, var(--amarillo)); }
.evento.hecho .marcar svg { opacity: 1; }
.marcar:active { transform: scale(.85); }

.vacio { text-align: center; padding: 8px 20px 4px; color: var(--texto2); }
.vacio img { width: min(260px, 70%); border-radius: 24px; display: block; margin: 0 auto 10px; }
.vacio b { display: block; color: var(--texto); font: 20px var(--titulo); margin-bottom: 4px; }

.aviso-tarjeta {
  display: flex; gap: 14px; align-items: center; margin-top: 14px;
  background: linear-gradient(135deg, var(--magenta), var(--naranja)); color: #fff;
  border-radius: var(--radio); padding: 14px 16px; box-shadow: var(--sombra);
}
.aviso-tarjeta img { width: 64px; height: 64px; border-radius: 16px; object-fit: cover; background: #fff; flex: none; }
.aviso-tarjeta b { font: 18px var(--titulo); display: block; }
.aviso-tarjeta p { margin: 2px 0 8px; font-size: 14px; opacity: .95; }
.aviso-tarjeta .boton { background: #fff; color: var(--magenta); padding: 8px 14px; font-size: 15px; }
.aviso-tarjeta.azul { background: linear-gradient(135deg, var(--azul), var(--turquesa)); }
.aviso-tarjeta.azul .boton { color: var(--azul); }

/* ───────── botones ───────── */
.boton {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 14px; font-weight: 700; font-size: 17px;
  background: var(--amarillo); color: var(--sobre-amarillo); transition: transform .12s, opacity .2s;
}
.boton:active { transform: scale(.96); }
.boton.sec { background: var(--fondo2); color: var(--texto); }
.boton.peligro { background: rgba(232, 69, 60, .12); color: var(--rojo); }
.boton.ancho { width: 100%; }
.boton[disabled] { opacity: .45; }

/* ───────── calendario ───────── */
.cal-cabeza { display: flex; align-items: center; gap: 8px; margin: 14px 4px 12px; }
.cal-cabeza h1 { font: 30px var(--titulo); margin: 0; flex: 1; text-transform: capitalize; }
.cal-cabeza h1 small { font: 600 18px var(--cuerpo); color: var(--texto2); }
.flecha { width: 40px; height: 40px; border-radius: 50%; background: var(--tarjeta); box-shadow: var(--sombra); display: grid; place-items: center; }
.flecha svg { width: 20px; height: 20px; stroke: var(--texto); stroke-width: 2.6; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.hoy-btn { font-weight: 700; color: var(--acento); padding: 8px 10px; }
.mes { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 10px 8px 12px; touch-action: pan-y; }
.mes .semana, .mes .dias { display: grid; grid-template-columns: repeat(7, 1fr); }
.mes .semana span { text-align: center; font: 700 13px var(--cuerpo); color: var(--texto2); padding: 4px 0 8px; letter-spacing: 1px; }
.dia {
  aspect-ratio: 1 / 1.08; display: flex; flex-direction: column; align-items: center; justify-content: flex-start;
  padding-top: 6px; border-radius: 14px; font-size: 17px; font-weight: 600; position: relative;
}
.dia.fuera { color: var(--texto2); opacity: .45; }
.dia.hoy .n { background: var(--rojo); color: #fff; }
.dia .n { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; transition: background .2s; }
.dia.sel .n { background: var(--amarillo); color: var(--sobre-amarillo); }
.dia.hoy.sel .n { background: var(--rojo); box-shadow: 0 0 0 3px var(--amarillo); }
.dia .puntos { display: flex; gap: 3px; margin-top: 3px; height: 6px; }
.dia .puntos i { width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.dia-titulo { font: 20px var(--titulo); margin: 22px 6px 10px; display: flex; align-items: center; }
.dia-titulo button { margin-left: auto; font: 700 15px var(--cuerpo); color: var(--acento); text-transform: none; }

/* ───────── próximos ───────── */
.buscador { position: relative; margin-bottom: 12px; }
.buscador input {
  width: 100%; height: 44px; border-radius: 14px; border: 0; background: var(--tarjeta); box-shadow: var(--sombra);
  padding: 0 14px 0 40px; font-size: 17px; outline: none;
}
.buscador svg { position: absolute; left: 13px; top: 12px; width: 20px; height: 20px; stroke: var(--texto2); stroke-width: 2.4; fill: none; }
.segmentos { display: flex; background: var(--fondo2); border-radius: 12px; padding: 3px; margin-bottom: 8px; }
.segmentos button { flex: 1; padding: 8px 4px; border-radius: 10px; font-weight: 600; font-size: 15px; color: var(--texto2); transition: background .2s, color .2s; }
.segmentos button.on { background: var(--tarjeta); color: var(--texto); box-shadow: 0 2px 6px rgba(0, 0, 0, .1); }
.galeria { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.galeria button { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--tarjeta); box-shadow: var(--sombra); }
.galeria img { width: 100%; height: 100%; object-fit: cover; display: block; }
.galeria .doc { display: grid; place-items: center; height: 100%; padding: 6px; font-size: 12px; text-align: center; color: var(--texto2); word-break: break-word; }
.galeria .doc span { font-size: 30px; display: block; }

/* ───────── ajustes ───────── */
.grupo { background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); overflow: hidden; }
.fila {
  display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 10px 16px; width: 100%; text-align: left;
  border-bottom: 1px solid var(--linea);
}
.fila:last-child { border-bottom: 0; }
.fila .ico { flex: none; width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 17px; background: var(--c, var(--amarillo)); }
.fila .txt { flex: 1; min-width: 0; }
.fila .txt small { display: block; color: var(--texto2); font-size: 14px; }
.fila .val { color: var(--texto2); font-size: 16px; }
.fila select, .fila input[type=time], .fila input[type=text] {
  border: 0; background: var(--fondo2); border-radius: 10px; padding: 6px 10px; font-size: 16px; max-width: 52%;
}
.fila input[type=text] { text-align: right; outline: none; }
button.fila:active { background: var(--fondo2); }

.interruptor { position: relative; flex: none; width: 52px; height: 32px; }
.interruptor input { position: absolute; opacity: 0; inset: 0; margin: 0; z-index: 1; }
.interruptor span { position: absolute; inset: 0; border-radius: 16px; background: var(--linea); transition: background .25s; }
.interruptor span::after {
  content: ''; position: absolute; top: 2px; left: 2px; width: 28px; height: 28px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(0, 0, 0, .25); transition: transform .25s cubic-bezier(.3, 1.4, .5, 1);
}
.interruptor input:checked + span { background: var(--turquesa); }
.interruptor input:checked + span::after { transform: translateX(20px); }

.nota { font-size: 14px; color: var(--texto2); margin: 8px 8px 0; line-height: 1.45; }
.pie { text-align: center; color: var(--texto2); font-size: 13px; margin-top: 30px; }
.pie img { width: 64px; height: 64px; border-radius: 16px; display: block; margin: 0 auto 8px; box-shadow: var(--sombra); }

/* ───────── barra de pestañas ───────── */
#pestanas {
  position: fixed; left: 12px; right: 12px; bottom: calc(var(--inf) + 10px); z-index: 20;
  height: 68px; display: flex; align-items: center; justify-content: space-around;
  background: var(--vidrio); border-radius: 26px; box-shadow: var(--sombra-alta);
  -webkit-backdrop-filter: saturate(180%) blur(22px); backdrop-filter: saturate(180%) blur(22px);
  border: 1px solid var(--linea); max-width: 560px; margin: 0 auto;
}
.pestana { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: var(--texto2); font-size: 11px; font-weight: 700; padding: 6px 0; transition: color .2s; }
.pestana svg { width: 26px; height: 26px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; transition: transform .25s cubic-bezier(.3, 1.6, .5, 1); }
.pestana.activa { color: var(--acento); }
.pestana.activa svg { transform: translateY(-2px) scale(1.08); }
#boton-nuevo {
  flex: none; width: 58px; height: 58px; border-radius: 20px; margin: 0 4px;
  background: var(--amarillo); color: var(--sobre-amarillo);
  display: grid; place-items: center; box-shadow: 0 6px 16px rgba(229, 164, 0, .45);
  transform: translateY(-14px) rotate(0); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
#boton-nuevo:active { transform: translateY(-14px) scale(.9) rotate(90deg); }
#boton-nuevo svg { width: 30px; height: 30px; stroke: currentColor; stroke-width: 3; stroke-linecap: round; fill: none; }

/* ───────── hojas ───────── */
#velo { position: fixed; inset: 0; background: rgba(15, 19, 48, .4); z-index: 40; opacity: 0; transition: opacity .3s; }
#velo.visible { opacity: 1; }
.hoja {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50; max-width: 640px; margin: 0 auto;
  height: calc(100% - var(--sup) - 12px); background: var(--fondo); border-radius: 22px 22px 0 0;
  box-shadow: var(--sombra-alta); transform: translateY(105%); visibility: hidden;
  transition: transform .42s cubic-bezier(.2, .9, .25, 1), visibility 0s .42s;
  display: flex; flex-direction: column;
}
.hoja.abierta { transform: none; visibility: visible; transition: transform .42s cubic-bezier(.2, .9, .25, 1); }
.hoja.arrastrando { transition: none; }
.hoja-baja { height: auto; max-height: 80%; }
.hoja .agarre { width: 40px; height: 5px; border-radius: 3px; background: var(--linea); margin: 8px auto 0; flex: none; }
.hoja-cabeza { display: flex; align-items: center; padding: 6px 12px 8px; gap: 8px; flex: none; }
.hoja-cabeza h2 { flex: 1; text-align: center; margin: 0; font: 19px var(--titulo); }
.hoja-cabeza button { min-width: 84px; padding: 8px 6px; font-size: 17px; color: var(--acento); }
.hoja-cabeza button.fuerte { font-weight: 800; }
.hoja-cabeza button:last-child { text-align: right; }
.hoja-cabeza button:first-child { text-align: left; }
.hoja-cuerpo { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 4px 16px calc(var(--inf) + 24px); }

/* formulario */
.campo-titulo {
  width: 100%; border: 0; background: var(--tarjeta); border-radius: 16px; padding: 16px; font-size: 20px; font-weight: 700;
  box-shadow: var(--sombra); outline: none;
}
.tipos { display: flex; gap: 8px; overflow-x: auto; margin: 12px -16px 0; padding: 2px 16px 6px; scrollbar-width: none; }
.tipos::-webkit-scrollbar { display: none; }
.form-grupo { margin-top: 14px; }
.form-grupo .fila input[type=date], .form-grupo .fila input[type=time], .form-grupo .fila select {
  border: 0; background: var(--fondo2); border-radius: 10px; padding: 7px 10px; font-size: 17px; min-width: 0;
}
.form-grupo .fila input[type=text], .form-grupo textarea {
  flex: 1; border: 0; background: none; font-size: 17px; outline: none; min-width: 0; text-align: left; max-width: none; padding: 0;
}
.form-grupo textarea { min-height: 90px; resize: none; padding: 4px 0; width: 100%; }
.avisos-opciones { display: flex; flex-wrap: wrap; gap: 8px; padding: 12px 14px 14px; }
.adjuntos { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; padding: 12px; }
.adjunto { position: relative; aspect-ratio: 1; border-radius: 14px; overflow: hidden; background: var(--fondo2); }
.adjunto img { width: 100%; height: 100%; object-fit: cover; display: block; }
.adjunto .doc { height: 100%; display: grid; place-items: center; text-align: center; font-size: 11px; padding: 6px; color: var(--texto2); word-break: break-word; }
.adjunto .doc span { font-size: 28px; display: block; }
.adjunto .quitar {
  position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 50%;
  background: rgba(0, 0, 0, .55); color: #fff; font-size: 16px; line-height: 26px; text-align: center;
}
.botones-adjuntar { display: flex; gap: 8px; padding: 0 12px 12px; }
.botones-adjuntar .boton { flex: 1; font-size: 15px; padding: 11px 8px; }

/* detalle */
.det-cabeza { text-align: center; padding: 6px 10px 4px; }
.det-cabeza .grande {
  width: 84px; height: 84px; margin: 0 auto 10px; border-radius: 26px; display: grid; place-items: center; font-size: 44px;
  background: color-mix(in srgb, var(--color) 22%, var(--tarjeta)); box-shadow: 0 0 0 4px var(--color);
}
.det-cabeza h2 { font: 26px/1.15 var(--titulo); margin: 4px 0; }
.det-cabeza .cuando { color: var(--texto2); font-size: 16px; }
.det-cabeza .cuenta { display: inline-block; margin-top: 8px; }
.notas-texto { white-space: pre-wrap; padding: 14px 16px; font-size: 17px; -webkit-user-select: text; user-select: text; }
.notas-texto a { color: var(--azul); }
.acciones-det { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 16px; }
.acciones-det .ancho2 { grid-column: span 2; }

.lista-acciones { padding: 4px 12px calc(var(--inf) + 14px); display: flex; flex-direction: column; gap: 8px; }
.lista-acciones h3 { text-align: center; margin: 6px 0 4px; font: 18px var(--titulo); }
.lista-acciones p { text-align: center; margin: 0 0 6px; color: var(--texto2); font-size: 15px; }

/* visor */
#visor {
  position: fixed; inset: 0; z-index: 80; background: rgba(8, 10, 26, .96); display: flex; flex-direction: column;
  padding: calc(var(--sup) + 6px) 0 calc(var(--inf) + 10px); animation: aparecer .25s ease;
}
#visor .barra { display: flex; align-items: center; gap: 8px; padding: 6px 12px; color: #fff; }
#visor .barra b { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
#visor .barra button { color: #fff; padding: 8px 10px; font-weight: 700; font-size: 16px; }
#visor .contenido { flex: 1; display: grid; place-items: center; overflow: auto; padding: 8px; }
#visor img, #visor video { max-width: 100%; max-height: 100%; border-radius: 8px; }
#visor iframe { width: 100%; height: 100%; border: 0; background: #fff; border-radius: 8px; }
#visor .doc-grande { color: #fff; text-align: center; }
#visor .doc-grande span { font-size: 80px; display: block; }

/* banner de aviso (tipo notificación de iOS) */
#banner {
  position: fixed; left: 10px; right: 10px; top: calc(var(--sup) + 8px); z-index: 90; max-width: 520px; margin: 0 auto;
  transform: translateY(calc(-100% - 60px)); transition: transform .5s cubic-bezier(.2, 1.2, .3, 1);
}
#banner.visible { transform: none; }
#banner .caja {
  display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 22px;
  background: var(--vidrio); -webkit-backdrop-filter: saturate(180%) blur(24px); backdrop-filter: saturate(180%) blur(24px);
  box-shadow: var(--sombra-alta); border: 1px solid var(--linea);
}
#banner .caja .e { font-size: 30px; flex: none; width: 46px; height: 46px; border-radius: 14px; display: grid; place-items: center; background: var(--amarillo); }
#banner .caja b { display: block; font-size: 16px; }
#banner .caja small { color: var(--texto2); font-size: 14px; display: block; }
#banner .caja div { flex: 1; min-width: 0; }

#toast {
  position: fixed; left: 50%; bottom: calc(var(--inf) + 96px); z-index: 95; transform: translate(-50%, 20px);
  background: var(--texto); color: var(--fondo); padding: 12px 18px; border-radius: 16px; font-weight: 600; font-size: 15px;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .35s cubic-bezier(.2, 1.3, .3, 1);
  display: flex; align-items: center; gap: 12px; max-width: calc(100% - 32px); box-shadow: var(--sombra-alta);
}
#toast.visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
#toast button { color: var(--amarillo); font-weight: 800; white-space: nowrap; }

/* bienvenida / instalación */
.bienvenida {
  position: fixed; inset: 0; z-index: 70; background: var(--fondo); overflow-y: auto;
  padding: calc(var(--sup) + 20px) 22px calc(var(--inf) + 24px); text-align: center; animation: aparecer .3s ease;
}
.bienvenida img.ilus { width: min(300px, 78%); border-radius: 28px; margin: 6px auto 8px; display: block; }
.bienvenida h1 { font: 32px/1.1 var(--titulo); margin: 8px 0; }
.bienvenida p { color: var(--texto2); font-size: 17px; margin: 6px 0 16px; }
.bienvenida .pasos { text-align: left; background: var(--tarjeta); border-radius: var(--radio); box-shadow: var(--sombra); padding: 6px 0; margin: 10px 0 18px; }
.bienvenida .pasos div { display: flex; gap: 12px; align-items: center; padding: 10px 16px; }
.bienvenida .pasos b { flex: none; width: 30px; height: 30px; border-radius: 50%; background: var(--amarillo); color: var(--sobre-amarillo); display: grid; place-items: center; font: 16px var(--titulo); }
.bienvenida input { width: 100%; height: 52px; border-radius: 16px; border: 2px solid var(--linea); background: var(--tarjeta); padding: 0 16px; font-size: 18px; text-align: center; outline: none; margin-bottom: 12px; }
.ios-share { display: inline-block; width: 18px; height: 18px; vertical-align: -3px; stroke: var(--azul); fill: none; stroke-width: 2; }

/* animaciones */
@keyframes aparecer { from { opacity: 0; } to { opacity: 1; } }
@keyframes entrar { from { opacity: 0; transform: translateY(12px) scale(.98); } to { opacity: 1; transform: none; } }
.entrar { animation: entrar .4s cubic-bezier(.2, .9, .3, 1) both; }
@keyframes latido { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
.latir { animation: latido 1.6s ease-in-out infinite; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
@media (min-width: 700px) {
  .vista { padding-left: max(16px, calc(50% - 320px)); padding-right: max(16px, calc(50% - 320px)); }
  .heroe { margin: 0; border-radius: 0 0 36px 36px; }
}

/* ═════════ animaciones: que la app se sienta viva ═════════ */

/* fondo psicodélico que respira */
body::before {
  content: ''; position: fixed; inset: -25%; z-index: -1; pointer-events: none;
  background:
    radial-gradient(circle at 18% 28%, rgba(255, 194, 26, .26), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(217, 51, 140, .16), transparent 30%),
    radial-gradient(circle at 70% 78%, rgba(20, 168, 156, .17), transparent 34%),
    radial-gradient(circle at 25% 85%, rgba(255, 138, 31, .14), transparent 30%);
  animation: deriva 26s ease-in-out infinite alternate;
  will-change: transform;
}
@keyframes deriva {
  0% { transform: translate3d(0, 0, 0) rotate(0) scale(1); }
  50% { transform: translate3d(5%, -4%, 0) rotate(10deg) scale(1.1); }
  100% { transform: translate3d(-4%, 3%, 0) rotate(-6deg) scale(1.04); }
}

/* héroe: zoom lento (Ken Burns) + elementos flotando */
.heroe { background: #F5A623; }
.heroe-img {
  position: absolute; inset: -6%; z-index: 0; background: center / cover no-repeat;
  animation: kenburns 32s ease-in-out infinite alternate; will-change: transform;
  transition: opacity .8s ease;
}
@keyframes kenburns { from { transform: scale(1.02) translate3d(0, 0, 0); } to { transform: scale(1.14) translate3d(-2%, 1.5%, 0); } }
.heroe::after { z-index: 0; }
.flotantes { position: absolute; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.flotantes span {
  position: absolute; bottom: -30px; font-size: var(--t, 22px); color: #fff; opacity: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, .25);
  animation: subir var(--d, 9s) linear var(--r, 0s) infinite;
}
@keyframes subir {
  0% { transform: translate3d(0, 0, 0) rotate(0); opacity: 0; }
  12% { opacity: .9; }
  50% { transform: translate3d(var(--x, 20px), -140px, 0) rotate(20deg); }
  85% { opacity: .7; }
  100% { transform: translate3d(calc(var(--x, 20px) * -1), -300px, 0) rotate(-15deg); opacity: 0; }
}
.heroe h1, .heroe .fecha, .heroe .lema { animation: deslizarArriba .7s cubic-bezier(.2, .9, .3, 1) both; }
.heroe .fecha { animation-delay: .05s; }
.heroe h1 { animation-delay: .12s; }
.heroe .lema { animation-delay: .22s; }
@keyframes deslizarArriba { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

/* asistente vivo: aro arcoíris que gira y flota */
.asistente .avatar { position: relative; animation: flotar 4s ease-in-out infinite; background: none; box-shadow: none; }
.asistente .avatar::after {
  content: ''; position: absolute; inset: 3px; border-radius: 50%; border: 2px solid var(--tarjeta);
  background: var(--amarillo) url('iconos/icono-192.png') center / cover;
}
.asistente .avatar::before {
  content: ''; position: absolute; inset: -2px; border-radius: 50%;
  background: conic-gradient(#FFC21A, #FF8A1F, #E8453C, #D9338C, #7B4FD6, #2F5BEA, #14A89C, #FFC21A);
  animation: girar 6s linear infinite;
}
@keyframes girar { to { transform: rotate(360deg); } }
@keyframes flotar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.escribiendo { display: inline-flex; gap: 5px; padding: 8px 2px; }
.escribiendo i { width: 8px; height: 8px; border-radius: 50%; background: var(--texto2); animation: punto 1s ease-in-out infinite; }
.escribiendo i:nth-child(2) { animation-delay: .15s; }
.escribiendo i:nth-child(3) { animation-delay: .3s; }
@keyframes punto { 0%, 60%, 100% { transform: translateY(0); opacity: .4; } 30% { transform: translateY(-6px); opacity: 1; } }
.burbuja.aparece { animation: aparecerTexto .45s ease both; }
@keyframes aparecerTexto { from { opacity: 0; transform: translateY(4px); filter: blur(3px); } to { opacity: 1; transform: none; filter: none; } }

/* tarjetas en cascada */
.entrar { animation-delay: var(--retraso, 0ms); }
.evento.ahora .emoji { animation: latido 1.8s ease-in-out infinite; }
.pildora { animation: pop .4s cubic-bezier(.3, 1.8, .5, 1) both; }
@keyframes pop { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }

/* ilustraciones vacías: el submarino flota */
.vacio img { animation: flotar 4.5s ease-in-out infinite; }
.aviso-tarjeta img { animation: balanceo 3.5s ease-in-out infinite; }
@keyframes balanceo { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
.aviso-tarjeta { background-size: 200% 200%; animation: entrar .4s both, gradiente 8s ease infinite; }
@keyframes gradiente { 0%, 100% { background-position: 0% 50%; } 50% { background-position: 100% 50%; } }

/* botón + : brillo que late */
#boton-nuevo { animation: brillo 3s ease-in-out infinite; }
@keyframes brillo {
  0%, 100% { box-shadow: 0 6px 16px rgba(229, 164, 0, .45), 0 0 0 0 rgba(255, 194, 26, .5); }
  50% { box-shadow: 0 6px 16px rgba(229, 164, 0, .45), 0 0 0 10px rgba(255, 194, 26, 0); }
}

/* pestañas: rebote del icono al elegirla */
.pestana.activa svg { animation: rebote .5s cubic-bezier(.3, 1.8, .5, 1); }
@keyframes rebote { 0% { transform: scale(.7); } 60% { transform: translateY(-3px) scale(1.18); } 100% { transform: translateY(-2px) scale(1.08); } }

/* calendario: el mes se desliza */
.mes.desde-der .dias { animation: desdeDer .38s cubic-bezier(.2, .9, .3, 1); }
.mes.desde-izq .dias { animation: desdeIzq .38s cubic-bezier(.2, .9, .3, 1); }
@keyframes desdeDer { from { transform: translateX(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes desdeIzq { from { transform: translateX(-40px); opacity: 0; } to { transform: none; opacity: 1; } }
.dia.sel .n { animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }

/* casilla de hecho */
.evento.hecho .marcar { animation: pop .35s cubic-bezier(.3, 1.8, .5, 1); }

/* banner: la campana se balancea */
#banner.visible .caja .e { animation: campana 1s ease-in-out 3; }
@keyframes campana { 0%, 100% { transform: rotate(0); } 15% { transform: rotate(18deg); } 30% { transform: rotate(-16deg); } 45% { transform: rotate(12deg); } 60% { transform: rotate(-8deg); } 75% { transform: rotate(4deg); } }

/* confeti de flores y notas */
.confeti { position: fixed; z-index: 120; pointer-events: none; font-size: 22px; left: 0; top: 0; will-change: transform, opacity; }

/* bienvenida */
.bienvenida img.ilus { animation: flotar 5s ease-in-out infinite; }
.bienvenida h1 {
  background: linear-gradient(90deg, #E8453C, #FF8A1F, #E5A400, #14A89C, #2F5BEA, #D9338C, #E8453C);
  background-size: 300% 100%; -webkit-background-clip: text; background-clip: text; color: transparent;
  animation: arcoiris 6s linear infinite;
}
@keyframes arcoiris { to { background-position: 300% 0; } }
.bienvenida > * { animation: deslizarArriba .6s cubic-bezier(.2, .9, .3, 1) both; }
.bienvenida > *:nth-child(2) { animation-delay: .08s; }
.bienvenida > *:nth-child(3) { animation-delay: .16s; }
.bienvenida > *:nth-child(4) { animation-delay: .24s; }
.bienvenida > *:nth-child(5) { animation-delay: .32s; }
.bienvenida > *:nth-child(6) { animation-delay: .4s; }

/* vistas: transición con un poco de escala */
.vista { transform: translateY(10px) scale(.99); }
.vista.activa { transform: none; }

/* ═════════ guía de instalación (para quien no sabe instalar apps web) ═════════ */
.guia { position: fixed; inset: 0; z-index: 75; background: var(--fondo); display: flex; flex-direction: column;
  padding: calc(var(--sup) + 14px) 20px calc(var(--inf) + 16px); animation: aparecer .3s ease; }
.guia-top { display: flex; align-items: center; gap: 10px; }
.guia-top img { width: 44px; height: 44px; border-radius: 12px; box-shadow: var(--sombra); }
.guia-top b { font: 20px var(--titulo); flex: 1; }
.guia-top button { font-weight: 700; color: var(--acento); padding: 8px; }
.guia-puntos { display: flex; gap: 6px; justify-content: center; margin: 14px 0 6px; }
.guia-puntos i { width: 9px; height: 9px; border-radius: 50%; background: var(--linea); transition: width .3s, background .3s; }
.guia-puntos i.on { width: 26px; border-radius: 5px; background: var(--amarillo); }
.guia-paso { flex: 1; overflow-y: auto; text-align: center; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; gap: 14px; padding: 4px 0; }
.guia-paso > :first-child { margin-top: auto; }
.guia-paso > :last-child { margin-bottom: auto; }
.guia.con-flecha { padding-bottom: calc(var(--inf) + 70px); }
.guia.con-flecha-arriba { padding-top: calc(var(--sup) + 64px); }
.guia-paso .num { font: 15px var(--titulo); color: var(--acento); letter-spacing: 1px; text-transform: uppercase; }
.guia-paso h2 { font: 28px/1.15 var(--titulo); margin: 0; }
.guia-paso p { font-size: 19px; line-height: 1.45; color: var(--texto2); margin: 0; max-width: 420px; }
.guia-paso p b { color: var(--texto); }
.guia-paso img.ilus { width: min(220px, 55vw); border-radius: 24px; animation: flotar 4.5s ease-in-out infinite; }
.guia-abajo { display: flex; flex-direction: column; gap: 10px; margin-top: 10px; }
.guia-abajo .boton { font-size: 19px; padding: 16px; }
.guia-abajo .fila-btn { display: flex; gap: 10px; }
.guia-abajo .fila-btn .boton { flex: 1; }
.guia .escuchar { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--acento); padding: 8px 14px; border-radius: 999px; background: var(--fondo2); font-size: 16px; }

/* maquetas de los botones de iOS (dibujadas, no fotos: así no hay letras deformadas) */
.maqueta { width: min(330px, 86vw); background: #f2f2f7; color: #000; border-radius: 22px; padding: 12px; box-shadow: var(--sombra); font-family: -apple-system, system-ui, sans-serif; text-align: left; }
@media (prefers-color-scheme: dark) { .maqueta { background: #1c1c1e; color: #fff; } }
.maqueta .barra-safari { display: flex; align-items: center; gap: 8px; }
.maqueta .barra-safari .dir { flex: 1; height: 40px; border-radius: 20px; background: rgba(120,120,128,.16); display: flex; align-items: center; justify-content: center; font-size: 14px; opacity: .8; }
.maqueta .ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.maqueta .ic svg { width: 24px; height: 24px; stroke: #007aff; fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.maqueta .ic.foco { background: rgba(0,122,255,.14); box-shadow: 0 0 0 3px #FFC21A; animation: latido 1.2s ease-in-out infinite; }
.maqueta .herramientas { display: flex; justify-content: space-around; margin-top: 8px; }
.maqueta .menu { background: rgba(255,255,255,.9); border-radius: 14px; overflow: hidden; }
@media (prefers-color-scheme: dark) { .maqueta .menu { background: #2c2c2e; } }
.maqueta .menu div { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; font-size: 17px; border-bottom: 1px solid rgba(120,120,128,.2); }
.maqueta .menu div:last-child { border-bottom: 0; }
.maqueta .menu div svg { width: 22px; height: 22px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.maqueta .menu div.foco { background: rgba(255,194,26,.35); font-weight: 700; animation: latido 1.2s ease-in-out infinite; }
.maqueta .menu div.tenue { opacity: .45; }
.maqueta .cabeza-hoja { display: flex; justify-content: space-between; align-items: center; font-size: 17px; padding: 4px 4px 10px; }
.maqueta .cabeza-hoja .azul { color: #007aff; }
.maqueta .cabeza-hoja .azul.foco { font-weight: 800; padding: 4px 10px; border-radius: 10px; box-shadow: 0 0 0 3px #FFC21A; animation: latido 1.2s ease-in-out infinite; }
.maqueta .app-prev { display: flex; gap: 12px; align-items: center; background: rgba(255,255,255,.9); border-radius: 14px; padding: 10px; }
@media (prefers-color-scheme: dark) { .maqueta .app-prev { background: #2c2c2e; } }
.maqueta .app-prev img { width: 52px; height: 52px; border-radius: 12px; }
.maqueta .switch { margin-left: auto; width: 46px; height: 28px; border-radius: 14px; background: #34c759; position: relative; flex: none; }
.maqueta .switch::after { content: ''; position: absolute; right: 2px; top: 2px; width: 24px; height: 24px; border-radius: 50%; background: #fff; }
.maqueta .inicio { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px 8px; padding: 6px; }
.maqueta .inicio span { aspect-ratio: 1; border-radius: 14px; background: rgba(120,120,128,.25); }
.maqueta .inicio span.nuestra { background: center / cover url('iconos/icono-192.png'); box-shadow: 0 0 0 3px #FFC21A; animation: latido 1.2s ease-in-out infinite; }
.maqueta small { display: block; text-align: center; font-size: 12px; opacity: .6; margin-top: 6px; }

/* flecha que señala la barra real de Safari */
.flecha-safari { position: fixed; z-index: 76; font-size: 46px; bottom: calc(var(--inf) + 4px); pointer-events: none;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,.25)); animation: senalar 1s ease-in-out infinite; }
.flecha-safari.der { right: 14px; }
.flecha-safari.centro { left: 50%; margin-left: -23px; }
.flecha-safari.arriba-der { top: calc(var(--sup) + 2px); bottom: auto; right: 10px; animation-name: senalarArriba; }
@keyframes senalar { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(12px); } }
@keyframes senalarArriba { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-12px); } }

/* aviso fijo arriba cuando aún no está instalada */
.aviso-instalar { position: fixed; left: 10px; right: 10px; top: calc(var(--sup) + 8px); z-index: 30; max-width: 520px; margin: 0 auto;
  display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 18px; color: #fff;
  background: linear-gradient(135deg, var(--azul), var(--magenta)); box-shadow: var(--sombra-alta); animation: deslizarArriba .5s both; }
.aviso-instalar img { width: 40px; height: 40px; border-radius: 10px; }
.aviso-instalar span { flex: 1; font-size: 15px; line-height: 1.3; }
.aviso-instalar button { background: #fff; color: var(--azul); font-weight: 800; padding: 9px 14px; border-radius: 12px; }
