/* ==========================================================================
   Mipplet — Ajustes: un menú principal y sus submenús.
   ========================================================================== */

.ajustes {
  width: min(100% - 2 * var(--gutter), 600px);
  margin: 0 auto;
  padding-block: var(--s-2) var(--s-16);
}
.ajustes__vista { display: grid; gap: var(--s-5); }
/* Entre submenús: un deslizamiento corto y lento, que se sienta como pasar de página. */
.ajustes__vista.is-entra { animation: aj-entra 420ms cubic-bezier(0.22, 1, 0.36, 1); }
.ajustes__vista.is-vuelve { animation: aj-vuelve 420ms cubic-bezier(0.22, 1, 0.36, 1); }
@keyframes aj-entra { from { opacity: 0; transform: translateX(12px); } }
@keyframes aj-vuelve { from { opacity: 0; transform: translateX(-12px); } }

/* Encabezado de cada pantalla */
.aj-head { display: grid; justify-items: center; gap: var(--s-2); padding: var(--s-2) var(--s-2) var(--s-3); text-align: center; position: relative; }
.aj-head__volver { justify-self: start; margin-bottom: var(--s-1); background: var(--surface); box-shadow: inset 0 0 0 1px var(--border); }
.aj-head__t { font-size: var(--fs-heading); letter-spacing: var(--ls-heading); line-height: 1.08; overflow-wrap: anywhere; }
.aj-head__t:focus-visible { box-shadow: none; }
.aj-head__b { max-width: 30rem; color: var(--text-2); font-size: var(--fs-lead); line-height: 1.45; overflow-wrap: anywhere; }

/* Listas de menú */
.aj-lista {
  margin: 0;
  padding: var(--s-1) var(--s-2);
  list-style: none;
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--e-1);
}
.aj-lista li + li .aj-fila { border-top: 1px solid var(--border); border-radius: 0; }

.aj-fila {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: var(--s-4);
  width: 100%;
  min-height: 60px;
  padding: var(--s-3);
  border-radius: 14px;
  text-align: left;
  color: var(--text);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.aj-lista--menu .aj-fila { min-height: 64px; }
@media (hover: hover) { a.aj-fila:hover, button.aj-fila:hover { background: var(--accent-soft); border-radius: 14px; } }
a.aj-fila:active, button.aj-fila:active { transform: scale(0.99); }
.aj-fila:focus-visible { border-radius: 14px; }
.aj-fila__ico { width: 24px; height: 24px; color: var(--accent); }
.aj-fila__ico.ilu { width: 30px; height: 30px; margin: -3px; }
.aj-fila__k { font-size: 1.0625rem; font-weight: var(--fw-semi); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.aj-fila__v { max-width: 45vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); font-size: var(--fs-small); text-align: right; }
.aj-fila__v:empty { display: none; }
.aj-fila__ir { color: var(--text-3); }
.aj-punto { width: 10px; height: 10px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.aj-fila--peligro .aj-fila__ico, .aj-fila--peligro .aj-fila__k { color: var(--error); }
.aj-avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: var(--fs-small);
  font-weight: var(--fw-bold);
}

.aj-fila--opciones { grid-template-columns: auto minmax(0, 1fr); row-gap: var(--s-3); padding-block: var(--s-4); }
.aj-fila--opciones .control { grid-column: 1 / -1; }
.aj-fila--opciones .chips { flex-wrap: nowrap; }

.aj-grupo__nota { padding: 0 var(--s-3); font-size: var(--fs-caption); color: var(--text-3); line-height: 1.5; }
.aj-grupo__t { margin-top: var(--s-2); padding: 0 var(--s-3); font-size: var(--fs-caption); font-weight: var(--fw-semi); color: var(--text-2); }
.aj-familia { display: grid; gap: var(--s-5); }
.aj-rol-nota { margin-top: var(--s-2); min-height: 2.9em; }
.aj-quitar { color: var(--error); }
@media (hover: hover) { .aj-quitar:hover { color: var(--error); background: color-mix(in oklab, var(--error) 10%, transparent); } }

/* Tarjeta de la prueba */
.aj-plan {
  position: relative;
  display: grid;
  gap: 2px;
  min-height: 112px;
  padding: var(--s-6);
  border-radius: var(--r-card);
  overflow: hidden;
  text-align: left;
  color: #fff;
  background: linear-gradient(135deg, var(--violet-700), var(--violet-500));
  box-shadow: var(--e-2);
  transition: transform var(--dur-micro) var(--ease-out), box-shadow var(--dur-comp) var(--ease-out);
}
@media (hover: hover) { .aj-plan:hover { box-shadow: var(--e-3); } }
.aj-plan:active { transform: scale(0.99); }
.aj-plan:focus-visible { border-radius: var(--r-card); }
.aj-plan__k { position: relative; z-index: 1; font-size: var(--fs-small); font-weight: var(--fw-semi); opacity: 0.85; }
.aj-plan__v { position: relative; z-index: 1; font-size: 1.5rem; font-weight: var(--fw-bold); letter-spacing: -0.02em; }
.aj-plan__arte { position: absolute; right: -24px; bottom: -34px; width: 180px; opacity: 0.55; transform: rotate(-8deg); }

/* Tu plan: fundadores, gratis para siempre */
.aj-fundador {
  position: relative; display: grid; justify-items: center; gap: var(--s-1); padding: var(--s-8) var(--s-6) var(--s-6);
  border-radius: var(--r-card); text-align: center; background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--border);
}
.aj-fundador__ilu { width: 64px; height: 64px; margin-bottom: var(--s-2); }
.aj-fundador__k { font-size: var(--fs-caption); font-weight: var(--fw-bold); color: var(--accent); letter-spacing: 0.04em; text-transform: uppercase; }
.aj-fundador__t { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; line-height: 1.15; }
.aj-fundador__b { margin-top: var(--s-2); color: var(--text-2); font-size: var(--fs-small); line-height: 1.5; max-width: 28rem; }

/* Tu plan: los planes de Google Play */
.aj-planes, .aj-elegir { display: grid; gap: var(--s-3); }
.aj-elegir { margin-top: var(--s-3); }
.aj-opciones { display: grid; gap: var(--s-2); }
.aj-opcion {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 2px var(--s-3);
  padding: var(--s-4) var(--s-5); border-radius: 20px; text-align: left;
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--border);
  transition: box-shadow var(--dur-micro) var(--ease-out), background var(--dur-micro) var(--ease-out);
}
.aj-opcion__n { font-weight: var(--fw-bold); font-size: 1.0625rem; }
.aj-opcion__p { grid-column: 1; color: var(--text-2); font-size: var(--fs-small); }
.aj-opcion__a { grid-column: 2; grid-row: 1 / span 2; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); font-size: var(--fs-caption); font-weight: var(--fw-bold); }
.aj-opcion[aria-checked="true"] { background: var(--accent-soft); box-shadow: inset 0 0 0 2px var(--accent); }
.aj-opcion[aria-checked="true"] .aj-opcion__a { background: var(--primary); color: var(--on-primary); }
.aj-opcion:active { transform: scale(0.99); }
.aj-restaurar { justify-self: center; }
.aj-plan-aviso { padding: var(--s-3) var(--s-4); border-radius: 16px; background: color-mix(in oklab, var(--warning) 16%, var(--surface)); font-size: var(--fs-small); font-weight: var(--fw-semi); }

.aj-legal { display: flex; justify-content: center; gap: var(--s-3); padding-top: var(--s-2); font-size: var(--fs-small); }
.aj-legal a { color: var(--accent); font-weight: var(--fw-semi); }
@media (hover: hover) { .aj-legal a:hover { text-decoration: underline; text-underline-offset: 3px; } }

@media (min-width: 560px) {
  .aj-fila--opciones { grid-template-columns: auto minmax(0, 1fr) auto; }
  .aj-fila--opciones .control { grid-column: auto; }
}
@media (prefers-reduced-motion: reduce) {
  .ajustes__vista.is-entra, .ajustes__vista.is-vuelve { animation: none; }
}

/* --- Notificaciones ---------------------------------------------------------------- */
.aj-avisos { display: grid; gap: var(--s-3); }
.aj-estado {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: var(--s-2) var(--s-4);
  padding: var(--s-5);
  border-radius: var(--r-card);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--e-1);
  margin-bottom: var(--s-2);
}
.aj-estado.is-activo { box-shadow: inset 0 0 0 1.5px var(--accent-muted), var(--e-1); }
.aj-estado__ico { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--surface-sunken); color: var(--text-3); }
.aj-estado.is-activo .aj-estado__ico { background: var(--accent-soft); color: var(--accent); }
.aj-estado__txt { display: grid; gap: 4px; align-content: center; min-width: 0; }
.aj-estado__t { font-size: var(--fs-body); font-weight: var(--fw-bold); line-height: 1.3; }
.aj-estado__b { color: var(--text-2); font-size: var(--fs-small); line-height: 1.5; }
.aj-estado__acc { grid-column: 2; display: flex; flex-wrap: wrap; gap: var(--s-2); }
.aj-estado__acc:empty { display: none; }

.aj-fila--switch { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; padding-block: var(--s-4); }
.aj-fila__txt { display: grid; gap: 2px; min-width: 0; }
.aj-fila--switch .aj-fila__k { white-space: normal; }
.aj-fila__n { font-size: var(--fs-caption); color: var(--text-3); line-height: 1.45; }
.aj-switch {
  position: relative;
  width: 48px; height: 28px;
  border-radius: 14px;
  background: var(--border-strong);
  transition: background-color var(--dur-micro) var(--ease-out);
}
.aj-switch span {
  position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgb(0 0 0 / 0.25);
  transition: transform var(--dur-micro) var(--ease-spring, var(--ease-out));
}
.aj-fila--switch[aria-checked="true"] .aj-switch { background: var(--primary); }
.aj-fila--switch[aria-checked="true"] .aj-switch span { transform: translateX(20px); }
@media (prefers-reduced-motion: reduce) { .aj-switch, .aj-switch span { transition: none; } }

/* --- Su foto y cómo ha cambiado (Perfil del bebé) ------------------------------- */
.aj-foto { display: grid; justify-items: center; gap: var(--s-3); margin-bottom: var(--s-5); }
.aj-foto__cara {
  display: grid; place-items: center; width: 112px; height: 112px; border-radius: 50%;
  background: var(--accent-soft); color: var(--accent); font-size: 2.75rem; font-weight: var(--fw-bold); letter-spacing: -0.02em;
  box-shadow: 0 0 0 4px var(--surface), 0 0 0 5px var(--border);
}
.aj-foto__acc .btn .icon { width: 18px; height: 18px; }
.aj-foto__historia { justify-self: stretch; display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.aj-foto__t { font-size: var(--fs-label); font-weight: var(--fw-semi); color: var(--text-2); }
.aj-foto__lista {
  display: grid; grid-auto-flow: column; grid-auto-columns: 92px; gap: var(--s-3);
  overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding-bottom: var(--s-2);
}
.aj-foto__item { display: grid; justify-items: center; gap: 2px; width: 100%; scroll-snap-align: start; text-align: center; }
.aj-foto__img { display: block; width: 76px; height: 76px; margin-bottom: var(--s-1); border-radius: 50%; overflow: hidden; box-shadow: 0 0 0 1px var(--border); }
.aj-foto__item img { display: block; width: 100%; height: 100%; object-fit: cover; }
.aj-foto__edad { font-size: var(--fs-caption); font-weight: var(--fw-semi); color: var(--text); }
.aj-foto__fecha { font-size: var(--fs-caption); color: var(--text-3); }
.aj-foto-grande__caja { border-radius: var(--r-card); overflow: hidden; }
.aj-foto-grande img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-card); }
.aj-foto-grande .hoja__text { text-align: center; }

.aj-estado__ilu { width: 34px; height: 34px; }
.aj-estado__ilu.is-apagado { filter: grayscale(1); opacity: 0.55; }
