/* Bunnimoo 5.7 — roadmap 2 wave E styles: calm error screen, school/home calm plan tabs, grown-up link check, kids' privacy page,
   parent tools (weekday chart, notes, teacher card + print), quiet/school hours, storage meter, copy settings, checklist, search,
   large print, and the WCAG AA contrast fixes (E12). No new raster art; reduced motion = still. */

/* ---------- E12 contrast to WCAG AA (measured by test/audit.py: text on pastel backgrounds) ---------- */
html.theme-pink { --muted: #6e5764; }
html.theme-blue { --muted: #55647d; }
:root:not([class*="theme-"]) { --muted: #5e6484; }
html.theme-pink .btn-primary, html.theme-pink .task .btn-primary, html.theme-pink .items .btn-primary, html.theme-pink .items .btn { color: #3a2530; }
html.theme-blue .btn-primary, html.theme-blue .task .btn-primary, html.theme-blue .items .btn-primary, html.theme-blue .items .btn { color: #1f2f47; }
html[class*="theme-"] .task:has(.chip-avail) .btn-primary { color: inherit; }
html.theme-pink .task:has(.chip-avail) .btn-primary { color: #3a2530; }
html.theme-blue .task:has(.chip-avail) .btn-primary { color: #1f2f47; }
.bma-cdnum { color: #5f6db0; }
.j-day { color: #4b54b0; }
.stage-path li.cur span { color: #173d2c; }

/* ---------- E16 calm error screen ---------- */
.bme-err { min-height: 70vh; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; text-align: center; padding: 24px 16px; }
.bme-err h1 { margin: 6px 0 0; font-size: 26px; color: var(--ink, #3d4159); }
.bme-err p { margin: 0; max-width: 340px; color: var(--ink-2, #4f4b66); font-size: 18px; }
.bme-err .note { font-size: 14px; color: var(--muted, #5e6484); }
.bme-errbun { width: 160px; min-height: 120px; display: flex; align-items: center; justify-content: center; }
.bme-errbun > svg { width: 96px; height: 96px; }
.bme-errbtns { display: flex; flex-direction: column; gap: 10px; width: min(320px, 100%); margin: 8px 0; }

/* ---------- E5 home / school tabs in "My calm plan" ---------- */
.bme-tbseg { display: flex; gap: 8px; margin: 4px 0 8px; }
.bme-tbseg .seg-btn { flex: 1; display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 52px; }
.bme-tbseg .seg-btn svg { width: 26px; height: 26px; flex: none; }
.bme-tbnote { margin: 0 0 8px; }

/* ---------- E7 grown-up check ---------- */
.bme-gate { text-align: center; }
.bme-gatei svg { width: 64px; height: 64px; }
.bme-gate .sub { margin: 4px 0 8px; }
.bme-gwhere { display: flex; align-items: center; justify-content: center; gap: 6px; }
.bme-gwhere svg { width: 22px; height: 22px; flex: none; }

/* ---------- E9 kids' privacy page ---------- */
.bme-mplist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.bme-mprow { display: flex; gap: 12px; align-items: flex-start; background: var(--card, #fff); border-radius: 20px; padding: 12px 14px; box-shadow: var(--shadow); }
.bme-mpi { flex: none; width: 60px; height: 60px; border-radius: 16px; background: #f6f3fb; display: flex; align-items: center; justify-content: center; }
.bme-mpi svg { width: 44px; height: 44px; }
.bme-mpt { display: flex; flex-direction: column; gap: 3px; font-size: 17px; line-height: 1.4; color: var(--ink-2); }
.bme-mpt b { color: var(--ink); font-size: 18px; display: flex; align-items: center; gap: 6px; }
.bme-mpcard h2, .bme-wdcard h2, .bme-notes h2, .bme-about h2, .bme-win h2, .bme-plan2 h2, .bme-store h2, .bme-trim h2, .bme-copy h2, .bme-gd h2, .bme-lpcard h2, .bme-kp h2, .bme-check h2, .bme-away h2 { display: flex; align-items: center; gap: 8px; }
.bme-mpcard h2 svg, .bme-wdcard h2 svg, .bme-notes h2 svg, .bme-about h2 svg, .bme-win h2 svg, .bme-plan2 h2 svg, .bme-store h2 svg, .bme-trim h2 svg, .bme-copy h2 svg, .bme-gd h2 svg, .bme-lpcard h2 svg, .bme-kp h2 svg, .bme-check h2 svg, .bme-away h2 svg, .vx-card h2 svg { width: 30px; height: 30px; flex: none; }
.bme-mpcard .btn svg, .bme-kp .btn svg { width: 24px; height: 24px; }

/* ---------- shared parent bits ---------- */
.bme-lbl { display: block; margin: 12px 0 6px; font-weight: 600; color: var(--ink); font-size: 15px; }
.bme-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.bme-chip { min-height: 40px; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--lilac2, #d8dcf6); background: #fff; color: var(--ink); font: inherit; font-size: 15px; cursor: pointer; }
.bme-chip.on { background: #e8f5ee; border-color: #6fb592; color: #234f3a; font-weight: 600; }
.bme-hint { background: #fff7e6; border-radius: 14px; padding: 8px 12px; color: #5a4520; font-size: 15px; }
.bme-local { display: flex; align-items: center; gap: 6px; font-size: 14px; color: #2f5d47; background: #eef8f2; border-radius: 12px; padding: 6px 10px; }
.bme-local svg { width: 20px; height: 20px; flex: none; }
.bme-wdtot { margin: 6px 0; font-weight: 600; color: var(--ink); }
.bme-tag { display: inline-block; margin: 2px 3px; padding: 2px 9px; border-radius: 999px; background: #f4eef8; color: var(--ink); font-size: 13.5px; }
.bme-tag.ok { background: #e8f5ee; color: #234f3a; }

/* ---------- E1 weekday chart ---------- */
.bme-wd { display: flex; align-items: flex-end; justify-content: space-between; gap: 6px; height: 170px; padding: 6px 2px 0; }
.bme-wdcol { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; min-width: 0; }
.bme-wdcol b { font-size: 13px; color: var(--ink-2); min-height: 16px; }
.bme-wdcol span { font-size: 13px; color: var(--ink-2); white-space: nowrap; }
.bme-wdcol.top span { font-weight: 700; color: var(--ink); }
.bme-wdbar { width: 100%; max-width: 38px; display: flex; flex-direction: column-reverse; border-radius: 9px; overflow: hidden; background: #f1eef6; }
.bme-wdbar i { display: block; min-height: 3px; }
.bme-wdcol.top .bme-wdbar { box-shadow: 0 0 0 2px #e9b65a; }
.bme-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin: 10px 0 4px; font-size: 13.5px; color: var(--ink-2); }
.bme-legend span { display: inline-flex; align-items: center; gap: 5px; }
.bme-legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.bme-wdeve { display: flex; justify-content: space-between; gap: 4px; }
.bme-wdeve span { flex: 1; display: flex; flex-direction: column; align-items: center; background: #f6f3fb; border-radius: 10px; padding: 4px 0; }
.bme-wdeve small { font-size: 12.5px; color: var(--ink-2); }

/* ---------- E2 notes ---------- */
.bme-nform { background: #fbf9fe; border-radius: 16px; padding: 4px 12px 12px; margin: 10px 0; }
.bme-when { display: flex; gap: 8px; flex-wrap: wrap; }
.bme-when .txt-in { flex: 1 1 100%; min-width: 0; box-sizing: border-box; }
.bme-nlist { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bme-nlist li { background: #fbf9fe; border-radius: 14px; padding: 8px 12px; }
.bme-nlist p { margin: 4px 0; }
.bme-nlist small { color: var(--muted); margin-inline-end: 4px; }
.bme-nhead { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.bme-nhead > b { flex: 1; }
.bme-ntext { color: var(--ink); white-space: pre-wrap; unicode-bidi: plaintext; }
.bme-size { font-size: 13px; padding: 2px 8px; border-radius: 999px; background: #eef3fd; color: #2c3a6b; }
.bme-size.s-b { background: #fde9e4; color: #6b2f22; }
.bme-x { width: 44px; height: 44px; }
.bme-x svg { width: 24px; height: 24px; }
.bme-delq { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 14px; }
.bme-del { background: #fde9e4; color: #6b2f22; }

/* ---------- E3 teacher card ---------- */
.bme-sugg { margin-top: 6px; }
.bme-sugg .bme-chip { font-size: 14px; min-height: 36px; background: #fbf9fe; }
.bme-card { border: 2px solid #eadff3; border-radius: 22px; padding: 14px; margin: 8px 0 12px; background: #fff; color: #2d2a3b; }
.bme-chead { display: flex; align-items: center; gap: 12px; }
.bme-chead h2 { margin: 0; font-size: 22px; color: #2d2a3b; }
.bme-cbun { width: 92px; height: 92px; flex: none; overflow: hidden; display: flex; align-items: center; justify-content: center; }
.bme-cbun .charwrap { width: 92px !important; height: 92px !important; }
.bme-cbun .charwrap svg { width: 100%; height: 100%; }
.bme-cgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 10px; }
.bme-cbox { border-radius: 16px; padding: 8px 10px; background: #f8f5fc; min-height: 84px; }
.bme-cbox:nth-child(2) { background: #f3f7fd; } .bme-cbox:nth-child(3) { background: #f1f9f4; } .bme-cbox:nth-child(4) { background: #fdf6ee; }
.bme-cbox h3 { display: flex; align-items: center; gap: 6px; margin: 0 0 4px; font-size: 16px; color: #2d2a3b; }
.bme-cbox h3 svg { width: 24px; height: 24px; flex: none; }
.bme-cbox p { margin: 0; font-size: 15px; line-height: 1.45; color: #2d2a3b; unicode-bidi: plaintext; }
.bme-cfoot { margin: 10px 0 0; font-size: 12.5px; color: #5d5870; text-align: center; }
@media (max-width: 360px) { .bme-cgrid { grid-template-columns: 1fr; } }
@media print {
  html.bme-printing body * { visibility: hidden !important; }
  html.bme-printing #bme-card, html.bme-printing #bme-card * { visibility: visible !important; }
  html.bme-printing #bme-card { position: absolute; inset: 0 auto auto 0; width: 100%; max-width: 680px; margin: 0; border-color: #ccc; box-shadow: none; }
  html.bme-printing .bme-cgrid { grid-template-columns: 1fr 1fr; }
  html.bme-printing body { background: #fff !important; }
  html.bme-printing #bg-life, html.bme-printing .bg42 { display: none !important; }
}

/* ---------- E4/E5 hours ---------- */
.bme-times { display: flex; gap: 10px; flex-wrap: wrap; margin: 8px 0 0; }
.bme-times label { display: flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); }
.bme-times .txt-in { width: 150px; box-sizing: border-box; }
.bme-days .bme-chip { min-width: 48px; text-align: center; }

/* ---------- E10 storage ---------- */
.bme-meter { display: flex; height: 18px; border-radius: 999px; overflow: hidden; background: #eef0f6; margin: 8px 0 4px; }
.bme-meter i { display: block; height: 100%; }
.bme-keys { list-style: none; padding: 0; margin: 4px 0; display: flex; flex-direction: column; gap: 3px; font-size: 14.5px; color: var(--ink-2); }
.bme-keys li { display: flex; align-items: center; gap: 6px; }
.bme-keys i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.bme-trprev { background: #fbf9fe; border-radius: 14px; padding: 6px 12px; margin: 10px 0; }
.bme-trprev p { margin: 6px 0; }
.bme-stay { display: flex; gap: 6px; align-items: flex-start; color: #234f3a; font-size: 14.5px; }
.bme-stay svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.bme-trgo { background: #fde9e4; color: #6b2f22; }
.bme-trgo svg { width: 22px; height: 22px; }

/* ---------- E6 copy ---------- */
.bme-cpl { display: flex; flex-direction: column; gap: 4px; }
.bme-cpr { display: flex; align-items: center; gap: 10px; min-height: 44px; font-size: 15.5px; color: var(--ink); }
.bme-cpr input { width: 22px; height: 22px; accent-color: #6fb592; flex: none; }

/* ---------- E20 checklist + E16 log ---------- */
.bme-cklist { list-style: none; margin: 8px 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.bme-ck { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; border-radius: 16px; background: #f7f7fb; }
.bme-ck.ok { background: #eef8f2; } .bme-ck.warn { background: #fff6e8; }
.bme-cki svg { width: 30px; height: 30px; }
.bme-ckt { flex: 1; display: flex; flex-direction: column; gap: 2px; font-size: 15px; color: var(--ink-2); }
.bme-ckt b { color: var(--ink); font-size: 16px; }
.bme-ckt .btn { margin-top: 6px; }
.bme-ckm { flex: none; width: 30px; height: 30px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-weight: 700; background: #fff; color: #2f6b4f; }
.bme-ck.warn .bme-ckm { color: #7a4e0e; }
.bme-errlist { list-style: none; padding: 0; margin: 6px 0; display: flex; flex-direction: column; gap: 6px; font-size: 13px; text-align: left; }
.bme-errlist li { background: #f7f7fb; border-radius: 10px; padding: 6px 8px; overflow-wrap: anywhere; }
.bme-errlist small { display: block; color: #555a70; }
.bme-errlist code { color: #3a3550; font-size: 12.5px; }

/* ---------- E18 search ---------- */
.bme-search { position: relative; margin: 2px 0 12px; }
.bme-sri { position: absolute; inset-inline-start: 12px; top: 12px; width: 26px; height: 26px; pointer-events: none; }
.bme-sri svg { width: 26px; height: 26px; }
.bme-search .txt-in { width: 100%; box-sizing: border-box; padding-inline-start: 46px; min-height: 50px; font-size: 17px; }
.bme-srres { list-style: none; margin: 6px 0 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.bme-srhit { width: 100%; text-align: start; display: flex; flex-direction: column; gap: 1px; padding: 8px 12px; border-radius: 12px; border: 0; background: #fff; box-shadow: var(--shadow); font: inherit; color: var(--ink); cursor: pointer; min-height: 48px; }
.bme-srhit small { color: var(--muted); font-size: 13px; }
.bme-hit { outline: 3px solid #e9b65a; outline-offset: 3px; border-radius: 14px; }

/* ---------- E19 away card ---------- */
.bme-away { background: #f7f4fd; }
.bme-away p { color: var(--ink-2); }

/* ---------- E8 large print (parent area and report only) ---------- */
html.bme-lp .admin .adm-body, html.bme-lp .report { zoom: 1.22; }
html.bme-lp .admin .adm-top h1 { font-size: 27px; }
html.bme-lp .admin .adm-link { font-size: 19px; min-height: 56px; }

/* ---------- E11 reduced motion: everything still ---------- */
html.rm .bme-hit { transition: none; }

/* 5.7.1 voice page: icon beside the title, no empty box while nothing is downloading */
.vx-card h2 { display: flex; align-items: center; gap: 10px; }
.vx-card .note:empty { display: none; }
