@font-face {
  font-family: "Fredoka";
  src: url("fonts/fredoka-latin-wght-normal.woff2") format("woff2");
  font-weight: 300 700;
  font-display: swap;
}

:root {
  --paper: #fff6e6;
  --dots: #efdfc2;
  --ink: #2a2240;
  --muted: #6b6280;
  --line: #ecdfc9;
  --card: #ffffff;
  --sun: #ffc83d;
  --sun-deep: #f0a51a;
  --sun-tint: #fff1c7;
  --mint: #1f9e74;
  --mint-tint: #d9f4e8;
  --coral: #ff6a4d;
  --coral-tint: #ffe3dc;
  --blue: #2f86de;
  --blue-tint: #dceafb;
  --violet: #8d5ae6;
  --violet-tint: #ece2fd;
  --radius: 22px;
  --shadow: 4px 4px 0 var(--ink);
  color-scheme: light;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Fredoka", ui-rounded, "Nunito", system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.45;
  color: var(--ink);
  background-color: var(--paper);
  background-image: radial-gradient(var(--dots) 1.5px, transparent 1.6px);
  background-size: 22px 22px;
}

button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; }

.icon {
  width: 1.25em;
  height: 1.25em;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.c-coral { --kid: var(--coral); --kid-tint: var(--coral-tint); }
.c-blue { --kid: var(--blue); --kid-tint: var(--blue-tint); }
.c-violet { --kid: var(--violet); --kid-tint: var(--violet-tint); }

/* Demo bar */
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0 14px;
  padding: 2px 14px;
  background: var(--ink);
  color: var(--paper);
  font-size: 14px;
}
.demo-bar__note { margin: 0; display: flex; align-items: center; gap: 8px; padding: 6px 0; }
.demo-bar__note strong {
  background: var(--sun);
  color: var(--ink);
  border-radius: 999px;
  padding: 1px 10px;
  font-weight: 600;
}
.demo-bar__actions { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.demo-bar__reset, .demo-bar__made {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border: 0;
  background: none;
  color: var(--paper);
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.demo-bar__made { color: var(--sun); }

/* Page */
.shell { max-width: 1180px; margin: 0 auto; padding: 22px 16px 40px; }

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 20px;
}
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 2px;
  font-weight: 600;
  color: var(--muted);
}
.eyebrow .icon { color: var(--sun-deep); }
h1 {
  margin: 0;
  font-size: clamp(44px, 9vw, 72px);
  line-height: 0.95;
  font-weight: 700;
  letter-spacing: -0.02em;
}
.top__week { margin: 8px 0 0; color: var(--muted); font-size: 17px; }
.top__week strong { color: var(--ink); font-weight: 600; }
.payday-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 10px 16px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--sun);
  box-shadow: 3px 3px 0 var(--ink);
  font-weight: 600;
}

.layout { display: flex; flex-direction: column; gap: 20px; }
/* On phones the two columns dissolve so sections can follow the most useful order. */
.col { display: contents; }
.kids { order: 1; }
.kids__hint { order: 2; }
.jobs { order: 3; }
.payday { order: 4; }
.jar { order: 5; }
.week { order: 6; }
.chores { order: 7; }
.history { order: 8; }

.card {
  min-width: 0;
  padding: 18px;
  border: 2.5px solid var(--ink);
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow);
}
.card__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 12px;
  margin-bottom: 14px;
}
.card__head h2, .jobs__head h2, .payday h2, .jar h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 650;
  letter-spacing: -0.01em;
}
.card__head p { margin: 0; color: var(--muted); }

/* Kids */
.kids { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.kid {
  position: relative;
  display: grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
  padding: 12px 12px 14px;
  border: 2.5px solid var(--ink);
  border-radius: 20px;
  background: var(--kid-tint);
  box-shadow: 3px 3px 0 var(--ink);
  text-align: left;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.kid:hover { transform: translate(-1px, -1px); box-shadow: 4px 4px 0 var(--ink); }
.kid--on { background: var(--kid); color: #fff; }
.kid--on .kid__avatar { background: #fff; color: var(--kid); }
.kid--on .kid__meta, .kid--on .kid__name small { color: rgb(255 255 255 / 0.85); }
.kid__avatar {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  margin-bottom: 6px;
  border: 2.5px solid var(--ink);
  border-radius: 50%;
  background: var(--kid);
  color: #fff;
  font-size: 22px;
  font-weight: 700;
}
.kid__name { display: flex; align-items: baseline; gap: 6px; font-size: 18px; font-weight: 600; }
.kid__name small { font-size: 13px; font-weight: 500; color: var(--muted); }
.kid__money { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; line-height: 1.1; }
.kid__meta { display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); }
.kid__meta svg { width: 14px; height: 14px; fill: var(--sun); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.kid__bar {
  width: 100%;
  height: 8px;
  margin-top: 8px;
  border: 2px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  overflow: hidden;
}
.kid__bar span { display: block; height: 100%; background: var(--sun); border-right: 2px solid var(--ink); }
.kid--on .kid__bar { border-color: #fff; }
.kids__hint { margin: -10px 0 0; font-size: 14px; color: var(--muted); }

/* Day picker */
.days { display: flex; gap: 3px; margin-bottom: 16px; }
.day {
  flex: 1 1 0;
  min-width: 44px;
  display: grid;
  justify-items: center;
  gap: 0;
  padding: 6px 0 7px;
  border: 2px solid var(--line);
  border-radius: 16px;
  background: #fff;
  line-height: 1.1;
}
.day__letter { font-size: 13px; font-weight: 600; color: var(--muted); }
.day__num { font-size: 19px; font-weight: 650; }
.day__dots { min-height: 16px; font-size: 11px; color: var(--muted); }
.day__dots svg { width: 16px; height: 16px; fill: var(--sun); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.day--today { border-color: var(--ink); }
.day--today .day__letter { color: var(--ink); }
.day--later { background: #fbf7ef; }
.day--on { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.day--on .day__letter, .day--on .day__dots { color: rgb(255 246 230 / 0.8); }

/* Jobs */
.jobs__head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.jobs__head h2 span { margin-left: 8px; font-size: 16px; font-weight: 500; color: var(--muted); }
.jobs__count {
  margin: 0;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--sun-tint);
  font-weight: 600;
  font-size: 14px;
  white-space: nowrap;
}
.jobs__later { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; color: var(--muted); }
.jobs__group + .jobs__group { margin-top: 10px; }
.jobs__kid { display: flex; align-items: center; gap: 8px; margin: 12px 0 6px; font-weight: 600; }
.jobs__dot { width: 12px; height: 12px; border: 2px solid var(--ink); border-radius: 50%; background: var(--kid); }
.jobs__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.job {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 10px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: background 0.2s ease, border-color 0.2s ease;
}
.job--done { background: var(--kid-tint); border-color: transparent; }
.job__icon {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: none;
  border-radius: 14px;
  background: var(--kid-tint);
  color: var(--ink);
}
.job--done .job__icon { background: #fff; }
.job__icon .icon { width: 22px; height: 22px; }
.job__text { display: grid; min-width: 0; flex: 1; }
.job__title { font-weight: 550; font-size: 17px; line-height: 1.25; }
.job--done .job__title { text-decoration: line-through; text-decoration-thickness: 2px; text-decoration-color: rgb(42 34 64 / 0.35); }
.job__value { font-size: 14px; color: var(--muted); }
.tick {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: none;
}
.tick__ring {
  width: 40px;
  height: 40px;
  border: 3px dashed var(--kid);
  border-radius: 50%;
  background: #fff;
  transition: transform 0.15s ease;
}
.tick:hover .tick__ring { transform: scale(1.06); background: var(--kid-tint); }
.tick:disabled .tick__ring { border-color: var(--line); background: #faf6ee; }
.sticker {
  width: 46px;
  height: 46px;
  transform: rotate(var(--turn, 0deg));
  fill: var(--sun);
  stroke: var(--ink);
  stroke-width: 1.5;
  stroke-linejoin: round;
  filter: drop-shadow(1.5px 1.5px 0 var(--ink));
}
.sticker--pop { animation: pop 0.45s cubic-bezier(0.2, 1.6, 0.4, 1); }
@keyframes pop {
  0% { transform: scale(0.3) rotate(-40deg); }
  70% { transform: scale(1.15) rotate(var(--turn, 0deg)); }
  100% { transform: scale(1) rotate(var(--turn, 0deg)); }
}
.empty { margin: 8px 0 0; color: var(--muted); }

/* Payday */
.payday { background: var(--sun-tint); }
.payday__top { position: relative; display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.payday__top p { margin: 2px 0 0; color: var(--muted); }
.payday__icon {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  flex: none;
  border: 2.5px solid var(--ink);
  border-radius: 18px;
  background: var(--sun);
}
.payday__icon .icon { width: 30px; height: 30px; }
.stamp {
  position: absolute;
  right: 0;
  top: -4px;
  padding: 2px 12px;
  border: 3px solid var(--mint);
  border-radius: 10px;
  color: var(--mint);
  font-size: 20px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transform: rotate(-8deg);
}
.payday__kids { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.payday__kids li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px 8px 8px;
  border: 2px solid var(--ink);
  border-radius: 16px;
  background: #fff;
  font-weight: 550;
}
.payday__kids strong { margin-left: auto; font-size: 19px; font-weight: 650; }
.payday__avatar {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--kid);
  color: #fff;
  font-weight: 700;
}
.payday__since {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin: 14px 2px;
  color: var(--muted);
}
.payday__since strong { font-size: 28px; color: var(--ink); font-weight: 700; letter-spacing: -0.02em; }

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 18px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  font-weight: 600;
  font-size: 16px;
  box-shadow: 3px 3px 0 var(--ink);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:active:not(:disabled) { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn:disabled { opacity: 0.55; box-shadow: none; }
.btn--sun { width: 100%; background: var(--sun); }
.btn--ink { background: var(--ink); color: var(--paper); box-shadow: 3px 3px 0 var(--sun-deep); }
.btn--danger { background: #fff; color: #b3261e; border-color: #b3261e; box-shadow: none; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.icon-btn:hover { border-color: var(--ink); }
.link-btn {
  min-height: 44px;
  margin-top: 4px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Star jar */
.jar { display: flex; align-items: center; gap: 16px; }
.jar__art { width: 110px; height: 128px; flex: none; }
.jar__lid { fill: var(--coral); stroke: var(--ink); stroke-width: 2.5; }
.jar__fill { fill: var(--sun-tint); }
.jar__star { fill: var(--sun); stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.jar__glass { fill: none; stroke: var(--ink); stroke-width: 3; stroke-linejoin: round; }
.jar__shine { fill: none; stroke: #ffffff; stroke-width: 4; stroke-linecap: round; opacity: 0.9; }
.jar__text p { margin: 4px 0 0; color: var(--muted); }
.jar__text p strong { color: var(--ink); }
.jar__count { font-size: 18px; }
.jar__count strong { font-size: 30px; font-weight: 700; color: var(--ink); }

/* Week grid */
.grid { display: grid; gap: 4px; }
.grid__row { display: grid; grid-template-columns: minmax(0, 1fr) repeat(7, 30px); align-items: center; gap: 3px; }
.grid__row--head { margin-bottom: 2px; }
.grid__label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
}
.grid__text { min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.grid__label .icon { width: 16px; height: 16px; color: var(--kid); stroke-width: 2.4; }
.grid__row--head .grid__label { font-size: 13px; color: var(--muted); }
.grid__day {
  display: grid;
  place-items: center;
  height: 26px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 650;
  color: var(--muted);
}
.grid__day--today { background: var(--ink); color: var(--paper); }
.grid__day--pay { box-shadow: inset 0 -3px 0 var(--sun-deep); }
.grid__kid { margin-top: 8px; padding: 2px 0; font-weight: 650; font-size: 15px; color: var(--kid); }
.grid__kid:first-of-type { margin-top: 0; }
.cell { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 9px; }
.cell--missed, .cell--todo { background: #faf6ee; }
.cell .sticker { width: 26px; height: 26px; stroke-width: 1.7; filter: none; }
.cell--done { background: var(--kid-tint); }
.cell--todo::after { content: ""; width: 14px; height: 14px; border: 2px dashed var(--kid); border-radius: 50%; }
.cell--missed::after { content: ""; width: 10px; height: 3px; border-radius: 2px; background: #cdbfa8; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; margin: 14px 0 0; font-size: 13px; color: var(--muted); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend__star { width: 14px; height: 14px; background: var(--sun); clip-path: polygon(50% 0, 61% 35%, 98% 35%, 68% 57%, 79% 91%, 50% 70%, 21% 91%, 32% 57%, 2% 35%, 39% 35%); }
.legend__todo { width: 12px; height: 12px; border: 2px dashed var(--muted); border-radius: 50%; }
.legend__missed { width: 10px; height: 3px; border-radius: 2px; background: #cdbfa8; }

/* History */
.history table { width: 100%; border-collapse: collapse; font-size: 15px; }
.history th, .history td { padding: 8px 4px; text-align: right; border-bottom: 2px dashed var(--line); }
.history th:first-child { text-align: left; }
.history thead th { font-size: 13px; color: var(--kid, var(--muted)); font-weight: 650; border-bottom: 2.5px solid var(--ink); }
.history tbody th { font-weight: 550; }
.history tbody tr:last-child th, .history tbody tr:last-child td { border-bottom: 0; }

/* Chores list */
.chores__kid + .chores__kid { margin-top: 16px; }
.chores__kid h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: 17px; font-weight: 600; }
.chores__kid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.chores__kid li { display: flex; align-items: center; gap: 12px; padding: 6px 6px 6px 8px; border-radius: 16px; background: #fbf7ef; }
.chores__text { display: grid; min-width: 0; flex: 1; }
.chores__text strong { font-weight: 550; }
.chores__text small { font-size: 13px; color: var(--muted); }

/* Make your own */
.own {
  margin-top: 28px;
  padding: 20px;
  border: 2.5px dashed var(--ink);
  border-radius: var(--radius);
  background: rgb(255 255 255 / 0.6);
}
.own__label { margin: 0; font-weight: 650; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; font-size: 13px; }
.own__words { margin: 8px 0; font-size: 21px; font-weight: 550; line-height: 1.3; }
.own__note { margin: 0; color: var(--muted); font-size: 14px; }

/* Dialog and form */
.dialog {
  width: min(560px, calc(100vw - 24px));
  max-height: calc(100dvh - 24px);
  padding: 0;
  border: 2.5px solid var(--ink);
  border-radius: 24px;
  background: #fff;
  color: var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.dialog::backdrop { background: rgb(42 34 64 / 0.5); }
.dialog__body { padding: 18px 18px 20px; }
.dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 8px; }
.dialog__title { margin: 0; font-size: 24px; font-weight: 650; }
.dialog__close {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.dialog__close svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.form { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; margin: 0; padding: 0; border: 0; min-width: 0; }
.field__label { padding: 0; font-weight: 600; }
.field input[type="text"], .field select {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 2.5px solid var(--ink);
  border-radius: 14px;
  background: #fff;
  font-size: 17px;
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; display: inline-flex; }
.chip input, .icon-choice input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
}
.chip span {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: #fff;
  font-weight: 600;
}
.chip input:checked + span { background: var(--kid, var(--sun)); color: #fff; }
.chip--day span { min-width: 56px; justify-content: center; padding: 0 10px; }
.chip--day input:checked + span { background: var(--sun); color: var(--ink); }
.chip input:focus-visible + span, .icon-choice input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 2px; }
.icons { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 8px; }
.icon-choice { position: relative; display: block; }
.icon-choice span {
  display: grid;
  place-items: center;
  height: 48px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff;
}
.icon-choice input:checked + span { border: 2.5px solid var(--ink); background: var(--sun-tint); }
.form__problem { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--coral-tint); font-weight: 550; }
.form__actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }

/* Toast */
.toast-region { position: fixed; left: 0; right: 0; bottom: 18px; display: grid; justify-items: center; pointer-events: none; z-index: 20; }
.toast {
  margin: 0 16px;
  padding: 12px 18px;
  border: 2.5px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 550;
  box-shadow: 3px 3px 0 var(--sun-deep);
  animation: toast-in 0.25s ease;
}
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }

@media (max-width: 979px) {
  .jobs { padding: 14px 12px; }
}

@media (min-width: 980px) {
  .shell { padding: 36px 28px 56px; }
  .layout { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); gap: 24px; align-items: start; }
  .col { display: grid; gap: 24px; align-content: start; min-width: 0; }
  .days { gap: 6px; }
  .kids__hint { margin: -14px 0 0; }
  .kids { gap: 14px; }
  .kid { padding: 16px 16px 18px; }
  .kid__avatar { width: 52px; height: 52px; font-size: 26px; }
  .kid__money { font-size: 30px; }
  .card { padding: 22px; }
  .grid__row { grid-template-columns: minmax(0, 1fr) repeat(7, 34px); gap: 4px; }
  .cell { width: 34px; height: 34px; }
}

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