@font-face {
  font-family: "Bricolage";
  src: url("fonts/bricolage.woff2") format("woff2-variations"), url("fonts/bricolage.woff2") format("woff2");
  font-weight: 200 800;
  font-stretch: 75% 100%;
  font-display: swap;
}

:root {
  --canvas: #ffffff;
  --surface: #f6f5f4;
  --line: #e5e3df;
  --line-2: #d3d1cb;
  --ink: #1a1a1a;
  --charcoal: #37352f;
  --muted: #6b6a66;
  --navy: #1a2a52;
  --navy-2: #24386b;
  --danger: #b42318;
  --k: #7b3ff2;
  --ki: #6528d6;
  --kt: #f1eafe;
  --r-s: 6px;
  --r-m: 10px;
  --r-l: 16px;
  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
}

[hidden] { display: none !important; }
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--charcoal);
  font: 400 16px/1.5 var(--font);
  font-variation-settings: "wdth" 100;
}
h1, h2, h3 { color: var(--ink); margin: 0; line-height: 1.1; }
h2 { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 1rem; font-weight: 650; }
p { margin: 0; }
button, input, select { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 4px; }
svg { display: block; }

.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; z-index: 50; background: var(--canvas); padding: 8px 12px; border: 2px solid var(--navy); }

.wrap { width: 100%; max-width: 1240px; margin-inline: auto; padding-inline: 16px; }
@media (min-width: 768px) { .wrap { padding-inline: 28px; } }

/* top bar */
.top { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-block: 14px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--ink); font-size: 1rem; letter-spacing: -0.01em; }
.brand-mark { width: 22px; height: 22px; fill: #f5b301; stroke: var(--ink); stroke-width: 1.4; stroke-linejoin: round; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 16px; border-radius: var(--r-s);
  border: 1px solid var(--line-2); background: var(--canvas); color: var(--ink);
  font-weight: 600; font-size: 0.95rem; text-decoration: none; cursor: pointer; white-space: nowrap;
}
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn.primary:hover { background: var(--navy-2); }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface); }
.btn.danger { color: var(--danger); border-color: #f1c7c3; background: transparent; }
.btn.wide { width: 100%; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 0.875rem; }
.btn svg { width: 18px; height: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--canvas); cursor: pointer; font-size: 0.9rem; font-weight: 500;
}
.chip:hover { background: var(--surface); }
.chip svg { width: 16px; height: 16px; }
.row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.row.tight { gap: 6px; margin-top: 8px; }
.hint { color: var(--muted); font-size: 0.875rem; }

/* layout */
.layout { display: grid; gap: 28px; padding-bottom: 32px; }
@media (min-width: 1000px) {
  .layout { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; gap: 36px; }
  .side-col { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; padding-right: 4px; }
}
.main-col { min-width: 0; }
.side-col { display: grid; gap: 16px; min-width: 0; }

/* kid tabs */
.kidbar { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 12px; scrollbar-width: none; }
.kidbar::-webkit-scrollbar { display: none; }
.kidtab {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px 0 12px;
  border-radius: 999px; border: 1px solid var(--line-2); background: var(--canvas); cursor: pointer; font-weight: 600; white-space: nowrap; color: var(--ink);
}
.kidtab .dot { width: 14px; height: 14px; border-radius: 50%; background: var(--c); }
.kidtab[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.kidtab.add { border-style: dashed; color: var(--charcoal); font-weight: 500; }
.kidtab.add svg { width: 18px; height: 18px; }

/* the chart */

.chart-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; padding-bottom: 14px; }
.kid-name {
  font-size: clamp(2.6rem, 9vw, 4.6rem); font-weight: 800; letter-spacing: -0.035em; color: var(--ki);
  font-variation-settings: "wdth" 85; line-height: 0.95; overflow-wrap: anywhere;
}
.week { margin-top: 6px; color: var(--muted); font-size: 0.95rem; }
.score { text-align: right; flex: none; }
.score-n { display: block; font-size: clamp(2.2rem, 7vw, 3.4rem); font-weight: 800; color: var(--ink); line-height: 1; font-variant-numeric: tabular-nums; letter-spacing: -0.03em; }
.score-l { display: block; font-size: 0.85rem; color: var(--muted); }
.score-b { display: block; font-size: 0.85rem; color: var(--charcoal); margin-top: 2px; }
.kid-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 14px; }

.grid {
  display: grid; grid-template-columns: minmax(104px, 1.7fr) repeat(7, minmax(34px, 1fr));
  border: 1px solid var(--line-2); border-radius: var(--r-m); overflow: hidden; background: var(--canvas);
}
.grid > * { border-bottom: 1px solid var(--line); border-left: 1px solid var(--line); min-width: 0; }
.grid > .c-name, .grid > .h-blank, .grid > .t-label { border-left: 0; }
.h-day, .h-blank { background: var(--surface); padding: 8px 2px; text-align: center; font-size: 0.8rem; font-weight: 600; color: var(--charcoal); }
.h-day b { display: block; font-size: 0.95rem; color: var(--ink); }
.h-day.today { background: var(--kt); color: var(--ki); }
.h-day.today b { color: var(--ki); }
.c-name { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 10px; }
.c-name .ic { flex: none; width: 30px; height: 30px; border-radius: 8px; display: grid; place-items: center; background: var(--kt); color: var(--ki); }
.c-name .ic svg { width: 18px; height: 18px; }
.c-name .nm { display: block; font-weight: 600; color: var(--ink); font-size: 0.92rem; line-height: 1.2; overflow-wrap: break-word; hyphens: auto; }
.c-name .pt { display: block; font-size: 0.78rem; color: var(--muted); }
.cell { display: grid; place-items: center; min-height: 52px; padding: 0; background: transparent; border-top: 0; border-right: 0; cursor: pointer; }
.cell:hover { background: var(--surface); }
.cell .ring { width: 28px; height: 28px; border-radius: 50%; border: 2px dashed var(--line-2); }
.cell svg { width: 30px; height: 30px; fill: var(--k); stroke: var(--ki); stroke-width: 1.2; stroke-linejoin: round; }
.cell[aria-pressed="true"] { background: var(--kt); }
.cell.today:not([aria-pressed="true"]) .ring { border-color: var(--k); }
.off { background: repeating-linear-gradient(135deg, transparent 0 6px, var(--surface) 6px 9px); min-height: 52px; }
.t-label, .t-day { background: var(--surface); padding: 8px 4px; font-weight: 700; font-size: 0.85rem; text-align: center; color: var(--ink); font-variant-numeric: tabular-nums; border-bottom: 0; }
.t-label { text-align: left; padding-left: 10px; color: var(--charcoal); font-weight: 600; }
.stamp { animation: stamp 0.28s cubic-bezier(.3,1.6,.6,1); }
@keyframes stamp { from { transform: scale(0.3) rotate(-25deg); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }

/* star chart (ages 3 to 6) */
.chart[data-style="stars"] .c-name { flex-direction: column; align-items: flex-start; gap: 4px; padding: 10px; }
.chart[data-style="stars"] .c-name .ic { width: 52px; height: 52px; border-radius: 14px; }
.chart[data-style="stars"] .c-name .ic svg { width: 34px; height: 34px; }
.chart[data-style="stars"] .cell, .chart[data-style="stars"] .off { min-height: 84px; }
.chart[data-style="stars"] .cell .ring { width: 36px; height: 36px; }
.chart[data-style="stars"] .cell svg { width: 40px; height: 40px; }

.empty { border: 1px dashed var(--line-2); border-radius: var(--r-m); padding: 20px; display: grid; gap: 12px; }
.empty h2 { font-size: 1.1rem; }
.empty .presets { margin: 0; }

/* rewards under the chart */
.goals { margin-top: 18px; display: grid; gap: 10px; }
.goals h2 { font-size: 1rem; }
.goal { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.goal .gn { font-weight: 600; color: var(--ink); display: flex; align-items: center; gap: 8px; min-width: 0; }
.goal .gn svg { width: 18px; height: 18px; flex: none; color: var(--ki); }
.goal .gv { font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.bar { grid-column: 1 / -1; height: 10px; border-radius: 999px; background: var(--surface); border: 1px solid var(--line); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--k); border-radius: 999px; }
.goal.ready .gv { color: var(--ki); font-weight: 700; }

/* add child */
.addkid { border: 1px solid var(--line-2); border-radius: var(--r-l); padding: 20px; display: grid; gap: 14px; margin-top: 4px; }
.addkid form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; border: 0; padding: 0; margin: 0; min-width: 0; }
.field > span, .field > legend { font-weight: 600; font-size: 0.9rem; color: var(--ink); padding: 0; margin-bottom: 6px; }
.field.inline { grid-template-columns: auto 1fr; align-items: center; gap: 12px; }
.field.inline > span { margin: 0; }
input[type="text"], input:not([type]), input[type="number"], select {
  width: 100%; min-height: 44px; padding: 8px 12px; border: 1px solid var(--line-2); border-radius: var(--r-s); background: var(--canvas);
}
input:focus, select:focus { border-color: var(--navy); }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatch { position: relative; }
.swatch input { position: absolute; opacity: 0; inset: 0; }
.swatch span { display: block; width: 40px; height: 40px; border-radius: 50%; background: var(--c); border: 3px solid var(--canvas); box-shadow: 0 0 0 1px var(--line-2); cursor: pointer; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--ink); }
.swatch input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 3px; }
.styles { display: grid; gap: 8px; }
@media (min-width: 560px) { .styles { grid-template-columns: 1fr 1fr; } }
.style-opt { display: flex; gap: 10px; align-items: flex-start; padding: 12px; border: 1px solid var(--line-2); border-radius: var(--r-m); cursor: pointer; }
.style-opt:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.style-opt input { margin-top: 4px; accent-color: var(--navy); }
.style-opt b { display: block; color: var(--ink); }
.style-opt small { display: block; color: var(--muted); font-size: 0.85rem; line-height: 1.35; }

/* side panels */
.panel { border-top: 1px solid var(--line); padding-top: 18px; display: grid; gap: 12px; }
@media (min-width: 1000px) { .panel:first-child { border-top: 0; padding-top: 0; } }
.presets { display: flex; flex-wrap: wrap; gap: 6px; }
.list { display: grid; }
.item { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.item:last-child { border-bottom: 0; }
.item .ic { width: 30px; height: 30px; border-radius: 8px; background: var(--surface); display: grid; place-items: center; color: var(--charcoal); }
.item .ic svg { width: 17px; height: 17px; }
.item b { display: block; color: var(--ink); font-weight: 600; font-size: 0.95rem; line-height: 1.25; }
.item small { display: block; color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.icon-btn { width: 40px; height: 40px; display: grid; place-items: center; border: 0; background: transparent; border-radius: var(--r-s); cursor: pointer; color: var(--charcoal); }
.icon-btn:hover { background: var(--surface); }
.icon-btn svg { width: 18px; height: 18px; }
.subform { display: grid; gap: 14px; background: var(--surface); border-radius: var(--r-m); padding: 16px; }
.iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(40px, 1fr)); gap: 6px; }
.iconpick label { position: relative; }
.iconpick input { position: absolute; opacity: 0; inset: 0; }
.iconpick span { display: grid; place-items: center; height: 40px; border-radius: 8px; border: 1px solid var(--line-2); background: var(--canvas); cursor: pointer; }
.iconpick svg { width: 20px; height: 20px; }
.iconpick input:checked + span { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.iconpick input:focus-visible + span { outline: 3px solid var(--navy); outline-offset: 2px; }
.days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.days button { min-height: 40px; border: 1px solid var(--line-2); border-radius: 8px; background: var(--canvas); cursor: pointer; font-weight: 600; font-size: 0.85rem; padding: 0; }
.days button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.who { display: flex; flex-wrap: wrap; gap: 8px; }
.check { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; min-height: 36px; cursor: pointer; }
.check input { width: 18px; height: 18px; accent-color: var(--navy); }
.rewardform { display: grid; grid-template-columns: 1fr 84px auto; gap: 8px; align-items: end; }
.rewardform .field > span { margin-bottom: 0; }
.plan { background: var(--surface); border-radius: var(--r-m); padding: 14px; display: grid; gap: 10px; }
.plan p { font-size: 0.92rem; }
body.pro .plan .btn.primary { display: none; }
.upsell a { color: var(--navy); font-weight: 600; }

.foot { color: var(--muted); font-size: 0.85rem; padding-block: 24px 40px; border-top: 1px solid var(--line); display: grid; gap: 4px; }

.toast {
  position: fixed; left: 50%; top: 14px; transform: translate(-50%, calc(-100% - 24px)); z-index: 40;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: var(--r-s); font-weight: 500; font-size: 0.92rem;
  max-width: calc(100vw - 32px); transition: transform 0.2s ease;
}
.toast.show { transform: translate(-50%, 0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

@media (max-width: 420px) {
  .grid { grid-template-columns: minmax(92px, 1.5fr) repeat(7, minmax(30px, 1fr)); }
  .c-name { padding: 6px 4px 6px 8px; gap: 6px; }
  .c-name .ic { width: 26px; height: 26px; }
  .c-name .nm { font-size: 0.85rem; }
  .cell .ring { width: 22px; height: 22px; }
  .cell svg { width: 26px; height: 26px; }
  .chart[data-style="stars"] .c-name .ic { width: 42px; height: 42px; }
  .chart[data-style="stars"] .c-name .ic svg { width: 28px; height: 28px; }
  .chart[data-style="stars"] .cell .ring { width: 28px; height: 28px; }
  .chart[data-style="stars"] .cell svg { width: 32px; height: 32px; }
  .top .btn { padding: 0 12px; }
  .rewardform { grid-template-columns: 1fr 76px; }
  .rewardform .btn { grid-column: 1 / -1; }
}

/* print: one page per child, black on white */
#print-root { display: none; }
@media print {
  @page { margin: 12mm; }
  html, body { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  body > *:not(#print-root) { display: none !important; }
  #print-root { display: block; color: #000; font-family: var(--font); }
  .sheet { height: 250mm; overflow: hidden; display: flex; flex-direction: column; break-after: page; page-break-after: always; break-inside: avoid; }
  .sheet:last-child { break-after: auto; page-break-after: auto; }
  .s-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; border-bottom: 1.2mm solid #000; padding-bottom: 3mm; margin-bottom: 4mm; }
  .s-name { font-size: 30pt; font-weight: 800; line-height: 1; letter-spacing: -0.02em; margin: 0; color: #000; }
  .s-week { font-size: 11pt; margin-top: 1.5mm; }
  .s-total { border: 0.6mm solid #000; border-radius: 2mm; padding: 2mm 4mm; font-size: 10pt; text-align: center; min-width: 38mm; }
  .s-total b { display: block; height: 9mm; }
  .s-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
  .s-table th, .s-table td { border: 0.35mm solid #000; text-align: center; vertical-align: middle; padding: 0 1mm; height: var(--rh); font-size: var(--fs); }
  .s-table thead th { height: 8mm; font-size: 10pt; font-weight: 700; }
  .s-table .s-chore { text-align: left; padding-left: 2mm; font-weight: 600; }
  .s-chore span { display: flex; align-items: center; gap: 2mm; }
  .s-chore svg { width: var(--is); height: var(--is); flex: none; fill: none; stroke: #000; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
  .s-table td.s-off { background: repeating-linear-gradient(135deg, #fff 0 1.6mm, #cfcfcf 1.6mm 2.1mm); -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .s-box { display: inline-block; width: calc(var(--rh) * 0.55); height: calc(var(--rh) * 0.55); max-width: 9mm; max-height: 9mm; border: 0.4mm solid #000; border-radius: 1mm; }
  .s-star { width: calc(var(--rh) * 0.8); height: calc(var(--rh) * 0.8); max-width: 17mm; max-height: 17mm; display: inline-block; fill: none; stroke: #000; stroke-width: 1; stroke-linejoin: round; }
  .s-table tfoot td { font-weight: 700; height: 9mm; font-size: 10pt; }
  .s-rewards { margin-top: 5mm; }
  .s-rewards h3 { font-size: 12pt; margin: 0 0 2mm; color: #000; }
  .s-rewards ul { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 8mm; }
  .s-rewards li { display: flex; align-items: center; gap: 2.5mm; font-size: 10.5pt; padding: 1.2mm 0; break-inside: avoid; }
  .s-rewards li i { width: 4.5mm; height: 4.5mm; border: 0.4mm solid #000; border-radius: 0.8mm; flex: none; }
  .s-foot { margin-top: auto; display: flex; justify-content: space-between; gap: 8mm; font-size: 10pt; padding-top: 4mm; }
  .s-foot span { flex: 1; border-bottom: 0.3mm solid #000; padding-bottom: 5mm; }
}
.faq { padding-block: 8px 16px; }
.faq h2 { font-size: 1.25rem; margin: 0 0 8px; }
.faq dt { font-weight: 700; margin-top: 12px; }
.faq dd { margin: 4px 0 0; color: var(--muted); font-size: 0.95rem; max-width: 70ch; }
