/* ============ Maya — diseño ============ */
:root {
  --bg: #fff5f8;
  --card: #ffffff;
  --text: #2b2330;
  --text-2: #8a7f90;
  --pink: #f06a9b;
  --pink-soft: #ffe3ee;
  --pink-deep: #d94f84;
  --lav: #e9e2ff;
  --mint: #dff5ea;
  --peach: #ffeadd;
  --blue-soft: #e3f0ff;
  --yellow-soft: #fff6d9;
  --danger: #e25555;
  --radius: 22px;
  --shadow: 0 6px 24px rgba(214, 110, 152, .12);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  --safe-top: env(safe-area-inset-top, 0px);
  --borde: #f0dde7;
  --seg: #f3e7ed;
  --barra: rgba(255,255,255,.9);
  --header-bg: rgba(255,245,248,.86);
  --linea: #f7ebf1;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none;
}

.hidden { display: none !important; }

/* ============ Login ============ */
.login-screen {
  min-height: 100dvh;
  display: flex; flex-direction: column; align-items: center;
  padding: 24px 20px calc(24px + var(--safe-bottom));
  overflow-y: auto;
  background: linear-gradient(160deg, #ffe9f2 0%, #fff5f8 45%, #f3edff 100%);
}
.login-card {
  width: 100%; max-width: 400px;
  margin: auto;                 /* centra cuando cabe, deja hacer scroll cuando no */
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  padding: 32px 26px;
  box-shadow: var(--shadow);
  text-align: center;
}
.login-icon { font-size: 56px; margin-bottom: 6px; }
.login-card h1 { font-size: 34px; font-weight: 800; letter-spacing: -.5px; }
.login-sub { color: var(--text-2); margin: 4px 0 14px; font-weight: 600; }
.login-pitch { color: var(--text-2); font-size: 14px; line-height: 1.5; margin: 0 0 20px; }
.login-features {
  display: grid; grid-template-columns: 1fr 1fr; gap: 9px;
  margin-bottom: 22px; text-align: left;
}
.login-feat { border-radius: 16px; padding: 12px 12px 13px; }
.login-feat span { font-size: 22px; display: block; margin-bottom: 5px; }
.login-feat b { font-size: 13px; display: block; line-height: 1.2; color: var(--text); }
.login-feat small { font-size: 11px; color: var(--text-2); line-height: 1.35; display: block; margin-top: 3px; }
.login-cta-demo { margin-bottom: 6px; font-size: 17px; }
.login-demo-hint { font-size: 12px; color: var(--text-2); margin: 0 0 4px; }
.login-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 20px 2px 14px; color: var(--text-2); font-size: 12.5px; font-weight: 600;
}
.login-divider::before, .login-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--borde);
}
.login-card input {
  width: 100%; padding: 15px 18px; margin-bottom: 12px;
  border: 1.5px solid var(--borde); border-radius: 16px;
  font-size: 17px; background: var(--card); color: var(--text);
  outline: none; transition: border-color .2s;
}
.login-card input:focus { border-color: var(--pink); }
.login-error { color: var(--danger); margin-top: 14px; font-size: 15px; animation: shake .35s; }
@keyframes shake { 0%,100%{transform:translateX(0)} 25%{transform:translateX(-7px)} 75%{transform:translateX(7px)} }

/* ============ Estructura ============ */
.app { min-height: 100dvh; display: flex; flex-direction: column; }

.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  padding: calc(14px + var(--safe-top)) 20px 10px;
  background: var(--header-bg);
  backdrop-filter: blur(18px);
}
.app-header h1 { font-size: 28px; font-weight: 800; letter-spacing: -.5px; }
.header-sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.header-right { display: flex; align-items: center; gap: 12px; }
.icon-btn { background: none; border: none; font-size: 22px; cursor: pointer; padding: 4px; }

.sync-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: #cfc6d4; display: inline-block;
}
.sync-dot.ok { background: #4cc38a; }
.sync-dot.busy { background: #f5b54a; animation: pulse 1s infinite; }
.sync-dot.error { background: var(--danger); }
@keyframes pulse { 50% { opacity: .35; } }

.main {
  flex: 1;
  padding: 8px 16px calc(96px + var(--safe-bottom));
  max-width: 560px; width: 100%; margin: 0 auto;
}

/* ============ Tab bar ============ */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-around;
  padding: 8px 8px calc(8px + var(--safe-bottom));
  background: var(--barra);
  backdrop-filter: blur(18px);
  border-top: 1px solid rgba(214,110,152,.12);
}
.tab {
  flex: 1; max-width: 110px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-size: 11px; font-weight: 600; color: var(--text-2);
  padding: 6px 0; border-radius: 14px; transition: color .15s;
}
.tab-icon { font-size: 22px; filter: grayscale(.7) opacity(.7); transition: filter .15s, transform .15s; }
.tab.active { color: var(--pink-deep); }
.tab.active .tab-icon { filter: none; transform: scale(1.12); }

/* ============ Componentes ============ */
.card {
  background: var(--card); border-radius: var(--radius);
  padding: 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.card h2 { font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.card-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.section-title {
  font-size: 22px; font-weight: 800; letter-spacing: -.4px;
  margin: 14px 4px 12px;
}

.btn-primary {
  background: linear-gradient(135deg, var(--pink) 0%, var(--pink-deep) 100%);
  color: #fff; border: none; border-radius: 16px;
  padding: 15px 22px; font-size: 17px; font-weight: 700;
  cursor: pointer; transition: transform .1s, opacity .15s;
}
.btn-primary:active { transform: scale(.97); }
.btn-secondary {
  background: var(--pink-soft); color: var(--pink-deep);
  border: none; border-radius: 16px;
  padding: 13px 20px; font-size: 16px; font-weight: 700; cursor: pointer;
}
.btn-secondary:active { transform: scale(.97); }
.btn-ghost {
  background: none; border: none; color: var(--pink-deep);
  font-size: 15px; font-weight: 600; cursor: pointer; padding: 8px;
}
.btn-danger { background: #ffe5e5; color: var(--danger); border: none; border-radius: 16px; padding: 13px 20px; font-size: 16px; font-weight: 700; cursor: pointer; }
.btn-block { width: 100%; display: block; }

/* resumen del día (inicio) */
.stats-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.stat-card {
  border-radius: var(--radius); padding: 16px;
  display: flex; flex-direction: column; gap: 4px;
  box-shadow: var(--shadow);
}
.stat-card .stat-emoji { font-size: 24px; }
.stat-card .stat-value { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.stat-card .stat-label { font-size: 13px; color: var(--text-2); font-weight: 600; }
.stat-card .stat-ago { font-size: 12px; color: var(--text-2); }
/* mini-stats compactas (pipí/popó): más info por menos espacio */
.mini-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.mini-stat {
  display: flex; align-items: center; gap: 10px;
  border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow);
}
.mini-stat .ms-emoji {
  font-size: 20px; width: 40px; height: 40px; flex: none;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; background: rgba(255,255,255,.55);
}
.mini-stat .ms-value { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.mini-stat .ms-label { font-size: 12.5px; color: var(--text-2); font-weight: 600; }
.bg-peach { background: var(--peach); }
.bg-lav { background: var(--lav); }
.bg-mint { background: var(--mint); }
.bg-blue { background: var(--blue-soft); }
.bg-pink { background: var(--pink-soft); }
.bg-yellow { background: var(--yellow-soft); }

.quick-actions { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.quick-btn {
  border: none; border-radius: 18px; padding: 14px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 700; color: var(--text);
  cursor: pointer; box-shadow: var(--shadow); background: var(--card);
}
/* círculo con tinte por acción: color = categoría, más fácil de ubicar */
.quick-btn span:first-child {
  font-size: 24px; width: 46px; height: 46px; margin-bottom: 2px;
  display: flex; align-items: center; justify-content: center; border-radius: 50%;
}
.quick-btn[data-accion="toma-izq"] span:first-child,
.quick-btn[data-accion="toma-der"] span:first-child { background: color-mix(in srgb, var(--pink) 15%, transparent); }
.quick-btn[data-accion="dormir"] span:first-child { background: color-mix(in srgb, #8b6ef0 15%, transparent); }
.quick-btn[data-accion="panal-pipi"] span:first-child { background: color-mix(in srgb, #4a97e8 15%, transparent); }
.quick-btn[data-accion="panal-popo"] span:first-child { background: color-mix(in srgb, #c8963c 18%, transparent); }
.quick-btn[data-accion="biberon"] span:first-child { background: color-mix(in srgb, #e0a37a 20%, transparent); }
.quick-btn:active { transform: scale(.96); }

/* segmento */
.segmented {
  display: flex; background: var(--seg); border-radius: 14px; padding: 4px; margin-bottom: 16px;
}
.segmented button {
  flex: 1; border: none; background: none; padding: 10px 4px;
  font-size: 14px; font-weight: 700; color: var(--text-2);
  border-radius: 11px; cursor: pointer; transition: all .15s;
}
.segmented button.active { background: var(--card); color: var(--text); box-shadow: 0 2px 8px rgba(0,0,0,.08); }

/* botones de pecho */
.boob-buttons { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.boob-btn {
  border: none; border-radius: 24px; padding: 26px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  cursor: pointer; box-shadow: var(--shadow);
  font-size: 16px; font-weight: 800; color: var(--text);
}
.boob-btn .big { font-size: 36px; }
.boob-btn .hint { font-size: 12px; font-weight: 600; color: var(--text-2); }
.boob-btn:active { transform: scale(.96); }
.boob-izq { background: linear-gradient(150deg, #ffe3ee, #ffd1e3); }
.boob-der { background: linear-gradient(150deg, #e9e2ff, #dcd1ff); }

/* timer activo */
.active-timers { max-width: 560px; width: 100%; margin: 0 auto; padding: 0 16px; }
.timer-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  background: linear-gradient(135deg, #ffd9e8, #ffc4da);
  border-radius: 18px; padding: 12px 16px; margin: 8px 0;
  box-shadow: var(--shadow);
}
.timer-banner.sleep { background: linear-gradient(135deg, #ddd3ff, #cfc2ff); }
.timer-banner .timer-info { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 15px; }
.timer-banner .timer-clock { font-variant-numeric: tabular-nums; font-size: 22px; font-weight: 800; }
.timer-banner button {
  border: none; border-radius: 12px; padding: 9px 14px;
  font-weight: 800; font-size: 14px; cursor: pointer; background: var(--card); color: var(--pink-deep);
}
.timer-banner button.stop { background: var(--pink-deep); color: #fff; }

/* listas de registros */
.entry-list { display: flex; flex-direction: column; gap: 8px; }
.day-label { font-size: 13px; font-weight: 800; color: var(--text-2); text-transform: uppercase; letter-spacing: .5px; margin: 14px 4px 4px; }
.entry {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 12px 14px;
  box-shadow: 0 2px 10px rgba(214,110,152,.08);
}
.entry .entry-emoji { font-size: 24px; }
.entry .entry-main { flex: 1; min-width: 0; }
.entry .entry-title { font-weight: 700; font-size: 15px; }
.entry .entry-sub { font-size: 13px; color: var(--text-2); margin-top: 1px; }
.entry .entry-time { font-size: 13px; font-weight: 700; color: var(--text-2); white-space: nowrap; }
.entry .entry-actions { display: flex; gap: 2px; }
.entry .entry-actions button { background: none; border: none; font-size: 16px; cursor: pointer; padding: 6px; opacity: .55; }

.empty-state { text-align: center; color: var(--text-2); padding: 36px 20px; font-size: 15px; }
.empty-state .big { font-size: 44px; display: block; margin-bottom: 10px; }

/* pañal: botones gigantes */
.diaper-buttons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-bottom: 16px; }
.diaper-btn {
  border: none; border-radius: 22px; padding: 22px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 14px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
}
.diaper-btn span:first-child { font-size: 34px; }
.diaper-btn:active { transform: scale(.95); }

/* formularios en hoja */
.sheet-backdrop {
  position: fixed; inset: 0; background: rgba(43,35,48,.4); z-index: 40;
  animation: fadein .2s;
}
@keyframes fadein { from { opacity: 0 } }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 41;
  background: var(--bg); border-radius: 26px 26px 0 0;
  padding: 10px 20px calc(24px + var(--safe-bottom));
  max-height: 88dvh; overflow-y: auto;
  max-width: 560px; margin: 0 auto;
  animation: slideup .25s cubic-bezier(.2,.9,.3,1);
}
@keyframes slideup { from { transform: translateY(100%) } }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: #e0d3da; margin: 4px auto 14px; }
.sheet h2 { font-size: 21px; font-weight: 800; margin-bottom: 16px; }

.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 13px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%; padding: 13px 15px; font-size: 16px;
  border: 1.5px solid var(--borde); border-radius: 14px; background: var(--card); color: var(--text);
  outline: none; font-family: inherit;
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus { border-color: var(--pink); }
.form-row { display: flex; gap: 10px; }
.form-row .form-group { flex: 1; }

/* stepper de ml */
.ml-stepper { display: flex; align-items: center; justify-content: center; gap: 18px; margin: 10px 0 16px; }
.ml-stepper button {
  width: 52px; height: 52px; border-radius: 50%; border: none;
  background: var(--pink-soft); color: var(--pink-deep);
  font-size: 26px; font-weight: 800; cursor: pointer;
}
.ml-stepper .ml-value { font-size: 40px; font-weight: 800; min-width: 120px; text-align: center; letter-spacing: -1px; }
.ml-stepper .ml-value small { font-size: 17px; color: var(--text-2); font-weight: 700; }
.ml-presets { display: flex; gap: 8px; justify-content: center; margin-bottom: 16px; flex-wrap: wrap; }
.ml-presets button {
  border: none; background: var(--card); box-shadow: var(--shadow);
  border-radius: 12px; padding: 9px 16px; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--text);
}

/* condiciones */
.condition-card { border-left: 5px solid var(--pink); }
.measure-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid var(--linea); font-size: 15px; }
.measure-row:last-child { border-bottom: none; }
.measure-val { font-weight: 800; }
.measure-pending { color: #c08a2e; font-weight: 700; }
.info-box {
  background: var(--blue-soft); border-radius: 16px; padding: 14px; margin-top: 12px;
  font-size: 14px; line-height: 1.5;
}
.info-box h4 { font-size: 14px; margin-bottom: 6px; }
.info-box a { color: #2563ad; font-weight: 600; }
.info-box ul { padding-left: 18px; margin: 6px 0; }
.care-box { background: var(--mint); border-radius: 16px; padding: 14px; margin-top: 10px; font-size: 14px; line-height: 1.5; }
.care-box h4 { font-size: 14px; margin-bottom: 6px; }
.care-box ul { padding-left: 18px; }
.disclaimer { font-size: 12px; color: var(--text-2); margin-top: 10px; font-style: italic; }

/* fotos */
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-grid img {
  width: 100%; aspect-ratio: 1; object-fit: cover;
  border-radius: 14px; cursor: pointer; background: var(--pink-soft);
}
/* mientras carga la miniatura, un brillo suave en vez de un hueco vacío */
.photo-grid img.foto-cargando {
  background: linear-gradient(100deg, var(--pink-soft) 30%, rgba(255,255,255,.6) 50%, var(--pink-soft) 70%);
  background-size: 200% 100%; animation: foto-brillo 1.2s ease-in-out infinite;
}
@keyframes foto-brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { .photo-grid img.foto-cargando { animation: none; } }
.photo-viewer {
  position: fixed; inset: 0; z-index: 60; background: rgba(20,15,22,.92);
  display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 20px;
}
.photo-viewer img { max-width: 100%; max-height: 75dvh; border-radius: 14px; }
.photo-viewer .pv-caption { color: #fff; margin-top: 12px; font-size: 14px; text-align: center; }
.photo-viewer .pv-actions { margin-top: 14px; display: flex; gap: 12px; }

/* menú "Más" */
.menu-list { display: flex; flex-direction: column; gap: 10px; }
.menu-item {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border: none; border-radius: 18px; padding: 16px;
  box-shadow: var(--shadow); cursor: pointer; text-align: left;
  font-size: 16px; font-weight: 700; color: var(--text); width: 100%;
}
.menu-item .mi-emoji { font-size: 26px; width: 44px; height: 44px; display: flex; align-items: center; justify-content: center; border-radius: 13px; }
.menu-item .mi-sub { display: block; font-size: 12.5px; color: var(--text-2); font-weight: 500; margin-top: 1px; }
.menu-item .mi-chev { margin-left: auto; color: #d4c6cd; font-size: 18px; }

.back-row { display: flex; align-items: center; gap: 4px; margin: 6px 0 2px; }
.back-row button { background: none; border: none; color: var(--pink-deep); font-size: 16px; font-weight: 700; cursor: pointer; padding: 8px 4px; }

.toast {
  position: fixed; bottom: calc(100px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  background: var(--text); color: #fff; padding: 12px 22px;
  border-radius: 100px; font-size: 15px; font-weight: 600; z-index: 70;
  box-shadow: 0 8px 24px rgba(0,0,0,.25); white-space: nowrap;
  animation: toastin .25s;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 12px) } }

.checkbox-row { display: flex; align-items: center; gap: 10px; padding: 10px 2px; font-size: 16px; font-weight: 600; }
.checkbox-row input { width: 22px; height: 22px; accent-color: var(--pink-deep); }

canvas.chart { width: 100% !important; }

@media (min-width: 600px) {
  .app-header, .active-timers { max-width: 560px; margin: 0 auto; }
}

/* ============ avatar y pull-to-refresh ============ */
.header-left { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.header-avatar {
  width: 42px; height: 42px; border-radius: 50%; object-fit: cover;
  border: 2.5px solid #fff; box-shadow: 0 2px 10px rgba(214,110,152,.3);
}
.header-avatar.girando { animation: girar 1s linear infinite; }
@keyframes girar { to { transform: rotate(360deg); } }

.ptr {
  position: fixed; top: calc(8px + var(--safe-top)); left: 50%;
  transform: translate(-50%, -60px); z-index: 50;
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--card); box-shadow: var(--shadow);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; transition: transform .2s;
}
.ptr.visible { transform: translate(-50%, 10px); }
.ptr.girando .ptr-spinner { display: inline-block; animation: latir .7s infinite; }
@keyframes latir { 50% { transform: scale(1.35); } }

/* 6 pestañas: etiquetas un poco más compactas */
.tab { font-size: 10px; }

/* ============ retos / actividades ============ */
.retos-hero {
  border-radius: 26px; padding: 20px;
  background: linear-gradient(135deg, #ff9ec3 0%, #c79df5 100%);
  color: #fff; box-shadow: 0 10px 30px rgba(199,157,245,.4);
  display: flex; align-items: center; gap: 18px; margin-bottom: 16px;
  animation: hero-in .5s cubic-bezier(.2,.9,.3,1);
}
@keyframes hero-in { from { opacity: 0; transform: translateY(14px) scale(.97); } }
.retos-hero h2 { font-size: 19px; font-weight: 800; margin-bottom: 2px; }
.retos-hero .hero-sub { font-size: 13px; opacity: .9; }
.racha-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.22); border-radius: 100px;
  padding: 5px 12px; font-size: 13px; font-weight: 800; margin-top: 8px;
}
.racha-chip .flama { display: inline-block; animation: flamear 1s infinite alternate; }
@keyframes flamear { from { transform: scale(1) rotate(-4deg); } to { transform: scale(1.18) rotate(4deg); } }

.anillo { position: relative; width: 86px; height: 86px; flex-shrink: 0; }
.anillo svg { transform: rotate(-90deg); }
.anillo circle { fill: none; stroke-width: 8; stroke-linecap: round; }
.anillo .fondo { stroke: rgba(255,255,255,.25); }
.anillo .avance { stroke: #fff; transition: stroke-dashoffset .8s cubic-bezier(.2,.9,.3,1); }
.anillo .num {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  font-size: 19px; font-weight: 800; line-height: 1;
}
.anillo .num small { font-size: 10px; font-weight: 700; opacity: .85; }

.tarea {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 20px; padding: 14px;
  box-shadow: var(--shadow); margin-bottom: 10px;
  opacity: 0; animation: tarea-in .45s cubic-bezier(.2,.9,.3,1) forwards;
}
.tarea:nth-child(1) { animation-delay: .03s } .tarea:nth-child(2) { animation-delay: .09s }
.tarea:nth-child(3) { animation-delay: .15s } .tarea:nth-child(4) { animation-delay: .21s }
.tarea:nth-child(5) { animation-delay: .27s } .tarea:nth-child(6) { animation-delay: .33s }
.tarea:nth-child(7) { animation-delay: .39s } .tarea:nth-child(8) { animation-delay: .45s }
@keyframes tarea-in { from { opacity: 0; transform: translateX(-16px); } to { opacity: 1; } }

.tarea .t-emoji {
  width: 48px; height: 48px; border-radius: 15px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 26px;
  background: var(--pink-soft);
}
.tarea.especial .t-emoji { background: linear-gradient(135deg, #ffe9a8, #ffd166); }
.tarea .t-main { flex: 1; min-width: 0; }
.tarea .t-titulo { font-weight: 800; font-size: 15px; }
.tarea .t-desc { font-size: 12.5px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }
.tarea .t-cond { display: inline-block; font-size: 10.5px; font-weight: 800; color: #b06a00;
  background: #fff1d6; border-radius: 100px; padding: 2px 8px; margin-bottom: 3px; }

.t-check {
  width: 46px; height: 46px; border-radius: 50%; border: 2.5px dashed #e8c9d8;
  background: none; font-size: 22px; cursor: pointer; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .2s; color: transparent;
}
.t-check.lista {
  border: none; background: linear-gradient(135deg, #4cc38a, #2ea06d);
  color: #fff; animation: pop-check .45s cubic-bezier(.3,1.6,.4,1);
  box-shadow: 0 4px 14px rgba(76,195,138,.45);
}
@keyframes pop-check { 0% { transform: scale(.3) rotate(-30deg); } 70% { transform: scale(1.2) rotate(6deg); } 100% { transform: scale(1); } }
.t-play {
  width: 46px; height: 46px; border-radius: 50%; border: none; flex-shrink: 0;
  background: linear-gradient(135deg, var(--pink), var(--pink-deep)); color: #fff;
  font-size: 17px; font-weight: 800; cursor: pointer;
  box-shadow: 0 4px 14px rgba(240,106,155,.4);
  display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1;
}
.t-play small { font-size: 8.5px; font-weight: 800; }
.t-play:active, .t-check:active { transform: scale(.92); }
.tarea.hecha { opacity: .75 !important; }
.tarea.hecha .t-titulo { text-decoration: line-through; text-decoration-color: #4cc38a; }

/* timer de actividad en curso */
.timer-banner.actividad { background: linear-gradient(135deg, #c9f3de, #a8e8c8); }
.timer-banner.actividad .timer-clock { color: #1d7a4f; }

/* medallas */
.medallero { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.medalla {
  background: var(--card); border-radius: 18px; padding: 12px 6px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  box-shadow: var(--shadow); text-align: center; position: relative; overflow: hidden;
}
.medalla .m-emoji { font-size: 28px; filter: grayscale(1) opacity(.35); }
.medalla .m-nombre { font-size: 10px; font-weight: 800; color: var(--text-2); }
.medalla.ganada .m-emoji { filter: none; animation: medalla-pop .5s cubic-bezier(.3,1.6,.4,1); }
.medalla.ganada .m-nombre { color: var(--text); }
.medalla.ganada::after {
  content: ''; position: absolute; top: -60%; left: -70%; width: 50%; height: 220%;
  background: linear-gradient(105deg, transparent, rgba(255,255,255,.9), transparent);
  transform: rotate(20deg); animation: brillo 2.8s infinite;
}
@keyframes medalla-pop { 0% { transform: scale(.4); } 70% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes brillo { 0% { left: -70%; } 45% { left: 130%; } 100% { left: 130%; } }

/* confeti */
.confeti {
  position: fixed; top: -12px; z-index: 80; pointer-events: none;
  width: 10px; height: 10px; border-radius: 2px;
  animation: confeti-cae linear forwards;
}
@keyframes confeti-cae {
  to { transform: translateY(105vh) rotate(720deg); opacity: .9; }
}

/* celebración de día completo */
.celebracion {
  position: fixed; inset: 0; z-index: 75; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}
.celebracion .cele-card {
  background: var(--card); border-radius: 26px; padding: 28px 34px; text-align: center;
  box-shadow: 0 18px 60px rgba(0,0,0,.25);
  animation: cele-in .55s cubic-bezier(.3,1.5,.4,1), cele-out .4s ease 2.6s forwards;
}
.celebracion .cele-emoji { font-size: 54px; display: block; animation: flamear .8s infinite alternate; }
.celebracion .cele-texto { font-size: 19px; font-weight: 800; margin-top: 8px; }
.celebracion .cele-sub { font-size: 13px; color: var(--text-2); margin-top: 2px; }
@keyframes cele-in { 0% { transform: scale(.3); opacity: 0; } 100% { transform: scale(1); opacity: 1; } }
@keyframes cele-out { to { transform: scale(.8); opacity: 0; } }

/* tarjeta de foto semanal */
.foto-semanal {
  border-radius: 22px; padding: 16px; margin-bottom: 14px;
  background: linear-gradient(135deg, #fff6e3, #ffe9c7);
  box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 12px;
  animation: hero-in .5s cubic-bezier(.2,.9,.3,1);
}
.foto-semanal .fs-emoji { font-size: 34px; animation: flamear 1.2s infinite alternate; }
.foto-semanal .fs-titulo { font-weight: 800; font-size: 15px; }
.foto-semanal .fs-sub { font-size: 12.5px; color: #9a7430; margin-top: 1px; }
.foto-semanal button {
  margin-left: auto; border: none; border-radius: 14px; padding: 11px 16px;
  background: #2b2330; color: #fff; font-weight: 800; font-size: 13px; cursor: pointer;
  flex-shrink: 0;
}

/* ============ vigilia y colores de popó ============ */
.timer-banner.vigilia { background: linear-gradient(135deg, #ffe9b8, #ffd98c); }
.timer-banner.vigilia .timer-clock { color: #9a6b00; }

.sueno-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-bottom: 8px; }
.sueno-botones button {
  border: none; border-radius: 22px; padding: 22px 8px;
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 15px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
  color: var(--text);
}
.sueno-botones button span:first-child { font-size: 32px; }
.sueno-botones button:active { transform: scale(.96); }
.sueno-botones .hint { font-size: 11.5px; font-weight: 600; color: var(--text-2); }

.color-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 8px 0 4px; }
.color-opt {
  border: 2.5px solid transparent; border-radius: 16px; padding: 10px 6px;
  background: var(--card); cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--text);
}
.color-opt .bolita { width: 30px; height: 30px; border-radius: 50%; border: 2px solid rgba(0,0,0,.08); }
.color-opt.activo { border-color: var(--pink-deep); }
.color-opt:active { transform: scale(.95); }

.color-dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.12); vertical-align: -1px; }

/* ============ bitácora de vigilia ============ */
.quien-chips { display: flex; gap: 8px; margin: 6px 0 12px; }
.quien-chips button {
  flex: 1; border: none; border-radius: 100px; padding: 10px 6px;
  font-weight: 700; font-size: 13.5px; cursor: pointer;
  background: #f3e7ed; color: var(--text-2); transition: all .15s;
}
.quien-chips button.activo {
  background: linear-gradient(135deg, #ffd98c, #ffc964); color: #7a5200;
  transform: scale(1.04);
}
.bitacora { margin: 6px 0 10px; }
.bitacora-item {
  display: flex; align-items: baseline; gap: 8px;
  padding: 7px 0; border-bottom: 1px solid var(--linea); font-size: 14px;
}
.bitacora-item:last-child { border-bottom: none; }
.bitacora-item b { color: #9a6b00; font-variant-numeric: tabular-nums; white-space: nowrap; font-size: 12.5px; }
.bitacora-item span { flex: 1; }
.bitacora-item .bit-x { background: none; border: none; cursor: pointer; opacity: .45; font-size: 14px; }
.vig-add { display: flex; gap: 8px; }
.vig-add input {
  flex: 1; padding: 12px 14px; border: 1.5px solid var(--borde);
  border-radius: 14px; font-size: 15px; outline: none; background: var(--card); color: var(--text);
}
.vig-add input:focus { border-color: var(--pink); }
.vig-add button {
  border: none; border-radius: 14px; padding: 0 18px;
  background: var(--pink-deep); color: #fff; font-size: 20px; font-weight: 800; cursor: pointer;
}
.entry-bitacora {
  font-size: 12.5px; color: var(--text-2); margin-top: 5px;
  border-left: 2.5px solid #ffd98c; padding-left: 8px; line-height: 1.5;
}
.entry-bitacora b { color: #9a6b00; font-variant-numeric: tabular-nums; }

/* etiqueta de quién escribió cada nota */
.bit-autor {
  display: inline-block; font-size: 10px; font-weight: 800;
  background: var(--pink-soft); color: var(--pink-deep);
  border-radius: 100px; padding: 1.5px 7px; margin-left: 5px;
  vertical-align: 1px; white-space: nowrap;
}
.dispositivo-botones { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.dispositivo-botones button {
  border: none; border-radius: 20px; padding: 22px 10px;
  font-size: 16px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
  display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text);
}
.dispositivo-botones button span:first-child { font-size: 34px; }
.dispositivo-botones button:active { transform: scale(.95); }

/* ============ foto y análisis de popó ============ */
.color-opt.sugerido { border-color: #f5b54a; background: #fff8e8; animation: pop-check .4s; }
.pp-analizando { text-align: center; padding: 14px; color: var(--text-2); font-weight: 700; animation: pulse 1s infinite; }
.pp-resultado {
  display: flex; gap: 12px; align-items: flex-start;
  background: var(--blue-soft); border-radius: 16px; padding: 12px; margin-top: 10px;
  font-size: 13.5px; line-height: 1.45; animation: hero-in .4s;
}
.pp-resultado img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.pp-resultado small { color: var(--text-2); }
.entry-thumb { width: 40px; height: 40px; object-fit: cover; border-radius: 10px; cursor: pointer; background: var(--pink-soft); }

/* ============ banco de leche ============ */
.banco-card {
  display: flex; align-items: center; gap: 16px;
  background: var(--card); border-radius: 22px; padding: 14px 16px;
  box-shadow: var(--shadow); margin-bottom: 14px; cursor: pointer;
}
.banco-card:active { transform: scale(.985); }
.banco-info { flex: 1; min-width: 0; }
.banco-info .b-titulo { font-weight: 800; font-size: 15px; }
.banco-info .b-ml { font-size: 24px; font-weight: 800; letter-spacing: -.5px; margin: 1px 0; }
.banco-info .b-sub { font-size: 12.5px; color: var(--text-2); }
.nivel-chip {
  display: inline-block; font-size: 11px; font-weight: 800; color: #fff;
  border-radius: 100px; padding: 3px 10px; margin-top: 5px;
}

.tanque {
  position: relative; width: 56px; height: 82px; flex-shrink: 0;
  border-radius: 14px 14px 18px 18px;
  background: linear-gradient(180deg, #faf4f8, #f3eaf0);
  border: 3px solid #e8d9e1; overflow: hidden;
}
.tanque::before { /* cuello del tanque */
  content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
  width: 22px; height: 5px; border-radius: 0 0 6px 6px; background: #e8d9e1;
}
.tanque .nivel {
  position: absolute; left: 0; right: 0; bottom: 0;
  transition: height .9s cubic-bezier(.2,.9,.3,1), background-color .4s;
}
.tanque .nivel .ola {
  position: absolute; top: -6px; left: -20%; width: 140%; height: 12px;
  background: inherit; opacity: .65; border-radius: 45%;
  animation: olita 3s linear infinite;
}
@keyframes olita { from { transform: rotate(0) } to { transform: rotate(360deg) } }
.tanque.grande { width: 92px; height: 132px; border-radius: 18px 18px 24px 24px; }

.banco-saldos { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 14px 0; }
.banco-saldo {
  border-radius: 18px; padding: 14px; text-align: center; box-shadow: var(--shadow);
}
.banco-saldo .bs-ml { font-size: 24px; font-weight: 800; letter-spacing: -.5px; }
.banco-saldo .bs-label { font-size: 12px; color: var(--text-2); font-weight: 700; }
.banco-acciones { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 8px; }
.banco-acciones button {
  border: none; border-radius: 16px; padding: 14px 8px;
  font-size: 13.5px; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
  background: var(--card); color: var(--text);
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.banco-acciones button span { font-size: 19px; }
.banco-acciones button:active { transform: scale(.96); }

/* ============ timer de extracción y producción ============ */
.timer-banner.extraccion { background: linear-gradient(135deg, #c8ecf5, #a5dded); }
.timer-banner.extraccion .timer-clock { color: #0e6b8c; }
.fase-chip {
  display: inline-block; background: rgba(255,255,255,.55); border-radius: 100px;
  padding: 2px 10px; font-size: 11.5px; font-weight: 800; color: #0e6b8c;
}
.prod-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 12px 0; }
.prod-stat { background: var(--card); border-radius: 14px; padding: 10px 4px; text-align: center; box-shadow: 0 2px 10px rgba(214,110,152,.08); }
.prod-stat .ps-num { font-size: 16px; font-weight: 800; letter-spacing: -.3px; }
.prod-stat .ps-label { font-size: 10px; color: var(--text-2); font-weight: 700; }
.prod-stat.record { background: linear-gradient(135deg, #fff6d9, #ffedb3); }
.tips-card { background: var(--blue-soft); border-radius: 20px; padding: 16px; margin-bottom: 14px; }
.tips-card h3 { font-size: 15px; font-weight: 800; margin-bottom: 4px; }
.tips-card .tc-resumen { font-size: 12px; color: #4a6b85; font-weight: 600; margin-bottom: 10px; }
.tip-item { display: flex; gap: 10px; padding: 8px 0; border-top: 1px solid var(--linea); font-size: 13.5px; line-height: 1.45; }
.tip-item .t-emoji { font-size: 20px; flex-shrink: 0; }

/* ============ selector de bebés ============ */
.bebes-bar {
  max-width: 560px; width: 100%; margin: 0 auto; padding: 6px 16px 0;
  display: flex; gap: 8px; overflow-x: auto;
}
.bebe-chip {
  border: none; border-radius: 100px; padding: 8px 16px;
  background: var(--card); box-shadow: var(--shadow); cursor: pointer;
  font-size: 13.5px; font-weight: 800; color: var(--text-2);
  white-space: nowrap; display: flex; align-items: center; gap: 6px;
  transition: all .15s;
}
.bebe-chip.activo {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff; transform: scale(1.04);
}
.bebe-chip.agregar { color: var(--pink-deep); border: 1.5px dashed #e8c9d8; background: none; box-shadow: none; }

/* ============ análisis general ============ */
.analisis-estado {
  border-radius: 22px; padding: 18px; margin-bottom: 14px; color: #fff;
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow);
  animation: hero-in .5s cubic-bezier(.2,.9,.3,1);
}
.analisis-estado .ae-emoji { font-size: 40px; }
.analisis-estado .ae-titulo { font-size: 18px; font-weight: 800; }
.analisis-estado .ae-sub { font-size: 13px; opacity: .92; margin-top: 2px; }
.hallazgo {
  display: flex; gap: 12px; background: var(--card); border-radius: 18px;
  padding: 14px; margin-bottom: 10px; box-shadow: var(--shadow);
  font-size: 14px; line-height: 1.45;
}
.hallazgo .h-emoji { font-size: 22px; flex-shrink: 0; }
.hallazgo b { display: block; font-size: 14.5px; }
.hallazgo .h-dato { color: var(--text-2); font-size: 12.5px; margin-top: 3px; }
.hallazgo.nivel-bien { border-left: 4px solid #4cc38a; }
.hallazgo.nivel-observar { border-left: 4px solid #f5b54a; }
.hallazgo.nivel-atencion { border-left: 4px solid #e25555; }
.analisis-mini {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 20px; padding: 13px 16px;
  box-shadow: var(--shadow); margin-bottom: 14px; cursor: pointer;
}
.analisis-mini .am-emoji { font-size: 26px; }
.analisis-mini .am-texto { flex: 1; font-size: 13.5px; font-weight: 700; }
.analisis-mini .am-sub { display: block; font-size: 12px; color: var(--text-2); font-weight: 600; }

/* ============ temas de color ============ */
:root[data-tema="noche"] {
  --bg: #191420;
  --card: #262030;
  --text: #f3ecf4;
  --text-2: #a595a8;
  --pink: #f06a9b;
  --pink-soft: #45283a;
  --pink-deep: #e05c8f;
  --lav: #332a4d;
  --mint: #1f3a2d;
  --peach: #3e2d24;
  --blue-soft: #22303f;
  --yellow-soft: #3a3220;
  --borde: #453a4e;
  --seg: #322a3d;
  --barra: rgba(30,24,38,.92);
  --header-bg: rgba(25,20,32,.88);
  --linea: #382f42;
  --shadow: 0 6px 24px rgba(0,0,0,.35);
}
:root[data-tema="menta"] {
  --bg: #f1faf5;
  --pink: #2eb381;
  --pink-soft: #d5f3e5;
  --pink-deep: #1d9468;
  --peach: #e8f6e3;
  --lav: #e2f0ec;
  --yellow-soft: #f4f7d9;
  --borde: #d8ece1;
  --seg: #e2f0e9;
  --barra: rgba(255,255,255,.92);
  --header-bg: rgba(241,250,245,.88);
  --linea: #e6f2eb;
  --shadow: 0 6px 24px rgba(46,179,129,.13);
}
:root[data-tema="lavanda"] {
  --bg: #f5f2ff;
  --pink: #8b6ef0;
  --pink-soft: #e7e0ff;
  --pink-deep: #6f4fe0;
  --peach: #efe9ff;
  --mint: #e4f0ee;
  --borde: #e2daf5;
  --seg: #e9e3f8;
  --barra: rgba(255,255,255,.92);
  --header-bg: rgba(245,242,255,.88);
  --linea: #ece6fa;
  --shadow: 0 6px 24px rgba(139,110,240,.14);
}
:root[data-tema="noche"] .login-screen { background: linear-gradient(160deg, #241b2e 0%, #191420 55%, #1f1830 100%); }
:root[data-tema="noche"] .login-card { background: rgba(38,32,48,.9); }
:root[data-tema="noche"] .login-card input { background: var(--card); color: var(--text); }
:root[data-tema="noche"] .segmented button.active { box-shadow: none; background: #453a52; color: var(--text); }
:root[data-tema="noche"] .boob-izq { background: linear-gradient(150deg, #4a2f3f, #55354a); }
:root[data-tema="noche"] .boob-der { background: linear-gradient(150deg, #362c50, #40345e); }
:root[data-tema="noche"] .diaper-btn, :root[data-tema="noche"] .quick-btn { color: var(--text); }
:root[data-tema="noche"] .tanque { background: linear-gradient(180deg, #2c2536, #241e2e); border-color: #453a4e; }

/* selector de tema */
.temas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tema-opcion {
  border: 2.5px solid transparent; border-radius: 20px; padding: 16px 10px;
  cursor: pointer; text-align: center; font-weight: 800; font-size: 14px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  box-shadow: var(--shadow);
}
.tema-opcion.activo { border-color: var(--pink-deep); }
.tema-opcion .bolitas { display: flex; gap: 5px; }
.tema-opcion .bolitas span { width: 18px; height: 18px; border-radius: 50%; border: 1.5px solid rgba(0,0,0,.08); }

/* guía de etapa en el análisis */
.hallazgo.nivel-info { border-left: 4px solid #8b6ef0; }
.h-lista { padding-left: 18px; margin: 6px 0 2px; color: var(--text-2); font-size: 13px; }
.h-lista li { margin-bottom: 3px; }

/* ============ ventana de sueño y rutina de dormir ============ */
.ventana-card { border-left: 5px solid #9b87e8; }
.ventana-barra {
  height: 14px; border-radius: 100px; background: var(--seg);
  overflow: hidden; margin: 10px 0 6px;
}
.ventana-barra .vb-fill {
  height: 100%; border-radius: 100px;
  transition: width .8s cubic-bezier(.2,.9,.3,1), background-color .4s;
}
.ventana-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); font-weight: 600; }

.rutina-paso {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border-radius: 16px; padding: 12px 14px;
  box-shadow: var(--shadow); margin-bottom: 8px;
}
.rutina-paso .rp-emoji { font-size: 24px; }
.rutina-paso .rp-titulo { flex: 1; font-weight: 700; font-size: 14.5px; }
.rutina-paso .rp-min { font-size: 12px; color: var(--text-2); font-weight: 700; white-space: nowrap; }
.rutina-paso.hecho { opacity: .6; }
.rutina-paso.hecho .rp-titulo { text-decoration: line-through; text-decoration-color: #4cc38a; }
.rutina-check {
  width: 40px; height: 40px; border-radius: 50%; border: 2.5px dashed var(--borde);
  background: none; font-size: 19px; cursor: pointer; flex-shrink: 0;
  color: transparent; display: flex; align-items: center; justify-content: center;
}
.rutina-check.lista {
  border: none; background: linear-gradient(135deg, #9b87e8, #7c63d8);
  color: #fff; animation: pop-check .4s cubic-bezier(.3,1.6,.4,1);
}
.rutina-progreso {
  height: 10px; border-radius: 100px; background: var(--seg); overflow: hidden; margin: 8px 0 12px;
}
.rutina-progreso div {
  height: 100%; background: linear-gradient(90deg, #9b87e8, #7c63d8);
  border-radius: 100px; transition: width .5s cubic-bezier(.2,.9,.3,1);
}
.timer-banner.rutina { background: linear-gradient(135deg, #ddd3ff, #c9bcf5); }

/* ============ bienestar de mamá ============ */
.epds-op {
  display: block; width: 100%; text-align: left;
  background: var(--card); border: 2px solid var(--borde); border-radius: 16px;
  padding: 14px 16px; margin-bottom: 9px; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: var(--text);
  transition: all .15s;
}
.epds-op:active { transform: scale(.98); border-color: var(--pink); }
.epds-recurso {
  display: block; background: var(--card); border-radius: 14px;
  padding: 13px 15px; margin-bottom: 8px; box-shadow: var(--shadow);
  font-size: 14px; font-weight: 700; color: var(--text); text-decoration: none;
}

/* listón del demo público */
.demo-liston {
  position: fixed; bottom: calc(96px + var(--safe-bottom)); left: 50%; transform: translateX(-50%);
  z-index: 40; background: #2b2330; color: #ffd166;
  font-size: 12px; font-weight: 800; padding: 7px 16px; border-radius: 100px;
  box-shadow: 0 6px 18px rgba(0,0,0,.28); white-space: nowrap; pointer-events: none;
  max-width: calc(100vw - 32px); overflow: hidden; text-overflow: ellipsis;
}
.demo-liston.clickeable { pointer-events: auto; cursor: pointer; border: none; }
.demo-liston.clickeable u { color: #ffd166; text-underline-offset: 2px; }

/* ═══════════════════════════════════════════════════════════════
   DISEÑO v2 — capa de pulido: profundidad, movimiento y detalle
   ═══════════════════════════════════════════════════════════════ */
:root {
  --sombra-1: 0 1px 2px rgba(43,35,48,.04), 0 6px 20px rgba(214,110,152,.10);
  --sombra-2: 0 2px 4px rgba(43,35,48,.05), 0 12px 32px rgba(214,110,152,.16);
  --sombra-glow: 0 6px 22px rgba(240,106,155,.38);
  --spring: cubic-bezier(.34,1.56,.5,1);
  --suave: cubic-bezier(.22,.9,.3,1);
  --text-2: #7d7185; /* contraste AA para texto secundario */
}
:root[data-tema="noche"] {
  --sombra-1: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.38);
  --sombra-2: 0 2px 6px rgba(0,0,0,.35), 0 14px 36px rgba(0,0,0,.5);
  --text-2: #ab9db0;
}

/* tipografía y números */
.app-header h1 { font-size: 26px; letter-spacing: -.6px; }
.timer-clock, .stat-value, .ml-value, .b-ml, .bs-ml, .ps-num, .anillo .num,
.entry-time, .ventana-card > div:nth-child(2) { font-variant-numeric: tabular-nums; }

/* tarjetas: borde fino + elevación en dos capas */
.card, .entry, .quick-btn, .menu-item, .tarea, .banco-card, .hallazgo,
.prod-stat, .rutina-paso, .analisis-mini, .medalla, .diaper-btn, .boob-btn,
.stat-card, .banco-saldo, .tema-opcion, .epds-recurso {
  box-shadow: var(--sombra-1);
  border: 1px solid color-mix(in srgb, var(--borde) 55%, transparent);
}
@media (hover: hover) {
  .card:hover, .entry:hover, .menu-item:hover, .banco-card:hover,
  .analisis-mini:hover, .quick-btn:hover, .tarea:hover {
    box-shadow: var(--sombra-2);
    transform: translateY(-1px);
    transition: transform .25s var(--suave), box-shadow .25s var(--suave);
  }
}
.card, .entry, .menu-item, .banco-card, .analisis-mini, .quick-btn, .tarea {
  transition: transform .25s var(--suave), box-shadow .25s var(--suave);
}

/* botones: brillo, resorte y glow */
.btn-primary { box-shadow: var(--sombra-glow); transition: transform .16s var(--spring), filter .2s, box-shadow .2s; }
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: scale(.96); }
.btn-secondary, .btn-danger, .btn-ghost, .quick-btn, .diaper-btn, .boob-btn,
.t-play, .t-check, .rutina-check, .bebe-chip, .epds-op, .color-opt, .tema-opcion,
.ml-stepper button, .banco-acciones button, .sueno-botones button, .menu-item {
  transition: transform .16s var(--spring), box-shadow .2s var(--suave), background-color .2s, border-color .2s, opacity .2s;
}
.btn-secondary:active, .btn-danger:active, .quick-btn:active, .diaper-btn:active,
.boob-btn:active, .banco-acciones button:active, .sueno-botones button:active,
.menu-item:active, .epds-op:active, .tema-opcion:active { transform: scale(.955); }

/* header: nombre con degradado + avatar con aro */
#header-title {
  background: linear-gradient(120deg, var(--text) 30%, var(--pink-deep) 130%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.header-avatar {
  border: none;
  outline: 2.5px solid transparent;
  background: linear-gradient(var(--card), var(--card)) padding-box,
              linear-gradient(135deg, var(--pink), #c79df5) border-box;
  border: 2.5px solid transparent;
  box-shadow: 0 3px 12px rgba(214,110,152,.35);
}

/* barra de pestañas flotante estilo isla */
.tabbar {
  left: 50%; right: auto; transform: translateX(-50%);
  width: min(100% - 20px, 540px);
  bottom: calc(10px + var(--safe-bottom));
  padding: 8px 6px;
  border-radius: 28px;
  border: 1px solid color-mix(in srgb, var(--borde) 60%, transparent);
  box-shadow: var(--sombra-2);
}
.tab { position: relative; padding: 7px 0 5px; border-radius: 18px; }
.tab.active { background: color-mix(in srgb, var(--pink) 13%, transparent); }
.tab.active .tab-icon { transform: scale(1.16) translateY(-1px); }
.tab .tab-icon { transition: transform .3s var(--spring), filter .2s; }
.main { padding-bottom: calc(118px + var(--safe-bottom)); }
/* cuando el listón de demo está visible, deja aire extra para que no tape contenido */
body:has(.demo-liston) .main { padding-bottom: calc(175px + var(--safe-bottom)); }

/* transición al cambiar de pestaña */
.main.cambio { animation: vista-in .32s var(--suave); }
@keyframes vista-in { from { opacity: 0; transform: translateY(10px); } }

/* hoja modal: cierre animado + fondo con blur */
.sheet-backdrop { backdrop-filter: blur(3px); }
.sheet { box-shadow: 0 -8px 40px rgba(43,35,48,.18); }
.sheet.cerrando { animation: sheet-out .22s var(--suave) forwards; }
.sheet-backdrop.cerrando { animation: fade-out .22s forwards; }
@keyframes sheet-out { to { transform: translateY(100%); } }
@keyframes fade-out { to { opacity: 0; } }

/* toast con blur y resorte */
.toast {
  background: color-mix(in srgb, var(--text) 92%, transparent);
  backdrop-filter: blur(8px);
  animation: toast-spring .4s var(--spring);
  max-width: min(88vw, 480px); white-space: normal; text-align: center;
}
@keyframes toast-spring { 0% { opacity: 0; transform: translate(-50%, 16px) scale(.92); } }

/* login: blobs flotantes de fondo + corazón latiendo */
.login-screen { position: relative; overflow-x: hidden; overflow-y: auto; }
.lang-toggle {
  position: absolute; z-index: 4;
  top: calc(14px + env(safe-area-inset-top)); right: 16px;
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.82); backdrop-filter: blur(12px);
  border: 1.5px solid var(--borde); border-radius: 100px;
  padding: 8px 14px; font-size: 13.5px; font-weight: 700; color: var(--text);
  cursor: pointer; box-shadow: var(--sombra-1); transition: transform .15s var(--spring);
}
.lang-toggle:active { transform: scale(.94); }
:root[data-tema="noche"] .lang-toggle { background: rgba(38,32,48,.85); }
.login-screen::before, .login-screen::after {
  content: ''; position: absolute; border-radius: 50%; filter: blur(70px); opacity: .55;
  animation: blob-flota 16s ease-in-out infinite alternate; pointer-events: none;
}
.login-screen::before { width: 45vmax; height: 45vmax; left: -12vmax; top: -12vmax; background: #ffd1e3; }
.login-screen::after { width: 40vmax; height: 40vmax; right: -10vmax; bottom: -10vmax; background: #dcd1ff; animation-delay: -8s; }
:root[data-tema="noche"] .login-screen::before { background: #4a2f3f; }
:root[data-tema="noche"] .login-screen::after { background: #362c50; }
@keyframes blob-flota { from { transform: translate(0,0) scale(1); } to { transform: translate(6vmax, 4vmax) scale(1.15); } }
.login-card { position: relative; z-index: 1; }
.login-icon { display: inline-block; animation: latido 2.6s ease-in-out infinite; }
@keyframes latido { 0%,100% { transform: scale(1); } 12% { transform: scale(1.12); } 24% { transform: scale(1); } 36% { transform: scale(1.08); } 48% { transform: scale(1); } }

/* tanque: doble ola + brillo + burbujas */
.tanque .nivel .ola { animation-duration: 3.4s; }
.tanque .nivel::before {
  content: ''; position: absolute; top: -5px; left: -30%; width: 150%; height: 10px;
  background: inherit; opacity: .4; border-radius: 42%;
  animation: olita 5s linear infinite reverse;
}
.tanque .nivel::after {
  content: ''; position: absolute; bottom: 6%; left: 30%;
  width: 5px; height: 5px; border-radius: 50%;
  background: rgba(255,255,255,.65);
  box-shadow: 14px -12px 0 -1px rgba(255,255,255,.5), 6px -26px 0 -2px rgba(255,255,255,.45);
  animation: burbujas 3.2s ease-in infinite;
}
@keyframes burbujas { 0% { transform: translateY(0); opacity: 0; } 25% { opacity: 1; } 100% { transform: translateY(-46px); opacity: 0; } }
.tanque::after {
  content: ''; position: absolute; top: 8%; left: 12%; width: 16%; height: 55%;
  border-radius: 100px; background: linear-gradient(rgba(255,255,255,.55), transparent);
  pointer-events: none;
}

/* listón demo con brillo que respira */
.demo-liston { background: linear-gradient(90deg, #2b2330, #4a3a55, #2b2330); background-size: 200% 100%; animation: brillo-liston 5s linear infinite; }
@keyframes brillo-liston { to { background-position: -200% 0; } }

/* estados vacíos más amables */
.empty-state .big { animation: flota-suave 3.5s ease-in-out infinite; display: inline-block; }
@keyframes flota-suave { 50% { transform: translateY(-6px); } }

/* accesibilidad: foco visible y menos movimiento */
:focus-visible { outline: 2.5px solid var(--pink-deep); outline-offset: 2px; border-radius: 8px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* escritorio: fondo decorado y columna cómoda */
@media (min-width: 900px) {
  body::before {
    content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none;
    background:
      radial-gradient(38vmax 38vmax at 8% 0%, color-mix(in srgb, var(--pink-soft) 55%, transparent), transparent 60%),
      radial-gradient(34vmax 34vmax at 100% 90%, color-mix(in srgb, var(--lav) 60%, transparent), transparent 60%);
  }
  .main, .app-header, .active-timers, .bebes-bar { max-width: 620px; }
  .tabbar { width: min(100%, 560px); }
}

/* detalles finos */
details.card summary { list-style: none; }
details.card summary::-webkit-details-marker { display: none; }
details.card summary::after { content: '›'; float: right; color: var(--text-2); transition: transform .25s var(--suave); font-size: 18px; }
details.card[open] summary::after { transform: rotate(90deg); }
.day-label { letter-spacing: .8px; }
.entry .entry-actions button { transition: opacity .2s, transform .16s var(--spring); }
.entry .entry-actions button:active { transform: scale(.85); }
::selection { background: var(--pink-soft); }

/* saludo del día en Inicio */
.hero-inicio {
  display: flex; align-items: center; gap: 14px;
  padding: 6px 6px 14px;
  animation: hero-in .5s var(--suave);
}
.hero-inicio .hi-emoji { font-size: 34px; animation: flota-suave 4s ease-in-out infinite; }
.hero-inicio .hi-saludo { font-size: 20px; font-weight: 800; letter-spacing: -.4px; }
.hero-inicio .hi-frase { font-size: 13px; color: var(--text-2); font-weight: 600; }
