/* JenPlanner. Original design system: friendly pastel stationery feel, mobile first. */
:root{
  --ink:#332f3b; --ink-soft:#6c6678; --paper:#fffdfa; --bg:#eee9f6;
  --accent:#7c6bb8; --accent-deep:#5c4a9e; --mint:#79c7a2; --coral:#e88a8a;
  --sun:#f2c14e; --sky:#7aa7d9; --line:#e5dff0; --radius:14px;
  --tap:44px;
}
*{box-sizing:border-box}
/* No global smooth scrolling: it turns every programmatic scroll into an
   interruptible animation, which broke long month-rail jumps entirely. */
body{margin:0;font-family:"AnniRounded",ui-rounded,"SF Pro Rounded","Comic Sans MS","Segoe UI",system-ui,-apple-system,sans-serif;font-size:18px;background:var(--bg);color:var(--ink);-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button{font:inherit;cursor:pointer;border:0;background:none;min-height:var(--tap)}
input,textarea,select{font:inherit;color:inherit}
.boot{padding:40vh 20px 0;text-align:center;color:var(--ink-soft)}

/* ---------- Landing ---------- */
.landing{min-height:100vh;display:flex;flex-direction:column;align-items:center;padding:24px 16px 60px}
/* Cover / login hero: Jen & Jon's own dog artwork + dynamic year + customizable grade badge */
.cover-hero{width:min(560px,96vw);border-radius:16px;position:relative;overflow:hidden;margin:4vh auto 0;
  box-shadow:0 12px 32px rgba(92,74,158,.22);line-height:0}
.cover-full{display:block;width:100%;height:auto}
/* dynamic grade badge overlays the artwork's baked badge, only for non-3rd-grade teachers */
.grade-cover{position:absolute;left:2%;bottom:3%;width:31%;min-height:28%;background:#fff;border:3px solid #2d2a33;
  border-radius:12px;transform:rotate(-3deg);box-shadow:2px 3px 0 rgba(0,0,0,.15);
  display:flex;flex-direction:column;align-items:center;justify-content:center;padding:1.5% 1%;line-height:1}
.grade-cover span{font-family:"Marker Felt","Comic Sans MS",cursive;color:#2d2a33;font-size:clamp(.8rem,3.2vw,1.15rem)}
.grade-cover b{font-family:"Marker Felt","Comic Sans MS",cursive;color:var(--coral);text-transform:capitalize;
  font-size:clamp(1.1rem,5vw,1.7rem);text-align:center;line-height:1.05;margin-top:2px}
.pagecard .cover-hero{margin:0;width:100%}
.auth{width:min(420px,94vw);background:var(--paper);border-radius:var(--radius);margin-top:22px;
  padding:22px;box-shadow:0 4px 14px rgba(0,0,0,.08)}
.auth h2{margin:0 0 4px;font-size:1.15rem}
.auth p.sub{margin:0 0 16px;color:var(--ink-soft);font-size:.88rem}
.field{margin:10px 0}
.field label{display:block;font-size:.8rem;font-weight:600;color:var(--ink-soft);margin-bottom:4px}
.field input{width:100%;padding:12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;min-height:var(--tap)}
.field input:focus{outline:2px solid var(--accent);border-color:transparent}
.btn{display:block;width:100%;padding:13px;border-radius:12px;background:var(--accent);color:#fff;font-weight:700;margin-top:14px}
.btn:active{background:var(--accent-deep)}
.btn.ghost{background:transparent;color:var(--accent);border:1.5px solid var(--accent)}
.authswitch{text-align:center;margin-top:12px;font-size:.85rem;color:var(--ink-soft)}
.authswitch a{color:var(--accent);font-weight:700;text-decoration:none}
.formerr{color:#b23b3b;font-size:.85rem;margin-top:8px;min-height:1.2em}

/* ---------- App chrome ---------- */
.topbar{position:sticky;top:0;z-index:40;background:var(--paper);box-shadow:0 2px 8px rgba(0,0,0,.08);
  display:flex;align-items:center;gap:6px;padding:6px 8px}
.navitems{display:flex;align-items:center;gap:6px;flex:1;min-width:0;overflow-x:auto;-webkit-overflow-scrolling:touch}
.navitems::-webkit-scrollbar{display:none}
.navham{display:none;flex:0 0 auto;padding:9px 15px;border-radius:999px;font-size:.82rem;font-weight:800;
  color:#fff;background:var(--accent-deep);border:0;white-space:nowrap;cursor:pointer}
@media(max-width:640px){
  .topbar{position:relative;flex-wrap:wrap}
  .navham{display:inline-flex}
  .navitems{position:absolute;top:100%;left:0;right:0;flex-direction:column;align-items:stretch;display:none;
    background:var(--paper);box-shadow:0 8px 18px rgba(0,0,0,.18);padding:8px;gap:6px;max-height:74vh;overflow:auto;z-index:41;
    border-bottom-left-radius:14px;border-bottom-right-radius:14px}
  .navitems.open{display:flex}
  .navitems .tab{flex:0 0 auto;text-align:center;padding:12px 14px;font-size:.9rem}
  .navitems .tab.settingsbtn{margin-left:0}
}
.tab{flex:0 0 auto;padding:8px 13px;border-radius:999px;font-size:.78rem;font-weight:700;color:#fff;white-space:nowrap}
.tab{background:var(--accent-deep)} /* fallback: a tab must never be invisible */
.tab[data-s="all"]{background:var(--ink)}
.tab[data-s="classinfo"]{background:#d98ab5}.tab[data-s="grades"]{background:var(--coral)}
.tab[data-s="attendance"]{background:var(--sky)}.tab[data-s="data"]{background:var(--sun);color:var(--ink)}
.tab[data-s="planning"]{background:var(--accent)}.tab[data-s="todo"]{background:#67b7ae}
.tab[data-s="notes"]{background:#d98ab5}.tab[data-s="calendars"]{background:#8f7ad1}
.tab.settingsbtn{background:var(--ink);margin-left:auto}
.monthrail{position:fixed;right:0;top:64px;bottom:0;z-index:39;display:flex;flex-direction:column;gap:2px;
  padding:6px 2px;overflow-y:auto;background:transparent}
.monthrail button{writing-mode:vertical-rl;font-size:.62rem;font-weight:700;color:var(--accent-deep);
  background:var(--paper);border-radius:8px 0 0 8px;padding:8px 4px;min-height:0;box-shadow:-1px 1px 3px rgba(0,0,0,.12)}
.monthrail button.now{background:var(--accent);color:#fff}
main.pages{max-width:1900px;margin:0 auto;padding:10px 34px 80px 14px}
.tab.viewtab.active{outline:2px solid #fff;box-shadow:0 0 0 2px var(--accent-deep)}
.viewbar{position:sticky;top:52px;z-index:37;display:flex;align-items:center;gap:8px;padding:6px 12px;
  background:rgba(255,253,250,.96);backdrop-filter:blur(4px);box-shadow:0 1px 4px rgba(0,0,0,.06);font-size:.82rem}
.viewbar .viewname{font-weight:800;color:var(--accent-deep)}
.viewbar .spacer{flex:1}
.viewbar .dot-sep{color:var(--ink-soft)}
.linkbtn{background:none;color:var(--accent);font-weight:700;font-size:.82rem;min-height:0;padding:4px 2px}
.linkbtn:active{color:var(--accent-deep)}
/* collapse */
.pagecollapse{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:32px;
  border-radius:8px;background:#f1edfa;color:var(--accent-deep);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.pagecollapse svg{transition:transform .15s}
.pagecard.collapsed .pagecollapse svg{transform:rotate(-90deg)}
.pagecard.collapsed{min-height:0}
.pagecard.collapsed .pagebody{display:none}
.pagecard.collapsed .ptitle{margin-bottom:0}
.phtitle{display:block;font-weight:700;color:var(--accent-deep);padding:2px 76px 2px 2px}

/* ---------- Page cards ---------- */
/* NOTE: no content-visibility here. It makes off-screen page heights permanently
   unstable (estimates), which made month-rail jumps land a month off. Lazy
   hydration alone keeps first paint fast; once hydrated, geometry is final. */
.pagecard{background:var(--paper);border-radius:var(--radius);box-shadow:0 3px 10px rgba(0,0,0,.07);
  margin:16px 0;padding:14px;min-height:220px;scroll-margin-top:96px}
.pagecard h3.ptitle{margin:2px 0 12px;color:var(--accent-deep);font-size:1.05rem;display:flex;justify-content:space-between;align-items:center}
.pagecard h3.ptitle small{color:var(--ink-soft);font-weight:400;font-size:.72rem}
.divider-card{display:flex;flex-direction:column;min-height:0;overflow:hidden;
  background:#e3d7fc;color:#fff;border-radius:var(--radius);margin:22px 0;padding:0}
.divider-dogs{display:block;width:100%;height:auto}
.divider-card .dv-title{letter-spacing:.18em;font-size:1.3rem;text-align:center;margin:0;padding:18px 12px;
  background:linear-gradient(135deg,var(--accent),var(--accent-deep))}
/* section header bar matches its nav tab color */
.sec-classinfo .dv-title{background:#d98ab5}
.sec-grades .dv-title{background:var(--coral)}
.sec-attendance .dv-title{background:var(--sky)}
.sec-data .dv-title{background:var(--sun);color:var(--ink)}
.sec-planning .dv-title{background:var(--accent)}
.sec-todo .dv-title{background:#67b7ae}
.sec-notes .dv-title{background:#d98ab5}
.sec-calendars .dv-title{background:#8f7ad1}
.placeholder{min-height:200px;display:flex;align-items:center;justify-content:center;color:var(--ink-soft);font-size:.85rem}

/* editable grids */
.egrid{width:100%;border-collapse:collapse;font-size:.85rem}
.egrid th{background:#f4f0fb;color:var(--accent-deep);font-size:.72rem;text-transform:uppercase;letter-spacing:.06em;padding:7px 6px;text-align:left;border:1px solid var(--line)}
.egrid td{border:1px solid var(--line);padding:0;min-width:70px}
.egrid td .cellinput{width:100%;border:0;background:transparent;padding:9px 8px;min-height:var(--tap);resize:none;display:block}
.egrid td .cellinput:focus{outline:2px solid var(--accent);background:#faf8ff}
.gridwrap{overflow-x:auto;-webkit-overflow-scrolling:touch}

/* labeled boxes (emergency etc.) */
.boxes{display:grid;grid-template-columns:1fr;gap:10px}
@media(min-width:640px){.boxes{grid-template-columns:1fr 1fr}}
.lbox label{font-size:.78rem;font-weight:700;color:var(--accent-deep)}
.lbox textarea{width:100%;min-height:84px;border:1.5px solid var(--line);border-radius:10px;padding:9px;background:#fff}

/* month calendar */
.mcal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;font-size:.72rem}
.mcal .dow{text-align:center;font-weight:700;color:var(--accent-deep);padding:4px 0;font-size:.66rem}
.mcal .mday{background:#fff;border:1px solid var(--line);border-radius:8px;min-height:74px;padding:3px;position:relative;min-width:0;overflow:hidden}
.mcal .mday.out{opacity:.35}
.mcal .mday .dnum{font-weight:700;font-size:.7rem;color:var(--ink-soft);cursor:pointer;display:inline-block;
  min-width:20px;min-height:20px;border-radius:6px;padding:1px 4px}
.mcal .mday .dnum:hover{background:var(--soft);color:var(--accent-deep)}
.mcal .mday .dnum:active{background:var(--accent);color:#fff}
.mcal .mday.today{outline:2px solid var(--accent)}
.chip{display:block;font-size:.6rem;font-weight:700;border-radius:6px;padding:1px 4px;margin:2px 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.chip.no_school,.chip.break{background:#ffd6d6;color:#e01414;font-weight:800}
.chip.early_release{background:#fbe0dd;color:#c0392b}
.chip.milestone{background:#e0f0e1;color:#276b2d}
.chip.event{background:#e2ecfa;color:#274f8a}
.chip.userevent{background:#efe6fb;color:#5c4a9e}
.chip.bday{background:#fbeec0;color:#8a6a12}
.chip.bday .cake{vertical-align:-1px;margin-right:2px}
.bdaylist{margin-top:6px}
.bmonth{margin:14px 0 4px;color:var(--accent-deep);font-size:.9rem;border-bottom:1px solid var(--line);padding-bottom:3px}
.brow{display:flex;align-items:center;gap:8px;padding:7px 4px;border-bottom:1px dashed var(--line);font-size:.9rem}
.brow .cake{flex:0 0 auto}
.brow b{min-width:96px}
.brow .bname{color:var(--ink)}
.chip .x{float:right;opacity:.6;padding:0 2px}
.addevt{position:absolute;bottom:1px;right:3px;color:var(--accent);font-weight:800;font-size:.85rem;opacity:.5;min-height:0;padding:2px 4px}
.mday:hover .addevt,.mday:focus-within .addevt{opacity:1}

/* weekly lessons */
.weekgrid{display:grid;gap:8px}
.wk-day{border:1.5px solid var(--line);border-radius:12px;padding:8px;background:#fff}
.wk-day .dhead{font-weight:800;color:var(--accent-deep);font-size:.85rem;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.wk-day .dhead .marks{font-weight:400}
.slot{margin:7px 0}
.slot .shead{font-size:.7rem;font-weight:700;color:var(--ink-soft);display:flex;justify-content:space-between}
.slot textarea{width:100%;border:1px solid var(--line);border-radius:8px;padding:8px;min-height:52px;background:#fdfcff;resize:vertical}
.slot textarea:focus{outline:2px solid var(--accent)}
.slot .attachrow{display:flex;flex-wrap:wrap;gap:4px;margin-top:3px}
.att{font-size:.66rem;background:#f1edfa;color:var(--accent-deep);border-radius:8px;padding:2px 7px;text-decoration:none;display:inline-flex;gap:4px;align-items:center}
.att button{min-height:0;padding:0 2px;opacity:.6}
.addatt{font-size:.66rem;color:var(--accent);font-weight:700;min-height:0;padding:2px 6px}
.dayacts{margin-left:auto;display:inline-flex;gap:6px}
.dayact{font-size:.64rem;font-weight:700;color:var(--accent-deep);background:#f1edfa;border-radius:8px;
  padding:3px 8px;min-height:24px}
.dayact:active{background:var(--accent);color:#fff}
.searchbtn{background:#4a4458}
.search-results{max-height:320px;overflow-y:auto;margin-top:8px}
.sres{display:block;width:100%;text-align:left;padding:9px 8px;border-bottom:1px solid var(--line);min-height:0}
.sres:active{background:var(--soft)}
.sres .rtype{font-size:.64rem;font-weight:800;color:#fff;border-radius:6px;padding:1px 6px;margin-right:6px}
.sres .rtype.lesson{background:var(--accent)}.sres .rtype.event{background:var(--sky)}.sres .rtype.cell{background:var(--mint)}
.sres .rwhere{font-weight:700;font-size:.78rem;color:var(--accent-deep)}
.sres .rsnip{display:block;font-size:.78rem;color:var(--ink-soft);margin-top:2px}
.saving button{background:none;color:#ffd75e;font-weight:800;min-height:0;padding:0 0 0 10px;font-size:.75rem}
@media(min-width:900px){
  .weekgrid.desktop{display:block;overflow-x:auto}
}

/* fixed school-day markers (recess/lunch/start/release) baked into schedules */
.slot.slot-fixed{background:#f5f2fb;border:1px dashed var(--line);border-radius:8px;padding:5px 8px;margin:6px 0}
.slot.slot-fixed .shead{color:var(--accent-deep);font-weight:800;display:flex;align-items:center}
.fixedtime{font-weight:700;color:var(--ink-soft)}
.markertime{margin-left:auto;background:transparent;border:1px dashed var(--accent);border-radius:8px;
  padding:2px 8px;font:inherit;font-weight:800;color:var(--accent-deep);cursor:pointer}
.markertime:hover{background:#f7f4fd}
tr.sched-fixed{background:#f5f2fb}
tr.sched-fixed td{color:var(--accent-deep);font-weight:700}
.delblock{background:transparent;border:1px dashed transparent;border-radius:8px;padding:2px 8px;margin-left:4px;
  color:var(--ink-soft);font-weight:800;min-height:0}
.delblock:hover{border-color:#c94848;color:#c94848;background:#fdf1f1}

/* settings: subject blocks + recess rows */
.blockrow{display:flex;align-items:center;gap:8px;padding:6px 0;border-bottom:1px dashed var(--line)}
.blockrow:last-child{border-bottom:0}
.blocklabel{flex:2;min-width:120px;border:1px solid var(--line);border-radius:8px;padding:8px}
.blocktime{flex:0 0 auto;font-size:.75rem;color:var(--ink-soft);white-space:nowrap}
.recessrow{align-items:center;border-bottom:1px dashed var(--line);padding-bottom:8px}

/* year at a glance */
.yaag{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:16px}
@media(min-width:760px){.yaag{grid-template-columns:repeat(3,1fr)}}
.mini{border:1.5px solid var(--line);border-radius:14px;padding:12px;background:#fff;box-shadow:0 2px 6px rgba(0,0,0,.05)}
.mini h4{margin:0 0 8px;font-size:1.05rem;color:var(--accent-deep);text-align:center;font-weight:800}
.mini .mg{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;text-align:center}
.mini .mg>span:nth-child(-n+7){font-size:.7rem;font-weight:800;color:var(--ink-soft);padding-bottom:2px}
.mday-mini{aspect-ratio:1;display:flex;align-items:center;justify-content:center;font-size:.9rem;
  border-radius:8px;cursor:pointer;position:relative;user-select:none;transition:background .12s;min-height:30px}
.mday-mini:hover{background:var(--soft)}
.mday-mini:active{background:var(--accent);color:#fff}
.mday-mini.mark{background:#fde2e2;color:#a12626;font-weight:700}
.mday-mini.tdy{outline:2px solid var(--accent);font-weight:800}
.mday-mini.dot::after{content:"";position:absolute;bottom:3px;left:50%;transform:translateX(-50%);
  width:5px;height:5px;border-radius:50%;background:var(--accent)}
.mday-mini.mark.dot::after{background:#a12626}
@keyframes dayflash{0%,100%{background:transparent}30%{background:#fff3c4}}
.wk-day.day-flash{animation:dayflash 1.4s ease;outline:2px solid var(--sun);border-radius:12px}

/* checklist */
.check{display:flex;align-items:center;gap:10px;border-bottom:1px dashed var(--line);padding:4px 0}
.check input[type=checkbox]{width:22px;height:22px;accent-color:var(--accent)}
.check input[type=text]{flex:1;border:0;padding:10px 4px;background:transparent;min-height:var(--tap)}

/* lined notes */
.lines textarea{width:100%;min-height:420px;border:0;background:repeating-linear-gradient(#fff 0 27px,#e8e3f2 27px 28px);line-height:28px;padding:0 6px;font-size:.95rem;resize:vertical}
.lines textarea:focus{outline:none}

/* upload + toolbars */
.toolrow{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0}
.toolrow .btn{width:auto;padding:9px 14px;margin:0;font-size:.8rem}
.hint{font-size:.75rem;color:var(--ink-soft)}

/* modal */
.modal-wrap{position:fixed;inset:0;background:rgba(40,30,60,.45);z-index:60;display:flex;align-items:flex-end;justify-content:center}
@media(min-width:640px){.modal-wrap{align-items:center}}
.modal{background:var(--paper);border-radius:18px 18px 0 0;width:min(560px,100vw);max-height:88vh;overflow-y:auto;padding:18px}
@media(min-width:640px){.modal{border-radius:18px}}
.modal h3{margin:0 0 10px;color:var(--accent-deep)}
.modal .close{float:right;font-size:1.3rem;color:var(--ink-soft)}
.saving{position:fixed;bottom:12px;left:50%;transform:translateX(-50%);background:var(--ink);color:#fff;
  font-size:.75rem;padding:6px 14px;border-radius:999px;z-index:70;opacity:0;transition:opacity .2s}
.saving.show{opacity:.92}

/* ---------- print controls ---------- */
.tab.printbtn{background:#5c8fb8}
.pagecard{position:relative}
.pagetools{position:absolute;top:8px;right:10px;z-index:5;display:flex;align-items:center;gap:6px}
/* V-0.4.88: .pagetools can hold up to 6 SIMULTANEOUSLY visible 32px buttons
   (pick and print swap via body.selectmode, never both at once): fmt, paper,
   share, clear, collapse, + one of pick/print = 6 x 32 + 5 x 6 gap = 222px.
   Reserve 236px (222 + 14 buffer) so the title/info-icon never renders under
   the tools row. If a button is ever added to the `tools` div in
   templates.js renderPage(), bump this number too or it will drift stale
   again (this is the second time; see gotcha 1 + V-0.4.88 feature log). */
.ptitle{padding-right:236px}
.pageprint,.pageshare{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:32px;
  border-radius:8px;background:#f1edfa;color:var(--accent-deep);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.pageprint:active,.pageshare:active{background:var(--accent);color:#fff}
.pageshare.busy{opacity:.5;pointer-events:none}
.pagecard.capturing .pagetools,.pagecard.capturing .addevt{visibility:hidden}
.pagepick{display:none;align-items:center}
.pagepick input{width:22px;height:22px;accent-color:var(--accent)}
body.selectmode .pagepick{display:inline-flex}
body.selectmode .pageprint{display:none}
body.selectmode .pagecard{outline:2px dashed transparent}
body.selectmode .pagecard:has(.pickbox:checked){outline:2px solid var(--accent);outline-offset:2px}
.print-actionbar{position:sticky;top:52px;z-index:38;display:flex;align-items:center;gap:12px;justify-content:center;
  background:var(--ink);color:#fff;padding:10px;flex-wrap:wrap}
.print-actionbar[hidden]{display:none !important}
.print-actionbar #pickcount{font-size:.85rem;font-weight:700}

@media print {
  @page { margin: 12mm; }
  .topbar,.monthrail,.saving,.print-actionbar,.pagetools,.addevt,.delevt,.delatt,.addatt,
  .uploadxlsx,.no-print,.slot .attachrow button,.check input[type=checkbox]{display:none !important}
  html,body{background:#fff !important}
  main.pages{max-width:none;margin:0;padding:0}
  .pagecard{box-shadow:none !important;border:0 !important;margin:0 !important;border-radius:0 !important;
    content-visibility:visible !important;contain:none !important;break-inside:avoid;page-break-after:always}
  textarea,input,.cellinput{border-color:#ccc !important}
  /* single page */
  body.print-one .pagecard{display:none !important}
  body.print-one .pagecard.print-target{display:block !important}
  /* selected pages */
  body.print-selected .pagecard{display:none !important}
  body.print-selected .pagecard.psel{display:block !important}
  /* whole planner = print-all: all cards show (default) */
}

/* last-year ghost view: faint, non-editable, tap to reuse */
.ghostline{margin-top:3px;padding:6px 8px;border:1px dashed var(--line);border-radius:8px;background:transparent;
  color:var(--ink-soft);opacity:.62;font-size:.78rem;font-style:italic;white-space:pre-wrap;cursor:pointer}
.ghostline::before{content:"last year: ";font-weight:700;font-style:normal;opacity:.8}
.ghostline:hover{opacity:.9;background:#faf8ff}

/* voice notes */
.att.voicenote{display:flex;align-items:center;gap:6px;max-width:100%;flex-wrap:wrap}
.att.voicenote audio{height:30px;max-width:190px}
.att.voicenote .vtxt{font-style:italic;color:var(--ink-soft);font-size:.75rem;max-width:100%}

/* expandable grids and notes */
.addrows{margin:8px 0 0;background:transparent;border:1.5px dashed var(--line);border-radius:10px;
  padding:8px 14px;color:var(--accent-deep);font-weight:700;font-size:.8rem;cursor:pointer;width:100%}
.addrows:hover{background:#f7f4fd}

/* attendance: real dates, sideways scroll */
.att-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch}
.atttable th.attname,.atttable td.attname{position:sticky;left:0;background:#fff;z-index:2;min-width:130px;box-shadow:2px 0 0 var(--line)}
.atttable th.attname{background:var(--paper,#f1edfa)}
.atttable th.attday{min-width:44px;text-align:center;font-size:.66rem;white-space:nowrap}
.atttable th.attday span{display:block;font-size:.6rem;opacity:.7}
.atttable th.att-today{background:var(--accent-deep);color:#fff}
.atttable td.attmark{padding:2px}
.atttable td.attmark input{width:40px;text-align:center;border:1px solid var(--line);border-radius:6px;padding:7px 2px;font-weight:700}
.attfixed{padding:9px 8px;font-weight:600}

/* supply list print branding: the dogs ride on top of the printout */
.print-brand{display:none}
@media print{
  .print-brand{display:block;text-align:center;margin-bottom:10px}
  .print-brand img{max-width:70%;border-radius:10px}
  .print-brand .pb-line{font-weight:700;color:#5c4a9e;margin-top:6px;font-size:1.05rem}
  .addrows{display:none !important}
}

/* contextual help "i" buttons + Guide tab */
.infoi{display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;border-radius:50%;
  border:1.5px solid var(--accent-deep);color:var(--accent-deep);background:#fff;font:italic 700 12px Georgia,serif;
  cursor:pointer;vertical-align:middle;line-height:1;padding:0;flex:none}
.infoi:hover{background:var(--accent-deep);color:#fff}
.dv-title .infoi{border-color:#fff;color:#fff;background:transparent;width:21px;height:21px}
.dv-title .infoi:hover{background:#fff;color:var(--accent-deep)}
.dayacts .infoi{width:17px;height:17px;font-size:11px}
.tab.guidebtn{background:var(--good,#2c7a4b)}

/* info "i": a true circle, light blue, never stretched by flex parents */
.infoi{width:20px;height:20px;min-width:20px;min-height:20px;max-width:20px;max-height:20px;
  aspect-ratio:1/1;align-self:center;border-radius:50%;
  border:1.5px solid #6aa9dc;color:#3579b1;background:#eaf4fd}
.infoi:hover{background:#3579b1;border-color:#3579b1;color:#fff}
.dv-title .infoi{border-color:#bcdcf5;color:#eaf4fd;background:rgba(234,244,253,.18);width:22px;height:22px;min-width:22px;min-height:22px;max-width:22px;max-height:22px}
.dv-title .infoi:hover{background:#eaf4fd;color:var(--accent-deep)}
.dayacts .infoi{width:18px;height:18px;min-width:18px;min-height:18px;max-width:18px;max-height:18px;font-size:11px}

/* keep the info "i" snug against the page title (ptitle is space-between flex) */
.ptitle .ptl{display:inline-flex;align-items:center;gap:8px;min-width:0}

/* year-at-a-glance: months must never spill past their card */
.yaag .mini{min-width:0;overflow:hidden}
.mini .mg>span{min-width:0}
.mday-mini{font-size:clamp(.62rem,1.6vw,.9rem)}

/* learned schedule: tappable times + drag handles */
.slot .shead{gap:6px;align-items:center}
.slottime{background:transparent;border:1px dashed transparent;border-radius:8px;padding:2px 8px;margin-left:auto;
  font:inherit;font-size:.7rem;font-weight:700;color:var(--ink-soft);cursor:pointer}
.slottime:hover{border-color:var(--accent);color:var(--accent-deep);background:#f7f4fd}
.draghandle{cursor:grab;color:var(--ink-soft);opacity:.55;font-size:.85rem;letter-spacing:-2px;padding:0 4px;
  touch-action:none;user-select:none;-webkit-user-select:none}
.draghandle:hover{opacity:1;color:var(--accent-deep)}
.slot.dragging{outline:2px dashed var(--accent);border-radius:10px;opacity:.85;background:#faf8ff}
.print-only{display:none}
@media print{.print-only{display:inline;font-size:.7rem;font-weight:700;margin-left:auto}}

/* meeting log */
.mtgform{background:#faf8ff;border:1.5px solid var(--line);border-radius:14px;padding:14px}
.mtgform input,.mtgform select,.mtgform textarea{width:100%;padding:10px;border:1.5px solid var(--line);border-radius:10px;font:inherit;background:#fff}
.mtgform .toolrow{align-items:flex-end;gap:8px}
.mtgform select{width:auto;min-width:140px}
#mtg-chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.mtgchip{display:inline-flex;align-items:center;gap:4px;border:0;cursor:default}
.mtgchip.student{background:#e8f2fd;color:#2b5e8f}
.mtgchip.parent{background:#fdeef5;color:#a04a74}
.mtgchip.other{background:#eef7ee;color:#3d7a3d}
button.mtgchip{cursor:pointer}
.mtgcard{border:1.5px solid var(--line);border-radius:12px;padding:10px 12px;margin:8px 0;background:#fff}
.mtghead{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.mtgtitle{font-weight:600;color:var(--accent-deep)}
.mtghead .mtg-del{margin-left:auto}
.mtgatt{display:flex;flex-wrap:wrap;gap:5px;margin-top:6px}
.mtgbody{margin:6px 0 0;font-size:.88rem;white-space:pre-wrap}

/* allergy checklists on the Medical page */
.medh{color:var(--accent-deep);margin:16px 0 4px;font-size:.95rem}
.allergygrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(240px,1fr));gap:4px 14px}
.allergycheck{display:flex;align-items:center;gap:8px;padding:5px 2px;flex-wrap:wrap}
.allergycheck input{width:18px;height:18px;flex:none}
.allergyacts{display:inline-flex;gap:6px;margin-left:auto}

/* poster + email library in Settings */
.posterlib{display:flex;flex-direction:column;gap:4px}
.posterrow{display:flex;align-items:center;gap:8px;padding:6px 8px;border:1px solid var(--line);border-radius:10px;background:#fff}
.posterrow .plabel{font-size:.88rem;font-weight:600;margin-right:auto}

/* beta badge: shown on every logged-in header and on the login page */
.betastrip{background:#2d2a33;color:#f6f3fb;text-align:center;font-size:.66rem;font-weight:800;
  letter-spacing:.09em;text-transform:uppercase;padding:4px 8px}
.landing .betastrip{width:min(560px,96vw);margin:0 auto;border-radius:0 0 10px 10px}
@media print{.betastrip{display:none}}

/* admin page: beta users + lead review, Jon only */
.admincard{background:var(--paper);border-radius:var(--radius);padding:16px;margin:0 0 16px;box-shadow:0 1px 4px rgba(0,0,0,.06)}
.admincard h2{margin:0 0 4px;font-size:1.05rem;color:var(--accent-deep);display:flex;align-items:center;gap:8px}
.tablewrap{overflow-x:auto;margin-top:10px}
.tablewrap table{width:100%;border-collapse:collapse;font-size:.85rem}
.tablewrap th{background:var(--bg);text-align:left;padding:7px 8px;color:var(--ink-soft);white-space:nowrap}
.tablewrap td{border-top:1px solid var(--line);padding:7px 8px;vertical-align:middle}
.tablewrap td a{color:var(--accent-deep)}
.admin-actions{white-space:nowrap}
.tagpill{display:inline-block;font-size:.7rem;font-weight:700;border-radius:999px;padding:2px 10px;text-transform:capitalize}
.tagpill.new{background:#fde2e2;color:#a12626}
.tagpill.approved{background:#e3f3ea;color:#2f7a52}
.tagpill.declined{background:#eee;color:#888}
.switch{position:relative;display:inline-block;width:42px;height:24px;vertical-align:middle}
.switch input{opacity:0;width:0;height:0}
.switch span{position:absolute;inset:0;background:#ddd;border-radius:999px;transition:.15s;cursor:pointer}
.switch span::before{content:"";position:absolute;width:18px;height:18px;left:3px;top:3px;background:#fff;border-radius:50%;transition:.15s;box-shadow:0 1px 3px rgba(0,0,0,.3)}
.switch input:checked+span{background:var(--mint)}
.switch input:checked+span::before{transform:translateX(18px)}
details summary{cursor:pointer;color:var(--ink-soft);font-size:.85rem;font-weight:600}

/* monthly calendar: the day's lessons in the cell, like the paper teaching calendar */
.mlesson{font-size:.68rem;line-height:1.25;margin-top:3px;padding:2px 5px;border-radius:6px;background:#f4f0fc;color:#4a3f78;cursor:pointer;overflow:hidden;word-break:break-word}
.mlesson:hover{background:#e9e2f8}

/* five-weekday spread: Monday..Friday columns, hidden on phones */
.wk5{display:none}
@media(min-width:760px){.wk5{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px;margin:0 0 14px;align-items:start}}
.wk5col{border:1.5px solid var(--line);border-radius:12px;background:#fff;padding:6px;min-width:0;overflow:hidden}
.wk5head{font-weight:800;color:var(--accent-deep);font-size:.85rem;padding:2px 2px 6px;cursor:pointer}
.wk5head small{color:var(--ink-soft);font-weight:700}
.wk5col .chip{margin:2px 0}
.wk5slot{margin-bottom:6px}
.wk5label{display:flex;justify-content:space-between;gap:4px;font-size:.85rem;font-weight:800;color:var(--accent-deep);padding:0 2px 2px}
.wk5time{color:var(--ink-soft);font-weight:600;font-size:.62rem;white-space:nowrap}
.wk5 textarea{width:100%;min-height:52px;font-size:.72rem;line-height:1.3;border:1px solid var(--line);border-radius:8px;padding:4px 6px;resize:vertical}

/* day pages: only today's window stays open; tap a day header to toggle */
.wk-day .dhead{cursor:pointer}
.wk-day.dayclosed>:not(.dhead){display:none}
.daychev{margin-left:6px;color:var(--accent-deep);font-weight:800}
@media print{.wk-day.dayclosed>:not(.dhead){display:block !important}}

/* big block labels in the weekly day view */
.slot .shead .slotlabel{font-size:2.1rem;line-height:1.05;font-weight:800;color:var(--ink)}

/* Break Board: live sign-out bubbles, visible on every screen */
#breakdock{position:fixed;right:14px;bottom:14px;z-index:90;display:flex;flex-direction:column;gap:8px;max-width:240px}
.breakbubble{background:#fff;border:2px solid var(--accent);border-radius:14px;padding:8px 14px;box-shadow:0 4px 14px rgba(0,0,0,.18);
  display:flex;flex-direction:column;gap:1px;animation:bbpulse 2.4s ease-in-out infinite}
.breakbubble b{color:var(--accent-deep);font-size:.95rem}
.breakbubble span{font-size:.72rem;color:var(--ink-soft);font-weight:700}
.breakbubble .bbtime{font-variant-numeric:tabular-nums}
.breakbubble.back{border-color:#3f9c53;background:#eaf7ec;animation:none}
.breakbubble.back b,.breakbubble.back span{color:#276b2d}
@keyframes bbpulse{0%,100%{transform:scale(1);box-shadow:0 4px 14px rgba(0,0,0,.18)}50%{transform:scale(1.05);box-shadow:0 6px 22px rgba(122,92,255,.4)}}
@media print{#breakdock{display:none}}
/* sign-out log table */
.blogtable{width:100%;border-collapse:collapse;font-size:.8rem}
.blogtable th{text-align:left;color:var(--accent-deep);padding:4px 6px;border-bottom:1.5px solid var(--line);position:sticky;top:0;background:#fff}
.blogtable td{padding:4px 6px;border-bottom:1px solid var(--line)}
.blogtable tr.stillout td{background:#fdeed9}

/* logged-on-the-spot pop up: round, closable, 2 minutes */
.breakbubble.spot{border-radius:999px;border-color:#d98ab5;padding:10px 38px 10px 18px;position:relative;align-items:flex-start}
.breakbubble.spot b{color:#8a2a4d}
.breakbubble.spot .bbx{position:absolute;top:50%;right:10px;transform:translateY(-50%);width:24px;height:24px;min-height:24px;
  border-radius:50%;background:#f6e3ee;color:#8a2a4d;font-weight:800;line-height:1;padding:0;display:flex;align-items:center;justify-content:center}

.blogdetail{max-width:220px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--ink-soft);font-size:.72rem}

/* Class List behavior + attendance tally */
.tallywrap{margin-top:18px;border-top:1.5px solid var(--line);padding-top:14px}
.tallyhd{color:var(--accent-deep);margin:0 0 4px;font-size:1rem}
.tallytable th,.tallytable td{text-align:center}
.tallytable th.tnm,.tallytable td.tnm{text-align:left;font-weight:700;white-space:nowrap}
.tallynum{min-width:34px;min-height:30px;padding:3px 9px;border-radius:8px;background:#efe6fb;color:var(--accent-deep);
  font-weight:800;cursor:pointer;border:0}
.tallynum:hover{background:#e0d2f7}
.tallyzero{color:#c9c2d6;font-weight:700}

/* birthdays in the 5-day spread: gold and slowly pulsating so they stand out */
.wk5col .chip.bday.bdaypulse{font-size:.78rem;font-weight:800;padding:4px 9px;text-align:center;
  animation:bdaypulse 2.4s ease-in-out infinite;transform-origin:center}
@keyframes bdaypulse{0%,100%{transform:scale(1);box-shadow:0 0 0 0 rgba(198,146,0,.45)}
  50%{transform:scale(1.05);box-shadow:0 0 12px 2px rgba(198,146,0,.65)}}
@media print{.bdaypulse{animation:none}}

/* birthday rolled forward to the Friday before a weekend/day off */
.wk5col .chip.bday.rollbday{display:flex;align-items:center;justify-content:center;gap:3px}
.wk5col .chip.bday.rollbday small{font-weight:700;opacity:.85}
.bdayarrow{color:#e01414;font-weight:900;font-size:1rem;line-height:1;margin-left:2px}

/* ---------- Docs: PDF library ---------- */
.docsdrop{border:2px dashed var(--line);border-radius:14px;padding:18px;display:flex;align-items:center;flex-wrap:wrap;gap:6px;margin:6px 0 4px;background:#fdfbff}
.docsdrop.dragover{border-color:var(--accent);background:#f4f0ff}
.docsgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(180px,1fr));gap:16px;margin-top:14px}
.doccard{border:1.5px solid var(--line);border-radius:14px;background:#fff;padding:10px;display:flex;flex-direction:column;gap:8px;
  box-shadow:0 2px 6px rgba(0,0,0,.06);cursor:grab}
.doccard.dragging{opacity:.5;cursor:grabbing}
.docthumb{border:0;padding:0;background:#f3f0fa;border-radius:10px;overflow:hidden;aspect-ratio:8.5/11;display:flex;align-items:center;justify-content:center;cursor:pointer;width:100%}
.docthumb img{width:100%;height:100%;object-fit:cover;object-position:top center;display:block}
.docnothumb{font-weight:800;color:var(--accent-deep);font-size:1.4rem;letter-spacing:1px}
.docname{border:0;background:none;text-align:left;font-weight:700;color:var(--ink);cursor:pointer;padding:0 2px;
  font-size:.86rem;line-height:1.25;word-break:break-word}
.docname:hover{color:var(--accent-deep)}
.docacts{display:flex;flex-wrap:wrap;gap:5px}
.docbtn{border:1px solid var(--line);background:#f6f3fd;color:var(--accent-deep);border-radius:8px;padding:4px 8px;
  font-size:.72rem;font-weight:700;cursor:pointer;min-height:0}
.docbtn:hover{background:#ece4fb}
.docbtn.del{color:#a12626;background:#fdf0f0;border-color:#e6c8c8}
.docsempty{padding:30px;text-align:center}
/* Docs viewer modal */
.modal.docmodal{max-width:min(96vw,940px);width:96vw;padding:0;overflow:hidden}
.docviewer{display:flex;flex-direction:column;max-height:88vh}
.docvhead{display:flex;align-items:center;gap:8px;padding:14px 52px 14px 18px;border-bottom:1px solid var(--line)}
.docvhead b{color:var(--accent-deep);font-size:1rem;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.docvhead .spacer{flex:1}
.docvbody{overflow:auto;padding:16px;background:#efeaf6;display:flex;flex-direction:column;align-items:center;gap:14px}
canvas.docpage{max-width:100%;box-shadow:0 2px 10px rgba(0,0,0,.18);background:#fff;border-radius:2px}
@media print{.topbar,.viewbar,.betastrip,.docsdrop,.docacts,.docsstatus{display:none !important}}

/* subject color coding on the weekly + 5-day calendars */
.slot[class*="subj-"]{border-left:4px solid var(--sc,transparent);padding-left:8px;border-radius:0 8px 8px 0}
.wk5slot[class*="subj-"]{border-left:4px solid var(--sc,transparent);padding-left:7px}
.slot[class*="subj-"] .slotlabel,.wk5slot[class*="subj-"] .wk5label>span:first-child{color:var(--sc)}
.subj-specials{--sc:#6b4bc4}
.subj-math{--sc:#c0396f}
.subj-reading{--sc:#2f7d40}
.subj-aloud{--sc:#9a7400}
.subj-grww{--sc:#2b5e9e}
.subj-writing{--sc:#9a7fd6}
.subj-socstudies{--sc:#5a5a66}

/* period-triggered quick actions on a lesson: blue file, yellow note */
.periodbtns{display:flex;gap:8px;margin:6px 0 2px;flex-wrap:wrap}
.periodbtns.hide{display:none}
.pfile{border:1.5px solid #b9d4f5;background:#e6f0fc;color:#1f5c9e;border-radius:999px;padding:5px 12px;font-size:.78rem;font-weight:800;cursor:pointer}
.pfile:hover{background:#d4e6fa}
.pnote{border:1.5px solid #f0dca0;background:#fbf1cf;color:#8a6a12;border-radius:999px;padding:5px 12px;font-size:.78rem;font-weight:800;cursor:pointer}
.pnote:hover{background:#f8e9b6}
.att.noteatt .noteopen{border:1.5px solid #f0dca0;background:#fbf5df;color:#8a6a12;border-radius:8px;padding:3px 8px;font-size:.75rem;font-weight:700;cursor:pointer}
.att.noteatt .noteopen:hover{background:#f6ecc6}
.att .fileatt{color:#1f5c9e}
.notebody{white-space:pre-wrap;background:#fffbe8;border-left:4px solid #f2c14e;padding:12px 14px;border-radius:8px;font-size:.95rem;line-height:1.5}
@media print{
  body.printing-note *{visibility:hidden}
  body.printing-note .modal-wrap,body.printing-note .modal-wrap *{visibility:visible}
  body.printing-note .modal-wrap{position:absolute;inset:0;background:#fff}
  body.printing-note .modal .close,body.printing-note .toolrow{display:none !important}
}

/* blue file marker on a lesson block that has a file attached */
.slot .filemark{display:none;margin-left:6px;color:#1f7ae0;font-size:.95rem;vertical-align:-1px}
.slot.has-file .filemark{display:inline}
.slot.has-file{box-shadow:inset 3px 0 0 #1f7ae0}
.slot.dropping{outline:2px dashed #1f7ae0;outline-offset:2px;background:#eef5ff;border-radius:8px}
/* link-a-file modal: drop zone + pick-from-Docs */
.lfdrop{border:2px dashed var(--line);border-radius:12px;padding:16px;display:flex;align-items:center;flex-wrap:wrap;gap:6px;background:#fdfbff}
.lfdrop.dragover{border-color:#1f7ae0;background:#eef5ff}
.lfdocs{display:flex;flex-wrap:wrap;gap:8px;max-height:180px;overflow:auto;margin-top:4px}
.lfdocitem{display:flex;flex-direction:column;align-items:center;gap:3px;width:84px;border:1.5px solid var(--line);border-radius:10px;
  background:#fff;padding:6px;cursor:pointer;font-size:.66rem;font-weight:700;color:var(--ink)}
.lfdocitem:hover{border-color:var(--accent)}
.lfdocitem img{width:64px;height:80px;object-fit:cover;object-position:top;border-radius:6px;background:#f3f0fa}
.lfdocitem span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}
/* Docs page: lesson files by subject */
.doclesscat{margin-top:12px}
.doclesshd{color:var(--accent-deep);margin:0 0 6px;font-size:.92rem}
.docgrid{display:grid;grid-template-columns:repeat(auto-fill,minmax(150px,1fr));gap:10px}
.doclessitem{display:flex;flex-direction:column;gap:2px;border:1.5px solid var(--line);border-radius:10px;background:#fff;
  padding:10px;text-decoration:none;color:var(--ink);box-shadow:0 1px 3px rgba(0,0,0,.05)}
.doclessitem:hover{border-color:var(--accent)}
.doclessitem .dlicon{font-size:1.3rem}
.doclessitem .dlname{font-weight:700;font-size:.8rem;line-height:1.25;word-break:break-word}
.doclessitem .dldate{color:var(--ink-soft);font-size:.7rem}

/* iPad-friendly grow-box control: floating button, bottom-LEFT so it clears the
   iPad Scribble bar (bottom-right) and the home indicator */
#growbtn{position:fixed;left:16px;bottom:calc(16px + env(safe-area-inset-bottom, 0px));z-index:95;
  background:var(--accent-deep);color:#fff;border:0;border-radius:999px;padding:12px 22px;font-size:.95rem;font-weight:800;
  box-shadow:0 4px 14px rgba(0,0,0,.28);min-height:48px;cursor:pointer}
#growbtn:active{transform:scale(.97)}
textarea.grown{resize:none}
@media print{#growbtn{display:none}}

/* Phone bottom navigation (iPhone-app style). Hidden on computer and iPad;
   shows only at phone width, where it is the primary nav for the two
   phone-only calendar views (5-Day / Today) plus Class Info. */
.botnav{display:none}
.cal5wrap,.cal1wrap{display:block}
.calweektitle{font-weight:800;color:var(--accent-deep);font-size:.95rem;margin:0 0 10px}
.cal1nav{display:flex;align-items:center;justify-content:space-between;gap:8px;margin:0 0 12px}
.cal1nav .cal1title{font-weight:800;color:var(--accent-deep);font-size:1rem;text-align:center;flex:1 1 auto}
.cal1btn{flex:0 0 auto;background:var(--accent-deep);color:#fff;border:0;border-radius:999px;
  padding:9px 16px;font-size:.85rem;font-weight:800;min-height:42px;cursor:pointer}
.cal1btn:active{transform:scale(.97)}
.cal5grid,.cal1grid{display:grid;gap:10px}
@media(max-width:640px){
  .botnav{display:flex;position:fixed;left:0;right:0;bottom:0;z-index:96;
    background:var(--paper);border-top:1.5px solid var(--line);
    box-shadow:0 -6px 16px rgba(0,0,0,.14);
    padding:6px 6px calc(6px + env(safe-area-inset-bottom, 0px));gap:4px}
  .botbtn{flex:1 1 0;display:flex;flex-direction:column;align-items:center;gap:2px;
    background:transparent;border:0;color:var(--accent-deep);font-size:.7rem;font-weight:700;
    padding:6px 2px;border-radius:12px;min-height:52px;cursor:pointer}
  .botbtn .botico{font-size:1.25rem;line-height:1}
  .botbtn.active{background:var(--accent-deep);color:#fff}
  /* clear the fixed bar so nothing hides behind it */
  .pages{padding-bottom:76px}
  #growbtn{bottom:calc(76px + env(safe-area-inset-bottom, 0px))}
}
@media print{.botnav{display:none}}

/* Simple Home screen (phone web app): the photo fills the whole screen edge to
   edge (under the status bar, down behind the bottom nav) with no bands. Just
   the photo, the hamburger (in the bottom bar), and the bottom nav. */
.pages.homeview{padding:0;margin:0;max-width:none;display:block}
/* Fill the TRUE full screen including the bottom home-indicator safe area.
   100lvh (large viewport height) includes the safe areas, unlike 100dvh which
   fell short of the physical bottom and leaked the body colour below the nav. */
.homehero{position:fixed;top:0;left:0;right:0;bottom:0;min-height:100lvh;
  background:#0e0e0e;overflow:hidden;z-index:0}
.homeimg{width:100%;height:100%;object-fit:cover;object-position:center;display:block}
/* Home fills under the iOS status bar (black-translucent). This scrim gives the
   white clock/battery text contrast over the light top of the photo. Only shows
   height when there is a real safe-area inset (installed app); zero in a browser. */
.homehero::before{content:"";position:fixed;top:0;left:0;right:0;
  height:calc(env(safe-area-inset-top, 0px) + 14px);
  background:linear-gradient(to bottom, rgba(0,0,0,.55), rgba(0,0,0,.12) 65%, transparent);
  z-index:2;pointer-events:none}
.topbar-home{background:transparent;border:0;box-shadow:none}
/* Non-home views: a branded fill behind the status bar so the white status text
   stays readable now that content runs full-screen under it. Invisible in a
   browser (no safe-area inset). */
.statusfill{position:fixed;top:0;left:0;right:0;height:env(safe-area-inset-top, 0px);
  background:var(--accent-deep);z-index:95}

/* Phone: the hamburger topbar is position:relative here and scrolls away, so the
   sticky view/print bars must pin to the very top (top:0), not 52px down where a
   gap would show scrolled content. This block is placed AFTER the base
   .viewbar/.print-actionbar rules on purpose: media queries add no specificity,
   so only later source order beats the base top:52px. */
@media(max-width:640px){
  .viewbar{top:0}
  .print-actionbar{top:0}
}

/* ---------- Phone web app: no top chrome, hamburger lives in the bottom bar ---------- */
/* Menu-only actions (Refresh / Expand / Collapse) are hidden in the desktop
   horizontal nav; they surface inside the phone bottom-sheet menu. */
.menuonly{display:none}
@media(max-width:640px){
  /* Strip everything off the top. */
  .betastrip{display:none}
  .viewbar{display:none}
  /* Keep the topbar in the DOM (it holds #navitems) but give it zero height and
     no visuals, so the very top of the app is just content. Do NOT display:none
     it, or the menu inside would be unreachable. */
  .topbar{min-height:0;height:0;padding:0;margin:0;overflow:visible;background:transparent;box-shadow:none}
  .topbar .navham{display:none}
  /* The nav menu opens upward as a bottom sheet, sitting above the bottom bar. */
  .navitems{position:fixed;left:8px;right:8px;top:auto;
    bottom:calc(74px + env(safe-area-inset-bottom,0px));z-index:98;
    max-height:62vh;overflow:auto;border-radius:16px}
  .navitems.open{display:flex}
  .navitems.open .menuonly{display:block}
  /* Content clears the iOS status bar now that the bars are gone. */
  main.pages{padding-top:calc(8px + env(safe-area-inset-top,0px))}
  .botham .botico{font-size:1.15rem}
}

/* ---------- Print papers: Canva pages behind printed data ---------- */
.no-screen{display:none}
/* per-page paper button next to Share/Print; tinted when a paper is set */
.pagepaper{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:32px;
  border-radius:8px;background:#f1edfa;color:var(--ink-soft);box-shadow:0 1px 2px rgba(0,0,0,.12)}
.pagepaper.haspaper{color:#fff;background:var(--accent)}
/* modal preview at letter shape */
.paperpreview{width:min(240px,60vw);aspect-ratio:8.5/11;margin:6px auto 12px;border:1.5px solid var(--line);
  border-radius:10px;overflow:hidden;background:#fff;display:flex;align-items:center;justify-content:center}
.paperpreview img{width:100%;height:100%;object-fit:fill;display:block}
.papernone{padding:14px;text-align:center;color:var(--ink-soft);font-size:.85rem}
/* Docs page paper cards */
.papercard .paperfor{display:block;color:var(--accent-deep);font-weight:700;font-size:.72rem;padding:0 6px 6px}
.papercard .docthumb img{object-fit:cover}
@media print{
  @page{size:letter portrait}
  .pagecard.has-paper{position:relative;width:8.5in;min-height:11in;margin:0;border-radius:0;box-shadow:none;
    padding:var(--paper-inset,56px);box-sizing:border-box;break-inside:avoid;page-break-inside:avoid}
  .pagecard.has-paper .printpaper{display:block;position:absolute;inset:0;width:100%;height:100%;object-fit:fill;
    z-index:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .pagecard.has-paper > :not(.printpaper){position:relative;z-index:1}
}

/* ---------- Rich text boxes: every writing surface accepts formatting ---------- */
.rte{display:block;width:100%;min-height:52px;border:1px solid var(--line);border-radius:8px;
  padding:8px;background:#fdfcff;overflow:auto;white-space:pre-wrap;word-break:break-word;
  font:inherit;line-height:1.35;-webkit-user-modify:read-write-plaintext-only}
.rte{-webkit-user-modify:read-write}
.rte:focus{outline:2px solid var(--accent)}
.rte:empty::before{content:"";display:inline-block}
.slot .rte.slotrte{background:#fdfcff}
.wk5 .rte.wk5rte{min-height:52px;font-size:.72rem;line-height:1.3;padding:4px 6px}
.lines .rte.cellinput{min-height:420px;border:0;background:repeating-linear-gradient(#fff 0 27px,#e8e3f2 27px 28px);
  line-height:28px;padding:0 6px;font-size:.95rem;border-radius:0}
.egrid td .rte.cellinput{border:0;background:transparent;border-radius:0;min-height:var(--tap);padding:9px 8px}
.egrid td .rte.cellinput:focus{outline:2px solid var(--accent);background:#faf8ff}
.lbox .rte{min-height:84px;border:1.5px solid var(--line);border-radius:10px;padding:9px;background:#fff}
.mtgrte{min-height:64px;border:1.5px solid var(--line);border-radius:10px;background:#fff;padding:10px}
.rte.grown{resize:none}
@media print{.rte{border-color:#ccc;background:#fff !important;overflow:visible;height:auto !important}}

/* floating formatting bar */
#rtebar{position:fixed;z-index:97;display:flex;align-items:center;gap:4px;flex-wrap:wrap;max-width:96vw;
  background:var(--paper);border:1.5px solid var(--line);border-radius:12px;box-shadow:0 6px 18px rgba(0,0,0,.18);
  padding:6px 8px}
#rtebar button{min-height:34px;min-width:34px;border-radius:8px;padding:2px 8px;font-size:1rem;color:var(--ink);background:#f1edfa}
#rtebar button:active{background:var(--accent);color:#fff}
#rtebar .rteswatch{min-width:26px;width:26px;height:26px;min-height:26px;border-radius:50%;padding:0;border:2px solid #fff;box-shadow:0 0 0 1px var(--line)}
#rtebar .rtesep{width:1.5px;height:24px;background:var(--line);margin:0 2px}
#rtebar select{min-height:34px;border:1.5px solid var(--line);border-radius:8px;background:#fff;font-size:.82rem;max-width:110px}
@media print{#rtebar{display:none}}

/* ---------- Calendar times print twice as big ---------- */
.slottime{font-size:1.4rem}
.markertime{font-size:1.6rem}
.wk5time{font-size:1.24rem}
.slot .shead .print-only{font-size:1.4rem}
.fixedtime{font-size:1.4rem}

/* Big 5-day-spread times need room in the narrow columns: let the label row
   wrap so the time drops to its own right-aligned line instead of clipping. */
.wk5label{flex-wrap:wrap;align-items:baseline}
.wk5time{margin-left:auto;white-space:nowrap;line-height:1.1}

/* ---------- Month rail: always fills the right edge top to bottom ---------- */
/* The tabs split the available height evenly and the type scales with screen
   height (which also widens the rail proportionally, since the text is
   vertical). Ten months on a big monitor = big tabs; small window = small tabs. */
.monthrail{display:flex;flex-direction:column;gap:4px;overflow:hidden;padding:6px 2px 8px}
.monthrail button{flex:1 1 0;min-height:0;display:flex;align-items:center;justify-content:center;
  font-size:clamp(.62rem,1.9vh,1.6rem);padding:0 .4em;line-height:1}
@media(max-width:640px){
  /* phone: no top chrome anymore, and the bottom bar owns the bottom edge */
  .monthrail{top:8px;bottom:calc(74px + env(safe-area-inset-bottom,0px))}
}

/* Start the month rail BELOW the Refresh/Expand/Collapse bar so they never
   overlap (topbar ~52px + view bar ~34px). Phone keeps its own top (that bar
   is hidden there). */
.monthrail{top:96px}
@media(max-width:640px){.monthrail{top:8px}}

/* Aa formatting toggle next to Share/Print: off by default, tinted when on */
.pagefmt{display:inline-flex;align-items:center;justify-content:center;width:32px;height:32px;min-height:32px;
  border-radius:8px;background:#f1edfa;color:var(--ink-soft);box-shadow:0 1px 2px rgba(0,0,0,.12);
  font-weight:800;font-size:.85rem}
.pagefmt.fmt-on{color:#fff;background:var(--accent)}
/* the bar must never cover popups (modals are z-index 60) */
#rtebar{z-index:55}

/* 5-day spread: time matches the block label size (per Jen, big times belong
   on the day cards below, not in these narrow columns) */
.wk5time{font-size:.85rem}

/* Anni eats lunch with the class: her portrait sits on every Lunch row */
.lunchpup{height:52px;width:auto;border-radius:12px;vertical-align:middle;margin:0 10px;
  box-shadow:0 1px 4px rgba(92,74,158,.25)}
.slot-lunch .shead{align-items:center}
.sched-fixed .lunchpup{height:40px;margin:0 8px}
@media print{.lunchpup{height:44px}}

/* Recess rows match the School starts / Release / Lunch inputs exactly */
.recessrow input{padding:12px;border:1.5px solid var(--line);border-radius:10px;background:#fff;min-height:var(--tap)}
.recessrow input:focus{outline:2px solid var(--accent);border-color:transparent}

/* ---------- live class timer ---------- */
#classtimer{position:fixed;right:16px;bottom:16px;z-index:45;text-align:center;font-weight:800;color:#fff;
  font-variant-numeric:tabular-nums}
#classtimer.ct-green{background:#2f8a4c;border-radius:16px;padding:10px 22px 12px;box-shadow:0 6px 18px rgba(47,138,76,.45)}
#classtimer.ct-green .ct-label{font-size:1rem;letter-spacing:.02em}
#classtimer.ct-green .ct-count{font-size:2rem;line-height:1.1}
#classtimer.ct-red{width:190px;height:190px;border-radius:50%;background:#d23c3c;display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:2px;box-shadow:0 10px 28px rgba(210,60,60,.55);
  animation:ctpulse 1.5s ease-in-out infinite}
#classtimer.ct-red .ct-warntext{font-size:1.05rem;line-height:1.2;max-width:130px}
#classtimer.ct-red .ct-count{font-size:2.8rem;line-height:1.05}
#classtimer .ct-x{position:absolute;top:10px;right:18px;color:#fff;font-size:1.3rem;min-height:0;padding:2px 8px;opacity:.85}
#classtimer .ct-x:hover{opacity:1}
@keyframes ctpulse{0%,100%{transform:scale(1)}50%{transform:scale(1.07)}}
@media(max-width:640px){#classtimer{bottom:calc(84px + env(safe-area-inset-bottom,0px))}}
@media print{#classtimer{display:none !important}}

/* Inserted photos display right in the lesson box (and print) */
.attphoto{max-width:220px;max-height:160px;border-radius:8px;display:block;box-shadow:0 1px 4px rgba(0,0,0,.18)}
.photoatt{display:inline-flex;align-items:flex-start;gap:2px;margin:4px 6px 2px 0}
.pphoto{background:#e7f3ea;color:#2f6b45;border:1px solid #bfe0c9;border-radius:999px;padding:3px 10px;font-size:.72rem;font-weight:700;min-height:0}
@media print{.attphoto{max-width:260px;max-height:200px}}

/* ---------- end-of-day celebration ---------- */
#celebrate{position:fixed;inset:0;z-index:300;background:rgba(46,38,66,.86);display:flex;flex-direction:column;
  align-items:center;justify-content:center;gap:18px;cursor:pointer;overflow:hidden}
.cele-scene{max-width:min(86vw,900px);max-height:60vh;border-radius:22px;box-shadow:0 16px 48px rgba(0,0,0,.5);z-index:2}
.cele-title{color:#fff;font-weight:800;font-size:clamp(1.3rem,3.5vw,2.2rem);text-shadow:0 2px 10px rgba(0,0,0,.4);z-index:2}
.cele-end{display:flex;gap:14px;z-index:3;cursor:auto}
.cele-fx{position:absolute;inset:0;pointer-events:none;z-index:1}
/* confetti */
.cf{position:absolute;top:-3vh;width:12px;height:18px;border-radius:3px;animation:cf-fall linear forwards}
@keyframes cf-fall{0%{transform:translateY(0) rotate(0deg)}100%{transform:translateY(108vh) rotate(720deg)}}
/* balloons */
.bl{position:absolute;bottom:-14vh;width:46px;height:58px;border-radius:50% 50% 48% 52%/55% 55% 45% 45%;
  animation:bl-rise linear forwards;opacity:.95}
.bl i{position:absolute;left:50%;bottom:-26px;width:2px;height:26px;background:rgba(255,255,255,.7)}
@keyframes bl-rise{0%{transform:translateY(0) translateX(0)}25%{transform:translateY(-30vh) translateX(14px)}50%{transform:translateY(-60vh) translateX(-12px)}75%{transform:translateY(-90vh) translateX(10px)}100%{transform:translateY(-125vh) translateX(0)}}
/* fireworks */
.fw{position:absolute;width:0;height:0}
.fw b{position:absolute;width:9px;height:9px;border-radius:50%;animation:fw-boom 1.2s ease-out forwards}
@keyframes fw-boom{0%{transform:translate(0,0);opacity:1}70%{opacity:1}100%{transform:translate(var(--dx),var(--dy));opacity:0}}
/* dances: the crew never stands still */
.dance-bounce{animation:d-bounce 1.1s ease-in-out infinite}
@keyframes d-bounce{0%,100%{transform:translateY(0) scale(1)}50%{transform:translateY(-16px) scale(1.02)}}
.dance-sway{animation:d-sway 1.8s ease-in-out infinite}
@keyframes d-sway{0%,100%{transform:rotate(-2.2deg)}50%{transform:rotate(2.2deg)}}
.dance-wiggle{animation:d-wiggle 1s ease-in-out infinite}
@keyframes d-wiggle{0%,100%{transform:scale(1) rotate(0)}25%{transform:scale(1.03) rotate(1.4deg)}75%{transform:scale(1.03) rotate(-1.4deg)}}
@media print{#celebrate{display:none !important}}

/* Jen's easter egg: a pocket party in a corner */
#miniparty{position:fixed;z-index:120;width:min(300px,42vw);border-radius:16px;overflow:hidden;cursor:pointer;
  box-shadow:0 10px 30px rgba(0,0,0,.4);animation:mp-in .5s ease}
#miniparty img{display:block;width:100%;animation:d-bounce 1.1s ease-in-out infinite}
#miniparty .mp-fx{position:absolute;inset:0;pointer-events:none;z-index:2;overflow:hidden}
.mp-cf{position:absolute;top:-8%;width:7px;height:11px;border-radius:2px;animation:mp-fall linear forwards}
@keyframes mp-fall{0%{transform:translateY(0) rotate(0)}100%{transform:translateY(260px) rotate(540deg)}}
@keyframes mp-in{0%{transform:scale(.4);opacity:0}100%{transform:scale(1);opacity:1}}
.mp-tl{top:14px;left:14px}.mp-tr{top:14px;right:14px}.mp-bl{bottom:90px;left:14px}.mp-br{bottom:90px;right:14px}
@media print{#miniparty{display:none !important}}

/* weekly-repeat day picks on recess/snack rows */
.recessdays{display:inline-flex;gap:8px;align-items:center;padding:2px 4px}
.recessday{display:inline-flex;align-items:center;gap:3px;font-size:.8rem;font-weight:700;color:var(--accent-deep);cursor:pointer}
.recessday input{width:auto;min-height:0;accent-color:var(--accent)}

/* ---------- Calendars living banner: seven pups dancing in place ---------- */
.dogband{display:flex;align-items:flex-end;justify-content:center;gap:1.5%;
  padding:26px 3% 10px;
  background:#d9ccf2;
  background-image:radial-gradient(circle at 12% 30%, #fff 0 44px, transparent 45px),
    radial-gradient(circle at 30% 75%, #fff 0 36px, transparent 37px),
    radial-gradient(circle at 50% 22%, #fff 0 48px, transparent 49px),
    radial-gradient(circle at 68% 70%, #fff 0 38px, transparent 39px),
    radial-gradient(circle at 86% 32%, #fff 0 46px, transparent 47px),
    radial-gradient(circle at 97% 85%, #fff 0 30px, transparent 31px)}
.dogband img{width:11.5%;height:auto;transform-origin:50% 100%}
.dogband img:nth-child(1){animation:d-sway 1.9s ease-in-out infinite}
.dogband img:nth-child(2){animation:d-bounce 1.3s ease-in-out .2s infinite}
.dogband img:nth-child(3){animation:d-wiggle 1.1s ease-in-out .4s infinite}
.dogband img:nth-child(4){animation:d-bounce 1.5s ease-in-out .1s infinite}
.dogband img:nth-child(5){animation:d-sway 1.6s ease-in-out .5s infinite}
.dogband img:nth-child(6){animation:d-bounce 1.2s ease-in-out .3s infinite}
.dogband img:nth-child(7){animation:d-wiggle 1.4s ease-in-out .6s infinite}
@media (prefers-reduced-motion: reduce){.dogband img{animation:none !important}}
@media print{.dogband{display:none !important}}

/* V-0.4.58: time-aware Calendars header. During a live recess block app.js
   sets body.recess-live; the Grok recess video replaces the dogband. */
.recessband{display:none;width:100%;height:auto;background:#d9ccf2}
body.recess-live .divider-card .recessband{display:block}
body.recess-live .divider-card .dogband{display:none}
@media print{.recessband{display:none !important}}

/* V-0.4.59: Calendars divider is the classic still banner again (dogband
   retired); during a live recess block the video replaces the still. */
body.recess-live .divider-card .bannerstill{display:none}
@media print{.bannerstill{display:block !important}}

/* V-0.4.60: full-screen document viewer. Tap the doc picture to open;
   nothing but the pages. Double-tap (or Escape) closes. */
#docfull{position:fixed;top:0;left:0;right:0;bottom:0;min-height:100lvh;z-index:220;background:#17141f;overflow-y:auto;-webkit-overflow-scrolling:touch;touch-action:pan-y;overscroll-behavior:contain;padding:env(safe-area-inset-top) 0 env(safe-area-inset-bottom)}
#docfull-pages{display:flex;flex-direction:column;align-items:center;gap:10px;padding:10px 0}
.docfull-page{display:block;width:100vw;max-width:900px;height:auto;background:#fff;box-shadow:0 2px 14px rgba(0,0,0,.5)}
.docfull-hint{color:#cfc7e6;text-align:center;margin-top:42vh;font-size:1.05rem}
.docfull-tip{position:fixed;left:50%;transform:translateX(-50%);bottom:calc(18px + env(safe-area-inset-bottom));background:rgba(0,0,0,.65);color:#fff;padding:8px 16px;border-radius:20px;font-size:.9rem;pointer-events:none;transition:opacity .8s;z-index:221}
.docfull-tip.fade{opacity:0}
@media print{#docfull{display:none !important}}

/* V-0.4.61: Post It notes. Plus circle bottom right on every device, five
   color-coded sticky kinds, planner + Notes page stickies, call popup. */
#fab{position:fixed;left:16px;bottom:calc(16px + env(safe-area-inset-bottom, 0px));z-index:95;width:56px;height:56px;border-radius:50%;border:0;background:var(--accent-deep, #6b4fd8);color:#fff;font-size:2.1rem;line-height:1;font-weight:800;box-shadow:0 6px 18px rgba(60,40,120,.4);cursor:pointer;display:flex;align-items:center;justify-content:center;padding:0 0 4px}
#fab:active{transform:scale(.93)}
#classtimer{bottom:88px} /* moved up so the sticky-note plus keeps the corner */
#fabmenu{position:fixed;left:16px;bottom:calc(84px + env(safe-area-inset-bottom, 0px));z-index:95;display:flex;flex-direction:column;gap:8px;background:#fff;border-radius:16px;padding:10px;box-shadow:0 12px 34px rgba(40,30,60,.4);width:min(300px, calc(100vw - 32px))}
#fabmenu[hidden]{display:none}
.fabopt{display:flex;flex-direction:column;align-items:flex-start;gap:1px;border:0;border-radius:10px;padding:10px 12px;cursor:pointer;text-align:left;font:inherit;box-shadow:0 1px 4px rgba(60,50,20,.18)}
.fabopt small{opacity:.72;font-size:.78rem}
.pk-general{background:#fff59a}
.pk-reminder{background:#a8d8ff}
.pk-missing{background:#ffb0a6}
.pk-call{background:#ffcf8f}
.pk-early{background:#b9edc0}
.pitrow{display:flex;flex-wrap:wrap;gap:8px;padding:8px 8px 2px}
.pitboard{display:flex;flex-wrap:wrap;gap:12px;margin:2px 0 16px}
.postit{position:relative;border-radius:2px 2px 16px 2px;padding:10px 26px 12px 12px;box-shadow:0 4px 10px rgba(60,50,20,.28);transform:rotate(-1.2deg);font-size:.92rem;max-width:290px;min-width:150px;break-inside:avoid}
.postit:nth-child(even){transform:rotate(1.1deg)}
.pit-kind{font-weight:800;font-size:.7rem;text-transform:uppercase;letter-spacing:.05em;opacity:.72;display:flex;gap:8px;align-items:baseline;flex-wrap:wrap}
.pit-time{font-size:.88rem;text-transform:none;letter-spacing:0;font-weight:800;opacity:1}
.pit-who{font-weight:800;margin-top:2px}
.pit-phones{display:flex;flex-wrap:wrap;gap:10px;margin-top:2px}
.pit-phones a{font-weight:800;color:#1d3fa3;text-decoration:none}
.pit-body{margin-top:4px;white-space:pre-wrap;overflow-wrap:anywhere}
.pit-stamp{margin-top:6px;font-size:.72rem;opacity:.62;font-style:italic}
.pit-x{position:absolute;top:3px;right:7px;border:0;background:none;font-weight:800;color:rgba(60,40,20,.5);cursor:pointer;font-size:1rem;padding:2px 4px}
.postit.pit-done{opacity:.55}
.pitform{border-radius:14px;padding:16px;margin:-4px}
.pitform label{display:block;font-weight:800;margin:10px 0 4px;font-size:.85rem}
.pitform input,.pitform select,.pitform textarea{width:100%;padding:9px;border:1px solid rgba(60,40,20,.3);border-radius:8px;background:rgba(255,255,255,.78);font:inherit;box-sizing:border-box}
#callpop{position:fixed;left:50%;top:16%;transform:translateX(-50%);z-index:260;background:#f28c1b;color:#fff;border-radius:18px;padding:18px 28px;text-align:center;box-shadow:0 12px 40px rgba(120,60,0,.55);animation:cppulse 1.1s ease-in-out infinite;min-width:272px;max-width:calc(100vw - 30px)}
@keyframes cppulse{0%,100%{transform:translateX(-50%) scale(1)}50%{transform:translateX(-50%) scale(1.05)}}
#callpop .cp-x{position:absolute;top:6px;right:12px;border:0;background:none;color:#fff;font-weight:800;font-size:1.15rem;cursor:pointer}
#callpop .cp-title{font-weight:800;letter-spacing:.04em;text-transform:uppercase;font-size:.8rem;opacity:.95}
#callpop .cp-who{font-size:1.2rem;font-weight:800;margin-top:4px}
#callpop .cp-phones{display:flex;justify-content:center;gap:14px;flex-wrap:wrap;margin-top:6px}
#callpop .cp-phones a{color:#fff;font-weight:800;font-size:1.25rem;text-decoration:underline}
#callpop .cp-note{margin-top:6px;font-size:.95rem;opacity:.95}
#callpop .cp-count{margin-top:8px;font-size:2rem;font-weight:800;font-variant-numeric:tabular-nums}
#callpop .cp-count small{display:block;font-size:.75rem;font-weight:700;opacity:.9}
@media (max-width:740px){
  #fab{bottom:calc(76px + env(safe-area-inset-bottom, 0px))}
  #fabmenu{bottom:calc(144px + env(safe-area-inset-bottom, 0px))}
  #classtimer{bottom:calc(148px + env(safe-area-inset-bottom, 0px))}
}
@media print{#fab,#fabmenu,#callpop{display:none !important}}

/* V-0.4.63: sixth sticky kind, Absence (soft purple, may span a date range) */
.pk-absence{background:#dcc9f7}

/* V-0.4.64: Google hookup. Docs page Google Docs list + settings card bits. */
.gdocslist{display:flex;flex-direction:column;gap:6px;max-width:640px}
.gdocitem{display:flex;justify-content:space-between;align-items:baseline;gap:12px;padding:10px 14px;border:1.5px solid var(--line);border-radius:10px;text-decoration:none;color:inherit;background:#fff}
.gdocitem:hover{border-color:var(--accent-deep)}
.gdocname{font-weight:700;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.gdocdate{font-size:.8rem;opacity:.65;white-space:nowrap}
@media print{#gdocsrow{display:none !important}}

/* V-0.4.66: one day per printed page, everywhere a week of stacked day cards
   prints. .weekgrid is shared by the phone 5-Day, the phone Today, and every
   desktop Weekly Lessons page, so this single rule covers them all. */
@media print{
  .weekgrid{display:block}
  .weekgrid > .wk-day{margin:0;break-inside:avoid;page-break-inside:avoid;break-after:page;page-break-after:always}
  .weekgrid > .wk-day:last-child{break-after:auto;page-break-after:auto}
  #cal5-root{page-break-after:auto}
  .calweektitle{break-after:avoid;page-break-after:avoid}
}

/* V-0.4.68: print papers frame EACH day of a week, one template per page
   (no more single paper stretched over a multi-page card). Mirrors the
   single-card .has-paper framing, applied per .wk-day. */
@media print{
  .weekgrid > .wk-day.has-paper{position:relative;width:8.5in;min-height:11in;margin:0;border:0;
    border-radius:0;background:transparent;box-shadow:none;padding:var(--paper-inset,56px);
    box-sizing:border-box;overflow:hidden;break-inside:avoid;page-break-inside:avoid}
  .weekgrid > .wk-day.has-paper .printpaper{display:block;position:absolute;inset:0;width:100%;height:100%;
    object-fit:fill;z-index:0;-webkit-print-color-adjust:exact;print-color-adjust:exact}
  .weekgrid > .wk-day.has-paper > :not(.printpaper){position:relative;z-index:1}
  /* in per-day paper mode the week/page title would push the first framed day
     off its page; each day's own date header carries the label instead */
  .pagecard.card-perday-paper > .ptitle,
  .pagecard.card-perday-paper .calweektitle{display:none !important}
}

/* V-0.4.69: auto-fit each framed day to one 8.5x11 page. app.js measures the
   day's content at true print geometry (.pp-measure) and sets --fit-scale on
   .wkday-scale. In print, .wkday-fit is a FIXED one-page-tall clip box (so the
   day's layout height stays exactly one page) and .wkday-scale is visually
   scaled to fit inside it, so a full day never spills to a second sheet. */
.pp-measure .weekgrid{display:block}
.pp-measure .weekgrid > .wk-day.has-paper{width:8.5in;min-height:0;padding:var(--paper-inset,56px);
  box-sizing:border-box;border:0;background:transparent}
.pp-measure .weekgrid > .wk-day.has-paper .wkday-fit{height:auto;overflow:visible}
.pp-measure .weekgrid > .wk-day.has-paper .wkday-scale{transform:none;width:100%}
.pp-measure .no-print,.pp-measure .printpaper{display:none !important}
@media print{
  .weekgrid > .wk-day.has-paper .wkday-fit{height:calc(11in - 2 * var(--paper-inset,56px));overflow:hidden}
  .weekgrid > .wk-day.has-paper .wkday-scale{transform:scale(var(--fit-scale,1));transform-origin:top left;width:100%}
}

/* V-0.4.70: templated pages print full-bleed. A named @page with margin:0 makes
   the 8.5x11 frame fill the physical sheet AND makes Chrome drop its injected
   header/footer (date, doc title, URL, page number) which only render when a
   page margin exists. Scoped to papered pages so plain prints keep their margin. */
@media print{
  @page framed{size:letter portrait;margin:0}
  .pagecard.has-paper,
  .weekgrid > .wk-day.has-paper{page:framed}
}

/* V-0.4.71: center each framed day's content in the page (both axes). The fit
   box is one page tall; flex-center the scaled content and scale from center so
   equal margins land on all four sides. Applies uniformly to every framed day. */
@media print{
  .weekgrid > .wk-day.has-paper .wkday-fit{display:flex;flex-direction:column;
    justify-content:center;align-items:center}
  .weekgrid > .wk-day.has-paper .wkday-scale{transform-origin:center center}
}

/* V-0.4.72: size templated print pages to the ACTUAL sheet, not a hard-coded
   8.5in. On a Mac defaulting to A4 (or any non-Letter paper), 8.5in overflowed
   the frame sideways. width:100% fills whatever the @page box is (Letter for
   machines that honor size:letter, the real paper otherwise), so the schedule
   stays inside the border everywhere. No change on Letter (100% == 8.5in). */
@media print{
  .pagecard.has-paper,
  .weekgrid > .wk-day.has-paper{width:100%;max-width:100%}
}

/* V-0.4.73: make every interactive control tap instantly for Apple Pencil and
   finger alike (no double-tap-zoom delay). The real Pencil fix is in app.js
   (removed the palm-rejection that was cancelling the Pencil's own taps). */
button,a,label,summary,[role="button"],.tab,.botbtn{touch-action:manipulation}

/* ---------- V-0.4.77: X on the right end of the text edit bar ---------- */
#rtebar .rteclose{background:#fff;border:1.5px solid var(--line);color:#8a8496;font-weight:700;font-size:.95rem}
#rtebar .rteclose:active{background:var(--accent);color:#fff}

/* ---------- V-0.4.81: make the text edit bar actually hide ---------- */
/* #rtebar sets display:flex (ID specificity), which silently overrode the UA
   [hidden]{display:none}, so bar.hidden=true (the X and Aa close paths) never
   hid it. id+attribute specificity here beats the plain id rule. This is why
   the X would not close across V-0.4.77 to 0.4.80. */
#rtebar[hidden]{display:none}

/* ---------- V-0.4.84: text edit bar docked right, vertical column, just left of the month tabs ---------- */
#rtebar{flex-direction:column;align-items:stretch;flex-wrap:nowrap;gap:6px;width:150px;max-width:150px;max-height:calc(100dvh - 20px);overflow-y:auto}
#rtebar .rtebiu{display:flex;gap:4px}
#rtebar .rtebiu button{flex:1}
#rtebar .rteswatches{display:grid;grid-template-columns:repeat(4,1fr);gap:6px;justify-items:center}
#rtebar .rtesep{width:auto;height:1.5px;margin:0}
#rtebar select{max-width:none;width:100%}
#rtebar .rteclose{width:100%}

/* ---------- V-0.4.85: art-directed Home hero, one image per device size ---------- */
.homehero picture{display:block;width:100%;height:100%}

/* ---------- V-0.4.88: divider/section title bars had ZERO room reserved for
   .pagetools, which still renders (share + print, up to 76px) even on
   cover/divider pages. Same root cause as the .ptitle fix above, just never
   had a reservation at all. dv-title is centered text, so pad both sides
   equally to keep it visually centered instead of skewing it left. */
.divider-card .dv-title{padding-left:76px;padding-right:76px}

/* V-0.4.97 tally lock + edit mode: the lock button sits above the Behavior &
   attendance tally. Locked = numbers open the log; unlocked = every count
   (zeros too) is tappable to correct by hand. Appended at END per gotcha 1. */
.tallybar{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin:2px 0 10px}
.tallylock{font:inherit;font-weight:800;font-size:.9rem;border:1.5px solid var(--line);background:#fff;color:var(--deep,#4a3f78);
  border-radius:999px;padding:8px 16px;cursor:pointer}
.tallylock.open{background:#fff4e0;border-color:#e0b96a;color:#7a4a00}
.tallynum.tallyeditable{background:#f4f0ff;border:1.5px dashed var(--accent,#7a5cff);border-radius:8px;min-width:38px}
.tallypdf{white-space:nowrap}
/* V-0.4.108: the 5-day weekly spread (wk5) now shows the fixed markers
   (School starts, Lunch, Snack, Recess, Release) interleaved with the subject
   blocks, matching the stacked day cards. These rows are info only (no lesson
   box), tinted and dashed like the day-card fixed slots. */
.wk5slot.wk5fixed{background:#f5f2fb;border:1px dashed var(--line);border-radius:8px;padding:4px 6px;margin-bottom:6px}
.wk5slot.wk5fixed .wk5label{align-items:center}
.wk5fixedname{display:flex;align-items:center;gap:4px;min-width:0;color:var(--accent-deep)}
.wk5pup{height:20px;width:auto;border-radius:4px;flex:none}
/* V-0.4.109: Appointment sticky (FAB "Appointment"): a meeting with a type,
   title, start/end time, location, and notes. Teal, distinct from the other
   sticky kinds. */
.pk-appt{background:#a7e5dd}
.pit-appt-title{font-weight:800;font-size:1.02rem;margin-top:2px;line-height:1.2}
.pit-loc{margin-top:3px;font-size:.9rem;color:var(--ink-soft);font-weight:600;display:flex;align-items:baseline;gap:5px}
.pit-locicon{font-size:.6rem;opacity:.7}
.pitform .pit-timerow{display:flex;gap:10px}
.pitform .pit-timecol{flex:1;display:flex;flex-direction:column}
/* V-0.4.110: dated stickies (appointments, reminders, etc.) show in the 5-day
   spread. In the narrow wk5 columns they fill the column, sit flat (no tilt),
   and shrink a touch so they read cleanly above the day's schedule. */
.wk5 .wk5pitrow{padding:0;margin:0 0 6px;gap:6px}
.wk5 .wk5pitrow .postit{width:100%;min-width:0;max-width:100%;transform:none;font-size:.8rem;padding:7px 22px 8px 9px;box-shadow:0 2px 6px rgba(60,50,20,.2)}
.wk5 .wk5pitrow .pit-appt-title{font-size:.9rem}
.wk5 .wk5pitrow .pit-body{font-size:.78rem}
/* V-0.4.116/117/118: To Do List on every day's lesson plan. Open items from the
   To Do Checklist page ride on top of each day, with a checkbox; checking marks
   the same checklist cell done so it drops off. It renders on BOTH the wk5
   5-day spread AND the detailed day card (V-0.4.118, per Jon: keep it on both
   the five-day view and the single-day view), so on desktop it shows in the
   5-column overview and on the stacked day cards; on phone the day cards show
   it. No dedup media query. */
.daytodo-box{background:#fff7e6;border:1px solid #f0d9a0;border-radius:10px;padding:8px 10px;margin:0 0 8px}
.daytodo-title{font-weight:800;font-size:.72rem;text-transform:uppercase;letter-spacing:.05em;color:#8a6d1f;margin-bottom:4px}
.daytodo{display:flex;align-items:flex-start;gap:8px;padding:3px 0;cursor:pointer}
.daytodo-check{margin-top:2px;width:18px;height:18px;flex:none;cursor:pointer;accent-color:#c69200}
.daytodo-txt{font-size:.9rem;line-height:1.3}
.wk5 .daytodo-box{padding:6px 8px}
.wk5 .daytodo-txt{font-size:.82rem}

/* Specials rotation card image inside a Specials lesson block (V-0.4.120).
   Shows on days inside a rotation's date range; never on Early Release days.
   Prints with the plan. Capped so it never dominates the box. */
.specials-rot{display:block;max-width:220px;width:100%;height:auto;border-radius:8px;border:1px solid var(--line);margin:0 0 6px}
.wk5 .specials-rot{max-width:100%;margin:0 0 4px}
.srot-card{border:1px solid var(--line);border-radius:12px;padding:10px;margin-bottom:10px;background:#fafafa}
.srot-range{display:flex;align-items:center;gap:8px;margin-bottom:6px;flex-wrap:wrap}
.srot-range input[type=date]{flex:1;min-width:130px}

/* Second, unlabeled writing box on a subject block (V-0.4.124, extra_boxes).
   A small gap sets it apart from the first box; no header/label by design. */
.slotrte-extra{margin-top:6px}
.wk5rte-extra{margin-top:4px}

/* Inline stickers (V-0.4.125). A sticker is a small image dropped into a lesson
   box; it sits on the text baseline and prints with the plan. */
.sticker{display:inline-block;height:38px;width:auto;vertical-align:-11px;margin:0 3px;max-width:270px}
.wk5rte .sticker,.wk5 .sticker{height:30px;vertical-align:-8px}
/* the sticker tray, opened from the formatting toolbar */
#stickertray{position:fixed;left:50%;transform:translateX(-50%);z-index:60;width:min(340px,92vw);max-height:70vh;overflow:auto;background:#fff;border:1px solid var(--line);border-radius:16px;box-shadow:0 10px 30px rgba(0,0,0,.22);padding:12px}
#stickertray[hidden]{display:none}
.stkhead{display:flex;align-items:center;justify-content:space-between;font-weight:700;color:var(--ink,#332f3b);margin-bottom:8px}
.stkclose{border:0;background:#f0edf6;border-radius:8px;width:28px;height:28px;cursor:pointer;font-size:.9rem}
.stkgrid{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.stkpick{border:1px solid var(--line);background:#fff;border-radius:10px;padding:5px 7px;cursor:pointer;display:inline-flex;align-items:center;min-height:38px}
.stkpick:active{transform:scale(.94)}
.stkpick img{height:24px;width:auto;display:block;pointer-events:none}
.stkwrap{position:relative;display:inline-flex}
.stkdel{position:absolute;top:-6px;right:-6px;width:18px;height:18px;border-radius:50%;border:0;background:#d13b3b;color:#fff;font-size:.7rem;line-height:1;cursor:pointer;padding:0}
.stkfoot{display:flex;align-items:center;gap:10px;margin-top:10px;flex-wrap:wrap}
.stkadd{border:1px dashed var(--line);background:#faf8ff;border-radius:10px;padding:8px 12px;cursor:pointer;font-weight:600;color:var(--ink,#332f3b)}
.stkhint{color:var(--ink-soft,#8a8594);font-size:.8rem}
.rtesticker{font-size:1rem}

/* Day stickers (V-0.4.128): a sticker pinned to a day via a post-it (kind sticker).
   Rendered as just the image, no sticky-note card. */
.postit.pk-sticker{background:none;border:0;box-shadow:none;transform:none;padding:0;overflow:visible}
.daysticker{display:block;max-width:150px;width:auto;height:auto}
.wk5 .daysticker,.wk5pitrow .daysticker{max-width:100%}
/* the sticker picker inside the Day Sticker modal */
.pitstkpick{display:flex;flex-wrap:wrap;gap:6px;max-height:190px;overflow:auto;border:1px solid var(--line);border-radius:10px;padding:8px;margin:4px 0 8px}
.pitstk{border:1px solid var(--line);background:#fff;border-radius:8px;padding:4px 6px;cursor:pointer;display:inline-flex;align-items:center;min-height:34px}
.pitstk img{height:22px;width:auto;pointer-events:none;display:block}
.pitstk.sel{outline:2px solid #7c6bb8;border-color:#7c6bb8;background:#f3effb}

/* Default rounded UI font (V-0.4.131). Self-hosted so it renders identically on
   iPhone / iPad / Mac Chrome / Windows, instead of relying on ui-rounded /
   SF Pro Rounded which browsers (esp. Chrome) do not reliably expose. Baloo 2
   latin, variable weight 400-800. CSP font-src 'self' allows it. */
@font-face{font-family:"AnniRounded";src:url(/fonts/anni-rounded-v1.woff2) format("woff2");font-weight:400 800;font-style:normal;font-display:swap}

/* V-0.4.134: larger subject headings in the 5-day week spread so subjects are
   easy to read at a glance and visually separate. Was .85rem; the day header
   (.wk5head) is left as-is. Appended override wins over the .85rem rule above. */
.wk5label{font-size:1.1rem}

/* V-0.4.135: lesson-plan block times (.slottime, was 1.4rem) matched to the
   lunch/snack fixed-block time size (.markertime is 1.6rem). Appended override. */
.slottime{font-size:1.6rem}

/* V-0.4.137: fixed-block headings (School Starts, Lunch, Snack Break, Recess,
   Release) enlarged to match their time size (1.6rem). The label is the bare
   <span> in a .slot-fixed .shead; :not(.print-only) excludes the print time
   span. Regular subject labels (.slotlabel) are untouched (scoped to .slot-fixed). */
.slot-fixed .shead > span:not(.print-only){font-size:1.6rem}

/* V-0.4.138: movable sticky notes on Today + Week views. Fixed-position pink
   note (uploaded image), draggable by the top tape strip, closed with the X,
   with a writable text box (type or pencil). Bigger than lesson boxes so it
   pops. z-index 55 sits above calendar content but below modals (60) and the
   FAB (95). touch-action:none so a drag does not scroll the page under it. */
.stickynote{position:fixed;width:320px;height:320px;z-index:55;
  background:url(/img/sticky-note-pink-v2.png) center/100% 100% no-repeat;
  filter:drop-shadow(0 8px 16px rgba(80,40,70,.28))}
.stickynote.dragging{filter:drop-shadow(0 14px 28px rgba(80,40,70,.38))}
.stickynote-drag{position:absolute;top:0;left:0;right:0;height:16%;cursor:grab;
  display:flex;align-items:flex-start;justify-content:center;padding-top:2px;
  color:rgba(70,45,60,.4);font-size:.9rem;letter-spacing:1px;user-select:none;touch-action:none}
.stickynote.dragging .stickynote-drag{cursor:grabbing}
.stickynote-x{position:absolute;top:5%;right:6%;width:30px;height:30px;border-radius:50%;
  border:0;background:rgba(255,255,255,.72);color:#7a3a56;font-size:1.35rem;font-weight:800;
  line-height:1;cursor:pointer;display:flex;align-items:center;justify-content:center;
  box-shadow:0 1px 3px rgba(0,0,0,.18);z-index:2}
.stickynote-x:hover{background:#fff}
.rte.stickyrte{position:absolute;top:20%;left:13%;right:13%;bottom:11%;overflow:auto;
  background:transparent;border:0;color:#4a2b3a;font-size:1.15rem;line-height:1.3;
  padding:2px;min-height:0;touch-action:auto}
.rte.stickyrte:focus{outline:none}

/* V-0.4.140: the "+" (FAB) menu grew many options and overflowed small screens.
   Cap its height and let it scroll. dvh handles mobile browser chrome; the vh
   line is the fallback. overscroll-behavior:contain keeps a scroll gesture in
   the menu from scrolling the page behind it. */
#fabmenu{max-height:70vh;max-height:70dvh;overflow-y:auto;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}

/* V-0.4.141: calendar info (event chips on days: synced/added events, plus the
   break/milestone/birthday marks that share .chip) was tiny at .6rem. Bump the
   base .chip so calendar information reads clearly. Appended override wins over
   the .6rem rule above. Chips stay nowrap+ellipsis in narrow cells. */
.chip{font-size:.8rem}

/* V-0.4.142: calendar chips wrap to multiple lines instead of truncating with an
   ellipsis, so full event text is always readable (Jon: no truncating, wrap). */
.chip{white-space:normal;overflow:visible;text-overflow:clip}

/* V-0.4.143: specials rotation cards a tad smaller in the single-day lesson view
   (was max-width 220px). The 5-day card is scoped by the more specific
   `.wk5 .specials-rot` rule and is unaffected. */
.specials-rot{max-width:185px}

/* V-0.4.144: 5-Day / Today were reachable only from the phone bottom nav, which
   is hidden on iPad/desktop, leaving no way to open those views there. Added
   5-Day + Today tabs to the top nav; hide them at phone width where the bottom
   nav already provides them (avoids duplicate buttons on the phone). */
@media(max-width:640px){.calnavtab{display:none}}

/* V-0.4.146: (1) 5-day lesson text boxes defaulted to .72rem (~11.5px = the
   toolbar "Small"); bump to 1rem so untyped text matches the "Normal" option
   (font size 3 = 16px = 1rem, root html is 16px). (2) specials rotation cards
   on the 5-day view reduced from filling the column to a smaller fixed width. */
.wk5 .rte.wk5rte{font-size:1rem}
.wk5 .specials-rot{max-width:110px}

/* V-0.4.151: Student Checklists grid. Rows = imported student names, columns =
   teacher-typed pastel collection items; a checkbox shows once a column header
   has text. Column colors come inline from the template's pastel palette. */
.scltable{border-collapse:separate;border-spacing:0}
.scltable th,.scltable td{border:1px solid #e7e3f1}
.scltable .scl-nameh{background:#f4f0fc;position:sticky;left:0;z-index:2;min-width:148px;text-align:left;padding:8px 10px}
.scltable .scl-name{position:sticky;left:0;z-index:1;background:#fff;text-align:left;font-weight:700;padding:8px 10px;white-space:nowrap}
.scltable .scl-colh{min-width:104px;max-width:120px;padding:4px;vertical-align:bottom}
.scl-colinput{width:100%;border:0;background:transparent;text-align:center;font-weight:800;color:#3f3a56;font-size:.95rem;line-height:1.2;padding:6px 4px;border-radius:8px}
.scl-colinput:focus{outline:2px solid var(--accent);background:rgba(255,255,255,.65)}
.scl-colinput::placeholder{color:#8a84a0;font-weight:600}
.scltable .scl-cell{text-align:center;padding:6px 4px}
.scl-check{width:22px;height:22px;cursor:pointer;accent-color:var(--accent-deep, #6b4fd8)}

/* V-0.4.152: group Print + Docs with the right-side buttons. The right cluster is
   pushed over by margin-left:auto; move that start point from Settings onto Print
   so Print, Docs, Settings, Search, Share all sit together on the right. */
.tab.printbtn{margin-left:auto}
.tab.settingsbtn{margin-left:0}

/* V-0.4.157: attachments (links/files/notes/photos added on the day view) now
   also show on the 5-day spread, compact + read-only. Constrain so long links
   wrap/truncate in the narrow columns and photos are small thumbnails. */
.wk5 .attachrow.wk5atts{margin-top:5px}
.wk5atts .att{max-width:100%}
.wk5atts .att.fileatt{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;display:inline-block}
.wk5atts .attphoto{max-width:64px;max-height:64px;border-radius:6px}
.wk5atts .att.voicenote audio{max-width:150px}
/* V-0.4.161: Data tab report hub. Big friendly cards, one per sign-out kind,
   that open the per-category report. Appended at the end per the CSS rule. */
.datacards{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:14px;margin-top:14px}
.datacard{display:flex;flex-direction:column;align-items:flex-start;gap:4px;text-align:left;
  background:var(--paper,#fffdfa);border:1.5px solid var(--line,#e4ddf2);border-radius:16px;
  padding:18px 18px 16px;cursor:pointer;transition:transform .08s ease,box-shadow .12s ease,border-color .12s ease}
.datacard:hover{transform:translateY(-2px);box-shadow:0 8px 22px rgba(74,63,120,.14);border-color:var(--accent,#7a5cff)}
.datacard .dc-ico{font-size:30px;line-height:1}
.datacard .dc-name{font-size:1.15rem;font-weight:700;color:var(--deep,#4a3f78)}
.datacard .dc-sub{font-size:.9rem;color:var(--soft,#6b6577)}
/* V-0.4.162: Break board options editor (F2) in Settings. */
.bcfg-opt{border:1.5px solid var(--line,#e4ddf2);border-radius:12px;padding:10px 12px;margin:8px 0;background:#fff}
.bcfg-row{display:flex;align-items:center;gap:10px;flex-wrap:wrap}
.bcfg-label{flex:1;min-width:150px;font:inherit;padding:8px 10px;border:1.5px solid var(--line,#e4ddf2);border-radius:9px}
.bcfg-on{display:flex;align-items:center;gap:6px;font-size:.9rem;font-weight:600;white-space:nowrap}
.bcfg-on input{width:18px;height:18px}
.bcfg-tag{color:var(--ink-soft,#6b6577);font-size:.75rem;white-space:nowrap}
.bcfg-qs{margin-top:8px;padding-left:8px;border-left:3px solid #f0ecf9}
.bcfg-q{display:flex;align-items:center;gap:6px;flex-wrap:wrap;margin:6px 0}
.bcfg-qlabel{flex:1;min-width:160px;font:inherit;font-size:.9rem;padding:7px 9px;border:1.5px solid var(--line,#e4ddf2);border-radius:8px}
.bcfg-qtype{font:inherit;font-size:.85rem;padding:6px;border:1.5px solid var(--line,#e4ddf2);border-radius:8px}
.bcfg-req{display:flex;align-items:center;gap:4px;font-size:.8rem;white-space:nowrap}
.bcfg-qchoices{width:100%;font:inherit;font-size:.85rem;padding:7px 9px;border:1.5px dashed var(--line,#e4ddf2);border-radius:8px}
.bcfg-qadd{margin-top:4px}
/* V-0.4.162: Colors settings card (F4). */
.theme-swatch{width:42px;height:42px;min-height:42px;border-radius:50%;border:3px solid #fff;box-shadow:0 0 0 1.5px var(--line),0 2px 6px rgba(0,0,0,.15);cursor:pointer;padding:0}
.theme-swatch:active{transform:scale(.94)}
.theme-custom{display:inline-flex;align-items:center;gap:6px;font-size:.85rem;font-weight:600;cursor:pointer}
.theme-custom input{width:42px;height:42px;border:0;background:none;padding:0;cursor:pointer}
/* V-0.4.163: Sub Plans day block. Added from the + menu onto one day; four
   sections with typeable boxes. Manila-folder look so it reads "for the sub"
   at a glance; Students to Watch is red per Jen's spec. */
.subplan-card{background:#fff8e7;border:1.5px solid #e8d9ae;border-radius:14px;padding:12px 14px 10px;margin:10px 0 12px;box-shadow:0 2px 8px rgba(122,92,20,.08)}
.subplan-card .sphead{display:flex;align-items:center;justify-content:space-between;margin-bottom:6px}
.subplan-card .sptitle{font-weight:800;font-size:1.05rem;color:#7a5c14}
.subplan-card .spdel{font-size:1.3rem;line-height:1;color:#a8965e;background:none;border:0;cursor:pointer;padding:2px 8px;min-height:0}
.subplan-card .spdel:hover{color:#c02525}
.subplan-card .spsec{margin:7px 0}
.subplan-card .splab{display:block;font-weight:700;font-size:.85rem;color:#7a5c14;margin-bottom:3px}
.subplan-card .spbox{width:100%;font:inherit;font-size:.95rem;line-height:1.4;padding:8px 10px;border:1.5px solid #e8d9ae;border-radius:9px;background:#fffdf6;resize:vertical;min-height:2.6em}
.subplan-card .spbox:focus{outline:none;border-color:#caa93f}
.subplan-card .spsec.spwatch .splab,.subplan-card .spsec.spwatch .spbox{color:#c02525}
.subplan-card .spsec.spwatch .spbox{border-color:#e5b8b8;background:#fff7f7}
@media print{.subplan-card{box-shadow:none}}
/* V-0.4.164: Sub Plans polish per Jon. Section titles match the lesson-plan
   subject titles (.slotlabel: 2.1rem/800); the + menu option gets its manila
   color instead of white. */
.subplan-card .splab{font-size:2.1rem;line-height:1.05;font-weight:800}
.fabopt.pk-subplans{background:#f2dfae}
/* V-0.4.166: Pull-out classes (Speech, Resource). Inline strip in the day's
   schedule at its time position, plus the manager modal from the + menu. */
.slot.slot-pullout{background:#f3edff;border:2.5px solid #c9b6f2;border-radius:14px;padding:9px 14px 10px;margin:7px 0}
.slot-pullout .pohead{display:flex;align-items:center;gap:9px;flex-wrap:wrap}
.slot-pullout .poico{font-size:1.3rem;line-height:1}
.slot-pullout .polabel{font-size:1.6rem;font-weight:800;color:#5c4a9e}
.slot-pullout .potime{font-size:1.3rem;font-weight:700;color:#7c6bb8;margin-left:auto}
.slot-pullout .poedit{background:none;border:0;color:#a08fd0;font-size:1rem;cursor:pointer;padding:2px 6px;min-height:0}
.slot-pullout .postudents{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}
.pokid{background:#fff;border:1.5px solid #c9b6f2;border-radius:999px;padding:2px 11px;font-size:.92rem;font-weight:600;color:#5c4a9e}
.pokid.ponone{color:#9a90b5;border-style:dashed;font-weight:400}
.wk5slot.wk5pullout{background:#f3edff;border-radius:10px}
.wk5pullout .wk5fixedname{color:#5c4a9e}
.wk5postudents{padding:0 6px 6px}
.wk5postudents .pokid{font-size:.68rem;padding:1px 7px}
/* manager modal */
.po-item{border:2.5px solid #c9b6f2;border-radius:13px;background:#fff;padding:9px 11px;margin:8px 0}
.po-row{display:flex;align-items:center;gap:7px;flex-wrap:wrap}
.po-label{flex:1;min-width:110px;font:inherit;padding:7px 9px;border:1.5px solid var(--line);border-radius:9px}
.po-day,.po-start,.po-end{font:inherit;font-size:.9rem;padding:6px;border:1.5px solid var(--line);border-radius:8px}
.po-to{font-size:.85rem;color:var(--ink-soft)}
.po-kids{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
.po-kid{font:inherit;font-size:.85rem;padding:4px 12px;min-height:0;border-radius:999px;border:1.5px solid var(--line);background:#faf8ff;color:var(--ink-soft);cursor:pointer}
.po-kid.on{background:#7c6bb8;border-color:#7c6bb8;color:#fff;font-weight:700}
.fabopt.pk-pullout{background:#e2d5fb}
/* V-0.4.167: pull-out strips restyled BRIGHT PINK with a yellow star (Jon:
   make it pop on the lesson plans). Overrides the V-0.4.166 soft purple. */
.slot.slot-pullout{background:#ff5ca8;border-color:#e0338a;box-shadow:0 2px 8px rgba(224,51,138,.3)}
.slot-pullout .polabel{color:#fff}
.slot-pullout .potime{color:#ffe3f1}
.slot-pullout .poedit{color:#ffd0e6}
.slot-pullout .poedit:hover{color:#fff}
.slot-pullout .pokid{background:#fff;border-color:#fff;color:#d6247d}
.slot-pullout .pokid.ponone{color:#f4a9cf;background:rgba(255,255,255,.35);border-color:#ffb7dc}
.wk5slot.wk5pullout{background:#ff5ca8;border-radius:10px}
.wk5pullout .wk5fixedname{color:#fff}
.wk5pullout .wk5time{color:#ffe3f1}
.wk5postudents .pokid{background:#fff;border-color:#fff;color:#d6247d}
.fabopt.pk-pullout{background:#ffc2df}
.po-item{border-color:#f48fc0}
.po-kid.on{background:#e0338a;border-color:#e0338a}
/* pull-out date window row in the manager */
.po-rangerow{margin-top:6px;font-size:.85rem;color:var(--ink-soft)}
.po-rangelab{font-weight:700;color:#d6247d}
.po-mode{display:inline-flex;align-items:center;gap:4px;white-space:nowrap}
.po-mode input{width:16px;height:16px}
.po-daterange{display:inline-flex;align-items:center;gap:6px;flex-wrap:wrap}
.po-from,.po-until{font:inherit;font-size:.85rem;padding:5px;border:1.5px solid var(--line);border-radius:8px}

/* V-0.4.168: bump scope picker (all lessons vs certain subjects) */
.bumpscope { display: flex; gap: 14px; flex-wrap: wrap; margin: 4px 0 8px; }
.bumpradio { display: flex; align-items: center; gap: 7px; font-weight: 700; font-size: .95rem; cursor: pointer; }
.bumpradio input { width: 18px; height: 18px; accent-color: var(--accent, #e8618c); }
.bumpsubs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 12px; padding: 10px 12px; background: #faf6ef; border: 1.5px solid var(--line); border-radius: 12px; margin-bottom: 4px; }
.bumpsub { display: flex; align-items: center; gap: 7px; font-size: .92rem; cursor: pointer; padding: 3px 0; }
.bumpsub input { width: 17px; height: 17px; accent-color: var(--accent, #e8618c); flex: none; }

/* V-0.4.170: per-day pull-out removal (X on the strip, "Off on" chips in the manager) */
.slot-pullout .poskip { background: none; border: 0; color: #ffe3f1; font-size: 1.35rem; line-height: 1; cursor: pointer; padding: 0 4px 2px; min-height: 0; margin-left: 2px; }
.slot-pullout .poskip:hover { color: #fff; }
.po-skiprow { flex-wrap: wrap; gap: 6px; align-items: center; }
.po-skipchip { background: #ffe3f1; border: 1.5px solid #f0a6cb; color: #b81f74; border-radius: 999px; font-size: .8rem; font-weight: 700; padding: 3px 10px; cursor: pointer; min-height: 0; }
.po-skipchip:hover { background: #ffd0e7; }

/* V-0.4.173: Daily Workshop Document box in Sub Notes (text + attachments) */
.subplan-card .spworkshop .spatts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.subplan-card .spworkshop .spatts:empty { display: none; }
.subplan-card .spattach { margin-top: 7px; background: #fffdf6; border: 1.5px dashed #caa93f; color: #7a5c14; font-weight: 700; font-size: .9rem; border-radius: 9px; padding: 7px 14px; cursor: pointer; min-height: 0; }
.subplan-card .spattach:hover { background: #fff5da; }

/* V-0.4.174: light divider between Sub Notes sections, matching the lesson rows */
.subplan-card .spsec + .spsec { border-top: 1px solid var(--line); padding-top: 9px; }

/* V-0.4.178: Behavior Tracking page (Class Info) */
.btgrid td { vertical-align: top; }
.btgrid .btdt { font: inherit; font-size: .85rem; padding: 8px 6px; border: 0; background: transparent; width: 100%; min-height: var(--tap); }
.btgrid .btdt:focus { outline: 2px solid var(--accent); background: #faf8ff; }
.btgrid .btsel { width: 100%; border: 0; background: transparent; font: inherit; font-size: .85rem; padding: 9px 6px; min-height: var(--tap); appearance: auto; }
.btgrid .btsel:focus { outline: 2px solid var(--accent); background: #faf8ff; }
.btgrid .btother { border-top: 1px dashed var(--line); }
.btgrid .btbcell { min-width: 150px; }
.btgrid .btnotes { min-width: 160px; }

/* V-0.4.179: Behavior Tracking, Antecedent column + Intensity dropdown */
.btgrid .btint { width: 100%; border: 0; background: transparent; font: inherit; font-size: .85rem; padding: 9px 6px; min-height: var(--tap); appearance: auto; }
.btgrid .btint:focus { outline: 2px solid var(--accent); background: #faf8ff; }
.btgrid .bticell { min-width: 140px; }
.btgrid .btante { min-width: 120px; }

/* V-0.4.180: Behavior Tracking, Antecedent and Notes wrap their text */
.btgrid .btta { white-space: pre-wrap; overflow-wrap: break-word; word-break: break-word; min-height: calc(var(--tap) + 14px); resize: vertical; overflow-y: auto; field-sizing: content; line-height: 1.35; }
.btgrid .btante, .btgrid .btnotes { min-width: 160px; }
@media print { .btgrid .btta { resize: none; overflow: visible; } }

/* V-0.4.181: Behavior Tracking sort-by-student button in the header */
.btgrid .btsth { white-space: nowrap; }
.btgrid .btsort { margin-left: 6px; background: #fff; border: 1.5px solid var(--accent); color: var(--accent-deep); font-weight: 800; font-size: .72rem; border-radius: 999px; padding: 3px 10px; cursor: pointer; min-height: 0; vertical-align: middle; letter-spacing: .04em; }
.btgrid .btsort:hover { background: #faf8ff; }
.btgrid .btsort:disabled { opacity: .5; cursor: wait; }

/* V-0.4.182: Behavior Tracking, Duration wraps; Intensity shows its full level wrapped */
.btgrid .btdur { min-width: 110px; }
.btgrid .btintlab { white-space: normal; overflow-wrap: break-word; font-size: .78rem; line-height: 1.3; color: var(--ink-soft); padding: 0 6px 7px; }
.btgrid .btintlab:empty { display: none; }

/* V-0.4.183: edit pencil on reminder / call / absence / appointment post-its */
.pit-edit { position: absolute; top: 3px; right: 28px; border: 0; background: none; color: rgba(60,40,20,.5); cursor: pointer; font-size: .85rem; padding: 2px 4px; min-height: 0; }
.pit-edit:hover { color: rgba(60,40,20,.85); }

/* V-0.4.183: Math Pacing page, the merged Grade 4 + Grade 5 sequence.
   Appended at the END per the override convention. */
.mp-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin: 4px 0 14px; }
.mp-barwrap { flex: 1 1 240px; min-width: 180px; }
.mp-bar { height: 12px; border-radius: 999px; background: #ece7f8; overflow: hidden; }
.mp-bar > i { display: block; height: 100%; border-radius: 999px; background: var(--accent); transition: width .18s ease; }
.mp-stat { font-size: .95rem; color: var(--ink-soft); white-space: nowrap; }
.mp-stat b { color: var(--accent-deep); font-size: 1.15rem; }
.mp-tools { display: flex; gap: 6px; }
.mp-tools .mp-toggle { background: #fff; border: 1.5px solid var(--accent); color: var(--accent-deep);
  font-weight: 700; font-size: .74rem; border-radius: 999px; padding: 5px 12px; cursor: pointer; min-height: 0; }
.mp-tools .mp-toggle:hover { background: #faf8ff; }

.mp-unit { border: 1.5px solid #e6e0f4; border-radius: 14px; margin: 0 0 14px; background: #fff; overflow: hidden; }
.mp-unit > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: 10px;
  padding: 11px 14px; background: #f6f3fd; font-weight: 700; }
.mp-unit > summary::-webkit-details-marker { display: none; }
.mp-unit .mp-unum { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 999px; background: var(--accent);
  color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: .95rem; font-weight: 800; }
.mp-unit .mp-utitle { flex: 1 1 auto; color: var(--accent-deep); font-size: 1.02rem; line-height: 1.2; }
.mp-unit .mp-udays { flex: 0 0 auto; font-size: .78rem; font-weight: 700; color: var(--ink-soft); white-space: nowrap; }
.mp-unit .mp-uprog { flex: 0 0 auto; font-size: .78rem; font-weight: 800; color: #fff; background: var(--accent-deep);
  border-radius: 999px; padding: 3px 10px; white-space: nowrap; }
.mp-flex > summary { background: #f2f1f8; }
.mp-unit .mp-src { margin: 10px 14px 0; font-size: .8rem; font-weight: 700; color: var(--accent-deep); }
.mp-unit .mp-why { margin: 4px 14px 10px; font-size: .8rem; line-height: 1.45; color: var(--ink-soft); }
.mp-unit .gridwrap { padding: 0 10px 12px; }

.mptable { width: 100%; font-size: .82rem; }
.mptable th { font-size: .72rem; letter-spacing: .03em; text-transform: uppercase; color: var(--ink-soft); }
.mptable td, .mptable th { vertical-align: top; padding: 6px 7px; }
.mptable th.mpck, .mptable td.mpck { width: 34px; text-align: center; }
.mptable .mp-check { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.mptable th.mpday, .mptable td.mpday { width: 42px; text-align: center; font-weight: 800; color: var(--accent-deep); }
.mptable td.mpwhat { white-space: normal; overflow-wrap: break-word; line-height: 1.35; }
.mptable td.mpsrc, .mptable td.mpstd { white-space: normal; overflow-wrap: break-word; font-size: .74rem;
  color: var(--ink-soft); line-height: 1.3; }
.mptable th.mpsrc, .mptable td.mpsrc { width: 20%; }
.mptable th.mpstd, .mptable td.mpstd { width: 18%; }
.mptable th.mpnote, .mptable td.mpnote { width: 96px; }
.mptable .mp-note { width: 100%; font-size: .74rem; padding: 3px 5px; }
.mptable .mptag { display: inline-block; font-size: .64rem; font-weight: 800; letter-spacing: .04em;
  text-transform: uppercase; border-radius: 999px; padding: 1px 7px; margin-right: 4px; vertical-align: 1px; }
.mprow.mpt-Q { background: #fff8e6; } .mprow.mpt-Q .mptag { background: #f0c96a; color: #4a3600; }
.mprow.mpt-R { background: #eef4fd; } .mprow.mpt-R .mptag { background: #a8c4e8; color: #17335c; }
.mprow.mpt-T { background: #fbeaf3; } .mprow.mpt-T .mptag { background: #e39ac2; color: #5c1240; }
.mprow.mpt-F { background: #f3f2fa; } .mprow.mpt-F .mptag { background: #b6afd8; color: #2f2657; }
.mprow.mpdone td.mpwhat, .mprow.mpdone td.mpsrc { opacity: .5; }
.mprow.mpdone td.mpday { color: var(--mint); }

@media (max-width: 700px) {
  .mptable th.mpsrc, .mptable td.mpsrc, .mptable th.mpstd, .mptable td.mpstd { display: none; }
  .mptable th.mpnote, .mptable td.mpnote { width: 74px; }
  .mp-unit .mp-utitle { font-size: .9rem; }
}
@media print {
  .mp-tools, .mp-top { display: none; }
  .mp-unit { break-inside: auto; border-color: #ddd; }
  .mprow { break-inside: avoid; page-break-inside: avoid; }
  .mptable .mp-note { border: 1px solid #ccc; }
}
/* V-0.4.183 follow-up: the progress track needs to read against the lavender page,
   the date box belongs at the top of a tall row, and the phone column is narrow. */
.mp-bar { background: #fff; box-shadow: inset 0 0 0 1.5px #d9d0f0; }
.mptable td.mpnote { vertical-align: top; }
.mptable .mp-note { display: block; height: auto; margin: 0; box-sizing: border-box; }
@media (max-width: 700px) { .mptable .mp-note { font-size: .68rem; padding: 3px; } }
.egrid.mptable td .mp-note { min-height: 0; padding: 4px 5px; }

/* V-0.4.185: pit-edit pencil sits BELOW the x (it was beside it, behind text) */
.pit-edit { top: 26px; right: 7px; }

/* V-0.4.186: Student Games report (Data tab) */
.sg-boards{display:flex;gap:10px;flex-wrap:wrap;margin:6px 0 10px}
.sg-board{flex:1 1 200px;background:#f7f4ff;border:1.5px solid var(--line);border-radius:12px;padding:8px 12px;font-size:.92rem}
.sg-board .sg-bt{font-weight:800;color:var(--accent-deep,#5c4a9e);margin-bottom:4px}
.sg-table td{vertical-align:top}
.sg-max{color:var(--ink-soft,#7a7391);font-size:.85em}
.sg-sub{font-size:.78rem;color:var(--ink-soft,#7a7391)}
.sg-none{color:var(--ink-soft,#9a94ad);font-style:italic}
.sg-pw{font:inherit;width:130px;padding:6px 8px;border:1.5px solid var(--line);border-radius:8px}
.modal.sg-modal{max-width:1000px;width:min(1000px,96vw)}

/* V-0.4.189: Student Games work viewer */
.sg-cell{font:inherit;text-align:left;background:transparent;border:0;padding:2px 4px;border-radius:8px;cursor:pointer;color:inherit}
.sg-cell:hover{background:#f4f0ff}
.sg-work td.sg-q{font-weight:700;color:var(--accent-deep,#5c4a9e);width:38%;font-size:.88rem}
.sg-work td{white-space:pre-wrap;font-size:.9rem;vertical-align:top}
.sg-raw{white-space:pre-wrap;font-size:.8rem;background:#f7f4ff;border-radius:8px;padding:8px}
.sg-modal details{border:1.5px solid var(--line);border-radius:10px;padding:6px 10px;margin:6px 0}
.sg-modal summary{cursor:pointer}
/* V-0.4.196: per-unit visibility toggle in the Student Games teacher report */
.sg-units-card{background:#f7f4ff;border:1.5px solid var(--line);border-radius:12px;padding:10px 12px;margin:10px 0}
.sg-units{display:flex;gap:8px;flex-wrap:wrap;margin-top:6px}
.sg-unit-btn{font:inherit;font-size:.88rem;font-weight:700;border:1.5px solid var(--line);background:#fff;color:var(--ink-soft,#7a7391);border-radius:999px;padding:7px 12px;cursor:pointer;display:inline-flex;align-items:center;gap:6px}
.sg-unit-btn.on{border-color:#2f7d40;color:#1f5c2e;background:#eefbf0}
.sg-unit-btn:disabled{opacity:.6;cursor:default}
.sg-unit-n{font-weight:400;color:var(--ink-soft,#9a94ad);font-size:.85em}
.sg-unit-off{font-weight:400;font-size:.8em;color:#b0175a;background:#ffe3ec;border-radius:999px;padding:1px 8px}

/* V-0.4.199: Word/Math grouping inside the Unit visibility card */
.sg-units-group{margin-top:8px}
.sg-units-glabel{display:block;font-size:.82rem;color:var(--ink-soft,#7a7391);text-transform:uppercase;letter-spacing:.03em;margin-bottom:2px}

/* V-0.4.201: past weeks cluster into monthly folders on the Lesson Plans list */
.monthfold{margin:12px 0}
.mfhead{display:flex;align-items:center;gap:10px;width:100%;text-align:left;background:var(--paper,#f1edfa);
  border:1.5px solid var(--line);border-radius:14px;padding:13px 16px;cursor:pointer;box-shadow:0 1px 3px rgba(0,0,0,.07)}
.mfhead:active{filter:brightness(.97)}
.mfhead .mfchev{display:inline-flex;color:var(--accent-deep)}
.mfhead .mfchev svg{transition:transform .15s}
.monthfold.mfolded .mfchev svg{transform:rotate(-90deg)}
.mfhead .mftitle{font-weight:800;color:var(--accent-deep);font-size:.98rem}
.mfhead .mfcount{margin-left:auto;color:var(--ink-soft);font-size:.78rem;font-weight:600;white-space:nowrap}
.monthfold.mfolded .mfbody{display:none}
.monthfold .mfbody{padding-left:12px}
.monthfold .mfbody .pagecard:first-child{margin-top:10px}
@media print{
  .mfhead{display:none !important}
  .monthfold.mfolded .mfbody,.monthfold .mfbody{display:block !important;padding:0 !important}
  .monthfold{margin:0 !important}
}

/* V-0.4.202: Anni pup video: big entrance at block start, then docks beside the class timer */
#annipup{position:fixed;z-index:44;overflow:hidden;border-radius:18px;box-shadow:0 10px 34px rgba(0,0,0,.35);
  background:#000;cursor:pointer;transition:left .5s ease,top .5s ease,width .5s ease,height .5s ease,border-radius .5s ease}
#annipup video{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;pointer-events:none}
#annipup .pup-x{position:absolute;top:6px;right:8px;color:#fff;background:rgba(0,0,0,.35);border-radius:50%;
  width:30px;height:30px;min-height:30px;padding:0;font-size:1.15rem;line-height:1;display:none}
#annipup.pup-big .pup-x{display:block}
#annipup.pup-big{border:3px solid #fff}
#annipup.pup-big::after{content:"Tap for sound";position:absolute;left:50%;bottom:8px;transform:translateX(-50%);
  color:#fff;background:rgba(0,0,0,.4);border-radius:999px;padding:3px 12px;font-size:.72rem;font-weight:700;pointer-events:none}
#annipup.pup-big.pup-sound::after{content:"Sound on"}
#annipup.pup-mini{border-radius:14px;border:2px solid #fff;box-shadow:0 4px 12px rgba(0,0,0,.3)}
@media print{#annipup{display:none !important}}

/* V-0.4.203: class timer video settings + preview above the settings modal */
.pupopt{display:inline-flex;align-items:center;gap:8px;font-weight:700;font-size:.87rem;color:var(--ink);cursor:pointer}
.pupopt input{width:20px;height:20px;min-height:20px;accent-color:var(--accent-deep);margin:0}
#annipup.pup-top{z-index:1000}

/* V-0.4.205: sign-out bubbles stack above the class timer instead of covering it */
#breakdock{transition:bottom .35s ease}
@media (max-width:740px){#breakdock{bottom:calc(90px + env(safe-area-inset-bottom,0px))}}

/* V-0.4.207: pup video library tiles (Settings) */
.puplib{display:flex;flex-wrap:wrap;gap:10px;margin:10px 0 2px}
.puptile{position:relative;width:106px;border:2px solid var(--line);border-radius:12px;padding:6px;background:#fff;cursor:pointer}
.puptile.on{border-color:var(--accent-deep);box-shadow:0 0 0 2px var(--accent-deep)}
.puptile-thumb{position:relative;width:100%;height:118px;border-radius:8px;overflow:hidden;background:#e9e4f5;display:flex;align-items:center;justify-content:center}
.puptile-thumb img{width:100%;height:100%;object-fit:cover;display:block}
.puptile-thumb.nothumb img{display:none}
.puptile-thumb.nothumb::before{content:"\1F3AC";font-size:1.8rem}
.puptile-play{position:absolute;right:4px;bottom:4px;width:28px;height:28px;min-height:28px;border-radius:50%;background:rgba(0,0,0,.5);color:#fff;padding:0 0 0 2px;font-size:.72rem;display:flex;align-items:center;justify-content:center;border:0}
.puptile-label{font-size:.68rem;font-weight:800;color:var(--accent-deep);margin-top:5px;text-align:center;line-height:1.2;min-height:1.5em}
.puptile-days{display:flex;gap:3px;justify-content:center;margin-top:5px}
.pupday{min-height:22px;height:22px;padding:0 4px;border-radius:6px;background:#f1edfa;color:var(--ink-soft);font-size:.62rem;font-weight:800;border:1px solid var(--line)}
.pupday.on{background:var(--accent-deep);color:#fff;border-color:var(--accent-deep)}
.puptile-x{position:absolute;top:-8px;right:-8px;width:22px;height:22px;min-height:22px;border-radius:50%;background:#d23c3c;color:#fff;font-weight:800;padding:0;line-height:1;z-index:2;display:flex;align-items:center;justify-content:center;font-size:.8rem;border:0}

/* ---- V-0.4.215: Student Checklists archive (appended at END, house rule) ---- */
.scltable .scl-colh{position:relative}
.scl-archbtn{position:absolute;top:2px;right:2px;border:0;background:rgba(255,255,255,.6);border-radius:6px;font-size:.72rem;line-height:1;padding:3px 4px;cursor:pointer;opacity:.5;z-index:1}
.scl-archbtn:hover,.scl-archbtn:focus-visible{opacity:1}
.scl-archrow{display:flex;flex-wrap:wrap;gap:8px;align-items:center;margin-top:14px}
.scl-archlab{font-weight:800;color:#6a6487;font-size:.9rem;margin-right:2px}
.scl-restorebtn{border:0;border-radius:999px;padding:7px 14px;font-weight:700;cursor:pointer;color:#3f3a56;box-shadow:0 1px 2px rgba(0,0,0,.14)}
.scl-restorebtn:hover{filter:brightness(1.04)}
.scl-archcount{font-weight:600;opacity:.75;font-size:.85em}
@media print{.scl-archbtn,.scl-archrow{display:none}}

/* ---- V-0.4.220: floating help + feedback (appended at END, house rule) ---- */
#helpfab{position:fixed;right:18px;bottom:18px;width:54px;height:54px;border-radius:50%;border:0;background:var(--accent-deep,#6b4fd8);color:#fff;font-size:1.5rem;font-weight:800;cursor:pointer;box-shadow:0 4px 14px rgba(60,40,140,.35);z-index:900}
#helpfab:hover{filter:brightness(1.08)}
#helpfab-dot{position:absolute;top:2px;right:2px;width:14px;height:14px;border-radius:50%;background:#e23c5f;border:2px solid #fff}
.hf-tabs{margin-bottom:12px}
.hf-tab.on{background:var(--accent-deep,#6b4fd8);color:#fff;border-color:transparent}
#hf-minedot{color:#e23c5f}
.hf-art{border:1px solid var(--line);border-radius:10px;padding:8px 12px;margin:6px 0;background:#fff}
.hf-art summary{font-weight:800;cursor:pointer;color:#3f3a56}
.hf-art p{margin:8px 0 2px}
.hf-msg{border:1px solid var(--line);border-radius:12px;padding:10px 14px;margin:8px 0;background:#fff}
.hf-msghead{margin-bottom:4px}
.hf-you{background:#f4f0fc;border-radius:8px;padding:8px 10px;white-space:pre-wrap}
.hf-reply{background:#f2faf4;border-radius:8px;padding:8px 10px;margin-top:6px;white-space:pre-wrap}
@media print{#helpfab{display:none}}

/* ---- V-0.4.222: onboarding tour bubbles (appended at END, house rule) ---- */
#tourbubble{position:fixed;z-index:1200;background:#fff;border:2px solid var(--accent-deep,#6b4fd8);border-radius:16px;padding:14px 16px 12px;box-shadow:0 10px 30px rgba(60,40,140,.3);max-width:340px}
#tourbubble.centered{left:50%;top:38%;transform:translate(-50%,-50%);width:min(340px,calc(100vw - 24px))}
#tourbubble h4{margin:2px 0 6px;color:var(--accent-deep,#6b4fd8);font-size:1.1rem}
#tourbubble p{margin:0 0 10px;font-size:.95rem;line-height:1.45}
.tour-step{font-size:.75rem;font-weight:800;color:#8a84a0;letter-spacing:.04em}
.tour-btns{display:flex;gap:10px;justify-content:flex-end}
.tour-skip{border:0;background:transparent;color:#6a6487;font-weight:700;cursor:pointer;padding:8px 10px}
.tour-next{border:0;background:var(--accent-deep,#6b4fd8);color:#fff;font-weight:800;border-radius:999px;padding:8px 18px;cursor:pointer}
.tour-x{position:absolute;top:6px;right:10px;border:0;background:transparent;font-size:1.1rem;color:#8a84a0;cursor:pointer}
.tour-glow{outline:3px solid var(--accent-deep,#6b4fd8);outline-offset:3px;border-radius:12px;animation:tourpulse 1.6s ease-in-out infinite}
@keyframes tourpulse{0%,100%{outline-color:var(--accent-deep,#6b4fd8)}50%{outline-color:#c9b8ff}}
@media print{#tourbubble{display:none}}

/* ---- V-0.4.224: floating buttons never cover an open menu or modal ----
   (Jon's phone screenshot: the + button sat on top of the Help panel's
   article list). While any modal is open, or the phone nav menu is
   expanded, both floating buttons and the + menu get out of the way. */
body:has(.modal-wrap) #helpfab, body:has(.modal-wrap) #fab, body:has(.modal-wrap) #fabmenu,
body:has(#navitems.open) #helpfab, body:has(#navitems.open) #fab{display:none}

/* ---- V-0.4.225: phone modal + floating button fixes (Jen's screenshots) ----
   1. Modals now sit ABOVE the bottom nav bar and both floating buttons
      (they were z60 under the z95+ bar, so the bar covered the sheet's
      bottom and stole taps).
   2. Sheet height uses the DYNAMIC viewport (dvh) so the title row is never
      pushed above the visible screen by Safari's toolbar, and scrolling
      inside the sheet no longer chains to the page behind it.
   3. The ? button lifts above the phone bottom bar like the + always has. */
.modal-wrap{z-index:1300}
.modal{max-height:88vh;max-height:88dvh;overscroll-behavior:contain;-webkit-overflow-scrolling:touch}
#helpfab{bottom:calc(18px + env(safe-area-inset-bottom, 0px))}
@media (max-width:740px){
  #helpfab{bottom:calc(76px + env(safe-area-inset-bottom, 0px));right:12px}
}

/* V-0.4.229 School quarters (Settings) */
.qset{display:flex;flex-direction:column;gap:8px;margin:6px 0 4px}
.qrow{display:flex;flex-wrap:wrap;align-items:center;gap:8px 14px;padding:8px 10px;border:1.5px solid var(--line);border-radius:10px}
.qrow b{min-width:84px}
.qrow label{display:flex;align-items:center;gap:6px;font-size:.92rem;color:var(--ink-soft)}
.qrow input[type=date]{padding:8px 10px;border:1.5px solid var(--line);border-radius:10px;font:inherit}

/* V-0.4.230 Absent work: lesson attachment picker */
.abfiles{display:flex;flex-direction:column;gap:6px;max-height:220px;overflow:auto}
.field label.abfile{display:flex;flex-direction:row;align-items:flex-start;gap:10px;padding:8px 10px;margin:0;border:1.5px solid var(--line);border-radius:10px;font-size:.92rem;font-weight:400;cursor:pointer}
.field label.abfile input[type=checkbox]{width:20px;height:20px;min-height:0;margin:1px 0 0;padding:0;flex:none;accent-color:var(--accent,#7c6bb8)}
.abfile span{flex:1;min-width:0;overflow-wrap:anywhere}
.abfile small{color:var(--ink-soft);font-weight:600}

/* V-0.4.252 (Jen's phone, 2026-11-19): tall notices could not be closed on a
   phone because the close controls scrolled off screen. The x now stays
   pinned at the top of every modal, notice buttons stick to the bottom, and
   notice pictures shrink on phones. */
.modal > .close{position:sticky;top:0;float:right;z-index:3;width:44px;height:44px;margin:-4px -4px 4px 8px;border-radius:50%;background:rgba(255,255,255,.95);box-shadow:0 1px 6px rgba(0,0,0,.18);font-size:1.15rem;line-height:1}
.modal .notice-actions{position:sticky;bottom:-20px;z-index:2;display:flex;flex-direction:column;gap:8px;margin:10px -4px -6px;padding:12px 4px 14px;background:linear-gradient(rgba(255,253,249,0),#fffdf9 26%)}
@media (max-width:740px){ .modal .notice-pic{max-width:120px !important} }
