/* Minute Mission — design system v2: startup-grade, mobile-first, one accent, real type. */
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 500; font-display: swap; src: url("/fonts/outfit-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/outfit-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Outfit"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/outfit-latin-800-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 400; font-display: swap; src: url("/fonts/nunito-sans-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 600; font-display: swap; src: url("/fonts/nunito-sans-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 700; font-display: swap; src: url("/fonts/nunito-sans-latin-700-normal.woff2") format("woff2"); }
@font-face { font-family: "Nunito Sans"; font-style: normal; font-weight: 800; font-display: swap; src: url("/fonts/nunito-sans-latin-800-normal.woff2") format("woff2"); }

:root {
  --font-display: "Outfit", "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-body: "Nunito Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  /* Neutrals: Radix Sand (warm, low-arousal). Text 15.5:1 on --bg. */
  --bg: #f9f9f8;
  --card: #fdfdfc;
  --card-2: #f1f0ef;
  --text: #21201c;
  --muted: #63635e;
  --border: #dad9d6;
  --border-strong: #bcbbb5;
  --control-border: #8d8d86;   /* 3.1:1 on --card — a control identified only by its outline */
  /* Primary: Radix Indigo. Calm, conventional, no collision with success/danger. */
  --primary: #3e63dd;          /* fill  — 5.1:1 on --bg, white label 5.2:1 */
  --primary-2: #3358d4;        /* hover */
  --primary-text: #3a5bc7;     /* on light bg — 5.9:1 */
  --primary-soft: #edf2fe;
  --on-primary: #ffffff;
  --focus: #3e63dd;
  /* Points currency: amber. Small areas only — never a warning here. */
  --star: #ffc53d;
  --star-deep: #9c5c00;        /* 5.0:1 text on --bg */
  --star-soft: #fff7c2;
  /* Success: darkened green so white labels pass AA (4.7:1). */
  --success: #218358;
  --success-text: #218358;
  --success-soft: #e6f6eb;
  --on-success: #ffffff;
  /* Destructive: darkened red, white label 5.2:1. */
  --danger: #ce2c31;
  --danger-text: #ce2c31;
  --danger-soft: #feebec;
  --on-danger: #ffffff;
  --info: #0d74ce;
  --info-soft: #e6f4fe;
  --shadow: 0 1px 2px rgba(33, 32, 28, 0.05), 0 6px 20px rgba(33, 32, 28, 0.06);
  --shadow-lg: 0 20px 60px rgba(33, 32, 28, 0.22);
  --glow: 0 6px 18px rgba(62, 99, 221, 0.28);
  --radius: 18px;
  --radius-sm: 12px;
  --tabbar-h: 66px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #111110;
  --card: #191918;
  --card-2: #222221;
  --text: #eeeeec;
  --muted: #b5b3ad;
  --border: #3b3a37;
  --border-strong: #62605b;
  --control-border: #7c7a73;
  --primary: #3e63dd;
  --primary-2: #5472e4;
  --primary-text: #9eb1ff;
  --primary-soft: #182449;
  --focus: #9eb1ff;
  --star: #ffc53d;
  --star-deep: #ffca16;
  --star-soft: #302008;
  --success: #30a46c;
  --success-text: #3dd68c;
  --success-soft: #132d21;
  --on-success: #0e1512;
  --danger: #e5484d;
  --danger-text: #ff9592;
  --danger-soft: #3b1219;
  --on-danger: #1f1315;
  --info: #70b8ff;
  --info-soft: #0d2847;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.65);
  --glow: 0 6px 18px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  [data-theme="auto"] {
  --bg: #111110;
  --card: #191918;
  --card-2: #222221;
  --text: #eeeeec;
  --muted: #b5b3ad;
  --border: #3b3a37;
  --border-strong: #62605b;
  --control-border: #7c7a73;
  --primary: #3e63dd;
  --primary-2: #5472e4;
  --primary-text: #9eb1ff;
  --primary-soft: #182449;
  --focus: #9eb1ff;
  --star: #ffc53d;
  --star-deep: #ffca16;
  --star-soft: #302008;
  --success: #30a46c;
  --success-text: #3dd68c;
  --success-soft: #132d21;
  --on-success: #0e1512;
  --danger: #e5484d;
  --danger-text: #ff9592;
  --danger-soft: #3b1219;
  --on-danger: #1f1315;
  --info: #70b8ff;
  --info-soft: #0d2847;
  --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 20px 60px rgba(0, 0, 0, 0.65);
  --glow: 0 6px 18px rgba(0, 0, 0, 0.45);
  color-scheme: dark;
  }
    /* brighter tints for the dark surface — all >=8:1 on --card */
    --tab-today: #9eb1ff; --tab-missions: #3dd68c; --tab-rewards: #ffd60a; --tab-family: #d19dff; --tab-settings: #70b8ff;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: contain;
}
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; -webkit-tap-highlight-color: transparent; }
button:focus-visible, a:focus-visible, input:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
a { color: var(--primary-text); text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; font-family: var(--font-display); letter-spacing: -0.01em; text-wrap: balance; }
h1 { font-size: 28px; font-weight: 800; }
h2 { font-size: 20px; font-weight: 700; }
h3 { font-size: 16px; font-weight: 700; }
p { margin: 0; }
.num, .display { font-family: var(--font-display); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.center { text-align: center; }
.hidden { display: none !important; }
.emoji { font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", "Twemoji Mozilla", sans-serif; }
svg.ic { width: 1.25em; height: 1.25em; flex: 0 0 auto; vertical-align: -0.28em; }
.star-ico { width: 1.15em; height: 1.15em; vertical-align: -0.2em; flex: 0 0 auto; filter: drop-shadow(0 1px 1px rgba(160, 90, 0, 0.25)); }

/* App shell: #app is the viewport, .page is the only scroller, the tab bar is a normal flex child pinned
   to the bottom. No position:fixed for chrome — that misbehaves inside embedded previews and with pinch-zoom. */
#app { height: 100%; display: flex; flex-direction: column; overflow: hidden; position: relative; }
body > #app { height: 100dvh; }
.page { scroll-padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px);
  flex: 1 1 auto; min-height: 0; overflow-y: auto; overflow-x: clip; overscroll-behavior: contain; -webkit-overflow-scrolling: touch;
  padding: 0 max(16px, calc((100% - 600px) / 2)) 100px;
}
.page.no-tabs { padding-bottom: 36px; }
/* The Today grid is the one screen that earns a tablet's width — lists stay at 600px
   because a 1000px-wide row is worse to read, not better. */
.page.wide { padding-inline: max(16px, calc((100% - 1000px) / 2)); }
.section { margin-top: 24px; }
.section-title {
  display: flex; align-items: center; gap: 8px; margin: 0 4px 10px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted);
}
.stack > * + * { margin-top: 10px; }
.row { display: flex; align-items: center; gap: 12px; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }

/* ---------- top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  padding: calc(12px + var(--safe-t)) 0 10px;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.kid-switch {
  display: flex; align-items: center; gap: 10px; background: transparent; border: 0; padding: 4px 8px 4px 2px; border-radius: 999px;
  font-family: var(--font-display); font-weight: 800; font-size: 24px; letter-spacing: -0.02em; color: var(--text); text-align: left;
}
.kid-switch:hover { background: var(--card); }
.kid-switch .chev { color: var(--muted); display: grid; }
.kid-switch .chev svg { width: 18px; height: 18px; }
.eyebrow { display: block; font-family: var(--font-body); font-size: 11px; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); margin-bottom: 1px; }
.avatar {
  width: 44px; height: 44px; border-radius: 50%; flex: 0 0 auto; display: grid; place-items: center; font-size: 24px; overflow: hidden;
  background: var(--card-2); border: 2px solid var(--card); box-shadow: var(--shadow);
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar.lg { width: 88px; height: 88px; font-size: 46px; border-width: 3px; }
.avatar.sm { width: 32px; height: 32px; font-size: 18px; }
.star-pill {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px 7px 14px; border-radius: 999px;
  background: var(--card); border: 1px solid var(--border); box-shadow: var(--shadow);
  font-family: var(--font-display); font-weight: 800; font-size: 20px; letter-spacing: -0.01em; color: var(--text); font-variant-numeric: tabular-nums;
  transition: transform 0.2s;
}
.star-pill .star-ico { width: 22px; height: 22px; }
.star-pill.bump { animation: bump 0.5s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes bump { 30% { transform: scale(1.16); } 60% { transform: scale(0.97); } }

/* ---------- day title + week strip ---------- */
.day-title { text-align: center; font-family: var(--font-display); font-size: 19px; font-weight: 500; color: var(--muted); margin: 2px 0 8px; }
.day-title b { font-weight: 800; color: var(--text); }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 0 -4px 14px; }
.day { background: transparent; border: 0; padding: 6px 0 4px; border-radius: 14px; display: flex; flex-direction: column; align-items: center; gap: 6px; color: var(--text); }
.day .wd { font-size: 10.5px; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.day .num { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; font-size: 18px; border: 2px solid transparent; }
.day.selected .num { border-color: var(--primary); }
.day.today .num { background: var(--primary); color: var(--on-primary); box-shadow: var(--glow); }
.day.today .wd { color: var(--primary-text); }
.day .bar { width: 26px; height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; }
.day .bar i { display: block; height: 100%; background: var(--success); width: 0; }
.day .bar.bar-none { opacity: 0.35; }
.day.past.incomplete .bar i { background: var(--star); }
.progress-line { display: flex; align-items: center; gap: 10px; margin: 0 4px 6px; font-size: 13px; font-weight: 700; color: var(--muted); }
.progress-line .track { flex: 1; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.progress-line .track i { display: block; height: 100%; background: var(--primary); border-radius: 3px; transition: width 0.4s ease; }

/* ---------- cards & task rows ---------- */
.card { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; border: 1px solid transparent; }
[data-theme="dark"] .card, .card.flat { border-color: var(--border); }
.card.soft { background: var(--card-2); box-shadow: none; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task {
  display: grid; grid-template-columns: 48px 1fr auto; align-items: center; gap: 10px;
  background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid transparent;
  padding: 10px 14px 10px 8px; min-height: 72px; transition: transform 0.15s, opacity 0.2s;
}
[data-theme="dark"] .task { border-color: var(--border); }
.task.done { opacity: 0.6; }
.task.done .task-name { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--border); text-decoration-thickness: 2px; }
.task:active { transform: scale(0.99); }
.check { width: 48px; height: 48px; border: 0; background: transparent; display: grid; place-items: center; padding: 0; }
.check i {
  width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--border); background: var(--card);
  display: grid; place-items: center; color: transparent; transition: all 0.18s cubic-bezier(0.2, 1.4, 0.4, 1);
}
.check i svg { width: 18px; height: 18px; }
.check:hover i { border-color: var(--success); transform: scale(1.05); }
.check i { border-color: var(--control-border); }
.task.done .check i { background: var(--success); border-color: var(--success); color: var(--on-success); }
.task-main { display: flex; align-items: center; gap: 12px; min-width: 0; background: transparent; border: 0; text-align: left; padding: 0; color: inherit; }
.task-icon { width: 46px; height: 46px; border-radius: 14px; flex: 0 0 auto; display: grid; place-items: center; font-size: 25px; background: var(--card-2); }
.task-name { font-weight: 700; font-size: 16.5px; overflow-wrap: anywhere; line-height: 1.25; }
.task-meta { color: var(--muted); font-size: 12.5px; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 700; background: var(--card-2); color: var(--muted); }
.badge svg { width: 13px; height: 13px; }
.badge.warn { background: var(--star-soft); color: var(--star-deep); }
.badge.danger { background: var(--danger-soft); color: var(--danger-text); }
.badge.ok { background: var(--success-soft); color: var(--success-text); }
.badge.info { background: var(--info-soft); color: var(--info); }
.task-stars { font-family: var(--font-display); font-weight: 800; font-size: 18px; display: flex; align-items: center; gap: 4px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.task-stars .star-ico { width: 20px; height: 20px; }
.tod-head { display: flex; align-items: center; gap: 6px; margin: 20px 4px 8px; color: var(--muted); font-weight: 800; font-size: 11.5px; letter-spacing: 0.1em; text-transform: uppercase; }
.tod-head .ico { font-size: 14px; }

.empty { text-align: center; padding: 44px 16px; color: var(--muted); }
.empty .big { font-size: 56px; margin-bottom: 10px; }
.empty h3 { color: var(--text); margin-bottom: 4px; }
.alldone { text-align: center; padding: 22px 16px; border-radius: var(--radius); margin-bottom: 12px; color: var(--on-primary); background: var(--primary); box-shadow: var(--glow); }
.alldone .big { font-size: 46px; }
.alldone h2 { color: var(--on-primary); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 18px; border-radius: 999px; border: 0;
  font-weight: 800; font-size: 15.5px; background: var(--card-2); color: var(--text); min-height: 48px; transition: transform 0.1s, opacity 0.2s, box-shadow 0.2s;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: default; }
.btn.primary { background: var(--primary); color: var(--on-primary); box-shadow: var(--glow); }
.btn.success { background: var(--success); color: var(--on-success); }
.btn.danger { background: var(--danger-soft); color: var(--danger-text); }
.btn.ghost { background: transparent; color: var(--primary-text); }
.btn.block { width: 100%; }
.btn.sm { padding: 10px 16px; min-height: 44px; font-size: 14px; }
.btn.icon { width: 48px; height: 48px; min-height: 0; padding: 0; border-radius: 50%; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--border); }
.btn.icon svg { width: 20px; height: 20px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > .btn { flex: 1; }
.fab {
  position: absolute; right: max(16px, calc((100% - 600px) / 2 + 16px)); bottom: calc(var(--tabbar-h) + var(--safe-b) + 16px);
  width: 60px; height: 60px; border-radius: 20px; border: 0; background: var(--primary); color: var(--on-primary); box-shadow: var(--glow); z-index: 15;
  display: grid; place-items: center; transition: transform 0.15s;
}
.fab svg { width: 28px; height: 28px; }
.fab:active { transform: scale(0.94) rotate(90deg); }

/* ---------- tab bar ---------- */
.tabbar { flex: 0 0 auto; z-index: 20; background: var(--card); border-top: 1px solid var(--border); padding-bottom: var(--safe-b); }
.tabbar .inner { max-width: 600px; margin: 0 auto; display: flex; height: var(--tabbar-h); }
/* The tab bar is the one thing on screen a parent and a child look at together, so it
   carries real colour rather than a grey row with one blue item. Every hue below is
   >=4.6:1 on --card (safe as a label, not just an icon) and every white-on-hue pairing
   is >=4.6:1, so the active pill passes WCAG 1.4.3 too. */
.tab { flex: 1; border: 0; background: transparent; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: 0.02em; position: relative;
  --tint: #3e63dd; --tint-soft: #edf2fe; --on-tint: #ffffff; }
.tab[data-to="/today"]    { --tint: #3e63dd; --tint-soft: #edf2fe; }
.tab[data-to="/tasks"]    { --tint: #218358; --tint-soft: #e6f6eb; }
.tab[data-to="/rewards"]  { --tint: #9c5c00; --tint-soft: #fff7c2; }
.tab[data-to="/family"]   { --tint: #8347b9; --tint-soft: #f7edfe; }
.tab[data-to="/settings"] { --tint: #0d74ce; --tint-soft: #e6f4fe; }
.tab .ico { width: 46px; height: 30px; border-radius: 15px; display: grid; place-items: center; color: var(--tint);
  background: var(--tint-soft); transition: background .18s ease, color .18s ease, transform .15s ease; }
.tab .ico svg { width: 22px; height: 22px; }
.tab .lbl { transition: color .18s ease; }
/* active: solid colour, white glyph, a small lift — unmistakable from across the table */
.tab.active { color: var(--tint); }
.tab.active .ico { background: var(--tint); color: var(--on-tint); transform: translateY(-1px);
  box-shadow: 0 4px 12px color-mix(in srgb, var(--tint) 42%, transparent); }
.tab:active .ico { transform: scale(0.92); }
@media (prefers-reduced-motion: reduce) { .tab .ico { transition: none; } }
.tab .count { position: absolute; top: 8px; left: calc(50% + 6px); min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--danger); color: var(--on-danger); font-size: 11px; display: grid; place-items: center; border: 2px solid var(--card); box-sizing: content-box; }

/* ---------- forms ---------- */
.form { display: flex; flex-direction: column; gap: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label, .label { font-size: 12px; font-weight: 800; color: var(--muted); letter-spacing: 0.06em; text-transform: uppercase; }
.input, select.input, textarea.input { width: 100%; padding: 13px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--card); color: var(--text); min-height: 50px; outline: none; transition: border-color 0.15s, box-shadow 0.15s; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 4px var(--primary-soft); outline: none; }
textarea.input { min-height: 80px; resize: vertical; }
.hint { font-size: 12.5px; color: var(--muted); }
.error { color: var(--danger-text); font-size: 14px; font-weight: 700; }
.list { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; border: 1px solid transparent; }
[data-theme="dark"] .list { border-color: var(--border); }
.list-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 0; background: transparent; width: 100%; text-align: left; color: inherit; min-height: 62px; }
.list-item + .list-item { border-top: 1px solid var(--border); }
.list-item:hover { background: var(--card-2); }
.list-item .li-icon { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; font-size: 18px; flex: 0 0 auto; background: var(--card-2); }
.list-item .li-icon svg { width: 20px; height: 20px; }
.list-item .li-icon.c1 { background: var(--info-soft); color: var(--info); } .list-item .li-icon.c2 { background: #efe9ff; color: #7c3aed; } .list-item .li-icon.c3 { background: var(--success-soft); color: var(--success-text); }
.list-item .li-icon.c4 { background: var(--primary-soft); color: var(--primary-text); } .list-item .li-icon.c5 { background: var(--danger-soft); color: var(--danger-text); } .list-item .li-icon.c6 { background: var(--star-soft); color: var(--star-deep); }
[data-theme="dark"] .list-item .li-icon.c2 { background: #2b1f52; color: #c4b5fd; }
.list-item .li-title { font-weight: 700; }
.list-item .li-sub { font-size: 13px; color: var(--muted); }
.list-item .li-value { color: var(--muted); margin-left: auto; white-space: nowrap; font-weight: 700; }
.list-item .chev { color: var(--muted); display: grid; }
.list-item .chev svg { width: 18px; height: 18px; }
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button { width: 52px; height: 52px; border-radius: var(--radius-sm); border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); font-size: 26px; font-weight: 300; display: grid; place-items: center; }
.stepper button svg { width: 22px; height: 22px; }
.stepper .val { flex: 1; text-align: center; font-family: var(--font-display); font-weight: 800; font-size: 22px; background: var(--card); border: 1px solid var(--border); border-radius: var(--radius-sm); height: 52px; display: flex; align-items: center; justify-content: center; gap: 6px; box-shadow: var(--shadow); }
.segmented { display: flex; background: var(--card-2); border-radius: var(--radius-sm); padding: 4px; gap: 4px; }
.segmented button { flex: 1; border: 0; background: transparent; padding: 10px 6px; border-radius: 9px; font-weight: 700; color: var(--muted); font-size: 14px; transition: background 0.15s, color 0.15s; }
.segmented button.active { background: var(--card); color: var(--text); box-shadow: var(--shadow); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px 8px 8px; border-radius: 999px; border: 1.5px solid var(--border); background: var(--card); font-weight: 700; font-size: 14px; transition: border-color 0.15s, background 0.15s; }
.chip.active { border-color: var(--primary); background: var(--primary-soft); }
.chip .avatar { width: 26px; height: 26px; font-size: 15px; border: 0; box-shadow: none; }
.chip.day { padding: 8px 0; width: 42px; justify-content: center; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 0; }
.switch-row + .switch-row { border-top: 1px solid var(--border); }
.switch-row .txt { display: flex; flex-direction: column; gap: 2px; }
.switch-row .txt b { font-size: 15.5px; }
.switch { position: relative; width: 52px; height: 30px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: 0.2s; }
.switch span::after { content: ""; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.25); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::after { transform: translateX(22px); }
.icon-pick { display: flex; flex-direction: column; align-items: center; gap: 8px; margin: 4px 0 8px; }
.icon-pick .big-icon { width: 96px; height: 96px; border-radius: 30px; background: var(--card); box-shadow: var(--shadow); border: 1px solid var(--border); display: grid; place-items: center; font-size: 50px; position: relative; }
.icon-pick .big-icon::after { content: ""; position: absolute; right: -4px; bottom: -4px; width: 32px; height: 32px; border-radius: 50%; background: var(--primary); box-shadow: var(--glow); }
.icon-pick .big-icon .pen { position: absolute; right: 2px; bottom: 2px; width: 20px; height: 20px; color: #fff; z-index: 1; }
.emoji-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.emoji-grid button { aspect-ratio: 1; border: 0; background: var(--card-2); border-radius: 12px; font-size: 28px; }
.emoji-grid button.active { background: var(--primary-soft); outline: 2px solid var(--primary); }
.color-dots { display: flex; gap: 10px; flex-wrap: wrap; }
.color-dots button { width: 34px; height: 34px; border-radius: 50%; border: 3px solid transparent; }
.color-dots button.active { border-color: var(--text); }
.photo-preview { width: 100%; max-height: 260px; object-fit: cover; border-radius: var(--radius-sm); display: block; }

/* ---------- rewards ---------- */
.reward-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.reward { background: var(--card); border-radius: var(--radius); box-shadow: var(--shadow); border: 1px solid transparent; padding: 12px; display: flex; flex-direction: column; gap: 8px; align-items: center; text-align: center; position: relative; }
[data-theme="dark"] .reward { border-color: var(--border); }
.reward .r-icon { width: 100%; aspect-ratio: 4/3; border-radius: 14px; background: var(--card-2); display: grid; place-items: center; font-size: 52px; overflow: hidden; }
.reward .r-icon img { width: 100%; height: 100%; object-fit: cover; }
.reward .r-name { font-weight: 800; font-size: 15.5px; overflow-wrap: anywhere; font-family: var(--font-display); }
.reward .r-cost { font-family: var(--font-display); font-weight: 800; display: flex; align-items: center; gap: 4px; }
.reward.locked .r-icon { filter: grayscale(0.7); opacity: 0.65; }
.reward .r-progress { width: 100%; height: 6px; border-radius: 3px; background: var(--border); overflow: hidden; }
.reward .r-progress i { display: block; height: 100%; background: var(--star); border-radius: 3px; }
/* The edit button used to be a muted grey pen sitting on a card whose picture is greyed out
   when the child cannot afford it — it read as disabled, when in fact a grown-up can edit any
   reward at any time. It is a proper button now, at full strength on locked cards too. */
/* z-index matters: the reward picture comes after this button in the DOM, so without it the
   image paints on top — which both dimmed the button (a translucent icon over it) and ate every
   click aimed at it. That, not the points, is why rewards looked uneditable. */
.reward .edit-dot { z-index: 2; position: absolute; top: 8px; right: 8px; height: 28px; padding: 0 10px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); box-shadow: var(--shadow); display: inline-flex; align-items: center; gap: 5px; color: var(--text); font: inherit; font-size: 11.5px; font-weight: 800; cursor: pointer; }
.reward .edit-dot svg { width: 13px; height: 13px; }
.reward .edit-dot:hover, .reward .edit-dot:focus-visible { background: var(--card-2); border-color: var(--primary); color: var(--primary); }
.reward.locked .edit-dot { opacity: 1; filter: none; }

/* ---------- approvals ---------- */
.approval { display: flex; flex-direction: column; gap: 10px; }
.approval .who { display: flex; align-items: center; gap: 10px; font-weight: 700; }

/* ---------- stats ---------- */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stat { background: var(--card); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 8px; text-align: center; border: 1px solid transparent; }
[data-theme="dark"] .stat { border-color: var(--border); }
.stat .v { font-family: var(--font-display); font-size: 24px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11px; color: var(--muted); font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.chart-head { display: flex; justify-content: space-between; align-items: baseline; margin-bottom: 2px; }
.bars { display: flex; align-items: flex-end; gap: 4px; height: 108px; padding: 8px 0 0; }
.bars .b { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 3px; height: 100%;
  justify-content: flex-end; background: none; border: 0; padding: 2px 0 0; cursor: pointer; border-radius: 8px;
  -webkit-tap-highlight-color: transparent; }
.bars .b:hover, .bars .b:focus-visible { background: var(--card-2); }
.bars .b em { font-style: normal; font-size: 10px; font-weight: 800; color: var(--text); font-variant-numeric: tabular-nums;
  line-height: 1; min-height: 10px; }
.bars .b i { display: block; width: 100%; max-width: 22px; border-radius: 6px 6px 3px 3px; background: var(--primary); min-height: 3px; }
.bars .b.zero i { background: var(--border); }
.bars .b.zero em { color: var(--muted); }
.bars .b span { font-size: 10px; color: var(--muted); font-weight: 800; }
.bars .b.is-today i { box-shadow: 0 0 0 2px var(--card), 0 0 0 4px var(--primary); }
.bars .b.is-today span { color: var(--text); }
/* weekends read differently so the rhythm of the week is still visible without letters */
.bars .b.wknd i { opacity: .62; }
.bars .b.wknd span { opacity: .7; }
.ldg-day + .ldg-day { margin-top: 6px; }
.ldg-head { display: flex; align-items: center; gap: 8px; width: 100%; background: var(--card-2); border: 0;
  border-radius: 10px; padding: 7px 8px 7px 10px; margin: 8px 0 2px; font: inherit; font-weight: 800; font-size: 13px;
  color: var(--muted); cursor: pointer; text-align: start; }
.ldg-head .grow { flex: 1; min-width: 0; }
.ldg-head .d { font-variant-numeric: tabular-nums; }
.ldg-head .d.pos { color: var(--success-text); }
.ldg-head .d.neg { color: var(--danger-text); }
.ldg-head .chev { display: inline-flex; opacity: .5; }
.ldg-day:first-child .ldg-head { margin-top: 0; }
.ledger-item { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--border); }
.ledger-item:first-child { border-top: 0; }
.ldg-day .ledger-item:first-child { border-top: 0; }
.ic.tiny { width: 12px; height: 12px; vertical-align: -1px; opacity: .6; }
button.stat { border: 0; font: inherit; cursor: pointer; text-align: center; }
.ledger-item .d { font-family: var(--font-display); font-weight: 800; margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ledger-item .d.pos { color: var(--success-text); }
.ledger-item .d.neg { color: var(--danger-text); }

/* ---------- sheets / dialogs ---------- */
dialog.sheet { border: 0; padding: 0; background: var(--card); color: var(--text); border-radius: 24px 24px 0 0; width: 100%; max-width: 600px; margin: auto auto 0; max-height: 92dvh; box-shadow: var(--shadow-lg); }
dialog.sheet::backdrop { background: rgba(8, 9, 24, 0.5); backdrop-filter: blur(3px); }
dialog.sheet[open] { animation: slideup 0.24s cubic-bezier(0.2, 1, 0.3, 1); }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 640px) { dialog.sheet { border-radius: 24px; margin: auto; } }
.sheet-inner { padding: 12px 18px calc(18px + var(--safe-b)); overflow: auto; max-height: 92dvh; }
.sheet-handle { width: 40px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto 12px; }
.sheet-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 14px; gap: 10px; }
.sheet-head .x { border: 0; background: var(--card-2); width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto; }
.sheet-head .x svg { width: 18px; height: 18px; }
.menu { display: flex; flex-direction: column; }
.menu button { display: flex; align-items: center; gap: 12px; border: 0; background: transparent; padding: 12px 8px; font-size: 17px; font-weight: 700; text-align: left; color: inherit; border-radius: 12px; }
.menu button:hover { background: var(--card-2); }
.menu button.active { color: var(--primary-text); }

/* ---------- celebration ---------- */
.celebrate { position: absolute; inset: 0; z-index: 50; display: grid; place-items: center; text-align: center; background: radial-gradient(circle at 50% 40%, rgba(62, 99, 221, 0.35), rgba(17, 17, 16, 0.86)); color: #fff; animation: fadein 0.2s; cursor: pointer; }
@keyframes fadein { from { opacity: 0; } }
.celebrate .inner { animation: pop 0.5s cubic-bezier(0.2, 1.5, 0.4, 1); text-shadow: 0 4px 24px rgba(0,0,0,0.45); padding: 20px; }
@keyframes pop { from { transform: scale(0.5); opacity: 0; } }
.celebrate .big { font-size: 96px; line-height: 1; }
.celebrate h1 { font-size: 36px; margin-top: 8px; color: #fff; }
.celebrate .plus { font-family: var(--font-display); font-size: 30px; font-weight: 800; color: var(--star); margin-top: 6px; }
.celebrate canvas { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* ---------- timer ---------- */
.timer { text-align: center; padding: 10px 0 6px; }
.timer .clock { font-family: var(--font-display); font-size: 60px; font-weight: 800; font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.timer .ring { width: 200px; height: 200px; margin: 0 auto 10px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--primary) var(--p, 0%), var(--border) 0); }
.timer .ring div { width: 172px; height: 172px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }

/* ---------- toast ---------- */
.toast { position: absolute; left: 50%; display: flex; align-items: center; gap: 14px; bottom: calc(var(--tabbar-h) + var(--safe-b) + 20px); transform: translateX(-50%); background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 999px; font-weight: 700; z-index: 60; box-shadow: var(--shadow-lg); animation: fadein 0.2s; max-width: 90vw; text-align: center; }
.toast.err { background: var(--danger); color: var(--on-danger); }
.toast button { border: 0; background: transparent; color: inherit; font: inherit; font-weight: 800; text-decoration: underline; padding: 6px 2px; min-height: 36px; cursor: pointer; }

/* ---------- auth pages ---------- */
.hero { text-align: center; padding: 44px 0 22px; }
.hero .logo { width: 96px; height: 96px; border-radius: 30px; margin: 0 auto 16px; display: grid; place-items: center; background: var(--primary); box-shadow: var(--glow); }
.hero .logo svg { width: 58px; height: 58px; }
.hero h1 { font-size: 30px; }
.hero .tagline { margin-top: 8px; color: var(--muted); font-size: 16px; }
.wordmark { font-family: var(--font-display); font-weight: 800; letter-spacing: -0.02em; }

/* ---------- kid mode tweaks ---------- */

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

/* ---------- RTL (Arabic) ---------- */
[dir="rtl"] .mirror { transform: scaleX(-1); }
[dir="rtl"] .fab { right: auto; left: max(16px, calc((100% - 600px) / 2 + 16px)); }
[dir="rtl"] .icon-pick .big-icon::after { right: auto; left: -4px; }
[dir="rtl"] .icon-pick .big-icon .pen { right: auto; left: 2px; }
[dir="rtl"] .tab .count { left: auto; right: calc(50% + 6px); }
[dir="rtl"] .task { padding: 10px 8px 10px 14px; }
[dir="rtl"] .reward .edit-dot { right: auto; left: 8px; }
[dir="rtl"] .star-pill { padding: 7px 14px 7px 12px; }

/* ---------- Fluent icon images ---------- */
.micon { width: 1.3em; height: 1.3em; vertical-align: -0.3em; object-fit: contain; user-select: none; }
.micon.inline { width: 1.2em; height: 1.2em; vertical-align: -0.25em; }
.task-icon .micon { width: 30px; height: 30px; }
.li-icon .micon { width: 24px; height: 24px; }
.avatar .micon { width: 68%; height: 68%; }
.avatar.lg .micon { width: 66%; height: 66%; }
.chip .avatar .micon { width: 72%; height: 72%; }
.r-icon .micon { width: 58%; height: 58%; }
.icon-pick .big-icon .micon { width: 60px; height: 60px; }
.emoji-grid .micon { width: 34px; height: 34px; }
.celebrate .big .micon { width: 120px; height: 120px; filter: drop-shadow(0 12px 24px rgba(0,0,0,0.35)); }
.alldone .big .micon { width: 56px; height: 56px; }
.empty .big .micon { width: 64px; height: 64px; }
.star-pill .star-ico, .task-stars .star-ico, .stepper .val .star-ico, .reward .r-cost .star-ico { filter: none; }

.pill-col { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.today-chip { font-size: 12px; font-weight: 800; color: var(--success-text); background: var(--success-soft); padding: 2px 8px; border-radius: 999px; font-family: var(--font-display); }

/* ---------- badges ---------- */
/* Three across on the shelf, always — "first three rows" is a promise about what you can see
   without scrolling, and auto-fill quietly broke it on a wide screen. In the full list a
   collection is six, so six across on anything wide enough lays each set out as one clean row
   instead of five-and-a-straggler. */
.ach-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
@media (min-width: 560px) { .ach-all .ach-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); } }

/* A badge should read as a thing you own, not a row in a table: a round medallion on a
   coloured disc, sitting on a card. The disc is a real element in the flow rather than an
   absolutely-positioned decoration — as a decoration it kept its own size whatever the tile
   did, so on a wide sheet it grew down into the title. Now the column gap is honoured at
   every width, and a narrow tile shrinks the disc instead of crowding the words. */
.ach { container-type: inline-size; position: relative; display: flex; flex-direction: column;
  align-items: center; gap: 9px; padding: 14px 8px 13px; border-radius: var(--radius-sm);
  background: var(--card); border: 1px solid var(--border); text-align: center; overflow: hidden; }
.ach .disc { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  background: var(--card-2); flex: 0 0 auto; }
.ach .disc .micon { width: 36px; height: 36px; }
.ach .ttl { font-size: 11.5px; font-weight: 800; line-height: 1.25; color: var(--muted); overflow-wrap: anywhere; }
.ach u { text-decoration: none; font-size: 10px; font-weight: 800; line-height: 1.3; color: var(--muted); opacity: .8; font-variant-numeric: tabular-nums; }
.ach i { position: absolute; left: 0; bottom: 0; height: 3px; background: var(--primary); border-radius: 0 2px 2px 0; }

/* Tight tiles: the picture gives way, never the words. */
@container (max-width: 104px) {
  .ach { gap: 7px; padding: 12px 5px 11px; }
  .ach .disc { width: 48px; height: 48px; }
  .ach .disc .micon { width: 30px; height: 30px; }
  .ach .ttl { font-size: 10.5px; }
}
@container (max-width: 84px) {
  .ach .disc { width: 40px; height: 40px; }
  .ach .disc .micon { width: 25px; height: 25px; }
  .ach .ttl { font-size: 10px; }
  .ach u { font-size: 9px; }
}

/* locked: the disc stays, the prize is a silhouette */
.ach:not(.on) .micon { filter: grayscale(1) contrast(0.6) brightness(1.12); opacity: .45; }

/* Earned. The first version filled the disc with the set's colour at full strength, which
   drowned the artwork it was meant to frame — a green disc and a green frog and you cannot see
   the frog. The picture is the headline; the colour is only a marker for which set this belongs
   to. So the fill is a pale wash of the hue, the identity is carried by a ring around the rim,
   and the illustration sits on near-white with room to breathe. */
.ach.on { border-color: transparent; box-shadow: var(--shadow); }
.ach.on .ttl { color: var(--text); }
.ach.on .disc {
  background: radial-gradient(circle at 50% 38%, #fff 30%, var(--ach-wash) 100%);
  box-shadow: 0 0 0 2px var(--ach-ring) inset, 0 2px 8px var(--ach-glow);
}
.ach.on .micon { filter: drop-shadow(0 1px 2px rgba(0,0,0,.14)); }
[data-theme="dark"] .ach.on .disc {
  background: radial-gradient(circle at 50% 38%, #f7f5f2 30%, var(--ach-wash) 100%);
}

/* One hue per collection, used at wash strength inside and full strength on the rim only. */
.ach.f-m { --ach-wash: #fdeec9; --ach-ring: #e8a317; --ach-glow: rgba(232,163,23,.28); }  /* trophies */
.ach.f-s { --ach-wash: #d8f3e6; --ach-ring: #1f9e6a; --ach-glow: rgba(31,158,106,.24); }  /* creatures */
.ach.f-c { --ach-wash: #ffe1ec; --ach-ring: #e0518c; --ach-glow: rgba(224,81,140,.24); }  /* sweets */
.ach.f-r { --ach-wash: #e8e0ff; --ach-ring: #7b5cf0; --ach-glow: rgba(123,92,240,.24); }  /* fun fair */
.ach.f-w { --ach-wash: #d9edff; --ach-ring: #2b7fd4; --ach-glow: rgba(43,127,212,.24); }  /* seasons */
.ach.on.f-m i { background: #e8a317; }
.ach.on.f-s i { background: #1f9e6a; }
.ach.on.f-c i { background: #e0518c; }
.ach.on.f-r i { background: #7b5cf0; }
.ach.on.f-w i { background: #2b7fd4; }
.ach-all { max-height: 62vh; overflow-y: auto; }

/* ---------- family today strip (approvals) ---------- */
/* --- Today: one block per child, filling the screen ----------------------- */
.today { display: flex; flex-direction: column; gap: 14px; min-height: 100%; }
/* Cards stretch to share the height, but never past a sane maximum — a card taller than
   this is empty space with a border, which is the thing this screen was fixing. */
/* Cards size to their content, but share any leftover height on a tall screen (up to a
   cap) so the screen never ends in a large void. Content stays centred when stretched. */
.kid-cards { display: grid; gap: 12px; flex: 1 1 auto; min-height: 0; grid-auto-rows: minmax(min-content, 1fr); align-content: stretch; }
.kid-cards.k1, .kid-cards.k2 { grid-template-columns: 1fr; }
.kid-cards.k3, .kid-cards.k4 { grid-template-columns: 1fr 1fr; grid-auto-rows: min-content; flex: 0 0 auto; }
@media (min-width: 900px) { .kid-cards.k3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) { .kid-cards.k2 .kid-card, .kid-cards.k1 .kid-card { max-height: none; } }
@media (min-width: 760px) { .kid-cards.k2 { grid-template-columns: 1fr 1fr; } }
@media (max-width: 359px) { .kid-cards.k3, .kid-cards.k4 { grid-template-columns: 1fr; } }

.kid-card { display: flex; flex-direction: column; gap: 12px; text-align: start; width: 100%;
  /* Share spare height, but stop well short of a card that is mostly padding — on a tall
     screen the leftover belongs at the bottom of the page, not inside the card. */
  justify-content: flex-start; max-height: 340px; padding: 18px 14px 18px 18px; border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--card); box-shadow: var(--shadow); color: inherit; font: inherit; cursor: pointer;
  position: relative; overflow: hidden; transition: border-color .15s ease, transform .12s ease; }
.kid-card::before { content: ''; position: absolute; inset-inline-start: 0; top: 0; bottom: 0; width: 5px; background: var(--kid); }
.kid-card:active { transform: scale(.995); }
.kid-card.complete { background: var(--success-soft); border-color: transparent; }
.kc-head { display: flex; align-items: center; gap: 14px; flex: 0 0 auto; }

.kc-ring { --p: 0%; flex: 0 0 auto; width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--kid) var(--p), var(--border) 0); }
.kc-ring > span { width: 64px; height: 64px; border-radius: 50%; background: var(--card); display: grid; place-items: center; }
.kid-card.complete .kc-ring > span { background: var(--success-soft); }
.kc-ring .avatar { width: 52px; height: 52px; font-size: 28px; }
.kc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kc-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; line-height: 1.15;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-status { color: var(--muted); font-size: 14px; font-weight: 700; }
.kid-card.complete .kc-status { color: var(--success-text); }
.kc-meta { display: flex; align-items: center; gap: 10px; margin-top: 4px; font-weight: 800; font-size: 13.5px; }
.kc-done { color: var(--muted); }
.kc-pts { display: inline-flex; align-items: center; gap: 4px; color: var(--star-deep);
  background: var(--star-soft); padding: 3px 10px; border-radius: 999px; }
.kc-pts svg, .kc-pts img { width: 14px; height: 14px; }
.kc-go { flex: 0 0 auto; color: var(--muted); display: grid; place-items: center; }
.kc-go svg { width: 22px; height: 22px; }

/* the jobs still open today — this is what earns the card its height */
.kc-chips { display: flex; flex-wrap: wrap; gap: 7px; align-content: flex-start; }
.kc-chip { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; background: var(--card-2);
  border-radius: 999px; padding: 6px 12px 6px 8px; font-size: 13.5px; font-weight: 700; color: var(--text); }
.kc-chip > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kc-chip svg, .kc-chip img, .kc-chip .micon { width: 16px; height: 16px; flex: 0 0 auto; }
.kc-chip.more { background: transparent; color: var(--muted); padding-inline-start: 4px; }
.kc-clear { display: flex; align-items: center; gap: 8px; color: var(--success-text); font-weight: 800; font-size: 14.5px; }
.kc-clear svg { width: 18px; height: 18px; }
.kid-card { container-type: inline-size; }
/* A narrow card (three kids on a phone) can't hold a row of avatar + name + pill without
   truncating the name and clipping the pill, so it stacks and centres instead. */
@container (max-width: 258px) {
  .kc-chips { display: none; }
  .kc-go { display: none; }
  .kid-card { align-items: center; padding: 16px 10px; }
  .kc-head { flex-direction: column; gap: 8px; width: 100%; }
  .kc-body { align-items: center; text-align: center; width: 100%; gap: 2px; }
  .kc-name { font-size: 17px; max-width: 100%; }
  .kc-status { font-size: 13px; }
  .kc-meta { justify-content: center; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
  .kc-ring { width: 64px; height: 64px; }
  .kc-ring > span { width: 55px; height: 55px; }
  .kc-ring .avatar { width: 45px; height: 45px; font-size: 25px; }
}
@media (min-width: 620px) { .kid-cards.k1 .kid-card { max-width: 620px; margin: 0 auto; } }

/* ---------- starter missions (after setup) ---------- */
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: 10px; }
.preset { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 6px 10px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--card); color: var(--text); font-size: 12.5px; font-weight: 700; text-align: center; line-height: 1.2; transition: border-color 0.15s, background 0.15s, transform 0.1s; }
.preset .micon { width: 40px; height: 40px; }
.preset small { color: var(--muted); font-weight: 800; display: inline-flex; align-items: center; gap: 3px; }
.preset.on { border-color: var(--primary); background: var(--primary-soft); box-shadow: 0 0 0 3px var(--primary-soft); }
.preset:active { transform: scale(0.97); }

/* ---------- plan & legal ---------- */
.plan { margin-bottom: 12px; }
.plan.current { border: 1.5px solid var(--success); }
.plan.pro { background: linear-gradient(180deg, var(--card), var(--primary-soft)); }
.plan-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.plan-name { font-family: var(--font-display); font-weight: 800; font-size: 20px; }
.plan-price { font-family: var(--font-display); font-weight: 800; font-size: 18px; margin-top: 2px; }
.plan-feats { list-style: none; padding: 0; margin: 12px 0 0; display: flex; flex-direction: column; gap: 6px; font-size: 14.5px; }
.plan-feats li { display: flex; align-items: center; gap: 8px; }
.plan-feats li svg { color: var(--success-text); width: 1.1em; height: 1.1em; flex: 0 0 auto; }
/* a limit, not a feature — muted, with a cross, so it never reads as something included */
.plan-feats li.off { color: var(--muted); }
.plan-feats li.off svg { color: var(--muted); }
.legal { font-size: 14.5px; line-height: 1.55; }
.legal h2 { font-family: var(--font-display); font-size: 22px; margin: 0 0 4px; }
.legal h3 { font-size: 15px; margin: 18px 0 6px; }
.legal p { margin: 0 0 10px; }
.legal ul { padding-left: 20px; margin: 0 0 10px; }
.legal li { margin-bottom: 4px; }
.legal a, .legal-links a { color: var(--primary-text); font-weight: 700; text-decoration: none; }
.legal-links { margin-top: 18px; }

.offers { display: flex; flex-direction: column; gap: 10px; margin-top: 14px; }
.offer { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 14px; border-radius: var(--radius-sm); border: 1.5px solid var(--border); background: var(--card); color: var(--text); text-align: left; transition: border-color 0.15s, box-shadow 0.15s; }
.offer.on { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.offer .radio { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; color: transparent; flex: 0 0 auto; }
.offer .radio svg { width: 15px; height: 15px; }
.offer.on .radio { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.offer b { display: block; font-size: 16px; }
.offer small { color: var(--muted); font-size: 12.5px; }
.offer .price { font-family: var(--font-display); font-weight: 800; font-size: 20px; white-space: nowrap; }
.offer .best { position: absolute; top: -10px; left: 14px; background: var(--success); color: var(--on-success); font-size: 10.5px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; padding: 3px 9px; border-radius: 999px; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .tab { --on-tint: #16150f; }
  :root:not([data-theme="light"]) .tab[data-to="/today"]    { --tint: #9eb1ff; --tint-soft: #1e2136; }
  :root:not([data-theme="light"]) .tab[data-to="/tasks"]    { --tint: #3dd68c; --tint-soft: #0f291d; }
  :root:not([data-theme="light"]) .tab[data-to="/rewards"]  { --tint: #ffd60a; --tint-soft: #2c2100; }
  :root:not([data-theme="light"]) .tab[data-to="/family"]   { --tint: #d19dff; --tint-soft: #2b1a3d; }
  :root:not([data-theme="light"]) .tab[data-to="/settings"] { --tint: #70b8ff; --tint-soft: #0d2847; }
}
:root[data-theme="dark"] .tab { --on-tint: #16150f; }
:root[data-theme="dark"] .tab[data-to="/today"]    { --tint: #9eb1ff; --tint-soft: #1e2136; }
:root[data-theme="dark"] .tab[data-to="/tasks"]    { --tint: #3dd68c; --tint-soft: #0f291d; }
:root[data-theme="dark"] .tab[data-to="/rewards"]  { --tint: #ffd60a; --tint-soft: #2c2100; }
:root[data-theme="dark"] .tab[data-to="/family"]   { --tint: #d19dff; --tint-soft: #2b1a3d; }
:root[data-theme="dark"] .tab[data-to="/settings"] { --tint: #70b8ff; --tint-soft: #0d2847; }

/* Admin: freshly minted codes, shown once. Monospace and selectable, because the next thing
   that happens to them is a paste into a spreadsheet. */
.mint-out { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px; line-height: 1.7;
  background: var(--card-2); border-radius: 10px; padding: 10px 12px; margin: 0 0 10px; overflow-x: auto;
  user-select: all; -webkit-user-select: all; }
