/* Ticket Jar — one stylesheet. A carnival ticket booth, built for small hands:
   touch-first, readable from across the kitchen, colorful without getting noisy. */


/* Fredoka, served from this site rather than Google, so that opening the board
   tells nobody else that a device did. SIL Open Font License 1.1 — the license
   ships beside the files in /fonts/OFL.txt.

   It is a variable font: one file covers 300–700, so all four weights the board
   uses are the same bytes, fetched once. */

@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/fredoka-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Accented names — José, Zoë, Bjørn — without pulling the whole font. */
@font-face {
  font-family: 'Fredoka';
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url('/fonts/fredoka-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --gold: #ffc233;
  --gold-deep: #d18b00;
  --pink: #ff6b9d;
  --grape: #7c5cff;
  --mint: #22c58b;
  --sky: #45b6ef;

  --ink: #3a2b4a;
  --ink-soft: #7d6b8d;
  --paper: #fff8ee;
  --card: #ffffff;
  --line: #ece0f2;
  --red: #e2445c;
  --red-ink: var(--red); /* red words, as opposed to red buttons with white words */
  --link: var(--grape);
  /* Text on the gold buttons, dark in both themes: gold never gets dark. */
  --on-gold: #3a2b4a;

  /* Small tinted surfaces, named for what they are, so the dark theme can
     answer each one rather than leaving a white chip on a dark board. */
  --worth-bg: #fff3d1;
  --worth-ink: var(--gold-deep);
  --cost-bg: #ffe4ec;
  --cost-ink: #c03562;
  --daily-bg: #eef4ff;
  --daily-ink: #4664b0;
  --done-bg: #e7f9f1;
  --waiting-bg: #fffaf0;
  --alert-bg: #ffe4ec;
  --alert-ink: #a12744;
  --code-bg: #f4ecfa;
  --toast-bg: var(--ink);

  /* The page's confetti dots and the warm wash behind them. */
  --dot-a: rgba(124, 92, 255, 0.10);
  --dot-b: rgba(255, 107, 157, 0.10);
  --wash-a: #ffe9c2;
  --wash-b: #ffdfe9;
  --wash-c: #e4f3ff;

  /* Shadows are this color at varying strength. */
  --shade: 70, 45, 95;

  --radius: 20px;
  --tap: 56px; /* every interactive thing is at least this tall */

  /* Chunky, slightly toy-like: a hard offset edge plus a soft ambient shadow. */
  --lift: 0 4px 0 var(--line), 0 12px 26px rgba(var(--shade), 0.09);
  --lift-sm: 0 3px 0 var(--line), 0 8px 18px rgba(var(--shade), 0.08);

  color-scheme: light;
}

/* Night: the same board, by lamplight. js/theme.js sets data-theme: from the
   device's own setting by default, so a tablet that dims for bedtime takes the
   board with it, or from Settings when a grown-up picks one. Only the tokens
   change; every rule below reads them. */
:root[data-theme='dark'] {
  --gold-deep: #b87800;
  --red-ink: #ff6b81;
  --link: #b3a2ff;

  --ink: #f4ecfb;
  --ink-soft: #b9a8cc;
  --paper: #17121f;
  --card: #251d31;
  --line: #3b3049;

  --worth-bg: #3a2f17;
  --worth-ink: #ffcf5c;
  --cost-bg: #432238;
  --cost-ink: #ff9fc2;
  --daily-bg: #1d2944;
  --daily-ink: #a5bfff;
  --done-bg: #173b2f;
  --waiting-bg: #30271a;
  --alert-bg: #4a1f2e;
  --alert-ink: #ffb4c6;
  --code-bg: #352a47;
  --toast-bg: #3e3352;

  --dot-a: rgba(155, 133, 255, 0.10);
  --dot-b: rgba(255, 107, 157, 0.08);
  --wash-a: #2a2014;
  --wash-b: #2b1624;
  --wash-c: #131f2d;

  --shade: 0, 0, 0;

  color-scheme: dark;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  font: 16px/1.5 'Fredoka', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background-color: var(--paper);
  /* Confetti dots over a warm wash of color. */
  background-image:
    radial-gradient(var(--dot-a) 1.6px, transparent 1.7px),
    radial-gradient(var(--dot-b) 1.6px, transparent 1.7px),
    radial-gradient(circle at 10% 0%, var(--wash-a) 0%, transparent 45%),
    radial-gradient(circle at 92% 4%, var(--wash-b) 0%, transparent 42%),
    radial-gradient(circle at 50% 100%, var(--wash-c) 0%, transparent 55%);
  background-size: 34px 34px, 34px 34px, auto, auto, auto;
  background-position: 0 0, 17px 17px, 0 0, 0 0, 0 0;
  background-attachment: fixed;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

h1, h2, h3 { margin: 0; line-height: 1.15; font-weight: 600; }

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
  /* Launched from the Home Screen: a double tap should not zoom the board,
     and a long press should not raise the copy/share callout. */
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

.app {
  max-width: 1040px;
  margin: 0 auto;
  padding: 14px 16px 72px;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
  padding-bottom: calc(72px + env(safe-area-inset-bottom));
}

/* ------------------------------------------------------------ the marquee */

.topbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px 18px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(115deg, #ffb020 0%, #ff7a68 48%, var(--pink) 100%);
  box-shadow: 0 5px 0 rgba(120, 50, 90, 0.16), 0 16px 32px rgba(255, 107, 157, 0.26);
}

.topbar h1 {
  font-size: clamp(23px, 4.6vw, 33px);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-shadow: 0 2px 0 rgba(120, 40, 70, 0.22);
}

.topbar .spacer { flex: 1; }
/* Solid buttons sit on the gradient, so they keep the dark ink; only the
   text-only ones inherit the banner's white. */
.topbar .btn { color: var(--ink); }
.topbar .btn--ghost { color: #fff; }

/* ------------------------------------------------------------------ buttons */

.btn {
  min-height: var(--tap);
  padding: 0 22px;
  border: none;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--lift-sm);
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.btn:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }
.btn--primary { background: var(--gold); color: var(--on-gold); box-shadow: 0 4px 0 var(--gold-deep), 0 10px 20px rgba(209, 139, 0, 0.25); }
.btn--primary:active { box-shadow: 0 0 0 var(--gold-deep); }
.btn--ghost { background: transparent; box-shadow: none; text-decoration: underline; }
.btn--danger { color: var(--red-ink); }
.btn--round { width: var(--tap); padding: 0; font-size: 22px; }
.btn--small { min-height: 44px; padding: 0 16px; font-size: 15px; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }

/* --------------------------------------------------- everyone at a glance */

.kid-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.kid-panel {
  position: relative;
  min-width: 0;
  padding: 10px 12px 12px;
  border: 2px solid var(--accent, var(--line));
  border-radius: 18px;
  background: var(--card);
  /* Tinted with the kid's own color where the browser can mix it. */
  background: linear-gradient(180deg, var(--card) 55%, color-mix(in srgb, var(--accent) 12%, var(--card)) 100%);
  box-shadow: var(--lift);
  box-shadow: 0 3px 0 color-mix(in srgb, var(--accent) 30%, var(--card)), 0 8px 18px rgba(var(--shade), 0.10);
}

/* Tapping a panel shows just that kid; the others fade until it is tapped again. */
.kid-panel { cursor: pointer; transition: opacity 0.15s ease; }
.kid-panel--picked { outline: 3px solid var(--accent); outline-offset: 2px; }
.kid-panel--dim { opacity: 0.45; }

.kid-top { display: flex; align-items: center; gap: 10px; }
.kid-text { min-width: 0; }

.kid-panel .face {
  flex: none;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 2px solid var(--accent, var(--line));
  font-size: 23px;
  line-height: 1;
}

.kid-panel .name {
  overflow: hidden;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kid-panel .count { font-size: 13px; line-height: 1.1; color: var(--ink-soft); font-weight: 500; }

.kid-panel .count strong {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent, var(--ink));
  letter-spacing: -0.02em;
}

/* One line, never wrapping, so a reward going on hold does not push the board down. */
.kid-meta {
  margin-top: 6px;
  overflow: hidden;
  font-size: 12px;
  color: var(--ink-soft);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kid-meta .held:not(:empty)::before { content: ' · '; }

/* What they are saving up for: a bar that fills as the tickets come in. */
.goal { margin-top: 8px; }

.goal-line {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
}

.goal-what { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goal-num { flex: none; font-variant-numeric: tabular-nums; color: var(--ink-soft); }

.goal-track {
  height: 7px;
  margin-top: 4px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, var(--card));
  overflow: hidden;
}

.goal-track i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--accent, var(--gold));
  transition: width 0.4s ease;
}

.badge {
  position: absolute;
  top: -9px;
  right: 10px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  box-shadow: 0 4px 12px rgba(226, 68, 92, 0.4);
}

/* ---------------------------------------------------------------- headings */

/* The kids' board tabs: the parent tab look, with room above for the panels. */
.board-tabs { display: grid; grid-template-columns: repeat(4, auto); margin: 28px 0 0; }
.board-tabs .tab { padding: 0 8px; line-height: 1.15; }
.board-hint { margin: 10px 0 14px; }

.section-head { display: flex; align-items: baseline; gap: 10px; margin: 32px 0 14px; }

.section-head h2 {
  position: relative;
  font-size: 22px;
  font-weight: 700;
  padding-bottom: 3px;
}

/* A highlighter stroke under each section title. */
.section-head h2::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -2px;
  height: 7px;
  border-radius: 999px;
  background: var(--gold);
  opacity: 0.45;
}

.section-head span { color: var(--ink-soft); font-size: 15px; }

/* ----------------------------------------------------------------- matrix */

.matrix { display: flex; flex-direction: column; gap: 10px; }

/* One column for the job, then one per kid — the header and every row share
   the same track list, so the faces line up over the buttons below. */
.matrix-head,
.matrix-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(var(--kids), 56px);
  gap: 10px;
  align-items: center;
}

.matrix-head {
  padding: 0 18px 2px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.matrix-head .col-kid { font-size: 26px; text-align: center; }

.matrix-row {
  padding: 11px 18px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--lift-sm);
  transition: transform 0.1s ease;
}

.matrix-row:hover { transform: translateY(-1px); }
.matrix-row .what { display: flex; align-items: center; gap: 11px; min-width: 0; }
.matrix-row .emoji { font-size: 29px; line-height: 1; }
.matrix-row .label { display: flex; align-items: center; gap: 11px; min-width: 0; }

.matrix-row .title {
  font-weight: 500;
  font-size: 17px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Pinned to the end of the name column at one width, so the amounts on every
   row line up however long the name before them is. */
.matrix-row .worth {
  flex: none;
  min-width: 48px;
  margin-left: auto;
  padding: 3px 10px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-radius: 999px;
  background: var(--worth-bg);
  color: var(--worth-ink);
  font-size: 14px;
  font-weight: 600;
}

.matrix-row .worth--cost { background: var(--cost-bg); color: var(--cost-ink); }

.matrix-row .daily {
  flex: none;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--daily-bg);
  color: var(--daily-ink);
  font-size: 13px;
  font-weight: 500;
}

/* The tap target: a kid presses their own face on the row they mean. */
.claim {
  width: 56px;
  height: 56px;
  border: 3px solid var(--accent, var(--line));
  border-radius: 50%;
  background: var(--card);
  font-size: 26px;
  line-height: 1;
  box-shadow: 0 3px 0 rgba(var(--shade), 0.10);
  transition: transform 0.1s ease, box-shadow 0.1s ease;
}

.claim:active:not(:disabled) { transform: translateY(3px) scale(0.94); box-shadow: none; }
.claim--locked { border-color: var(--line); opacity: 0.32; cursor: not-allowed; box-shadow: none; }

/* Done for today: still legible, clearly finished, and not tappable. */
.claim--done {
  border-color: var(--mint);
  background: var(--done-bg);
  color: var(--mint);
  cursor: default;
  box-shadow: none;
}

/* The reward a kid is saving for: filled in with their own color. */
.claim--picked {
  background: color-mix(in srgb, var(--accent) 22%, var(--card));
  box-shadow: none;
}

/* -------------------------------------------------------------- list rows */

.rows { display: flex; flex-direction: column; gap: 10px; }

.row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--lift-sm);
}

/* History: one collapsible pane per kid. */
.history-pane { margin-bottom: 12px; }
.history-pane summary {
  cursor: pointer;
  padding: 14px 18px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--lift-sm);
  font-size: 18px;
  font-weight: 700;
}
.history-pane summary span { color: var(--ink-soft); font-size: 15px; font-weight: 400; margin-left: 6px; }
.history-pane[open] summary { margin-bottom: 10px; }

.row .emoji { font-size: 27px; }
.row .grow { flex: 1; min-width: 0; }
.row .who { font-weight: 700; }
.row .what { font-size: 16px; }

/* The kids' History tab: rows under a heading for each day. */
.day-head { margin: 18px 0 8px; font-size: 15px; color: var(--ink-soft); }
.day-head:first-child { margin-top: 0; }
.history-row + .history-row { margin-top: 10px; }

/* Which kids a job is for, in the grown-ups' job list. */
.who { display: flex; flex: 1 1 100%; flex-wrap: wrap; gap: 6px 14px; margin: 0; padding: 0; border: 0; font-size: 15px; }
.who legend { padding: 0; font-size: 13px; font-weight: 600; color: var(--ink-soft); }
.who label { display: flex; align-items: center; gap: 6px; }
.who input { width: 20px; height: 20px; accent-color: var(--grape); }
.row .when { font-size: 13px; color: var(--ink-soft); }
.row .amount { font-weight: 700; font-variant-numeric: tabular-nums; font-size: 17px; }
.row .amount.plus { color: var(--mint); }
.row .amount.minus { color: var(--red-ink); }
.row--muted { opacity: 0.55; }

/* Anything waiting on a grown-up wears a torn-ticket edge. */
.row--waiting {
  border-left: 6px dashed var(--gold);
  background: linear-gradient(90deg, var(--waiting-bg), var(--card) 60px);
}

.ok, .no {
  width: 50px;
  height: 50px;
  flex: none;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  color: #fff;
  transition: transform 0.1s ease;
}

.ok { background: var(--mint); box-shadow: 0 4px 0 #148f62; }
.no { background: var(--red); box-shadow: 0 4px 0 #a92f42; }
.ok:active, .no:active { transform: translateY(4px); box-shadow: none; }

.empty {
  padding: 36px 20px;
  border: 3px dashed var(--line);
  border-radius: 24px;
  color: var(--ink-soft);
  text-align: center;
  font-size: 17px;
}

/* --------------------------------------------------------------- parent */

.tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 22px; }

/* ---------------------------------------------------- giving in the moment */

.give-label { margin: 18px 0 8px; font-weight: 700; font-size: 15px; }
.give-label:first-of-type { margin-top: 4px; }
.give-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.give-row + .give-label { margin-top: 20px; }

/* What is picked so far, on buttons that are otherwise the board's own. */
.give-row [aria-pressed="true"] {
  outline: 3px solid var(--gold-deep);
  outline-offset: 3px;
}

.give-row .btn[aria-pressed="true"] { background: var(--gold); color: var(--on-gold); }
.give-row input { min-height: 44px; }
[data-form="give"] .btn--primary { margin-top: 22px; }

.tab {
  min-height: 46px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: var(--card);
  box-shadow: var(--lift-sm);
  font-weight: 500;
}

.tab[aria-selected='true'] {
  background: var(--grape);
  color: #fff;
  box-shadow: 0 4px 0 #5a3fd6;
}

.tab .dot {
  display: inline-block;
  margin-left: 7px;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}

.pinpad { max-width: 320px; margin: 36px auto; text-align: center; }
.pinpad p { font-size: 17px; }
.pin-dots { display: flex; justify-content: center; gap: 14px; margin: 24px 0; }
.pin-dots i { width: 20px; height: 20px; border-radius: 50%; background: var(--line); transition: background 0.15s ease; }
.pin-dots i.on { background: var(--grape); }
.keys { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }

/* Clear of the keypad, and not dressed as another key. */
.pinpad .btn--ghost { margin-top: 26px; color: var(--ink-soft); }

.keys button {
  min-height: 70px;
  border: none;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--lift-sm);
  font-size: 27px;
  font-weight: 600;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
}

.keys button:active { transform: translateY(3px); box-shadow: 0 0 0 var(--line); }

.card { padding: 20px; border-radius: 22px; background: var(--card); box-shadow: var(--lift-sm); }
.card + .card { margin-top: 14px; }
.card h3 { margin-bottom: 14px; font-size: 18px; font-weight: 700; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.field label { font-size: 13px; font-weight: 600; color: var(--ink-soft); }

input[type='text'], input[type='number'], input[type='password'], input[type='email'],
select {
  min-height: var(--tap);
  padding: 0 14px;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  font: inherit;
  color: inherit;
}

input:focus, select:focus, button:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
}

.inline { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.inline .field { flex: 1 1 140px; margin-bottom: 0; }
.inline input[type='text'] { width: 100%; }
.emoji-pick { width: 172px; font-size: 17px; }
.w-num { width: 92px; }

.switch { display: flex; align-items: center; gap: 12px; padding: 12px 0; font-weight: 500; }
.switch input { width: 26px; height: 26px; accent-color: var(--grape); }
/* The same switch, sized to sit in a row of fields rather than own a line. */
.switch--tight { gap: 8px; padding: 0 0 14px; font-size: 15px; white-space: nowrap; }
.hint { margin: 8px 0 0; font-size: 14px; color: var(--ink-soft); }

/* ---------------------------------------------------------------- gate */

.gate { max-width: 400px; margin: 11vh auto 0; text-align: center; }
.gate h1 { font-size: 38px; font-weight: 700; margin-bottom: 8px; }
.gate p { color: var(--ink-soft); }
.gate input { width: 100%; text-align: center; }
.gate .switch { text-align: left; }
.gate .switch input { width: 26px; flex: none; }
.gate .btn { width: 100%; margin-top: 14px; }

.setup { max-width: 520px; margin: 10vh auto 0; }
.setup-kid { flex-wrap: nowrap; align-items: center; margin-bottom: 10px; }
.setup-kid .field { min-width: 0; }
.setup > .btn--primary { margin-top: 14px; }
.setup > .inline:last-child { align-items: center; margin-top: 14px; }
.setup code { padding: 2px 7px; border-radius: 7px; background: var(--code-bg); font-size: 15px; }

/* -------------------------------------------------------- toast, banner */

#toast {
  position: fixed;
  left: 50%;
  bottom: calc(26px + env(safe-area-inset-bottom));
  z-index: 50;
  display: none;
  max-width: 90vw;
  padding: 15px 24px;
  transform: translateX(-50%);
  border-radius: 999px;
  background: var(--toast-bg);
  color: #fff;
  font-weight: 500;
  font-size: 17px;
  box-shadow: 0 10px 30px rgba(58, 43, 74, 0.35);
}

#toast.show { display: block; animation: pop 0.22s ease; }
#toast.bad { background: var(--red); }

.offline {
  padding: 11px 16px;
  margin-bottom: 14px;
  border-radius: 14px;
  background: var(--alert-bg);
  color: var(--alert-ink);
  font-weight: 500;
  text-align: center;
}

@keyframes pop { from { opacity: 0; transform: translate(-50%, 12px); } }

/* ------------------------------------------------------------- confetti */

#confetti { position: fixed; inset: 0; z-index: 40; pointer-events: none; overflow: hidden; }

#confetti i {
  position: absolute;
  top: -14px;
  width: 11px;
  height: 15px;
  border-radius: 2px;
  animation: fall 1.6s linear forwards;
}

@keyframes fall {
  to { transform: translateY(105vh) rotate(620deg); opacity: 0; }
}

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

@media (max-width: 420px) {
  .matrix-head,
  .matrix-row { grid-template-columns: minmax(0, 1fr) repeat(var(--kids), 48px); gap: 6px; }
  .matrix-row { padding: 10px 13px; }
  .claim { width: 48px; height: 48px; font-size: 22px; }
  /* Wrap rather than truncate: a kid has to be able to read the whole job. */
  .matrix-row .title { font-size: 15px; line-height: 1.25; white-space: normal; }
  /* Under the name rather than beside it, so it doesn't squeeze the name. */
  .matrix-row .label { flex-direction: column; align-items: flex-start; gap: 3px; }
  .matrix-row .daily { padding: 1px 8px; font-size: 11px; }
  /* Four kids or more leave a name no room beside the buttons: give it its own
     line, and keep the buttons under the faces in the header. */
  .matrix--many .matrix-row .what { grid-column: 1 / -1; }
  .matrix--many .matrix-row .what + .claim { grid-column-start: 2; }

  /* Five kids or more: one slim row each — face, name, goal, count — so the
     panels don't fill the screen before the first job. */
  .kid-strip--many { grid-template-columns: 1fr; gap: 10px; }

  .kid-strip--many .kid-panel {
    display: grid;
    grid-template-columns: 30px minmax(0, 1fr) auto auto auto;
    grid-template-areas: "face name goal badge count";
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    border-radius: 14px;
  }

  .kid-strip--many .kid-top,
  .kid-strip--many .kid-text { display: contents; }
  .kid-strip--many .face { grid-area: face; width: 30px; height: 30px; font-size: 17px; }
  .kid-strip--many .name { grid-area: name; }
  .kid-strip--many .count { grid-area: count; text-align: right; }
  .kid-strip--many .count strong { font-size: 20px; }
  .kid-strip--many .goal { grid-area: goal; width: 120px; margin-top: 0; }
  .kid-strip--many .goal-track { margin-top: 2px; }
  .kid-strip--many .kid-meta,
  .kid-strip--many .word { display: none; }
  /* In the row, before the count, where it covers nothing. */
  .kid-strip--many .badge { position: static; grid-area: badge; box-shadow: none; }
  .emoji-pick { width: 100%; }
}

/* ------------------------------------------------- privacy and terms pages */

.page { max-width: 46rem; margin: 0 auto; padding: 32px 20px 64px; }
.page h1 { margin-bottom: 4px; }
.page .updated { margin-top: 0; color: var(--ink-soft); font-size: 15px; }
.page h2 { margin-top: 36px; font-size: 20px; }
.page li { margin-bottom: 6px; }
.page .card { padding: 20px 24px; }
.page a { color: var(--link); }
