/* ═══════════════════════════════════════════════════════════════
   bebe.rsegura.mx — sistema de diseño "cuarto de bebé"
   Cálido, redondeado, durazno + menta. Modo oscuro = noche con lamparita.
   ═══════════════════════════════════════════════════════════════ */
:root {
  --bg: #fff6ee;
  --bg2: #fdeee2;
  --card: #ffffff;
  --card2: #fff9f4;
  --border: #f2e3d8;
  --text: #3d2c2e;
  --text2: #8a7473;
  --text3: #b8a5a3;
  --peach: #ff9f7a;
  --peach2: #ffbfa3;
  --peachTint: #fff0e8;
  --mint: #5fc9ad;
  --mint2: #a8e6d4;
  --mintTint: #e9f8f3;
  --lila: #a996f2;
  --lilaTint: #f0ecfd;
  --sol: #ffc857;
  --solTint: #fff5dc;
  --cielo: #7cb9e8;
  --cieloTint: #eaf4fc;
  --rojo: #e5615d;
  --rojoTint: #fdecec;
  --shadow: 0 1px 2px rgba(80,40,30,.04), 0 18px 40px -24px rgba(120,60,40,.28);
  --shadow-sm: 0 1px 3px rgba(80,40,30,.06);
  --radius: 26px;
  --radius-sm: 16px;
  --tab-h: 68px;
}
[data-theme="dark"] {
  --bg: #1b1517;
  --bg2: #231b1e;
  --card: #2a2125;
  --card2: #241c1f;
  --border: #3a2d32;
  --text: #f6ebe6;
  --text2: #b39c98;
  --text3: #7a666a;
  --peach: #ffad8c;
  --peach2: #ff9f7a;
  --peachTint: #3a2a26;
  --mint: #7fdcc1;
  --mint2: #4fb99a;
  --mintTint: #1f332d;
  --lila: #bcaaff;
  --lilaTint: #2d2740;
  --sol: #ffd175;
  --solTint: #3a3222;
  --cielo: #8fc6ee;
  --cieloTint: #1f2d3a;
  --rojo: #ff8a86;
  --rojoTint: #3d2426;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 18px 40px -20px rgba(0,0,0,.7);
  --shadow-sm: 0 1px 3px rgba(0,0,0,.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Nunito', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  overscroll-behavior-y: none;
  -webkit-font-smoothing: antialiased;
  transition: background .3s ease, color .3s ease;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button:active { transform: scale(.97); }
button, .card { transition: transform .12s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease; }
a { color: var(--peach); text-decoration: none; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0); }
::selection { background: rgba(255,159,122,.3); }
:focus-visible { outline: 3px solid var(--peach2); outline-offset: 2px; border-radius: 8px; }

/* Nubes de fondo, muy suaves */
#fondo { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.nube { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .55; animation: flotar 18s ease-in-out infinite; }
.n1 { width: 42vw; height: 42vw; background: var(--peach2); top: -12vw; right: -10vw; }
.n2 { width: 36vw; height: 36vw; background: var(--mint2); bottom: 8vh; left: -14vw; animation-delay: -6s; }
.n3 { width: 28vw; height: 28vw; background: var(--lila); bottom: -10vw; right: 10vw; opacity: .35; animation-delay: -12s; }
[data-theme="dark"] .nube { opacity: .16; }
@keyframes flotar { 0%,100% { transform: translateY(0) } 50% { transform: translateY(-3vh) } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; } }

/* ── Animaciones ── */
@keyframes vin { from { opacity: 0; transform: translateY(12px) } to { opacity: 1; transform: none } }
@keyframes pop { from { opacity: 0; transform: scale(.92) } to { opacity: 1; transform: none } }
@keyframes subir { from { transform: translateY(100%) } to { transform: none } }
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
@keyframes grow { from { transform: scaleY(0) } to { transform: scaleY(1) } }
@keyframes latido { 0%,100% { transform: scale(1) } 50% { transform: scale(1.08) } }
@keyframes respirar { 0%,100% { opacity: 1 } 50% { opacity: .55 } }
@keyframes girar { to { transform: rotate(360deg) } }
@keyframes temblar { 0%,100% { transform: translateX(0) } 25% { transform: translateX(-6px) } 75% { transform: translateX(6px) } }
@keyframes dibujar { to { stroke-dashoffset: 0 } }
@keyframes confeti { 0% { transform: translateY(0) rotate(0); opacity: 1 } 100% { transform: translateY(80px) rotate(200deg); opacity: 0 } }

/* ── Pantalla PIN ── */
.pantalla { position: fixed; inset: 0; z-index: 5; display: grid; place-items: center; padding: 20px; animation: fade .3s; }
.pin-card { width: min(100%, 360px); background: var(--card); border-radius: 32px; padding: 30px 26px 24px; box-shadow: var(--shadow); text-align: center; animation: pop .35s cubic-bezier(.2,.8,.2,1); }
.pin-logo { font-size: 46px; animation: latido 2.6s ease-in-out infinite; }
.pin-titulo { font-family: 'Fraunces', serif; font-weight: 700; font-size: 30px; margin-top: 6px; }
.pin-sub { color: var(--text2); font-size: 14px; margin: 4px 0 18px; min-height: 20px; }
.pin-dots { display: flex; justify-content: center; gap: 12px; margin-bottom: 18px; height: 14px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--peach2); transition: all .15s; }
.pin-dots i.on { background: var(--peach); border-color: var(--peach); transform: scale(1.15); }
.pin-dots.mal { animation: temblar .35s; }
.pin-pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; -webkit-user-select: none; user-select: none; }
.pin-pad button { height: 62px; border-radius: 20px; background: var(--card2); border: 1px solid var(--border); font-size: 24px; font-weight: 800; color: var(--text); }
.pin-pad button:active { background: var(--peachTint); }
.pin-pad .pin-aux { font-size: 22px; color: var(--text2); }
.pin-pad .pin-ok { background: var(--peach); color: #fff; border-color: transparent; }
.pin-error { color: var(--rojo); font-size: 13px; font-weight: 700; min-height: 18px; margin-top: 12px; }

/* ── Estructura ── */
.app { position: relative; z-index: 1; min-height: 100dvh; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; padding: calc(10px + env(safe-area-inset-top)) 16px 10px; background: color-mix(in srgb, var(--bg) 82%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px); display: flex; align-items: center; gap: 12px; }
.topbar .bebe-avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--peachTint); display: grid; place-items: center; font-size: 24px; overflow: hidden; border: 2px solid var(--card); box-shadow: var(--shadow-sm); flex: none; }
.topbar .bebe-avatar img { width: 100%; height: 100%; object-fit: cover; }
.topbar .bebe-nombre { font-family: 'Fraunces', serif; font-size: 20px; font-weight: 700; line-height: 1.1; }
.topbar .bebe-edad { font-size: 12.5px; color: var(--text2); font-weight: 700; }
.topbar .espacio { flex: 1; }
.topbar .icono-btn { width: 40px; height: 40px; border-radius: 14px; background: var(--card); border: 1px solid var(--border); display: grid; place-items: center; font-size: 18px; box-shadow: var(--shadow-sm); }
.topbar .quien { display: flex; align-items: center; gap: 6px; padding: 6px 10px 6px 6px; border-radius: 999px; background: var(--card); border: 1px solid var(--border); font-size: 12.5px; font-weight: 800; box-shadow: var(--shadow-sm); }
.topbar .quien b { width: 26px; height: 26px; border-radius: 50%; background: var(--mintTint); display: grid; place-items: center; font-size: 14px; }

.main { flex: 1; width: 100%; max-width: 760px; margin: 0 auto; padding: 6px 14px calc(var(--tab-h) + 24px + env(safe-area-inset-bottom)); }
.main > * { animation: vin .45s cubic-bezier(.2,.8,.2,1) both; }
.main > *:nth-child(2) { animation-delay: .05s } .main > *:nth-child(3) { animation-delay: .1s }
.main > *:nth-child(4) { animation-delay: .15s } .main > *:nth-child(n+5) { animation-delay: .2s }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding: 8px 8px calc(6px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 88%, transparent); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px); border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; border-radius: 16px; font-size: 11px; font-weight: 800; color: var(--text3); padding: 4px 0; transition: color .2s, background .2s; }
.tabbar button .ico { font-size: 21px; transition: transform .25s cubic-bezier(.2,.8,.2,1); filter: grayscale(.4); }
.tabbar button.on { color: var(--peach); background: var(--peachTint); }
.tabbar button.on .ico { transform: translateY(-2px) scale(1.12); filter: none; }
@media (min-width: 720px) {
  .tabbar { max-width: 760px; margin: 0 auto; left: 0; right: 0; border-radius: 24px 24px 0 0; border: 1px solid var(--border); border-bottom: 0; }
}

/* ── Tarjetas ── */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow); }
.card.suave { background: var(--card2); box-shadow: none; }
.card h2, .card h3 { font-family: 'Fraunces', serif; font-weight: 700; }
.card h2 { font-size: 20px; margin-bottom: 10px; }
.card h3 { font-size: 16px; margin-bottom: 8px; }
.card .sub { color: var(--text2); font-size: 13px; }
.card-cab { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.card-cab h2, .card-cab h3 { margin-bottom: 0; }
.fila { display: flex; align-items: center; gap: 10px; }
.entre { justify-content: space-between; }
.envolver { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.grid4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 420px) { .grid4 { grid-template-columns: repeat(2, 1fr); } .grid3 { grid-template-columns: repeat(3, 1fr); } }

.saludo { padding: 10px 4px 14px; }
.saludo h1 { font-family: 'Fraunces', serif; font-size: 28px; font-weight: 700; line-height: 1.15; }
.saludo p { color: var(--text2); font-weight: 700; font-size: 14px; margin-top: 4px; }

/* Contadores vivos */
.vivos { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 14px; }
.vivo { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 14px 14px 12px; box-shadow: var(--shadow-sm); position: relative; overflow: hidden; }
.vivo::before { content: ''; position: absolute; inset: 0 auto 0 0; width: 5px; background: var(--c, var(--peach)); }
.vivo .et { font-size: 11.5px; font-weight: 800; color: var(--text2); text-transform: uppercase; letter-spacing: .06em; display: flex; align-items: center; gap: 6px; }
.vivo .val { font-family: 'Fraunces', serif; font-size: 26px; font-weight: 700; margin: 4px 0 0; line-height: 1.05; font-variant-numeric: tabular-nums; }
.vivo .det { font-size: 12.5px; color: var(--text2); margin-top: 3px; font-weight: 700; }
.vivo.activo { background: linear-gradient(135deg, var(--c-tint, var(--peachTint)), var(--card)); }
.vivo.activo .val { color: var(--c, var(--peach)); animation: respirar 2.2s ease-in-out infinite; }
.vivo .semaforo { position: absolute; top: 12px; right: 12px; width: 10px; height: 10px; border-radius: 50%; }
.s-ok { background: var(--mint); } .s-med { background: var(--sol); } .s-mal { background: var(--rojo); animation: respirar 1.2s infinite; }

/* Botones de un toque */
.acciones { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.accion { background: var(--card); border: 1px solid var(--border); border-radius: 22px; padding: 12px 4px 10px; display: flex; flex-direction: column; align-items: center; gap: 4px; font-size: 12px; font-weight: 800; color: var(--text); box-shadow: var(--shadow-sm); min-height: 78px; }
.accion .ico { font-size: 26px; transition: transform .2s; }
.accion:hover .ico { transform: scale(1.12) rotate(-6deg); }
.accion.ac-peach { background: var(--peachTint); } .accion.ac-mint { background: var(--mintTint); }
.accion.ac-lila { background: var(--lilaTint); } .accion.ac-sol { background: var(--solTint); } .accion.ac-cielo { background: var(--cieloTint); }
.accion.en-curso { border-color: var(--peach); box-shadow: 0 0 0 3px var(--peachTint); }
.accion.en-curso .ico { animation: latido 1.4s ease-in-out infinite; }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 16px; font-weight: 800; font-size: 15px; background: var(--peach); color: #fff; box-shadow: 0 8px 20px -10px var(--peach); min-height: 46px; }
.btn.lleno { width: 100%; }
.btn.sec { background: var(--card2); color: var(--text); border: 1px solid var(--border); box-shadow: none; }
.btn.mint { background: var(--mint); box-shadow: 0 8px 20px -10px var(--mint); }
.btn.lila { background: var(--lila); box-shadow: 0 8px 20px -10px var(--lila); }
.btn.peligro { background: var(--rojoTint); color: var(--rojo); box-shadow: none; }
.btn.chico { padding: 8px 12px; font-size: 13px; min-height: 36px; border-radius: 12px; }
.btn.fantasma { background: transparent; color: var(--peach); box-shadow: none; padding: 6px 8px; min-height: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn.cargando::after { content: ''; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: girar .7s linear infinite; }

/* Chips / segmentos */
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 9px 14px; border-radius: 999px; background: var(--card2); border: 1.5px solid var(--border); font-size: 13.5px; font-weight: 800; color: var(--text2); }
.chip.on { background: var(--peachTint); border-color: var(--peach); color: var(--peach); }
.chip.on.mint { background: var(--mintTint); border-color: var(--mint); color: var(--mint); }
.segmento { display: flex; background: var(--card2); border: 1px solid var(--border); border-radius: 14px; padding: 3px; gap: 2px; }
.segmento button { flex: 1; padding: 9px 6px; border-radius: 11px; font-size: 13px; font-weight: 800; color: var(--text2); }
.segmento button.on { background: var(--card); color: var(--text); box-shadow: var(--shadow-sm); }
.subtabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 10px; scrollbar-width: none; }
.subtabs::-webkit-scrollbar { display: none; }
.subtabs button { flex: none; padding: 9px 14px; border-radius: 999px; font-size: 13.5px; font-weight: 800; color: var(--text2); background: var(--card); border: 1px solid var(--border); }
.subtabs button.on { background: var(--text); color: var(--card); border-color: var(--text); }

/* Formularios */
.campo { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.campo label { font-size: 12.5px; font-weight: 800; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.campo input, .campo select, .campo textarea { width: 100%; padding: 12px 14px; border-radius: 14px; border: 1.5px solid var(--border); background: var(--card2); font-size: 16px; font-weight: 700; color: var(--text); transition: border-color .15s, box-shadow .15s; }
.campo input:focus, .campo select:focus, .campo textarea:focus { outline: none; border-color: var(--peach); box-shadow: 0 0 0 4px var(--peachTint); }
.campo textarea { min-height: 80px; resize: vertical; font-weight: 600; }
.campo .ayuda { font-size: 12px; color: var(--text3); font-weight: 600; }
.campo input[type="number"] { font-variant-numeric: tabular-nums; }
.presets { display: flex; gap: 6px; flex-wrap: wrap; }
.presets button { padding: 8px 12px; border-radius: 12px; background: var(--card2); border: 1px solid var(--border); font-size: 13px; font-weight: 800; color: var(--text2); }
.presets button.on { background: var(--peachTint); color: var(--peach); border-color: var(--peach); }
.toggle { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.toggle:last-child { border-bottom: 0; }
.toggle .sw { position: relative; width: 50px; height: 30px; border-radius: 999px; background: var(--border); transition: background .2s; flex: none; }
.toggle .sw::after { content: ''; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 2px 6px rgba(0,0,0,.2); transition: transform .2s; }
.toggle .sw.on { background: var(--mint); } .toggle .sw.on::after { transform: translateX(20px); }
.stepper { display: flex; align-items: center; gap: 0; background: var(--card2); border: 1.5px solid var(--border); border-radius: 14px; overflow: hidden; }
.stepper button { width: 46px; height: 46px; font-size: 22px; font-weight: 800; color: var(--peach); }
.stepper input { flex: 1; text-align: center; border: 0; background: transparent; font-size: 22px; font-weight: 800; padding: 8px 0; min-width: 0; }
.stepper input:focus { outline: none; }
.numgrande { font-family: 'Fraunces', serif; font-size: 44px; font-weight: 700; text-align: center; font-variant-numeric: tabular-nums; }

/* Hoja (modal deslizante) */
.hoja-fondo { position: fixed; inset: 0; z-index: 90; background: rgba(40,20,20,.35); backdrop-filter: blur(3px); animation: fade .2s; }
.hoja { position: fixed; left: 0; right: 0; bottom: 0; z-index: 95; max-height: 92dvh; overflow-y: auto; background: var(--card); border-radius: 28px 28px 0 0; padding: 12px 18px calc(22px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(0,0,0,.2); animation: subir .3s cubic-bezier(.2,.8,.2,1); max-width: 760px; margin: 0 auto; }
.hoja::before { content: ''; display: block; width: 44px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 12px; }
.hoja h2 { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.hoja .sub { color: var(--text2); font-size: 13.5px; margin-bottom: 14px; font-weight: 600; }
.hoja .pie { display: flex; gap: 10px; margin-top: 16px; }
.hoja .pie .btn { flex: 1; }
.hoja.cerrando { animation: subir .2s reverse forwards; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + 18px + env(safe-area-inset-bottom)); z-index: 200; transform: translate(-50%, 14px); opacity: 0; padding: 11px 18px; border-radius: 999px; background: var(--text); color: var(--card); font-size: 13.5px; font-weight: 800; box-shadow: 0 12px 30px rgba(0,0,0,.25); pointer-events: none; transition: all .2s; max-width: 90vw; text-align: center; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: var(--rojo); color: #fff; }
.toast.exito { background: var(--mint); color: #fff; }

/* Línea de tiempo */
.linea { position: relative; padding-left: 26px; }
.linea::before { content: ''; position: absolute; left: 9px; top: 6px; bottom: 6px; width: 2px; background: var(--border); border-radius: 2px; }
.evento { position: relative; display: flex; gap: 10px; align-items: flex-start; padding: 8px 0; animation: vin .3s both; }
.evento .punto { position: absolute; left: -26px; top: 12px; width: 20px; height: 20px; border-radius: 50%; background: var(--card); border: 2px solid var(--c, var(--peach)); display: grid; place-items: center; font-size: 10px; }
.evento .hora { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--text2); font-size: 12.5px; min-width: 42px; padding-top: 2px; }
.evento .cuerpo { flex: 1; }
.evento .cuerpo b { font-weight: 800; }
.evento .cuerpo small { display: block; color: var(--text2); font-size: 12px; font-weight: 600; }
.evento .editar { color: var(--text3); font-size: 16px; padding: 4px; }

/* Resumen del día */
.resumen { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.resumen div { text-align: center; padding: 10px 4px; border-radius: 16px; background: var(--card2); }
.resumen .n { font-family: 'Fraunces', serif; font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }
.resumen .e { font-size: 11px; font-weight: 800; color: var(--text2); text-transform: uppercase; letter-spacing: .05em; }
.resumen .m { font-size: 11px; color: var(--text3); font-weight: 700; }
.barra { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.barra i { display: block; height: 100%; border-radius: 4px; background: var(--c, var(--mint)); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* Listas */
.lista-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.lista-item:last-child { border-bottom: 0; }
.lista-item .ico { width: 40px; height: 40px; border-radius: 14px; background: var(--c-tint, var(--peachTint)); display: grid; place-items: center; font-size: 20px; flex: none; }
.lista-item .cuerpo { flex: 1; min-width: 0; }
.lista-item .cuerpo b { display: block; font-weight: 800; }
.lista-item .cuerpo small { color: var(--text2); font-size: 12.5px; font-weight: 600; }
.lista-item .der { text-align: right; font-weight: 800; font-size: 13px; color: var(--text2); white-space: nowrap; }
.etiqueta { display: inline-block; padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 800; background: var(--c-tint, var(--peachTint)); color: var(--c, var(--peach)); }
.check { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: 15px; color: #fff; flex: none; transition: all .2s; }
.check.on { background: var(--mint); border-color: var(--mint); animation: pop .25s; }
.check.medio { background: var(--sol); border-color: var(--sol); }
.check.no { background: var(--rojoTint); border-color: var(--rojo); color: var(--rojo); }

/* Gráficas SVG */
.grafica { width: 100%; height: auto; display: block; }
.grafica text { font-family: 'Nunito', sans-serif; font-weight: 800; fill: var(--text2); }
.grafica .eje { stroke: var(--border); stroke-width: 1; }
.grafica .curva { fill: none; stroke-width: 1.5; stroke-linecap: round; }
.grafica .banda { opacity: .18; }
.grafica .bebe-linea { fill: none; stroke: var(--text); stroke-width: 2.5; stroke-linejoin: round; stroke-dasharray: 2000; stroke-dashoffset: 2000; animation: dibujar 1.6s cubic-bezier(.2,.8,.2,1) forwards; }
.grafica .bebe-punto { fill: var(--card); stroke: var(--text); stroke-width: 2.5; animation: pop .4s both; }
.grafica .bebe-punto.ultimo { fill: var(--peach); stroke: var(--peach); r: 6; }
.leyenda { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: var(--text2); font-weight: 700; margin-top: 8px; }
.leyenda i { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 4px; }
.patron { display: grid; grid-template-columns: 34px 1fr; gap: 4px 8px; align-items: center; }
.patron .dia { font-size: 11px; font-weight: 800; color: var(--text2); }
.patron .pista { position: relative; height: 22px; background: var(--card2); border-radius: 6px; overflow: hidden; }
.patron .pista i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.patron .pista .sueno { background: var(--cielo); opacity: .8; }
.patron .pista .toma { width: 4px; background: var(--peach); border-radius: 2px; top: 4px; bottom: 4px; }
.patron .pista .panal { width: 4px; background: var(--sol); top: 14px; bottom: 2px; }
.patron .horas { grid-column: 2; display: flex; justify-content: space-between; font-size: 10px; color: var(--text3); font-weight: 800; }

/* Percentil */
.percentil { display: flex; align-items: baseline; gap: 6px; }
.percentil .p { font-family: 'Fraunces', serif; font-size: 34px; font-weight: 700; }
.percentil .z { font-size: 12px; color: var(--text2); font-weight: 700; }

/* Hitos */
.hito { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); }
.hito:last-child { border-bottom: 0; }
.hito .txt { flex: 1; font-weight: 700; font-size: 14.5px; }
.hito .txt small { display: block; color: var(--text3); font-size: 11.5px; font-weight: 700; }
.hito.logrado .txt { color: var(--text2); }
.progreso-anillo { width: 74px; height: 74px; position: relative; flex: none; }
.progreso-anillo svg { transform: rotate(-90deg); }
.progreso-anillo circle { fill: none; stroke-width: 7; }
.progreso-anillo .track { stroke: var(--border); }
.progreso-anillo .val { stroke: var(--mint); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.progreso-anillo b { position: absolute; inset: 0; display: grid; place-items: center; font-size: 15px; font-weight: 900; }

/* Diario / fotos */
.fotos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.fotos .foto { aspect-ratio: 1; border-radius: 18px; overflow: hidden; background: var(--card2); position: relative; animation: pop .35s both; }
.fotos .foto img { width: 100%; height: 100%; object-fit: cover; }
.fotos .foto span { position: absolute; left: 8px; bottom: 8px; padding: 3px 8px; border-radius: 999px; background: rgba(0,0,0,.5); color: #fff; font-size: 11px; font-weight: 800; }
.fotos .foto.vacia { display: grid; place-items: center; color: var(--text3); font-size: 12px; font-weight: 800; border: 2px dashed var(--border); text-align: center; }
.nota { padding: 12px 0; border-bottom: 1px solid var(--border); }
.nota:last-child { border-bottom: 0; }
.nota .fecha { font-size: 12px; font-weight: 800; color: var(--text3); }
.nota h4 { font-family: 'Fraunces', serif; font-size: 17px; }
.nota p { font-size: 14.5px; line-height: 1.5; white-space: pre-wrap; }
.nota img { max-width: 100%; border-radius: 16px; margin-top: 8px; }

/* Vacío / aviso */
.vacio { text-align: center; color: var(--text2); padding: 28px 10px; font-weight: 700; }
.vacio .ico { font-size: 40px; display: block; margin-bottom: 6px; }
.aviso { padding: 12px 14px; border-radius: 16px; background: var(--solTint); color: var(--text); font-size: 13.5px; font-weight: 700; border-left: 4px solid var(--sol); margin-bottom: 12px; }
.aviso.rojo { background: var(--rojoTint); border-color: var(--rojo); }
.aviso.mint { background: var(--mintTint); border-color: var(--mint); }
.aviso.lila { background: var(--lilaTint); border-color: var(--lila); }
.confeti { position: fixed; z-index: 300; font-size: 22px; pointer-events: none; animation: confeti 1.1s ease-out forwards; }

/* Onboarding */
.bienvenida { max-width: 520px; margin: 0 auto; }
.bienvenida .hero { text-align: center; padding: 26px 0 10px; }
.bienvenida .hero .ico { font-size: 56px; animation: latido 2.6s infinite; }
.bienvenida .hero h1 { font-family: 'Fraunces', serif; font-size: 30px; }

/* Reporte imprimible */
@media print {
  body { background: #fff; }
  #fondo, .tabbar, .topbar, .no-print { display: none !important; }
  .main { padding: 0; max-width: none; }
  .card { box-shadow: none; break-inside: avoid; }
}
