* { box-sizing: border-box; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0; background: #f4f6fb; color: #1e293b;
}
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #1e293b; color: #fff;
  position: sticky; top: 0; z-index: 10;
}
.topbar a { color: #fff; text-decoration: none; }
.brand { font-weight: 700; font-size: 1.05rem; }
.topbar nav { display: flex; gap: 12px; align-items: center; font-size: .9rem; }
.topbar .me { display: flex; gap: 6px; align-items: center; }
.linklike {
  background: none; border: none; color: #fff; font-size: .9rem;
  cursor: pointer; text-decoration: underline; padding: 0;
}
main { max-width: 900px; margin: 0 auto; padding: 14px; }

.avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: 50%;
  font-size: 1.4rem; color: #fff; flex: none;
}
.avatar.sm { width: 26px; height: 26px; font-size: 1rem; }
.avatar.xs { width: 22px; height: 22px; font-size: .9rem; }
.avatar.big { width: 48px; height: 48px; font-size: 1.7rem; cursor: pointer; }

.monthnav { display: flex; justify-content: space-between; align-items: center; margin: 4px 0 12px; }
.monthnav h1 { font-size: 1.25rem; margin: 0; }
.btn {
  display: inline-block; padding: 8px 14px; border-radius: 8px;
  background: #e2e8f0; color: #1e293b; text-decoration: none; border: none;
  font-size: .95rem; cursor: pointer;
}
.btn.primary { background: #3b82f6; color: #fff; }
.btn.danger { background: #fee2e2; color: #b91c1c; }


.grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.dow { text-align: center; font-size: .75rem; color: #64748b; padding: 4px 0; }
.cell {
  min-height: 64px; background: #fff; border-radius: 8px; padding: 4px;
  text-decoration: none; color: inherit; border: 2px solid transparent;
  overflow: hidden;
}
.cell.empty { background: transparent; }
.cell.today { border-color: #3b82f6; }
.daynum { font-size: .8rem; font-weight: 700; color: #475569; }
.entry { display: flex; align-items: center; gap: 3px; margin-top: 3px; font-size: .72rem; }
.etime { white-space: nowrap; }

.card {
  background: #fff; border-radius: 12px; padding: 16px;
  margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.08);
}
.card.narrow { max-width: 480px; margin: 20px auto; }
.card h1 { margin-top: 0; font-size: 1.3rem; }
.muted { color: #64748b; }
.center { text-align: center; }
.error { color: #b91c1c; background: #fee2e2; padding: 8px 12px; border-radius: 8px; }
.ok { color: #166534; background: #dcfce7; padding: 8px 12px; border-radius: 8px; }
.flash { padding: 10px 14px; border-radius: 8px; font-weight: 600; }
.flash.ok { background: #dcfce7; color: #166534; }
.flash.err { background: #fee2e2; color: #b91c1c; }

.form label { display: block; margin-bottom: 12px; font-weight: 600; font-size: .95rem; }
.form input[type=text], .form input[type=password], .form input[type=time],
.form input[type=date], .form select.sel,
.editor input[type=text], .editor input[type=time] {
  width: 100%; padding: 10px; margin-top: 4px; font-size: 1rem;
  border: 1px solid #cbd5e1; border-radius: 8px;
  background: #fff;
}
.form button, .editor .btn { font-size: 1rem; }
.form button[type=submit] {
  width: 100%; padding: 12px; background: #3b82f6; color: #fff;
  border: none; border-radius: 8px; font-size: 1.05rem; cursor: pointer;
}
.google-btn {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 12px; background: #fff; color: #1f1f1f;
  border: 1px solid #cbd5e1; border-radius: 8px; font-size: 1.05rem;
  font-weight: 500; text-decoration: none; box-sizing: border-box;
}
.google-btn:hover { background: #f8fafc; }
.google-icon { width: 20px; height: 20px; flex: none; }
.oauth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 16px 0 12px; color: #94a3b8; font-size: .9rem;
}
.oauth-divider::before, .oauth-divider::after {
  content: ""; flex: 1; border-top: 1px solid #e2e8f0;
}
fieldset { border: 1px solid #e2e8f0; border-radius: 8px; margin: 0 0 12px; padding: 10px; }
legend { font-weight: 600; font-size: .9rem; padding: 0 6px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice input { display: none; }
.choice input:checked + .avatar, .choice input:checked + .swatch {
  outline: 3px solid #1e293b; outline-offset: 2px;
}
.swatch { width: 40px; height: 40px; border-radius: 50%; display: inline-block; cursor: pointer; }

.person-head { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 10px; }
.person-head .current { margin-top: 4px; }
.editor label { display: block; margin-bottom: 10px; font-weight: 600; font-size: .9rem; }
.row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.row > * { min-width: 0; }

@media (max-width: 560px) {
  .cell { min-height: 56px; }
  .etime { display: none; }   /* initials only on small screens; tap day for times */
  .topbar { flex-wrap: wrap; row-gap: 8px; }
  .topbar nav { flex-wrap: wrap; gap: 6px 12px; font-size: .82rem; }
  /* The recurring form's Event time / From / To row stacks on phones so
     the date inputs never overflow off the right edge. */
  .row.wrap-sm { flex-direction: column; align-items: stretch; }
}

/* repeating pickups */
.pill {
  display: inline-block; font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 999px; margin-left: 6px;
  background: #e0e7ff; color: #3730a3; vertical-align: middle;
}
.pill.once { background: #f1f5f9; color: #475569; }
.wdays { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 12px; }
.wdays label {
  display: flex; align-items: center; gap: 6px;
  background: #f1f5f9; border-radius: 8px; padding: 8px 12px;
  font-size: .9rem; font-weight: 600; cursor: pointer; margin: 0;
}
.wdays input { width: 18px; height: 18px; accent-color: #3b82f6; }
.card.rule { display: flex; gap: 12px; align-items: center; }
.card.rule.member { flex-wrap: wrap; }
.member-head { display: flex; align-items: center; gap: 12px; flex: 1 1 100%; min-width: 0; }
.member-move { display: flex; gap: 4px; margin-left: auto; }
.member-id { flex: 1; min-width: 0; }
.member-remove { margin: 0; flex: none; }
.card.rule.member .member-label { flex: 1 1 100%; margin: 0; }
.member-danger { flex: 1 1 100%; margin: 0; justify-content: flex-end; }
.member-tabs { gap: 8px; margin-top: 8px; }
.member-tab.active { outline: 2px solid #3b82f6; outline-offset: 1px; }
.member-section { margin-top: 8px; }
.member-section[hidden] { display: none; }
.invite-box { background: #f3f4f6; border-radius: 12px; padding: 10px 12px; margin-top: 8px; }
.invite-box .muted { margin: 0 0 6px; }
.invite-box .invite-link { word-break: break-all; margin: 0 0 8px; font-size: .78rem; color: #6b7280; }
.btn.icon {
  width: 40px; height: 40px; padding: 0; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1.15rem;
}
.btnrow { flex-wrap: wrap; }

/* pickup person: pink = Mom, blue = Dad — kept bright on purpose so the
   pickup parent is obvious at a glance */
.pk-mom { background: #ec4899; color: #fff; }
.pk-dad { background: #2563eb; color: #fff; }
/* month entries: the kid's initial carries the picker's color —
   a blue M means Dad picks up, a pink M means Mom does */
.entry.pk-mom, .entry.pk-dad { background: none; color: inherit; border-radius: 6px; padding: 2px 5px; }
.entry.pk-mom .kid-initial { color: #ec4899; }
.entry.pk-dad .kid-initial { color: #2563eb; }
.pkword-mom { color: #db2777; }
.pkword-dad { color: #2563eb; }
.pkword { font-weight: 700; }
.pk-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle; white-space: nowrap;
}
.picker-legend { font-size: .85rem; color: #475569; margin: 0 0 8px; }
.pickerow { display: flex; gap: 8px; margin-top: 6px; }
.pkbtn {
  flex: 1; padding: 10px; border-radius: 10px; font-size: 1rem; font-weight: 700;
  cursor: pointer; border: 2px solid transparent;
}
.pkbtn.pk-mom { background: #fce7f3; color: #831843; }
.pkbtn.pk-dad { background: #dbeafe; color: #1e3a8a; }
.pkbtn.pk-mom.sel { background: #ec4899; border-color: #be185d; color: #fff; }
.pkbtn.pk-dad.sel { background: #2563eb; border-color: #1e40af; color: #fff; }
.kid-initial { font-weight: 800; font-size: .85rem; min-width: 1em; text-align: center; }
.kid-initial.lg {
  width: 26px; height: 26px; border-radius: 50%; color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 1rem; flex: none;
}

/* roles */
.role-badge {
  display: inline-block; font-size: .72rem; font-weight: 700;
  padding: 2px 10px; border-radius: 999px; margin-left: 6px;
  vertical-align: middle;
}
.role-admin { background: #1e293b; color: #fff; }
.role-editor { background: #e0e7ff; color: #3730a3; }
.role-basic { background: #f1f5f9; color: #475569; }
select.sel {
  padding: 10px; font-size: 1rem; border: 1px solid #cbd5e1;
  border-radius: 8px; background: #fff;
}

/* week view: one week per screen, inline editors, no drilling into days */
.wk-day {
  background: #fff; border-radius: 12px; padding: 12px 14px;
  margin-bottom: 0; box-shadow: 0 1px 3px rgba(0,0,0,.08);
  border: 2px solid #e5e7eb;
}
.wk-day.today { border-color: #3b82f6; }
.wk-dayhead { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2px; }
.wk-dayhead a { text-decoration: none; color: inherit; font-size: 1.05rem; }
.wk-kid {
  display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
  padding: 10px 0; border-top: 1px solid #f1f5f9;
}
.wk-kid input[type="time"] {
  width: 108px; padding: 8px; font-size: 1rem;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff;
}
.wk-loc {
  flex: 1 1 100%; padding: 8px 10px; font-size: 1rem;
  border: 1px solid #cbd5e1; border-radius: 8px; background: #fff;
}
.pkseg { display: inline-flex; border-radius: 10px; overflow: hidden; }
.pkseg .pkbtn { border-radius: 0; padding: 8px 14px; font-size: .95rem; flex: none; }
.btn.sm { padding: 8px 16px; font-size: .95rem; }
.wk-status { flex: 1 1 100%; display: flex; gap: 14px; align-items: center; font-size: .85rem; }
.wk-readonly { font-size: 1rem; }
.linklike.dark { color: #475569; }
.linklike.danger-t { color: #b91c1c; }

/* settings dropdown in the topbar */
.dropdown { position: relative; display: inline-block; }
.dropbtn {
  background: none; border: none; color: #fff; font-size: .9rem;
  cursor: pointer; padding: 6px 8px; border-radius: 8px;
}
.dropbtn:hover { background: rgba(255,255,255,.12); }
.dropdown-menu {
  position: absolute; right: 0; top: calc(100% + 6px);
  background: #fff; min-width: 210px; border-radius: 12px;
  box-shadow: 0 10px 28px rgba(0,0,0,.28); padding: 6px; z-index: 50;
}
.dropdown-menu a, .dropdown-menu .menubtn {
  display: block; width: 100%; text-align: left;
  color: #1e293b; padding: 10px 12px; border-radius: 8px;
  text-decoration: none; background: none; border: none;
  font-size: .95rem; cursor: pointer;
}
.dropdown-menu a:hover, .dropdown-menu .menubtn:hover { background: #f1f5f9; }
.dropdown-menu form { margin: 0; }

/* ---- Infinite feed ---- */
.feed-top { display: flex; align-items: center; justify-content: space-between; margin: 2px 0 10px; }
.feed-top h1 { font-size: 1.35rem; margin: 0; }
.legend {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: center;
  margin-bottom: 10px; font-size: .9rem;
  border: 1px solid #e2e8f0; border-radius: 12px; padding: 8px 10px;
  background: #fff;
}
/* Member filter: the legend doubles as the filter (feed-only,
   client-side multi-select). Items keep the legend's airy look;
   selection shows as a ring around the avatar. */
.mchip {
  display: inline-flex; align-items: center; gap: 5px;
  border: 0; background: none; padding: 2px;
  font-size: .9rem; cursor: pointer; color: inherit;
}
.mchip .kid-initial.lg { width: 26px; height: 26px; }
.mchip.on { font-weight: 700; color: #1d4ed8; }
.mchip.on .kid-initial.lg { outline: 2px solid #3b82f6; outline-offset: 2px; }
.filter-empty {
  text-align: center; color: #64748b; font-size: .9rem;
  border: 1px dashed #cbd5e1; border-radius: 12px; padding: 12px;
  margin: 0 0 10px;
}
.hidden-by-filter { display: none !important; }
#feed { display: flex; flex-direction: column; gap: 12px; }
#sentinel-bottom { min-height: 2px; }
.wk-day.today { border-color: #3b82f6; box-shadow: 0 0 0 3px rgba(59,130,246,.22); }
.wk-day.editing { border-color: #a78bfa; }
.wk-day { margin-bottom: 0; }
.wk-head-right { display: flex; align-items: center; gap: 8px; }
.wk-view { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex: 1; min-width: 0; font-size: 1rem; }
.vevent { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; flex: 1 1 100%; }
.xhead { flex: 1 1 100%; margin-top: 10px; font-size: .85rem; font-weight: 700; color: #475569; }
.edit-block {
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f8fafc;
  padding: 10px;
  margin-top: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.edit-block-title {
  flex: 1 1 100%;
  font-size: .78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: #64748b;
}
.xadd { margin-top: 8px; }
.iconbtn {
  border: 1px solid #e2e8f0;
  background: #fff;
  border-radius: 12px;
  min-width: 48px;
  height: 48px;
  padding: 0 12px;
  font-size: 1.3rem;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex: none;
  text-decoration: none;
  color: inherit;
}
.iconbtn.save { color: #15803d; }
.iconbtn.del { color: #64748b; }
.iconbtn.add { color: #2563eb; }
.iconbtn.del.armed { background: #dc2626; border-color: #dc2626; color: #fff; }
/* The hidden attribute must win over display rules (flex etc.), or
   toggled sections never actually hide. */
[hidden] { display: none !important; }
.vtime { font-size: 1.25rem; font-weight: 700; }
.vloc { color: #374151; }
.vact { font-weight: 600; color: #1e293b; }
.vnotes { flex: 1 1 100%; color: #475569; font-size: .85rem; }
.pkword-mom { color: #db2777; font-weight: 700; }
.pkword-dad { color: #2563eb; font-weight: 700; }
.fab {
  position: fixed; right: 16px; bottom: 20px; z-index: 50;
  border: none; border-radius: 999px; padding: 12px 20px;
  background: #3b82f6; color: #fff; font-weight: 700; font-size: 1rem;
  box-shadow: 0 4px 14px rgba(0,0,0,.28); cursor: pointer;
}
.fab[hidden] { display: none; }
.wk-day { cursor: pointer; }
.tap-hint { color: #6b7280; font-size: .85rem; margin: 0 0 10px; }

/* One-time onboarding hint for brand-new families (1 member) */
.onboard-hint { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af;
  border-radius: 10px; padding: 10px 12px; font-size: .9rem; margin: 0 0 10px; }
.onboard-hint-x { background: none; border: none; font-size: 1rem; color: #1e40af;
  cursor: pointer; padding: 4px 8px; flex-shrink: 0; }

/* Language picker page */
.langlist { display: flex; flex-direction: column; }
.langrow {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 4px; border-bottom: 1px solid #e5e7eb;
  text-decoration: none; color: inherit; font-size: 1rem;
}
.langrow:last-child { border-bottom: none; }
.langrow .check { color: #16a34a; font-weight: 700; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap;
}

/* v2 family events */
.pchips { display: inline-flex; gap: 4px; }
.pchip {
  display: inline-flex; align-items: center; justify-content: center;
  width: 1.5em; height: 1.5em; border-radius: 50%;
  color: #fff; font-weight: 800; font-size: .85rem;
}
.pname { font-size: .85rem; color: #334155; margin-right: 6px; }
/* Participant names stay hidden in the plain (avatar-only) feed view; they
   appear when a day is tapped into edit mode or on the dedicated day page. */
.wk-day .pname { display: none; }
.wk-day.editing .pname, .day-view .pname { display: inline; }
/* Day drill-down: thin separators between consecutive events, both in the
   tapped-inline drill-down and on the dedicated day page. */
.day-view .vevent + .vevent, .wk-day.editing .vevent + .vevent {
  border-top: 1px solid #e5e7eb;
  padding-top: 8px;
}
.ev-actions { display: inline-flex; gap: 6px; margin-left: auto; }
.wk-actions { display: flex; gap: 14px; margin-top: 8px; flex-wrap: wrap; }
/* Edit controls only show once a day is tapped into edit mode. The hidden
   attribute loses to the display:flex above, so restate it explicitly. */
.wk-day .wk-edit[hidden] { display: none; }
.evform-wrap { margin-top: 10px; }
.evform { display: flex; flex-direction: column; gap: 12px; }
.ef-step { display: flex; gap: 10px; align-items: flex-start; }
.ef-num {
  flex: 0 0 auto; width: 1.6em; height: 1.6em; border-radius: 50%;
  background: #3b82f6; color: #fff; font-weight: 800;
  display: inline-flex; align-items: center; justify-content: center;
}
.ef-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.ef-title { font-weight: 700; font-size: 1.05rem; }
.who-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.who-chip {
  display: inline-flex; align-items: center; gap: 6px;
  border: 2px solid #cbd5e1; border-radius: 999px;
  background: #fff; padding: 4px 12px 4px 4px;
  font-size: 1rem; cursor: pointer;
}
.who-chip.on { border-color: #3b82f6; background: #eff6ff; }

/* cache-bust: member filter fix 2026-09-23 */

/* App footer: single muted line, same on every page. */
.foot { max-width: 900px; margin: 28px auto 0; padding: 14px;
        text-align: center; font-size: .85rem; color: #64748b; }
.foot a { color: #64748b; }
.foot a:hover { color: #3b82f6; }

/* Plain stats tables (admin usage page): full width, phone-legible. */
table.stats { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.stats th, table.stats td { text-align: left; padding: 8px 4px;
        border-bottom: 1px solid #e2e8f0; }
table.stats th { font-weight: 600; }
table.stats td:last-child, table.stats th:last-child { text-align: right; }
.card.legal { max-width: 720px; margin: 20px auto; }
.card.legal h2 { font-size: 1.05rem; margin: 1.4em 0 .4em; }
.card.legal ul { padding-left: 1.3em; }
.card.legal li { margin: .3em 0; }
.legal-note { font-size: .8rem; margin-top: 12px; }
