/* ============ Star Jar ============ */
:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --surface-2: #f5efe8;
  --ink: #2a2132;
  --ink-2: #4a3f52;
  --muted: #85798c;
  --line: #ece3d9;
  --brand: #7a5bc4;
  --accent: #8a6bd1;
  --good: #2f9a6f;
  --warn: #c98216;
  --bad: #cf4f68;
  --shadow: 0 1px 2px rgba(60, 40, 70, .05), 0 8px 24px -8px rgba(60, 40, 70, .14);
  --shadow-lg: 0 2px 6px rgba(60, 40, 70, .06), 0 24px 48px -16px rgba(60, 40, 70, .25);
  --r: 22px;
  --r-sm: 14px;
  --display: 'Fraunces', Georgia, serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --soft: color-mix(in srgb, var(--accent) 12%, var(--surface));
  --soft-2: color-mix(in srgb, var(--accent) 22%, var(--surface));
  --accent-ink: color-mix(in srgb, var(--accent) 70%, #1a1020);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #16121b; --surface: #211b28; --surface-2: #2a2332; --ink: #f4eef8; --ink-2: #d9cfe0; --muted: #a497ad; --line: #362d40;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px -8px rgba(0,0,0,.5); --shadow-lg: 0 24px 48px -16px rgba(0,0,0,.6);
    --accent-ink: color-mix(in srgb, var(--accent) 55%, #ffffff);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #16121b; --surface: #211b28; --surface-2: #2a2332; --ink: #f4eef8; --ink-2: #d9cfe0; --muted: #a497ad; --line: #362d40;
  --accent-ink: color-mix(in srgb, var(--accent) 55%, #ffffff);
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink); font-family: var(--body); font-weight: 600; font-size: 16px; line-height: 1.45;
  min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) 0 env(safe-area-inset-left);
}
#app { position: relative; z-index: 1; max-width: 1100px; margin: 0 auto; padding: 16px 16px 120px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; border: 0; background: none; padding: 0; }
h1, h2, h3 { margin: 0; line-height: 1.15; }
p { margin: 0; }
small { font-size: .8em; }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.center { text-align: center; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; align-items: center; gap: 10px; }
.row.wrap { flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.center { justify-content: center; }
.row.between { justify-content: space-between; }
.row.two > * { flex: 1; }
.eyebrow { font-size: 12px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.pad { padding: 14px 16px; }
.small { font-size: 14px; }
.foot { margin-top: 28px; font-size: 13px; }

/* soft background shapes */
.bg-blobs { position: fixed; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.bg-blobs i { position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; background: var(--accent); transition: background .6s; }
.bg-blobs i:nth-child(1) { width: 46vmax; height: 46vmax; top: -22vmax; right: -14vmax; }
.bg-blobs i:nth-child(2) { width: 30vmax; height: 30vmax; bottom: -12vmax; left: -10vmax; opacity: .18; background: #ffc46b; }
.bg-blobs i:nth-child(3) { width: 22vmax; height: 22vmax; top: 40%; left: 55%; opacity: .12; background: #ff8fb1; }
body.mode-parent .bg-blobs i { opacity: .12; }

/* ============ buttons & fields ============ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 20px; border-radius: 999px;
  font-weight: 800; font-size: 15px; white-space: nowrap; transition: transform .12s, box-shadow .2s, background .2s; user-select: none;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--ink); color: var(--bg); box-shadow: var(--shadow); }
.btn.accent { background: var(--accent); color: #fff; box-shadow: 0 8px 20px -8px var(--accent); }
.btn.ghost { background: var(--surface); border: 1.5px solid var(--line); }
.btn.danger { background: var(--bad); color: #fff; }
.btn.danger.ghost { background: transparent; color: var(--bad); border-color: color-mix(in srgb, var(--bad) 30%, transparent); }
.btn.big { min-height: 56px; font-size: 17px; padding: 0 28px; }
.btn.small { min-height: 36px; padding: 0 14px; font-size: 14px; }
.btn.full { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.link { color: var(--accent-ink); font-weight: 800; padding: 10px; }
.back { display: inline-block; color: var(--muted); font-weight: 800; padding: 8px 0; margin-bottom: 8px; }

.card { background: var(--surface); border-radius: var(--r); padding: 20px; box-shadow: var(--shadow); }
.field { display: flex; flex-direction: column; gap: 6px; }
.field > span { font-size: 14px; font-weight: 800; color: var(--ink-2); }
.field > span small { color: var(--muted); font-weight: 600; }
input:not([type=checkbox]):not([type=radio]):not([type=file]), select, textarea {
  width: 100%; border: 1.5px solid var(--line); background: var(--surface); border-radius: var(--r-sm); padding: 12px 14px; font-size: 17px; font-weight: 700; outline: none; transition: border .15s, box-shadow .15s;
}
select { width: auto; padding: 8px 12px; font-size: 15px; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 18%, transparent); }
textarea { resize: vertical; }
.code-input { font-family: ui-monospace, 'SF Mono', Menlo, monospace; letter-spacing: .12em; text-align: center; font-size: 24px !important; }
.check { display: flex; gap: 10px; align-items: center; font-weight: 700; }
.check input { width: 20px; height: 20px; accent-color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { padding: 8px 14px; border-radius: 999px; background: var(--surface); border: 1.5px solid var(--line); font-weight: 800; font-size: 14px; transition: all .15s; }
.chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; background: var(--surface-2); font-size: 13px; font-weight: 800; }
.pill.wait { background: color-mix(in srgb, var(--warn) 14%, var(--surface)); color: var(--warn); }
.pill.earn { background: var(--soft); color: var(--accent-ink); }

.switch { width: 46px; height: 28px; border-radius: 99px; background: var(--line); position: relative; flex: none; transition: background .2s; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.2); transition: transform .2s; }
.switch.on { background: var(--good); }
.switch.on::after { transform: translateX(18px); }

.bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.bar.thin { height: 6px; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .8s cubic-bezier(.2,.8,.2,1); }

/* segmented / pickers (work with radio labels and plain buttons) */
.seg { display: grid; gap: 8px; }
.seg.two { grid-template-columns: 1fr 1fr; }
.seg.ages { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 640px) { .seg.ages { grid-template-columns: repeat(4, 1fr); } }
.seg label { display: contents; }
.seg input, .pick input { position: absolute; opacity: 0; pointer-events: none; }
.seg label > span, .seg > button {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; text-align: center; padding: 12px; min-height: 52px;
  border-radius: var(--r-sm); border: 1.5px solid var(--line); background: var(--surface); font-weight: 800; cursor: pointer; transition: all .15s;
}
.seg small { font-weight: 600; color: var(--muted); font-size: 12px; line-height: 1.25; }
.seg b { font-size: 17px; }
.seg input:checked + span, .seg > button.on { border-color: var(--accent); background: var(--soft); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.seg input:focus-visible + span { outline: 2px solid var(--accent); }

.pick { display: flex; flex-wrap: wrap; gap: 8px; }
.pick label > span, .pick > button {
  display: grid; place-items: center; min-width: 46px; height: 46px; padding: 0 10px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface);
  font-size: 22px; cursor: pointer; transition: all .15s;
}
.pick.days label > span, .pick.kids label > span { font-size: 14px; font-weight: 800; }
.pick input:checked + span, .pick > button.on { border-color: var(--accent); background: var(--soft); transform: scale(1.06); }
.pick.colors label > span, .pick.colors > button { width: 42px; min-width: 42px; height: 42px; border-radius: 50%; background: var(--c); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); }
.pick.colors input:checked + span, .pick.colors > button.on { box-shadow: 0 0 0 3px var(--c); transform: scale(1.08); }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-2); font-size: 22px; font-weight: 800; flex: none; }
.stepper input { text-align: center; max-width: 120px; }

/* ============ lists ============ */
.sec { font-family: var(--display); font-weight: 600; font-size: 22px; margin: 28px 0 12px; }
.sec small { font-family: var(--body); font-size: 13px; color: var(--muted); font-weight: 700; margin-left: 6px; }
.sec-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin: 28px 0 12px; }
.sec-row .sec { margin: 0; }
.sub { font-size: 13px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 22px 0 8px; }
.sub small { text-transform: none; letter-spacing: 0; font-weight: 600; }
.list { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; min-height: 64px; }
.li:last-child { border-bottom: 0; }
.li b { display: block; font-weight: 800; }
.li small { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; color: var(--muted); font-weight: 600; }
.btnlike { transition: background .15s; }
.btnlike:active { background: var(--surface-2); }
.li-ic { width: 42px; height: 42px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; font-size: 22px; flex: none; }
.li-pic { width: 46px; height: 46px; border-radius: 13px; background: var(--surface-2); display: grid; place-items: center; font-size: 24px; overflow: hidden; flex: none; }
.li-pic img { width: 100%; height: 100%; object-fit: cover; }
.li-pts { font-weight: 800; color: var(--accent-ink); white-space: nowrap; }
.li .add { font-size: 22px; color: var(--accent-ink); }
.icon-btn { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; font-size: 18px; font-weight: 900; flex: none; }
.icon-btn.yes { background: var(--good); color: #fff; }
.icon-btn.no { background: var(--surface-2); color: var(--muted); }
.kchip { display: inline-flex; align-items: center; gap: 3px; padding: 1px 8px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 14%, var(--surface)); color: var(--ink-2); font-weight: 800; font-size: 12px; }
.pickrow .tick { width: 26px; height: 26px; border-radius: 8px; border: 2px solid var(--line); display: grid; place-items: center; color: #fff; font-weight: 900; font-size: 14px; flex: none; transition: all .15s; }
.pickrow.on .tick { background: var(--accent); border-color: var(--accent); }
.pickrow:not(.on) { opacity: .62; }

.empty { text-align: center; padding: 40px 20px; color: var(--muted); grid-column: 1 / -1; }
.empty-ic { font-size: 48px; margin-bottom: 8px; }
.empty b { display: block; color: var(--ink); font-size: 18px; }

.loading { display: grid; place-items: center; min-height: 60vh; }
.spinner { width: 36px; height: 36px; border-radius: 50%; border: 4px solid var(--line); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.spinner.small { width: 22px; height: 22px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.offline { position: fixed; top: calc(env(safe-area-inset-top) + 8px); left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 6px 14px; border-radius: 99px; font-size: 13px; font-weight: 800; z-index: 50; }

/* ============ landing / setup ============ */
.narrow { max-width: 620px; margin: 0 auto; }
.landing { max-width: 520px; margin: 0 auto; text-align: center; padding-top: 4vh; }
.land-jar { width: 150px; margin: 0 auto 8px; animation: float 5s ease-in-out infinite; }
.landing h1 { font-size: clamp(44px, 9vw, 64px); }
.lead { font-size: 19px; color: var(--ink-2); margin: 8px 0 26px; }
.feat { list-style: none; padding: 0; margin: 0 0 28px; display: grid; gap: 10px; text-align: left; }
.feat li { display: flex; gap: 14px; align-items: center; background: var(--surface); padding: 14px 16px; border-radius: var(--r-sm); box-shadow: var(--shadow); }
.feat li > span { font-size: 26px; }
.feat b { display: block; }
.feat small { color: var(--muted); font-size: 14px; }
@keyframes float { 50% { transform: translateY(-8px) rotate(-2deg); } }

.wiz h1 { font-size: clamp(30px, 6vw, 40px); margin: 6px 0 8px; }
.wiz > .muted { margin-bottom: 18px; }
.wiz-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
.wiz-head .back { margin: 0; }
.wiz-steps { display: flex; gap: 6px; }
.wiz-steps span { font-size: 12px; font-weight: 800; padding: 5px 10px; border-radius: 99px; background: var(--surface-2); color: var(--muted); }
.wiz-steps span.on { background: var(--ink); color: var(--bg); }
.wiz-steps span.past { background: var(--soft); color: var(--accent-ink); }
.wiz-kid { margin-bottom: 14px; border-top: 6px solid var(--accent); }
.wk-av { font-size: 44px; width: 72px; height: 72px; display: grid; place-items: center; border-radius: 50%; background: var(--soft); }
.wiz-foot { position: sticky; bottom: 0; padding: 18px 0 calc(env(safe-area-inset-bottom) + 12px); background: linear-gradient(transparent, var(--bg) 35%); margin-top: 18px; }
.wiz.done { text-align: center; }
.wiz.done .card { text-align: left; margin: 18px 0; }
.done-ic { font-size: 64px; }
.fam-code { font-family: ui-monospace, 'SF Mono', Menlo, monospace; font-size: 28px; font-weight: 800; letter-spacing: .1em; margin: 4px 0; }
.fam-code.rc { font-size: 22px; color: var(--accent-ink); }

/* ============ who's here ============ */
.who { text-align: center; padding-top: 6vh; }
.who h1 { font-size: clamp(36px, 7vw, 56px); margin: 6px 0 30px; }
.who-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 18px; }
.who-kid {
  width: min(170px, calc(50% - 9px)); padding: 22px 12px; border-radius: 28px; background: var(--surface); box-shadow: var(--shadow); display: flex; flex-direction: column; align-items: center; gap: 6px;
  animation: rise .5s both; animation-delay: calc(var(--i) * 70ms); transition: transform .15s;
}
.who-kid:active { transform: scale(.96); }
.who-av { width: min(104px, 26vw); height: min(104px, 26vw); border-radius: 50%; display: grid; place-items: center; font-size: 58px; background: var(--soft); box-shadow: 0 0 0 4px var(--surface), 0 0 0 7px var(--accent); margin-bottom: 8px; }
.who-kid b { font-size: 20px; }
.who-kid small { color: var(--muted); font-weight: 800; }
.parent-btn { margin-top: 40px; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } }

/* ============ KID ============ */
.kid { max-width: 1040px; margin: 0 auto; }
.hero {
  position: relative; display: grid; grid-template-columns: auto 1fr; grid-template-areas: "av hi" "stats stats"; gap: 16px 16px; align-items: center;
  padding: 22px; border-radius: 30px; color: #fff; overflow: hidden;
  background:
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--accent) 60%, #ffd29a) 0%, transparent 55%),
    linear-gradient(135deg, color-mix(in srgb, var(--accent) 88%, #2a1640), color-mix(in srgb, var(--accent) 70%, #ff9fb8));
  box-shadow: 0 20px 40px -18px color-mix(in srgb, var(--accent) 80%, #000);
}
.hero::after { content: '✦  ⋆  ✧'; position: absolute; right: 22px; top: 14px; font-size: 18px; letter-spacing: 6px; opacity: .45; }
.hero-av { grid-area: av; width: 78px; height: 78px; border-radius: 50%; display: grid; place-items: center; font-size: 44px; background: rgba(255,255,255,.22); box-shadow: inset 0 0 0 2px rgba(255,255,255,.4); transition: transform .15s; }
.hero-av:active { transform: scale(.94); }
.hero-hi { grid-area: hi; min-width: 0; }
.hero-greet { font-weight: 700; opacity: .9; }
.hero h1 { font-family: var(--display); font-size: clamp(32px, 6vw, 46px); font-weight: 600; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; }
.hero-stats { grid-area: stats; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; background: rgba(255,255,255,.18); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); padding: 12px 16px; border-radius: 20px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.25); }
.stat-ic { grid-row: span 2; font-size: 30px; }
.stat-num { font-family: var(--display); font-size: 32px; font-weight: 700; line-height: 1; }
.stat-lbl { font-size: 13px; font-weight: 800; opacity: .9; }
.stat.streak:not(.on) .stat-ic { filter: grayscale(1); opacity: .6; }
@media (min-width: 720px) {
  .hero { grid-template-columns: auto 1fr auto; grid-template-areas: "av hi stats"; padding: 26px 28px; }
  .hero-stats { grid-template-columns: auto auto; }
  .stat { min-width: 150px; }
}

.kid-body { padding-top: 6px; }
.today-card { display: flex; align-items: center; gap: 20px; background: var(--surface); border-radius: var(--r); padding: 18px 22px; box-shadow: var(--shadow); margin-top: 18px; }
.today-ring { position: relative; flex: none; }
.ring-bg { fill: none; stroke: var(--surface-2); }
.ring-fg { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s cubic-bezier(.2,.8,.2,1); }
.ring-txt { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-txt b { font-family: var(--display); font-size: 30px; }
.ring-txt small { color: var(--muted); font-weight: 800; }
.today-date { color: var(--muted); font-weight: 800; font-size: 14px; }
.today-msg { font-family: var(--display); font-size: 24px; font-weight: 600; margin: 2px 0 8px; }
.today-sub { display: flex; flex-wrap: wrap; gap: 6px; }

.chores { display: grid; gap: 12px; }
@media (min-width: 760px) { .chores { grid-template-columns: 1fr 1fr; } }
.chore {
  display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow);
  animation: rise .45s both; animation-delay: calc(var(--i) * 45ms); transition: opacity .3s, background .3s; min-height: 84px;
}
.chore-ic { width: 56px; height: 56px; border-radius: 18px; background: var(--soft); display: grid; place-items: center; font-size: 30px; flex: none; }
.chore-main { flex: 1; min-width: 0; }
.chore-title { font-weight: 800; font-size: 18px; }
.chore-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-top: 3px; font-size: 14px; font-weight: 800; color: var(--muted); }
.chore-meta .pts { color: var(--accent-ink); }
.chore-meta .wait { color: var(--warn); }
.chore-meta .rej { color: var(--bad); }
.done-btn {
  display: flex; align-items: center; gap: 8px; height: 52px; padding: 0 20px 0 8px; border-radius: 99px; background: var(--accent); color: #fff; font-weight: 900; font-size: 16px; flex: none;
  box-shadow: 0 8px 18px -8px var(--accent); transition: transform .12s;
}
.done-btn:active { transform: scale(.94); }
.done-check { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,.25); display: grid; place-items: center; font-size: 18px; }
.undo-btn { font-weight: 800; font-size: 14px; color: var(--muted); padding: 10px 14px; border-radius: 99px; background: var(--surface-2); flex: none; }
.done-mark { width: 48px; height: 48px; border-radius: 50%; background: var(--good); color: #fff; display: grid; place-items: center; font-size: 22px; font-weight: 900; flex: none; animation: pop .4s; }
.chore.s-done { background: color-mix(in srgb, var(--good) 7%, var(--surface)); }
.chore.s-done .chore-title { color: var(--muted); text-decoration: line-through; text-decoration-color: color-mix(in srgb, var(--good) 50%, transparent); text-decoration-thickness: 2px; }
.chore.s-done .chore-ic { filter: saturate(.4); opacity: .7; }
.chore.s-wait { background: color-mix(in srgb, var(--warn) 6%, var(--surface)); }
.popping { animation: pop .45s; }
@keyframes pop { 0% { transform: scale(1); } 35% { transform: scale(1.12); } 70% { transform: scale(.96); } 100% { transform: scale(1); } }

/* little kids: big picture tiles */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
.tile {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 22px 10px 16px; min-height: 190px;
  background: var(--surface); border-radius: 28px; box-shadow: var(--shadow); text-align: center; cursor: pointer; border: 3px solid transparent;
  animation: rise .45s both; animation-delay: calc(var(--i) * 50ms); transition: transform .12s;
}
.tile:active { transform: scale(.95); }
.tile.s-todo { border-color: var(--soft-2); }
.tile-ic { font-size: 64px; line-height: 1; }
.tile-title { font-weight: 900; font-size: 18px; line-height: 1.2; }
.tile-pts { font-size: 18px; letter-spacing: 2px; }
.tile-times { position: absolute; top: 12px; left: 14px; font-weight: 900; color: var(--muted); }
.say { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; background: var(--surface-2); font-size: 18px; }
.tile-check { position: absolute; inset: 0; display: grid; place-items: center; font-size: 90px; color: var(--good); background: color-mix(in srgb, var(--good) 14%, transparent); border-radius: 25px; font-weight: 900; animation: pop .4s; }
.tile.s-done { cursor: default; }
.tile.s-done .tile-ic, .tile.s-done .tile-title { opacity: .35; }
.tile-wait { position: absolute; top: 10px; left: 12px; font-size: 26px; }
.tile-undo { position: absolute; bottom: 8px; right: 10px; font-size: 13px; font-weight: 800; color: var(--muted); padding: 4px 8px; }
.tile.s-wait { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }

/* age styles */
body.age-little { font-size: 18px; }
body.age-little .hero h1 { font-size: 48px; }
body.age-little .today-msg { font-size: 30px; }
body.age-little .tabbar b { font-size: 14px; }
body.age-teen .hero { background: linear-gradient(135deg, #241c2c, color-mix(in srgb, var(--accent) 55%, #241c2c)); }
body.age-teen .hero::after { content: ''; }
body.age-teen .chore-ic { background: var(--surface-2); border-radius: 14px; width: 48px; height: 48px; font-size: 24px; }
body.age-teen .done-btn { background: var(--ink); color: var(--bg); box-shadow: none; }
body.age-teen .done-check { background: color-mix(in srgb, var(--bg) 20%, transparent); }
body.age-teen .bg-blobs i { opacity: .12; }
body.age-tween .chore { border: 1px solid color-mix(in srgb, var(--accent) 10%, var(--line)); }

/* bottom tab bar */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) + 14px); z-index: 20;
  display: flex; gap: 4px; padding: 6px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 82%, transparent);
  backdrop-filter: blur(16px) saturate(1.4); -webkit-backdrop-filter: blur(16px) saturate(1.4); box-shadow: var(--shadow-lg); border: 1px solid var(--line);
  width: min(560px, calc(100% - 24px));
}
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 8px 4px; border-radius: 99px; color: var(--muted); transition: all .2s; }
.tabbar a span { font-size: 22px; line-height: 1.1; filter: grayscale(.6); transition: filter .2s, transform .2s; }
.tabbar a b { font-size: 12px; font-weight: 800; }
.tabbar a.on { background: var(--soft); color: var(--accent-ink); }
.tabbar a.on span { filter: none; transform: translateY(-1px) scale(1.1); }

/* savings jar */
.jar-card { display: flex; align-items: center; gap: 22px; margin-top: 18px; padding: 20px 24px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.jar-wrap { position: relative; width: 130px; flex: none; }
.jar-svg { width: 100%; display: block; overflow: visible; }
.jar-glass { fill: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.jar-line { fill: none; stroke: color-mix(in srgb, var(--accent) 45%, var(--line)); stroke-width: 4; }
.jar-lid { fill: color-mix(in srgb, var(--accent) 70%, #3a2a44); }
.jar-shine { fill: none; stroke: #fff; stroke-width: 5; stroke-linecap: round; opacity: .55; }
.jar-wave { animation: wave 4s linear infinite; }
@keyframes wave { to { transform: translateX(80px); } }
.jar-star { fill: #fff3b0; font-size: 16px; animation: twinkle 2.4s ease-in-out infinite; animation-delay: var(--d); }
@keyframes twinkle { 50% { opacity: .4; } }
.jar-pct { margin: 6px auto 0; width: max-content; padding: 2px 12px; border-radius: 99px; background: var(--soft); color: var(--accent-ink); text-align: center; font-family: var(--display); font-weight: 700; font-size: 18px; }
.jar-info { flex: 1; min-width: 0; }
.jar-info h2 { font-family: var(--display); font-weight: 600; font-size: 26px; margin: 2px 0 6px; }
.jar-nums { font-weight: 800; color: var(--muted); margin-bottom: 8px; }
.jar-nums b { font-family: var(--display); font-size: 28px; color: var(--ink); }
.jar-info p { margin: 8px 0 12px; font-weight: 700; color: var(--ink-2); }
.jar-card.empty .jar-wrap { width: 100px; opacity: .8; }
@media (max-width: 480px) { .jar-wrap { width: 100px; } .jar-info h2 { font-size: 21px; } }

.rewards { display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
@media (min-width: 900px) { .rewards { grid-template-columns: repeat(4, 1fr); } }
.reward { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); overflow: hidden; display: flex; flex-direction: column; animation: rise .45s both; animation-delay: calc(var(--i) * 40ms); }
.reward.is-goal { box-shadow: 0 0 0 3px var(--accent), var(--shadow); }
.rw-pic { position: relative; aspect-ratio: 4 / 3; background: linear-gradient(160deg, var(--soft), var(--surface-2)); display: grid; place-items: center; }
.rw-pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.pic-emoji { font-size: 58px; filter: drop-shadow(0 6px 10px rgba(0,0,0,.12)); }
.goal-btn { position: absolute; top: 8px; right: 8px; width: 40px; height: 40px; border-radius: 50%; background: color-mix(in srgb, var(--surface) 85%, transparent); font-size: 18px; filter: grayscale(1); opacity: .75; box-shadow: var(--shadow); transition: all .2s; }
.goal-btn.on { filter: none; opacity: 1; background: var(--surface); transform: scale(1.08); }
.rw-tag { position: absolute; left: 8px; top: 8px; font-size: 11px; font-weight: 900; padding: 3px 8px; border-radius: 99px; background: color-mix(in srgb, var(--surface) 85%, transparent); letter-spacing: .02em; }
.rw-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.rw-title { font-weight: 800; line-height: 1.25; flex: 1; }
.rw-cost { font-family: var(--display); font-weight: 700; font-size: 20px; }
.need { font-size: 13px; color: var(--muted); font-weight: 800; }
.reward:not(.can) .rw-pic { filter: saturate(.75); }
.orders { display: grid; gap: 10px; }
.order { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: var(--surface); border-radius: var(--r-sm); box-shadow: var(--shadow); border-left: 5px solid var(--warn); }
.order b { display: block; }
.order small { color: var(--muted); font-weight: 700; }
.order-pic { width: 46px; height: 46px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; overflow: hidden; flex: none; }
.order-pic img { width: 100%; height: 100%; object-fit: cover; }
.order-pic .pic-emoji { font-size: 26px; }
.wish-card { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 22px; padding: 18px 20px; border-radius: var(--r); border: 2px dashed color-mix(in srgb, var(--accent) 35%, var(--line)); background: color-mix(in srgb, var(--accent) 5%, transparent); }
.wish-card p { color: var(--muted); font-size: 14px; }
.wishes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* badges */
.badge-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-top: 18px; padding: 18px 22px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); }
.badge-head h2 { font-family: var(--display); font-weight: 600; font-size: 26px; }
.bh-stats { display: flex; gap: 22px; text-align: center; }
.bh-stats b { display: block; font-family: var(--display); font-size: 26px; }
.bh-stats small { color: var(--muted); font-weight: 800; }
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; margin-top: 16px; }
.badge { padding: 18px 12px; text-align: center; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); animation: rise .45s both; animation-delay: calc(var(--i) * 35ms); }
.badge-ic { width: 70px; height: 70px; margin: 0 auto 8px; border-radius: 50%; display: grid; place-items: center; font-size: 36px; background: var(--surface-2); }
.badge.got .badge-ic { background: radial-gradient(circle at 30% 30%, #fff6d6, color-mix(in srgb, var(--accent) 35%, #ffd27a)); box-shadow: 0 6px 16px -6px var(--accent), inset 0 0 0 3px rgba(255,255,255,.6); }
.badge b { display: block; font-size: 15px; }
.badge small { color: var(--muted); font-weight: 700; font-size: 12px; }
.badge:not(.got) { opacity: .6; }
.badge:not(.got) .badge-ic { font-size: 24px; }

/* history */
.history { margin-top: 10px; }
.hday { font-size: 13px; font-weight: 800; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 20px 4px 8px; }
.hrow { display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: var(--surface); border-bottom: 1px solid var(--line); }
.hday + .hrow { border-radius: var(--r-sm) var(--r-sm) 0 0; }
.hrow:has(+ .hday), .hrow:last-child { border-radius: 0 0 var(--r-sm) var(--r-sm); border-bottom: 0; }
.hday + .hrow:has(+ .hday), .hday + .hrow:last-child { border-radius: var(--r-sm); }
.h-ic { font-size: 22px; width: 32px; text-align: center; }
.hrow small { display: flex; gap: 4px; align-items: center; color: var(--muted); font-weight: 600; }
.plus { color: var(--good); font-weight: 900; white-space: nowrap; }
.minus { color: var(--bad); font-weight: 900; white-space: nowrap; }

/* ============ PIN ============ */
.pin { max-width: 380px; margin: 0 auto; text-align: center; }
.pin .back { display: block; text-align: left; }
.pin-ic { font-size: 44px; margin-top: 2vh; }
.pin h1 { font-size: 34px; margin: 6px 0; }
.dots { display: flex; justify-content: center; gap: 14px; margin: 26px 0; }
.dots i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--muted); transition: all .15s; }
.dots i.on { background: var(--ink); border-color: var(--ink); transform: scale(1.1); }
.dots.shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-10px); } 50% { transform: translateX(10px); } 75% { transform: translateX(-6px); } }
.pad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; max-width: 300px; margin: 0 auto 18px; }
.key { height: 72px; border-radius: 50%; aspect-ratio: 1; margin: 0 auto; background: var(--surface); box-shadow: var(--shadow); font-size: 28px; font-weight: 700; font-family: var(--display); transition: transform .1s, background .1s; }
.key:active { transform: scale(.92); background: var(--surface-2); }
.key.ok { background: var(--ink); color: var(--bg); }

/* ============ PARENT ============ */
.parent { max-width: 920px; margin: 0 auto; }
.p-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 6px 0 16px; }
.p-head h1 { font-size: clamp(28px, 5vw, 38px); }
.pnav { display: flex; gap: 6px; overflow-x: auto; padding: 4px; margin: 0 -4px; scrollbar-width: none; position: sticky; top: 0; z-index: 10; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.pnav::-webkit-scrollbar { display: none; }
.pnav a { flex: none; padding: 10px 16px; border-radius: 99px; font-weight: 800; font-size: 15px; color: var(--ink-2); background: var(--surface); border: 1.5px solid var(--line); display: flex; align-items: center; gap: 6px; }
.pnav a.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pnav a i { font-style: normal; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: 12px; display: grid; place-items: center; }
.glance { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 12px; margin-top: 18px; }
.glance-kid { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); border-left: 5px solid var(--accent); }
.glance-kid b { display: block; }
.glance-kid small { display: block; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.g-av { font-size: 30px; width: 50px; height: 50px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); flex: none; }
.g-pts { font-family: var(--display); font-weight: 700; font-size: 20px; white-space: nowrap; }
.kid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.kcard { background: var(--surface); border-radius: var(--r); box-shadow: var(--shadow); padding: 18px; border-top: 6px solid var(--accent); display: flex; flex-direction: column; gap: 14px; }
.kc-top { display: flex; align-items: center; gap: 12px; }
.kc-top b { display: block; font-size: 20px; }
.kc-top small { color: var(--muted); font-weight: 700; }
.kc-av { font-size: 34px; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); }
.kc-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; text-align: center; background: var(--surface-2); border-radius: var(--r-sm); padding: 10px 6px; }
.kc-stats b { display: block; font-size: 17px; }
.kc-stats small { color: var(--muted); font-weight: 700; font-size: 12px; }
.connect { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; margin-top: 18px; }
.connect h2 { font-family: var(--display); font-weight: 600; font-size: 24px; margin-bottom: 6px; }
.connect p { margin-bottom: 10px; }
.qr { width: 170px; height: 170px; background: #fff; border-radius: 16px; padding: 6px; flex: none; }
.qr svg { width: 100%; height: 100%; display: block; }
.danger-t { color: var(--bad); }
.photo-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.photo-prev { width: 76px; height: 76px; border-radius: 16px; background: var(--surface-2); display: grid; place-items: center; font-size: 28px; overflow: hidden; }
.photo-prev img { width: 100%; height: 100%; object-fit: cover; }
form:has(input[name="repeat"][value="once"]:checked) .only-daily { display: none; }

/* ============ sheets, toasts, confetti ============ */
#sheet:empty { display: none; }
.sheet-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(25, 15, 35, .45); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); animation: fade .2s; }
.sheet {
  position: fixed; z-index: 61; left: 50%; bottom: 0; transform: translateX(-50%); width: min(640px, 100%); max-height: 90dvh; overflow-y: auto; overscroll-behavior: contain;
  background: var(--bg); border-radius: 28px 28px 0 0; padding: 26px 20px calc(env(safe-area-inset-bottom) + 22px); box-shadow: var(--shadow-lg); animation: up .28s cubic-bezier(.2,.9,.3,1);
}
.sheet h2 { font-family: var(--display); font-weight: 600; font-size: 26px; }
.sheet.center { bottom: auto; top: 50%; transform: translate(-50%, -50%); width: min(440px, calc(100% - 32px)); border-radius: 28px; animation: zoom .3s cubic-bezier(.2,.9,.3,1.3); }
@keyframes fade { from { opacity: 0; } }
@keyframes up { from { transform: translate(-50%, 100%); } }
@keyframes zoom { from { opacity: 0; transform: translate(-50%, -50%) scale(.85); } }
@media (min-width: 760px) { .sheet:not(.center) { bottom: auto; top: 50%; transform: translate(-50%, -50%); border-radius: 28px; animation: zoom .25s ease-out; } }
.confirm { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; }
.confirm-pic { width: 120px; height: 120px; border-radius: 28px; background: var(--soft); display: grid; place-items: center; overflow: hidden; }
.confirm-pic img { width: 100%; height: 100%; object-fit: cover; }
.confirm-pic .pic-emoji { font-size: 64px; }
.celebrate { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 8px 0; }
.cel-ic { font-size: 76px; animation: pop .6s; }
.celebrate h2 { font-size: 32px; }
.cel-badges { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; margin: 6px 0 10px; }
.cel-badge { width: 150px; }
.cel-badge b { display: block; font-size: 18px; }
.cel-badge small { color: var(--muted); }
.menu-head { display: flex; align-items: center; gap: 12px; }
.menu-head b { display: block; font-size: 20px; }
.menu-head small { color: var(--muted); }
.menu-av { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; font-size: 32px; background: var(--soft); }
.menu-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--surface); font-weight: 800; text-align: left; width: 100%; box-shadow: var(--shadow); }
.menu-item > span:first-child { font-size: 22px; }

#toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); top: calc(env(safe-area-inset-top) + 14px); display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: calc(100% - 32px); max-width: 460px; }
.toast { background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 16px; font-weight: 800; box-shadow: var(--shadow-lg); animation: drop .35s cubic-bezier(.2,.9,.3,1.3); transition: opacity .4s, transform .4s; text-align: center; }
.toast.good { background: var(--good); color: #fff; }
.toast.warn { background: var(--warn); color: #fff; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.out { opacity: 0; transform: translateY(-10px); }
@keyframes drop { from { opacity: 0; transform: translateY(-16px) scale(.95); } }
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 90; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
