/* ---------- Themes ---------- */
:root {
  --radius: 18px;
  --radius-sm: 12px;
  --gap: 14px;
  --maxw: 560px;
  --shadow: 0 6px 20px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 34px rgba(0,0,0,.14);
  font-family: system-ui, -apple-system, "Segoe UI", Rubik, Arial, sans-serif;
}

/* Pink / sky — sweet */
[data-theme="pink"] {
  --bg: #fff5f8;
  --bg2: #eaf6fb;
  --card: #ffffff;
  --ink: #3b2b33;
  --muted: #8a7a82;
  --primary: #f4679b;
  --primary-ink: #fff;
  --accent: #4fc3e8;
  --soft: #ffe3ee;
  --soft2: #d9f1fa;
  --line: #f3dbe5;
  --danger: #e24a6a;
  --ok: #38b48b;
}
/* Neutral / slate — discreet */
[data-theme="neutral"] {
  --bg: #f4f5f7;
  --bg2: #eceef1;
  --card: #ffffff;
  --ink: #23272e;
  --muted: #767c86;
  --primary: #3f5366;
  --primary-ink: #fff;
  --accent: #6b7a89;
  --soft: #e6e9ed;
  --soft2: #e0e4e9;
  --line: #e2e5ea;
  --danger: #b4495b;
  --ok: #3f8a6e;
}
/* Mint */
[data-theme="mint"] {
  --bg: #f0faf6;
  --bg2: #e7f6f1;
  --card: #ffffff;
  --ink: #233a33;
  --muted: #6f8a80;
  --primary: #2fae84;
  --primary-ink: #fff;
  --accent: #5bb6a9;
  --soft: #d8f3e8;
  --soft2: #d2efe9;
  --line: #d6ece2;
  --danger: #d9725f;
  --ok: #2fae84;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: linear-gradient(170deg, var(--bg), var(--bg2));
  color: var(--ink);
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

/* ---------- Login ---------- */
.login-body { display: grid; place-items: center; padding: 24px; min-height: 100dvh; }
.login-card {
  background: var(--card); border-radius: 24px; box-shadow: var(--shadow-lg);
  padding: 34px 26px; width: 100%; max-width: 380px; text-align: center;
}
.login-card .logo { font-size: 54px; }
.login-card h1 { margin: 6px 0 2px; letter-spacing: 2px; font-size: 30px; }
.tagline { color: var(--muted); margin: 0 0 22px; line-height: 1.5; }
.join-note, .error-note {
  border-radius: var(--radius-sm); padding: 10px 12px; margin-bottom: 16px; font-size: 14px;
}
.join-note { background: var(--soft2); }
.error-note { background: #ffe0e0; color: #a33; }
.dev-login { margin-top: 16px; text-align: right; display: grid; gap: 8px; }
.dev-login label { font-size: 13px; color: var(--muted); }
.dev-login input {
  width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 16px; background: var(--bg);
}
.hint { font-size: 12px; color: var(--muted); margin-top: 14px; }
.login-foot { position: fixed; bottom: 14px; color: var(--muted); font-size: 12px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; padding: 14px 16px; border: none; border-radius: var(--radius-sm);
  font-size: 16px; font-weight: 600; cursor: pointer; text-decoration: none;
  margin-top: 10px; transition: transform .05s, filter .15s;
}
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--primary); color: var(--primary-ink); }
.btn-google { background: #fff; color: #333; border: 1px solid var(--line); box-shadow: var(--shadow); }
.btn-google .g {
  display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%;
  background: #4285f4; color: #fff; font-weight: 800; font-family: Arial;
}
.btn-ghost { background: var(--soft); color: var(--ink); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { width: auto; padding: 8px 14px; font-size: 14px; margin: 0; }

/* ---------- Layout ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
  background: color-mix(in srgb, var(--card) 86%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.family-btn {
  background: none; border: none; font-size: 19px; font-weight: 700; color: var(--ink);
  display: flex; align-items: center; gap: 6px; cursor: pointer;
}
.family-btn .chev { color: var(--muted); font-size: 14px; }
.top-actions { display: flex; gap: 6px; }
.icon-btn {
  background: var(--soft); border: none; width: 40px; height: 40px; border-radius: 50%;
  font-size: 18px; cursor: pointer; display: grid; place-items: center;
}
.view {
  max-width: var(--maxw); margin: 0 auto; padding: 16px 16px 110px;
}
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4,1fr);
  background: color-mix(in srgb, var(--card) 92%, transparent);
  backdrop-filter: blur(10px); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tab {
  background: none; border: none; padding: 9px 0 10px; cursor: pointer;
  display: grid; justify-items: center; gap: 2px; font-size: 12px; color: var(--muted);
}
.tab span { font-size: 21px; filter: grayscale(.3); }
.tab.is-active { color: var(--primary); font-weight: 700; }
.tab.is-active span { filter: none; }

/* ---------- Cards / bits ---------- */
.card {
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 16px; margin-bottom: var(--gap);
}
.card h2 { margin: 0 0 10px; font-size: 17px; }
.section-title { margin: 22px 4px 10px; font-size: 15px; color: var(--muted); font-weight: 700; }
.row { display: flex; align-items: center; gap: 10px; }
.spread { justify-content: space-between; }
.muted { color: var(--muted); }
.pill {
  display: inline-flex; align-items: center; gap: 5px; font-size: 12px; font-weight: 600;
  padding: 4px 10px; border-radius: 999px; background: var(--soft);
}
.pill.mother { background: var(--soft); color: var(--primary); }
.pill.baby   { background: var(--soft2); color: var(--accent); }
.avatar {
  width: 34px; height: 34px; border-radius: 50%; object-fit: cover;
  background: var(--soft); display: grid; place-items: center; font-weight: 700; color: var(--primary);
}
.empty { text-align: center; color: var(--muted); padding: 26px 10px; }

/* Help button (home) */
.help-wrap { text-align: center; padding: 10px 0 4px; }
.help-btn {
  width: 190px; height: 190px; border-radius: 50%; border: none; cursor: pointer;
  background: radial-gradient(circle at 35% 30%, color-mix(in srgb,var(--primary) 80%,#fff), var(--primary));
  color: #fff; font-size: 23px; font-weight: 800; box-shadow: var(--shadow-lg);
  display: grid; place-items: center; margin: 6px auto 4px; line-height: 1.3;
  animation: breathe 3.2s ease-in-out infinite;
}
.help-btn:active { transform: scale(.96); }
@keyframes breathe { 50% { box-shadow: 0 0 0 16px color-mix(in srgb, var(--primary) 16%, transparent); } }
.help-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 8px; }
.help-type {
  padding: 16px 10px; border-radius: var(--radius); border: 1px solid var(--line);
  background: var(--card); font-size: 16px; font-weight: 600; cursor: pointer;
  display: grid; gap: 4px; justify-items: center;
}
.help-type span { font-size: 26px; }
.help-type:active { transform: scale(.97); }

/* lists */
.list-item {
  display: flex; align-items: center; gap: 12px; padding: 12px 4px;
  border-bottom: 1px solid var(--line);
}
.list-item:last-child { border-bottom: none; }
.li-main { flex: 1; min-width: 0; }
.li-title { font-weight: 600; }
.li-sub { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* forms / modal */
.modal-bg {
  position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 40;
  display: grid; place-items: end center;
}
.modal {
  background: var(--card); width: 100%; max-width: var(--maxw);
  border-radius: 22px 22px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom));
  box-shadow: var(--shadow-lg); animation: up .2s ease;
}
@keyframes up { from { transform: translateY(40px); opacity: .4; } }
.modal h3 { margin: 0 0 14px; }
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; color: var(--muted); }
.field input, .field select, .field textarea {
  padding: 12px; border: 1px solid var(--line); border-radius: var(--radius-sm);
  font-size: 16px; background: var(--bg); font-family: inherit; width: 100%;
}
.seg { display: flex; gap: 8px; }
.seg button {
  flex: 1; padding: 11px; border: 1px solid var(--line); background: var(--bg);
  border-radius: var(--radius-sm); font-size: 15px; font-weight: 600; cursor: pointer; color: var(--ink);
}
.seg button.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.modal-actions { display: flex; gap: 10px; margin-top: 6px; }

.toast {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 999px;
  font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 60; max-width: 90%;
}
.toast.show { opacity: .95; transform: translateX(-50%) translateY(0); }

.theme-grid { display: grid; grid-template-columns: repeat(3,1fr); gap: 12px; }
.theme-opt { border-radius: var(--radius); padding: 14px 8px; cursor: pointer; border: 2px solid transparent; text-align: center; font-weight: 600; }
.theme-opt.sel { border-color: var(--ink); }
.swatch { height: 34px; border-radius: 10px; margin-bottom: 8px; }

.day-head { font-weight: 700; margin: 18px 4px 6px; }
.invite-box { display: flex; gap: 8px; }
.invite-box input { flex: 1; }
