/* Cameron Cal — shared styles. Mobile-first, system fonts, light+dark.
   Palette: Dad = emerald, Mom = violet, neutrals = warm slate, holiday = amber. */

:root {
  /* Family convention colors (possession) */
  --dad: #059669;
  --mom: #7C3AED;
  /* Readable deep variants for text/accents on light surfaces */
  --dad-deep: #047857;
  --mom-deep: #6D28D9;
  /* Fills used in calendar cells / strips (white/near-white text on these) */
  --d-fill: #10B981;
  --m-fill: #8B5CF6;
  --d-soft: #D1FAE5;
  --m-soft: #EDE9FE;
  /* Holiday accent */
  --holiday: #F59E0B;
  /* Near-white text on possession fills */
  --on-fill: #FCFCFB;

  --bg: #FAFAF9;
  --card: #FFFFFF;
  --card-2: #F5F5F4;
  --text: #292524;
  --muted: #78716C;
  --line: #E7E5E4;
  --shadow: 0 2px 12px rgba(41, 37, 36, 0.07);
  --ring: #292524;
  --radius: 18px;
  --tabbar-h: 62px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1C1917;
    --card: #292524;
    --card-2: #322E2B;
    --text: #FAFAF9;
    --muted: #A8A29E;
    --line: #44403C;
    --shadow: 0 2px 14px rgba(0, 0, 0, 0.35);
    --ring: #FAFAF9;
    --dad: #10B981;
    --mom: #8B5CF6;
    --dad-deep: #34D399;
    --mom-deep: #A78BFA;
    --d-fill: #065F46;
    --m-fill: #5B21B6;
    --d-soft: #0B3A2C;
    --m-soft: #2C1D52;
    --holiday: #FBBF24;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  -webkit-tap-highlight-color: transparent;
}

.page {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px 16px 24px;
}

/* ---------- Header ---------- */
.app-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px 6px;
  max-width: 640px;
  margin: 0 auto;
}
.app-header img { width: 30px; height: 30px; border-radius: 8px; }
.app-header h1 { font-size: 1.05rem; font-weight: 700; margin: 0; letter-spacing: 0.01em; }
.app-header .spacer { flex: 1; }
.offline-badge {
  display: none;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 9px;
}
body.is-offline .offline-badge { display: inline-block; }
.app-header .gear {
  color: var(--text);
  text-decoration: none;
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  opacity: 0.9;
}
.app-header .gear:hover,
.app-header .gear:active { opacity: 1; border-color: var(--dad); }
.sheet-edit {
  display: inline-block;
  margin-top: 12px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card-2);
  color: var(--text);
  font-size: 0.85rem;
  font-weight: 700;
  text-decoration: none;
}
.sheet-edit:active { transform: scale(0.97); }

/* ---------- Cards ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin: 0 0 10px;
  font-weight: 700;
}

/* ---------- Tonight hero ---------- */
.hero {
  border-radius: 22px;
  padding: 22px 18px 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow);
  text-align: center;
  background: var(--card);
  border-top: 6px solid var(--line);
}
.hero.owner-D { background: var(--d-soft); border-top-color: var(--dad); }
.hero.owner-M { background: var(--m-soft); border-top-color: var(--mom); }
.hero-kicker { font-size: 0.9rem; color: var(--muted); font-weight: 600; margin: 0; }
.hero-name {
  font-size: clamp(2.4rem, 11vw, 3.2rem);
  font-weight: 800;
  margin: 2px 0 8px;
  letter-spacing: -0.02em;
}
.hero.owner-D .hero-name { color: var(--dad-deep); }
.hero.owner-M .hero-name { color: var(--mom-deep); }
.hero-range { font-size: 0.92rem; color: var(--muted); margin: 0 0 12px; }
.hero-range strong { color: var(--text); font-weight: 650; }
.countdown {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  background: var(--card);
  border-radius: 999px;
  padding: 8px 16px;
  box-shadow: var(--shadow);
}
.countdown .cd-num { font-size: 1.25rem; font-weight: 750; font-variant-numeric: tabular-nums; }
.countdown .cd-label { font-size: 0.78rem; color: var(--muted); font-weight: 600; }

/* ---------- Ask about a date ---------- */
.ask-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 6px 4px 14px;
  position: relative;
}
.ask-box:focus-within { border-color: var(--dad); }
.ask-spark { color: var(--holiday); font-size: 0.85rem; flex: none; }
#ask-input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  min-height: 44px;
  outline: none;
}
#ask-input::placeholder { color: var(--muted); opacity: 0.8; }
.ask-pick {
  flex: none;
  width: 44px;
  height: 44px;
  border: none;
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
}
.ask-pick svg { width: 20px; height: 20px; }
.ask-pick:active { transform: scale(0.94); }
.ask-go {
  flex: none;
  min-width: 56px;
  height: 44px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--dad);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 750;
  cursor: pointer;
}
.ask-go:active { transform: scale(0.95); }
.ask-native-date {
  position: absolute;
  right: 74px;
  bottom: 0;
  width: 44px;
  height: 44px;
  opacity: 0;
  pointer-events: none;
  border: 0;
}
.ask-answer { padding: 12px 2px 2px; }
.ask-big { font-size: 1.15rem; font-weight: 750; margin: 0 0 2px; }
.ask-big.owner-D { color: var(--dad-deep); }
.ask-big.owner-M { color: var(--mom-deep); }
.ask-date-line { margin: 0 0 8px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
.ask-badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--holiday);
  border: 1px solid var(--holiday);
  border-radius: 999px;
  padding: 1px 8px;
  margin-left: 6px;
  vertical-align: 1px;
}
.ask-timeline { margin: 0 0 10px; font-size: 0.85rem; line-height: 1.7; overflow-wrap: anywhere; }
.ask-seg { font-weight: 600; }
.ask-seg.o-D { color: var(--dad-deep); }
.ask-seg.o-M { color: var(--mom-deep); }
.ask-arrow { color: var(--muted); }
.ask-link {
  display: inline-block;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 14px;
  min-height: 24px;
}
.ask-link:active { transform: scale(0.97); }
/* Period / coverage answers -------------------------------------------- */
.ask-period-head {
  margin: 0 0 8px;
  font-size: 1.05rem;
  font-weight: 750;
  line-height: 1.3;
}
.ask-split { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 10px; }
.ask-chip {
  font-size: 0.82rem;
  font-weight: 700;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid transparent;
  white-space: nowrap;
}
.ask-chip.o-D { color: var(--dad-deep); border-color: var(--dad); background: color-mix(in srgb, var(--dad) 12%, transparent); }
.ask-chip.o-M { color: var(--mom-deep); border-color: var(--mom); background: color-mix(in srgb, var(--mom) 12%, transparent); }
.ask-note {
  margin: 0 0 10px;
  font-size: 0.8rem;
  color: var(--muted);
  line-height: 1.5;
}
.ask-blocks { list-style: none; margin: 0 0 10px; padding: 0; }
.ask-block {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 10px;
  padding: 9px 12px;
  margin-bottom: 6px;
  border-radius: 12px;
  border-left: 4px solid transparent;
  background: var(--card-2);
  font-size: 0.85rem;
}
.ask-block.o-D { border-left-color: var(--dad); }
.ask-block.o-M { border-left-color: var(--mom); }
.ask-block-who { font-weight: 750; flex: none; }
.ask-block.o-D .ask-block-who { color: var(--dad-deep); }
.ask-block.o-M .ask-block-who { color: var(--mom-deep); }
.ask-block-when { color: var(--muted); font-weight: 600; overflow-wrap: anywhere; }
.ask-block.ask-edge-start, .ask-block.ask-edge-end { border-left-style: dashed; }
.ask-more {
  padding: 6px 12px;
  margin-bottom: 6px;
  font-size: 0.8rem;
  color: var(--muted);
  font-style: italic;
}
.ask-hint { padding: 10px 2px 2px; font-size: 0.85rem; color: var(--muted); }
.ask-hint p { margin: 0 0 4px; }
.ask-hint ul { margin: 0; padding-left: 18px; }
.ask-hint li { margin: 2px 0; }

/* ---------- Exchange list ---------- */
.xlist { display: flex; flex-direction: column; }
.xrow {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 2px;
  border-bottom: 1px solid var(--line);
  min-height: 44px;
}
.xrow:last-child { border-bottom: none; }
.x-when { flex: 1; min-width: 0; }
.x-day { font-weight: 650; font-size: 0.95rem; }
.x-time { font-size: 0.82rem; color: var(--muted); }
.x-kind {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 8px;
  white-space: nowrap;
  max-width: 40vw;
  overflow: hidden;
  text-overflow: ellipsis;
}
.x-to {
  font-size: 0.82rem;
  font-weight: 750;
  border-radius: 999px;
  padding: 5px 12px;
  white-space: nowrap;
}
.x-to.to-D { background: var(--dad); color: var(--on-fill); }
.x-to.to-M { background: var(--mom); color: var(--on-fill); }

/* ---------- 14-night strip ---------- */
.strip-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
  margin-bottom: 6px;
}
.strip-day {
  border-radius: 10px;
  padding: 6px 0 7px;
  text-align: center;
  background: var(--card-2);
}
.strip-day.n-D { background: var(--d-fill); color: var(--on-fill); }
.strip-day.n-M { background: var(--m-fill); color: var(--on-fill); }
.strip-day .sd-dow { display: block; font-size: 0.62rem; font-weight: 700; opacity: 0.75; letter-spacing: 0.03em; }
.strip-day .sd-num { display: block; font-size: 0.95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.strip-day.is-today { outline: 2px solid var(--ring); outline-offset: 1px; }
.strip-day .sd-star { font-size: 0.6rem; line-height: 0.6; display: block; color: var(--holiday); }

.legend { display: flex; gap: 16px; justify-content: center; margin-top: 8px; font-size: 0.78rem; color: var(--muted); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 5px; vertical-align: -1px; }
.legend .dot.d { background: var(--dad); }
.legend .dot.m { background: var(--mom); }

/* ---------- Calendar ---------- */
.cal-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}
.cal-nav h2 { flex: 1; text-align: center; font-size: 1.1rem; margin: 0; font-weight: 750; }
.btn {
  appearance: none;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--text);
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 650;
  min-width: 44px;
  min-height: 40px;
  padding: 6px 12px;
  cursor: pointer;
}
.btn:active { transform: scale(0.96); }
.btn-today { font-size: 0.82rem; }

.cal-dows {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  margin-bottom: 4px;
}
.cal-dows span { text-align: center; font-size: 0.68rem; font-weight: 700; color: var(--muted); letter-spacing: 0.04em; }
.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
  touch-action: pan-y;
}
.cal-cell {
  border-radius: 10px;
  min-height: 62px;
  padding: 4px 4px 3px;
  background: var(--card-2);
  border: none;
  font: inherit;
  color: inherit;
  text-align: left;
  display: flex;
  flex-direction: column;
  cursor: pointer;
  overflow: hidden;
}
.cal-cell:disabled { opacity: 0.35; cursor: default; }
.cal-cell.is-today { outline: 2px solid var(--ring); outline-offset: 1px; }
.cal-cell.has-fill { color: var(--on-fill); } /* possession fills carry near-white text */
.cal-cell .cc-num { font-size: 0.85rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.cal-cell .cc-holiday {
  margin-top: auto;
  font-size: 0.56rem;
  line-height: 1.15;
  font-weight: 650;
  opacity: 0.85;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cal-cell.outside { opacity: 0.4; }

/* ---------- Bottom sheet (day detail) ---------- */
.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(10, 8, 14, 0.45);
  z-index: 40;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s;
}
.sheet {
  position: fixed;
  left: 0; right: 0;
  bottom: 0;
  z-index: 41;
  background: var(--card);
  border-radius: 20px 20px 0 0;
  padding: 10px 18px calc(20px + env(safe-area-inset-bottom));
  max-width: 640px;
  margin: 0 auto;
  transform: translateY(105%);
  transition: transform 0.22s ease-out;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
}
body.sheet-open .sheet { transform: translateY(0); }
body.sheet-open .sheet-backdrop { opacity: 1; pointer-events: auto; }
.sheet-handle { width: 38px; height: 4px; border-radius: 2px; background: var(--line); margin: 0 auto 10px; }
.sheet h3 { margin: 0 0 2px; font-size: 1.05rem; }
.sheet .sheet-sub { margin: 0 0 10px; font-size: 0.8rem; color: var(--muted); }
.seg-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.seg-row:last-child { border-bottom: none; }
.seg-bar { width: 5px; align-self: stretch; border-radius: 3px; }
.seg-bar.o-D { background: var(--dad); }
.seg-bar.o-M { background: var(--mom); }
.seg-times { flex: 1; }
.seg-owner { font-weight: 700; font-size: 0.92rem; }
.seg-owner.o-D { color: var(--dad-deep); }
.seg-owner.o-M { color: var(--mom-deep); }
.seg-span { font-size: 0.8rem; color: var(--muted); }
.seg-label { font-size: 0.72rem; color: var(--muted); font-style: italic; }

/* ---------- Stats ---------- */
.year-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.year-nav h2 { flex: 1; text-align: center; font-size: 1.15rem; margin: 0; font-weight: 750; font-variant-numeric: tabular-nums; }

.totals {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-bottom: 14px;
}
.total-card {
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow);
}
.total-card.t-D { background: var(--d-soft); }
.total-card.t-M { background: var(--m-soft); }
.total-card .t-name { font-size: 0.8rem; font-weight: 750; }
.total-card.t-D .t-name { color: var(--dad-deep); }
.total-card.t-M .t-name { color: var(--mom-deep); }
.total-card .t-big { font-size: 1.7rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.2; }
.total-card .t-sub { font-size: 0.74rem; color: var(--muted); }

.mrow { margin-bottom: 12px; }
.mrow .m-name { font-size: 0.8rem; font-weight: 700; margin-bottom: 3px; }
.bar-pair { display: flex; flex-direction: column; gap: 3px; }
.bar-track { display: flex; align-items: center; gap: 8px; }
.bar {
  height: 16px;
  border-radius: 5px;
  min-width: 3px; /* keeps tiny nonzero months visible */
  transition: width 0.35s ease-out;
}
.bar.is-zero { min-width: 0; } /* zero nights = no colored sliver */
.bar.b-D { background: var(--dad); }
.bar.b-M { background: var(--mom); }
.bar-val { font-size: 0.74rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 30;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--card);
  border-top: 1px solid var(--line);
  display: flex;
}
.tab {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  text-decoration: none;
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 650;
}
.tab svg { width: 24px; height: 24px; }
.tab.active { color: var(--text); }

/* ---------- States ---------- */
.skeleton {
  border-radius: var(--radius);
  background: linear-gradient(100deg, var(--card) 40%, var(--card-2) 50%, var(--card) 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }
.sk-hero { height: 190px; margin-bottom: 14px; border-radius: 22px; }
.sk-block { height: 120px; margin-bottom: 14px; }

.empty { color: var(--muted); font-size: 0.88rem; text-align: center; padding: 18px 0; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 14px);
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 600;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 60;
  max-width: 88vw;
  text-align: center;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Site login overlay ---------- */
.login-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.login-card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px 22px;
  width: 100%;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: center;
}
.login-mark {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: linear-gradient(100deg, var(--dad-deep), var(--mom-deep));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.login-hint { margin: 0; font-size: 0.85rem; color: var(--muted); }
.login-card input[type="password"] {
  font: inherit;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card-2);
  color: var(--text);
  text-align: center;
}
.login-card input[type="password"]:focus { outline: 2px solid var(--dad); outline-offset: 1px; }
.login-btn { background: var(--dad); border-color: var(--dad); color: var(--on-fill); font-weight: 700; }
.login-error { margin: 0; font-size: 0.8rem; color: #DC2626; min-height: 1.1em; }
@keyframes login-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(8px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(5px); }
}
.login-card.shake { animation: login-shake 0.35s; }

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


/* ======================= Chores ======================= */
body[data-page="chores"] { --kid: var(--kid-l, var(--dad)); --on-kid: #fff; }
@media (prefers-color-scheme: dark) {
  body[data-page="chores"] { --kid: var(--kid-d, var(--dad)); --on-kid: #1C1917; }
}
.ch-sub { margin: 0 0 12px; color: var(--muted); font-size: 0.9rem; }
.ch-picker h2 { margin-bottom: 4px; }
.ch-picker-grid { display: grid; grid-template-columns: 1fr; gap: 10px; }
.ch-pick {
  min-height: 56px; border: none; border-radius: 16px; font: inherit; font-size: 1.15rem; font-weight: 750; cursor: pointer;
  background: var(--pk-l); color: #fff;
}
@media (prefers-color-scheme: dark) { .ch-pick { background: var(--pk-d); color: #1C1917; } }
.ch-pick-all { background: var(--card-2); color: var(--text); border: 1px solid var(--line); }
@media (prefers-color-scheme: dark) { .ch-pick-all { background: var(--card-2); color: var(--text); } }
.ch-pick:active { transform: scale(0.98); }

.ch-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.ch-chips::-webkit-scrollbar { display: none; }
.ch-chip {
  flex: none; min-height: 40px; padding: 0 16px; border-radius: 999px; font: inherit; font-size: 0.9rem; font-weight: 700; cursor: pointer;
  border: 1.5px solid var(--pk-l, var(--line)); background: var(--card); color: var(--text);
}
@media (prefers-color-scheme: dark) { .ch-chip { border-color: var(--pk-d, var(--line)); } }
.ch-chip.on { background: var(--pk-l, var(--text)); color: #fff; }
@media (prefers-color-scheme: dark) { .ch-chip.on { background: var(--pk-d, var(--text)); color: #1C1917; } }
.ch-chip-all { --pk-l: var(--text); border-color: var(--line); }
.ch-chip-all.on { background: var(--text); color: var(--bg, #fff); }

.ch-week { display: flex; align-items: center; gap: 10px; margin: 0 0 12px; }
.ch-nav { flex: none; width: 44px; height: 44px; padding: 0; font-size: 1.3rem; }
.ch-week-mid { flex: 1; min-width: 0; text-align: center; }
.ch-week-title { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.ch-weekbadge { background: var(--kid); color: var(--on-kid); padding: 4px 12px; border-radius: 999px; font-weight: 800; font-size: 0.9rem; }
.ch-week-dates { font-weight: 700; }
.ch-week-sub { margin-top: 4px; font-size: 0.8rem; color: var(--muted); }

.ch-strip { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; margin: 0 0 14px; }
.ch-day {
  display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 8px 0 7px; min-height: 64px;
  border: 1.5px solid var(--line); border-radius: 14px; background: var(--card); color: var(--text); font: inherit; cursor: pointer;
}
.ch-day-dow { font-size: 0.7rem; font-weight: 700; color: var(--muted); }
.ch-day-num { font-size: 1.05rem; font-weight: 800; }
.ch-day-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.ch-day.dad .ch-day-dot { background: var(--dad); }
.ch-day.mom .ch-day-dot { background: var(--mom); }
.ch-day.mom { opacity: 0.7; }
.ch-day.today { border-color: var(--text); }
.ch-day.on { background: var(--kid); border-color: var(--kid); color: var(--on-kid); opacity: 1; }
.ch-day.on .ch-day-dow { color: inherit; opacity: 0.85; }
.ch-day.on .ch-day-dot { background: var(--on-kid); }

.ch-day-card { margin-bottom: 14px; }
.ch-day-head { display: flex; align-items: baseline; gap: 10px; flex-wrap: wrap; margin-bottom: 4px; }
.ch-day-head h2 { margin: 0; }
.ch-day-date { color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.ch-pm { margin: 4px 0 0; font-size: 0.85rem; color: var(--muted); }
.ch-h { margin: 16px 0 6px; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--kid); }
.ch-list { list-style: none; margin: 0; padding: 0; }
.ch-item { display: flex; align-items: center; gap: 12px; min-height: 48px; padding: 6px 2px; cursor: pointer; border-bottom: 1px solid var(--line); }
.ch-list li:last-child .ch-item { border-bottom: none; }
.ch-item input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.ch-box { flex: none; width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--kid); display: grid; place-items: center; }
.ch-item input:focus-visible + .ch-box { outline: 3px solid var(--kid); outline-offset: 2px; }
.ch-item input:checked + .ch-box { background: var(--kid); }
.ch-item input:checked + .ch-box::after { content: "\2713"; color: var(--on-kid); font-weight: 900; font-size: 0.95rem; line-height: 1; }
.ch-text { font-size: 1rem; }
.ch-item.done .ch-text { text-decoration: line-through; color: var(--muted); }
.ch-just { margin: 14px 0 0; color: var(--muted); font-size: 0.95rem; }
.ch-away { margin: 8px 0 0; font-size: 1rem; line-height: 1.5; }
.ch-progress { display: flex; align-items: center; gap: 12px; margin-top: 16px; }
.ch-bar { flex: 1; height: 10px; border-radius: 999px; background: var(--card-2); overflow: hidden; }
.ch-bar span { display: block; height: 100%; background: var(--kid); border-radius: 999px; transition: width 0.25s ease; }
.ch-count { font-size: 0.85rem; font-weight: 700; white-space: nowrap; }

.ch-cards { display: grid; gap: 12px; margin-bottom: 14px; }
.ch-info h3 { margin: 0 0 6px; font-size: 1rem; color: var(--kid); }
.ch-info p { margin: 0; font-size: 0.92rem; line-height: 1.55; }

.ch-everyone { display: grid; gap: 10px; margin-top: 8px; }
.ch-ekid { padding: 10px 12px; border-radius: 14px; background: var(--card-2); border-left: 5px solid var(--pk-l); }
@media (prefers-color-scheme: dark) { .ch-ekid { border-left-color: var(--pk-d); } }
.ch-ekid h3 { margin: 0 0 4px; font-size: 1rem; color: var(--pk-l); }
@media (prefers-color-scheme: dark) { .ch-ekid h3 { color: var(--pk-d); } }
.ch-ekid ul { margin: 0; padding-left: 18px; font-size: 0.92rem; line-height: 1.6; }
.ch-ekid .ch-just { margin: 0; font-size: 0.9rem; }

.ch-overview { margin-bottom: 14px; }
.ch-jobs { display: grid; gap: 14px; margin-top: 8px; }
.ch-jobkid h3 { margin: 0 0 6px; font-size: 1rem; color: var(--pk-l); }
@media (prefers-color-scheme: dark) { .ch-jobkid h3 { color: var(--pk-d); } }
.ch-jobkid ul { list-style: none; margin: 0; padding: 0; }
.ch-jobkid li { display: flex; flex-direction: column; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 0.92rem; }
.ch-jobkid li:last-child { border-bottom: none; }
.ch-jobkid li span { color: var(--muted); font-size: 0.82rem; }
.ch-rhythm { display: flex; align-items: center; gap: 8px; margin-top: 10px; padding: 6px; border-radius: 14px; }
.ch-rhythm.now { background: var(--card-2); }
.ch-rhythm-w { flex: none; width: 22px; font-weight: 800; font-size: 1.1rem; text-align: center; }
.ch-rhythm-days { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.ch-rd { display: flex; flex-direction: column; gap: 2px; padding: 6px 3px; border-radius: 10px; border: 1px solid var(--line); background: var(--card); text-align: center; min-width: 0; }
.ch-rd b { font-size: 0.68rem; }
.ch-rd span { font-size: 0.62rem; line-height: 1.2; color: var(--muted); overflow-wrap: anywhere; }
.ch-rd.away { opacity: 0.55; }
@media (min-width: 640px) {
  .ch-picker-grid { grid-template-columns: repeat(4, 1fr); }
  .ch-cards { grid-template-columns: repeat(3, 1fr); }
  .ch-everyone, .ch-jobs { grid-template-columns: repeat(3, 1fr); }
  .ch-rd span { font-size: 0.75rem; }
}
