/* Family page only (loaded after style.css). Bright, rounded, kid-friendly - still tidy.
   Font: Fredoka (SIL OFL 1.1, self-hosted, see /assets/fonts/OFL.txt) for headings.
   Caveat (SIL OFL 1.1, self-hosted, see /assets/fonts/caveat-OFL.txt) for post-it notes. */
@font-face { font-family: 'Fredoka'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/fredoka-latin.woff2) format('woff2'); }
@font-face { font-family: 'Baloo 2'; font-style: normal; font-weight: 400 800; font-display: swap;
  src: url(/assets/fonts/baloo2-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: 'Caveat'; font-style: normal; font-weight: 400 700; font-display: swap;
  src: url(/assets/fonts/caveat-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; }

body.fam {
  --fun: 'Fredoka', ui-rounded, 'SF Pro Rounded', 'Nunito', system-ui, sans-serif;
  --bg: #fff8ef; --surface: #ffffff; --line: #f1e4d3; --line-strong: #e6d2b8;
  --accent: #6d3df5; --accent-ink: #fff; --accent-soft: #efe8ff; --radius: 18px;
  --club: #8b5cf6; --club-soft: #f1eaff; --trip: #f97316; --trip-soft: #ffeedd;
  --homework: #0ea5e9; --homework-soft: #e2f5fe; --payment: #16a34a; --payment-soft: #e3f8e9;
  --event: #14b8a6; --event-soft: #dcf7f3;
  --kid-0: #f5c542; --kid-0-ink: #422006; --kid-1: #e07aa8; --kid-1-ink: #831843;
  --kid-0-soft: color-mix(in srgb, var(--kid-0) 28%, var(--surface));
  --kid-1-soft: color-mix(in srgb, var(--kid-1) 28%, var(--surface));
  --kid-2: #38bdf8; --kid-2-ink: #0c4a6e; --kid-3: #34d399; --kid-3-ink: #064e3b;
  --kid-2-soft: color-mix(in srgb, var(--kid-2) 28%, var(--surface));
  --kid-3-soft: color-mix(in srgb, var(--kid-3) 28%, var(--surface));
  --other: #64748b; --other-soft: #eef1f5;
  --sun: #c4b5fd;
  background: var(--bg);
  background-image: radial-gradient(circle at 8% 4%, #ffe3f1 0 120px, transparent 121px), radial-gradient(circle at 96% 10%, #dff3ff 0 160px, transparent 161px);
  background-repeat: no-repeat;
}
@media (prefers-color-scheme: dark) {
  body.fam { --bg: #17131f; --surface: #221c2e; --line: #322a40; --line-strong: #43395a; --accent: #b79cff; --accent-ink: #1a1028; --accent-soft: #2e2442;
    --club-soft: #2c2242; --trip-soft: #3a2616; --homework-soft: #12303d; --payment-soft: #143020; --event-soft: #3a1a2c; --other-soft: #262b33;
    background-image: none; }
}
body.fam h1, body.fam h2, body.fam h3, body.fam .fun { font-family: var(--fun); letter-spacing: 0; }
body.fam h1 { font-weight: 600; font-size: clamp(1.5rem, 4.2vw, 2.2rem); margin: 0; }
body.fam h2 { font-weight: 600; font-size: 1.1rem; display: flex; align-items: center; gap: .4rem; margin: 0; }
body.fam .site-header { background: transparent; border: 0; }
body.fam .brand-mark { width: 28px; height: 28px; border-radius: 8px; display: block; flex: none; }
body.fam .easel-copy h1 { font-weight: 700; font-size: clamp(1.15rem, 3.4vw, 1.6rem); }
body.fam main.container { max-width: 1240px; padding-top: .5rem; padding-bottom: 6rem; }
body.fam .btn { border-radius: 999px; font-weight: 500; }
body.fam .btn.primary { background: var(--accent); border-color: var(--accent); }
body.fam .card { border-radius: var(--radius); border: 0; box-shadow: 0 2px 0 var(--line), 0 6px 18px rgba(120, 72, 20, .06); padding: 1rem; }
body.fam dialog { border-radius: 20px; border: 0; }
body.fam input, body.fam select, body.fam textarea { border-radius: 10px; }

/* Hero */
.fam-hero { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: end; justify-content: space-between; margin: .25rem 0 1rem; }
.fam-hero .sub { color: var(--muted); margin: .15rem 0 0; font-size: .95rem; }
.fam-stats { display: flex; flex-wrap: wrap; gap: .4rem; }
.pill { display: inline-flex; align-items: center; gap: .3rem; border-radius: 999px; padding: .25rem .7rem; font-size: .85rem; font-weight: 600; background: var(--surface); box-shadow: 0 1px 0 var(--line); white-space: nowrap; }
.pill.t-homework { background: var(--homework-soft); } .pill.t-payment { background: var(--payment-soft); } .pill.t-trip { background: var(--trip-soft); } .pill.t-club { background: var(--club-soft); }
.fam-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: 1rem; }
.top-tools { display: contents; }
.chips { display: flex; flex-wrap: wrap; gap: .35rem; }
.chip { font: inherit; font-size: .85rem; border: 2px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: .2rem .75rem; cursor: pointer; }
.chip[aria-pressed="true"] { border-color: var(--accent); background: var(--accent); color: var(--accent-ink); }
.add-row { display: flex; flex-wrap: wrap; gap: .35rem; }
.add-row .btn { padding: .3rem .7rem; font-size: .85rem; }
.add-row .btn.t-club { background: var(--club-soft); border-color: transparent; }
.add-row .btn.t-trip { background: var(--trip-soft); border-color: transparent; }
.add-row .btn.t-homework { background: var(--homework-soft); border-color: transparent; }
.add-row .btn.t-payment { background: var(--payment-soft); border-color: transparent; }
.add-row .btn.t-event { background: var(--event-soft); border-color: transparent; }

/* Dashboard */
.dash { display: grid; gap: .9rem; grid-template-columns: repeat(12, minmax(0, 1fr)); }
.dash > .card { grid-column: span 4; min-width: 0; display: flex; flex-direction: column; }
.dash > .card.wide { grid-column: span 12; }
.dash > .card.half { grid-column: span 6; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.card-h .sum { font-size: .8rem; color: var(--muted); font-weight: 600; }
.card.t-club { border-top: 5px solid var(--club); } .card.t-trip { border-top: 5px solid var(--trip); }
.card.t-homework { border-top: 5px solid var(--homework); } .card.t-payment { border-top: 5px solid var(--payment); }
.card.t-next { border-top: 5px solid var(--sun); } .card.t-notes { border-top: 5px solid var(--event); } .card.t-info { border-top: 5px solid var(--other); }
.rows { list-style: none; margin: 0; padding: 0; }
.rows li { display: flex; align-items: center; gap: .55rem; padding: .4rem 0; border-top: 1px dashed var(--line-strong); min-width: 0; }
.rows li:first-child { border-top: 0; }
.rows .main { flex: 1 1 auto; min-width: 0; }
.rows .ttl { font-weight: 600; overflow-wrap: anywhere; line-height: 1.3; }
.rows .meta { font-size: .8rem; color: var(--muted); line-height: 1.35; }
.rows li.done .ttl { text-decoration: line-through; color: var(--faint); }
.rows li.done .meta { color: var(--faint); }
.rows .edit { flex: none; border: 0; background: transparent; cursor: pointer; font-size: 1rem; color: var(--faint); border-radius: 8px; padding: .2rem .35rem; }
.rows .edit:hover { background: var(--accent-soft); color: var(--text); }
.ico { flex: none; display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 12px; font-size: 1.05rem; background: var(--other-soft); }
.ico.t-club { background: var(--club-soft); } .ico.t-trip { background: var(--trip-soft); } .ico.t-homework { background: var(--homework-soft); }
.ico.t-payment { background: var(--payment-soft); } .ico.t-event { background: var(--event-soft); }
.when { flex: none; text-align: center; min-width: 3.1rem; font-family: var(--fun); line-height: 1.1; border-radius: 12px; padding: .25rem .3rem; background: var(--accent-soft); }
.when .d { font-size: .72rem; text-transform: uppercase; color: var(--muted); display: block; }
.when .n { font-size: 1.1rem; font-weight: 600; display: block; }
.when.today { background: var(--accent); color: #fff; } .when.today .d { color: #ede9fe; }
.tick { flex: none; font: inherit; width: 1.9rem; height: 1.9rem; border-radius: 50%; border: 2.5px solid var(--line-strong); background: var(--surface); cursor: pointer; display: inline-grid; place-items: center; font-size: .95rem; color: transparent; }
.tick:hover { border-color: var(--payment); color: var(--payment); }
.tick[aria-pressed="true"] { background: var(--payment); border-color: var(--payment); color: #fff; }
.paybtn { flex: none; font: inherit; font-size: .78rem; font-weight: 600; border-radius: 999px; padding: .2rem .6rem; border: 2px solid var(--payment); background: var(--surface); color: var(--payment); cursor: pointer; white-space: nowrap; }
.paybtn[aria-pressed="true"] { background: var(--payment); color: #fff; }
.amt { font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.tag { display: inline-block; font-size: .7rem; font-weight: 700; border-radius: 999px; padding: 0 .45rem; line-height: 1.6; vertical-align: 1px; white-space: nowrap; }
.tag.late { background: #fee2e2; color: #991b1b; } .tag.soon { background: #fef3c7; color: #92400e; } .tag.ok { background: #dcfce7; color: #166534; } .tag.kid { background: var(--accent-soft); color: var(--accent); }
.fam-empty { color: var(--muted); font-size: .88rem; padding: .35rem 0; margin: 0; }
.fam-empty strong { color: var(--text); }
.more { font-size: .8rem; color: var(--muted); margin: .35rem 0 0; }
.next-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .5rem; list-style: none; margin: 0; padding: 0; }
.next-grid li { display: flex; gap: .55rem; align-items: center; padding: .45rem .55rem; border-radius: 14px; background: var(--bg); min-width: 0; cursor: pointer; border: 0; text-align: left; font: inherit; color: inherit; }
.next-grid li:hover { outline: 2px solid var(--line-strong); }

/* Calendar */
.cal-card { margin-top: .9rem; }
.cal-top { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-nav { display: flex; align-items: center; gap: .3rem; }
.cal-nav .btn { padding: .25rem .65rem; }
.cal-title { font-family: var(--fun); font-weight: 600; font-size: 1.15rem; min-width: 9.5rem; text-align: center; }
.seg { display: inline-flex; border: 2px solid var(--line-strong); border-radius: 999px; overflow: hidden; }
.seg button { font: inherit; font-size: .82rem; border: 0; background: var(--surface); color: var(--muted); padding: .25rem .8rem; cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.mgrid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.mgrid .dow { text-align: center; font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; padding: .15rem 0; }
.mday { font: inherit; text-align: left; min-height: 80px; border: 0; border-radius: 12px; background: var(--bg); padding: .25rem .3rem; display: flex; flex-direction: column; gap: 2px; cursor: pointer; min-width: 0; color: inherit; overflow: hidden; }
.mday:hover { outline: 2px solid var(--line-strong); }
.mday.other { opacity: .4; }
.mday.weekend { background: color-mix(in srgb, var(--bg) 70%, var(--accent-soft)); }
.mday.today { outline: 3px solid var(--accent); }
.mday.sel { background: var(--accent-soft); }
.mday.sel { outline: 3px dashed var(--accent); }
.mday .n { font-size: .78rem; font-weight: 700; color: var(--muted); }
.mday.today .n { color: var(--text); }
.ev { display: block; font-size: .72rem; line-height: 1.3; border-radius: 6px; padding: 1px 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; background: var(--other-soft); border-left: 3px solid var(--other); }
.ev.t-club { background: var(--club-soft); border-color: var(--club); } .ev.t-trip { background: var(--trip-soft); border-color: var(--trip); }
.ev.t-homework { background: var(--homework-soft); border-color: var(--homework); } .ev.t-payment { background: var(--payment-soft); border-color: var(--payment); }
.ev.t-event { background: var(--event-soft); border-color: var(--event); }
.ev.done { text-decoration: line-through; opacity: .6; }
.ev-more { font-size: .7rem; color: var(--muted); }
button.ev-more { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.dots { display: none; gap: 2px; flex-wrap: wrap; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--other); }
.dot.t-club { background: var(--club); } .dot.t-trip { background: var(--trip); } .dot.t-homework { background: var(--homework); } .dot.t-payment { background: var(--payment); } .dot.t-event { background: var(--event); }
.legend-row { display: flex; flex-wrap: wrap; gap: .3rem .8rem; font-size: .78rem; color: var(--muted); margin-top: .6rem; }
.legend-row span { display: inline-flex; align-items: center; gap: .3rem; }
.agenda { list-style: none; margin: 0; padding: 0; }
.agenda > li { display: grid; grid-template-columns: 3.6rem 1fr; gap: .6rem; padding: .5rem 0; border-top: 1px dashed var(--line-strong); }
.agenda > li:first-child { border-top: 0; }
.agenda > li.past { opacity: .55; }
.agenda .rows li { padding: .2rem 0; border: 0; }
.daydetail { margin-top: .75rem; padding: .6rem .75rem; background: var(--bg); border-radius: 14px; }
.daydetail h3 { font-family: var(--fun); margin: 0 0 .25rem; }
.lower { display: grid; gap: .9rem; grid-template-columns: 1fr 1fr; margin-top: .9rem; }

/* Floating chat */
.chat-fab { position: fixed; right: 1.1rem; bottom: 1.1rem; z-index: 40; width: 3.9rem; height: 3.9rem; border-radius: 50%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, #f472b6, #8b5cf6); color: #fff; font-size: 1.7rem; box-shadow: 0 8px 24px rgba(109, 61, 245, .35); display: grid; place-items: center; }
.chat-fab:hover { transform: scale(1.05); }
.chat-fab .count { position: absolute; top: -2px; right: -2px; min-width: 1.4rem; height: 1.4rem; padding: 0 .3rem; border-radius: 999px; background: #ef4444; color: #fff; font: 700 .78rem/1.4rem system-ui, sans-serif; border: 2px solid #fff; }
.chat-fab .count[hidden] { display: none; }
.chat-panel { position: fixed; right: 1.1rem; bottom: 5.8rem; z-index: 41; width: min(400px, calc(100vw - 2.2rem)); max-height: min(620px, calc(100vh - 7.5rem));
  display: flex; flex-direction: column; background: var(--surface); border-radius: 22px; box-shadow: 0 18px 50px rgba(40, 20, 80, .28); overflow: hidden; }
.chat-panel[hidden] { display: none; }
.chat-panel-h { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .6rem .6rem .6rem 1rem; background: linear-gradient(135deg, #f472b6, #8b5cf6); color: #fff; }
.chat-panel-h h2 { color: #fff; font-size: 1.05rem; }
.chat-panel-h button { border: 0; background: rgba(255,255,255,.2); color: #fff; width: 2.2rem; height: 2.2rem; border-radius: 50%; cursor: pointer; font-size: 1.1rem; }
.chat-panel .chat { border-radius: 0; box-shadow: none; flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; padding: 0; }
.chat-panel .chat-list { max-height: none; flex: 1 1 auto; min-height: 200px; }
.chat-panel .msg { max-width: 86%; border-radius: 14px; }
.chat-panel .chat-foot .hide-sm { display: none; }

@media (max-width: 1000px) {
  .dash > .card { grid-column: span 6; }
  .dash > .card.wide { grid-column: span 12; }
}
@media (max-width: 640px) {
  body.fam main.container { padding-left: .75rem; padding-right: .75rem; }
  .dash { gap: .65rem; }
  .dash > .card, .dash > .card.half { grid-column: span 12; }
  body.fam .card { padding: .8rem; }
  .lower { grid-template-columns: 1fr; gap: .65rem; }
  .next-grid { grid-template-columns: 1fr; gap: .35rem; }
  .mday { min-height: 46px; padding: .12rem .08rem; align-items: center; gap: 1px; }
  .mday .ev, .mday .ev-more { display: none; }
  .mgrid { touch-action: pan-y; }
  .mday .dots { display: flex; justify-content: center; gap: 6px; }
  .mday button.dot { position: relative; width: 8px; height: 8px; }
  .mday button.dot::after { content: ''; position: absolute; inset: -6px; }
  .cal-title { min-width: 0; font-size: 1rem; }
  .chat-panel { right: 0; left: 0; bottom: 0; width: 100%; max-height: 88vh; height: 88vh; border-radius: 22px 22px 0 0; }
  .chat-fab { right: .85rem; bottom: .85rem; }
  body.fam .site-footer { padding-bottom: 5rem; }
}

/* Each child has a colour from family.config.json. Both is a split of the first two. */
.tag.kid.k-0 { background: var(--kid-0); color: var(--kid-0-ink); } .tag.kid.k-1 { background: var(--kid-1); color: var(--kid-1-ink); }
.tag.kid.k-both { background: linear-gradient(90deg, var(--kid-0) 50%, var(--kid-1) 50%); color: var(--kid-0-ink); }
.ev.k-0, .ev.k-1, .ev.k-both { border-left-width: 5px; }
.ev.k-0 { border-left-color: var(--kid-0); } .ev.k-1 { border-left-color: var(--kid-1); }
.ev.k-both { border-left-color: transparent; border-image: linear-gradient(180deg, var(--kid-0) 50%, var(--kid-1) 50%) 0 0 0 1; }
.ev .who { font-weight: 700; margin-right: .2em; }
.ev.k-0 .who { color: var(--kid-0-ink); } .ev.k-1 .who { color: var(--kid-1-ink); }
.dot.k-0 { box-shadow: 0 0 0 2px var(--kid-0); } .dot.k-1 { box-shadow: 0 0 0 2px var(--kid-1); }
.dot.k-both { box-shadow: -2px 0 0 1px var(--kid-0), 2px 0 0 1px var(--kid-1); }
.dots { gap: 4px; padding: 2px; }
.ico.k-0 { box-shadow: inset 0 0 0 2.5px var(--kid-0); } .ico.k-1 { box-shadow: inset 0 0 0 2.5px var(--kid-1); }
.kidkey { font-weight: 700; padding: 0 .45rem; border-radius: 999px; }
.kidkey.k-0 { background: var(--kid-0); color: var(--kid-0-ink); } .kidkey.k-1 { background: var(--kid-1); color: var(--kid-1-ink); }
.kidkey.k-both { background: linear-gradient(90deg, var(--kid-0) 50%, var(--kid-1) 50%); color: var(--kid-0-ink); }
.chip.k-0[aria-pressed="true"] { background: var(--kid-0); border-color: var(--kid-0); color: var(--kid-0-ink); } .chip.k-1[aria-pressed="true"] { background: var(--kid-1); border-color: var(--kid-1); color: var(--kid-1-ink); }
.chip.k-both { border-color: var(--kid-1); } .chip.k-both[aria-pressed="true"] { background: linear-gradient(90deg, var(--kid-0) 50%, var(--kid-1) 50%); color: var(--kid-0-ink); border-color: var(--kid-0); }
.chip.k-0 { border-color: var(--kid-0); } .chip.k-1 { border-color: var(--kid-1); }
/* Cards: a girl-coloured stripe on each row's icon, so cards match the calendar */
.ico.k-both { box-shadow: inset 3px 0 0 0 var(--kid-0), inset -3px 0 0 0 var(--kid-1); }
.chip.k-0:not([aria-pressed="true"]) { background: var(--kid-0-soft); } .chip.k-1:not([aria-pressed="true"]) { background: var(--kid-1-soft); }
/* style.css adds a gap between sibling sections; the grid handles spacing here */
body.fam .dash > section + section, body.fam .lower > section + section { margin-top: 0; }
@media (max-width: 640px) { .next-grid li { padding: .35rem .45rem; } .next-grid .ttl, .rows .ttl { font-size: .95rem; } }

/* ---- 0004: kids' profiles, every week, spellings, contacts, term dates ---- */
body.fam { --term: #2563eb; --term-soft: #e0eaff; --holiday: #f59e0b; --holiday-soft: #fff1d6; --week: #06b6d4; --spellc: #a855f7; }
@media (prefers-color-scheme: dark) { body.fam { --term-soft: #172447; --holiday-soft: #3a2a10; } }
.card.t-kids { border-top: 5px solid transparent; border-image: linear-gradient(90deg, var(--kid-0), var(--kid-1)) 1 0 0 0; }
.card.t-week { border-top: 5px solid var(--week); } .card.t-spell { border-top: 5px solid var(--spellc); } .card.t-contacts { border-top: 5px solid var(--term); }
.pill.t-term { background: var(--term-soft); } .pill.t-holiday { background: var(--holiday-soft); }
.ico.t-term, .ev.t-term { background: var(--term-soft); } .ev.t-term { border-left-color: var(--term); } .dot.t-term { background: var(--term); }
.ico.t-holiday, .ev.t-holiday { background: var(--holiday-soft); } .ev.t-holiday { border-left-color: var(--holiday); } .dot.t-holiday { background: var(--holiday); }
.lnk { font-size: .78rem; font-weight: 600; color: var(--accent); text-decoration: none; white-space: nowrap; }
.lnk:hover { text-decoration: underline; }

.kidcards { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.kidcard { border-radius: 16px; padding: .6rem .75rem; background: var(--other-soft); min-width: 0; }
.kidcard.k-0 { background: var(--kid-0-soft); box-shadow: inset 4px 0 0 var(--kid-0); }
.kidcard.k-1 { background: var(--kid-1-soft); box-shadow: inset 4px 0 0 var(--kid-1); }
.kidcard.k-both { background: linear-gradient(100deg, var(--kid-0-soft), var(--kid-1-soft)); box-shadow: inset 4px 0 0 var(--kid-0), inset -4px 0 0 var(--kid-1); }
.kc-top { display: flex; align-items: center; gap: .55rem; }
.kc-emoji { font-size: 1.6rem; width: 2.6rem; height: 2.6rem; display: grid; place-items: center; border-radius: 50%; background: var(--surface); flex: none; }
.kc-name { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.2; }
.kc-name strong { font-family: var(--fun); font-size: 1.15rem; font-weight: 600; }
.kc-name span { font-size: .85rem; color: var(--muted); font-weight: 600; }
.k-0 .kc-name strong { color: var(--kid-0-ink); } .k-1 .kc-name strong { color: var(--kid-1-ink); }
.kidcard .edit { border: 0; background: transparent; cursor: pointer; color: var(--faint); border-radius: 8px; padding: .2rem .35rem; }
.kc-dl { display: grid; grid-template-columns: auto 1fr; gap: .1rem .6rem; margin: .45rem 0 0; font-size: .88rem; }
.kc-dl dt { color: var(--muted); font-weight: 600; white-space: nowrap; } .kc-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.kc-notes { font-size: .85rem; margin: .4rem 0 0; color: var(--text); }
.kidcard .fam-empty { padding-top: .4rem; }

.wkgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .45rem; }
.wkgrid.cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } .wkgrid.cols-7 { grid-template-columns: repeat(7, minmax(0, 1fr)); }
.wkday { background: var(--bg); border-radius: 14px; padding: .4rem .45rem .5rem; min-width: 0; }
.wkday.today { outline: 3px solid var(--week); }
.wkday h3, .wkany h3, .wkrules h3 { font-family: var(--fun); font-size: .9rem; font-weight: 600; margin: 0 0 .3rem; color: var(--muted); }
.wkday.today h3 { color: var(--text); }
.wkday .short { display: none; }
.wkday ul, .wkany ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; }
.wkany ul { flex-direction: row; flex-wrap: wrap; }
.wk { background: var(--surface); border-radius: 10px; padding: .3rem .45rem; font-size: .82rem; line-height: 1.3; cursor: pointer; border-left: 4px solid var(--week); min-width: 0; overflow-wrap: anywhere; }
.wk:hover { outline: 2px solid var(--line-strong); }
.wk.t-club { border-left-color: var(--club); }
.wk.k-0 { box-shadow: inset 0 -3px 0 var(--kid-0); } .wk.k-1 { box-shadow: inset 0 -3px 0 var(--kid-1); }
.wk.k-both { box-shadow: inset 0 -3px 0 transparent; background-image: linear-gradient(90deg, var(--kid-0) 50%, var(--kid-1) 50%); background-size: 100% 3px; background-repeat: no-repeat; background-position: bottom; }
.wk-t { display: block; font-weight: 600; } .wk-m { display: block; color: var(--muted); font-size: .74rem; } .wk-m:empty { display: none; }
.wk-free { color: var(--faint); margin: 0; font-size: .8rem; }
.wkany, .wkrules { margin-top: .65rem; }

.spell { border-radius: 14px; padding: .5rem .6rem; background: var(--bg); }
.spell + .spell { margin-top: .5rem; }
.sp-h { display: flex; align-items: center; gap: .4rem; flex-wrap: wrap; }
.sp-who { font-family: var(--fun); font-weight: 600; border-radius: 999px; padding: 0 .55rem; }
.spell.k-0 .sp-who { background: var(--kid-0); color: var(--kid-0-ink); } .spell.k-1 .sp-who { background: var(--kid-1); color: var(--kid-1-ink); }
.spell.k-both .sp-who { background: linear-gradient(90deg, var(--kid-0) 50%, var(--kid-1) 50%); color: var(--kid-0-ink); }
.sp-t { flex: 1; min-width: 0; font-weight: 600; font-size: .88rem; }
.sp-h .edit { border: 0; background: transparent; cursor: pointer; color: var(--faint); }
.words { list-style: none; display: flex; flex-wrap: wrap; gap: .3rem; margin: .45rem 0 .3rem; padding: 0; }
.words li { font-family: var(--fun); font-size: 1rem; font-weight: 500; padding: .12rem .6rem; border-radius: 999px; background: var(--surface); border: 2px solid var(--spellc); }
.spell.k-0 .words li { border-color: var(--kid-0); } .spell.k-1 .words li { border-color: var(--kid-1); }
.spell.k-both .words li:nth-child(odd) { border-color: var(--kid-0); } .spell.k-both .words li:nth-child(even) { border-color: var(--kid-1); }
.spell .meta { font-size: .78rem; color: var(--muted); margin: 0; }
.lower { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 1000px) { .lower { grid-template-columns: 1fr 1fr; } }
@media (max-width: 640px) {
  .lower { grid-template-columns: 1fr; }
  .wkgrid, .wkgrid.cols-6, .wkgrid.cols-7 { grid-template-columns: 1fr; gap: .3rem; }
  .wkday { display: grid; grid-template-columns: 2.6rem 1fr; gap: .5rem; align-items: start; padding: .35rem .45rem; }
  .wkday h3 { margin: .15rem 0 0; } .wkday .long { display: none; } .wkday .short { display: inline; }
  .wkday ul { flex-direction: row; flex-wrap: wrap; }
}

/* ---- 0005: pinned Homework + Challenge, sticky sidebar, collapsible sections, challenges ---- */
body.fam { --chal: #eab308; --chal-a: #7c2d12; --chal-b: #b45309; }
.card-h .sum { margin-left: auto; white-space: nowrap; }
.card-h .sum:empty { display: none; }
.layout { display: block; }
.side { grid-column: 2; grid-row: 1; position: sticky; top: .75rem; display: flex; flex-direction: column; gap: .8rem;
  max-height: calc(100vh - 1.5rem); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; padding: 2px; }
.side .tile { display: none; }
.side .sbody { box-shadow: 0 2px 0 var(--line), 0 10px 26px rgba(120, 72, 20, .13);  margin: 0; }
.side .sidecard { margin: 0; }
.card.t-chal { border-top: 5px solid var(--chal); background: linear-gradient(180deg, #fffbeb, var(--surface) 140px); }
@media (prefers-color-scheme: dark) { .card.t-chal { background: var(--surface); } }
.dash { align-items: start; }
.dash > .card.half { grid-column: span 6; }
/* collapsible sections */
.sec-toggle { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; display: flex; align-items: center; gap: .4rem; text-align: left; min-width: 0; flex: 1 1 auto; overflow: hidden; }
.sec-toggle h2 { pointer-events: none; display: block; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sec-toggle::after { content: none; }
body.fam .dash > .card[data-sec],
body.fam #pin-strip > .card[data-sec] { --strip: var(--line-strong); border-left: 6px solid var(--strip); }
body.fam .dash > .card.t-cal, body.fam #pin-strip > .card.t-cal { --strip: var(--accent); }
body.fam .dash > .card.t-learn, body.fam #pin-strip > .card.t-learn { --strip: var(--spellc); }
body.fam .dash > .card.t-club, body.fam #pin-strip > .card.t-club { --strip: var(--club); }
body.fam .dash > .card.t-trip, body.fam #pin-strip > .card.t-trip { --strip: var(--trip); }
body.fam .dash > .card.t-payment, body.fam #pin-strip > .card.t-payment { --strip: var(--payment); }
body.fam .dash > .card.t-notes, body.fam #pin-strip > .card.t-notes { --strip: var(--event); }
body.fam .dash > .card.t-school, body.fam #pin-strip > .card.t-school { --strip: var(--kid-0); }
body.fam .dash > .card[data-sec]:not(.is-open),
body.fam #pin-strip > .card[data-sec]:not(.is-open) { border-top-width: 0; }
.card[data-sec] > .card-h { cursor: pointer; border-radius: 12px; }
.card[data-sec]:not(.is-open) > .card-h { background: color-mix(in srgb, var(--strip) 12%, transparent); }
.card[data-sec].is-open > .card-h { background: color-mix(in srgb, var(--strip) 20%, var(--surface)); margin: -.15rem -.2rem .55rem; padding: .28rem .35rem .28rem .45rem; }
.sec-chev { order: 8; flex: none; width: 1.45rem; height: 1.45rem; display: grid; place-items: center; border-radius: 999px; border: 2px solid var(--strip, var(--line-strong)); background: var(--surface); font-size: .9rem; line-height: 1; transition: transform .28s ease; }
@media (max-width: 640px) {
  .card[data-sec] > .card-h { gap: .3rem; }
  .sec-toggle { flex: 1 1 auto; min-width: 0; }
  .sec-toggle h2 { font-size: .95rem; }
  .card[data-sec] > .card-h .sum { flex: none; max-width: none; overflow: visible; text-overflow: clip; white-space: nowrap; font-size: .68rem; padding: 0 .4rem; }
  .card[data-sec] > .card-h .undo-btn { flex: none; padding: .05rem .4rem; font-size: .68rem; }
}
.card[data-sec].is-open > .card-h .sec-chev { transform: rotate(180deg); }
.card[data-sec] > .sec-body { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .32s ease, opacity .22s ease; }
.card[data-sec].is-open > .sec-body { grid-template-rows: 1fr; opacity: 1; }
.sec-body-inner { overflow: hidden; min-height: 0; }
.card[data-sec]:not(.is-open) > .card-h { margin-bottom: 0; }
.card[data-sec]:not(.is-open) > .card-h .btn { display: none; }
@media (prefers-reduced-motion: reduce) {
  .card[data-sec] > .sec-body, .sec-toggle::after, .animal-img.play { transition: none; animation: none; }
}
.dash > .cal-card { margin-top: 0; }
.card[data-sec] > .card-h .sum { order: 2; }
.card[data-sec] > .card-h .btn { order: 3; }
.card[data-sec] > .card-h .sec-toggle { order: 1; }
.card[data-sec] > .card-h .sum { background: var(--bg); border-radius: 999px; padding: .08rem .55rem; font-size: .74rem; }
.card[data-sec] > .card-h .sum.hot { background: #fee2e2; color: #991b1b; }
.cal-card > .card-h { margin-bottom: .4rem; }

/* challenges */
.chal-switch { display: flex; gap: .3rem; flex-wrap: wrap; margin: 0 0 .55rem; }
.chal-switch button { font: inherit; font-size: .8rem; font-weight: 600; border: 2px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 999px; padding: .12rem .6rem; cursor: pointer; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chal-switch button[aria-pressed="true"] { background: var(--chal); border-color: var(--chal); color: var(--kid-0-ink); }
.chal-switch button.done-c { opacity: .7; }
.chal-h { display: flex; align-items: flex-start; gap: .4rem; }
.chal-h h3 { font-family: var(--fun); font-weight: 600; font-size: 1.08rem; margin: 0; flex: 1; min-width: 0; line-height: 1.25; }
.chal-h .edit { border: 0; background: transparent; cursor: pointer; color: var(--faint); border-radius: 8px; padding: .1rem .35rem; font-size: 1rem; }
.chal-h .edit:hover { background: var(--accent-soft); }
.chal-desc { font-size: .85rem; color: var(--muted); margin: .25rem 0 0; white-space: pre-line; }
.prize { font-family: var(--fun); font-weight: 600; background: linear-gradient(90deg, #fde68a, #fbcfe8); color: var(--kid-0-ink); border-radius: 12px; padding: .4rem .6rem; font-size: .93rem; margin: .45rem 0 .2rem; line-height: 1.3; }
.chal-meta { font-size: .76rem; color: var(--muted); margin: .2rem 0 0; display: flex; gap: .35rem; flex-wrap: wrap; align-items: center; }
.girl { margin-top: .55rem; }
.girl .gh { display: flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .88rem; margin-bottom: .3rem; }
.girl .nm { font-family: var(--fun); font-weight: 600; border-radius: 999px; padding: 0 .55rem; white-space: nowrap; background: var(--accent-soft); }
.girl.k-0 .nm { background: var(--kid-0); color: var(--kid-0-ink); } .girl.k-1 .nm { background: var(--kid-1); color: var(--kid-1-ink); }
.pbar { flex: 1; height: 10px; background: var(--line); border-radius: 9px; overflow: hidden; min-width: 40px; }
.pbar i { display: block; height: 100%; background: var(--accent); border-radius: 9px; transition: width .3s; }
.girl.k-0 .pbar i { background: var(--kid-0); } .girl.k-1 .pbar i { background: var(--kid-1); }
.girl .pn { font-variant-numeric: tabular-nums; white-space: nowrap; }
.steps { display: flex; flex-wrap: wrap; gap: .28rem; list-style: none; margin: 0; padding: 0; }
.step { font: inherit; font-size: .76rem; font-weight: 700; border-radius: 999px; padding: .14rem .55rem; border: 2px dashed var(--line-strong); background: var(--surface); color: var(--muted); cursor: pointer; text-align: left; }
.step:hover { border-style: solid; }
.step[aria-pressed="true"] { border-style: solid; border-color: var(--accent); background: var(--accent); color: #fff; }
.girl.k-0 .step[aria-pressed="true"] { background: var(--kid-0); border-color: var(--kid-0); color: var(--kid-0-ink); }
.girl.k-1 .step[aria-pressed="true"] { background: var(--kid-1); border-color: var(--kid-1); color: var(--kid-1-ink); }
.step[aria-pressed="true"]::before { content: '✓ '; }
.step:disabled { cursor: progress; opacity: .7; }
.chal-foot { font-size: .74rem; color: var(--muted); margin: .55rem 0 0; }
.chal-foot button { font: inherit; border: 0; background: none; color: var(--accent); font-weight: 600; cursor: pointer; padding: 0; }
.mini { display: flex; gap: .3rem; align-items: center; font-size: .74rem; font-weight: 700; margin-top: .15rem; }
.mini .b { flex: 1; height: 7px; background: rgba(255,255,255,.35); border-radius: 9px; overflow: hidden; }
.mini .b i { display: block; height: 100%; border-radius: 9px; }
/* steps editor (challenge form) */
.steped { display: flex; flex-direction: column; gap: .3rem; }
.steped ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .3rem; max-height: 40vh; overflow-y: auto; }
.steped li { display: flex; gap: .3rem; align-items: center; }
.steped li .no { font-family: var(--fun); color: var(--muted); width: 1.4rem; text-align: right; flex: none; }
.steped li input { flex: 1; min-width: 0; }
.steped li button, .steped .addstep { font: inherit; border: 1px solid var(--line-strong); background: var(--surface); color: var(--text); border-radius: 8px; cursor: pointer; width: 2rem; height: 2rem; flex: none; }
.steped li button:disabled { opacity: .35; cursor: default; }
.steped .addstep { width: auto; padding: 0 .7rem; align-self: flex-start; border-radius: 999px; }

@media (max-width: 999px) {
  #dash > .card { scroll-margin-top: .6rem; }
  .layout { display: block; }
  .side { position: sticky; top: 0; z-index: 30; display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; max-height: none; overflow: visible;
    margin: 0 -.75rem .7rem; padding: .5rem .75rem .55rem; background: color-mix(in srgb, var(--bg) 94%, transparent); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 14px rgba(120, 72, 20, .10); }
  .sidecard { display: contents; }
  .side .tile { display: block; grid-row: 1; }
  #hw-card .tile { grid-column: 1; } #ch-card .tile { grid-column: 2; }
  .side .sbody { display: none; grid-row: 2; grid-column: 1 / -1; max-height: min(62vh, 520px); overflow-y: auto; overscroll-behavior: contain; margin: 0; }
  .side .sbody.open { display: block; }
  .tile { border: 0; text-align: left; border-radius: 18px; padding: .5rem .65rem .55rem; color: #fff; font: inherit; cursor: pointer; position: relative; min-height: 76px; min-width: 0; box-shadow: 0 3px 0 rgba(0,0,0,.12); }
  .tile .tt { display: block; font-family: var(--fun); font-weight: 700; font-size: 1rem; white-space: nowrap; padding-right: 2.2rem; }
  .tile .cnt { position: absolute; top: .45rem; right: .45rem; background: #fff; color: #0369a1; border-radius: 999px; font-size: .72rem; padding: .05rem .45rem; font-weight: 800; white-space: nowrap; }
  .tile .ln { display: block; font-size: .76rem; font-weight: 600; line-height: 1.3; margin-top: .15rem; padding-right: .6rem; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .tile .chev { position: absolute; right: .5rem; bottom: .3rem; font-size: .75rem; opacity: .85; transition: transform .15s; }
  .tile[aria-expanded="true"] { outline: 3px solid #111827; outline-offset: 2px; }
  .tile[aria-expanded="true"] .chev { transform: rotate(180deg); }
  .tile.hw { background: linear-gradient(135deg, #0ea5e9, #2563eb); }
  .tile.ch { background: linear-gradient(135deg, var(--chal-a) 0%, var(--chal-b) 45%, var(--chal) 100%); }
  .tile.ch .cnt { color: var(--chal-a); }
  .tile.ch .ln { -webkit-line-clamp: 3; }
  .dash > .card.half { grid-column: span 12; }
  body.fam .fam-bar { margin-bottom: .6rem; }
  body.fam .fam-hero { margin-bottom: .5rem; }
}
@media (max-width: 640px) {
  .add-row { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; width: 100%; padding-bottom: 2px; }
  .add-row::-webkit-scrollbar { display: none; }
  .add-row .btn { white-space: nowrap; flex: none; }
  .fam-stats { display: none; }
  .dash { gap: .5rem; }
  body.fam .dash > .card { padding: .7rem .8rem; }
  .step { font-size: .72rem; padding: .1rem .45rem; }
}

/* Phone notifications button (header) - state via data-state: off | on | blocked | ios-install | busy */
body.fam .push-btn { font-family: var(--fun); font-weight: 600; border: 2px solid var(--accent); background: var(--accent-soft); color: var(--text); white-space: nowrap; }
body.fam .push-btn:hover { background: var(--accent); color: var(--accent-ink); }
body.fam .push-btn[data-state="on"] { border-color: var(--payment); background: var(--payment-soft); }
body.fam .push-btn[data-state="blocked"] { border-color: var(--line-strong); background: transparent; color: var(--muted); }
body.fam .push-btn[data-state="busy"] { opacity: .65; cursor: progress; }
body.fam .push-help { border-radius: var(--radius); }
body.fam .push-help .row { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; }

/* ---- Reading & learning, school info, files, undo, layout (0008) ---- */
.card.t-learn { border-top: 5px solid var(--spellc); }
.card.t-school { border-top: 5px solid var(--kid-0); }
.lkids, .subtabs { display: flex; gap: .35rem; overflow-x: auto; scrollbar-width: none; margin: 0 0 .55rem; }
.lkids::-webkit-scrollbar, .subtabs::-webkit-scrollbar { display: none; }
.lkid, .subtabs button { font: inherit; font-weight: 700; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); color: var(--text); padding: .28rem .7rem; cursor: pointer; white-space: nowrap; flex: none; }
.lkid { font-family: var(--fun); font-size: 1rem; padding: .35rem .9rem; }
.lkid.k-0[aria-pressed="true"] { background: var(--kid-0); border-color: var(--kid-0); color: var(--kid-0-ink); }
.lkid.k-1[aria-pressed="true"] { background: var(--kid-1); border-color: var(--kid-1); color: var(--kid-1-ink); }
.lkid.k-2[aria-pressed="true"] { background: var(--kid-2); border-color: var(--kid-2); color: var(--kid-2-ink); }
.lkid.k-3[aria-pressed="true"] { background: var(--kid-3); border-color: var(--kid-3); color: var(--kid-3-ink); }
.subtabs button[aria-selected="true"], .subtabs button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.read-top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .4rem; }
.read-count { display: flex; align-items: center; gap: .4rem; font-size: .82rem; font-weight: 700; color: var(--muted); }
.wdots { display: inline-flex; gap: .22rem; }
.wdots i { width: .7rem; height: .7rem; border-radius: .2rem; background: #e7d3b0; display: inline-block; }
.wdots i.on { background: #f5b301; }
.add-read { display: block; width: 100%; font: inherit; font-family: var(--fun); font-weight: 650; font-size: 1rem; background: var(--kid-0); color: var(--kid-0-ink); border: 0; border-radius: 999px; padding: .55rem .8rem; cursor: pointer; margin: .2rem 0 .6rem; }
.read-table { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); border: 1px solid var(--line-strong); border-radius: 14px; overflow: hidden; }
.read-table .rh { background: #fff6e8; font-size: .68rem; font-weight: 800; letter-spacing: .04em; color: var(--muted); padding: .4rem .55rem; }
.read-table .rc { padding: .55rem; border-top: 1px solid var(--line); min-width: 0; }
.read-table .rd { font-weight: 800; }
.read-table .rb { font-weight: 650; overflow-wrap: anywhere; }
.read-table .rp, .read-table .comment { font-size: .84rem; color: var(--muted); }
.read-table .span2 { grid-column: 1 / -1; }
.reader { display: inline-block; margin-top: .25rem; background: var(--accent); color: #fff; font-size: .68rem; font-weight: 800; border-radius: 999px; padding: 0 .4rem; }
.panel-add { display: flex; justify-content: flex-end; margin-bottom: .35rem; }
.tt-ns { display: flex; gap: .3rem; overflow-x: auto; scrollbar-width: none; margin-bottom: .55rem; }
.tt-ns::-webkit-scrollbar { display: none; }
.tt-n { font: inherit; font-weight: 800; border-radius: 999px; border: 2px solid var(--line-strong); background: var(--surface); min-width: 2.6rem; padding: .3rem .45rem; cursor: pointer; flex: none; }
.tt-n[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.tt-cols { display: grid; grid-template-columns: 1fr 1fr; gap: .35rem; }
.tt-fact { font: inherit; display: flex; justify-content: space-between; gap: .4rem; width: 100%; text-align: left; background: #fff6e8; border: 0; border-radius: 12px; padding: .38rem .55rem; margin: 0 0 .28rem; cursor: pointer; font-weight: 700; }
.tt-fact .ans { color: var(--accent); font-variant-numeric: tabular-nums; }
.tt-fact .ans.hid { visibility: hidden; }
.tt-full { overflow-x: auto; margin: .4rem 0; }
.tt-full table { border-collapse: collapse; font-size: .72rem; font-variant-numeric: tabular-nums; }
.tt-full th, .tt-full td { border: 1px solid var(--line); padding: .15rem .3rem; text-align: center; min-width: 1.5rem; }
.tt-tools { display: flex; flex-wrap: wrap; gap: .5rem .8rem; align-items: center; margin-top: .45rem; font-size: .84rem; }
.soundgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .4rem; }
.sound { font: inherit; text-align: center; background: #f3e8ff; border: 0; border-radius: 14px; padding: .55rem .3rem; cursor: pointer; min-width: 0; }
.sound strong { display: block; color: var(--accent); font-size: 1.15rem; }
.sound span { display: block; font-size: .72rem; color: var(--muted); overflow-wrap: anywhere; }
.sound.on { outline: 2px solid var(--accent); }
.sound-ex { margin-top: .5rem; }
.words button.word { font: inherit; font-family: var(--fun); font-size: 1rem; font-weight: 500; background: transparent; border: 0; padding: 0; cursor: pointer; color: inherit; }
.word-tools { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; margin-bottom: .4rem; }
.word-tools input { flex: 1; min-width: 8rem; }
.word-count { font-size: .8rem; font-weight: 700; color: var(--muted); white-space: nowrap; }
.azbar { display: flex; flex-wrap: wrap; gap: .15rem .28rem; margin: .2rem 0 .45rem; }
.az { font: inherit; font-size: .75rem; font-weight: 800; border: 0; background: transparent; color: var(--faint); padding: .05rem .12rem; cursor: pointer; }
.az[aria-pressed="true"] { color: var(--accent); }
.az:disabled { opacity: .35; cursor: default; }
.wordcols { display: grid; grid-template-columns: 1fr 1fr; gap: .15rem .6rem; }
.wrow { display: flex; align-items: center; gap: .35rem; font-size: .92rem; min-width: 0; }
.wrow .wname { font: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-align: left; overflow-wrap: anywhere; }
.hint { font-size: .75rem; color: var(--muted); margin: .45rem 0 0; }
.linkish { font: inherit; background: none; border: 0; padding: 0; color: var(--accent); font-weight: 700; cursor: pointer; }
.school-q { width: 100%; margin-top: .55rem; }
.linktiles { display: grid; grid-template-columns: 1fr; gap: .4rem; }
@media (min-width: 560px) { .linktiles { grid-template-columns: 1fr 1fr; } }
.linktile { display: flex; align-items: center; gap: .3rem; background: var(--bg); border-radius: 12px; padding: .45rem .55rem; min-width: 0; }
.linktile a { flex: 1; min-width: 0; text-decoration: none; color: inherit; }
.linktile strong, .linktile span { display: block; overflow-wrap: anywhere; }
.linktile span { font-size: .75rem; color: var(--muted); }
.thumbs { display: flex; flex-wrap: wrap; gap: .35rem; margin-top: .35rem; }
.thumb { width: 3.4rem; height: 3.4rem; border-radius: 10px; border: 1px dashed var(--line-strong); background: var(--bg); padding: 0; overflow: hidden; cursor: pointer; font: inherit; font-size: .68rem; font-weight: 800; color: var(--muted); }
.thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumb.pdf, .thumb .pdf { display: grid; place-items: center; width: 100%; height: 100%; background: #e8eefc; color: #1d4ed8; font-size: .68rem; font-weight: 800; }
.thumb.add { border-style: dashed; }
.grip { order: 0; flex: none; border: 0; background: transparent; color: var(--faint); cursor: pointer; font-size: 1rem; padding: .1rem .2rem; border-radius: 8px; }
.grip:hover, .grip:focus-visible { background: var(--accent-soft); color: var(--text); }
.card[data-sec] > .card-h .undo-slot { order: 3; }
.undo-btn { font: inherit; font-weight: 800; font-size: .75rem; border: 0; border-radius: 999px; background: var(--accent); color: #fff; padding: .2rem .55rem; cursor: pointer; }
.undo-toast { position: fixed; left: 50%; bottom: 5.4rem; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: .55rem; width: min(92vw, 26rem); background: #1f1630; color: #fff; border-radius: 14px; padding: .5rem .55rem .5rem .8rem; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.undo-toast > span:nth-child(2) { flex: 1; min-width: 0; line-height: 1.3; }
.undo-toast[hidden] { display: none; }
.undo-toast .ok { color: #86efac; font-weight: 800; }
.undo-toast .btn { background: var(--kid-0); color: var(--kid-0-ink); border: 0; }
.recent { margin-top: .45rem; }
.recent summary { cursor: pointer; font-weight: 700; font-size: .86rem; color: var(--muted); }
.restore { font: inherit; font-weight: 700; font-size: .78rem; border: 1px solid var(--line-strong); background: var(--surface); border-radius: 999px; padding: .2rem .55rem; cursor: pointer; flex: none; }
.recent .rows li.done .ttl { text-decoration: none; color: var(--text); }
.move-menu { position: fixed; z-index: 70; background: var(--surface); border-radius: 16px; box-shadow: 0 12px 40px rgba(40, 20, 60, .25); padding: .35rem; min-width: 14rem; }
.move-menu button { font: inherit; display: flex; gap: .45rem; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px; padding: .45rem .55rem; cursor: pointer; font-weight: 650; }
.move-menu button:hover, .move-menu button:focus-visible { background: var(--accent-soft); }
.move-menu button:disabled { opacity: .35; cursor: default; }
.move-menu .hint { margin: .35rem .4rem .2rem; }
.hidden-box { border: 1.5px dashed var(--line-strong); }
/* Author `display` rules beat the hidden attribute. Keep these actually hidden. */
.dash > [hidden], .wrow[hidden], #school .kidcard[hidden], #school li[hidden], #school .linktile[hidden] { display: none !important; }
.hidden-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .3rem 0; }
dialog.teacher, dialog.viewer { width: min(920px, 100vw); max-width: 100vw; border: 0; border-radius: 18px; padding: .8rem 1rem 1rem; }
dialog.teacher::backdrop, dialog.viewer::backdrop { background: rgba(28, 18, 48, .55); }
.teacher-h { display: flex; flex-wrap: wrap; gap: .35rem .6rem; align-items: center; }
.teacher-h h2 { flex: 1 1 12rem; }
.teacher-nav { display: flex; gap: .3rem; flex-wrap: wrap; }
.teacher-table { width: 100%; border-collapse: collapse; font-size: .82rem; margin-top: .4rem; }
.teacher-table th, .teacher-table td { border-bottom: 1px solid var(--line); text-align: left; padding: .28rem .3rem; vertical-align: top; }
.teacher-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.teacher-table tfoot th { background: #fff6c7; }
.signs { display: grid; gap: .8rem; margin-top: .8rem; }
.signs .line { display: inline-block; border-bottom: 1px solid var(--text); min-width: 9rem; margin-left: .4rem; }
.viewer-bar { display: flex; justify-content: space-between; gap: .5rem; align-items: center; font-size: .8rem; margin-bottom: .4rem; }
.viewer-actions { display: flex; gap: .3rem; flex: none; }
dialog.viewer[open] { height: min(92vh, 860px); display: flex; flex-direction: column; }
dialog.viewer:not([open]), dialog.teacher:not([open]) { display: none !important; }
dialog.viewer img, dialog.viewer iframe { flex: 1; width: 100%; min-height: 0; border: 0; object-fit: contain; background: #f4f0ea; }
.msg-img { display: block; max-width: 100%; max-height: 220px; border-radius: 10px; margin: .25rem 0; cursor: pointer; }
.msg-file { font-size: .78rem; color: inherit; }
.chat-form .clip { flex: none; width: 2.6rem; height: 2.6rem; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--surface); cursor: pointer; font-size: 1.1rem; }
.attach-chip { font-size: .8rem; margin: 0 .9rem; }
.ver { font-size: .8rem; margin: .2rem 0 0; }
.ver a { font-weight: 800; }
.changes { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: .7rem; }
.changes article { border: 2px solid var(--accent); border-radius: 16px; padding: .8rem .9rem; }
.changes .when { float: right; color: var(--muted); font-size: .8rem; }
.here { display: inline-block; background: var(--accent); color: #fff; border-radius: 999px; font-size: .72rem; font-weight: 800; padding: .05rem .45rem; margin-left: .35rem; }
@media (max-width: 640px) {
  .soundgrid { gap: .3rem; }
  .sound { padding: .45rem .2rem; }
  .sound strong { font-size: 1rem; }
  dialog.teacher, dialog.viewer { width: 100vw; height: 100vh; max-height: 100vh; border-radius: 0; margin: 0; }
  .teacher-table { font-size: .74rem; }
}
@media print {
  body.fam.printing-sheet > *:not(dialog) { display: none !important; }
  body.fam.printing-sheet dialog.teacher { position: static; width: auto; height: auto; max-height: none; box-shadow: none; }
  body.fam.printing-sheet .teacher-nav { display: none; }
  body.fam.printing-sounds .site-header,
  body.fam.printing-sounds .fam-hero,
  body.fam.printing-sounds .fam-bar,
  body.fam.printing-sounds .side,
  body.fam.printing-sounds .chat-fab,
  body.fam.printing-sounds .chat-panel,
  body.fam.printing-sounds .site-footer,
  body.fam.printing-sounds #dash > :not(#learn-card) { display: none !important; }
  body.fam.printing-sounds #learn-card,
  body.fam.printing-sounds #learn-card.is-open > :not(.card-h) { display: block !important; }
  body.fam.printing-sounds #learn-card .lkids,
  body.fam.printing-sounds #learn-card .card-h,
  body.fam.printing-sounds #learn-card #reading,
  body.fam.printing-sounds #learn-card #spellings,
  body.fam.printing-sounds #learn-card #times,
  body.fam.printing-sounds #learn-card #wordlist { display: none !important; }
}
@media (prefers-color-scheme: dark) {
  .read-table .rh, .tt-fact { background: var(--surface); }
  .sound { background: #2c2242; }
  .wdots i { background: #4a3b28; }
  .teacher-table tfoot th { background: #3a3210; color: var(--kid-0-ink); }
  .easel-fade { background: linear-gradient(90deg, rgba(23, 19, 31, .55) 0%, rgba(23, 19, 31, .2) 50%, transparent 100%); }
  .easel-copy h1, .easel-copy .page-date { color: #f6e9ff; text-shadow: 0 1px 2px rgba(0, 0, 0, .55); }
}

/* ---- Easel header: one continuous picture, title on the left sky ---- */
.easel { position: relative; width: 100%; aspect-ratio: 1600 / 500; margin: 0 0 .55rem; border-radius: 18px; overflow: hidden;
  background: #f8e6d4; box-shadow: 0 6px 16px rgba(120, 72, 20, .1); }
.easel-fade { position: absolute; z-index: 1; left: 0; top: 0; bottom: 0; width: 38%; pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 246, 236, .5) 0%, rgba(255, 246, 236, .12) 62%, rgba(255, 246, 236, 0) 100%); }
.easel-stack { position: absolute; inset: 0; width: 100%; height: 100%; }
.easel-stack picture { position: absolute; inset: 0; margin: 0; }
.easel-stack img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.easel-hit { position: absolute; z-index: 3; border: 0; padding: 0; margin: 0; background: transparent; cursor: pointer; }
.easel-hit:focus-visible { outline: 3px solid #6d3df5; outline-offset: 2px; border-radius: 18px; }
/* The template header is text only. These rules used to position a hero illustration. */
@keyframes fam-wiggle {
  0% { transform: translateY(0) rotate(0); }
  30% { transform: translateY(-2%) rotate(-2.4deg); }
  55% { transform: translateY(0) rotate(2deg); }
  75% { transform: translateY(-1%) rotate(-1deg); }
  100% { transform: translateY(0) rotate(0); }
}
.animal-img.play { animation: fam-wiggle .6s ease; }
.easel-copy { position: absolute; z-index: 2; left: .65rem; top: .45rem; display: flex; align-items: flex-start; gap: .4rem;
  max-width: min(15rem, 46%); background: none; padding: 0; }
.easel-copy .brand-mark { width: 28px; height: 28px; border-radius: 8px; box-shadow: 0 1px 2px rgba(80, 40, 20, .18); }
.easel-copy h1, .easel-copy .page-date { font-family: 'Baloo 2', 'Fredoka', ui-rounded, system-ui, sans-serif; color: #2a1848;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .9), 0 0 10px rgba(255, 248, 239, .95); }
.easel-copy h1 { font-weight: 700; font-size: clamp(1.15rem, 3.4vw, 1.6rem); line-height: 1.05; margin: 0; }
.easel-copy .page-date { margin: .05rem 0 0; font-weight: 600; font-size: .78rem; line-height: 1.2; }
@media (max-width: 640px) {
  .easel { height: 140px; aspect-ratio: auto; }
  .easel-stack { inset: auto; top: 0; right: 0; height: 100%; width: auto; aspect-ratio: 1600 / 500; }
  .easel-copy { max-width: 52%; top: .4rem; left: .5rem; }
  .easel-copy h1 { font-size: 1.2rem; }
}

/* ---- Pins, sheet, hold menu, edit mode, reading photo ---- */
.pin-strip { display: flex; flex-direction: column; gap: .65rem; margin: 0 0 .7rem; grid-column: 1 / -1; }
#pin-strip > section + section { margin-top: 0; }
.pin-strip[hidden] { display: none !important; }
.pin-line { display: none; }
body.fam #pin-strip > .card.is-pinned { padding: .95rem 1rem 1rem; min-height: 6.4rem; border: 2px solid var(--strip); border-left-width: 12px;
  background: color-mix(in srgb, var(--strip) 34%, var(--surface));
  box-shadow: 0 10px 22px color-mix(in srgb, var(--strip) 32%, transparent); }
#pin-strip > .card.is-pinned:not(.is-open) h2 { font-size: 1.2rem; }
#pin-strip > .card.is-pinned:not(.is-open) > .sec-body { display: none !important; }
#pin-strip > .card.is-pinned:not(.is-open) > .card-h { margin: 0; min-height: 4.4rem; background: transparent; align-items: flex-start; }
#pin-strip > .card.is-pinned:not(.is-open) .grip,
#pin-strip > .card.is-pinned:not(.is-open) .edit-tools,
#pin-strip > .card.is-pinned:not(.is-open) .sum,
#pin-strip > .card.is-pinned:not(.is-open) .undo-slot { display: none; }
#pin-strip > .card.is-pinned:not(.is-open) .sec-toggle { flex: 1 1 auto; min-width: 0; max-width: none; }
#pin-strip > .card.is-pinned:not(.is-open) > .card-h { flex-wrap: wrap; }
#pin-strip > .card.is-pinned:not(.is-open) .pin-line { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; order: 9; flex: 1 0 100%; min-width: 0; margin: .28rem 0 0; font-size: .92rem; font-weight: 650; line-height: 1.35; color: var(--text); white-space: normal; overflow: hidden; }
#pin-strip > .card.is-pinned .pin-toggle { width: 2rem; height: 2rem; background: var(--strip); color: #fff; border-color: transparent; }
#pin-strip > .card.is-pinned .pin-toggle .pin-glyph { fill: currentColor; }
#pin-strip > .pin-tile { min-height: 0; flex-direction: row; flex-wrap: wrap; align-items: center; gap: .45rem; padding: .45rem .7rem; }
#pin-strip > .pin-tile strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
#pin-strip > .pin-tile .pin-text { flex: 1 0 100%; white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden; line-height: 1.3; }
.pin-tile { text-align: left; border: 0; border-radius: 18px; padding: .7rem .8rem .75rem; color: #fff; cursor: pointer; min-height: 92px;
  font: inherit; box-shadow: 0 6px 16px rgba(40, 20, 60, .12); display: flex; flex-direction: column; gap: .2rem; }
.pin-tile strong { font-family: 'Baloo 2', var(--fun), sans-serif; font-size: 1.15rem; }
.pin-tile .pin-text { font-size: .82rem; line-height: 1.3; }
.pin-tile.t-notes, .pin-tile.t-events { background: linear-gradient(160deg, #0f9f8f, #0b7a6c); }
.pin-tile.t-homework, .pin-tile.t-learn { background: linear-gradient(160deg, #2563eb, #1d4ed8); }
.pin-tile.t-clubs, .pin-tile.t-spell { background: linear-gradient(160deg, #7c3aed, #6d28d9); }
.pin-tile.t-pay, .pin-tile.t-trips { background: linear-gradient(160deg, #ea580c, #c2410c); }
.pin-tile.t-school, .pin-tile.t-read, .pin-tile.t-challenges, .pin-tile.t-words, .pin-tile.t-times, .pin-tile.t-sounds { background: linear-gradient(160deg, #db2777, #be185d); }
.pin-toggle { position: relative; order: 4; flex: none; width: 1.45rem; height: 1.45rem; margin-left: .1rem; display: grid; place-items: center; border-radius: 999px; border: 1.5px solid var(--line-strong); color: var(--muted); background: var(--surface); cursor: pointer; }
.pin-toggle input { position: absolute; width: 1px; height: 1px; opacity: 0; margin: 0; pointer-events: none; }
.pin-glyph { display: block; width: .95rem; height: .95rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pin-toggle:has(input:checked) { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.pin-toggle:has(input:checked) .pin-glyph { fill: currentColor; }
.pin-toast { position: fixed; left: 50%; bottom: 4.6rem; transform: translateX(-50%); z-index: 70; width: min(92vw, 22rem);
  background: #1f1630; color: #fff; border-radius: 14px; padding: .55rem .8rem; font-size: .88rem; font-weight: 600; text-align: center;
  box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
.pin-toast[hidden] { display: none !important; }
.every-week { border: 2px solid #38bdf8; color: #0369a1; background: #fff; font-weight: 700; }
.daynum { font: inherit; font-weight: 700; color: var(--muted); background: none; border: 0; padding: 0; cursor: pointer; text-align: left; }
.mday { cursor: default; }
.mday .ev { text-align: left; cursor: pointer; width: 100%; border: 0; font: inherit; font-size: .84rem; line-height: 1.3; padding: 2px 5px; }
@media (min-width: 641px) {
  .mday { min-height: 104px; }
  .mday .ev { white-space: normal; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
}
@media (min-width: 1100px) {
  body.fam main.container { padding-top: .35rem; }
  .easel { height: 115px; aspect-ratio: auto; margin-bottom: .35rem; }
  .easel-stack { inset: auto; left: 0; width: 100%; height: auto; aspect-ratio: 1600 / 500; top: 58%; transform: translateY(-58%); }
  .easel-copy { top: 50%; transform: translateY(-50%); }
  .easel-copy h1 { font-size: 1.2rem; }
  .easel-copy .page-date { font-size: .72rem; }
  .top-tools { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .55rem; margin: 0 0 .4rem; }
  .top-tools .coming { flex: 1 1 12rem; width: auto; min-width: 0; margin: 0; }
  .top-tools .fam-stats { flex: 0 1 auto; flex-wrap: nowrap; gap: .3rem; }
  .top-tools .pill { padding: .12rem .5rem; font-size: .75rem; }
  .top-tools .fam-bar { flex: none; margin: 0 0 0 auto; }
  .top-tools .chip { padding: .12rem .6rem; font-size: .8rem; }
  .top-tools .notice, .top-tools .push-help { flex: 1 0 100%; }
  .dash > .cal-card { order: -2; grid-column: 1 / -1; }
  .dash:has(> .postits:not([hidden])) > .cal-card { grid-column: 1 / 11; }
  .dash > .postits { order: -2; grid-column: 11 / -1; flex-direction: column; align-items: stretch; margin: 0; padding: .1rem 0 0; gap: .45rem; }
  .dash > .postits .postit { width: auto; min-height: 6.6rem; transform: none; }
  .dash > .postits .postit:nth-child(n) { transform: rotate(-.6deg); }
  .dash > .postits .postit:nth-child(2n) { transform: rotate(.6deg); }
  .dash > .pin-strip { order: -1; }
  .dash > .card.wide:not(.cal-card) { grid-column: span 6; }
  .dash > .hidden-box, .dash > .add-section { grid-column: 1 / -1; }
  body.fam .cal-card { margin-top: 0; padding: .4rem .5rem .35rem; }
  .cal-card > .card-h { margin-bottom: .15rem; }
  .cal-card > .card-h h2 { font-size: .95rem; }
  .cal-top { margin-bottom: .2rem; gap: .3rem; }
  .cal-title { font-size: .9rem; min-width: 0; }
  .cal-nav .btn, .every-week, .seg button { padding: .12rem .5rem; font-size: .75rem; }
  .mgrid { gap: 2px; }
  .mgrid .dow { font-size: .6rem; padding: 0; letter-spacing: .02em; }
  .mday { min-height: 0; padding: .05rem .12rem .08rem; gap: 1px; border-radius: 7px; }
  .mday .ev { font-size: 11px; line-height: 1.15; padding: 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; -webkit-line-clamp: unset; -webkit-box-orient: unset; }
  .legend-row { margin-top: .25rem; font-size: .65rem; gap: .1rem .4rem; }
  .cal-hint { margin: .15rem 0 0; font-size: .7rem; }
}
@media (max-width: 1099px) {
  .dash > .pin-strip { order: -2; }
  .dash > .cal-card { order: -1; }
}
.postits { display: flex; flex-wrap: wrap; gap: .85rem 1rem; margin: .15rem 0 .85rem; padding: .35rem .2rem .15rem; }
.postits[hidden] { display: none !important; }
.postit { width: 9.4rem; min-height: 9.4rem; padding: .8rem .75rem .65rem; border: 0; cursor: pointer; text-align: left; color: #3b2a05;
  background: #ffe56a; box-shadow: 0 8px 16px rgba(120, 80, 10, .18); transform: rotate(-1.5deg);
  font-family: 'Caveat', "Segoe Print", "Bradley Hand", cursive;
  display: flex; flex-direction: column; gap: .3rem; }
.postit:nth-child(2n) { transform: rotate(1.6deg); background: #fff3a1; }
.postit:nth-child(3n) { transform: rotate(-.6deg); }
.postit strong { font-size: 1.05rem; font-weight: 700; line-height: 1.2; }
.postit p { margin: 0; font-size: .95rem; line-height: 1.25; display: -webkit-box; -webkit-line-clamp: 5; -webkit-box-orient: vertical; overflow: hidden; }
.postit-meta { margin-top: auto; display: flex; align-items: center; gap: .35rem; font-family: 'Fredoka', var(--fun), sans-serif; font-size: .72rem; font-weight: 700; }
.postit-meta .mine { margin-left: auto; }
.pin-scope { display: flex; flex-wrap: wrap; gap: .35rem .8rem; }
.day-pager { display: flex; align-items: center; justify-content: space-between; gap: .4rem; margin: 0 0 .45rem; }
.day-pager[hidden] { display: none !important; }
.day-count { font-weight: 800; font-size: .85rem; }
.day-slide { touch-action: pan-y; }
.coming { display: flex; align-items: center; gap: .45rem; width: 100%; margin: 0 0 .45rem; padding: .38rem .75rem; border: 0; border-radius: 999px; background: var(--surface); box-shadow: 0 1px 0 var(--line), 0 4px 14px rgba(120, 72, 20, .06); font: inherit; font-weight: 650; font-size: .9rem; text-align: left; cursor: pointer; color: var(--text); }
.coming span:first-child { flex: 1 1 auto; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.coming-chev { color: var(--muted); font-size: 1.15rem; line-height: 1; }
.coming[hidden] { display: none !important; }
.swipe-hint { margin: 0 auto .35rem; width: fit-content; background: #1f1630; color: #fff; border-radius: 999px; padding: .18rem .7rem; font-size: .74rem; font-weight: 700; }
.swipe-hint[hidden] { display: none !important; }
@media (min-width: 701px) { .swipe-hint { display: none !important; } }
.by { display: inline-grid; place-items: center; width: .95rem; height: .95rem; margin-right: .2rem; border-radius: 999px; font-size: .6rem; font-weight: 800; background: var(--accent-soft); color: var(--accent); vertical-align: 1px; flex: none; }
.by-r { background: #dbeafe; color: #1e40af; }
.by-d { background: #fce7f3; color: #9d174d; }
.detail-by { margin: 0 0 .35rem; color: var(--muted); font-size: .82rem; font-weight: 650; }
.mgrid { transition: transform .2s ease; }
button.dot { border: 0; padding: 0; display: block; cursor: pointer; }
button.dot:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.hold-menu { position: fixed; z-index: 80; background: #fff; color: #1f1630; border-radius: 16px; box-shadow: 0 16px 40px rgba(40, 20, 60, .28); padding: .35rem; min-width: 11rem; }
.hold-menu[hidden] { display: none !important; }
.hold-menu button { font: inherit; display: flex; gap: .45rem; width: 100%; text-align: left; background: transparent; border: 0; border-radius: 10px; padding: .5rem .6rem; cursor: pointer; font-weight: 700; }
.hold-menu button.danger { color: #b91c1c; }
.hold-menu button:hover, .hold-menu button:focus-visible { background: #f4eeff; }
.hold-menu button:disabled { opacity: .35; }
dialog.sheet { margin: auto auto 0; width: min(720px, 100%); max-height: min(86vh, 740px); border: 0; border-radius: 22px 22px 0 0; padding: .9rem 1rem 1.1rem; }
dialog.sheet::backdrop, dialog.detail::backdrop { background: rgba(28, 16, 48, .45); }
dialog.sheet:not([open]), dialog.detail:not([open]) { display: none; }
.sheet-h, .sheet-tools, .detail-actions { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; }
dialog.detail .detail-actions .btn { white-space: nowrap; }
.del-icon { display: none; }
@media (max-width: 520px) {
  dialog.detail { padding: .8rem .7rem .9rem; }
  dialog.detail .detail-actions { flex-wrap: nowrap; gap: .35rem; }
  dialog.detail .detail-actions .btn { padding: .38rem .55rem; font-size: .82rem; }
  dialog.detail .del-word { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
  dialog.detail .del-icon { display: inline; font-size: 1.05rem; line-height: 1; }
  dialog.detail .detail-actions .btn.danger { padding: .32rem .5rem; }
}
.sheet-h { margin-bottom: .4rem; }
.sheet-tools { margin-bottom: .4rem; }
dialog.detail { width: min(520px, calc(100% - 1.4rem)); border: 0; border-radius: 22px; padding: 1rem 1.1rem; }
dialog.detail h2 { font-family: 'Baloo 2', var(--fun), sans-serif; margin: 0 0 .2rem; }
.detail-when { color: var(--muted); margin: 0 0 .6rem; }
dialog.detail dl { display: grid; grid-template-columns: 4.6rem 1fr; gap: .35rem .6rem; margin: 0 0 .8rem; }
dialog.detail dt { color: var(--muted); font-weight: 700; }
dialog.detail dd { margin: 0; }
.cal-hint { margin: .35rem 0 0; }
.edit-tools { display: none; gap: .3rem; }
body.editing .edit-tools { display: inline-flex; }
.edit-tools .mini, .add-section { font: inherit; font-weight: 700; border-radius: 999px; border: 1.5px solid var(--line-strong); background: #fff; padding: .2rem .65rem; cursor: pointer; }
.edit-tools .mini.danger { color: #b91c1c; border-color: #fecaca; }
.add-section { display: none; width: 100%; margin-top: .3rem; border-style: dashed; color: var(--accent); padding: .7rem; grid-column: 1 / -1; }
body.editing .add-section { display: block; }
.rename { font: inherit; font-family: 'Baloo 2', var(--fun), sans-serif; font-weight: 700; border: 2px dashed #7c3aed; border-radius: 10px; padding: .15rem .4rem; min-width: 0; flex: 1 1 8rem; background: #fff; color: #2a1848; }
body.editing .card[data-sec] h2, body.editing .easel-copy h1 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.card.is-removed { outline: 2px dashed #f59e0b; }
.just-added { color: #15803d; font-size: .78rem; font-weight: 700; }
.photo-book { display: block; width: 100%; font: inherit; font-family: 'Baloo 2', var(--fun), sans-serif; font-weight: 700; font-size: 1.05rem;
  background: #f5c518; color: #3b2a05; border: 0; border-radius: 999px; padding: .6rem .8rem; cursor: pointer; margin: .15rem 0 .35rem; }
.tab-tools { display: flex; flex-wrap: wrap; gap: .45rem .8rem; align-items: center; margin: 0 0 .55rem; font-size: .82rem; }
.tab-tools .pin-cap { flex-basis: 100%; }
.drop-slot { border: 2px dashed #a78bfa; background: #f3e8ff; color: #6d28d9; border-radius: 16px; min-height: 52px; display: grid; place-items: center; font-weight: 800; grid-column: 1 / -1; }
.card.dragging { opacity: .55; }
.grip { touch-action: none; }
@media (max-width: 640px) {
  .pin-strip { gap: .65rem; }
  .pin-tile { min-height: 0; flex-direction: row; align-items: center; gap: .45rem; padding: .4rem .7rem; }
  .pin-tile strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
  .pin-tile .pin-text { white-space: normal; }
  .pin-tile strong { font-size: .98rem; flex: 0 1 auto; }
  .pin-tile .pin-text { font-size: .75rem; flex: 1 1 auto; }
  dialog.detail { width: calc(100% - .8rem); }
  .mgrid { gap: 3px; }
  .cal-top { display: grid; grid-template-columns: 1fr auto; gap: .35rem .5rem; align-items: center; margin-bottom: .4rem; }
  .cal-nav { grid-column: 1 / -1; }
  .cal-top .every-week { justify-self: start; }
  .cal-top .seg { justify-self: end; }
}

/* Bottom bar: add, chat, and the rarely used tools */
.dock { position: fixed; left: 0; right: 0; bottom: 0; z-index: 45; display: flex; align-items: center; justify-content: space-between; gap: .35rem;
  padding: .3rem .65rem calc(.3rem + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--surface) 94%, transparent);
  border-top: 1px solid var(--line); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); }
.dock-btn { font: inherit; font-weight: 700; font-size: .95rem; border: 0; background: transparent; color: var(--text); border-radius: 12px; padding: .4rem .75rem; cursor: pointer; }
.dock-btn[aria-expanded="true"] { background: var(--accent-soft); }
body.fam .dock .chat-fab { position: relative; right: auto; bottom: auto; width: 2.7rem; height: 2.7rem; font-size: 1.25rem; box-shadow: 0 4px 12px rgba(109, 61, 245, .28); }
body.fam .chat-panel { bottom: 4.6rem; }
.dock-pop { position: fixed; z-index: 46; left: .55rem; right: .55rem; bottom: calc(3.4rem + env(safe-area-inset-bottom));
  background: var(--surface); color: var(--text); border-radius: 16px; padding: .7rem; box-shadow: 0 12px 40px rgba(40, 20, 60, .28);
  display: flex; flex-direction: column; align-items: stretch; gap: .4rem; }
.dock-pop[hidden] { display: none !important; }
.dock-pop .add-row { width: 100%; }
.dock-who { margin: .1rem 0; }
.dock-out { font-weight: 700; color: var(--text); text-decoration: none; padding: .35rem .1rem; }
@media (max-width: 640px) {
  body.fam .chat-panel { bottom: 0; }
  body.fam .dock .chat-fab { right: auto; bottom: auto; }
}

/* Slim hub header (no hero artwork). Reset the absolute title used by an illustration. */
.hub-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin: .15rem 0 .35rem; }
.hub-head .easel-copy { position: static; max-width: none; left: auto; top: auto; }
.hub-head .easel-copy h1, .hub-head .easel-copy .page-date { color: inherit; text-shadow: none; }
.hub-kicker { margin: 0; color: var(--muted); font-size: .85rem; font-weight: 600; }
.hub-head h1 { font-size: clamp(1.25rem, 3.4vw, 1.7rem); }
.hub-head .page-date { margin: .1rem 0 0; color: var(--muted); }
.dock .chat-fab[hidden] { display: none !important; }

/* Third and fourth children reuse the same shapes as the first two. */
.tag.kid.k-2, .kidkey.k-2, .spell.k-2 .sp-who, .girl.k-2 .nm, .chip.k-2[aria-pressed="true"] { background: var(--kid-2); color: var(--kid-2-ink); }
.tag.kid.k-3, .kidkey.k-3, .spell.k-3 .sp-who, .girl.k-3 .nm, .chip.k-3[aria-pressed="true"] { background: var(--kid-3); color: var(--kid-3-ink); }
.ev.k-2 { border-left-color: var(--kid-2); } .ev.k-3 { border-left-color: var(--kid-3); }
.chip.k-2 { border-color: var(--kid-2); } .chip.k-3 { border-color: var(--kid-3); }
.chip.k-2:not([aria-pressed="true"]) { background: var(--kid-2-soft); }
.chip.k-3:not([aria-pressed="true"]) { background: var(--kid-3-soft); }
.kidcard.k-2 { background: var(--kid-2-soft); box-shadow: inset 4px 0 0 var(--kid-2); }
.kidcard.k-3 { background: var(--kid-3-soft); box-shadow: inset 4px 0 0 var(--kid-3); }
.k-2 .kc-name strong { color: var(--kid-2-ink); } .k-3 .kc-name strong { color: var(--kid-3-ink); }
.dot.k-2 { box-shadow: 0 0 0 2px var(--kid-2); } .dot.k-3 { box-shadow: 0 0 0 2px var(--kid-3); }
.wall-msg { display: flex; flex-direction: column; gap: .15rem; max-width: 86%; border-radius: 14px; padding: .55rem .7rem; background: var(--bg); }
.wall-msg.mine { margin-left: auto; background: var(--accent-soft); }
.wall-msg .msg-meta { font-size: .75rem; color: var(--muted); }
.wall-del { align-self: flex-end; border: 0; background: none; color: var(--muted); cursor: pointer; font: inherit; font-size: .75rem; text-decoration: underline; }
