/* Layout: una pantalla de móvil; el mazo ocupa casi todo el alto. Ajustes vive en una página aparte detrás de un icono pequeño. */
:root {
  --sky-top: #141a3f;
  --sky-bottom: #2c2f6b;
  --paper: #fff6e3;
  --ink: #2a2350;
  --ink-soft: #6b6390;
  --moon: #ffe39a;
  --fg: #eef0ff;
  --muted: #aeb3e0;
  --panel: rgba(255,255,255,0.07);
  --line: rgba(255,255,255,0.15);
  --sheet: #1b2150;
  --age-p: #ffc857;
  --age-a: #ff8a6b;
  --age-b: #3ec9b6;
  --age-c: #b49cff;
  --err: #ff9f8a;
  --font-display: "Baloo 2", "Trebuchet MS", system-ui, sans-serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}
/* iOS 26 deja abajo, en la app de pantalla de inicio, una franja de ~60px que la web no puede pintar: la rellena con el color de fondo y el theme-color. Usamos el de las colinas para que no se note. */
html, body { height: 100%; }
html { overflow: hidden; background: #1d2457; touch-action: manipulation; -webkit-text-size-adjust: 100%; }
.screen { overflow-x: clip; }
body {
  margin: 0;
  background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)) fixed, #1d2457;
  color: var(--fg); font-family: var(--font-body); font-size: 16px; line-height: 1.45;
  overflow: hidden; overscroll-behavior: none;
  -webkit-tap-highlight-color: transparent;
}
[hidden] { display: none !important; }

/* Cielo */
#stars { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.clouds { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.cloud {
  position: absolute; left: 0; width: 340px; height: 110px; border-radius: 50%;
  background:
    radial-gradient(closest-side at 30% 60%, rgba(255,255,255,0.9), transparent),
    radial-gradient(closest-side at 55% 40%, rgba(255,255,255,0.9), transparent),
    radial-gradient(closest-side at 75% 62%, rgba(255,255,255,0.8), transparent);
  filter: blur(10px);
  opacity: var(--o, 0.08);
  transform: translateX(-120%) scale(var(--s, 1));
  animation: drift var(--d, 100s) linear infinite;
  animation-delay: var(--delay, 0s);
}
@keyframes drift {
  from { transform: translateX(-120%) scale(var(--s, 1)); }
  to { transform: translateX(calc(100vw + 20%)) scale(var(--s, 1)); }
}
.hills { position: fixed; left: 0; right: 0; bottom: 0; height: 22vh; pointer-events: none; }
.hills svg { width: 100%; height: 100%; display: block; }

/* Pantalla del mazo */
.screen {
  /* Fija a toda la ventana: en la app de pantalla de inicio del iPhone, 100dvh se queda ~60px corto y dejaba una franja abajo. */
  position: fixed; inset: 0; box-sizing: border-box;
  display: grid; grid-template-rows: auto 1fr auto;
  /* Ocupa todo el ancho y centra el contenido en 528px con el relleno: así la carta al deslizarla llega al borde
     de la pantalla también en iPad (con max-width se cortaba en el borde de la columna de 560px). */
  padding-left: max(16px, env(safe-area-inset-left, 0px), calc((100vw - 528px) / 2));
  padding-right: max(16px, env(safe-area-inset-right, 0px), calc((100vw - 528px) / 2));
  padding-block: calc(8px + env(safe-area-inset-top, 0px)) calc(14px + env(safe-area-inset-bottom, 0px));
  /* La barra de abajo baja 20px (sin salirse de la zona segura) y la carta se alarga lo mismo hacia abajo. */
  --drop: min(20px, calc(env(safe-area-inset-bottom, 0px) + 10px));
}
.top { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 4px 10px; }
.brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand img { width: 34px; height: 34px; border-radius: 9px; flex: none; }
.brand span { font-family: var(--font-display); font-weight: 800; font-size: 1.55rem; line-height: 1; letter-spacing: 0.01em; color: var(--paper); white-space: nowrap; }
@media (max-width: 374px) { .brand { gap: 8px; } .brand span { font-size: 1.3rem; } }
@media (max-width: 339px) { .brand { gap: 7px; } .brand img { width: 30px; height: 30px; } .brand span { font-size: 1.05rem; } }
.status { grid-column: 1 / -1; font-size: 0.78rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; min-height: 1.2em; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04); color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0;
}
.icon-btn svg { width: 20px; height: 20px; }

.table { position: relative; display: grid; place-items: center; min-height: 0; touch-action: pan-y; container-type: size; }
/* La carta mantiene el ancho y la posición de arriba de siempre (5:7 centrada) y solo se alarga hacia abajo,
   hasta la mitad del hueco libre que quedaba debajo. */
.slot {
  --w: min(86vw, 400px, calc((100dvh - 210px) * 0.7));
  --h0: calc(var(--w) * 1.4);
  --free: max(0px, calc(100cqh - var(--h0)));
  position: relative; align-self: start; max-width: 100%;
  width: var(--w);
  margin-top: calc(var(--free) / 2);
  height: calc(var(--h0) + max(0px, var(--free) / 2 - 14px) + var(--drop));
}
/* Las cartas de debajo llevan el mismo dorso que la de arriba: se ven al deslizar una carta. */
.under {
  position: absolute; inset: 0; border-radius: 26px; border: 3px solid var(--paper); box-shadow: 0 12px 30px rgba(0,0,0,0.35);
  background:
    radial-gradient(circle, rgba(255,255,255,0.16) 1.5px, transparent 2px) 0 0 / 20px 20px,
    linear-gradient(160deg, #4b4fb0, #2e3283);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; overflow: hidden;
}
.under::before { content: ""; width: 92px; height: 92px; border-radius: 50%; box-shadow: inset 20px -16px 0 0 var(--moon); filter: drop-shadow(0 0 16px rgba(255,227,154,0.5)); }
.under::after { content: "Luna Family"; font-family: var(--font-display); font-weight: 800; color: var(--paper); font-size: 1.7rem; letter-spacing: 0.02em; margin-bottom: calc(0.9rem * 1.45 + 14px); }
.under.u1 { transform: rotate(-4deg) translate(-8px, 8px); }
.under.u2 { transform: rotate(3deg) translate(8px, 5px); }
.card { position: absolute; inset: 0; cursor: pointer; touch-action: pan-y; user-select: none; -webkit-user-select: none; will-change: transform; }
.card.dragging { cursor: grabbing; }
/* Giro suave: perspectiva para que se vea en 3D (sin ella la carta se aplasta como una línea) y curva simétrica sin rebote. */
.card { perspective: 1600px; }
.inner { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(.45,0,.25,1); }
.card.flipped .inner { transform: rotateY(180deg); }
.card.flipped.answering .inner { transform: rotateY(360deg); }
/* Al terminar el giro, la cara de respuesta se queda plana: Safari en iPhone y iPad no acierta los toques dentro de caras en 3D. */
.card.flat .inner { transform: none !important; transition: none !important; transform-style: flat; }
.card.flat .answer { transform: none; }
/* Con la carta girada dos veces, el dorso y la cara de respuesta miran al frente: se oculta el que no toca. */
.card .answer, .card.answering .back, .card.answering .front { visibility: hidden; transition: visibility 0s .4s; }
.card.answering .answer { visibility: visible; transition: visibility 0s 0s; }
/* Mientras la carta vuelve a la pregunta, la cara de respuesta aún se ve un instante: que no se quede con los toques ni impida deslizar. */
.card:not(.answering) .answer { pointer-events: none; }
.face { position: absolute; inset: 0; border-radius: 26px; backface-visibility: hidden; -webkit-backface-visibility: hidden; border: 3px solid var(--paper); box-shadow: 0 18px 44px rgba(0,0,0,0.5); overflow: hidden; }
.back {
  background:
    radial-gradient(circle, rgba(255,255,255,0.16) 1.5px, transparent 2px) 0 0 / 20px 20px,
    linear-gradient(160deg, #4b4fb0, #2e3283);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px;
}
.emblem { width: 92px; height: 92px; border-radius: 50%; box-shadow: inset 20px -16px 0 0 var(--moon); filter: drop-shadow(0 0 16px rgba(255,227,154,0.5)); }
/* La luna crece con las noches de la semana: 0, 1, 2, 3 y 4 o más (llena). La fase va en .slot para que la carta de arriba
   y las de debajo (las que se ven al deslizar) muestren la misma luna. Se dibuja con SVG: la sombra interior que se usaba
   antes dejaba un cuadrado alrededor en Safari. */
.emblem, .under::before { box-shadow: none; background: center / contain no-repeat; transition: filter 0.8s ease; }
.slot[data-fase="0"] .emblem, .slot[data-fase="0"] .under::before, .emblem, .under::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 92'%3E%3Cmask id='m'%3E%3Crect width='92' height='92' fill='%23fff'/%3E%3Ccircle cx='66' cy='30' r='46' fill='%23000'/%3E%3C/mask%3E%3Ccircle cx='46' cy='46' r='46' fill='%23ffe39a' mask='url%28%23m%29'/%3E%3C/svg%3E"); }
.slot[data-fase="1"] .emblem, .slot[data-fase="1"] .under::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 92'%3E%3Cmask id='m'%3E%3Crect width='92' height='92' fill='%23fff'/%3E%3Ccircle cx='74' cy='25' r='46' fill='%23000'/%3E%3C/mask%3E%3Ccircle cx='46' cy='46' r='46' fill='%23ffe39a' mask='url%28%23m%29'/%3E%3C/svg%3E"); }
.slot[data-fase="2"] .emblem, .slot[data-fase="2"] .under::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 92'%3E%3Cmask id='m'%3E%3Crect width='92' height='92' fill='%23fff'/%3E%3Ccircle cx='86' cy='19' r='46' fill='%23000'/%3E%3C/mask%3E%3Ccircle cx='46' cy='46' r='46' fill='%23ffe39a' mask='url%28%23m%29'/%3E%3C/svg%3E"); }
.slot[data-fase="3"] .emblem, .slot[data-fase="3"] .under::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 92'%3E%3Cmask id='m'%3E%3Crect width='92' height='92' fill='%23fff'/%3E%3Ccircle cx='102' cy='11' r='46' fill='%23000'/%3E%3C/mask%3E%3Ccircle cx='46' cy='46' r='46' fill='%23ffe39a' mask='url%28%23m%29'/%3E%3C/svg%3E"); }
.slot[data-fase="4"] .emblem, .slot[data-fase="4"] .under::before { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 92 92'%3E%3Ccircle cx='46' cy='46' r='46' fill='%23ffe39a'/%3E%3C/svg%3E"); }
.slot[data-fase="4"] .emblem, .slot[data-fase="4"] .under::before { filter: drop-shadow(0 0 26px rgba(255,227,154,0.85)); }
@media (prefers-reduced-motion: reduce) { .emblem, .under::before { transition: none; } }
/* Mientras crece, la luna se dibuja con un SVG animado y late un poco más brillante. */
.emblem { position: relative; }
.emblem.halo::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 3px solid rgba(255,227,154,0.9); box-shadow: 0 0 18px rgba(255,227,154,0.6); animation: luna-halo 0.9s ease-out forwards; pointer-events: none; }
@keyframes luna-halo { from { transform: scale(0.95); opacity: 0.95; } to { transform: scale(1.75); opacity: 0; } }
/* Número de noches: el viejo sube y se apaga, el nuevo entra desde abajo */
/* Sin espacios de texto alrededor: en Safari el espacio junto a un inline-block salía más estrecho. El margen hace de espacio. */
.cifra { display: inline-block; color: var(--moon); margin: 0 0.27em; }
.cifra:first-child { margin-left: 0; }
.cifra.out { animation: cifra-out 0.22s ease-in forwards; }
.cifra.in { animation: cifra-in 0.32s ease-out; }
@keyframes cifra-out { to { transform: translateY(-0.6em); opacity: 0; } }
@keyframes cifra-in { from { transform: translateY(0.6em); opacity: 0; } }
.emblem.creciendo { background-image: none !important; animation: luna-late 1.35s ease-in-out; }
.emblem.creciendo svg { width: 100%; height: 100%; display: block; }
@keyframes luna-late { 0%, 100% { transform: scale(1); } 55% { transform: scale(1.1); filter: drop-shadow(0 0 30px rgba(255,227,154,0.95)); } }
.back .label { font-family: var(--font-display); font-weight: 800; color: var(--paper); font-size: 1.7rem; letter-spacing: 0.02em; }
.back .hint { color: var(--muted); font-size: 0.9rem; font-weight: 700; }
.back .racha { color: var(--muted); font-size: 0.8rem; font-weight: 700; margin-top: -6px; opacity: 0.85; }
.back .racha[hidden] { display: none; }
.loading .back .hint::after { content: " ·"; }

.bottom { display: flex; flex-direction: column; align-items: center; gap: 10px; min-height: 92px; justify-content: flex-end; position: relative; top: var(--drop); z-index: 2; }
.swipe-hint { color: var(--muted); font-size: 0.85rem; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.swipe-hint svg { width: 34px; height: 14px; animation: nudge 1.8s ease-in-out infinite; }
@keyframes nudge { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(-8px); } }
.row { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.row.start { justify-content: flex-start; }
.pill {
  border: 0; border-radius: 999px; padding: 12px 20px; cursor: pointer;
  font: 800 1rem var(--font-display); background: var(--moon); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px; min-height: 48px;
}
.pill:disabled { opacity: 0.6; cursor: default; }
.pill.ghost { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.pill svg { width: 18px; height: 18px; }
.desktop-only { display: none !important; }
@media (hover: hover) and (pointer: fine) { .desktop-only { display: inline-flex !important; } }

/* Hoja de respuestas */
.scrim { position: fixed; inset: 0; background: rgba(5,6,25,0.55); opacity: 0; pointer-events: none; transition: opacity 0.25s; z-index: 10; }
.scrim.open { opacity: 1; pointer-events: auto; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 11;
  background: var(--sheet); border-radius: 24px 24px 0 0; border-top: 1px solid var(--line);
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: 10px calc(18px + env(safe-area-inset-bottom, 0px));
  transform: translateY(calc(100% + 60px)); visibility: hidden; transition: transform 0.3s cubic-bezier(.2,.8,.25,1), visibility 0s linear 0.3s;
  max-width: 560px; margin: 0 auto; box-sizing: border-box; max-height: 85dvh; overflow-y: auto;
  display: flex; flex-direction: column; gap: 12px;
}
/* Cerradas quedan ocultas del todo: en iOS la zona bajo la barra de Safari también se pinta y se veían asomar. */
.sheet.open { transform: translateY(0); visibility: visible; transition-delay: 0s; }
.grab { width: 40px; height: 5px; border-radius: 3px; background: var(--line); margin: 0 auto 4px; }
.sheet h2 { font-family: var(--font-display); margin: 0; font-size: 1.2rem; line-height: 1.2; }
.sheet .sq { color: var(--muted); margin: -6px 0 0; font-size: 0.92rem; }
.ans { display: flex; flex-direction: column; gap: 6px; }
.ans label { font-weight: 800; font-size: 0.92rem; display: flex; align-items: center; gap: 8px; }
.ans label i { width: 10px; height: 10px; border-radius: 50%; display: inline-block; }
textarea, input, select {
  width: 100%; box-sizing: border-box; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(10,12,40,0.5); color: var(--fg); font: 400 16px var(--font-body); padding: 10px 12px;
}
textarea { min-height: 70px; resize: vertical; }
.voice { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-height: 48px; }
.rec { display: inline-flex; align-items: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 999px; border: 0; cursor: pointer; background: var(--moon); color: var(--ink); font: 800 1rem var(--font-display); }
.rec svg { width: 20px; height: 20px; }
.rec.on { background: var(--age-a); color: var(--ink); animation: pulse 1.4s ease-in-out infinite; font-variant-numeric: tabular-nums; }
.rec.play { background: transparent; color: var(--fg); border: 1px solid var(--line); }
.rec:disabled { opacity: 0.5; cursor: default; }
.rec.mini { min-height: 36px; padding: 0 12px; font-size: 0.85rem; background: var(--ink); color: var(--paper); margin-left: 8px; vertical-align: middle; }
.rec.mini svg { width: 14px; height: 14px; }
.rec-hint { color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.link-btn { background: none; border: 0; color: var(--moon); font: 700 0.9rem var(--font-body); cursor: pointer; padding: 8px 4px; text-decoration: underline; text-underline-offset: 3px; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(255,138,107,0.5); } 50% { box-shadow: 0 0 0 10px rgba(255,138,107,0); } }
.msg { margin: 0; min-height: 1.3em; font-weight: 700; font-size: 0.9rem; color: var(--age-b); }
.msg.err { color: var(--err); }

/* Página de ajustes */
.page {
  position: fixed; inset: 0; z-index: 20; background: var(--sky-top);
  transform: translateX(100%); transition: transform 0.32s cubic-bezier(.2,.8,.25,1);
  overflow-y: auto; -webkit-overflow-scrolling: touch; visibility: hidden;
}
.page.open { transform: translateX(0); visibility: visible; }
.page-inner {
  max-width: 560px; margin: 0 auto; box-sizing: border-box;
  padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px));
  padding-block: calc(10px + env(safe-area-inset-top, 0px)) calc(40px + env(safe-area-inset-bottom, 0px));
  display: flex; flex-direction: column; gap: 22px;
}
.page-head { display: flex; align-items: center; gap: 12px; min-height: 44px; position: sticky; top: 0; background: var(--sky-top); padding-block: 6px; z-index: 1; }
.page-head h1 { font-family: var(--font-display); font-size: 1.4rem; margin: 0; }
.group { display: flex; flex-direction: column; gap: 10px; }
.group h2 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0; font-weight: 800; }
.box { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { border: 1px solid var(--line); background: transparent; color: var(--fg); border-radius: 999px; padding: 8px 14px; font: 700 0.9rem var(--font-body); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; }
.chip i { width: 9px; height: 9px; border-radius: 50%; }
.chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.two { display: grid; grid-template-columns: 1fr 88px; gap: 10px; }
.two.even { grid-template-columns: 1fr 1fr; }
.two > * { min-width: 0; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field label { font-weight: 800; font-size: 0.85rem; }
.entry { background: var(--paper); color: var(--ink); border-radius: 14px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.entry .meta { font-size: 0.74rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.05em; }
.entry .eq { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; line-height: 1.25; }
.say { font-size: 0.95rem; }
.say b { margin-right: 4px; }
.say.empty { color: var(--ink-soft); font-style: italic; }
.note { font-size: 0.85rem; color: var(--muted); margin: 0; }
.mine { display: flex; gap: 10px; align-items: center; font-size: 0.95rem; padding: 6px 0; border-bottom: 1px solid var(--line); }
.mine.editing { opacity: .55; }
.mine-t { flex: 1; min-width: 0; }
.mine-t small { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 2px; }
.mine-btn { flex: none; min-width: 40px; height: 40px; border-radius: 12px; border: 1px solid var(--line); background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; padding: 0 8px; font: 800 0.8rem var(--font-body); }
.mine-btn svg { width: 18px; height: 18px; }
.mine-btn.danger { background: #e5484d; border-color: #e5484d; color: #fff; }
.mine i { width: 10px; height: 10px; border-radius: 50%; flex: none; align-self: flex-start; margin-top: 7px; }
.code { font-family: ui-monospace, Menlo, monospace; font-size: 0.78rem; word-break: break-all; color: var(--muted); margin: 0; }

.menu-list { display: flex; flex-direction: column; background: var(--panel); border: 1px solid var(--line); border-radius: 18px; overflow: hidden; }
.menu-row { display: flex; align-items: center; gap: 14px; min-height: 68px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--fg); text-align: left; cursor: pointer; font: inherit; width: 100%; }
.menu-row:last-child { border-bottom: 0; }
.menu-row:active { background: rgba(255,255,255,0.06); }
.mi { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: rgba(255,227,154,0.14); color: var(--moon); flex: none; }
.mi svg { width: 22px; height: 22px; }
.mt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.mt b { font-family: var(--font-display); font-size: 1.08rem; font-weight: 700; line-height: 1.2; }
.mt small { color: var(--muted); font-size: 0.85rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-height: 1.2em; }
.chev { width: 18px; height: 18px; color: var(--muted); flex: none; }
.view { display: flex; flex-direction: column; gap: 14px; animation: viewIn 0.22s ease; }
@keyframes viewIn { from { opacity: 0; transform: translateX(16px); } to { opacity: 1; transform: none; } }
button:focus-visible, textarea:focus-visible, input:focus-visible, select:focus-visible { outline: 3px solid var(--moon); outline-offset: 3px; }
/* El foco de la carta se marca en su propio borde redondeado, no con un rectángulo alrededor. */
.card:focus-visible { outline: none; }
.card:focus-visible .face { box-shadow: 0 0 0 3px var(--moon), 0 18px 44px rgba(0,0,0,0.5); }
@media (prefers-reduced-motion: reduce) {
  .inner, .sheet, .page, .scrim { transition: none; }
  .view { animation: none; }
  .rec.on { animation: none; }
  .swipe-hint svg, .cloud { animation: none; }
  .cloud { transform: translateX(var(--rest, 20vw)) scale(var(--s, 1)); }
}

/* Borrar respuestas del diario */
.entry-row { position: relative; border-radius: 14px; overflow: hidden; }
.entry-under { position: absolute; inset: 0; background: #e5484d; color: #fff; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding-right: 22px; font-weight: 800; }
.entry-under svg { width: 20px; height: 20px; }
.entry-row .entry { position: relative; border-radius: 0; touch-action: pan-y; transition: transform 0.22s ease; }
.entry-row .entry.drag { transition: none; }
.entry-top { display: flex; align-items: center; gap: 8px; }
.entry-top .meta { flex: 1; }
.more { width: 36px; height: 30px; border: 0; background: transparent; color: var(--ink-soft); border-radius: 8px; cursor: pointer; display: grid; place-items: center; margin: -4px -6px -4px 0; }
.more svg { width: 20px; height: 20px; }
.more:active, .more:focus-visible { background: rgba(42,35,80,0.08); }
.del-sheet { z-index: 31; }
.scrim.top { z-index: 30; }
.del-sheet .sq { margin: 0 4px 4px; font-family: var(--font-display); font-weight: 700; font-size: 1rem; line-height: 1.3; }
.act { width: 100%; display: flex; align-items: center; gap: 12px; min-height: 54px; padding: 8px 14px; border: 0; border-radius: 12px; background: rgba(255,255,255,0.06); color: var(--fg); font: 700 1rem var(--font-body); cursor: pointer; text-align: left; }
.act i { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.act svg { width: 20px; height: 20px; flex: none; }
.act small { display: block; font-weight: 400; color: var(--muted); font-size: 0.8rem; }
.act.danger { color: #ffb3ae; }
.edit-ans { display: grid; gap: 10px; }
.edit-ans textarea { background: #fff; color: var(--ink); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 14px; min-height: 120px; resize: vertical; font: 400 1rem var(--font-body); }
.edit-ans .pill { justify-self: start; }
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, calc(100% + 80px)); visibility: hidden; width: calc(100% - 32px); max-width: 420px; background: var(--paper); color: var(--ink); border-radius: 14px; padding: 12px 12px 12px 16px; display: flex; align-items: center; gap: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.35); transition: transform .25s ease, visibility 0s linear .25s; z-index: 40; overflow: hidden; box-sizing: border-box; }
.toast.on { transform: translate(-50%, 0); visibility: visible; transition-delay: 0s; }
.toast span { flex: 1; font-weight: 700; font-size: 0.95rem; }
.toast button { border: 0; background: var(--ink); color: var(--paper); font: 800 0.9rem var(--font-body); padding: 10px 14px; border-radius: 10px; cursor: pointer; }
.toast-bar { position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: #e5484d; transform-origin: left; }
@media (prefers-reduced-motion: reduce) { .entry-row .entry, .toast { transition: none; } }
.del-sheet .pill { justify-content: center; }

/* Cara de la pregunta: ilustración y pastel propios de cada carta */
.front { background: var(--paper); color: var(--ink); transform: rotateY(180deg); display: flex; flex-direction: column; --p: #e9dcff; --pd: #7b5cd6; border-color: var(--paper); }
.scene { position: relative; height: 40%; flex: none; background: var(--p); overflow: hidden; }
.scene svg.ill { position: absolute; inset: 0; width: 100%; height: 100%; }
.scene::after { content: ""; position: absolute; left: -5%; right: -5%; bottom: -1px; height: 22px; background: var(--paper);
  -webkit-mask: radial-gradient(16px 12px at 50% 0, transparent 98%, #000) 0 0 / 32px 100% repeat-x; mask: radial-gradient(16px 12px at 50% 0, transparent 98%, #000) 0 0 / 32px 100% repeat-x; }
.ftop { position: absolute; top: 12px; left: 12px; right: 12px; display: flex; align-items: center; justify-content: space-between; z-index: 1; pointer-events: none; }
.tema { display: inline-flex; align-items: center; gap: 5px; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.07em; text-transform: uppercase; background: rgba(255,255,255,0.88); color: var(--pd); border-radius: 999px; padding: 4px 11px 4px 7px; }
.tema svg { width: 15px; height: 15px; }
.num { font-family: var(--font-display); font-weight: 800; color: var(--pd); font-size: 0.82rem; background: rgba(255,255,255,0.75); border-radius: 999px; padding: 1px 9px; }
.fbody { flex: 1; display: flex; flex-direction: column; padding: 2px 18px 14px; min-height: 0; }
.qwrap { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2px 0 6px; }
.q { font-family: var(--font-display); font-weight: 800; font-size: clamp(1.15rem, 5.6vw, 1.6rem); line-height: 1.18; margin: 0; text-wrap: balance; }
.who-label { text-align: center; font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--pd); margin: 0 0 8px; }
.kids { display: flex; justify-content: center; gap: 26px; }
.kid { --c: #c4553a; --cs: #ffe1d6; background: none; border: 0; padding: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; cursor: pointer; font-family: var(--font-body); color: var(--ink); touch-action: manipulation; }
.medal { position: relative; width: 60px; height: 60px; border-radius: 50%; background: var(--cs); display: grid; place-items: center; box-shadow: 0 0 0 3px var(--paper), 0 0 0 5px color-mix(in srgb, var(--c) 45%, transparent); transition: transform .2s cubic-bezier(.3,1.6,.5,1); }
.medal svg.av { width: 52px; height: 52px; border-radius: 50%; }
.kid:active .medal { transform: scale(.92); }
.kid.pending .medal::after { content: ""; position: absolute; inset: -9px; border-radius: 50%; border: 2px dashed var(--c); opacity: .55; animation: spin 14s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.kid.done .medal { box-shadow: 0 0 0 3px var(--paper), 0 0 0 6px var(--c); }
.badge { position: absolute; width: 28px; height: 28px; border-radius: 50%; background: #fff; display: grid; place-items: center; box-shadow: 0 3px 8px rgba(42,35,80,.25); font-size: 1rem; }
.badge.mood { right: -9px; top: -7px; }
.badge.plus, .badge.ok { right: -6px; bottom: -4px; background: var(--c); color: #fff; width: 24px; height: 24px; }
.badge svg { width: 13px; height: 13px; }
.kname { font-family: var(--font-display); font-weight: 800; font-size: 1rem; line-height: 1; margin-top: 5px; color: var(--c); max-width: 110px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kstate { font-size: 0.7rem; font-weight: 800; color: var(--ink-soft); display: flex; align-items: center; gap: 4px; min-height: 15px; }
.kstate .mw { display: inline-flex; gap: 1.5px; align-items: center; }
.kstate .mw i { width: 2px; border-radius: 1px; background: var(--c); }
.kid.pop .medal { animation: pop .45s cubic-bezier(.3,1.6,.5,1); }
@keyframes pop { 0% { transform: scale(.7); } 100% { transform: scale(1); } }
/* Ese niño está contestando en otro móvil de la familia: anillo continuo que respira y el estado en su color. */
.kid.fuera .medal::after { border-style: solid; opacity: .8; animation: breathe 1.6s ease-in-out infinite; }
.kid.fuera .kstate { color: var(--c); }
.kid.fuera .kstate::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); animation: breathe 1.6s ease-in-out infinite; }
@keyframes breathe { 50% { opacity: .3; } }
.stamp { position: absolute; top: 46%; left: 50%; transform: translate(-50%,-50%) rotate(-14deg) scale(2); opacity: 0; border: 3px solid #1f8c7e; color: #1f8c7e; font-family: var(--font-display); font-weight: 800; font-size: 1.3rem; padding: 2px 14px; border-radius: 10px; letter-spacing: .08em; text-transform: uppercase; transition: all .25s cubic-bezier(.3,1.5,.5,1); pointer-events: none; background: rgba(255,246,227,.9); z-index: 3; }
.stamp.on { opacity: 1; transform: translate(-50%,-50%) rotate(-14deg) scale(1); }
.status.flash { color: var(--moon); }

/* Cara de respuesta: la carta da otra vuelta y contesta cada hijo */
.answer { transform: rotateY(360deg); background: linear-gradient(180deg, var(--paper) 62%, var(--p, var(--paper))); color: var(--ink); display: flex; flex-direction: column; --c: #c4553a; --cs: #ffe1d6; border-color: var(--paper); cursor: default; }
.aband { position: relative; flex: none; background: var(--c); color: #fff; padding: 14px 18px 26px; border-radius: 0 0 50% 50% / 0 0 22px 22px; }
.aband h2 { font-family: var(--font-display); font-weight: 800; font-size: 1.25rem; margin: 0; line-height: 1.1; }
.aband p { margin: 3px 0 0; font-size: 0.8rem; line-height: 1.3; opacity: .92; padding-right: 64px; }
.aband .bav { position: absolute; right: 14px; bottom: -24px; width: 60px; height: 60px; border-radius: 50%; background: var(--cs); box-shadow: 0 0 0 4px var(--paper); display: grid; place-items: center; }
.aband .bav svg { width: 52px; height: 52px; border-radius: 50%; }
.abody { flex: 1; min-height: 0; display: flex; flex-direction: column; padding: 8px 16px 12px; }
.mic-zone { flex: 1; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; }
.micwrap { position: relative; width: 104px; height: 104px; display: grid; place-items: center; }
.ring { position: absolute; inset: 0; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 6; }
.ring .bg { stroke: color-mix(in srgb, var(--c) 18%, transparent); }
.ring .fg { stroke: var(--c); stroke-linecap: round; stroke-dasharray: 345.6; stroke-dashoffset: 345.6; transition: stroke-dashoffset .12s linear; }
.mic { position: relative; z-index: 1; width: 82px; height: 82px; border-radius: 50%; border: 0; color: #fff; display: grid; place-items: center; cursor: pointer; touch-action: none; -webkit-touch-callout: none; transition: transform .15s; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c) 70%); box-shadow: 0 10px 22px color-mix(in srgb, var(--c) 45%, transparent), inset 0 -4px 0 rgba(0,0,0,.12); }
.mic svg { width: 36px; height: 36px; }
.mic.on { transform: scale(1.08); }
.wave { display: flex; gap: 4px; align-items: center; height: 24px; color: var(--c); }
.wave i { width: 5px; border-radius: 3px; background: currentColor; height: 5px; opacity: .5; transition: height .12s; }
.mic-hint { font-weight: 800; font-size: 0.9rem; margin: 0; text-align: center; color: var(--ink); }
.done-note { display: flex; align-items: center; gap: 10px; background: var(--cs); border-radius: 16px; padding: 8px 12px; width: 100%; box-sizing: border-box; }
.aplay { width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--c); color: #fff; display: grid; place-items: center; flex: none; cursor: pointer; }
.aplay svg { width: 18px; height: 18px; }
.done-note .bars { flex: 1; display: flex; gap: 2px; align-items: center; height: 28px; }
.done-note .bars i { flex: 1; border-radius: 2px; background: var(--c); opacity: .55; }
.done-note b { font-size: 0.85rem; color: var(--ink-soft); font-variant-numeric: tabular-nums; }
.transcript { font-size: 0.86rem; color: var(--ink-soft); font-style: italic; margin: 2px 0 0; text-align: center; max-height: 4.2em; overflow: hidden; }
.alinks { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 14px; }
.alink { white-space: nowrap; background: none; border: 0; color: var(--ink-soft); font: 800 0.8rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 4px; }
.alink.danger { color: #e5484d; }
.ahint { font-size: 0.8rem; color: var(--ink-soft); }
.answer textarea { background: #fff; color: var(--ink); border: 2px solid color-mix(in srgb, var(--c) 35%, transparent); border-radius: 14px; min-height: 0; height: 92px; resize: none; }
.mood-label { font-size: 0.66rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.08em; margin: 2px 0 6px; text-align: center; }
.moods { display: flex; justify-content: center; gap: 10px; margin-bottom: 10px; }
.moods button { width: 42px; height: 42px; border-radius: 50%; border: 0; background: rgba(42,35,80,.06); font-size: 1.45rem; cursor: pointer; padding: 0; transition: transform .2s cubic-bezier(.3,1.6,.5,1), background .2s; filter: grayscale(.35); }
.moods button[aria-pressed="true"] { background: var(--cs); transform: scale(1.16); filter: none; box-shadow: 0 0 0 2.5px var(--c); }
.arow { display: flex; gap: 8px; }
.arow button { min-height: 46px; border-radius: 16px; font: 800 1rem var(--font-body); cursor: pointer; }
.aghost { flex: 0 0 46px; background: transparent; border: 2px solid rgba(42,35,80,.14); color: var(--ink); display: grid; place-items: center; padding: 0; }
.aghost svg { width: 20px; height: 20px; }
.asolid { flex: 1; border: 0; color: #fff; background: var(--c); box-shadow: 0 4px 0 color-mix(in srgb, var(--c) 70%, #000); }
.asolid:active { transform: translateY(2px); box-shadow: 0 2px 0 color-mix(in srgb, var(--c) 70%, #000); }
@media (prefers-reduced-motion: reduce) {
  .kid.pending .medal::after, .kid.pop .medal, .kid.fuera .medal::after, .kid.fuera .kstate::before { animation: none; }
  .medal, .mic, .moods button, .stamp { transition: none; }
}
/* Pantallas bajas (iPhone SE y similares): la cara de respuesta se compacta */
@media (max-height: 640px) {
  .aband { padding: 10px 14px 18px; }
  .aband h2 { font-size: 1.05rem; }
  .aband p { display: none; }
  .aband .bav { width: 46px; height: 46px; bottom: -18px; }
  .aband .bav svg { width: 40px; height: 40px; }
  .micwrap { width: 78px; height: 78px; }
  .mic { width: 60px; height: 60px; }
  .mic svg { width: 28px; height: 28px; }
  .wave { display: none; }
  .mic-hint { font-size: 0.8rem; }
  .alink { padding: 2px 4px; }
  .moods { margin-bottom: 6px; gap: 8px; }
  .moods button { width: 36px; height: 36px; font-size: 1.2rem; }
  .mood-label { margin-bottom: 4px; }
  .arow button { min-height: 40px; }
  .aghost { flex-basis: 40px; }
  .answer textarea { height: 64px; }
  .medal { width: 52px; height: 52px; }
  .medal svg.av { width: 44px; height: 44px; }
  .kstate { display: none; }
}

/* Ordenador: flecha discreta junto a la carta en lugar de arrastrar */
.next-arrow { display: none; }
.mouse-only { display: none; }
@media (hover: hover) and (pointer: fine) {
  .touch-only { display: none; }
  .mouse-only { display: inline; }
  .next-arrow:not([hidden]) {
    display: grid; place-items: center; position: absolute; top: 50%; right: calc(100% + 22px); transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.05);
    color: var(--muted); cursor: pointer; padding: 0; z-index: 3; transition: background .2s, color .2s, transform .2s;
  }
  .next-arrow svg { width: 22px; height: 22px; }
  .next-arrow:hover { background: rgba(255,227,154,0.14); color: var(--moon); transform: translateY(-50%) translateX(-3px); }
  .next-arrow:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; }
  .card { cursor: default; }
  .card:not(.flipped) { cursor: pointer; }
}
@media (hover: hover) and (pointer: fine) and (max-width: 620px) {
  .next-arrow:not([hidden]) { right: auto; left: -10px; top: auto; bottom: -64px; transform: none; }
  .next-arrow:hover { transform: translateX(-3px); }
}

/* Descartar: etiquetas al arrastrar, pista a dos lados y papelera en ordenador */
.drag-tag { position: absolute; top: 18%; z-index: 4; font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; letter-spacing: .06em; text-transform: uppercase; padding: 4px 14px; border-radius: 12px; border: 3px solid; background: rgba(255,246,227,.92); opacity: 0; pointer-events: none; }
.tag-next { right: 18px; color: #3c6fb8; transform: rotate(10deg); }
.tag-skip { left: 18px; color: #d24c4c; transform: rotate(-10deg); }
.swipe-hint { gap: 14px; }
.hint-side { display: inline-flex; align-items: center; gap: 8px; }
.hint-side.skip { color: #ffb3ae; opacity: .85; }
.hint-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--muted); opacity: .6; }
.swipe-hint svg.nudge-r { animation: nudge-r 1.8s ease-in-out infinite; }
@keyframes nudge-r { 0%, 100% { transform: translateX(0); } 50% { transform: translateX(8px); } }
.skip-arrow { display: none; }
@media (hover: hover) and (pointer: fine) {
  .swipe-hint svg { display: none; }
  .hint-side::before { font-weight: 800; }
  .skip-arrow:not([hidden]) {
    display: grid; place-items: center; position: absolute; top: 50%; left: calc(100% + 22px); transform: translateY(-50%);
    width: 52px; height: 52px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.05);
    color: var(--muted); cursor: pointer; padding: 0; z-index: 3; transition: background .2s, color .2s, transform .2s;
  }
  .skip-arrow svg { width: 22px; height: 22px; }
  .skip-arrow:hover { background: rgba(255,120,110,0.16); color: #ffb3ae; transform: translateY(-50%) translateX(3px); }
  .skip-arrow:focus-visible { outline: 2px solid #ffb3ae; outline-offset: 3px; }
}
@media (hover: hover) and (pointer: fine) and (max-width: 620px) {
  .skip-arrow:not([hidden]) { left: auto; right: -10px; top: auto; bottom: -64px; transform: none; }
}
.pill.danger { background: #e5484d; color: #fff; }
.check { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 0.95rem; cursor: pointer; }
/* Casilla propia: cuadrado redondeado que se llena de luna con una marca al activarse. */
.check input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 24px; height: 24px; min-height: 0; margin: 0; padding: 0; border-radius: 8px; border: 2px solid rgba(255,255,255,.28); background: rgba(255,255,255,.06); cursor: pointer; transition: background .15s, border-color .15s; }
.check input::after { content: ""; position: absolute; left: 50%; top: 45%; width: 11px; height: 6px; border: solid var(--ink); border-width: 0 0 3px 3px; transform: translate(-50%, -50%) rotate(-45deg) scale(0); transition: transform .15s cubic-bezier(.3,1.6,.5,1); }
.check input:checked { background: var(--moon); border-color: var(--moon); }
.check input:checked::after { transform: translate(-50%, -50%) rotate(-45deg) scale(1); }
#kid-add .two.solo { grid-template-columns: 1fr; }
.check input:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }
.disc-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.disc-thumb { flex: none; width: 64px; height: 40px; border-radius: 8px; overflow: hidden; position: relative; }
.disc-thumb svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.disc-row .mine-btn { padding: 0 12px; color: var(--moon); }
.disc-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
.disc-head span { font-size: 0.85rem; color: var(--muted); }
.disc-head .mine-btn { padding: 0 12px; color: var(--moon); }
.disc-head .mine-btn.on { background: var(--moon); border-color: var(--moon); color: var(--ink); }
#disc-msg:empty { display: none; }
.card.demo { transition: transform .45s cubic-bezier(.3,.8,.3,1) !important; }
@media (prefers-reduced-motion: reduce) { .swipe-hint svg.nudge-r { animation: none; } }

/* Más de tres hijos en una carta: medallas más pequeñas */
.kids { flex-wrap: wrap; }
.kids.many { gap: 10px 12px; }
.kids.many .medal { width: 46px; height: 46px; }
.kids.many .medal svg.av { width: 40px; height: 40px; }
.kids.many .kstate { display: none; }
/* Familias numerosas: el dibujo de arriba encoge para que la pregunta y quién contesta se vean siempre enteros */
/* El dibujo no encoge (eso en Safari no funcionaba): crece hasta el 40 % con el sitio que deja el texto. La pregunta y las
   medallas ocupan siempre su altura natural (base auto y sin encoger; con "flex: 1", Safari las medía como si midieran 0). */
.front .scene { height: auto; flex: 1000 0 0px; min-height: 64px; max-height: 40%; }
.front .fbody { flex: 1 0 auto; }
.front .qwrap { flex: 1 0 auto; }
/* Más de cinco personas en la carta: medallas pequeñas, tres o cuatro por fila */
.kids.crowd { gap: 10px 6px; }
.kids.crowd .kid { width: 60px; }
.kids.crowd .medal { width: 40px; height: 40px; }
.kids.crowd .medal svg.av { width: 34px; height: 34px; }
.kids.crowd .kid.pending .medal::after { inset: -5px; }
.kids.crowd .badge { transform: scale(.75); transform-origin: 100% 100%; }
.kids.crowd .kname { font-size: .66rem; max-width: 62px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kids.crowd .kstate { display: none; }
.grown.crowd { margin-top: 8px; }

/* Tus hijos */
.kid-row { display: flex; align-items: center; gap: 12px; padding: 10px 12px; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; }
.kid-row.editing { flex-wrap: wrap; }
.kid-row.editing .two { flex: 1 1 220px; }
.kid-row.editing .row { flex-basis: 100%; }
.kid-av svg.av { width: 44px; height: 44px; border-radius: 50%; display: block; }
.kid-row .mine-t { flex: 1; min-width: 0; }
.mine-btn[disabled] { opacity: .35; cursor: default; }

/* Fila de los mayores en la carta */
.grown { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.grown .glabel { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-soft); margin-right: 2px; }
.gchip { flex-direction: row; gap: 5px; padding: 3px 9px 3px 3px; border-radius: 999px; background: var(--cs); border: 2px solid transparent; font: 800 0.8rem var(--font-body); color: var(--c); }
.gchip svg.av { width: 22px; height: 22px; border-radius: 50%; }
.gchip > svg:not(.av) { width: 14px; height: 14px; }
.gchip.done { border-color: var(--c); }
#kids-list h2 { margin-top: 6px; }

/* Móvil en horizontal: se pide volver a vertical (la web no puede bloquear el giro en iPhone). */
.rotate { display: none; }
@media (orientation: landscape) and (max-height: 500px) and (pointer: coarse) {
  .rotate { display: flex; position: fixed; inset: 0; z-index: 100; flex-direction: column; align-items: center; justify-content: center; gap: 6px; background: linear-gradient(180deg, var(--sky-top), var(--sky-bottom)); color: var(--fg); text-align: center; }
  .rotate svg { width: 72px; height: 72px; color: var(--moon); animation: girar 2.4s ease-in-out infinite; }
  .rotate p { margin: 8px 0 0; font: 800 1.4rem var(--font-display); }
  .rotate small { color: var(--muted); font-weight: 700; }
}
@keyframes girar { 0%, 30% { transform: rotate(90deg); } 60%, 100% { transform: rotate(0deg); } }
@media (prefers-reduced-motion: reduce) { .rotate svg { animation: none; } }

/* Diario: pestañas, buscador, resumen del mes y cartas con burbujas */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.dhead { display: flex; gap: 8px; align-items: center; }
.dtabs { flex: 1; display: flex; gap: 4px; background: var(--panel); border-radius: 12px; padding: 4px; }
.dtab { flex: 1; border: 0; background: none; color: var(--muted); font: 800 0.88rem var(--font-body); padding: 9px 4px; border-radius: 9px; cursor: pointer; min-height: 38px; }
.dtab[aria-selected="true"] { background: var(--paper); color: var(--ink); }
.dtab:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }
.dsearch-btn[aria-expanded="true"] { background: var(--paper); color: var(--ink); }
.dsearch-btn svg { width: 18px; height: 18px; }
.dsearch { display: flex; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; padding: 0 12px; }
.dsearch[hidden] { display: none; }
.dsearch input { flex: 1; min-width: 0; background: none; border: 0; color: var(--fg); font: 600 16px var(--font-body); outline: none; padding: 11px 0; }
.dlist { display: flex; flex-direction: column; gap: 14px; }
.dstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.dstat { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px; }
.dstat b { display: block; font: 800 1.45rem/1 var(--font-display); color: var(--moon); font-variant-numeric: tabular-nums; }
.dstat span { font-size: 0.75rem; color: var(--muted); font-weight: 700; line-height: 1.2; display: block; margin-top: 4px; }
.eyebrow { font: 800 0.7rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; }
.dmemory { background: linear-gradient(135deg, #3d3a8a, #2a2f6e); border: 1px solid rgba(255,227,154,0.35); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.dmemory .eyebrow { color: var(--moon); }
.dmemory q { font: 700 1.05rem/1.35 var(--font-display); quotes: "“" "”"; }
.dmemory small { color: var(--muted); font-weight: 700; }
.dgrow { background: var(--paper); color: var(--ink); border-radius: 18px; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.dgrow .q { font: 800 1rem/1.3 var(--font-display); }
.then { display: grid; grid-template-columns: 62px 1fr; gap: 10px; align-items: start; }
.then .age { font: 800 0.74rem/1.25 var(--font-body); color: var(--ink-soft); text-align: center; background: #ffe1d6; border-radius: 10px; padding: 6px 4px; }
.then p { margin: 0; font-weight: 600; }
.dmonth { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.dmonth h3 { margin: 0 0 8px; font: 800 0.72rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; justify-content: space-between; }
.dwd, .dweek { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; padding: 4px 8px; }
.dwd span { text-align: center; font: 800 0.62rem var(--font-body); color: var(--muted); opacity: 0.7; }
.dweek { border-radius: 999px; margin-top: 3px; }
.dweek.lit { background: rgba(255,227,154,0.13); }
.dweek i { width: 16px; height: 16px; justify-self: center; border-radius: 50%; background: rgba(255,255,255,0.09); display: block; }
.dweek i.on { background: var(--moon); box-shadow: 0 0 6px rgba(255,227,154,0.6); }
.dweek i.fut { opacity: 0.35; }
.dweek i.out { opacity: 0.4; }
.dhint { margin: 8px 2px 0; font-size: 0.72rem; color: var(--muted); }
.dnight { display: flex; flex-direction: column; gap: 10px; }
.dnight h2 { margin: 2px 0 0; font: 800 0.76rem var(--font-body); letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.dnight h2::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.entry-row { border-radius: 18px; }
.entry.dentry { padding: 0; gap: 0; }
.etop { display: grid; grid-template-columns: 64px 1fr auto auto; gap: 8px; align-items: center; padding: 10px 8px 8px 10px; }
.dthumb { width: 64px; height: 44px; border-radius: 10px; overflow: hidden; display: block; }
.dthumb svg { width: 100%; height: 100%; display: block; }
.dentry .eq { font: 800 0.98rem/1.25 var(--font-display); min-width: 0; }
.dentry .eq small { display: block; font: 700 0.72rem var(--font-body); color: var(--ink-soft); margin-top: 2px; }
.dstar { width: 36px; height: 36px; border: 0; background: none; color: #c9bfa6; cursor: pointer; border-radius: 50%; display: grid; place-items: center; padding: 0; }
.dstar svg { width: 21px; height: 21px; }
.dstar[aria-pressed="true"] { color: #f2b51d; }
.dentry .more { margin: 0; }
.says { display: flex; flex-direction: column; gap: 6px; padding: 0 10px 12px; }
.dsay { display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: start; }
.dav svg.av { width: 30px; height: 30px; border-radius: 50%; display: block; }
.bubble { background: #fff; border-radius: 4px 14px 14px 14px; padding: 7px 10px; min-width: 0; overflow-wrap: anywhere; }
.bubble b { font: 800 0.8rem var(--font-body); display: block; }
.bubble p { margin: 2px 0 0; font-size: 0.93rem; white-space: pre-wrap; }
.voice { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.dplay { width: 32px; height: 32px; border-radius: 50%; border: 0; display: grid; place-items: center; color: #fff; cursor: pointer; flex: none; padding: 0; }
.dplay svg { width: 13px; height: 13px; }
.dplay:disabled { opacity: 0.6; }
.wave { display: flex; gap: 2px; align-items: center; flex: 1; height: 22px; min-width: 0; overflow: hidden; }
.wave i { width: 3px; flex: none; border-radius: 2px; background: currentColor; opacity: 0.35; transition: opacity 0.1s; }
.wave i.lit { opacity: 1; }
.dmiss { margin: 0; font-size: 0.82rem; color: var(--ink-soft); font-style: italic; padding: 0 12px 12px; }
.pchip { padding: 4px 14px 4px 4px; background: var(--panel); }
.pchip .dav svg.av { width: 28px; height: 28px; }
.pchip[aria-pressed="true"] { background: var(--paper); color: var(--ink); }
.dprofile { background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 14px; display: grid; grid-template-columns: 56px 1fr; gap: 12px; align-items: center; }
.pav svg.av { width: 56px; height: 56px; border-radius: 50%; display: block; }
.dprofile h3 { margin: 0; font: 800 1.15rem var(--font-display); }
.dprofile p { margin: 2px 0 0; color: var(--muted); font-size: 0.85rem; font-weight: 700; }
.dbars { display: flex; flex-direction: column; gap: 6px; grid-column: 1 / -1; }
.dbar { display: grid; grid-template-columns: 96px 1fr 28px; gap: 8px; align-items: center; font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.dbar span:nth-child(2) { height: 8px; border-radius: 4px; background: rgba(255,255,255,0.08); overflow: hidden; }
.dbar span:nth-child(2) i { display: block; height: 100%; border-radius: 4px; }
.dbar span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
@media (prefers-reduced-motion: reduce) { .wave i { transition: none; } }

/* Cuenta: aviso de prueba sin cuenta y sección Cuenta */
.trial { width: 100%; box-sizing: border-box; display: flex; align-items: center; gap: 6px 10px; flex-wrap: wrap; background: rgba(255,227,154,0.12); border: 1px solid rgba(255,227,154,0.4); border-radius: 14px; padding: 6px 8px 6px 12px; font-size: 0.82rem; font-weight: 700; color: var(--paper); }
.trial[hidden] { display: none; }
.trial.urge { background: rgba(255,138,107,0.16); border-color: rgba(255,138,107,0.6); }
.enter-link { border: 0; background: none; color: var(--muted); font: 600 0.82rem var(--font-body); min-height: 36px; padding: 0 8px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.enter-link[hidden], main:has(#card.flipped) .enter-link { display: none; }
#share-link:not([hidden]) ~ #enter-link, main:has(#card.flipped) #share-link, .bottom:has(#trial:not([hidden])) #share-link { display: none; }
.trial span { flex: 1 1 160px; line-height: 1.3; }
.trial-btn { border: 0; background: var(--moon); color: var(--ink); font: 800 0.85rem var(--font-display); border-radius: 999px; padding: 0 14px; min-height: 36px; cursor: pointer; }
.trial-link { border: 0; background: none; color: var(--paper); font: 700 0.85rem var(--font-body); text-decoration: underline; text-underline-offset: 3px; min-height: 36px; padding: 0 4px; cursor: pointer; }
.acc-lead { margin: 0; font: 800 1.1rem/1.3 var(--font-display); color: var(--paper); }
.link-btn.inline { padding: 0; font-size: inherit; }
a.menu-row { text-decoration: none; box-sizing: border-box; }
.menu-row:has(+ .menu-row[hidden]) { border-bottom: 0; }

/* Mazo vacío: sin cartas debajo, solo el hueco del mazo con el aviso. */
.slot.empty .under { opacity: 0; transition: opacity .3s; }
.card.empty { cursor: default; }
.card.empty .back { background: rgba(255,255,255,0.04); border: 2px dashed rgba(255,246,227,0.35); box-shadow: none; }
.card.empty .back::before { display: none; }
.card.empty .emblem { opacity: 0.4; filter: none; }
.card.empty .back .label { font-size: 1.45rem; }
.card.empty .back .hint { max-width: 24ch; text-align: center; line-height: 1.4; color: var(--fg); }
#show-disc { min-height: 44px; }

/* Plan gratuito: hoja de Premium e interruptor de prueba en el menú */
.prem-why { margin: 0 4px; color: var(--fg); font-weight: 700; line-height: 1.4; }
.prem-list { margin: 0; padding: 0 4px 0 24px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; font-weight: 600; }
.prem-list li::marker { color: var(--moon); }
#go-premium { min-height: 44px; }
.switch { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch .sw { flex: none; width: 50px; height: 30px; border-radius: 999px; background: rgba(255,255,255,0.16); position: relative; transition: background .2s; }
.switch .sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: var(--paper); transition: transform .2s; }
.switch input:checked + .sw { background: var(--moon); }
.switch input:checked + .sw::after { transform: translateX(20px); background: var(--ink); }
.switch input:focus-visible + .sw { outline: 3px solid var(--moon); outline-offset: 3px; }
.switch b { display: block; }
.switch small { display: block; color: var(--muted); font-weight: 700; font-size: 0.82rem; }
@media (prefers-reduced-motion: reduce) { .switch .sw, .switch .sw::after { transition: none; } }

/* Avisos */
.av-hora { display: flex; align-items: center; gap: 10px; font-weight: 700; flex-wrap: wrap; }
.av-hora[hidden] { display: none; }
.av-hora input { width: auto; flex: none; font: inherit; color: var(--paper); background: rgba(255,255,255,0.08); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; color-scheme: dark; }
#av-msg:empty { display: none; }
#av-actions:not(:has(button:not([hidden]))) { display: none; }

/* Límite de personas del plan gratuito */
.limit-box { margin-top: 14px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: rgba(255,255,255,0.05); display: flex; flex-direction: column; gap: 10px; }
.limit-box[hidden] { display: none; }
.limit-box.full { border-color: rgba(255,227,154,0.55); background: rgba(255,227,154,0.08); }
.limit-head { display: flex; align-items: center; gap: 10px; }
.limit-lock { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; background: var(--moon); color: var(--ink); flex: none; }
.limit-lock svg { width: 16px; height: 16px; }
.limit-box:not(.full) .limit-lock { background: rgba(255,255,255,0.12); color: var(--paper); }
.limit-meter { height: 8px; border-radius: 999px; background: rgba(255,255,255,0.12); overflow: hidden; }
.limit-meter i { display: block; height: 100%; border-radius: inherit; background: var(--moon); }
.limit-box p { margin: 0; line-height: 1.4; }
.limit-box .pill { align-self: flex-start; }

/* Cara de respuesta en el plan gratuito */
.mic-lock { position: absolute; z-index: 3; right: -4px; top: -4px; width: 42px; height: 42px; border: 3px solid var(--paper); border-radius: 50%; display: grid; place-items: center; background: var(--moon); color: var(--ink); box-shadow: 0 2px 6px rgba(0,0,0,0.25); pointer-events: none; }
.mic-lock svg { width: 20px; height: 20px; }
.prem-chip { display: inline-flex; align-items: center; gap: 6px; margin-top: 4px; padding: 4px 10px; border-radius: 999px; background: var(--moon); color: var(--ink); font-weight: 800; font-size: 0.78rem; }
.prem-chip svg { width: 12px; height: 12px; }

/* Plan gratuito: escribir directamente y grabar como Premium */
.mic-prem { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1.5px dashed color-mix(in srgb, var(--c) 45%, transparent); background: none; color: var(--ink); font: 800 0.95rem var(--font-display); cursor: pointer; text-align: left; }
.mic-prem small { display: block; font: 700 0.72rem var(--font-body); color: var(--ink-soft); }
.mp-ic { position: relative; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--c); color: #fff; flex: none; }
.mp-ic > svg { width: 22px; height: 22px; }
.mp-lock { position: absolute; right: -6px; top: -6px; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--moon); color: var(--ink); border: 2px solid var(--paper); }
.mp-lock svg { width: 12px; height: 12px; }
#d-promo { margin: 0 0 14px; }
.empty-acts { flex-wrap: nowrap; }
.empty-acts:not(:has(button:not([hidden]))) { display: none; }
.empty-acts .pill { white-space: nowrap; }

/* Familia sin registrar: aviso de bienvenida y botón rápido */
.fam-chip { display: inline-flex; align-items: center; gap: 6px; border: 1px solid rgba(255,227,154,0.6); background: rgba(255,227,154,0.14); color: var(--moon); border-radius: 999px; padding: 0 12px 0 10px; min-height: 36px; font: 800 0.85rem var(--font-display); cursor: pointer; }
.fam-chip[hidden] { display: none; }
.fam-chip svg { width: 18px; height: 18px; }
.welcome { padding-top: 18px; z-index: 31; }
.i-icon img { width: 56px; height: 56px; border-radius: 15px; box-shadow: 0 6px 18px rgba(0,0,0,0.35); display: block; }
.i-steps { list-style: none; counter-reset: paso; margin: 2px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.i-steps li { counter-increment: paso; display: flex; align-items: center; gap: 12px; line-height: 1.35; font-size: 0.97rem; background: rgba(255,255,255,0.05); border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.i-steps li::before { content: counter(paso); flex: none; width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--moon); color: #1d2457; font: 800 0.9rem var(--font-display); }
.i-steps b { color: var(--paper); }
.i-steps .ico { display: inline-block; width: 20px; height: 20px; vertical-align: -4px; color: var(--moon); }
.i-steps .ico.dots { width: auto; font-weight: 900; letter-spacing: 1px; }
.i-note { font-size: 0.92rem; color: var(--muted); }
.w-body .i-note { margin-top: 2px; }
.w-close { position: absolute; top: 12px; right: max(12px, env(safe-area-inset-right, 0px)); width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--fg); display: grid; place-items: center; cursor: pointer; }
.w-close svg { width: 18px; height: 18px; }
.w-body { display: flex; flex-direction: column; gap: 12px; }
.w-kids { display: flex; gap: 10px; align-items: flex-end; margin-top: 4px; }
.w-kids .wk { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: rgba(255,255,255,0.08); border: 2px dashed rgba(255,227,154,0.5); color: var(--moon); font: 800 1.4rem var(--font-display); }
.w-kids .wk.big { width: 70px; height: 70px; }
.w-body h2 { padding-right: 48px; font-size: 1.35rem; }
.w-body p { margin: 0; line-height: 1.45; }
.w-body .w-warn { color: var(--paper); font-weight: 700; }
.w-list { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; color: var(--muted); }
.w-list li::marker { color: var(--moon); }
.w-acts { display: flex; flex-direction: column; gap: 10px; margin-top: 6px; }
.example-note { margin: 0 0 12px; padding: 10px 14px; border-radius: 14px; background: rgba(255,227,154,0.12); border: 1px solid rgba(255,227,154,0.4); color: var(--paper); font-weight: 700; font-size: 0.9rem; line-height: 1.4; }
.example-note[hidden] { display: none; }
.add-new { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; }
.add-new svg { width: 18px; height: 18px; }

/* Sin familia: medallón vacío y cara de respuesta apagada */
.gq { font-family: var(--font-display); font-weight: 800; font-size: 1.6rem; color: #6b70a8; }
.kid.ghost .kname { color: #6b70a8; }
.kid.ghost .kstate { display: block; max-width: 150px; text-align: center; line-height: 1.25; margin-top: 3px; }
.ghost-zone { flex: 0 0 auto; margin-top: 26px; opacity: .42; filter: grayscale(1); pointer-events: none; }
.answer .ghost-zone textarea { height: 40px; width: 100%; box-sizing: border-box; }
.ghost-zone .mic-prem { margin-bottom: 6px; }
.mic-prem.off { cursor: default; }
.ghost-box { flex: 0 1 auto; min-height: 0; overflow: auto; margin: auto 0 10px; background: color-mix(in srgb, var(--c) 10%, #fff); border: 1px solid color-mix(in srgb, var(--c) 30%, transparent); border-radius: 16px; padding: 12px 14px; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
.ghost-box b { font-size: .98rem; line-height: 1.25; }
.ghost-box ul { margin: 0; padding-left: 18px; font-size: .86rem; line-height: 1.35; }

/* Etiquetas Premium y Nuevo */
.prem-tag { display: inline-flex; align-items: center; gap: 5px; font-weight: 800; color: var(--moon); }
.prem-tag svg { width: 12px; height: 12px; }
.new-tag { display: inline-block; vertical-align: 2px; margin-left: 6px; padding: 2px 8px; border-radius: 999px; background: #3ecf8e; color: #0b2a1c; font: 800 0.66rem var(--font-body); letter-spacing: 0.06em; text-transform: uppercase; line-height: 1.4; }
#q-form.locked { opacity: .45; filter: grayscale(1); pointer-events: none; }
#q-prem { margin-bottom: 12px; }

/* Invitar a otra familia */
.rf-box{display:block;margin:12px auto 0;width:100%;max-width:290px;border:1px solid rgba(255,227,154,.45);background:rgba(255,227,154,.08);border-radius:16px;padding:12px 14px;text-align:left}
.rf-box b{display:block;color:var(--paper);font:800 .95rem var(--font-display)} .rf-box small{display:block;color:var(--muted);font-weight:600;font-size:.78rem;margin-top:2px}
.rf-box button{margin-top:10px;width:100%;border:0;border-radius:999px;background:var(--moon);color:var(--ink);font:800 .95rem var(--font-display);min-height:42px;cursor:pointer}
.rf-link{display:inline-block;margin-top:10px;background:none;border:0;color:var(--muted);font:700 .82rem var(--font-body);text-decoration:underline;text-underline-offset:3px;cursor:pointer}
.rf-how{margin:0 4px;padding:14px;border-radius:16px;background:rgba(255,227,154,.1);border:1px solid rgba(255,227,154,.45)}
.rf-how b{display:block;color:var(--moon);font:800 1rem var(--font-display);margin-bottom:10px}
.rf-how ol{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:9px}
.rf-how li{display:flex;align-items:center;gap:10px;color:var(--paper);font-weight:700;font-size:1rem}
.rf-how li i{flex:none;width:28px;height:28px;border-radius:50%;display:grid;place-items:center;background:var(--moon);color:var(--ink);font:900 .85rem var(--font-display);font-style:normal}
.rf-how u{text-decoration-color:var(--moon);text-underline-offset:3px;text-decoration-thickness:2px}
.rf-how p{margin:10px 0 0;color:var(--muted);font-weight:600;font-size:.86rem}
.rf-list{display:flex;flex-direction:column;gap:8px;margin:0 4px}
.rf-row{display:flex;justify-content:space-between;gap:10px;padding:10px 12px;border-radius:12px;background:rgba(255,255,255,.06);font-weight:700}
.rf-row small{display:block;color:var(--muted);font-weight:600;font-size:.78rem}
.rf-row em{font-style:normal;color:var(--moon);font:800 .82rem var(--font-display);white-space:nowrap;align-self:center}
.rf-row em.w{color:var(--muted)}
.rf-dots{display:flex;gap:4px;margin:5px 0 3px} .rf-dots i{width:22px;height:5px;border-radius:3px;background:rgba(255,255,255,.18)} .rf-dots i.d{background:var(--moon)} .rf-dots i.h{background:linear-gradient(90deg,var(--moon) 50%,rgba(255,255,255,.18) 50%)}
.rf-share{display:flex;gap:8px} .rf-share .pill{flex:1;justify-content:center}
.rf-hero{display:flex;align-items:center;gap:12px;margin:0 4px}
.rf-hero i{flex:none;width:54px;height:54px;border-radius:50%;background:var(--moon);display:grid;place-items:center;color:var(--ink);font:900 1.2rem var(--font-display);font-style:normal}
.rf-hero b{display:block;font:800 1.1rem var(--font-display);color:var(--paper)} .rf-hero small{color:var(--muted);font-weight:600}
.rf-name{display:grid;gap:6px;margin:0 4px} .rf-name input{font:600 1rem var(--font-body)}
.menu-row.rf .mi{background:var(--moon);color:var(--ink)}
.install .pill { justify-content: center; width: 100%; }

/* Dibujo de cada persona: se toca para cambiarlo */
.av-btn { position: relative; flex: none; padding: 0; border: 0; background: none; border-radius: 50%; cursor: pointer; color: var(--ink); }
.av-btn svg.av { width: 44px; height: 44px; border-radius: 50%; display: block; }
.av-pen { position: absolute; right: -3px; bottom: -3px; width: 20px; height: 20px; border-radius: 50%; background: var(--moon); color: var(--ink); display: grid; place-items: center; box-shadow: 0 0 0 2px var(--sky-top); }
.av-pen svg { width: 11px; height: 11px; }
.kid-row .av-pen, .box .av-pen { box-shadow: 0 0 0 2px #252b4e; }
.av-btn:focus-visible { outline: 2px solid var(--moon); outline-offset: 3px; }
.av-line { display: flex; align-items: center; gap: 12px; }
.av-line .two { flex: 1; min-width: 0; }
#kn-av svg.av { width: 48px; height: 48px; }

/* Editor del dibujo */
.av-sheet { gap: 14px; overflow: hidden; }
.av-top { display: flex; align-items: center; gap: 14px; }
.av-top .link-btn { padding: 6px 0 0; font-size: 0.85rem; }
.av-big svg.av { width: 76px; height: 76px; border-radius: 50%; display: block; }
.av-opts { display: flex; flex-direction: column; gap: 14px; flex: 1 1 auto; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; margin: 0 -16px; padding: 4px 16px; border-block: 1px solid var(--line); padding-block: 12px; }
.av-row h3 { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin: 0 0 6px; font-weight: 800; }
.av-list { display: flex; flex-wrap: wrap; gap: 10px 8px; }
.av-opt { flex: none; width: 52px; height: 52px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; display: grid; place-items: center; box-shadow: 0 0 0 2px transparent; transition: box-shadow .15s; }
.av-opt svg.av { width: 52px; height: 52px; border-radius: 50%; display: block; }
.av-opt.sw { width: 44px; height: 44px; }
.av-opt.sw i { width: 36px; height: 36px; border-radius: 50%; display: block; }
.av-opt[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--moon); }
.av-opt:focus-visible { outline: 2px solid var(--fg); outline-offset: 3px; }
.av-sheet .row .pill { justify-content: center; }
.av-opt:not(.sw)[aria-pressed="true"] { box-shadow: 0 0 0 2px var(--sheet), 0 0 0 5px var(--moon); }

/* Cuándo nació: campo que abre la hoja de año y mes */
.nac-btn { width: 100%; box-sizing: border-box; min-height: 46px; border-radius: 12px; border: 1px solid var(--line); background: rgba(10,12,40,0.5); color: var(--fg); font: 400 16px var(--font-body); padding: 10px 10px 10px 12px; display: flex; align-items: center; justify-content: space-between; gap: 4px; cursor: pointer; text-align: left; white-space: nowrap; }
.nac-btn.empty span { color: var(--muted); }
.nac-btn svg { width: 16px; height: 16px; flex: none; color: var(--muted); }
.nac-btn:focus-visible { outline: 2px solid var(--moon); outline-offset: 2px; }
#kid-add .two, .kid-row.editing .two { grid-template-columns: 1fr 128px; }
.nac-sheet { gap: 10px; }
.nac-sub { margin: 4px 0 0; color: var(--muted); font-size: 0.92rem; }
.nac-label { font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); font-weight: 800; margin: 8px 0 8px; }
.nac-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.nac-grid.m { grid-template-columns: repeat(4, 1fr); }
.nac-grid button { min-height: 46px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.06); color: var(--fg); font: 800 1rem var(--font-display); cursor: pointer; }
.nac-grid button[aria-pressed="true"] { background: var(--moon); border-color: var(--moon); color: var(--ink); }
.nac-grid button:disabled { opacity: 0.3; cursor: default; }
.nac-grid button:focus-visible { outline: 2px solid var(--fg); outline-offset: 2px; }
#exp-msg:empty { display: none; }
.legal-links { text-align: center; margin-top: 18px; }
.legal-links a { color: var(--muted); text-decoration: underline; text-underline-offset: 2px; }
/* Consentimiento dentro de la carta: una vez por familia, al empezar a escribir o al grabar. */
.aconsent { display: flex; gap: 10px; align-items: flex-start; font: 600 0.8rem/1.35 var(--font-body); color: var(--ink); margin: 0 0 10px; cursor: pointer; animation: viewIn .25s ease both; }
.aconsent input { -webkit-appearance: none; appearance: none; position: relative; flex: none; width: 24px; height: 24px; min-height: 0; margin: 1px 0 0; padding: 0; border-radius: 8px; border: 2px solid color-mix(in srgb, var(--c) 45%, transparent); background: #fff; cursor: pointer; }
.aconsent input:checked { background: var(--c); border-color: var(--c); }
.aconsent input:checked::after { content: ""; position: absolute; left: 50%; top: 45%; width: 11px; height: 6px; border: solid #fff; border-width: 0 0 3px 3px; transform: translate(-50%, -50%) rotate(-45deg); }
.aconsent a { color: var(--c); font-weight: 800; }
.aconsent.nudge { animation: nudge .3s ease 2; }
@media (prefers-reduced-motion: reduce) { .aconsent, .aconsent.nudge { animation: none; } }
.aconsent { margin-top: 8px; }
/* En móviles bajos no caben el botón de grabar, el texto y la casilla: mientras se pide, el botón de grabar se aparta. */
@media (max-height: 700px) { .abody:has(.aconsent:not([hidden])) #to-rec { display: none; } }

/* Otros móviles: QR y número de un solo uso para unir otro móvil a la familia */
#vin-on { display: flex; flex-direction: column; gap: 12px; }
#vin-on[hidden] { display: none; }
.vin-qr { width: 220px; height: 220px; align-self: center; border-radius: 18px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,0.25); }
.vin-qr svg { display: block; width: 100%; height: 100%; }
.vin-num { margin: 0; text-align: center; font: 800 1.8rem/1.1 var(--font-display); letter-spacing: 0.06em; color: var(--paper); font-variant-numeric: tabular-nums; }
.vin-cad { text-align: center; }
.rec-box summary { font-weight: 800; font-size: 0.9rem; color: var(--muted); cursor: pointer; }
.rec-box:not([open]) { gap: 0; }
.unir-num { text-align: center; font: 800 1.5rem var(--font-display); letter-spacing: 0.06em; color: var(--paper); margin: 4px 0; }
#vin-box > .msg:empty, #unir-box > .msg:empty { display: none; }
/* En un móvil en prueba (lo normal en el móvil nuevo), unirse va primero. */
.view[data-view="codigo"] { display: flex; flex-direction: column; gap: 14px; }
.view[data-view="codigo"][hidden] { display: none; }
#unir-form[hidden] { display: none; }
/* Lector de QR a pantalla completa, con la cámara trasera */
.scan { position: fixed; inset: 0; z-index: 80; background: #000; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.scan[hidden] { display: none; }
.scan video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.scan-frame { position: relative; width: min(64vw, 280px); aspect-ratio: 1; border-radius: 22px; box-shadow: 0 0 0 100vmax rgba(10, 12, 35, 0.55); border: 3px solid var(--moon); }
.scan-t { position: relative; margin: 22px 24px 0; text-align: center; font-weight: 800; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.scan-x { position: absolute; bottom: calc(28px + env(safe-area-inset-bottom)); background: rgba(10, 12, 35, 0.7); color: #fff; border-color: rgba(255,255,255,0.4); }

/* Otros dispositivos: dos papeles plegables; el usuario elige cuál es este dispositivo */
.rol-intro { margin: 2px 2px -4px; }
.rol { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.rol-h { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 72px; padding: 12px 14px; border: 0; background: transparent; color: var(--fg); text-align: left; cursor: pointer; font: inherit; }
.rol-h:active { background: rgba(255,255,255,0.06); }
.rol-h .chev { transition: transform 0.25s ease; }
.rol-h[aria-expanded="true"] .chev { transform: rotate(180deg); }
.rol.abierto { border-color: rgba(255,227,154,0.45); }
.rol-b { display: flex; flex-direction: column; gap: 12px; padding: 0 14px 16px; }
.rol-b[hidden] { display: none; }
#vin-box > .msg:empty, #unir-box > .msg:empty { display: none; }
.fam-num { margin: 0 4px; text-align: center; }
.fam-num[hidden] { display: none; }

/* Tarjeta de Google Analytics: gana a las demás tarjetas de abajo y se va al girar la carta. */
.ga-card .ga-btns { display: flex; gap: 8px; margin-left: auto; }
.ga-card a { color: var(--moon); }
body.con-ga #share-link, body.con-ga #trial, body.con-ga #enter-link, main:has(#card.answering) #ga-card { display: none; }
