/* Lesson Ledger – warm, calm "homeschool kitchen table" look.
   Fonts are self-hosted (fonts/). Display font (Fraunces) only for headings, Nunito for everything else. */
@font-face {
  font-family: 'Fraunces';
  font-style: normal;
  font-weight: 600 700;
  font-display: swap;
  src: url(fonts/fraunces-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;
}
@font-face {
  font-family: 'Nunito';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url(fonts/nunito-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;
}

:root {
  --cream: #fbf6ec;
  --oat: #f3ead8;
  --oat-deep: #e9dcc2;
  --card: #fffdf8;
  --ink: #3a2f27;
  --muted: #6b5d52;
  --line: #e6dac4;
  --sage: #5d7f5f;
  --sage-dark: #3c5a40;
  --sage-soft: #e4ecdc;
  --terra: #a94a28;
  --terra-dark: #8e3b1d;
  --terra-soft: #f8e4d6;
  --blue: #4f7592;
  --blue-dark: #274a63;
  --blue-soft: #e3ecf2;
  --gold-soft: #fff1c2;
  --err-bg: #fbe3df;
  --err-ink: #7d231a;
  --warn-bg: #fdecd0;
  --warn-ink: #6e3510;
  --radius: 20px;
  --radius-sm: 14px;
  --shadow: 0 1px 2px rgba(80, 55, 30, .06), 0 8px 24px rgba(80, 55, 30, .08);
  --display: 'Fraunces', 'Iowan Old Style', 'Palatino Linotype', Georgia, serif;
  --body: 'Nunito', system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--cream); color: var(--ink);
  font: 17px/1.55 var(--body);
  background-image: radial-gradient(circle at 0 0, rgba(233, 220, 194, .55) 0, transparent 38%), radial-gradient(circle at 100% 30%, rgba(228, 236, 220, .6) 0, transparent 30%);
  background-repeat: no-repeat;
}
.wrap { max-width: 920px; margin: 0 auto; padding: 0 16px; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; vertical-align: -.25em; flex: none; }
.ic.fill { fill: currentColor; stroke: none; }

/* ---------- header ---------- */
header.site { background: var(--oat); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-top: 10px; padding-bottom: 10px; }
.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--display); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; color: var(--ink); text-decoration: none; }
.logo span { color: var(--terra); font-weight: 600; }
.logo svg { width: 34px; height: 34px; flex: none; }
.tagline { font-size: .86rem; color: var(--muted); font-weight: 700; display: none; }

/* ---------- headings ---------- */
h1, h2, h3.fancy { font-family: var(--display); font-optical-sizing: auto; letter-spacing: -.01em; color: var(--ink); }
h1 { font-size: 2rem; line-height: 1.12; margin: 0 0 12px; font-weight: 700; }
h2 { font-size: 1.5rem; line-height: 1.2; margin: 0 0 12px; font-weight: 700; display: flex; align-items: center; gap: 10px; }
h2 .ic { color: var(--terra); width: 1.1em; height: 1.1em; }
h3 { font-size: 1.08rem; margin: 0 0 6px; font-weight: 800; }
h4 { font-size: 1rem; margin: 14px 0 4px; }
.sub { color: var(--muted); margin: 0 0 18px; font-size: 1.1rem; }

/* ---------- hero ---------- */
.hero { position: relative; padding: 26px 0 8px; }
.hero-grid { display: grid; gap: 22px; }
.kicker { display: inline-flex; align-items: center; gap: 8px; background: var(--sage-soft); color: var(--sage-dark); border-radius: 999px; padding: 4px 14px 4px 10px; font-weight: 800; font-size: .88rem; margin-bottom: 12px; }
.benefits { list-style: none; padding: 0; margin: 0 0 20px; display: grid; gap: 8px; }
.benefits li { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.benefits .dot { width: 30px; height: 30px; border-radius: 50%; background: var(--terra-soft); color: var(--terra-dark); display: inline-grid; place-items: center; flex: none; }
.cta-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.cta-note { font-size: .92rem; color: var(--muted); font-weight: 600; }
.hero-art { position: absolute; right: -10px; top: 6px; width: 120px; height: 120px; opacity: .9; pointer-events: none; }

.example { position: relative; background: var(--card); border: 2px dashed var(--oat-deep); border-radius: 26px; padding: 22px 16px 16px; box-shadow: var(--shadow); }
.ex-tag { position: absolute; top: -14px; left: 18px; background: var(--ink); color: #fff; font-weight: 800; font-size: .8rem; letter-spacing: .04em; text-transform: uppercase; border-radius: 999px; padding: 3px 14px; }
.ex-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-dark); font-family: var(--display); font-weight: 700; display: grid; place-items: center; font-size: 1.15rem; flex: none; }
.ex-head .who { flex: 1; line-height: 1.2; }
.ex-head .who small { color: var(--muted); font-weight: 600; display: block; }
.ex-body { display: flex; gap: 14px; align-items: center; }
.ex-meta { flex: 1; font-size: .95rem; }
.ex-meta p { margin: 0 0 4px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; margin: 12px 0 8px; }
.cal b { font-size: .7rem; text-align: center; color: var(--muted); font-weight: 800; }
.cal i { aspect-ratio: 1; border-radius: 7px; background: var(--oat); display: block; }
.cal i.on { background: var(--sage); }
.cal i.half { background: #a9c2a3; }
.cal i.today { outline: 2px solid var(--terra); outline-offset: 1px; }
.ex-log { list-style: none; padding: 0; margin: 0; font-size: .92rem; border-top: 1px solid var(--line); }
.ex-log li { display: flex; justify-content: space-between; gap: 8px; padding: 6px 0; border-bottom: 1px solid var(--line); }
.ex-foot { margin: 10px 0 0; font-size: .85rem; color: var(--muted); font-weight: 600; }

/* ---------- cards ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 16px; margin-bottom: 18px; box-shadow: var(--shadow); }
label, .lbl { display: block; font-size: .95rem; font-weight: 800; margin-bottom: 4px; color: var(--ink); }
input, select, button, textarea { font: inherit; }
input[type=text], input[type=number], input[type=email], input[type=month], input[type=date], select, textarea {
  width: 100%; min-height: 48px; padding: 9px 14px; border: 2px solid #cdbd9f; border-radius: 14px; background: #fff; color: var(--ink);
}
input:hover, select:hover, textarea:hover { border-color: #b3a07c; }
input:focus-visible, select:focus-visible, button:focus-visible, a:focus-visible, summary:focus-visible, textarea:focus-visible {
  outline: 3px solid #2f5d8a; outline-offset: 2px;
}
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-bottom: 12px; }
.row .full { grid-column: 1 / -1; }
.hint { color: var(--muted); font-size: .92rem; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 10px 22px;
  border-radius: 999px; border: 2px solid var(--terra); background: var(--terra); color: #fff; font-weight: 800; cursor: pointer; text-decoration: none;
  box-shadow: 0 2px 0 rgba(0, 0, 0, .12);
}
.btn:hover { background: var(--terra-dark); border-color: var(--terra-dark); }
.btn:active { transform: translateY(1px); box-shadow: none; }
.btn.secondary { background: #fff; color: var(--sage-dark); border-color: var(--sage); box-shadow: none; }
.btn.secondary:hover { background: var(--sage-soft); }
.btn.big { min-height: 56px; font-size: 1.1rem; padding: 12px 30px; }
.btn.link { border: 0; background: none; color: var(--terra-dark); text-decoration: underline; min-height: 44px; padding: 8px 10px; font-weight: 700; box-shadow: none; }
.btn.link:hover { background: none; color: var(--terra); }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* ---------- messages ---------- */
.msg { border-radius: 14px; padding: 12px 14px; margin: 12px 0; font-weight: 600; }
.msg.err { background: var(--err-bg); color: var(--err-ink); border: 1px solid #e8b9b2; }
.msg.warn { background: var(--warn-bg); color: var(--warn-ink); border: 1px solid #efcf9b; }
.msg.ok { background: var(--sage-soft); color: var(--sage-dark); border: 1px solid #c4d6b8; }
.ph { background: #fff3a3; color: #5c4a00; padding: 0 4px; border-radius: 4px; font-weight: 700; }
.ph-block { border: 2px dashed #d4a800; background: #fffbe0; border-radius: 14px; padding: 12px 14px; margin: 10px 0; color: #5c4a00; }
.extra { border: 2px solid var(--sage); background: linear-gradient(180deg, #fffdf8, #f7f9ef); }

/* ---------- setup ---------- */
.kid-row { display: grid; grid-template-columns: 1fr 120px auto; gap: 8px; align-items: end; margin-bottom: 8px; padding: 10px; border-radius: 16px; background: var(--oat); }
.rule-card { background: var(--blue-soft); border-radius: 16px; padding: 14px 16px; margin: 12px 0; border-left: 6px solid var(--blue); color: #1f3547; }
.rule-card h3 { font-family: var(--display); font-size: 1.2rem; }
.rule-card p { margin: 6px 0; }
.rule-card .hint { color: #3e5567; }
.rule-card .src a { color: var(--blue-dark); font-weight: 800; word-break: break-word; }
.badge-warn { display: inline-block; background: var(--gold-soft); color: #5c4a00; border: 1px solid #e3c866; border-radius: 999px; padding: 0 10px; font-weight: 800; font-size: .82rem; }

/* ---------- logging ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 6px 0 12px; }
.chip { min-height: 48px; min-width: 64px; padding: 6px 16px; border-radius: 999px; border: 2px solid var(--sage); background: #fff; color: var(--sage-dark); font-weight: 800; cursor: pointer; }
.chip:hover { background: var(--sage-soft); }
.chip:active { background: var(--sage); color: #fff; }
.checks { display: flex; flex-wrap: wrap; gap: 4px 12px; }
.checks label { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; min-height: 48px; margin: 0; padding: 0 14px 0 10px; background: var(--oat); border-radius: 999px; }
.checks input { width: 24px; height: 24px; accent-color: var(--sage-dark); }
#mo-checks label { border-radius: 14px; padding: 8px 12px; }

/* ---------- progress ---------- */
.kidcard { padding: 16px; overflow: hidden; }
.kid-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.kid-head .who { flex: 1; min-width: 150px; font-family: var(--display); font-weight: 700; font-size: 1.25rem; line-height: 1.15; }
.kid-head .who small { display: block; font-family: var(--body); font-size: .9rem; color: var(--muted); font-weight: 700; }
.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 800; padding: 4px 12px; border-radius: 999px; font-size: .9rem; }
.status::before { font-weight: 800; }
.status.met { background: #dcecd6; color: #1f4a22; }
.status.met::before { content: '✓'; }
.status.not_met { background: #fbe6cf; color: #6e3510; }
.status.not_met::before { content: '◔'; }
.status.progress { background: var(--blue-soft); color: var(--blue-dark); }
.status.progress::before { content: '◔'; }
.status.behind { background: #fde0c2; color: #6e3510; }
.status.behind::before { content: '▲'; font-size: .8em; }
.status.ok-pill { background: var(--sage-soft); color: var(--sage-dark); }
.status.ok-pill::before { content: '✓'; }
.status.info { background: var(--blue-soft); color: var(--blue-dark); }
.status.info::before { content: 'i'; font-family: var(--display); font-style: italic; }
.kid-top { display: flex; gap: 16px; align-items: center; margin-bottom: 6px; }
.ring { width: 128px; height: 128px; flex: none; }
.ring .track { fill: none; stroke: var(--oat); }
.ring .bar { fill: none; stroke: var(--sage); stroke-linecap: round; transform: rotate(-90deg); transform-origin: 60px 60px; transition: stroke-dashoffset .6s ease; }
.ring.done .bar { stroke: #2f7a3f; }
.ring text { font-family: var(--body); fill: var(--ink); text-anchor: middle; }
.ring .big { font-size: 25px; font-weight: 800; }
.ring .small { font-size: 11px; font-weight: 700; fill: var(--muted); }
.kid-stats { flex: 1; min-width: 0; }
.kid-stats p { margin: 0 0 4px; }
.cheer { display: flex; gap: 10px; align-items: center; background: var(--sage-soft); color: var(--sage-dark); border-radius: 14px; padding: 8px 12px; font-weight: 800; margin: 8px 0; }
.cheer .ic { width: 1.5em; height: 1.5em; color: #c07a1a; }
.cheer.done .ic { color: #2f7a3f; }
.cheer small { display: block; font-weight: 600; color: #46634a; }
.progress-row { margin: 12px 0; }
.progress-row .top { display: flex; justify-content: space-between; gap: 8px; font-size: .96rem; font-weight: 800; }
.pbar { height: 16px; background: var(--oat); border-radius: 8px; overflow: hidden; margin-top: 4px; border: 1px solid var(--line); }
.pbar > span { display: block; height: 100%; background: var(--sage); border-radius: 8px; }
.pbar.done > span { background: #2f7a3f; }
.disclaimer { font-size: .9rem; color: var(--muted); margin-top: 12px; }
#progress > h2 { margin-top: 26px; }

/* ---------- log ---------- */
.month { margin: 20px 0 2px; font-family: var(--display); font-size: 1.15rem; color: var(--terra-dark); }
.monthsum { margin: 0 0 4px; font-size: .92rem; color: var(--muted); font-weight: 700; }
.entry { display: flex; flex-wrap: wrap; gap: 6px 12px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.entry .main { flex: 1; min-width: 200px; }
.entry .dur { font-weight: 800; color: var(--sage-dark); }
.entry .btn { min-height: 40px; padding: 4px 16px; }

/* ---------- misc ---------- */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: 8px 6px; border-bottom: 1px solid var(--line); }
th { font-size: .82rem; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; }
td.num, th.num { text-align: right; white-space: nowrap; }
.tablewrap { overflow-x: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 10px; }
legend { font-weight: 800; font-size: .95rem; padding: 0; margin-bottom: 4px; }
details summary { cursor: pointer; font-weight: 800; min-height: 48px; display: flex; align-items: center; color: var(--terra-dark); }
textarea { min-height: 80px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.install { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; background: var(--terra-soft); border: 1px solid #ecc4aa; }
.install p { margin: 0; flex: 1; min-width: 220px; font-weight: 700; color: #5a2c18; }
.install .ios { font-weight: 600; font-size: .92rem; width: 100%; flex-basis: 100%; }

footer.site { margin-top: 32px; padding: 22px 0 36px; border-top: 1px solid var(--line); color: var(--muted); font-size: .9rem; background: var(--oat); }
footer.site a { color: var(--terra-dark); font-weight: 700; }
.prose h2 { margin-top: 26px; }
.prose p, .prose li { max-width: 70ch; }
.prose h1 { margin-top: 24px; }

[hidden] { display: none !important; }

/* ---------- wider screens ---------- */
@media (max-width: 480px) {
  .kid-row { grid-template-columns: 1fr 104px; }
  .kid-row .rm { grid-column: 1 / -1; justify-self: start; }
  .ring { width: 112px; height: 112px; }
  .hero-art { width: 84px; height: 84px; right: -6px; }
}
@media (min-width: 640px) {
  body { font-size: 18px; }
  h1 { font-size: 2.6rem; }
  .wrap { padding: 0 24px; }
  .tagline { display: block; }
  .card { padding: 24px; }
  .hero { padding-top: 40px; }
  .hero-grid { grid-template-columns: 1.15fr .85fr; gap: 36px; align-items: center; }
  .hero-art { right: auto; left: -34px; top: -6px; width: 120px; height: 120px; }
  .row.cols3 { grid-template-columns: repeat(3, 1fr); }
  .ring { width: 150px; height: 150px; }
  .kidcard { padding: 22px; }
}

/* layout safety: grid children and date inputs may shrink below their intrinsic width */
.row > *, .kid-row > *, .ex-body > *, .kid-top > * { min-width: 0; }
input[type=date], input[type=number], input[type=text], select { min-width: 0; max-width: 100%; }
.hero { overflow-x: clip; }
.hero-art { width: 60px; height: 60px; right: 0; top: 18px; }
@media (min-width: 640px) { .hero-art { width: 120px; height: 120px; left: auto; right: auto; left: -34px; top: -6px; } }
@media (min-width: 640px) { .hero-art { display: none; } }

.basis-hint { margin: 4px 0 8px; font-size: .85rem; font-weight: 700; color: var(--sage-dark); }
