/* ============================================================================
   Nuestra Casa — estilos (romántico pastel + modo oscuro)
   ========================================================================== */

/* ---------- Tokens de tema ---------- */
:root {
  --rose: #ef9fbe;
  --rose-deep: #e177a0;
  --lavender: #b78ce6;
  --lavender-deep: #9a6fd6;
  --grad: linear-gradient(135deg, #b78ce6 0%, #ef9fbe 100%);
  --grad-soft: linear-gradient(135deg, #d9c2f3 0%, #fbcfe0 100%);

  --bg: #fbf1f7;
  --bg-2: #f6ecf6;
  --surface: #ffffff;
  --surface-2: #fdf4f9;
  --line: #f0dfe9;
  --ink: #4b3a52;
  --ink-soft: #74627d;
  --ink-faint: #877593;

  --ok: #79c9a8;
  --shadow: 0 10px 30px -12px rgba(154, 111, 214, 0.35);
  --shadow-sm: 0 4px 14px -6px rgba(154, 111, 214, 0.30);
  --shadow-lg: 0 22px 50px -18px rgba(154, 111, 214, 0.45);

  --r-lg: 26px;
  --r-md: 18px;
  --r-sm: 13px;

  --tab-h: 72px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);

  --font: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Fraunces', 'Nunito', Georgia, serif;
}

html[data-theme='dark'] {
  --rose: #f3a9c6;
  --rose-deep: #f08cb1;
  --lavender: #c6a4ef;
  --lavender-deep: #b389e9;
  --grad: linear-gradient(135deg, #b389e9 0%, #ef93b6 100%);
  --grad-soft: linear-gradient(135deg, #3a2c47 0%, #43293c 100%);

  --bg: #181020;
  --bg-2: #1d1426;
  --surface: #251a30;
  --surface-2: #2c2038;
  --line: #38293f;
  --ink: #f3e9f6;
  --ink-soft: #c3b0cd;
  --ink-faint: #8a7894;

  --shadow: 0 14px 34px -14px rgba(0, 0, 0, 0.6);
  --shadow-sm: 0 6px 16px -8px rgba(0, 0, 0, 0.55);
  --shadow-lg: 0 26px 60px -20px rgba(0, 0, 0, 0.7);
}

/* ---------- Base ---------- */
/* El atributo [hidden] SIEMPRE gana, aunque la clase defina display */
[hidden] { display: none !important; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

/* Foco visible para navegación por teclado (accesibilidad) */
:focus-visible { outline: 3px solid var(--lavender-deep); outline-offset: 2px; }
.add-input:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lavender-deep) 55%, transparent);
  border-radius: var(--r-sm);
}
.member-name-input:focus-visible, .pin-input:focus-visible {
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--lavender-deep) 45%, transparent);
}
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100dvh;
  overflow-x: hidden;
  padding-bottom: calc(var(--tab-h) + var(--safe-b) + 14px);
  transition: background 0.4s ease, color 0.4s ease;
  -webkit-font-smoothing: antialiased;
}
button, input { font-family: inherit; }
h1, h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
::selection { background: var(--rose); color: #fff; }

/* Fondo decorativo */
.bg-blobs { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; }
.blob-1 { width: 320px; height: 320px; background: #e9b7d8; top: -90px; right: -70px; }
.blob-2 { width: 280px; height: 280px; background: #c3a7ee; bottom: 12%; left: -90px; opacity: 0.45; }
.blob-3 { width: 240px; height: 240px; background: #f7c9d6; bottom: -80px; right: -40px; opacity: 0.4; }
html[data-theme='dark'] .blob { opacity: 0.22; }

/* ---------- Cabecera ---------- */
.app-header {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  padding: calc(var(--safe-t) + 14px) 18px 12px;
  background: var(--bg); /* respaldo si no hay color-mix */
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: saturate(1.5) blur(14px);
  -webkit-backdrop-filter: saturate(1.5) blur(14px);
}
.brand { display: flex; align-items: center; gap: 11px; min-width: 0; }
.brand-logo { display: grid; place-items: center; filter: drop-shadow(0 6px 10px rgba(154,111,214,.35)); }
.brand-text { min-width: 0; }
.brand-text h1 { margin: 0; font-size: 1.34rem; line-height: 1.05; }
.brand-sub {
  margin: 2px 0 0; font-size: 0.72rem; font-weight: 700; color: var(--ink-soft);
  display: flex; align-items: center; gap: 6px; letter-spacing: 0.01em;
}
.brand-sub .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ink-faint); box-shadow: 0 0 0 0 currentColor; }
.brand-sub.online .dot { background: var(--ok); animation: pulse 2.4s infinite; }
.brand-sub.offline .dot { background: #e8a04f; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(121,201,168,.55);} 70%{ box-shadow:0 0 0 7px rgba(121,201,168,0);} 100%{box-shadow:0 0 0 0 rgba(121,201,168,0);} }

.header-actions { display: flex; gap: 9px; align-items: center; flex-shrink: 0; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--surface); box-shadow: var(--shadow-sm);
  font-size: 1.2rem; display: grid; place-items: center; color: var(--ink);
  transition: transform 0.15s ease, box-shadow 0.2s ease;
}
.icon-btn:active { transform: scale(0.9); }
.who-btn { background: var(--grad); }
.who-avatar {
  width: 100%; height: 100%; border-radius: 50%; display: grid; place-items: center;
  font-size: 1.25rem; background: var(--surface);
  border: 2.5px solid transparent;
}

/* ---------- Main / vistas ---------- */
.app-main { max-width: 640px; margin: 0 auto; padding: 6px 14px 0; }
.view { animation: fade-up 0.4s cubic-bezier(.2,.7,.3,1); }
@keyframes fade-up { from { opacity: 0; transform: translateY(10px);} to { opacity: 1; transform: none; } }

/* ---------- Barra de añadir ---------- */
.add-bar {
  background: var(--surface); border-radius: var(--r-lg);
  box-shadow: var(--shadow); padding: 10px; margin: 10px 0 16px;
}
.add-row { display: flex; gap: 8px; align-items: center; }
.add-input {
  flex: 1; min-width: 0; border: none; outline: none; background: transparent;
  font-size: 1.05rem; font-weight: 600; color: var(--ink); padding: 12px 8px 12px 14px;
}
.add-input::placeholder { color: var(--ink-faint); font-weight: 600; }
.add-btn {
  width: 50px; height: 50px; flex-shrink: 0; border: none; cursor: pointer;
  border-radius: 15px; background: var(--grad); color: #fff;
  font-size: 1.7rem; font-weight: 400; line-height: 1; display: grid; place-items: center;
  box-shadow: var(--shadow-sm); transition: transform 0.15s ease, filter 0.2s ease;
}
.add-btn:active { transform: scale(0.88); }
.add-btn:disabled { filter: grayscale(0.6) opacity(0.6); }

.add-options { display: flex; flex-direction: column; gap: 6px; margin-top: 4px; }

/* ---------- Chips ---------- */
.chip-scroll {
  display: flex; gap: 7px; overflow-x: auto; padding: 6px 4px 4px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.chip-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; border: 1.6px solid var(--line); background: var(--surface-2);
  color: var(--ink-soft); border-radius: 999px; padding: 8px 13px; font-size: 0.82rem;
  font-weight: 700; cursor: pointer; white-space: nowrap; display: inline-flex; gap: 5px;
  align-items: center; transition: all 0.18s ease; user-select: none;
}
.chip:active { transform: scale(0.93); }
.chip.active {
  background: var(--grad); color: #fff; border-color: transparent;
  box-shadow: var(--shadow-sm);
}
.chip .chip-emo { font-size: 0.95rem; }

/* ---------- Tarjeta de progreso ---------- */
.progress-card { background: var(--surface); border-radius: var(--r-md); padding: 13px 16px; margin-bottom: 14px; box-shadow: var(--shadow-sm); }
.progress-text { font-size: 0.82rem; font-weight: 800; color: var(--ink-soft); margin-bottom: 8px; }
.progress-track { height: 9px; border-radius: 999px; background: var(--line); overflow: hidden; }
.progress-fill { height: 100%; width: 0; border-radius: 999px; background: var(--grad); transition: width 0.5s cubic-bezier(.2,.8,.2,1); }

/* ---------- Listas ---------- */
.list { display: flex; flex-direction: column; gap: 9px; }
.group-head {
  display: flex; align-items: center; gap: 8px; margin: 16px 4px 4px;
  font-size: 0.78rem; font-weight: 800; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--ink-soft);
}
.group-head .g-emo { font-size: 1rem; }
.group-head .g-count { margin-left: auto; color: var(--ink-faint); font-weight: 800; }

.item {
  display: flex; align-items: center; gap: 12px; background: var(--surface);
  border-radius: var(--r-md); padding: 13px 14px; box-shadow: var(--shadow-sm);
  position: relative; overflow: hidden; cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.2s ease, opacity 0.3s ease;
  animation: item-in 0.32s cubic-bezier(.2,.8,.3,1) both;
}
@keyframes item-in { from { opacity: 0; transform: translateY(8px) scale(.98);} to { opacity: 1; transform: none; } }
.item:active { transform: scale(0.985); }
.item.is-done { opacity: 0.62; }
.item.leaving { animation: item-out 0.28s ease forwards; }
@keyframes item-out { to { opacity: 0; transform: translateX(40px) scale(.95); height: 0; padding-top: 0; padding-bottom: 0; margin: 0; } }
.item.pop { animation: item-pop 0.4s cubic-bezier(.2,1.3,.4,1) both; }
@keyframes item-pop { 0% { transform: scale(.7); opacity: 0; } 60% { transform: scale(1.04); } 100% { transform: none; opacity: 1; } }
.item.partner-touch { animation: partner-glow 1.2s ease; }
@keyframes partner-glow { 0%,100% { box-shadow: var(--shadow-sm);} 30% { box-shadow: 0 0 0 2.5px var(--rose), var(--shadow);} }

/* Checkbox redondo */
.check {
  width: 27px; height: 27px; flex-shrink: 0; border-radius: 50%;
  border: 2.4px solid var(--ink-faint); display: grid; place-items: center;
  transition: all 0.22s cubic-bezier(.2,.9,.3,1.2); position: relative;
}
.item.is-done .check { background: var(--grad); border-color: transparent; }
.check svg { width: 15px; height: 15px; stroke: #fff; stroke-width: 3.4; fill: none;
  stroke-dasharray: 22; stroke-dashoffset: 22; transition: stroke-dashoffset 0.3s ease 0.05s; stroke-linecap: round; stroke-linejoin: round; }
.item.is-done .check svg { stroke-dashoffset: 0; }

.item-body { flex: 1; min-width: 0; }
.item-text {
  font-size: 1.02rem; font-weight: 700; color: var(--ink); line-height: 1.25;
  word-break: break-word; transition: color 0.25s ease;
}
.item.is-done .item-text { text-decoration: line-through; text-decoration-color: var(--ink-faint); color: var(--ink-soft); }
.item-qty { font-weight: 800; color: var(--lavender-deep); }
html[data-theme='dark'] .item-qty { color: var(--rose); }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 5px; align-items: center; }

.tag {
  display: inline-flex; align-items: center; gap: 4px; font-size: 0.68rem; font-weight: 800;
  padding: 3px 8px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft);
  border: 1px solid var(--line);
}
.tag.due { color: var(--ink-soft); }
.tag.overdue { background: color-mix(in srgb, var(--rose) 22%, var(--surface)); color: var(--rose-deep); border-color: transparent; }
html[data-theme='dark'] .tag.overdue { color: #ffc0d8; }

.avatar-mini {
  width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  font-size: 0.8rem; flex-shrink: 0; box-shadow: 0 2px 6px rgba(0,0,0,.12);
}

.item-del {
  border: none; background: transparent; color: var(--ink-faint); cursor: pointer;
  font-size: 1.15rem; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; transition: all 0.16s ease; opacity: 0.55;
}
.item-del:active { transform: scale(0.85); background: color-mix(in srgb, var(--rose) 18%, transparent); color: var(--rose-deep); opacity: 1; }
.item-edit {
  border: none; background: transparent; cursor: pointer;
  font-size: 0.98rem; width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
  display: grid; place-items: center; transition: all 0.16s ease; opacity: 0.62;
}
.item-edit:active { transform: scale(0.85); background: color-mix(in srgb, var(--lavender) 20%, transparent); opacity: 1; }

/* ---------- Filtros limpieza ---------- */
.filter-bar { display: flex; gap: 7px; overflow-x: auto; padding: 0 2px 12px; scrollbar-width: none; }
.filter-bar::-webkit-scrollbar { display: none; }

/* ---------- Pie de lista ---------- */
.list-footer { display: flex; justify-content: center; margin: 18px 0 6px; }
.ghost-btn {
  border: 1.6px dashed var(--line); background: transparent; color: var(--ink-soft);
  border-radius: 999px; padding: 10px 18px; font-size: 0.85rem; font-weight: 800; cursor: pointer;
  transition: all 0.18s ease;
}
.ghost-btn:active { transform: scale(0.95); background: var(--surface); }

/* ---------- Estado vacío ---------- */
.empty {
  text-align: center; padding: 40px 20px; color: var(--ink-soft);
  animation: fade-up 0.5s ease;
}
.empty-emoji { font-size: 3.4rem; display: block; margin-bottom: 10px; filter: drop-shadow(0 8px 14px rgba(154,111,214,.25)); }
.empty h3 { font-family: var(--font-display); margin: 0 0 4px; color: var(--ink); font-size: 1.2rem; }
.empty p { margin: 0; font-size: 0.92rem; font-weight: 600; }

/* ---------- Ajustes / Nosotros ---------- */
.settings { padding: 6px 2px 20px; }
.settings-title { font-size: 1.05rem; margin: 22px 0 10px; }
.settings-title:first-child { margin-top: 8px; }
.settings-help { font-size: 0.86rem; color: var(--ink-soft); font-weight: 600; margin: -4px 0 12px; }
.members-edit { display: flex; flex-direction: column; gap: 12px; }
.member-card {
  display: flex; align-items: center; gap: 13px; background: var(--surface);
  border-radius: var(--r-md); padding: 13px; box-shadow: var(--shadow-sm);
}
.member-ava-btn {
  width: 52px; height: 52px; border-radius: 50%; border: none; cursor: pointer; flex-shrink: 0;
  font-size: 1.5rem; display: grid; place-items: center; color: #fff; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.member-ava-btn:active { transform: scale(0.9); }
.member-fields { flex: 1; min-width: 0; }
.member-name-input {
  width: 100%; border: none; background: var(--surface-2); border-radius: 12px;
  padding: 11px 13px; font-size: 1rem; font-weight: 700; color: var(--ink); outline: none;
  border: 1.6px solid transparent; transition: border-color 0.2s ease;
}
.member-name-input:focus { border-color: var(--lavender); }
.member-swatches { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.swatch { width: 26px; height: 26px; border-radius: 50%; cursor: pointer; border: 2.5px solid transparent; transition: transform 0.15s ease; }
.swatch:active { transform: scale(0.85); }
.swatch.sel { border-color: var(--ink); transform: scale(1.08); }
.emoji-grid { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin: 8px 0 4px; }
.emoji-pick { font-size: 1.5rem; width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--line); background: var(--surface-2); cursor: pointer; }
.emoji-pick.sel { border-color: var(--lavender); background: var(--grad-soft); }

.setting-row {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  background: var(--surface); border-radius: var(--r-md); padding: 14px 16px;
  box-shadow: var(--shadow-sm); margin-bottom: 10px;
}
.setting-name { font-weight: 800; font-size: 0.98rem; }
.setting-desc { font-size: 0.8rem; color: var(--ink-soft); font-weight: 600; margin-top: 2px; }
.info-card { background: var(--grad-soft); border-radius: var(--r-md); padding: 14px 16px; margin-bottom: 10px; }
.info-card strong { font-family: var(--font-display); font-size: 1rem; }
.info-card p { margin: 6px 0 0; font-size: 0.86rem; font-weight: 600; }
.conn-pill { font-size: 0.78rem; font-weight: 800; padding: 6px 12px; border-radius: 999px; background: var(--surface-2); color: var(--ink-soft); }
.conn-pill.ok { background: color-mix(in srgb, var(--ok) 25%, var(--surface)); color: #2f7d5e; }
.conn-pill.bad { background: color-mix(in srgb, #e8a04f 30%, var(--surface)); color: #a5641f; }
html[data-theme='dark'] .conn-pill.ok { color: #8fe0bd; }
html[data-theme='dark'] .conn-pill.bad { color: #f2b87a; }
.credits { text-align: center; color: var(--ink-faint); font-size: 0.82rem; font-weight: 700; margin-top: 26px; }

.pill-btn {
  border: none; background: var(--grad); color: #fff; border-radius: 999px;
  padding: 10px 18px; font-weight: 800; font-size: 0.88rem; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease;
}
.pill-btn:active { transform: scale(0.92); }

/* Interruptor */
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { display: none; }
.slider { position: absolute; inset: 0; background: var(--line); border-radius: 999px; cursor: pointer; transition: background 0.25s ease; }
.slider::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform 0.25s cubic-bezier(.2,1.3,.4,1); box-shadow: 0 2px 6px rgba(0,0,0,.2); }
.switch input:checked + .slider { background: var(--grad); }
.switch input:checked + .slider::before { transform: translateX(22px); }

/* ---------- Barra de pestañas ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(var(--tab-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  background: var(--surface); /* respaldo si no hay color-mix */
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  backdrop-filter: saturate(1.6) blur(18px); -webkit-backdrop-filter: saturate(1.6) blur(18px);
  border-top: 1px solid var(--line);
}
.tab {
  flex: 1; border: none; background: transparent; cursor: pointer; position: relative;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--ink-soft); font-weight: 800; font-size: 0.7rem; transition: color 0.2s ease;
  padding-top: 6px;
}
.tab-ico { font-size: 1.4rem; transition: transform 0.25s cubic-bezier(.2,1.4,.4,1); filter: grayscale(0.5) opacity(0.7); }
.tab.active { color: var(--lavender-deep); }
html[data-theme='dark'] .tab.active { color: var(--rose); }
.tab.active .tab-ico { transform: translateY(-3px) scale(1.18); filter: none; }
.tab.active::before { content: ''; position: absolute; top: 0; width: 34px; height: 4px; border-radius: 999px; background: var(--grad); }
.tab-badge {
  position: absolute; top: 6px; right: 50%; margin-right: -26px;
  min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: var(--rose-deep);
  color: #fff; font-size: 0.66rem; font-weight: 800; display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(225,119,160,.5);
}

/* ---------- Toasts ---------- */
.toast-host {
  position: fixed; left: 0; right: 0; bottom: calc(var(--tab-h) + var(--safe-b) + 14px); z-index: 60;
  display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; padding: 0 16px;
}
.toast {
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 0.88rem; font-weight: 700; box-shadow: var(--shadow-lg); max-width: 90%;
  animation: toast-in 0.3s cubic-bezier(.2,1.2,.3,1) both; display: flex; gap: 8px; align-items: center;
}
html[data-theme='dark'] .toast { background: var(--surface); border: 1px solid var(--line); }
.toast.out { animation: toast-out 0.3s ease forwards; }
@keyframes toast-in { from { opacity: 0; transform: translateY(16px) scale(.95);} to { opacity: 1; transform: none; } }
@keyframes toast-out { to { opacity: 0; transform: translateY(16px) scale(.95);} }

/* ---------- Corazones voladores ---------- */
.heart-host { position: fixed; inset: 0; z-index: 55; pointer-events: none; overflow: hidden; }
.fly-heart { position: absolute; font-size: 1.2rem; will-change: transform, opacity; animation: fly 1.1s ease-out forwards; }
@keyframes fly {
  0% { opacity: 0; transform: translate(0,0) scale(.4) rotate(0); }
  20% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.1) rotate(var(--rot)); }
}

/* ---------- Overlays (onboarding / pin) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 22px;
  background: color-mix(in srgb, var(--bg) 70%, rgba(40,20,55,.5));
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  animation: fade-up 0.35s ease;
}
.onboard-card {
  width: 100%; max-width: 420px; background: var(--surface); border-radius: 28px;
  padding: 30px 24px; box-shadow: var(--shadow-lg); text-align: center;
  animation: card-in 0.45s cubic-bezier(.2,1.1,.3,1) both;
}
@keyframes card-in { from { opacity: 0; transform: translateY(20px) scale(.96);} to { opacity: 1; transform: none; } }
.onboard-emoji { font-size: 3rem; margin-bottom: 6px; }
.onboard-card h2 { margin: 6px 0 8px; font-size: 1.5rem; }
.onboard-card p { margin: 0 0 18px; color: var(--ink-soft); font-weight: 600; font-size: 0.94rem; line-height: 1.45; }
.onboard-members { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }
.onboard-member { display: flex; align-items: center; gap: 12px; }
.onboard-member .member-ava-btn { width: 48px; height: 48px; font-size: 1.4rem; }
.primary-btn {
  width: 100%; border: none; background: var(--grad); color: #fff; border-radius: 16px;
  padding: 15px; font-size: 1.05rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
  transition: transform 0.15s ease;
}
.primary-btn:active { transform: scale(0.96); }
.who-picker { display: flex; gap: 14px; justify-content: center; }
.who-card {
  flex: 1; max-width: 150px; background: var(--surface-2); border: 2.5px solid var(--line);
  border-radius: 20px; padding: 20px 12px; cursor: pointer; transition: all 0.2s ease;
}
.who-card:active { transform: scale(0.95); }
.who-card .wc-ava { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 2rem; margin: 0 auto 10px; color: #fff; box-shadow: var(--shadow-sm); }
.who-card .wc-name { font-weight: 800; font-size: 1.05rem; }

.pin-input {
  width: 100%; text-align: center; font-size: 1.8rem; letter-spacing: 0.5em; font-weight: 800;
  border: 2px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 16px;
  background: var(--surface-2); color: var(--ink); outline: none;
}
.pin-input:focus { border-color: var(--lavender); }
.pin-error { color: var(--rose-deep); font-weight: 700; font-size: 0.85rem; margin-top: 12px; }

/* Hoja inferior para elegir emoji */
.sheet { position: fixed; inset: 0; z-index: 85; display: flex; align-items: flex-end; justify-content: center; }
.sheet-back { position: absolute; inset: 0; background: rgba(30,15,40,.4); backdrop-filter: blur(3px); animation: fade-up 0.25s ease; }
.sheet-card { position: relative; width: 100%; max-width: 460px; background: var(--surface); border-radius: 26px 26px 0 0; padding: 22px 20px calc(22px + var(--safe-b)); box-shadow: var(--shadow-lg); animation: sheet-up 0.32s cubic-bezier(.2,1,.3,1) both; }
@keyframes sheet-up { from { transform: translateY(100%);} to { transform: none; } }
.sheet-card h3 { font-family: var(--font-display); margin: 0 0 14px; text-align: center; }

@media (min-width: 560px) {
  .app-main { padding-top: 10px; }
}

/* ---------- Gastos (resumen mensual) ---------- */
.exp-summary {
  background: var(--grad-soft); border-radius: var(--r-lg); padding: 16px 18px;
  margin: 10px 0 16px; box-shadow: var(--shadow);
}
.month-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.month-btn {
  width: 40px; height: 40px; border: none; border-radius: 50%; background: var(--surface);
  box-shadow: var(--shadow-sm); font-size: 1.25rem; color: var(--ink); cursor: pointer;
  transition: transform 0.15s ease;
}
.month-btn:active { transform: scale(0.88); }
.month-label { font-family: var(--font-display); font-size: 1.08rem; font-weight: 600; text-transform: capitalize; display: flex; align-items: center; gap: 8px; }
.month-today { border: none; background: var(--surface); border-radius: 999px; padding: 5px 11px; font-size: 0.7rem; font-weight: 800; color: var(--ink-soft); cursor: pointer; box-shadow: var(--shadow-sm); }
.sum-total { font-family: var(--font-display); font-size: 2.1rem; text-align: center; margin-top: 10px; color: var(--ink); }
.sum-sub { text-align: center; font-size: 0.8rem; font-weight: 700; color: var(--ink-soft); margin-bottom: 12px; }
.cat-row { display: grid; grid-template-columns: 1fr auto; gap: 3px 10px; margin-top: 10px; font-size: 0.86rem; font-weight: 700; }
.cat-name { color: var(--ink); }
.cat-amt { color: var(--ink-soft); font-weight: 800; }
.cat-track { grid-column: 1 / -1; height: 7px; border-radius: 999px; background: color-mix(in srgb, var(--surface) 60%, transparent); overflow: hidden; }
.cat-fill { height: 100%; border-radius: 999px; background: var(--grad); transition: width 0.5s cubic-bezier(.2,.8,.2,1); }
.sum-payers { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.bal-row { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.86rem; background: var(--surface); padding: 7px 12px; border-radius: 999px; box-shadow: var(--shadow-sm); }
.bal-paid { color: var(--ink-soft); font-weight: 800; }
.exp-amount-row { gap: 8px; }
.amount-input { flex: 1; min-width: 0; }
.add-hint { font-size: 0.78rem; font-weight: 800; color: var(--ink-soft); padding: 2px 4px; }
.exp-item .exp-amount-badge {
  flex-shrink: 0; min-width: 64px; padding: 8px 10px; border-radius: 13px; color: #fff;
  font-weight: 800; font-size: 0.92rem; text-align: center; box-shadow: var(--shadow-sm);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45); /* legible sobre cualquier color pastel */
}

/* ---------- Segmentos (ocio) ---------- */
.segmented { display: flex; gap: 6px; background: var(--surface); padding: 5px; border-radius: 999px; box-shadow: var(--shadow-sm); margin: 12px 0 14px; }
.seg { flex: 1; border: none; background: transparent; border-radius: 999px; padding: 11px; font-weight: 800; font-size: 0.92rem; color: var(--ink-soft); cursor: pointer; transition: all 0.2s ease; }
.seg.active { background: var(--grad); color: #fff; box-shadow: var(--shadow-sm); }
.seg:active { transform: scale(0.97); }

/* ---------- Estrellas ---------- */
.stars { display: inline-flex; gap: 3px; margin: -8px 0; } /* margen negativo: no engorda la fila */
.star {
  border: none; background: transparent; cursor: pointer; font-size: 1.1rem; line-height: 1;
  color: var(--ink-faint); transition: transform 0.12s ease; -webkit-tap-highlight-color: transparent;
  min-width: 40px; min-height: 40px; display: inline-flex; align-items: center; justify-content: center; padding: 8px 4px;
}
.star.on { color: #f3b73b; }
.star:active { transform: scale(1.3); }

/* ---------- Menú "Más" ---------- */
.mas-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.mas-item {
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 22px 12px;
  border: none; border-radius: var(--r-md); background: var(--surface-2); cursor: pointer;
  font-weight: 800; font-size: 0.95rem; color: var(--ink); box-shadow: var(--shadow-sm); transition: transform 0.15s ease;
}
.mas-item:active { transform: scale(0.95); }
.mas-emo { font-size: 2rem; }

/* ---------- Bóveda de contraseñas ---------- */
.vault-pad { text-align: center; padding: 30px 18px; max-width: 420px; margin: 0 auto; }
.vault-emoji { font-size: 3rem; margin-bottom: 8px; }
.vault-pad h2 { font-size: 1.4rem; margin: 4px 0 8px; }
.vault-sub { color: var(--ink-soft); font-weight: 600; font-size: 0.92rem; line-height: 1.45; margin: 0 0 18px; }
.vault-bar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 10px 0 14px; }
.vault-bar-actions { display: flex; align-items: center; gap: 8px; }
.vault-locktag { font-size: 0.8rem; font-weight: 800; color: var(--ok); }
.vault-lockbtn { width: 40px; height: 40px; font-size: 1.05rem; }
.vault-list { display: flex; flex-direction: column; gap: 11px; }
.vault-card { background: var(--surface); border-radius: var(--r-md); padding: 14px; box-shadow: var(--shadow-sm); animation: item-in 0.3s ease both; }
.vault-card.leaving { animation: item-out 0.28s ease forwards; }
.vault-card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.vault-title { font-family: var(--font-display); font-weight: 600; font-size: 1.12rem; color: var(--ink); }
.vault-field { display: flex; align-items: center; gap: 10px; margin-top: 10px; background: var(--surface-2); border-radius: 12px; padding: 8px 10px; }
.vf-label { font-size: 0.68rem; font-weight: 800; color: var(--ink-soft); text-transform: uppercase; letter-spacing: 0.03em; flex-shrink: 0; width: 74px; }
.vf-val { flex: 1; min-width: 0; font-weight: 700; color: var(--ink); word-break: break-all; }
.vf-secret { font-family: 'Courier New', monospace; letter-spacing: 0.04em; }
.vf-btn { border: none; background: transparent; cursor: pointer; font-size: 1.05rem; width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0; display: grid; place-items: center; transition: transform 0.14s ease, background 0.2s ease; }
.vf-btn:active { transform: scale(0.85); background: color-mix(in srgb, var(--lavender) 18%, transparent); }
.vault-notes { margin-top: 10px; font-size: 0.85rem; color: var(--ink-soft); font-weight: 600; line-height: 1.4; }
.vault-edit { margin-top: 12px; border: 1.6px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 999px; padding: 8px 16px; font-weight: 800; font-size: 0.82rem; cursor: pointer; }
.vault-edit:active { transform: scale(0.96); }
.v-secret-row { display: flex; gap: 8px; align-items: center; }
.v-secret-row .member-name-input { flex: 1; }
.v-notes { resize: none; min-height: 56px; font-family: inherit; line-height: 1.4; }

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