/* ==========================================================================
   Teacher Handbook + Tests & Remedial modules (handbook.js, remedial.js)
   Uses the palette tokens from styles.css (light + dark). Print styles at the
   bottom (.bbp-*) are deliberately black-on-white and never themed.
   ========================================================================== */
.bb-module{color:var(--ink,#0f172a);}
.mod-wrap{max-width:1100px; margin:0 auto; padding:4px 0 40px; display:flex; flex-direction:column; gap:14px; min-width:0;}
.mod-head{display:flex; justify-content:space-between; gap:12px; align-items:flex-start;}
.mod-title{font-family:var(--font-display,inherit); font-size:24px; line-height:1.25; margin:0 0 4px; color:var(--ink,#0f172a); letter-spacing:-.01em;}
.mod-sub{margin:0; color:var(--muted,#475569); font-size:14px; line-height:1.55; max-width:70ch;}
.mod-tip{margin:6px 0 10px; color:var(--muted,#475569); font-size:13px; line-height:1.55;}
.mod-muted{color:var(--muted,#475569); font-weight:400;}
.mod-card{background:var(--panel,#fff); border:1px solid var(--border,#e2e8f0); border-radius:var(--radius-lg,14px); box-shadow:var(--shadow-sm); padding:16px 18px; min-width:0;}
.mod-label{font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted,#475569); min-width:64px;}
.mod-chips{display:flex; flex-wrap:wrap; gap:8px;}
.mod-chip{appearance:none; font:inherit; font-size:13px; font-weight:600; display:inline-flex; align-items:center; gap:6px;
  padding:7px 12px; border-radius:999px; border:1px solid var(--border,#e2e8f0); background:var(--panel,#fff); color:var(--ink-soft,#334155);
  cursor:pointer; text-decoration:none; min-height:36px;}
.mod-chip:hover{border-color:var(--accent,#2563eb); color:var(--accent,#2563eb);}
.mod-chip.is-on{background:var(--accent-soft,#dbeafe); border-color:var(--accent,#2563eb); color:var(--accent-dark,#1e3a8a);}
.mod-chip.is-soon{color:var(--muted,#475569);}
.mod-chip:focus-visible,.hb-chcard:focus-visible,.rm-step:focus-visible{outline:2px solid var(--accent,#2563eb); outline-offset:2px;}
.mod-soon{font-size:10.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; padding:2px 7px; border-radius:999px;
  background:var(--bg-alt,#f1f5f9); color:var(--muted,#475569);}
.mod-pill{display:inline-block; font-size:11.5px; font-weight:600; padding:2px 8px; border-radius:999px; white-space:nowrap; border:1px solid transparent;}
.pill-info{background:var(--accent-soft,#dbeafe); color:var(--accent-dark,#1e3a8a);}
.pill-muted{background:var(--bg-alt,#f1f5f9); color:var(--muted,#475569);}
.pill-good{background:var(--ok-bg,#dcfce7); color:var(--ok-fg,#15803d);}
.pill-mid{background:var(--warn-bg,#fef3c7); color:var(--warn-fg,#b45309);}
.pill-bad{background:var(--danger-bg,#ffe4e6); color:var(--danger-fg,#be123c);}
.txt-good{color:var(--ok-fg,#15803d);} .txt-mid{color:var(--warn-fg,#b45309);} .txt-bad{color:var(--danger-fg,#be123c);}
.mod-alert{border-radius:var(--radius,10px); padding:10px 14px; font-size:13.5px; line-height:1.5;}
.alert-bad{background:var(--danger-bg,#ffe4e6); color:var(--danger-fg,#be123c);}
.alert-mid{background:var(--warn-bg,#fef3c7); color:var(--warn-fg,#b45309);}
.mod-field{display:flex; flex-direction:column; gap:5px; font-size:13px; margin:0 0 10px;}
.mod-field > span{font-weight:600; color:var(--ink-soft,#334155);}
.bb-module input[type=text],.bb-module input[type=date],.bb-module select,.bb-module textarea{
  font:inherit; font-size:14px; color:var(--ink,#0f172a); background:var(--panel-2,#f8fafc); border:1px solid var(--border,#e2e8f0);
  border-radius:var(--radius-sm,8px); padding:8px 10px; max-width:100%; min-width:0;}
.bb-module textarea{width:100%; resize:vertical; line-height:1.5;}
.bb-module input:focus,.bb-module select:focus,.bb-module textarea:focus{outline:none; border-color:var(--accent,#2563eb); box-shadow:0 0 0 3px var(--accent-ring,rgba(37,99,235,.16));}
.mod-tablewrap{overflow-x:auto; -webkit-overflow-scrolling:touch; border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px);}
.mod-table{width:100%; border-collapse:collapse; font-size:13px; line-height:1.5;}
.mod-table th{background:var(--bg-alt,#f1f5f9); color:var(--ink-soft,#334155); text-align:left; font-weight:700; padding:8px 10px; white-space:nowrap;}
.mod-table td{padding:8px 10px; border-top:1px solid var(--border,#e2e8f0); vertical-align:top; color:var(--ink-soft,#334155);}
.mod-table td.num{text-align:center; font-variant-numeric:tabular-nums;}
.mod-empty{text-align:center; padding:32px 18px; display:flex; flex-direction:column; align-items:center; gap:8px;}
.mod-empty p{margin:0; color:var(--muted,#475569);}
.mod-empty-icon{font-size:30px;}
.bb-module kbd{font-family:inherit; font-size:11.5px; padding:1px 6px; border:1px solid var(--border-strong,#cbd5e1); border-bottom-width:2px; border-radius:5px; background:var(--panel,#fff);}
.bb-module code{font-size:12.5px; background:var(--bg-alt,#f1f5f9); padding:1px 5px; border-radius:4px;}

/* ------------------------------- Handbook -------------------------------- */
.mod-pick{display:flex; flex-direction:column; gap:10px;}
.mod-pick-row{display:flex; gap:12px; align-items:center; flex-wrap:wrap;}
.mod-pick .mod-tip{margin:0;}
.hb-grid{display:grid; grid-template-columns:repeat(auto-fill,minmax(230px,1fr)); gap:12px;}
.hb-chcard{text-align:left; font:inherit; color:inherit; cursor:pointer; display:flex; flex-direction:column; gap:6px; position:relative; transition:border-color .15s, box-shadow .15s, transform .15s;}
button.hb-chcard:hover{border-color:var(--accent,#2563eb); box-shadow:var(--shadow-md); transform:translateY(-1px);}
.hb-chcard.is-soon{cursor:default; opacity:.7; box-shadow:none; background:var(--bg-alt,#f1f5f9);}
.hb-chno{font-size:12px; font-weight:700; text-transform:uppercase; letter-spacing:.05em; color:var(--accent,#2563eb);}
.hb-chname{font-family:var(--font-display,inherit); font-size:17px; font-weight:700; line-height:1.3; color:var(--ink,#0f172a);}
.hb-chmeta{display:flex; flex-wrap:wrap; gap:6px 14px; font-size:12.5px; color:var(--muted,#475569);}
.hb-chgo{font-size:12.5px; font-weight:700; color:var(--accent,#2563eb); margin-top:auto; padding-top:4px;}
.hb-crumbs{display:flex; gap:12px; align-items:center; flex-wrap:wrap; font-size:13px;}
.hb-crumbs .link-btn{font-weight:600;}
.hb-chhead{display:flex; flex-direction:column; gap:8px; position:relative;}
.hb-actions{display:flex; flex-wrap:wrap; gap:8px; margin-top:4px;}
.hb-nav{display:flex; gap:6px; overflow-x:auto; padding:6px 0 2px; margin-top:4px; border-top:1px solid var(--border,#e2e8f0); scrollbar-width:thin;}
.hb-nav .mod-chip{white-space:nowrap; font-size:12.5px; min-height:32px; padding:5px 11px;}
.hb-sec{scroll-margin-top:80px;}
.hb-h2,.rm-h3,.bbp h2{text-transform:none; letter-spacing:normal; display:block;}
.hb-h2{font-family:var(--font-display,inherit); font-size:18px; margin:0 0 4px; color:var(--ink,#0f172a);}
.hb-h4{font-size:13.5px; margin:14px 0 6px; color:var(--ink,#0f172a);}
.hb-sec > .hb-h4:first-of-type{margin-top:8px;}
.hb-overview{font-size:14.5px; line-height:1.65; margin:6px 0; color:var(--ink-soft,#334155);}
.hb-list{margin:0; padding-left:20px; line-height:1.6; font-size:13.5px; color:var(--ink-soft,#334155);}
.hb-list li{margin-bottom:4px;}
.hb-los{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px;}
.hb-los li{display:flex; justify-content:space-between; gap:12px; align-items:flex-start; padding:9px 12px; border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); font-size:13.5px; line-height:1.5; background:var(--panel-2,#f8fafc);}
.hb-cols2{display:grid; grid-template-columns:1fr 1fr; gap:4px 24px;}
.hb-cols3{display:grid; grid-template-columns:repeat(3,1fr); gap:4px 20px;}
.hb-vocab{margin:0; display:flex; flex-direction:column; gap:6px;}
.hb-vocab div{font-size:13.5px; line-height:1.45;}
.hb-vocab dt{font-weight:700; color:var(--ink,#0f172a); display:inline;}
.hb-vocab dt::after{content:" — "; font-weight:400; color:var(--muted,#475569);}
.hb-vocab dd{display:inline; margin:0; color:var(--ink-soft,#334155);}
.hb-hindi{font-weight:500; color:var(--muted,#475569);}
.hb-periods{display:flex; flex-direction:column; gap:8px;}
.hb-period{border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); background:var(--panel,#fff);}
.hb-period > summary{list-style:none; cursor:pointer; display:flex; align-items:center; gap:10px; padding:11px 14px; font-weight:600; min-height:44px;}
.hb-period > summary::-webkit-details-marker{display:none;}
.hb-period > summary::after{content:"▾"; margin-left:auto; color:var(--muted,#475569); transition:transform .15s;}
.hb-period[open] > summary::after{transform:rotate(180deg);}
.hb-period[open] > summary{border-bottom:1px solid var(--border,#e2e8f0); background:var(--accent-light,#eff6ff); border-radius:var(--radius,10px) var(--radius,10px) 0 0;}
.hb-pno{font-size:11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--accent,#2563eb); white-space:nowrap;}
.hb-ptitle{color:var(--ink,#0f172a); line-height:1.35;}
.hb-pmin{font-size:12px; color:var(--muted,#475569); white-space:nowrap; font-weight:500;}
.hb-pbody{padding:6px 14px 14px;}
.hb-book{font-size:13px; color:var(--muted,#475569); margin:8px 0;}
.hb-steps td:nth-child(3),.hb-steps td:nth-child(4){min-width:200px;}
.hb-phase{display:inline-block; font-size:11.5px; font-weight:700; padding:2px 8px; border-radius:999px; background:var(--bg-alt,#f1f5f9); color:var(--slate-fg,#475569); white-space:nowrap;}
.hb-phase-engage{background:var(--violet-bg,#ede9fe); color:var(--violet-fg,#5b21b6);}
.hb-phase-explore{background:var(--teal-bg,#ccfbf1); color:var(--teal-fg,#0f766e);}
.hb-phase-explain{background:var(--accent-soft,#dbeafe); color:var(--accent-dark,#1e3a8a);}
.hb-phase-practise,.hb-phase-practice{background:var(--warn-bg,#fef3c7); color:var(--warn-fg,#b45309);}
.hb-phase-wrapup{background:var(--ok-bg,#dcfce7); color:var(--ok-fg,#15803d);}
/* board work looks like a chalkboard in both themes */
.hb-board{background:#1f3b2d; color:#f1f5f9; border:6px solid #8b5e3c; border-radius:8px; padding:12px 14px; font-size:14px; line-height:1.6; white-space:pre-line; font-family:"Comic Sans MS","Segoe Print",var(--font,inherit);}
.hb-cfu,.hb-fio{margin:0; padding-left:22px; display:flex; flex-direction:column; gap:8px; font-size:13.5px; line-height:1.5; color:var(--ink-soft,#334155);}
.hb-fio-ref{font-weight:600; color:var(--ink,#0f172a);}
.hb-reveal{margin-top:4px;}
.hb-reveal > summary{display:inline-flex; align-items:center; gap:4px; cursor:pointer; font-size:12.5px; font-weight:600; color:var(--accent,#2563eb); list-style:none; padding:4px 0; min-height:30px;}
.hb-reveal > summary::-webkit-details-marker{display:none;}
.hb-reveal > summary::before{content:"👁"; font-size:12px;}
.hb-reveal[open] > summary{color:var(--muted,#475569);}
.hb-reveal[open] > summary::before{content:"▴";}
.hb-reveal-body{background:var(--ok-bg,#dcfce7); color:var(--ink,#0f172a); border-radius:var(--radius-sm,8px); padding:8px 12px; margin-top:2px; white-space:pre-line;}
.hb-ansbar{display:flex; justify-content:flex-end; margin-bottom:6px;}
.hb-mist{border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:10px 12px; margin-bottom:8px; display:flex; flex-direction:column; gap:6px; background:var(--panel-2,#f8fafc);}
.hb-mist-row{display:grid; grid-template-columns:64px 1fr; gap:10px; font-size:13.5px; line-height:1.5; align-items:start; color:var(--ink-soft,#334155);}
.hb-mist-row .mod-pill{text-align:center;}
.hb-act{border-left:3px solid var(--accent,#2563eb); padding:2px 0 2px 14px; margin:10px 0 16px;}
.hb-act .hb-h4{margin-top:0;}
.hb-look{font-size:13px; margin:6px 0 0; color:var(--ink-soft,#334155);}

/* ----------------------------- Tests & Remedial --------------------------- */
.rm-privacy{margin-top:8px;}
.rm-help{background:var(--accent-light,#eff6ff); border:1px solid var(--accent-soft,#dbeafe); color:var(--ink-soft,#334155); border-radius:var(--radius,10px); padding:10px 14px; margin:0;}
.rm-steps{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(5,1fr); gap:6px;}
.rm-step{appearance:none; font:inherit; width:100%; height:100%; display:flex; align-items:center; gap:8px; padding:9px 10px; border-radius:var(--radius,10px);
  border:1px solid var(--border,#e2e8f0); background:var(--panel,#fff); color:var(--ink-soft,#334155); cursor:pointer; text-align:left; font-size:13px; font-weight:600; min-height:46px;}
.rm-step:disabled{opacity:.5; cursor:not-allowed;}
.rm-step:not(:disabled):hover{border-color:var(--accent,#2563eb);}
.rm-step-n{flex:0 0 auto; width:24px; height:24px; border-radius:50%; display:inline-flex; align-items:center; justify-content:center; font-size:12px; font-weight:800;
  background:var(--bg-alt,#f1f5f9); color:var(--muted,#475569);}
.rm-step.is-done .rm-step-n{background:var(--ok-bg,#dcfce7); color:var(--ok-fg,#15803d);}
.rm-step.is-on{border-color:var(--accent,#2563eb); background:var(--accent-soft,#dbeafe); color:var(--accent-dark,#1e3a8a);}
.rm-step.is-on .rm-step-n{background:var(--accent,#2563eb); color:var(--panel,#fff);}
.rm-step-l{line-height:1.25;}
.rm-context{display:flex; flex-wrap:wrap; gap:6px 18px; font-size:13px; color:var(--muted,#475569);}
.rm-body{display:flex; flex-direction:column; gap:14px;}
.rm-h3{font-family:var(--font-display,inherit); font-size:16px; margin:0 0 8px; color:var(--ink,#0f172a);}
.rm-two{display:grid; grid-template-columns:1fr 1fr; gap:14px;}
.rm-src p{margin:0 0 10px; font-size:13.5px; color:var(--ink-soft,#334155);}
.rm-src .mod-field input{width:100%;}
.rm-actions{display:flex; flex-wrap:wrap; gap:8px; justify-content:flex-end; margin-top:12px;}
.rm-actions-top{margin-top:0;}
.rm-list{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px;}
.rm-list li{display:flex; align-items:center; gap:10px; border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:6px 10px;}
.rm-list li.is-on{border-color:var(--accent,#2563eb); background:var(--accent-light,#eff6ff);}
.rm-list-main{appearance:none; background:none; border:0; font:inherit; color:inherit; text-align:left; flex:1; min-width:0; cursor:pointer; display:flex; flex-direction:column; gap:2px; padding:4px 0; font-size:13.5px;}
.rm-list-main .mod-muted{font-size:12.5px;}
.rm-qtable td:last-child{min-width:220px;}
.rm-new{margin-top:12px; border-top:1px dashed var(--border,#e2e8f0); padding-top:10px;}
.rm-new > summary{cursor:pointer; font-weight:700; color:var(--accent,#2563eb); font-size:13.5px; padding:4px 0; min-height:32px;}
.rm-new-body{padding-top:8px; max-width:520px;}
.rm-new-body > textarea{margin-bottom:8px;}
.rm-rowhead{display:flex; justify-content:space-between; align-items:center; gap:10px; flex-wrap:wrap;}
.rm-danger{color:var(--danger-fg,#be123c) !important;}
.rm-students input{width:100%;}
.rm-students td{padding:5px 8px;}
.rm-students td:first-child{width:80px;}
.rm-students td:last-child{width:90px;}

/* marks grid */
.rm-gridcard{padding:0; overflow:hidden;}
.rm-gridwrap{overflow:auto; max-height:70vh; -webkit-overflow-scrolling:touch;}
.rm-grid{border-collapse:separate; border-spacing:0; font-size:13px; min-width:100%;}
.rm-grid th,.rm-grid td{border-bottom:1px solid var(--border,#e2e8f0); padding:4px 6px; background:var(--panel,#fff); white-space:nowrap;}
.rm-grid thead th{position:sticky; top:0; z-index:2; background:var(--bg-alt,#f1f5f9); font-weight:700; color:var(--ink-soft,#334155); text-align:center; padding:8px 6px;}
.rm-grid th small{display:block; font-weight:500; color:var(--muted,#475569); font-size:11px;}
.rm-grid .rm-sticky{position:sticky; z-index:1;}
.rm-grid thead .rm-sticky{z-index:3;}
.rm-grid .rm-c-roll{left:0; width:52px; min-width:52px; text-align:center;}
.rm-grid .rm-c-name{left:52px; min-width:150px; max-width:220px; overflow:hidden; text-overflow:ellipsis; text-align:left; border-right:1px solid var(--border,#e2e8f0); font-weight:600;}
.rm-grid .rm-c-ab{text-align:center;}
.rm-grid .rm-c-q{text-align:center; padding:3px;}
.rm-grid .rm-c-tot{text-align:center; font-weight:700; font-variant-numeric:tabular-nums; min-width:60px;}
.rm-grid tr.is-absent td{color:var(--muted,#475569); background:var(--bg-alt,#f1f5f9);}
.bb-module label{text-transform:none; letter-spacing:normal;}
.rm-grid input.rm-mark,.rm-phoneq input.rm-mark{width:56px; flex:0 0 auto;}
.rm-mark{width:52px; text-align:center; padding:6px 4px !important; font-variant-numeric:tabular-nums;}
.rm-mark:disabled{opacity:.4;}
.rm-mark.is-err{border-color:var(--danger-fg,#be123c) !important; background:var(--danger-bg,#ffe4e6) !important;}
.rm-grid input[type=checkbox],.rm-absent input,.rm-wslist input{width:18px; height:18px; accent-color:var(--accent,#2563eb);}
.rm-msg{min-height:0; margin:0; font-size:13px; font-weight:600; color:var(--danger-fg,#be123c);}
.rm-msg.is-on{min-height:20px;}

/* phone: one student at a time */
.rm-phonehead{display:flex; gap:12px; align-items:flex-end; justify-content:space-between; flex-wrap:wrap;}
.rm-phonehead .mod-field{flex:1; min-width:0; margin:0;}
.rm-phonehead select{width:100%;}
.rm-absent{display:flex; align-items:center; gap:6px; font-weight:600; font-size:14px; padding:8px 0;}
.rm-phoneqs{display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-top:12px;}
.rm-phoneqs.is-absent{opacity:.5;}
.rm-phoneq{display:flex; align-items:center; justify-content:space-between; gap:8px; border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:6px 8px; font-size:13.5px;}
.rm-phoneq .rm-mark{width:56px; font-size:16px;}
.rm-phonetotal{margin-top:12px; font-size:15px; text-align:right;}

/* results */
.rm-kpis{display:grid; grid-template-columns:repeat(3,1fr); gap:12px;}
.rm-kpi{display:flex; flex-direction:column; gap:4px;}
.rm-kpi span{font-size:12.5px; color:var(--muted,#475569); font-weight:600;}
.rm-kpi b{font-family:var(--font-display,inherit); font-size:26px; color:var(--ink,#0f172a);}
.rm-kpi b.txt-good{color:var(--ok-fg,#15803d);} .rm-kpi b.txt-mid{color:var(--warn-fg,#b45309);} .rm-kpi b.txt-bad{color:var(--danger-fg,#be123c);}
.rm-kpi small{font-size:14px; color:var(--muted,#475569); font-weight:500;}
.rm-legend{display:flex; flex-wrap:wrap; gap:6px; margin:0;}
.rm-los{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px;}
.rm-lo{border:1px solid var(--border,#e2e8f0); border-left:4px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:9px 12px; background:var(--panel-2,#f8fafc);}
.rm-lo.band-good{border-left-color:var(--ok-fg,#15803d);}
.rm-lo.band-mid{border-left-color:var(--warn-fg,#b45309);}
.rm-lo.band-bad{border-left-color:var(--danger-fg,#be123c);}
.rm-lo-top{display:flex; justify-content:space-between; gap:12px; align-items:flex-start;}
.rm-lo-text{font-size:13.5px; line-height:1.45; color:var(--ink,#0f172a);}
.rm-lo-pct{font-weight:800; font-variant-numeric:tabular-nums; white-space:nowrap; font-size:14px;}
.band-good .rm-lo-pct{color:var(--ok-fg,#15803d);} .band-mid .rm-lo-pct{color:var(--warn-fg,#b45309);} .band-bad .rm-lo-pct{color:var(--danger-fg,#be123c);}
.rm-lo-sub{font-size:12.5px; color:var(--muted,#475569); margin-top:4px;}
.rm-bar{display:block; height:8px; border-radius:999px; background:var(--bg-alt,#f1f5f9); margin-top:6px; overflow:hidden;}
.rm-bar-fill{display:block; height:100%; border-radius:999px;}
.rm-bar-fill.band-good{background:var(--ok-fg,#15803d);} .rm-bar-fill.band-mid{background:var(--warn-fg,#b45309);} .rm-bar-fill.band-bad{background:var(--danger-fg,#be123c);}
.rm-los-small{margin:8px 0 4px;}
.rm-los-small .rm-lo{padding:7px 10px;}
.rm-stu{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:6px;}
.rm-stu-row{border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:0 12px;}
.rm-stu-row.is-absent{background:var(--bg-alt,#f1f5f9);}
.rm-stu-top{display:flex; justify-content:space-between; align-items:center; gap:10px; padding:10px 0; font-size:13.5px; font-weight:600; cursor:pointer; list-style:none; flex-wrap:wrap;}
.rm-stu-top::-webkit-details-marker{display:none;}
.rm-stu-score{font-weight:500; display:inline-flex; gap:6px; align-items:center;}

/* worksheets */
.rm-opts{display:flex; gap:16px; flex-wrap:wrap;}
.rm-selbar{font-size:13px; margin-bottom:6px; display:flex; flex-wrap:wrap; gap:4px 16px;}
.rm-wslist{list-style:none; margin:0; padding:0; display:grid; grid-template-columns:repeat(auto-fill,minmax(260px,1fr)); gap:6px;}
.rm-wslist label{display:flex; align-items:center; gap:8px; border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:8px 10px; font-size:13.5px; cursor:pointer; min-height:44px;}
.rm-ws-name{flex:1; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap;}
.rm-grouplist{list-style:none; margin:0; padding:0; display:flex; flex-direction:column; gap:8px;}
.rm-grouplist li{display:flex; justify-content:space-between; align-items:center; gap:12px; border:1px solid var(--border,#e2e8f0); border-left:4px solid var(--danger-fg,#be123c); border-radius:var(--radius,10px); padding:9px 12px; background:var(--panel-2,#f8fafc);}
.rm-grouplist li.band-mid{border-left-color:var(--warn-fg,#b45309);}
.rm-grouplist li.band-good{border-left-color:var(--ok-fg,#15803d);}
.rm-grp-btns{display:flex; gap:6px; flex:0 0 auto;}

/* ------------------------------- Small screens ----------------------------- */
@media (max-width: 900px){
  .hb-cols3{grid-template-columns:1fr;}
  .rm-steps{grid-template-columns:repeat(5,minmax(0,1fr));}
  .rm-step{flex-direction:column; justify-content:center; text-align:center; gap:4px; padding:7px 4px; font-size:11.5px;}
}
@media (max-width: 640px){
  .mod-wrap{gap:12px;}
  .mod-title{font-size:21px;}
  .mod-card{padding:14px;}
  .hb-cols2,.rm-two,.rm-kpis{grid-template-columns:1fr;}
  .rm-kpis{grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px;}
  .rm-kpi{padding:10px;}
  .rm-kpi b{font-size:20px;}
  .rm-kpi span{font-size:11px;}
  .hb-grid{grid-template-columns:1fr;}
  .hb-los li{flex-direction:column; gap:6px;}
  .hb-actions .btn,.rm-actions .btn{flex:1 1 auto; justify-content:center;}
  .rm-step-l{font-size:10.5px;}
  .rm-grouplist li{flex-direction:column; align-items:stretch;}
  .rm-lo-top{flex-direction:column; gap:2px;}
  .hb-mist-row{grid-template-columns:58px 1fr; gap:8px;}
  .rm-phoneqs{grid-template-columns:1fr 1fr;}
  /* lesson steps + materials: one card per row instead of a squeezed table */
  .hb-stack{border:0; overflow:visible;}
  .hb-stack table,.hb-stack tbody,.hb-stack tr,.hb-stack td{display:block; width:100%;}
  .hb-stack thead{display:none;}
  .hb-stack tr{border:1px solid var(--border,#e2e8f0); border-radius:var(--radius,10px); padding:6px 10px; margin-bottom:8px; background:var(--panel-2,#f8fafc);}
  .hb-stack td{border:0; padding:3px 0; min-width:0 !important; text-align:left !important;}
  .hb-stack td[data-label]::before{content:attr(data-label); display:block; font-size:11px; font-weight:700; text-transform:uppercase; letter-spacing:.04em; color:var(--muted,#475569);}
  .hb-steps td.num,.hb-steps td[data-label="Phase"]{display:inline-block; width:auto; margin-right:14px;}
  .hb-steps td.num::before,.hb-steps td[data-label="Phase"]::before{display:none;}
  .hb-steps td.num::after{content:" min"; color:var(--muted,#475569);}
}
@media (max-width: 380px){
  .rm-phoneqs{grid-template-columns:1fr;}
  .rm-step-l{display:none;}
}

/* ==========================================================================
   Print (handbook chapter, worksheets, answer keys) — black on white only
   ========================================================================== */
#bbModPrint{display:none;}
@media print{
  body.bb-mod-printing > *:not(#bbModPrint){display:none !important;}
  body.bb-mod-printing #bbModPrint{display:block !important;}
  body.bb-mod-printing{background:#fff !important;}
}
#bbModPrint, #bbModPrint *{color:#000 !important; background:#fff !important; box-shadow:none !important;}
.bbp{font-family:Arial, "Helvetica Neue", sans-serif; font-size:12px; line-height:1.45;}
.bbp h1{font-size:20px; margin:4px 0 2px;}
.bbp h2{font-size:15px; margin:16px 0 6px; border-bottom:1.5px solid #000; padding-bottom:2px; page-break-after:avoid;}
.bbp h3{font-size:13px; margin:10px 0 4px; page-break-after:avoid;}
.bbp p{margin:3px 0;}
.bbp ul,.bbp ol{margin:3px 0 6px; padding-left:22px;}
.bbp li{margin-bottom:2px;}
.bbp-top{display:flex; justify-content:space-between; font-size:10.5px; border-bottom:1px solid #000; padding-bottom:3px;}
.bbp-meta{font-size:11.5px; margin:2px 0 8px;}
.bbp-block{page-break-inside:avoid; margin-bottom:8px;}
.bbp-table{width:100%; border-collapse:collapse; margin:4px 0 8px; font-size:11px;}
.bbp-table th,.bbp-table td{border:1px solid #000; padding:3px 5px; vertical-align:top; text-align:left;}
.bbp-table tr{page-break-inside:avoid;}
.bbp-box{border:1px solid #000; padding:5px 8px; white-space:pre-line;}
.bbp-ws{page-break-after:always; break-after:page;}
.bbp-ws:last-child{page-break-after:auto; break-after:auto;}
.bbp-wshead{border-bottom:2px solid #000; padding-bottom:6px; margin-bottom:8px;}
.bbp-school{text-align:center; font-size:18px; font-weight:800;}
.bbp-wstitle{text-align:center; font-size:15px; font-weight:700; text-decoration:underline; margin:4px 0 6px;}
.bbp-wsmeta{display:grid; grid-template-columns:1fr 1fr; gap:3px 16px; font-size:12px;}
.bbp-intro{font-style:italic; margin:4px 0 8px;}
.bbp-lo{margin-top:10px;}
.bbp-lo-title{font-weight:700; font-size:12.5px; border:1px solid #000; padding:4px 8px; margin-bottom:8px; page-break-after:avoid;}
.bbp-note{font-style:italic;}
.bbp-key h3{border-bottom:1px solid #000; margin-top:12px;}
.bbp-keystu{page-break-inside:auto;}
.bbp-keylo{margin:4px 0 6px;}
.bbp-keylo > i{display:block; margin-bottom:2px;}
.bbp-ans{margin:2px 0 4px 8px; page-break-inside:avoid;}
.bbp-steps{margin:2px 0 4px; font-size:11px;}
#bbModPrint .paper-q-diagram svg{max-width:220px;}
