/* 👪 For parents (js/parents.js): the grown-ups' dashboard. The marketing page's Living Paper look
   (site/index.html): warm paper, serif headings, vermilion seals, ink-dark text. Scoped to #parents. */
#parents {
  --pa-paper: #f4ecdc; --pa-paper2: #ebdfc6; --pa-card: #fffdf7; --pa-sunk: #f8f2e6;
  --pa-ink: #221d18; --pa-ink2: #463c33; --pa-muted: #7a6b5b; --pa-line: #e3d5b9; --pa-line2: #efe6d3;
  --pa-verm: #c4381f; --pa-verm-d: #9e2a14; --pa-verm-l: #f6dcd2;
  --pa-jade: #3f8e73; --pa-jade-l: #dcece3; --pa-gold: #b98a3a; --pa-gold-l: #f6e8c8; --pa-indigo: #2d4878; --pa-indigo-l: #dde4f0;
  --pa-serif: "Fraunces", "Iowan Old Style", "Palatino", Georgia, serif;
  --pa-sans: "Nunito", -apple-system, "Segoe UI", system-ui, sans-serif;
  --pa-kai: "Kaiti SC", "STKaiti", "KaiTi", "Ma Shan Zheng", "PingFang SC", serif;
  --pa-shadow: 0 1px 1px rgba(60, 40, 20, .06), 0 8px 24px -12px rgba(60, 40, 20, .22);
  overflow-y: auto; background: var(--pa-paper); color: var(--pa-ink); font-family: var(--pa-sans); font-weight: 500;
  -webkit-user-select: text; user-select: text;
  background-image: radial-gradient(1200px 500px at 85% -10%, rgba(255, 253, 247, .7), transparent 60%),
    radial-gradient(900px 600px at -10% 110%, rgba(235, 223, 198, .6), transparent 60%);
}
#parents button { font-family: inherit; }
#parents [lang="zh"] { font-family: var(--pa-kai); }
.pa-i { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---------- shell: sidebar + main ---------- */
.pa-shell { display: grid; grid-template-columns: 264px minmax(0, 1fr); min-height: 100%; flex: none; }
.pa-side {
  position: sticky; top: 0; align-self: start; height: 100vh; overflow-y: auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 20px; display: flex; flex-direction: column; gap: 18px;
  border-right: 1px solid var(--pa-line); background: rgba(251, 246, 234, .7);
}
.pa-back { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; border: 0; background: none; padding: 6px 4px; color: var(--pa-ink2); font-weight: 800; font-size: 15px; }
.pa-back svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pa-brand { display: flex; align-items: center; gap: 12px; padding: 0 4px; }
.pa-brand b { display: block; font: 600 18px/1.1 var(--pa-serif); white-space: nowrap; }
.pa-brand small { color: var(--pa-muted); font-weight: 600; font-size: 13px; letter-spacing: .08em; text-transform: uppercase; }
.pa-seal {
  display: inline-grid; place-items: center; background: var(--pa-verm); color: #fff6ea; border-radius: 5px;
  font: 400 15px/1 var(--pa-kai); padding: 0; width: 40px; height: 40px; letter-spacing: .02em;
  box-shadow: inset 0 0 0 2px var(--pa-verm), inset 0 0 0 3.5px rgba(255, 246, 234, .7);
}
.pa-seal.sq { width: 46px; height: 46px; font-size: 26px; padding: 0; }
.pa-seal.big { width: 54px; height: 54px; font-size: 28px; padding: 0; background: var(--pa-paper2); color: var(--pa-muted); box-shadow: inset 0 0 0 2px var(--pa-line), inset 0 0 0 3.5px var(--pa-card); }
.pa-seal.stamp { width: auto; height: auto; font-size: 40px; padding: 10px 14px; transform: rotate(-6deg); }

.pa-kids { display: flex; flex-direction: column; gap: 6px; }
.pa-kid {
  display: flex; align-items: center; gap: 10px; text-align: left; width: 100%; padding: 8px 10px;
  border: 1px solid transparent; border-radius: 12px; background: none; color: var(--pa-ink);
}
.pa-kid b { display: block; font-size: 16px; font-weight: 800; }
.pa-kid small { color: var(--pa-muted); font-weight: 600; font-size: 12.5px; }
.pa-kid.on { background: var(--pa-card); border-color: var(--pa-line); box-shadow: var(--pa-shadow); }
.pa-avatar { width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; background: var(--pa-paper2); font-size: 26px; flex: none; }
.pa-nav { display: flex; flex-direction: column; gap: 2px; border-top: 1px solid var(--pa-line); padding-top: 14px; }
.pa-nav button {
  display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; border-radius: 10px; background: none;
  color: var(--pa-ink2); font-weight: 800; font-size: 15.5px; text-align: left; position: relative;
}
.pa-nav button svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.pa-nav button:hover { background: rgba(255, 253, 247, .7); }
.pa-nav button.on { background: var(--pa-ink); color: #fbf6ea; }
.pa-side-foot { margin-top: auto; color: var(--pa-muted); font-size: 12.5px; font-weight: 600; line-height: 1.45; padding: 0 6px; }

.pa-main { padding: max(26px, env(safe-area-inset-top)) clamp(18px, 3.4vw, 44px) max(40px, env(safe-area-inset-bottom)); max-width: 1120px; width: 100%; }
.pa-main > div { display: flex; flex-direction: column; gap: 18px; }

/* ---------- headings ---------- */
.pa-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; padding-bottom: 4px; }
.pa-head h1 { font: 600 clamp(28px, 3.4vw, 40px)/1.08 var(--pa-serif); letter-spacing: -.01em; margin: 6px 0 0; }
.pa-eyebrow { display: inline-flex; align-items: center; gap: 10px; margin: 0; font: 800 12px/1.3 var(--pa-sans); letter-spacing: .16em; text-transform: uppercase; color: var(--pa-verm); }
.pa-eyebrow::before { content: ""; width: 20px; height: 5px; border-radius: 5px 2px 5px 2px; background: var(--pa-verm); opacity: .85; transform: rotate(-4deg); }
.pa-eyebrow span { font-size: 14px; letter-spacing: .04em; text-transform: none; }
.pa-eyebrow.small { font-size: 11px; }
.pa-sub { margin: 6px 0 0; color: var(--pa-muted); font-weight: 600; font-size: 15px; }
.pa-sub b { color: var(--pa-ink); }
.pa-head-right { display: flex; gap: 10px; align-items: center; }
.pa-seg-nav { display: inline-flex; align-items: center; background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 999px; padding: 3px; box-shadow: var(--pa-shadow); }
.pa-seg-nav span { font-weight: 800; font-size: 14px; padding: 0 10px; min-width: 92px; text-align: center; }
.pa-seg-nav button { width: 36px; height: 36px; border-radius: 50%; border: 0; background: none; display: grid; place-items: center; color: var(--pa-ink); }
.pa-seg-nav button:hover:not(:disabled) { background: var(--pa-sunk); }
.pa-seg-nav button:disabled { opacity: .3; }

.pa-btn {
  display: inline-flex; align-items: center; gap: 8px; border: 0; border-radius: 10px; padding: 11px 16px;
  background: var(--pa-verm); color: #fff8ee; font-weight: 800; font-size: 15px; box-shadow: 0 2px 0 var(--pa-verm-d);
}
.pa-btn:active { transform: translateY(1px); box-shadow: 0 1px 0 var(--pa-verm-d); }
.pa-btn.ghost { background: var(--pa-card); color: var(--pa-ink); border: 1px solid var(--pa-line); box-shadow: 0 1px 0 var(--pa-line); }
.pa-btn:disabled { opacity: .45; }
.pa-link { border: 0; background: none; color: var(--pa-verm); font-weight: 800; font-size: 14px; padding: 4px 0; }
.pa-muted { color: var(--pa-muted); font-weight: 600; line-height: 1.5; margin: 0; }
.pa-muted.small { font-size: 13px; margin-top: 12px; }

/* ---------- cards ---------- */
.pa-card { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 18px; padding: 20px 22px; box-shadow: var(--pa-shadow); }
.pa-card.pa-flush { padding: 0; overflow: hidden; }
.pa-card h2 { font: 600 20px/1.2 var(--pa-serif); margin: 0; }
.pa-card h2 small { display: block; font: 600 13px var(--pa-sans); color: var(--pa-muted); margin-top: 2px; }
.pa-card-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.pa-card-h.pad { padding: 18px 22px 0; margin-bottom: 10px; }
.pa-grid2 { display: grid; grid-template-columns: 1.25fr 1fr; gap: 18px; }
.pa-key { display: inline-flex; align-items: center; gap: 7px; color: var(--pa-muted); font-size: 12.5px; font-weight: 600; }
.pa-key i { width: 18px; height: 0; border-top: 2px dashed var(--pa-ink2); }
.pa-key i.met { width: 12px; height: 12px; border: 0; border-radius: 3px; background: var(--pa-jade); }
.pa-tag { display: inline-block; padding: 4px 10px; border-radius: 999px; background: var(--pa-verm-l); color: var(--pa-verm-d); font-weight: 800; font-size: 12.5px; }
.pa-tag.dark { background: var(--pa-ink); color: #fbf6ea; }

/* ---------- weekly report ---------- */
.pa-hero {
  display: flex; align-items: center; justify-content: space-between; gap: 22px; padding: 24px 28px; border-radius: 20px;
  background: var(--pa-ink); color: #f7efe0; box-shadow: var(--pa-shadow); position: relative; overflow: hidden;
}
.pa-hero::after { content: ""; position: absolute; right: -60px; top: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(196, 56, 31, .35), transparent 70%); }
.pa-hero-text { font: 400 clamp(19px, 2.2vw, 25px)/1.4 var(--pa-serif); margin: 0; max-width: 640px; }
.pa-hero-text b { font-weight: 650; color: #fff; }
.pa-hero-note { margin: 10px 0 0; color: #cdbfa8; font-weight: 600; font-size: 14px; }
.pa-hero-note b { font-family: var(--pa-kai); font-size: 18px; color: #fff; font-weight: 400; }
.pa-grade { display: flex; flex-direction: column; align-items: center; gap: 10px; flex: none; position: relative; z-index: 1; }
.pa-grade small { color: #cdbfa8; font-weight: 800; font-size: 12.5px; letter-spacing: .06em; text-transform: uppercase; }

.pa-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.pa-kpi { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 16px; padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--pa-shadow); }
.pa-kpi-l { color: var(--pa-muted); font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; }
.pa-kpi > b { font: 600 38px/1.05 var(--pa-serif); letter-spacing: -.02em; }
.pa-kpi > b small { font-size: 20px; color: var(--pa-muted); font-weight: 500; }
.pa-kpi-f { color: var(--pa-muted); font-size: 13px; font-weight: 600; line-height: 1.35; }
.pa-zh-inline { font-size: 16px; color: var(--pa-ink); }
.pa-delta { display: inline-flex; align-items: center; gap: 3px; font-size: 12.5px; font-weight: 800; }
.pa-delta .pa-i { width: 14px; height: 14px; stroke-width: 2.6; }
.pa-delta.up { color: var(--pa-jade); }
.pa-delta.down { color: var(--pa-verm); }
.pa-delta.flat { color: var(--pa-muted); }
.pa-dots { display: flex; gap: 5px; margin: 2px 0; }
.pa-dots i { width: 14px; height: 14px; border-radius: 50%; background: var(--pa-line2); border: 1px solid var(--pa-line); }
.pa-dots i.on { background: var(--pa-jade); border-color: var(--pa-jade); }
.pa-dots i.future { opacity: .4; }

.pa-plot { position: relative; height: 170px; display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; border-bottom: 1px solid var(--pa-line); padding-top: 22px; }
.pa-col { height: 100%; display: flex; align-items: flex-end; justify-content: center; }
.pa-col i { position: relative; width: min(38px, 100%); border-radius: 6px 6px 2px 2px; background: #cfdcc9; }
.pa-col.met i { background: var(--pa-jade); }
.pa-col.some i { background: #a9cbbb; }
.pa-col.today i { box-shadow: 0 0 0 2px var(--pa-card), 0 0 0 4px var(--pa-ink); }
.pa-col i span { position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 4px; font-weight: 800; font-size: 12.5px; color: var(--pa-ink2); font-style: normal; }
.pa-goal-line { position: absolute; left: 0; right: 0; height: 0; border-top: 2px dashed rgba(34, 29, 24, .45); z-index: 1; pointer-events: none; }
.pa-plot-x { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; text-align: center; padding-top: 8px; }
.pa-plot-x small { color: var(--pa-muted); font-weight: 800; font-size: 12.5px; }
.pa-plot-x small.today { color: var(--pa-ink); }

.pa-score { display: inline-block; min-width: 52px; text-align: center; padding: 4px 8px; border-radius: 8px; font-weight: 900; font-size: 14.5px; }
.pa-score.great { background: var(--pa-jade-l); color: #23604b; }
.pa-score.pass { background: var(--pa-gold-l); color: #7a5a1c; }
.pa-score.low { background: var(--pa-verm-l); color: var(--pa-verm-d); }
.pa-tests-mini { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.pa-tests-mini li { display: grid; grid-template-columns: auto 1fr auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--pa-line2); }
.pa-tests-mini li:first-child { border-top: 0; padding-top: 0; }
.pa-tests-mini b { display: block; font-size: 15px; }
.pa-tests-mini small { color: var(--pa-muted); font-weight: 600; font-size: 13px; }
.pa-missed-zh { font-size: 19px; color: var(--pa-verm-d); letter-spacing: .04em; }

.pa-watch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pa-watch-card { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 2px; padding: 18px 12px 16px; border-radius: 14px; background: var(--pa-sunk); border: 1px solid var(--pa-line2); }
.pa-hz { font: 400 52px/1.15 var(--pa-kai); color: var(--pa-ink); }
.pa-hz.sm { font-size: 30px; }
.pa-watch-py { font-weight: 800; font-size: 15px; }
.pa-watch-en { color: var(--pa-muted); font-weight: 600; font-size: 13.5px; margin-bottom: 8px; }

.pa-donut-wrap { display: flex; align-items: center; gap: 32px; flex-wrap: wrap; }
.pa-donut { position: relative; width: 150px; height: 150px; flex: none; }
.pa-donut svg { width: 100%; height: 100%; }
.pa-donut > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pa-donut b { font: 600 30px/1 var(--pa-serif); }
.pa-donut small { color: var(--pa-muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pa-ring-bg { fill: none; stroke: var(--pa-line2); }
.pa-seg, .pa-ring-fg { fill: none; }
.pa-seg.mastered, .pa-legend i.mastered, .pa-bar .mastered { stroke: var(--pa-jade); background: var(--pa-jade); }
.pa-seg.learning, .pa-legend i.learning, .pa-bar .learning { stroke: #9cc4b2; background: #9cc4b2; }
.pa-seg.review, .pa-legend i.review, .pa-bar .review { stroke: var(--pa-verm); background: var(--pa-verm); }
.pa-seg.fresh, .pa-legend i.fresh, .pa-bar .fresh { stroke: #ddd0b5; background: #ddd0b5; }
.pa-legend { list-style: none; margin: 0; padding: 0; flex: 1; min-width: 240px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 24px; }
.pa-legend li { display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center; }
.pa-legend i { width: 12px; height: 12px; border-radius: 3px; }
.pa-legend b { display: block; font-size: 14.5px; }
.pa-legend small { color: var(--pa-muted); font-weight: 600; font-size: 12.5px; }
.pa-legend em { font: 600 22px var(--pa-serif); font-style: normal; }

.pa-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; padding: 18px 10px; }
.pa-empty b { font: 600 17px var(--pa-serif); margin-top: 4px; }
.pa-empty p { margin: 0; color: var(--pa-muted); font-weight: 600; font-size: 14px; max-width: 360px; line-height: 1.45; }

/* ---------- 听写 tests ---------- */
.pa-ready { position: relative; width: 132px; height: 132px; flex: none; }
.pa-ready > div { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.pa-ready b { font: 600 32px/1 var(--pa-serif); }
.pa-ready b small { font-size: 16px; color: var(--pa-muted); }
.pa-ready > div > small { color: var(--pa-muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; margin-top: 3px; }
.pa-ring-fg { stroke: var(--pa-jade); stroke-linecap: round; }
.pa-ring.pass .pa-ring-fg { stroke: var(--pa-gold); }
.pa-ring.low .pa-ring-fg { stroke: var(--pa-verm); }
.pa-test-card { display: grid; grid-template-columns: auto 1fr; gap: 18px 26px; align-items: center; }
.pa-test-info h2 { font-size: 26px; margin-top: 4px; }
.pa-today { display: flex; gap: 10px; align-items: flex-start; margin-top: 12px; line-height: 1.45; color: var(--pa-ink2); font-weight: 600; }
.pa-test-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px; }
.pa-timeline { grid-column: 1 / -1; list-style: none; margin: 4px 0 0; padding: 16px 0 0; border-top: 1px solid var(--pa-line2); display: flex; gap: 0; overflow-x: auto; }
.pa-timeline li { flex: 1 1 0; min-width: 104px; position: relative; padding: 0 8px 0 0; display: flex; flex-direction: column; gap: 3px; }
.pa-timeline li small { color: var(--pa-muted); font-weight: 800; font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.pa-timeline li b { font-size: 13.5px; line-height: 1.3; color: var(--pa-ink2); }
.pa-tl-dot { order: -1; width: 12px; height: 12px; border-radius: 50%; background: var(--pa-line); margin-bottom: 8px; position: relative; }
.pa-timeline li::before { content: ""; position: absolute; left: 12px; right: 0; top: 5px; height: 2px; background: var(--pa-line); }
.pa-timeline li:last-child::before { display: none; }
.pa-timeline li.now .pa-tl-dot { background: var(--pa-ink); box-shadow: 0 0 0 4px var(--pa-paper2); }
.pa-timeline li.now b { color: var(--pa-ink); }
.pa-timeline li.test .pa-tl-dot { background: var(--pa-verm); }
.pa-timeline li.test b { color: var(--pa-verm); }
.pa-timeline li.gap { flex: 0 0 40px; min-width: 40px; color: var(--pa-muted); font-weight: 900; padding-top: 18px; }

.pa-form { display: flex; flex-direction: column; gap: 18px; margin-top: 16px; }
.pa-field { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pa-field > span, .pa-field legend { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--pa-muted); padding: 0; margin-bottom: 8px; }
.pa-field input[type=date] { align-self: flex-start; font: 700 17px var(--pa-sans); color: var(--pa-ink); padding: 10px 14px; border: 1px solid var(--pa-line); border-radius: 10px; background: var(--pa-sunk); }
.pa-checks { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.pa-check { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--pa-line); border-radius: 12px; background: var(--pa-sunk); cursor: pointer; }
.pa-check:has(input:checked) { border-color: var(--pa-ink); background: var(--pa-card); box-shadow: 0 0 0 1px var(--pa-ink); }
.pa-check input { width: 20px; height: 20px; accent-color: var(--pa-ink); flex: none; }
.pa-check span { font-weight: 800; font-size: 15px; }
.pa-py-check { margin: 4px 0 2px; }
.pa-check small { display: block; color: var(--pa-muted); font-weight: 600; font-size: 12.5px; }
.pa-form-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
/* 📝 results from school: the add form's three fields in a row, the first-to-latest line */
.pa-school-row { display: flex; flex-wrap: wrap; gap: 14px; }
.pa-school-row .pa-field > span { margin-bottom: 0; }
.pa-field input[type=number] { width: 110px; box-sizing: border-box; font: 700 17px var(--pa-sans); color: var(--pa-ink); padding: 10px 14px; border: 1px solid var(--pa-line); border-radius: 10px; background: var(--pa-sunk); }
.pa-school-trend { margin: 6px 0 0; font-size: 15px; }
.pa-school .pa-table td.num small { display: block; }
/* a phone: the date stays on one line, without "Added by" (Missed then fits beside it) */
.pa-s-m, .pa-s-xin { display: none; }
/* a phone: the missed characters go under the score, so the ✕ stays on screen */
@media (max-width: 560px) { .pa-s-mcol, .pa-s-xcol { display: none; } .pa-school .pa-table .pa-s-xin { display: block; min-height: 32px; min-width: 32px; margin-left: -8px; text-align: left; padding-left: 8px; } .pa-school .pa-table .pa-s-m { display: block; font-size: 16px; color: var(--pa-verm-d); white-space: nowrap; } .pa-school .pa-table td:first-child b { white-space: nowrap; } .pa-school .pa-table td:first-child small { display: none; } .pa-school .pa-table th { letter-spacing: .02em; } }
.pa-s-x { min-width: 44px; min-height: 44px; color: var(--pa-muted); }

.pa-chart { width: 100%; height: auto; display: block; font: 700 12px var(--pa-sans); }
.pa-chart text { fill: var(--pa-muted); }
.pa-chart .pa-val { fill: var(--pa-ink); font-weight: 900; font-size: 13px; }
.pa-grid { stroke: var(--pa-line2); stroke-width: 1; }
.pa-pass { stroke: var(--pa-ink2); stroke-width: 1.5; stroke-dasharray: 5 5; opacity: .55; }
.pa-key i.pass-line { border-top-style: dashed; }
.pa-bar.great path { fill: var(--pa-jade); }
.pa-bar.pass path { fill: var(--pa-gold); }
.pa-bar.low path { fill: var(--pa-verm); }
.pa-bar:hover path { opacity: .82; }

.pa-scroll { overflow-x: auto; }
.pa-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.pa-table th { text-align: left; font-weight: 800; font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--pa-muted); padding: 12px 16px; background: var(--pa-sunk); border-bottom: 1px solid var(--pa-line); white-space: nowrap; }
.pa-table td { padding: 12px 16px; border-bottom: 1px solid var(--pa-line2); vertical-align: middle; }
.pa-table tr:last-child td { border-bottom: 0; }
.pa-table td small { display: block; color: var(--pa-muted); font-weight: 600; font-size: 12.5px; }
.pa-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.pa-table th.num { text-align: right; }
/* 📖 Words: tap a heading to sort by it */
.pa-sort { display: inline-flex; align-items: center; gap: 6px; border: 0; background: none; padding: 0; font: inherit; letter-spacing: inherit; text-transform: inherit; color: inherit; cursor: pointer; }
.pa-sort i { font-style: normal; font-size: 10px; opacity: .45; }
.pa-sort.on { color: var(--pa-ink); }
.pa-sort.on i { opacity: 1; color: var(--pa-verm); }
.pa-card h2 small .pa-link { padding: 0; font-size: 13px; }

/* ---------- words ---------- */
.pa-sets { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.pa-set { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--pa-line); background: var(--pa-card); color: var(--pa-ink); box-shadow: var(--pa-shadow); }
.pa-set b { font-size: 15.5px; }
.pa-set small { color: var(--pa-muted); font-weight: 600; font-size: 12.5px; }
.pa-set em { color: var(--pa-verm); font-style: normal; }
.pa-set.on { border-color: var(--pa-ink); box-shadow: 0 0 0 1px var(--pa-ink), var(--pa-shadow); }
.pa-bar { display: flex; gap: 2px; height: 8px; border-radius: 999px; overflow: hidden; background: var(--pa-line2); margin-top: 4px; }
.pa-bar i { display: block; }
.pa-word { display: flex; align-items: center; gap: 14px; }
.pa-word .pa-hz, .pa-word b { white-space: nowrap; }
.pa-word b { display: block; font-size: 14.5px; }
.pa-stage { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 13.5px; color: var(--pa-ink2); white-space: nowrap; }
.pa-stage em { font-style: normal; color: var(--pa-verm); font-size: 12px; background: var(--pa-verm-l); padding: 2px 8px; border-radius: 999px; }
.pa-pips { display: inline-flex; gap: 3px; }
.pa-pips i { width: 9px; height: 9px; border-radius: 2px; background: var(--pa-line2); }
.pa-stage.learning .pa-pips i.on { background: #9cc4b2; }
.pa-stage.mastered .pa-pips i.on { background: var(--pa-jade); }
.pa-stage.review .pa-pips i.on { background: var(--pa-verm); }
.pa-pips i.half { background: repeating-linear-gradient(45deg, #6f9f8b 0 2px, var(--pa-line2) 2px 4px); }
.pa-stage.fresh { color: var(--pa-muted); }
.pa-table-foot { display: flex; gap: 6px 18px; flex-wrap: wrap; margin: 0; padding: 14px 22px; border-top: 1px solid var(--pa-line2); color: var(--pa-muted); font-size: 12.5px; font-weight: 600; background: var(--pa-sunk); }
.pa-table-foot b { color: var(--pa-ink); }

/* ---------- daily goal ---------- */
.pa-goal-opts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pa-opt { position: relative; text-align: left; display: flex; flex-direction: column; gap: 4px; padding: 20px; border-radius: 18px; border: 1px solid var(--pa-line); background: var(--pa-card); color: var(--pa-ink); box-shadow: var(--pa-shadow); }
.pa-opt-n { font: 600 44px/1 var(--pa-serif); margin-bottom: 6px; }
.pa-opt-n small { font: 800 15px var(--pa-sans); color: var(--pa-muted); margin-left: 4px; }
.pa-opt b { font-size: 17px; }
.pa-opt > small { color: var(--pa-muted); font-weight: 600; font-size: 13.5px; line-height: 1.35; }
.pa-opt.on { background: var(--pa-ink); color: #fbf6ea; border-color: var(--pa-ink); }
.pa-opt.on .pa-opt-n small, .pa-opt.on > small { color: #cdbfa8; }
.pa-opt-check { position: absolute; top: 16px; right: 16px; width: 28px; height: 28px; border-radius: 50%; background: var(--pa-verm); display: grid; place-items: center; color: #fff; }
.pa-opt-check .pa-i { width: 16px; height: 16px; stroke-width: 3; }
.pa-today-card { display: flex; align-items: center; gap: 22px; }
.pa-streak { margin: 12px 0 0; font-weight: 800; color: var(--pa-ink2); }
.pa-streak b { font: 600 24px var(--pa-serif); color: var(--pa-verm); margin-right: 4px; }
.pa-cal { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; }
.pa-cal li { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pa-cal small { color: var(--pa-muted); font-weight: 800; font-size: 11.5px; }
.pa-cal i { width: 34px; height: 34px; border-radius: 9px; background: var(--pa-line2); display: grid; place-items: center; color: #fff; }
.pa-cal li.some i { background: #cfe0d6; }
.pa-cal li.met i { background: var(--pa-jade); }
.pa-cal li.today i { box-shadow: 0 0 0 2px var(--pa-card), 0 0 0 4px var(--pa-ink); }
.pa-cal .pa-i { width: 16px; height: 16px; stroke-width: 3; }

/* ---------- how Inkpop teaches ---------- */
.pa-ladder { list-style: none; margin: 18px 0 0; padding: 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; align-items: end; }
.pa-ladder li { display: flex; flex-direction: column; gap: 6px; padding: 14px; border-radius: 12px; background: var(--pa-sunk); border: 1px solid var(--pa-line2); }
.pa-ladder li:nth-child(1) { min-height: 120px; } .pa-ladder li:nth-child(2) { min-height: 140px; } .pa-ladder li:nth-child(3) { min-height: 160px; }
.pa-ladder li:nth-child(4) { min-height: 180px; } .pa-ladder li:nth-child(5) { min-height: 200px; background: var(--pa-ink); color: #fbf6ea; border-color: var(--pa-ink); }
.pa-ladder-n { font: 600 26px/1 var(--pa-serif); color: var(--pa-verm); }
.pa-ladder li:nth-child(5) .pa-ladder-n { color: #f0a48e; }
.pa-ladder b { font-size: 15px; line-height: 1.25; }
.pa-ladder small { color: var(--pa-muted); font-weight: 600; font-size: 12.5px; line-height: 1.35; margin-top: auto; }
.pa-ladder li:nth-child(5) small { color: #cdbfa8; }
.pa-principles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pa-principle { background: var(--pa-card); border: 1px solid var(--pa-line); border-radius: 16px; padding: 20px; box-shadow: var(--pa-shadow); display: flex; flex-direction: column; gap: 8px; }
.pa-principle b { font: 600 18px/1.25 var(--pa-serif); margin-top: 6px; }
.pa-principle p { margin: 0; color: var(--pa-ink2); font-weight: 600; font-size: 14.5px; line-height: 1.5; }

/* ---------- narrower screens: the sidebar becomes a top bar ---------- */
@media (max-width: 980px) {
  .pa-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pa-grid2 { grid-template-columns: minmax(0, 1fr); }
  .pa-principles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pa-shell { grid-template-columns: minmax(0, 1fr); }
  .pa-side { position: static; height: auto; border-right: 0; border-bottom: 1px solid var(--pa-line); gap: 12px; padding: max(12px, env(safe-area-inset-top)) 14px 10px; }
  .pa-brand, .pa-side-foot { display: none; }
  .pa-kids { flex-direction: row; overflow-x: auto; }
  .pa-kid { width: auto; flex: none; }
  .pa-nav { flex-direction: row; overflow-x: auto; border-top: 0; padding-top: 0; gap: 6px; }
  .pa-nav button { flex: none; padding: 9px 12px; font-size: 14px; }
  .pa-main { padding-top: 18px; }
  .pa-hero { flex-direction: column; align-items: flex-start; padding: 20px; }
  .pa-grade { flex-direction: row; }
  .pa-watch { grid-template-columns: 1fr; }
  .pa-goal-opts, .pa-principles { grid-template-columns: 1fr; }
  .pa-ladder { grid-template-columns: 1fr; }
  .pa-ladder li { min-height: 0 !important; }
  .pa-test-card { grid-template-columns: 1fr; justify-items: start; }
  .pa-legend { grid-template-columns: 1fr; }
  .pa-today-card { flex-direction: column; align-items: flex-start; }
  .pa-timeline li { min-width: 72px; }
  .pa-timeline li b { font-size: 12.5px; }
  .pa-chart { font-size: 11px; }
}

/* ---------- Manage kids ---------- */
.pa-kidgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 18px; }
.pa-kidcard { display: flex; flex-direction: column; gap: 16px; }
.pa-kidcard.on { border-color: var(--pa-ink2); }
.pa-kidcard-top { display: flex; align-items: center; gap: 14px; }
.pa-kidcard-top b { display: block; font: 600 22px/1.15 var(--pa-serif); }
.pa-kidcard-top small { display: block; color: var(--pa-muted); font-weight: 600; font-size: 13px; margin-top: 3px; }
.pa-kidface {
  width: 76px; height: 76px; flex: none; border-radius: 50%; display: grid; place-items: center; font-size: 44px;
  background: color-mix(in srgb, var(--kc, #ebdfc6) 22%, #fffdf7); border: 1px solid var(--pa-line);
}
.pa-kidface.sm { width: 44px; height: 44px; font-size: 26px; }
.pa-kidstats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 0; }
.pa-kidstats div { background: var(--pa-sunk); border-radius: 12px; padding: 10px; min-width: 0; }
.pa-kidstats dt { font-size: 11.5px; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--pa-muted); }
.pa-kidstats dd { margin: 2px 0 0; font: 600 24px/1.1 var(--pa-serif); }
.pa-kidstats dd small { font: 600 13px var(--pa-sans); color: var(--pa-muted); }
.pa-kidcard-acts { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.pa-kidcard-acts .pa-btn { padding: 9px 14px; font-size: 14px; }
.pa-link.danger { color: var(--pa-muted); margin-left: auto; }
.pa-link.danger:hover { color: var(--pa-verm); }
.pa-kidedit { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 26px; margin-bottom: 18px; border-color: var(--pa-ink2); }
.pa-kidedit-face {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; border-radius: 16px;
  background: color-mix(in srgb, var(--kc) 18%, #fffdf7); padding: 18px; align-self: start; min-height: 230px;
}
.pa-kidedit-face small { font-weight: 800; color: var(--pa-ink2); }
.pa-kidedit-main { display: flex; flex-direction: column; gap: 14px; }
.pa-kidedit-main h2 { font: 600 22px/1.2 var(--pa-serif); margin: 0; }
.pa-kidedit label.pa-field { font-weight: 800; font-size: 13px; letter-spacing: .06em; text-transform: uppercase; color: var(--pa-muted); gap: 8px; }
.pa-kidedit .pa-field > span { margin-bottom: 0; }
#pa-kid-name {
  font: 700 18px var(--pa-sans); color: var(--pa-ink); letter-spacing: 0; text-transform: none;
  padding: 11px 14px; border: 1px solid var(--pa-line); border-radius: 10px; background: var(--pa-sunk); max-width: 360px;
}
#pa-kid-name:focus { outline: none; border-color: var(--pa-ink2); background: #fff; }
.pa-buds { display: grid; grid-template-columns: repeat(8, 52px); gap: 8px; }
.pa-bud { width: 52px; height: 52px; border-radius: 12px; border: 1px solid var(--pa-line); background: var(--pa-sunk); display: grid; place-items: center; padding: 0; }
.pa-bud.on { border: 2px solid var(--pa-ink); background: #fff; }
.pa-cols { display: flex; gap: 10px; flex-wrap: wrap; }
.pa-swatch { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--pa-card); box-shadow: 0 0 0 1px var(--pa-line); padding: 0; }
.pa-swatch.on { box-shadow: 0 0 0 2px var(--pa-ink); }
.pa-form-msg { margin: 0; min-height: 18px; color: var(--pa-verm-d); font-weight: 700; }
.pa-gone { margin-top: 18px; }
.pa-gone-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--pa-line2); }
.pa-gone-row b { flex: 1; font-weight: 800; }
@media (max-width: 760px) {
  .pa-kidedit { grid-template-columns: 1fr; }
  .pa-buds { grid-template-columns: repeat(auto-fill, 46px); }
  .pa-bud { width: 46px; height: 46px; }
}

/* entries: ☁️ Family account → 👪 For parents (hold), Home → 📝 test day */
.acct-parents { display: block; width: 100%; margin: 10px 0 0; font-size: 18px; min-height: 52px; position: relative; overflow: hidden; }
/* the test countdown on Home (Parents.homePill): red count block, the days before the test, readiness + today's step */
.home-test {
  flex-basis: 100%; display: grid; grid-template-columns: auto 1fr auto; align-items: stretch;
  background: #fff; border: 4px solid #d93a2b; border-radius: 22px; box-shadow: 0 5px 0 #d93a2b; overflow: hidden; color: #1d2233;
}
.home-test[hidden] { display: none; }
.home-test .ht-count { background: #d93a2b; color: #fff; display: flex; flex-direction: column; justify-content: center; padding: 8px 20px; min-width: 150px; }
.home-test .ht-count small { font-weight: 900; font-size: 12px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; }
.home-test .ht-count b { font-family: var(--f-display, sans-serif); font-weight: 400; font-size: 38px; line-height: 1; }
.home-test .ht-count span { font-weight: 800; font-size: 14px; }
.home-test .ht-week { list-style: none; margin: 0; padding: 10px 12px; display: flex; gap: 8px; min-width: 0; }
.home-test .ht-day { flex: 1 1 0; min-width: 0; border: 3px solid #eadfcd; border-radius: 14px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; padding: 4px 2px; color: #6b6578; }
.home-test .ht-day b { font-size: 14px; font-weight: 900; line-height: 1.1; }
.home-test .ht-day small { font-size: 11px; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.home-test .ht-day.now { border-color: #1d2233; background: #fff7d6; color: #1d2233; box-shadow: 0 3px 0 #1d2233; }
.home-test .ht-day.test { border-color: #d93a2b; background: #fff0ee; color: #d93a2b; }
.home-test .ht-seal { width: 32px; height: 32px; border-radius: 8px; display: grid; place-items: center; background: #d93a2b; color: #fff; font-family: var(--f-brush, serif); font-size: 21px; line-height: 1; transform: rotate(-6deg); }
.home-test .ht-seal.empty { background: transparent; border: 3px dashed #d8cfc0; transform: none; }
.home-test .ht-day.test .ht-seal { background: transparent; border: 3px solid #d93a2b; color: #d93a2b; transform: none; }
.home-test .ht-gap { align-self: center; font-weight: 900; color: #b5ab9b; }
.home-test .ht-side { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 10px 14px 10px 4px; min-width: 0; }
.home-test .ht-ready { display: flex; align-items: center; gap: 10px; font-size: 15px; font-weight: 900; }
.home-test .ht-meter { flex: 1; min-width: 70px; height: 12px; border: 3px solid #1d2233; border-radius: 999px; background: #f4efe6; overflow: hidden; }
.home-test .ht-meter i { display: block; height: 100%; background: linear-gradient(90deg, #2ec27e, #7bdc6a); }
.home-test .ht-go { font: inherit; font-weight: 900; font-size: 16px; color: #1d2233; background: #ffc22e; border: 3px solid #1d2233; border-radius: 14px; padding: 8px 14px; box-shadow: 0 4px 0 #1d2233; cursor: pointer; text-align: left; }
.home-test .ht-go:active { transform: translateY(3px); box-shadow: 0 1px 0 #1d2233; }
/* narrow (upright phones, split view): count + button on top, the days below */
@media (max-width: 760px) {
  .home-test { grid-template-columns: auto 1fr; }
  .home-test .ht-count { min-width: 0; padding: 8px 14px; }
  .home-test .ht-count b { font-size: 28px; }
  .home-test .ht-week { grid-column: 1 / -1; grid-row: 2; padding: 8px; gap: 5px; }
  .home-test .ht-side { padding: 8px 10px; }
  .home-test .ht-go { font-size: 14px; padding: 6px 10px; }
  .home-test .ht-seal { width: 26px; height: 26px; font-size: 17px; }
  .home-test .ht-day small { display: none; }
}

/* 🖨 print-outs: only #print-area goes on paper */
#print-area { display: none; }
@media print {
  @page { margin: 14mm; }
  body.printing { height: auto; background: #fff; overflow: visible; }
  body.printing > *:not(#print-area) { display: none !important; }
  body.printing #print-area { display: block; color: #000; font-family: -apple-system, "PingFang SC", "Helvetica Neue", sans-serif; }
  .pr-page { break-after: page; }
  .pr-page:last-child { break-after: auto; }
  .pr-head { display: flex; gap: 24px; align-items: baseline; flex-wrap: wrap; border-bottom: 2px solid #000; padding-bottom: 6px; margin-bottom: 8px; font-size: 14pt; }
  .pr-head b { font-size: 20pt; margin-right: auto; }
  .pr-note { font-size: 11pt; color: #333; }
  .pr-rows { columns: 2; column-gap: 12mm; padding-left: 8mm; font-size: 13pt; }
  .pr-rows li { break-inside: avoid; margin-bottom: 7mm; }
  .pr-line { display: block; width: 46mm; border-bottom: 1px solid #555; height: 7mm; margin-bottom: 1.5mm; }
  .pr-boxes { display: flex; }
  .pr-box { width: 17mm; height: 17mm; margin-right: -1px; }
  .pr-key { columns: 2; font-size: 14pt; }
  .pr-key li { margin-bottom: 3mm; }
  .pr-key b { font-size: 18pt; }
  .pr-key small { color: #555; }
  .pr-stats { width: 100%; border-collapse: collapse; margin: 6px 0 10px; }
  .pr-stats td { border: 1px solid #999; padding: 6px 8px; font-size: 11pt; }
  .pr-stats b { font-size: 16pt; }
  .pr-words { width: 100%; border-collapse: collapse; font-size: 11pt; }
  .pr-words th, .pr-words td { border-bottom: 1px solid #ccc; padding: 3px 6px; text-align: left; }
  .pr-hz { font-size: 16pt; }
}

/* parents read reports on an upright iPad too: no "turn sideways" here */
body:has(#parents.screen.active) .rotate-me { display: none !important; }
