:root {
  --bg: #fdf2f8; --card: #fff; --text: #1f2937; --muted: #6b7280; --border: #f1e4ec;
  --pink: #ec4899; --pink-d: #db2777; --violet: #8b5cf6; --blue: #3b82f6;
  --green: #10b981; --amber: #f59e0b; --red: #ef4444;
  --radius: 18px; --shadow: 0 6px 20px -8px rgba(236,72,153,.25);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: linear-gradient(180deg, #fdf2f8 0%, #f5f3ff 100%) fixed; color: var(--text); line-height: 1.45; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; }
h2 { font-size: 1.1rem; margin-bottom: 12px; display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
h2 small { font-weight: 500; color: var(--muted); font-size: .78rem; }
button { font: inherit; cursor: pointer; }

/* ---------- Gate ---------- */
.gate { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 24px; text-align: center; }
.gate-title { font-size: 2.4rem; }
.gate-sub { font-size: 1.2rem; color: var(--muted); margin: 8px 0 28px; }
.gate-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; width: 100%; max-width: 440px; }
.persona-card { border: 0; border-radius: 24px; padding: 32px 12px; color: #fff; display: flex; flex-direction: column; align-items: center; gap: 10px; box-shadow: var(--shadow); transition: transform .15s; }
.persona-card:active { transform: scale(.96); }
.persona-card .avatar { font-size: 3.4rem; }
.persona-card .nombre { font-size: 1.3rem; font-weight: 700; }
.persona-card.yessica { background: linear-gradient(135deg, #f472b6, #ec4899); }
.persona-card.stefano { background: linear-gradient(135deg, #60a5fa, #6366f1); }

/* ---------- Layout ---------- */
.app { max-width: 560px; margin: 0 auto; padding: 16px 16px calc(32px + env(safe-area-inset-bottom)); }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-bottom: 16px; }
.topbar h1 { font-size: 1.05rem; min-width: 0; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 999px; padding: 8px 14px; font-size: .85rem; min-height: 40px; white-space: nowrap; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; margin-bottom: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }

/* ---------- Meta ---------- */
.meta-head { display: flex; justify-content: space-between; font-weight: 700; margin-bottom: 10px; }
.bar { background: #f3e8ff; border-radius: 999px; height: 14px; overflow: hidden; }
.bar-fill { height: 100%; width: 0; background: linear-gradient(90deg, #f472b6, #8b5cf6); transition: width .6s ease; }
.meta-msg { margin-top: 10px; text-align: center; font-weight: 600; color: var(--muted); font-size: .9rem; }
.meta-msg.done { color: #b45309; background: #fef3c7; padding: 8px; border-radius: 10px; }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 16px; }
.stat { color: #fff; font-weight: 700; text-align: center; border-radius: 14px; padding: 12px; font-size: .92rem; }
.stat.green { background: var(--green); } .stat.amber { background: var(--amber); }

/* ---------- Form ---------- */
label { display: block; font-weight: 600; font-size: .85rem; color: var(--muted); margin: 14px 0 6px; }
input, select, textarea { width: 100%; font: inherit; font-size: 16px; /* evita zoom iOS */ padding: 12px 14px; border: 1.5px solid var(--border); border-radius: 12px; background: #fff; color: var(--text); min-height: 48px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--pink); box-shadow: 0 0 0 3px rgba(236,72,153,.15); }
textarea { resize: vertical; }
.btn { border: 0; border-radius: 14px; padding: 14px 18px; font-weight: 700; min-height: 48px; width: 100%; transition: transform .1s, background .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--pink); color: #fff; margin-top: 18px; }
.btn-primary:hover { background: var(--pink-d); }
.btn-soft { background: #ede9fe; color: #5b21b6; }
.btn-ghost { background: #f3f4f6; color: var(--text); }
.btn-icon { width: 52px; margin: 0; padding: 0; flex: none; }
.pills { display: flex; flex-wrap: wrap; gap: 8px; }
.pill { border: 1.5px solid var(--border); background: #fff; border-radius: 999px; padding: 9px 14px; min-height: 44px; font-size: .9rem; }
.pill.on { background: #fce7f3; border-color: var(--pink); color: var(--pink-d); font-weight: 700; }
.quick-dates { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.quick-dates .pill { padding: 7px 12px; min-height: 38px; font-size: .82rem; }

/* ---------- Ideas ---------- */
.idea-add { display: grid; grid-template-columns: 1fr 52px; gap: 8px; }
.idea-add input { grid-column: 1 / -1; }
.idea-add select { min-width: 0; }
.ideas { margin-top: 12px; max-height: 300px; overflow-y: auto; }
.idea { display: flex; gap: 8px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.idea:last-child { border-bottom: 0; }
.idea-use { flex: 1; text-align: left; background: none; border: 0; padding: 4px; border-radius: 10px; color: var(--text); }
.idea-use:hover { background: #fdf2f8; }
.tag { display: inline-block; font-size: .72rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; background: #f3f4f6; color: var(--muted); margin: 0 4px 4px 0; }
.tag.idea-tag { background: #ede9fe; color: #6d28d9; }
.icon-btn { width: 40px; height: 40px; border: 0; border-radius: 10px; background: #f9fafb; flex: none; font-size: 1rem; }
.icon-btn:hover { background: #f3f4f6; }
.empty { text-align: center; color: var(--muted); padding: 18px; font-size: .9rem; }

/* ---------- Historial ---------- */
.hist-head { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.hist-head h2 { margin: 0; }
.tabs { display: flex; gap: 4px; background: #fff; border-radius: 999px; padding: 4px; border: 1px solid var(--border); }
.tabs button { border: 0; background: none; border-radius: 999px; padding: 6px 10px; font-size: .78rem; min-height: 34px; }
.tabs button.on { background: var(--pink); color: #fff; font-weight: 700; }
.cita { position: relative; background: #fff; border-radius: var(--radius); padding: 16px; margin-top: 14px; box-shadow: var(--shadow); border-left: 6px solid #e5e7eb; }
.cita.ok { border-left-color: var(--green); }
.cita.no { border-left-color: var(--red); opacity: .85; }
.cita.pospuesta { border-left-color: var(--amber); background: #fffbeb; }
.cita.hecha { border-left-color: var(--violet); }
.cita-fecha { font-weight: 700; padding-right: 96px; }
.cita-desc { margin: 8px 0; word-wrap: break-word; }
.cita-actions { position: absolute; top: 12px; right: 12px; display: flex; gap: 6px; }
.votos { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.voto { background: #f9fafb; border-radius: 12px; padding: 10px; font-size: .85rem; }
.voto .who { font-weight: 600; display: block; margin-bottom: 6px; }
.voto-btns { display: flex; gap: 6px; }
.voto-btns button { flex: 1; min-height: 40px; border-radius: 10px; border: 1.5px solid var(--border); background: #fff; font-weight: 600; }
.voto-btns button.on.si { background: #d1fae5; border-color: var(--green); color: #047857; }
.voto-btns button.on.no { background: #fee2e2; border-color: var(--red); color: #b91c1c; }
.estado-voto { font-weight: 700; }
.estado-voto.si { color: #047857; } .estado-voto.no { color: #b91c1c; } .estado-voto.pendiente { color: var(--muted); }
.cita-msg { text-align: center; font-weight: 600; font-size: .88rem; margin-top: 10px; }

/* ---------- Toasts & dialog ---------- */
.toasts { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 50; width: min(92vw, 420px); pointer-events: none; }
.toast { background: #111827; color: #fff; padding: 12px 16px; border-radius: 14px; font-weight: 600; font-size: .9rem; box-shadow: 0 10px 25px rgba(0,0,0,.2); animation: tin .25s ease; text-align: center; }
.toast.err { background: #b91c1c; }
@keyframes tin { from { opacity: 0; transform: translateY(10px); } }
dialog { border: 0; border-radius: 20px; padding: 0; width: min(92vw, 440px); box-shadow: 0 20px 50px rgba(0,0,0,.25); }
dialog::backdrop { background: rgba(17,24,39,.45); }
.dlg-body { padding: 20px; }
.dlg-body h3 { margin-bottom: 8px; }
.dlg-actions { display: flex; gap: 10px; margin-top: 16px; }
.dlg-actions .btn { margin-top: 0; }

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