/* Pouch: shared styles for the app and the site. No web fonts, no third-party requests. */
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin.woff2") format("woff2");
  font-weight: 300 700; font-display: swap;
  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;
}
@font-face {
  font-family: "Fredoka";
  src: url("/assets/fonts/fredoka-latin-ext.woff2") format("woff2");
  font-weight: 300 700; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C4, U+2C60-2C7F, U+A720-A7FF;
}
/* Brand: Coin jar (2026-11-14). Teal pouch, marigold coin, cream page. */
:root {
  --bg: #FFF8EC;
  --card: #FFFFFF;
  --sand: #FBF0DC;
  --line: #F1E4CC;
  --ink: #2A2522;
  --ink-2: #6E655C;
  --ink-3: #8A7F73;
  --brand: #2E7C77;
  --brand-ink: #1F5E5B;
  --brand-mist: #E6F0EE;
  --coin: #F2A93B;
  --coin-soft: #F4E7CF;
  --alert: #E8735A;
  --alert-ink: #B4472F;
  --warm: #F6C7A0;
  --sky-ink: #2F6680;
  --focus: #2F6680;
  --on-brand: #FFFFFF;
  --radius: 16px;
  --shadow: 0 1px 2px rgba(42, 37, 34, .05), 0 4px 16px rgba(42, 37, 34, .06);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fredoka", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14201F;
    --card: #1C2B2A;
    --sand: #223433;
    --line: #2E4341;
    --ink: #F6EFE3;
    --ink-2: #CBC1B2;
    --ink-3: #A99E8F;
    --brand: #5FB3AC;
    --brand-ink: #86CCC5;
    --brand-mist: #1F3A38;
    --coin: #F2A93B;
    --coin-soft: #2E4341;
    --alert-ink: #F3A08B;
    --sky-ink: #9CC8DE;
    --focus: #9CC8DE;
    --on-brand: #0E2624;
    --shadow: none;
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 17px;
  line-height: 1.55;
}
a { color: var(--brand-ink); text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; }
h1 { font-size: clamp(1.8rem, 6vw, 2.6rem); font-weight: 800; letter-spacing: -.01em; }
h2 { font-size: 1.35rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0 0 1em; }
small, .muted { color: var(--ink-2); }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- buttons and inputs ---------- */
.btn {
  appearance: none; border: 0; cursor: pointer; font: inherit; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: .4em;
  min-height: 48px; padding: .6em 1.2em; border-radius: 999px;
  background: var(--brand-ink); color: var(--on-brand); text-decoration: none;
}
.btn:hover { filter: brightness(1.06); }
.btn.secondary { background: var(--sand); color: var(--ink); border: 1px solid var(--line); }
.btn.ghost { background: transparent; color: var(--brand-ink); padding-inline: .6em; }
.btn.danger { background: transparent; color: var(--alert-ink); border: 1px solid var(--line); }
.btn.small { min-height: 40px; padding: .35em .9em; font-size: .95rem; }
.btn.wide { width: 100%; }
.icon-btn {
  appearance: none; border: 0; background: transparent; color: var(--ink-2); cursor: pointer;
  width: 44px; height: 44px; border-radius: 999px; font-size: 1.3rem; display: inline-grid; place-items: center;
}
.icon-btn:hover { background: var(--sand); }
label { display: block; font-weight: 700; margin: .9em 0 .3em; }
.hint { font-weight: 400; color: var(--ink-2); font-size: .92rem; }
input[type=text], input[type=search], input:not([type]), input[inputmode], select, textarea {
  width: 100%; font: inherit; color: var(--ink); background: var(--card);
  border: 1.5px solid var(--line); border-radius: 12px; padding: .65em .8em; min-height: 48px;
}
textarea { min-height: 140px; resize: vertical; }
input:focus, select:focus, textarea:focus { border-color: var(--brand); outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 25%, transparent); }
.row { display: flex; gap: .6em; align-items: center; flex-wrap: wrap; }
.row > * { flex: 1 1 auto; }
.chips { display: flex; flex-wrap: wrap; gap: .4em; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .7em;
  border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700;
}
.chip input:checked + span { border-color: var(--brand-ink); background: var(--brand-mist); color: var(--brand-ink); }
.chip input:focus-visible + span { outline: 3px solid var(--focus); outline-offset: 2px; }
.swatch span { width: 44px; padding: 0; }
.swatch input:checked + span { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
.emoji-chip span { font-size: 1.4rem; padding: 0; }

/* ---------- layout ---------- */
.wrap { max-width: 640px; margin: 0 auto; padding: 0 16px; }
.wrap-wide { max-width: 980px; margin: 0 auto; padding: 0 16px; }
.topbar {
  position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px); border-bottom: 1px solid var(--line);
  padding-top: env(safe-area-inset-top);
}
.topbar .inner { display: flex; align-items: center; gap: .5em; min-height: 60px; }
.brand { display: inline-flex; align-items: center; gap: .5em; font-weight: 800; font-size: 1.2rem; color: var(--ink); text-decoration: none; }
.brand img { width: 36px; height: 36px; }
.topbar .spacer { flex: 1; }
main.app-main { padding-top: 16px; padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 16px; margin: 0 0 14px;
}
.card h2 { font-size: 1.1rem; margin-bottom: .6em; }
.card-head { display: flex; align-items: center; gap: .6em; justify-content: space-between; margin-bottom: .4em; }
.card-head h2 { margin: 0; }
.today { font-weight: 700; color: var(--ink-2); margin: 0 0 12px; }
.banner {
  border-radius: var(--radius); padding: 14px 16px; margin: 0 0 14px; background: var(--brand-mist);
  border: 1px solid color-mix(in srgb, var(--brand) 35%, transparent);
}
.banner.warn { background: color-mix(in srgb, var(--warm) 30%, var(--card)); border-color: var(--warm); }
.banner p:last-child { margin-bottom: 0; }
.banner .row { margin-top: .6em; }
.empty { text-align: center; padding: 28px 16px; }
.empty img { width: 120px; height: 120px; margin-bottom: 12px; }

/* ---------- kid card ---------- */
.avatar {
  --c: var(--brand-ink);
  width: 52px; height: 52px; flex: 0 0 52px; border-radius: 18px; display: grid; place-items: center;
  font-size: 1.7rem; background: color-mix(in srgb, var(--c) 18%, var(--card)); border: 2px solid color-mix(in srgb, var(--c) 45%, transparent);
}
.avatar.big { width: 72px; height: 72px; flex-basis: 72px; font-size: 2.3rem; border-radius: 24px; }
.kid-head { display: flex; align-items: center; gap: 12px; }
.kid-head .who { flex: 1; min-width: 0; }
.kid-head .name { display: block; font-weight: 800; font-size: 1.2rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kid-head .balance-label { display: block; }
.kid-head a.name { color: var(--ink); text-decoration: none; display: block; }
.balance { font-weight: 800; font-size: 1.5rem; font-variant-numeric: tabular-nums; }
.balance.neg { color: var(--alert-ink); }
.balance-label { font-size: .85rem; color: var(--ink-2); font-weight: 700; }
.big-balance { text-align: center; margin: 8px 0 14px; }
.big-balance .balance { font-size: 2.6rem; }
.goal { margin-top: 12px; }
.goal .bar { height: 12px; border-radius: 999px; background: var(--coin-soft); overflow: hidden; }
.goal .fill { height: 100%; background: var(--coin); border-radius: 999px; }
.goal .meta { display: flex; justify-content: space-between; font-size: .9rem; color: var(--ink-2); margin-top: 4px; gap: 1em; }

/* ---------- chores ---------- */
.chores { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; }
.chore {
  display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; font: inherit; color: inherit;
  background: var(--sand); border: 1.5px solid transparent; border-radius: 14px; padding: 10px 12px; min-height: 56px; cursor: pointer;
}
.chore .box {
  width: 30px; height: 30px; flex: 0 0 30px; border-radius: 10px; border: 2px solid var(--ink-3);
  display: grid; place-items: center; font-weight: 900; color: transparent; background: var(--card);
}
.chore .title { flex: 1; font-weight: 600; }
.chore .pay { font-weight: 800; color: var(--brand-ink); font-variant-numeric: tabular-nums; font-size: .95rem; }
.chore .freq { display: block; font-size: .8rem; color: var(--ink-2); font-weight: 500; }
.chore[aria-pressed="true"] { background: var(--brand-mist); border-color: color-mix(in srgb, var(--brand) 45%, transparent); }
.chore[aria-pressed="true"] .box { background: var(--brand-ink); border-color: var(--brand-ink); color: var(--on-brand); }
.chore[aria-pressed="true"] .title { text-decoration: line-through; text-decoration-thickness: 2px; color: var(--ink-2); }
.chore-manage { display: flex; align-items: center; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.chore-manage:last-child { border-bottom: 0; }
.chore-manage .title { flex: 1; font-weight: 600; }
.chore-manage .freq { display: block; font-size: .82rem; color: var(--ink-2); font-weight: 500; }

/* ---------- history ---------- */
.history { list-style: none; margin: 0; padding: 0; }
.history li { display: flex; align-items: center; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.history li:last-child { border-bottom: 0; }
.history .ico { width: 32px; text-align: center; font-size: 1.1rem; }
.history .what { flex: 1; min-width: 0; }
.history .what b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .what small { font-size: .82rem; }
.history .amt { font-weight: 800; font-variant-numeric: tabular-nums; }
.history .amt.plus { color: var(--brand-ink); }
.history .amt.minus { color: var(--alert-ink); }

/* ---------- fab, sheet, toast ---------- */
.fab-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; pointer-events: none;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 55%, transparent);
}
.fab-bar .wrap { display: flex; gap: 10px; pointer-events: auto; padding: 0; }
.fab-bar .btn { flex: 1; box-shadow: var(--shadow); }
dialog.sheet {
  border: 0; padding: 0; margin: auto auto 0; width: 100%; max-width: 560px; max-height: 92vh;
  border-radius: 22px 22px 0 0; background: var(--card); color: var(--ink);
}
@media (min-width: 600px) { dialog.sheet { margin: auto; border-radius: 22px; } }
dialog.sheet::backdrop { background: rgba(30, 27, 24, .45); }
dialog.sheet form { padding: 18px 18px calc(18px + env(safe-area-inset-bottom)); }
dialog.sheet .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 1em; }
dialog.sheet .sheet-head h2 { margin: 0; }
dialog.sheet .actions { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }
dialog.sheet .actions .btn { flex: 1 1 140px; }
.check-list { list-style: none; margin: .4em 0 0; padding: 0; display: grid; gap: 6px; }
.check-list label { display: flex; align-items: center; gap: 10px; font-weight: 600; margin: 0; padding: 10px 12px; background: var(--sand); border-radius: 12px; cursor: pointer; }
.check-list input { width: 22px; height: 22px; accent-color: var(--brand-ink); }
.toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: var(--bg); padding: .7em 1.2em; border-radius: 999px; font-weight: 700;
  opacity: 0; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); text-align: center; pointer-events: none;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
@media (prefers-reduced-motion: reduce) { .toast { transition: none; } }

/* ---------- site pages ---------- */
.site-header .inner { min-height: 64px; }
.site-nav { display: flex; gap: .2em; flex-wrap: wrap; }
.site-nav a { color: var(--ink-2); text-decoration: none; font-weight: 700; padding: .4em .6em; border-radius: 999px; font-size: .95rem; }
.site-nav a:hover { background: var(--sand); color: var(--ink); }
.site-nav a.btn, .site-nav a.btn:hover { color: var(--on-brand); background: var(--brand-ink); padding: .35em .9em; }
@media (max-width: 560px) { .site-nav .hide-sm { display: none; } }
.hero { padding: 40px 0 24px; display: grid; gap: 24px; align-items: center; }
@media (min-width: 820px) { .hero { grid-template-columns: 1.15fr .85fr; padding: 64px 0 40px; } }
.hero .lede { font-size: 1.15rem; color: var(--ink-2); max-width: 34em; }
.hero .cta { display: flex; gap: 10px; flex-wrap: wrap; margin: 18px 0 8px; }
.hero-art { justify-self: center; width: min(320px, 80vw); }
.phone {
  border-radius: 34px; border: 10px solid var(--ink); background: var(--bg); padding: 14px 12px; box-shadow: var(--shadow);
}
@media (prefers-color-scheme: dark) { .phone { border-color: #000; } }
.phone .card { padding: 12px; margin-bottom: 10px; }
.phone .chore { min-height: 44px; padding: 8px 10px; cursor: default; }
.phone .chore .box { width: 24px; height: 24px; flex-basis: 24px; }
.section { padding-top: 28px; padding-bottom: 28px; }
.section + .section { border-top: 1px solid var(--line); }
.features { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .features { grid-template-columns: repeat(3, 1fr); } }
.feature { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.feature .ico { font-size: 1.6rem; }
.faq details { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 4px 16px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 12px 0; min-height: 44px; }
.faq details p { margin-top: 0; }
.prose { max-width: 42em; }
.prose h2 { margin-top: 1.4em; }
.prose ul { padding-left: 1.2em; }
.prose li { margin-bottom: .35em; }
.site-footer { border-top: 1px solid var(--line); padding: 28px 0 40px; color: var(--ink-2); font-size: .92rem; }
.site-footer nav { display: flex; flex-wrap: wrap; gap: .4em 1em; margin-bottom: .8em; }
.site-footer a { color: var(--ink-2); }
table.data { width: 100%; border-collapse: collapse; margin: .6em 0 1.2em; font-variant-numeric: tabular-nums; }
table.data th, table.data td { text-align: left; padding: .55em .5em; border-bottom: 1px solid var(--line); }
table.data th { font-size: .9rem; color: var(--ink-2); }
.age-group { margin-bottom: 18px; }
.age-group ul { margin: .3em 0 .8em; }
.calc-out { background: var(--brand-mist); border-radius: var(--radius); padding: 16px; margin-top: 14px; }
.calc-out .num { font-size: 1.8rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.source { font-size: .88rem; color: var(--ink-2); }

/* ---------- printable chore chart ---------- */
#print-area { display: none; }
.pc-sheet { page-break-after: always; break-after: page; padding: 0; color: #222; background: #fff; font-family: var(--font); }
.pc-sheet:last-child { page-break-after: auto; break-after: auto; }
.pc-title { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.pc-title h1 { font-size: 30px; margin: 0; color: #1F5E5B; font-family: var(--font-display); font-weight: 600; }
.pc-title .emoji { font-size: 40px; }
.pc-week { font-size: 15px; color: #444; }
.pc-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.pc-table th, .pc-table td { border: 2px solid #1F5E5B; padding: 6px 8px; font-size: 15px; }
.pc-table th { background: #E6F0EE; font-size: 14px; }
.pc-table th:first-child { width: 30%; text-align: left; }
.pc-table td { height: 46px; }
.pc-table td.chore-name { font-weight: 700; }
.pc-table td.chore-name small { display: block; font-weight: 600; color: #555; font-size: 12px; }
.pc-table td.off { background: repeating-linear-gradient(135deg, #eee 0 6px, #fff 6px 12px); }
.pc-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13px; color: #555; }
.pc-preview { overflow-x: auto; background: #fff; border-radius: var(--radius); padding: 14px; border: 1px solid var(--line); }
@media print {
  @page { size: landscape; margin: 12mm; }
  body { background: #fff; }
  body > *:not(#print-area) { display: none !important; }
  #print-area { display: block !important; }
}
.pc-preview .pc-sheet { min-width: 640px; }

/* display type */
h1, h2, h3, .btn, .brand, .balance, .num, .kid-head .name, .chore .title, .chore .pay, .chip span, .today, .faq summary, .site-nav a, .history .amt, .balance-label, .calc-out .num {
  font-family: var(--font-display);
}
h1, h2, h3, .brand, .kid-head .name { font-weight: 600; letter-spacing: 0; }
.btn { font-weight: 600; }
.balance, .num { font-weight: 600; }
.brand img { border-radius: 0; }
.hero h1 { color: var(--ink); }
.hero h1 .accent { color: var(--brand-ink); }
@media (prefers-color-scheme: dark) {
  .brand img, .empty img { background: #FFF8EC; border-radius: 10px; padding: 3px; }
  .empty img { border-radius: 28px; padding: 14px; }
}
