/* Estilos de Mi Segundo Cerebro.
   Diseño: una sola columna, como una casa de muñecas en papel cálido.
   Los colores están todos aquí arriba: si quieres cambiar uno, cámbialo aquí. */

:root {
  --paper: #FBF4E6;      /* fondo */
  --card: #FFFDF7;       /* tarjetas */
  --line: #E8D9C0;       /* bordes suaves */
  --line-strong: #E3D2B6;
  --ink: #4A3428;        /* texto */
  --ink-soft: #75573F;   /* texto secundario */
  --brick: #9A5640;      /* botón principal */
  --brick-dark: #7E4432;
  --sage: #5E8C7B;       /* casillas y elegido */
  --sage-soft: #D3E6DC;
  --sage-ink: #2F4A40;
  --late: #8A5A12;       /* "se quedó de ayer" */
  --glow: #F2B935;
  --danger: #A2382B;
  --font-display: 'Fredoka', 'Nunito', system-ui, sans-serif;
  --font-body: 'Nunito', system-ui, -apple-system, sans-serif;
  --radius: 22px;
  color-scheme: light;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.4;
  -webkit-tap-highlight-color: transparent;
}
body.no-scroll { overflow: hidden; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding-top: max(18px, env(safe-area-inset-top, 0px));
  padding-bottom: calc(110px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex;
  flex-direction: column;
  gap: 14px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; margin: 0; text-wrap: balance; }
h1 { font-size: 30px; }
h2 { font-size: 19px; }
h3 { font-size: 15px; color: var(--ink-soft); margin-top: 10px; }

.eyebrow { font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.muted { color: var(--ink-soft); font-size: 14px; margin: 0; }
.center { text-align: center; }

button, input, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 3px solid var(--sage); outline-offset: 2px; }

/* ---- cabecera ---- */
.top { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.top > div { display: flex; flex-direction: column; gap: 2px; }
.room-top { justify-content: flex-start; align-items: center; }
.room-top h1 { font-size: 28px; }
.grow { flex: 1; min-width: 0; }

.icon-btn {
  width: 44px; height: 44px; flex-shrink: 0;
  border-radius: 22px; border: 2px solid var(--line-strong); background: var(--card);
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--ink-soft); text-decoration: none;
}
.icon-btn.small { width: 36px; height: 36px; border-width: 0; background: transparent; }

/* ---- Luna ---- */
.luna-row { display: flex; gap: 10px; align-items: center; }
.luna { flex-shrink: 0; }
.bubble {
  flex: 1; margin: 0;
  background: var(--card); border: 2px solid var(--line);
  border-radius: 18px 18px 18px 6px; padding: 10px 14px;
  font-size: 14px; line-height: 1.45;
}
.bubble.solo { border-radius: 18px; }

/* ---- estados de ánimo ---- */
.moods { border: 0; margin: 0; padding: 0; min-width: 0; }
.moods legend { font-size: 13px; font-weight: 600; color: var(--ink-soft); padding: 0; margin-bottom: 8px; }
.mood-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.chip {
  min-height: 44px; padding: 4px 8px;
  border-radius: 22px; border: 2px solid var(--line-strong); background: var(--card);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.chip.on { border-color: var(--sage); background: var(--sage-soft); color: var(--sage-ink); font-weight: 700; }

/* ---- la casa ---- */
.house-wrap, .interior-wrap { width: 100%; }
.house { display: block; width: 100%; height: auto; }
.room-link { cursor: pointer; }
.room-link:hover .room-hover, .room-link:focus-visible .room-hover { opacity: 0.18; }
.room-link:focus-visible { outline: none; }
.room-link:focus-visible .room-hover { opacity: 0.3; }
.glow { animation: breathe 4s ease-in-out infinite; }
@keyframes breathe { 0%, 100% { opacity: 0.18; } 50% { opacity: 0.36; } }

.interior { display: block; width: 100%; height: auto; }
.luna { border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--line); }
.lamp { animation: breathe 4s ease-in-out infinite; }
.zz { animation: float 3s ease-in-out infinite; }
.zz + .zz { animation-delay: 0.6s; }
@keyframes float { 0%, 100% { transform: translateY(0); opacity: 0.9; } 50% { transform: translateY(-4px); opacity: 0.5; } }

.legend { display: flex; align-items: center; gap: 8px; margin: -6px 0 0; font-size: 12px; color: var(--ink-soft); }
.dot { width: 14px; height: 14px; border-radius: 7px; background: radial-gradient(circle, var(--glow) 40%, #FFE08A 45%); flex-shrink: 0; }
.dot.book { border-radius: 2px; height: 7px; background: #F2A7A0; border: 1px solid #6B4A3A; transform: rotate(-12deg); }
.dot.calm { background: var(--sage-soft); border: 2px solid var(--sage); }

/* ---- tarjetas y listas ---- */
.card {
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px; display: flex; flex-direction: column; gap: 6px; min-width: 0;
}
.items { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 8px; min-height: 48px; transition: opacity 0.5s, transform 0.5s; }
.item.finished { opacity: 0.35; transform: translateX(8px); }
.item.finished .title { text-decoration: line-through; }
.check { flex: 1; display: flex; align-items: center; gap: 12px; cursor: pointer; min-width: 0; padding: 4px 0; }
.check input { width: 22px; height: 22px; accent-color: var(--sage); margin: 0; flex-shrink: 0; }
.text { display: flex; flex-direction: column; min-width: 0; }
.title { font-size: 15px; overflow-wrap: anywhere; }
.sub { font-size: 12px; color: var(--ink-soft); }
.sub.late { color: var(--late); font-weight: 600; }
.tag { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 10px; white-space: nowrap; flex-shrink: 0; }
.tag.example { background: #EFE7D8; color: var(--ink-soft); font-weight: 600; }

.countdown { display: grid; grid-template-columns: repeat(auto-fit, minmax(96px, 1fr)); gap: 8px; }
.cd { border-radius: 16px; padding: 10px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cd-num { font-family: var(--font-display); font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.cd-what { font-size: 12px; font-weight: 700; overflow-wrap: anywhere; }
.cd-when { font-size: 11px; font-weight: 600; }

/* ---- botones ---- */
.primary {
  flex: 1; min-height: 56px; padding: 0 18px;
  border-radius: 28px; border: none; background: var(--brick); color: #FFFDF7;
  font-family: var(--font-display); font-size: 17px; font-weight: 500;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
}
.primary:hover { background: var(--brick-dark); }
.primary:disabled { background: #C9B3A6; cursor: not-allowed; }
.round {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 28px;
  border: 2px solid var(--brick); background: var(--card); color: var(--brick);
  display: inline-flex; align-items: center; justify-content: center;
}
.ghost-btn {
  align-self: flex-start; min-height: 44px; padding: 0 16px;
  border-radius: 22px; border: 2px solid var(--line-strong); background: var(--card);
  font-weight: 700; color: var(--ink); display: inline-flex; align-items: center; gap: 8px;
}
.link-btn { background: none; border: none; padding: 6px 4px; color: var(--brick); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }
.danger { min-height: 44px; padding: 0 16px; border-radius: 22px; border: none; background: var(--danger); color: #fff; font-weight: 700; }
.danger-text { color: var(--danger); align-self: center; }
.row-btns { display: flex; flex-wrap: wrap; gap: 8px; }

/* La barra de abajo con el buzón queda siempre a mano */
.bottom-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 5;
  display: flex; gap: 10px; align-items: center;
  max-width: 480px; margin: 0 auto;
  padding-top: 12px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  background: linear-gradient(to top, var(--paper) 70%, rgba(251, 244, 230, 0));
}

/* ---- ajustes ---- */
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 44px; cursor: pointer; }
.switch-row input { width: 24px; height: 24px; accent-color: var(--sage); flex-shrink: 0; }
.field-label { display: block; font-size: 13px; font-weight: 700; color: var(--ink-soft); margin: 8px 0 6px; }
textarea, input[type="date"], input[type="time"] {
  width: 100%; border: 2px solid var(--line-strong); border-radius: 14px; background: #fff;
  padding: 10px 12px; font-size: 16px; /* 16px evita que el iPhone haga zoom */
}
textarea { resize: vertical; min-height: 84px; }
input[type="date"], input[type="time"] { min-height: 46px; -webkit-appearance: none; appearance: none; }

/* ---- el buzón ---- */
.sheet { position: fixed; inset: 0; z-index: 20; display: flex; align-items: flex-end; justify-content: center; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(74, 52, 40, 0.35); }
.sheet-panel {
  position: relative; width: 100%; max-width: 480px; max-height: 92vh; overflow-y: auto;
  background: var(--paper); border-radius: 26px 26px 0 0;
  padding-top: 18px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; gap: 4px;
  animation: rise 0.25s ease-out;
}
@keyframes rise { from { transform: translateY(30px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; }
.sheet-actions { display: flex; margin-top: 12px; }
.hint { margin: 4px 0 0; font-size: 13px; color: var(--sage-ink); font-weight: 600; }
.understood { margin-top: 10px; background: var(--card); border: 2px solid var(--line); border-radius: 18px; padding: 12px 14px; transition: opacity 0.2s; }
.understood.dim { opacity: 0.6; }
.u-title { display: flex; align-items: center; gap: 8px; margin: 0; font-weight: 700; font-size: 14px; }
.ask { color: var(--late); }
.room-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.room-chip { min-height: 40px; padding: 4px 12px; }
.room-chip.on { background: var(--tag-bg); color: var(--tag-fg); border-color: var(--tag-fg); }
.when-row { display: flex; gap: 10px; }
.when-field { flex: 2; min-width: 0; }
.when-field.small { flex: 1; }
.when-text { margin-top: 6px; }

/* ---- avisos pequeños ---- */
.toast {
  position: fixed; z-index: 30; left: 50%; transform: translateX(-50%);
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  width: calc(100% - 32px); max-width: 440px;
  background: var(--ink); color: #FFFDF7; border-radius: 16px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  font-size: 14px; box-shadow: 0 6px 20px rgba(74, 52, 40, 0.25);
}
.toast .link-btn { color: #FFE08A; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ================= Jardín (pantalla de inicio) ================= */
body[data-view="jardin"] { background: #BFD99A; }
body[data-view="jardin"].garden-night { background: #81957A; }
body[data-view="jardin"] .page { padding: 0; gap: 0; max-width: 480px; }

.garden-scene {
  position: relative;
  width: 100%;
  aspect-ratio: 2 / 3;
  max-height: 80vh;
  min-height: 420px;
  overflow: hidden;
}
.garden { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.garden-top {
  position: absolute; top: 0; left: 0; right: 0;
  padding-top: max(16px, env(safe-area-inset-top, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  display: flex; flex-direction: column; align-items: flex-start; gap: 6px;
}
.garden-top .eyebrow { color: #3E4A3A; font-size: 14px; }
.is-night .garden-top .eyebrow { color: #F2ECDD; }
.weather-pill {
  font-size: 12px; font-weight: 700; color: var(--ink);
  background: rgba(255, 253, 247, 0.85); border: 2px solid rgba(107, 74, 58, 0.25);
  padding: 4px 10px; border-radius: 12px;
}
.garden-bottom {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  position: relative;
  padding-top: 4px;
  padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px));
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  transition: opacity 0.4s;
}
.garden-bottom.leaving, .garden-top.leaving { opacity: 0; pointer-events: none; }
.garden-top { transition: opacity 0.3s; }
.walking .mailbox { pointer-events: none; }
.butterfly-hide, .walking .butterfly { opacity: 0; transition: opacity 0.4s; }
.garden-bubble { align-self: stretch; text-align: center; border-color: #D9E6C4; }

/* El botón "Empecemos": como una tecla de cuento */
.start-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 60px; padding: 0 36px;
  border-radius: 30px; border: 3px solid #6B4A3A;
  background: #FFFDF7; color: #6B4A3A;
  font-family: var(--font-display); font-size: 21px; font-weight: 600; letter-spacing: 0.02em;
  box-shadow: 0 5px 0 #6B4A3A, 0 10px 24px rgba(74, 52, 40, 0.18);
  transition: transform 0.12s, box-shadow 0.12s;
  animation: invite 3.2s ease-in-out infinite;
}
.start-btn:active { transform: translateY(4px); box-shadow: 0 1px 0 #6B4A3A, 0 4px 10px rgba(74, 52, 40, 0.18); }
@keyframes invite { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-3px); } }

/* Entrar en casa: nos acercamos a la puerta */
.garden { transition: transform 0.65s cubic-bezier(0.5, 0, 0.75, 0), opacity 0.65s; transform-origin: var(--door-x, 50%) var(--door-y, 60%); }
.entering .garden { opacity: 0; }
.fade-in { animation: fadeIn 0.45s ease-out; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* Movimiento del jardín */
/* Solo las piezas que se mueven giran o crecen desde su propio centro */
.cloud, .smoke, .flap, .duck-swim, .duck-bob, .wake, .butterfly, .flutter, .wing,
.firefly, .drop, .flake, .fog1, .fog2, .glow, .lamp { transform-box: fill-box; }
.cloud { animation: drift 70s linear infinite; }
.cloud.slower { animation-duration: 110s; }
.cloud.d1 { animation-delay: -10s; } .cloud.d2 { animation-delay: -55s; }
.cloud.d3 { animation-delay: -30s; } .cloud.d4 { animation-delay: -80s; }
@keyframes drift { from { transform: translateX(-60px); } 50% { transform: translateX(60px); } to { transform: translateX(-60px); } }
.sun-spin { animation: spin 60s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.sway { transform-origin: 50% 100%; animation: sway 6s ease-in-out infinite; }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
.smoke { transform-origin: center; animation: smoke 5s ease-out infinite; opacity: 0; }
.smoke.k2 { animation-delay: 1.6s; } .smoke.k3 { animation-delay: 3.2s; }
@keyframes smoke { 0% { transform: translate(0, 0) scale(0.6); opacity: 0.8; } 100% { transform: translate(14px, -60px) scale(1.6); opacity: 0; } }
.duck-swim { animation: swim 18s ease-in-out infinite; transform-origin: center; }
@keyframes swim {
  0% { transform: translateX(0) scaleX(1); } 45% { transform: translateX(95px) scaleX(1); }
  50% { transform: translateX(95px) scaleX(-1); } 95% { transform: translateX(0) scaleX(-1); }
  100% { transform: translateX(0) scaleX(1); }
}
.wake { transform-origin: center; animation: wake 2.4s ease-in-out infinite; }
@keyframes wake { 0%, 100% { transform: scaleX(0.85); opacity: 0.4; } 50% { transform: scaleX(1.05); opacity: 0.8; } }
.duck-bob { animation: bob 2.4s ease-in-out infinite; }
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(1.5px); } }
.ripple { transform-origin: center; animation: ripple 4s ease-out infinite; }
@keyframes ripple { from { transform: scale(0.4); opacity: 0.9; } to { transform: scale(1.6); opacity: 0; } }
.tail { transform-origin: 0% 100%; animation: tail 3s ease-in-out infinite; }
@keyframes tail { 0%, 100% { transform: rotate(0deg); } 50% { transform: rotate(-10deg); } }
.eyelids { opacity: 0; animation: blink 6s infinite; }
@keyframes blink { 0%, 90%, 93.5%, 96%, 99%, 100% { opacity: 0; } 91%, 92.5%, 97%, 98% { opacity: 1; } }
.butterfly { animation: flutter-path 16s ease-in-out infinite; }
@keyframes flutter-path {
  0% { transform: translate(0, 0); } 20% { transform: translate(90px, -60px); }
  40% { transform: translate(160px, -20px); } 60% { transform: translate(90px, 50px); }
  80% { transform: translate(-30px, 10px); } 100% { transform: translate(0, 0); }
}
.flutter { animation: hover 0.9s ease-in-out infinite alternate; }
@keyframes hover { from { transform: translateY(-2px) rotate(-6deg); } to { transform: translateY(2px) rotate(6deg); } }
.flap { transform-origin: center; animation: flap 0.26s ease-in-out infinite alternate; }
@keyframes flap { from { transform: scaleX(1); } to { transform: scaleX(0.4); } }
.star { animation: twinkle 3s ease-in-out infinite; }
.star.s1 { animation-delay: 1s; } .star.s2 { animation-delay: 2s; }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
.firefly { animation: firefly 4s ease-in-out infinite; }
.firefly.f2 { animation-delay: 1.3s; } .firefly.f3 { animation-delay: 2.6s; }
@keyframes firefly { 0%, 100% { opacity: 0; transform: translate(0, 0); } 50% { opacity: 1; transform: translate(10px, -14px); } }
.drop { animation: rain 1.1s linear infinite; }
@keyframes rain { to { transform: translate(-28px, 760px); } }
.flake { animation: snow 9s linear infinite; }
@keyframes snow { 0% { transform: translate(0, 0); } 50% { transform: translate(12px, 380px); } 100% { transform: translate(-6px, 760px); } }
.fog1 { animation: fog 26s ease-in-out infinite; } .fog2 { animation: fog 34s ease-in-out infinite reverse; }
@keyframes fog { 0%, 100% { transform: translateX(-30px); } 50% { transform: translateX(30px); } }
.flash { animation: flash 9s infinite; }
@keyframes flash { 0%, 90%, 94%, 100% { opacity: 0; } 91% { opacity: 0.55; } 93% { opacity: 0.25; } }
.mailbox { cursor: pointer; }
.mailbox:focus-visible { outline: none; }
.mailbox:focus-visible .mailbox-hit { opacity: 0.35; stroke: var(--sage); stroke-width: 8; }

/* ================= Elegir fecha ================= */
.date-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.date-chip { min-height: 40px; padding: 4px 14px; }
.calendar { margin-top: 8px; background: #fff; border: 2px solid var(--line-strong); border-radius: 16px; padding: 8px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; font-family: var(--font-display); font-size: 16px; }
.cal-head .icon-btn.small { font-size: 26px; line-height: 1; color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 2px; text-align: center; }
.cal-week span { font-size: 11px; font-weight: 700; color: var(--ink-soft); padding: 4px 0; }
.cal-day {
  min-height: 40px; border: 2px solid transparent; border-radius: 12px; background: none;
  font-size: 15px; font-variant-numeric: tabular-nums; color: var(--ink);
}
.cal-day.today { border-color: var(--line-strong); font-weight: 700; }
.cal-day.past { color: #B4A493; }
.cal-day.on { background: var(--sage); color: #fff; font-weight: 700; border-color: var(--sage); }
.time-row { display: flex; align-items: center; gap: 6px; font-weight: 700; }
.time-row select {
  min-height: 44px; min-width: 96px; padding: 0 12px; font-size: 16px;
  border: 2px solid var(--line-strong); border-radius: 14px; background: #fff; color: var(--ink);
}
.when-text { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }
.when-text strong { color: var(--ink); }

/* ================= Personas y teléfono ================= */
.avatar {
  display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
  border-radius: 50%; border: 2px solid #6B4A3A; color: #FFFDF7;
  font-family: var(--font-display); font-weight: 600;
}
.sub.who { color: var(--sage-ink); font-weight: 600; }
.optional { font-weight: 600; color: #9C8470; }
.person-card { gap: 10px; }
.person-head { display: flex; gap: 10px; align-items: center; }
.person-bubble { border-radius: 18px 18px 18px 6px; }
.person-in { animation: person-in 0.45s ease-out; }
@keyframes person-in { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: none; } }
.person-in { transform-box: fill-box; }

/* El teléfono sube desde abajo, como si lo sacaras del bolsillo */
.phone-layer { position: fixed; inset: 0; z-index: 25; display: flex; align-items: flex-end; justify-content: center; }
.phone {
  /* Tus manos con el iPhone (img/telefono.webp); la pantalla está en estas posiciones de la imagen */
  position: relative; width: min(450px, 116vw); aspect-ratio: 720 / 1080;
  margin-bottom: calc(-6% + env(safe-area-inset-bottom, 0px));
  animation: phone-up 0.45s cubic-bezier(0.2, 0.9, 0.3, 1.1);
}
@keyframes phone-up { from { transform: translateY(100%); } to { transform: none; } }
.phone-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; pointer-events: none; filter: drop-shadow(0 -6px 24px rgba(74, 52, 40, 0.25)); }
.phone-screen {
  position: absolute; left: 27.4%; top: 12%; width: 45.2%; height: 57%;
  border-radius: 8% / 5%; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 10px 8px 12px; display: flex; flex-direction: column; gap: 6px;
}
.phone-screen h2 { font-size: 16px; text-align: center; line-height: 1.2; }
.phone-sub { margin: -4px 0 4px; text-align: center; font-size: 13px; color: var(--ink-soft); }
.phone-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.phone-contact {
  width: 100%; min-height: 48px; display: flex; align-items: center; gap: 8px;
  border: 2px solid var(--line); border-radius: 14px; background: #fff; padding: 4px 8px; text-align: left;
}
.phone-contact:active { background: var(--sage-soft); }
.pc-name { flex: 1; min-width: 0; font-size: 14px; font-weight: 700; color: var(--ink); }
.pc-count { min-width: 24px; height: 24px; border-radius: 12px; background: #FCEFC7; color: #6E5418; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; padding: 0 6px; }
.phone-empty { text-align: center; color: var(--ink-soft); margin: 18px 0; }
.phone-add { margin-top: 4px; min-height: 44px; border: 2px dashed var(--line-strong); border-radius: 18px; background: none; font-weight: 700; color: var(--brick); }
.phone-close { min-height: 44px; border: none; background: none; color: var(--ink-soft); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; }

/* Contactos */
.contact-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.contact { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--line); }
.contact:first-child { border-top: none; }
.contact-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.contact-rooms { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.chip.mini { min-height: 32px; padding: 2px 10px; font-size: 12px; font-weight: 700; }
.text-input { width: 100%; min-height: 46px; border: 2px solid var(--line-strong); border-radius: 14px; background: #fff; padding: 0 12px; font-size: 16px; }
a.ghost-btn { text-decoration: none; }

.avatar.art { background-color: #F3E6D3; background-size: 240% auto; background-position: 50% 2%; background-repeat: no-repeat; }

/* ================= Diario ================= */
.mood-note { animation: rise 0.3s ease-out; }
.small-primary { flex: 0 1 auto; min-height: 48px; font-size: 16px; }
.diary-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.diary-day { margin-top: 8px; }
.diary-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.diary-entry { background: #FBF6EC; border-radius: 14px; padding: 8px 12px; }
.diary-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 700; color: var(--ink-soft); }
.diary-meta .icon-btn { margin-left: auto; }
.diary-text { margin: 2px 0 4px; font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.mood-tag { background: #EFE7D8; color: var(--ink-soft); }
.mood-energia, .mood-contenta { background: #FCEFC7; color: #6E5418; }
.mood-tranquila, .mood-normal { background: var(--sage-soft); color: var(--sage-ink); }
.mood-cansada { background: #E8EEF3; color: #2F4A5E; }
.mood-triste, .mood-ansiosa, .mood-agobiada { background: #F6DCD5; color: #7A3A30; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.diary-btn {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 10px 16px;
  background: var(--card); border: 2px solid var(--line); border-radius: var(--radius);
  text-decoration: none; color: var(--ink);
}
.diary-btn:active { background: #FBF6EC; }
.diary-btn-icon { width: 44px; height: 44px; border-radius: 14px; background: #E3EDD0; color: #3D5A2F; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.diary-btn-text { flex: 1; display: flex; flex-direction: column; }
.diary-btn-text strong { font-family: var(--font-display); font-size: 18px; font-weight: 600; }
.diary-btn-text span { font-size: 13px; color: var(--ink-soft); }
.diary-btn-arrow { font-size: 28px; color: var(--ink-soft); }

/* ================= Entrar ================= */
body[data-view="login"] .page { min-height: 100vh; justify-content: center; }
.login { display: flex; flex-direction: column; align-items: stretch; gap: 10px; max-width: 360px; width: 100%; margin: 0 auto; padding-block: 24px; }
.login-luna { align-self: center; border-radius: 50%; box-shadow: 0 0 0 3px var(--line); }
.login h1 { text-align: center; font-size: 28px; }
.login-form { display: flex; flex-direction: column; gap: 4px; }
.login-form .primary { margin-top: 14px; flex: none; }
.login .link-btn { align-self: center; }
.login-error { margin: 8px 0 0; color: var(--danger); font-weight: 700; font-size: 14px; }
.login-msg { margin: 8px 0 0; background: var(--sage-soft); color: var(--sage-ink); border-radius: 14px; padding: 10px 12px; font-size: 14px; font-weight: 600; }
.sync-line { display: flex; align-items: center; gap: 8px; }
