/* Gurukulam phone-specific ergonomics, loaded after legacy CSS.
   Desktop is unchanged. Keep every read/write control usable. */
@media screen and (max-width:700px){
 body.pulse-experience #app #content{box-sizing:border-box;width:100%;max-width:100%;min-width:0;padding:8px!important;overflow-x:clip}
 body.pulse-experience #app #content :is(.panel,.tablebox,.toolbar,.teacher-entry-sheet,.attendance-grid-page,.school-test-grid-page,.classic-homework){box-sizing:border-box;min-width:0;max-width:100%}
 body.pulse-experience #app #content :is(h2,h3){font-size:19px!important;line-height:1.25!important;margin:8px 0 10px!important}
 body.pulse-experience #app #content :is(input,select,textarea){box-sizing:border-box;font-size:14px!important;min-width:0;max-width:100%}
 body.pulse-experience #app #content .teacher-history-tabs{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;padding:5px!important;margin-bottom:9px!important}
 body.pulse-experience #app #content .teacher-history-tabs button{min-height:37px!important;font-size:14px!important;padding:5px!important}
 body.pulse-experience #app #content :is(.school-test-filters,.teacher-history-filters,.school-roster-filters,.classic-homework>.toolbar,.attendance-grid-page>.toolbar){display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;padding:5px!important}
 body.pulse-experience #app #content :is(.school-test-filters,.teacher-history-filters,.school-roster-filters,.classic-homework>.toolbar,.attendance-grid-page>.toolbar)>label{display:flex!important;flex-direction:column!important;gap:3px!important;margin:0!important;padding:4px!important;min-height:0!important;min-width:0!important;width:100%!important;max-width:100%!important;font-size:12px!important;align-items:stretch!important}
 body.pulse-experience #app #content :is(.school-test-filters,.teacher-history-filters,.school-roster-filters,.classic-homework>.toolbar,.attendance-grid-page>.toolbar)>label :is(input,select){width:100%!important;min-width:0!important;max-width:100%!important;height:36px!important;padding:5px!important;font-size:13px!important}
 body.pulse-experience #app #content :is(.school-test-filters,.teacher-history-filters,.school-roster-filters,.classic-homework>.toolbar,.attendance-grid-page>.toolbar)>button{width:100%!important;min-width:0!important;max-width:100%!important;min-height:36px!important;margin:0!important;padding:6px!important;font-size:12px!important}
 body.pulse-experience #app #content :is(.school-test-filters,.teacher-history-filters,.school-roster-filters,.classic-homework>.toolbar,.attendance-grid-page>.toolbar)>[role=status]{grid-column:1/-1}
 /* Students: remove tall export controls and oversized info boxes. */
 body.pulse-experience #app #content .principal-student-tools{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;padding:5px!important}
 body.pulse-experience #app #content .principal-student-tools label{margin:0!important;padding:5px!important;min-width:0!important}
 body.pulse-experience #app #content .principal-student-tools select{width:100%!important}
 body.pulse-experience #app #content .tablebox:has(table.mobile-card-table){overflow:visible!important}
 body.pulse-experience #app #content table.mobile-card-table tbody{display:grid!important;grid-template-columns:1fr!important;gap:7px!important}
 body.pulse-experience #app #content table.mobile-card-table tbody tr{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:0 9px!important;padding:8px!important;min-width:0!important}
 body.pulse-experience #app #content table.mobile-card-table td{padding:4px!important;min-width:0!important;font-size:12px!important;line-height:1.2!important}
 body.pulse-experience #app #content table.mobile-card-table td:before{font-size:10px!important;margin:0 0 2px!important}
 /* Attendance: student and absent checkbox in same fully visible row. */
 body.pulse-experience #app #content .attendance-card-grid.teacher-attendance-rows{display:block!important;width:100%!important;min-width:0!important;overflow:visible!important}
 body.pulse-experience #app #content .attendance-student-card.attendance-sheet-row{box-sizing:border-box;display:grid!important;grid-template-columns:minmax(0,1fr) 90px!important;gap:5px!important;width:100%!important;min-width:0!important;max-width:100%!important;min-height:44px!important;padding:6px 8px!important;margin:0!important;align-items:center!important;overflow:visible!important}
 body.pulse-experience #app #content .attendance-student-heading{min-width:0!important;display:flex!important;gap:5px!important;align-items:center!important}
 body.pulse-experience #app #content .attendance-student-heading strong{font-size:13px!important;overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
 body.pulse-experience #app #content .attendance-toggle{min-width:0!important;width:90px!important;display:flex!important;align-items:center!important;justify-content:flex-end!important;gap:3px!important}
 body.pulse-experience #app #content .attendance-toggle input{width:20px!important;height:20px!important;min-width:20px!important}
 body.pulse-experience #app #content .attendance-toggle span{font-size:11px!important}
 body.pulse-experience #app #content .teacher-attendance-head{display:grid!important;grid-template-columns:minmax(0,1fr) 90px!important;font-size:12px!important;padding:7px 8px!important}
 body.pulse-experience #app #content #agSave{grid-column:1/-1}
 /* Subject copy-checking: cards must not overflow the right edge. */
 body.pulse-experience #app #content :is(.class-copy-card,.class-copies-card,.subject-copy-card){box-sizing:border-box;max-width:100%!important;min-width:0!important;overflow-wrap:anywhere}
 body.pulse-experience #app #content :is(.class-copy-card,.class-copies-card,.subject-copy-card) :is(button,input,textarea){box-sizing:border-box;max-width:100%!important;min-width:0!important}
 /* Test entry: cards two per row, status below instead of squeezed next to save. */
 body.pulse-experience #app #content .school-test-card-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;overflow:visible!important}
 body.pulse-experience #app #content .school-test-student-card{box-sizing:border-box;width:100%!important;min-width:0!important;max-width:100%!important;display:flex!important;flex-direction:column!important;gap:6px!important;padding:8px!important;overflow:hidden!important}
 body.pulse-experience #app #content .school-test-student-card h4{font-size:13px!important;line-height:1.2!important;margin:0!important;overflow-wrap:anywhere;text-align:center}
 body.pulse-experience #app #content .school-test-student-card label{font-size:11px!important;min-width:0!important}
 body.pulse-experience #app #content .school-test-student-card input{height:36px!important;width:100%!important;min-width:0!important;padding:5px!important;font-size:15px!important}
 body.pulse-experience #app #content .school-test-card-actions{display:flex!important;flex-direction:column-reverse!important;gap:4px!important;align-items:stretch!important;width:100%!important;min-width:0!important}
 body.pulse-experience #app #content .school-test-card-actions [role=status]{font-size:11px!important;overflow-wrap:normal!important;word-break:normal!important;text-align:center!important;white-space:normal!important;width:100%!important}
 body.pulse-experience #app #content .school-test-card-actions button{width:100%!important;min-width:0!important;min-height:33px!important;padding:5px!important;font-size:12px!important}
 /* Homework entry: two small values side by side, action on one compact line. */
 body.pulse-experience #app #content .teacher-entry-sheet .classic-homework-student{box-sizing:border-box;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important;width:100%!important;min-width:0!important;max-width:100%!important;padding:9px!important;overflow:hidden!important}
 body.pulse-experience #app #content .classic-homework-student h4{grid-column:1/-1!important;margin:0!important;font-size:14px!important}
 body.pulse-experience #app #content .classic-homework-line{min-width:0!important;width:100%!important;padding:0!important}
 body.pulse-experience #app #content .classic-homework-line label{display:flex!important;flex-direction:column!important;gap:4px!important;font-size:11px!important;min-width:0!important}
 body.pulse-experience #app #content .classic-homework-line select{box-sizing:border-box;width:100%!important;min-width:0!important;height:35px!important;font-size:12px!important}
 body.pulse-experience #app #content .classic-homework-actions{grid-column:1/-1!important;display:flex!important;gap:7px!important;align-items:center!important;justify-content:flex-start!important;min-width:0!important}
 body.pulse-experience #app #content .classic-homework-actions button{min-width:72px!important;max-width:110px!important;min-height:33px!important;padding:5px 10px!important;font-size:12px!important}
 body.pulse-experience #app #content .classic-homework-actions [role=status]{font-size:11px!important;white-space:normal!important;overflow-wrap:anywhere!important}
}

@media screen and (max-width:700px){
 /* Teacher Class Copies: one complete subject card with fully visible Save. */
 body.pulse-experience #app #content .copy-subject-row{box-sizing:border-box!important;display:grid!important;grid-template-columns:minmax(0,1fr) 84px!important;gap:7px!important;align-items:center!important;min-width:0!important;max-width:100%!important;width:100%!important;padding:9px!important;margin:0 0 7px!important;overflow:visible!important;border-radius:11px!important}
 body.pulse-experience #app #content .copy-subject-row>label{grid-column:1!important;grid-row:1!important;display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;min-width:0!important;max-width:100%!important;font-size:14px!important}
 body.pulse-experience #app #content .copy-subject-row>label input{width:20px!important;height:20px!important;min-width:20px!important;flex-shrink:0!important}
 body.pulse-experience #app #content .copy-subject-row>[data-copy-note]{grid-column:1/-1!important;grid-row:2!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;height:35px!important;padding:7px!important;font-size:13px!important}
 body.pulse-experience #app #content .copy-subject-row>[data-copy-save]{grid-column:2!important;grid-row:1!important;box-sizing:border-box!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:34px!important;padding:5px!important;font-size:12px!important}
}

/* Screenshot parity: Homework on phones only; other role pages and desktop untouched. */
@media screen and (max-width:700px){
 body.pulse-experience #app #content .screenshot-homework{padding:12px!important;background:#fff!important;overflow:visible!important;border-radius:16px!important}
 body.pulse-experience #app #content .screenshot-homework>h3{font-size:20px!important;line-height:1.25!important;margin:10px 0 13px!important;text-align:left!important;color:#185489!important}
 body.pulse-experience #app #content .screenshot-homework>.toolbar:first-of-type{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;background:transparent!important;padding:0!important;border:0!important;margin:0 0 13px!important}
 body.pulse-experience #app #content .screenshot-homework>.toolbar:first-of-type>label{padding:0!important;margin:0!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;min-width:0!important;background:none!important;border:0!important;box-shadow:none!important;color:#205178!important;font-size:13px!important;font-weight:700!important;gap:5px!important}
 body.pulse-experience #app #content .screenshot-homework>.toolbar:first-of-type>label:has(#rosterClass){grid-column:1/-1!important}
 body.pulse-experience #app #content .screenshot-homework>.toolbar:first-of-type :is(select,input){box-sizing:border-box!important;width:100%!important;height:43px!important;min-width:0!important;max-width:100%!important;padding:6px 9px!important;border-radius:10px!important;font-size:15px!important;background:#fff!important}
 body.pulse-experience #app #content .screenshot-homework #rosterSummary{background:#e6f0ff!important;border-left:5px solid #2e75cc!important;border-radius:13px!important;padding:13px!important;margin:12px 0!important;display:flex!important;flex-direction:column!important;gap:7px!important;line-height:1.45!important}
 body.pulse-experience #app #content .screenshot-homework #rosterSummary strong{font-size:19px!important;color:#185489!important}
 body.pulse-experience #app #content .screenshot-homework #rosterSummary :is(span,small,p){font-size:13px!important;color:#355b78!important;margin:0!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards{display:grid!important;grid-template-columns:1fr!important;gap:9px!important;margin-top:12px!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .teacher-entry-head{display:none!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-student{box-sizing:border-box!important;display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:8px!important;padding:12px!important;margin:0!important;width:100%!important;min-width:0!important;border:1px solid #d7e3ea!important;border-radius:13px!important;background:#fff!important;box-shadow:none!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-student h4{grid-column:1!important;margin:0 0 3px!important;font-size:16px!important;text-align:left!important;color:#1a527f!important;font-weight:750!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line{width:100%!important;display:block!important;min-width:0!important;margin:0!important;padding:0!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line label{display:grid!important;grid-template-columns:94px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;color:#47677f!important;font-size:13px!important;font-weight:650!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line select{box-sizing:border-box!important;min-width:0!important;max-width:100%!important;width:100%!important;height:40px!important;border-radius:9px!important;padding:7px!important;font-size:14px!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line:has([data-field=homework]) select{background:#e2f6e9!important;color:#176843!important;border:1px solid #92c6a7!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line:has([data-field=copies]) select{background:#e3f0fd!important;color:#165e91!important;border:1px solid #9dbfdc!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-actions{display:flex!important;grid-column:1!important;align-items:center!important;justify-content:space-between!important;gap:9px!important;min-width:0!important;padding-top:2px!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-actions button{min-width:90px!important;max-width:130px!important;min-height:36px!important;padding:6px 13px!important;font-size:13px!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-actions [role=status]{font-size:11px!important;min-width:0!important;overflow-wrap:anywhere!important}
 body.pulse-experience #app #content .screenshot-homework #rosterReload,
 body.pulse-experience #app #content .screenshot-homework #rosterExport{display:inline-flex!important;align-items:center!important;justify-content:center!important;vertical-align:middle!important;max-width:calc(50% - 6px)!important;min-height:35px!important;margin:0 5px 6px 0!important;padding:5px 7px!important;font-size:12px!important}
 body.pulse-experience #app #content .screenshot-homework .school-roster-filters{margin-top:7px!important}
}

/* Repair: previous legacy card columns and fixed row heights were clipping Homework records. */
@media screen and (max-width:700px){
 body.pulse-experience #app #content .screenshot-homework #rosterCards.teacher-entry-sheet{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:10px!important;width:100%!important;min-width:0!important;overflow:visible!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-student{position:relative!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;flex:none!important;height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important;float:none!important;gap:9px!important;padding:12px!important;margin:0!important;box-sizing:border-box!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-student>*{position:static!important;float:none!important;grid-column:auto!important;grid-row:auto!important;transform:none!important;min-height:0!important;max-height:none!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-student>h4{display:block!important;width:100%!important;height:auto!important;min-height:0!important;line-height:1.3!important;margin:0!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line{display:block!important;width:100%!important;height:auto!important;min-height:0!important;flex:none!important;overflow:visible!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line>label{display:grid!important;grid-template-columns:95px minmax(0,1fr)!important;align-items:center!important;gap:8px!important;width:100%!important;min-width:0!important;margin:0!important;padding:0!important;line-height:1.25!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-line select{display:block!important;position:static!important;width:100%!important;max-width:100%!important;min-width:0!important;height:40px!important;min-height:40px!important;padding:6px!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-actions{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;width:100%!important;height:auto!important;min-height:36px!important;gap:8px!important;margin:0!important;padding:0!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-actions button{position:static!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;flex:0 0 96px!important;width:96px!important;max-width:96px!important;margin:0!important}
 body.pulse-experience #app #content .screenshot-homework #rosterCards .classic-homework-actions [role=status]{flex:1!important;min-width:0!important;overflow-wrap:anywhere!important;line-height:1.3!important}
}

/* Test marks phone card repair: overwrite legacy 570px rows and zero-sized labels. */
@media screen and (max-width:700px){
 body.pulse-experience #app #content .school-test-grid-page #tgCards.school-test-card-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;align-items:stretch!important;gap:10px!important;padding:0!important;overflow:visible!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card{display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important;box-sizing:border-box!important;grid-template-columns:none!important;grid-auto-rows:auto!important;min-width:0!important;width:100%!important;max-width:100%!important;min-height:0!important;height:auto!important;max-height:none!important;gap:10px!important;padding:12px 10px!important;margin:0!important;overflow:visible!important;background:#fff!important;border-radius:13px!important;border:1px solid #d1e1e8!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>h4{display:block!important;flex:none!important;position:static!important;width:100%!important;min-height:36px!important;height:auto!important;margin:0!important;padding:0!important;font-size:15px!important;font-weight:750!important;line-height:1.25!important;overflow-wrap:anywhere!important;text-align:center!important;color:#1b4f79!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>label{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:7px!important;position:static!important;flex:none!important;width:100%!important;min-width:0!important;min-height:0!important;height:auto!important;margin:0!important;padding:0!important;font-size:12px!important;line-height:1.3!important;font-weight:650!important;color:#34495e!important;overflow:visible!important;text-align:left!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>label input{box-sizing:border-box!important;position:static!important;display:block!important;flex:none!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:41px!important;height:41px!important;max-height:41px!important;margin:0!important;padding:7px!important;font-size:17px!important;line-height:24px!important;text-align:center!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>.school-test-card-meta{display:block!important;flex:none!important;width:100%!important;margin:0!important;padding:0!important;font-size:12px!important;line-height:1.4!important;text-align:center!important;color:#5b7180!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>.school-test-card-actions{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important;flex:none!important;position:static!important;width:100%!important;min-width:0!important;height:auto!important;margin-top:auto!important;padding:5px 0 0!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>.school-test-card-actions button{display:block!important;flex:none!important;box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;min-height:37px!important;margin:0!important;padding:7px!important;font-size:13px!important;line-height:1.2!important}
 body.pulse-experience #app #content .school-test-grid-page #tgCards>.school-test-student-card>.school-test-card-actions [role=status]{display:block!important;position:static!important;flex:none!important;width:100%!important;min-width:0!important;margin:0!important;padding:0!important;font-size:11px!important;line-height:1.3!important;text-align:center!important;white-space:normal!important;word-break:normal!important;overflow-wrap:anywhere!important}
}

@media(max-width:700px){body.pulse-experience .teacher-history-tabs button.selected,body.pulse-experience .teacher-history-tabs button[aria-current=page]{background:#0c806d!important;color:#fff!important;box-shadow:inset 0 0 0 2px #0d5a50!important}body.pulse-experience nav button[aria-current=page]{border-left:4px solid #0d806b!important;font-weight:800!important}}


/* Principal Students: class-first, compact, entirely visible without horizontal scrolling. */
@media screen and (max-width:700px){
 body.pulse-experience #app #content .principal-student-tools{
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:end!important;gap:8px!important;margin:7px 0 9px!important;
  padding:9px!important;border-radius:13px!important;
 }
 body.pulse-experience #app #content .principal-student-tools label{
  display:flex!important;flex-direction:column!important;gap:4px!important;
  min-width:0!important;width:100%!important;margin:0!important;padding:0!important;
  font-size:12px!important;font-weight:750!important;line-height:1.15!important;
 }
 body.pulse-experience #app #content .principal-student-tools select{
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;
  height:40px!important;min-height:40px!important;min-width:0!important;
  padding:5px 7px!important;font-size:14px!important;text-overflow:ellipsis!important;
 }
 body.pulse-experience #app #content .principal-student-tools button{
  width:100%!important;max-width:100%!important;min-width:0!important;
  height:40px!important;min-height:40px!important;margin:0!important;
  padding:5px 8px!important;font-size:12px!important;
  white-space:normal!important;line-height:1.1!important;border-radius:9px!important;
 }
 body.pulse-experience #app #content .student-filter-count{
  display:inline-block!important;margin:2px 0 4px!important;font-size:12px!important;
  font-weight:700!important;color:#345c67!important;
 }
 body.pulse-experience #app #content .principal-students-table{
  width:100%!important;max-width:100%!important;min-width:0!important;overflow-x:hidden!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table{
  box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody{
  display:grid!important;grid-template-columns:minmax(0,1fr)!important;gap:7px!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr{
  box-sizing:border-box!important;display:grid!important;
  grid-template-columns:repeat(2,minmax(0,1fr))!important;
  align-items:start!important;gap:3px 8px!important;padding:9px 10px!important;
  max-width:100%!important;min-width:0!important;border-radius:12px!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr[hidden]{
  display:none!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody td{
  min-width:0!important;max-width:100%!important;overflow-wrap:anywhere!important;
  margin:0!important;padding:3px!important;font-size:13px!important;line-height:1.25!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody td:before{
  font-size:10px!important;margin:0 0 2px!important;font-weight:700!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody td:last-child{
  grid-column:1/-1!important;display:flex!important;flex-wrap:wrap!important;
  align-items:center!important;gap:6px!important;padding-top:5px!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody td:last-child:before{
  width:100%!important;margin:0!important;
 }
 body.pulse-experience #app #content .principal-students-table .editStudent,
 body.pulse-experience #app #content .principal-students-table .deleteStudent{
  flex:1 1 100px!important;min-width:0!important;width:auto!important;
  max-width:100%!important;height:34px!important;min-height:34px!important;
  padding:5px 10px!important;margin:0!important;border-radius:9px!important;
  font-size:12px!important;font-weight:700!important;
 }
}

/* Principal student card action regression fix: no tall narrow buttons. */
@media screen and (max-width:700px){
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr td:last-child{
  grid-column:1/-1!important;display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;
  grid-auto-rows:36px!important;align-items:stretch!important;justify-items:stretch!important;
  gap:8px!important;width:100%!important;min-width:0!important;max-width:100%!important;
  height:auto!important;min-height:0!important;margin:0!important;padding:4px 0 0!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr td:last-child::before{
  display:none!important;content:none!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr td:last-child button.editStudent,
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr td:last-child button.deleteStudent{
  display:flex!important;position:static!important;align-items:center!important;justify-content:center!important;
  grid-row:1!important;box-sizing:border-box!important;flex:none!important;
  width:100%!important;min-width:0!important;max-width:100%!important;
  height:36px!important;min-height:36px!important;max-height:36px!important;
  margin:0!important;padding:5px 8px!important;font-size:13px!important;
  line-height:1.2!important;white-space:nowrap!important;
 }
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr td:last-child button.editStudent{grid-column:1!important;}
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody tr td:last-child button.deleteStudent{grid-column:2!important;background:#fbeaea!important;color:#9a3636!important;border:1px solid #e7b9b9!important;}
}

/* Student photos in Principal roster and Add/Edit preview */
.student-name-with-photo{display:inline-flex;align-items:center;gap:9px;min-width:0;max-width:100%;font-weight:700}
.student-name-with-photo>span{min-width:0;overflow-wrap:anywhere}
.student-list-photo{display:none;width:39px;height:39px;min-width:39px;object-fit:cover;border-radius:10px;border:1px solid #c5d8dd;background:#e6f1f1}
.student-list-photo.has-photo{display:block}
.student-form-photo-preview{width:92px;height:92px;object-fit:cover;border:2px solid #bed7d6;border-radius:13px;margin-top:9px;background:#e6f1f1}
.student-form-photo-preview[hidden]{display:none!important}
@media(max-width:700px){body.pulse-experience #app #content .principal-students-table .student-name-with-photo{gap:6px}body.pulse-experience #app #content .principal-students-table .student-list-photo{width:36px;height:36px;min-width:36px}}

/* Optional photo removal control for Principal student form. */
#add #studentRemovePhoto{display:inline-flex;align-items:center;justify-content:center;margin:8px 0 0;padding:7px 12px;min-height:34px;background:#fff1f0;color:#963b35;border:1px solid #e7b8b3;border-radius:9px;font-weight:700;font-size:13px}
#add #studentRemovePhoto[hidden]{display:none!important}

/* Principal multi-class subject assignment: responsive without horizontal scrolling. */
.staff-assignment-toolbar{display:flex;flex-wrap:wrap;gap:8px;align-items:end;margin:8px 0}
.staff-assignment-toolbar label{flex:1 1 190px;min-width:0}
.staff-subject-class-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,230px),1fr));gap:6px;max-width:100%}
.staff-subject-class-row{box-sizing:border-box;display:grid;grid-template-columns:minmax(84px,1fr) minmax(0,1.4fr);gap:8px;align-items:center;padding:7px 9px;border:1px solid #d3e2e6;border-radius:10px;background:#f3f8fa;min-width:0}
.staff-subject-class-row label{display:flex;align-items:center;gap:7px;white-space:nowrap;margin:0!important;min-width:0}
.staff-subject-class-row select{width:100%;min-width:0;max-width:100%;height:38px}
.staff-subject-class-row input[type=checkbox]{width:18px;height:18px;flex:none}
#staffCombinedAssignmentForm{width:100%;max-width:100%;min-width:0;box-sizing:border-box}
@media(max-width:700px){.staff-subject-class-grid{grid-template-columns:1fr}.staff-assignment-toolbar button{flex:1 1 120px;min-width:0}.staff-subject-class-row{padding:5px 8px}.staff-subject-class-row select{height:36px}}


/* Final consolidated Manage Teachers assignment layout, desktop and mobile. */
body.pulse-experience #content #staffCombinedAssignmentForm.staff-assignment-form{
 display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;
 box-sizing:border-box!important;padding:14px!important;margin:0!important;
 border:1px solid #d1e1e6!important;border-radius:14px!important;background:#f8fbfc!important;
}
#staffCombinedAssignmentForm .staff-assignment-heading{display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:4px 12px;margin-bottom:12px}
#staffCombinedAssignmentForm .staff-assignment-heading h3{margin:0!important;color:#20516a}
#staffCombinedAssignmentForm .staff-assignment-heading p{margin:0!important;font-size:12px;color:#5c7380}
#staffCombinedAssignmentForm .staff-assignment-top{display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr) auto!important;align-items:end!important;gap:10px!important;margin-bottom:12px!important}
#staffCombinedAssignmentForm .staff-assignment-top>label,#staffCombinedAssignmentForm .staff-assignment-footer>label{display:flex!important;flex-direction:column!important;gap:5px!important;min-width:0!important;margin:0!important;padding:0!important;font-size:13px!important;font-weight:700!important}
#staffCombinedAssignmentForm :is(.staff-assignment-top,.staff-assignment-footer) select{box-sizing:border-box!important;display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;height:40px!important;padding:6px 9px!important}
#staffCombinedAssignmentForm .staff-assignment-bulk{display:flex!important;gap:7px!important;align-items:center!important;flex-wrap:nowrap!important}
#staffCombinedAssignmentForm .staff-assignment-bulk button{box-sizing:border-box!important;width:auto!important;max-width:none!important;min-width:0!important;height:40px!important;min-height:40px!important;margin:0!important;padding:6px 12px!important;white-space:nowrap!important;font-size:12px!important}
#staffCombinedAssignmentForm .staff-assignment-grid-header{display:flex;align-items:center;justify-content:space-between;gap:10px;margin:5px 0 8px}
#staffCombinedAssignmentForm .staff-assignment-grid-header span{font-size:12px;color:#526c7d}
#staffCombinedAssignmentForm .staff-subject-class-grid{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:8px!important;width:100%!important;max-width:100%!important;margin:0!important;padding:0!important}
#staffCombinedAssignmentForm .staff-subject-class-row{display:grid!important;grid-template-columns:minmax(66px,.75fr) minmax(0,1fr)!important;align-items:center!important;gap:6px!important;min-width:0!important;max-width:100%!important;padding:7px 8px!important;border:1px solid #d4e3e8!important;border-radius:9px!important;background:#eff6f8!important}
#staffCombinedAssignmentForm .staff-subject-class-row label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;min-width:0!important;margin:0!important;padding:0!important;white-space:nowrap!important;font-size:12px!important;line-height:1.2!important}
#staffCombinedAssignmentForm .staff-subject-class-row input[type=checkbox]{flex:none!important;width:16px!important;height:16px!important;min-height:16px!important;margin:0!important}
#staffCombinedAssignmentForm .staff-subject-class-row select{box-sizing:border-box!important;display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;height:35px!important;min-height:35px!important;margin:0!important;padding:4px 6px!important;font-size:12px!important}
#staffCombinedAssignmentForm .staff-assignment-footer{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:end!important;gap:12px!important;margin-top:12px!important}
#staffCombinedAssignmentForm .staff-assignment-footer button{box-sizing:border-box!important;min-width:180px!important;height:40px!important;min-height:40px!important;padding:6px 16px!important;margin:0!important}
#staffCombinedAssignmentForm .staff-assignment-hint{font-size:12px!important;margin:10px 0 0!important;color:#506a78!important;line-height:1.4!important}
@media(max-width:1100px){#staffCombinedAssignmentForm .staff-subject-class-grid{grid-template-columns:repeat(3,minmax(0,1fr))!important}}
@media(max-width:760px){
 #staffCombinedAssignmentForm .staff-assignment-top{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #staffCombinedAssignmentForm .staff-assignment-bulk{grid-column:1/-1!important;justify-content:flex-start!important}
 #staffCombinedAssignmentForm .staff-subject-class-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
 #staffCombinedAssignmentForm .staff-assignment-footer{grid-template-columns:1fr!important}
 #staffCombinedAssignmentForm .staff-assignment-footer button{width:100%!important}
}
@media(max-width:440px){
 body.pulse-experience #content #staffCombinedAssignmentForm.staff-assignment-form{padding:9px!important}
 #staffCombinedAssignmentForm .staff-assignment-top{grid-template-columns:1fr!important}
 #staffCombinedAssignmentForm .staff-subject-class-grid{grid-template-columns:1fr!important}
 #staffCombinedAssignmentForm .staff-assignment-grid-header span{display:none}
}

/* Teacher assignments: clear subject chips for any number of subjects per class. */
#staffCombinedAssignmentForm .staff-assignment-top{grid-template-columns:repeat(2,minmax(0,1fr))!important}
#staffCombinedAssignmentForm .staff-subject-class-row{display:flex!important;flex-direction:column!important;align-items:stretch!important;gap:6px!important}
#staffCombinedAssignmentForm .staff-subject-class-row>strong{font-size:13px!important;color:#24516b!important}
#staffCombinedAssignmentForm .staff-class-subject-picker{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:4px!important}
#staffCombinedAssignmentForm .staff-class-subject-picker label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;white-space:normal!important;font-size:12px!important;font-weight:600!important;line-height:1.2!important;padding:5px!important;border-radius:6px!important;background:#fff!important}
#staffCombinedAssignmentForm .staff-class-subject-picker input[type=checkbox]{width:15px!important;height:15px!important;min-width:15px!important;min-height:15px!important}
#staffAssignmentList .staff-delete-assignment{background:#fff0ef!important;color:#933f3a!important;border:1px solid #e6c3bf!important;margin-left:6px!important}
#staffAssignmentEditor[hidden]{display:none!important}
@media(max-width:700px){#staffCombinedAssignmentForm .staff-assignment-top{grid-template-columns:1fr!important}#staffCombinedAssignmentForm .staff-subject-class-grid{grid-template-columns:1fr!important}#staffCombinedAssignmentForm .staff-class-subject-picker{grid-template-columns:repeat(2,minmax(0,1fr))!important}}

/* Multiple class-monitor assignments, compact and responsive. */
#staffCombinedAssignmentForm .staff-monitor-field{min-width:0;margin:0!important;padding:8px!important;border:1px solid #d4e3e8!important;border-radius:10px!important}
#staffCombinedAssignmentForm .staff-monitor-field legend{font-size:13px!important;font-weight:700!important;padding:0 5px!important}
#staffCombinedAssignmentForm .staff-monitor-classes{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:4px!important}
#staffCombinedAssignmentForm .staff-monitor-classes label{display:flex!important;flex-direction:row!important;align-items:center!important;gap:5px!important;white-space:nowrap!important;font-size:12px!important;font-weight:600!important;margin:0!important;padding:5px!important;border-radius:6px!important;background:#fff!important}
#staffCombinedAssignmentForm .staff-monitor-classes input{width:16px!important;height:16px!important;min-height:16px!important;flex:none!important}
@media(max-width:650px){#staffCombinedAssignmentForm .staff-monitor-classes{grid-template-columns:repeat(3,minmax(0,1fr))!important}}

/* Compact, deliberate Principal bulk student removal controls. */
#studentBulkDelete{background:#fff0ef!important;color:#a13e3e!important;border:1px solid #e8b9b6!important}
#studentBulkDelete:disabled{opacity:.45!important;cursor:not-allowed!important}
.studentBulkSelect{width:18px!important;height:18px!important;min-width:18px!important;min-height:18px!important}
@media(max-width:700px){
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody td:has(.studentBulkSelect){grid-column:1/-1!important;display:flex!important;align-items:center!important;gap:8px!important}
 body.pulse-experience #app #content .principal-students-table table.mobile-card-table tbody td:has(.studentBulkSelect):before{content:"Select"!important}
}

/* Import: clearly separate valid preview from disabled final action. */
#content .csv-import-controls{display:flex!important;align-items:end!important;flex-wrap:wrap!important;gap:10px!important;padding:12px!important;margin:12px 0!important;border-radius:12px!important;background:#eff6f8!important}
#content .csv-import-controls .csv-file-label{display:flex!important;flex:1 1 270px!important;flex-direction:column!important;gap:7px!important;font-weight:700!important;min-width:0!important}
#content .csv-import-controls input[type=file]{box-sizing:border-box!important;width:100%!important;min-width:0!important;background:#fff!important;padding:9px!important}
#content .csv-import-controls #previewCsv{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:125px!important;min-height:43px!important;background:#245c83!important;color:white!important;opacity:1!important}
#content .csv-import-controls #saveCsv{display:inline-flex!important;align-items:center!important;justify-content:center!important;min-width:155px!important;min-height:43px!important;background:#087e6b!important;color:white!important}
#content .csv-import-controls #saveCsv:disabled{background:#e5edf0!important;color:#687d87!important;opacity:1!important;border:1px solid #b8ced5!important;box-shadow:none!important;cursor:not-allowed!important}
#content .csv-import-preview{border:1px solid #d1e2e7;border-radius:10px;padding:12px;margin-top:9px;background:#fafdfd;font-weight:600}
@media(max-width:600px){#content .csv-import-controls>*{flex:1 1 100%!important;width:100%!important}#content .csv-import-controls button{width:100%!important}}

/* Show / Hide password toggle across staff, parent and accountant forms. */
.password-visibility-wrap{display:flex!important;align-items:stretch!important;gap:6px!important;width:100%!important;min-width:0!important}
.password-visibility-wrap>input{flex:1 1 auto!important;min-width:0!important;width:100%!important}
.password-visibility-toggle{flex:0 0 auto!important;min-width:60px!important;min-height:42px!important;padding:8px 12px!important;background:#e3eff0!important;border:1px solid #b8cfd3!important;border-radius:9px!important;color:#164e5e!important;font-size:14px!important;font-weight:700!important}
.password-visibility-toggle:focus-visible{outline:3px solid #317e96!important;outline-offset:2px}

/* Teacher home: compact class and roster without duplicate search/table tools. */
.teacher-class-dashboard .teacher-student-list{margin-top:12px!important;padding:12px!important}
.teacher-class-dashboard .teacher-student-list>h3{margin:0 0 9px!important}
.teacher-class-dashboard .teacher-student-controls{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;margin:0 0 9px!important}
.teacher-class-dashboard .teacher-student-controls label{margin:0!important;min-width:0!important}
.teacher-class-dashboard .teacher-student-controls select{width:100%!important;min-width:0!important}
.teacher-class-dashboard .teacher-roster-tablebox{overflow-x:auto!important;max-width:100%!important;border-radius:10px!important}
.teacher-class-dashboard .teacher-home-student-table{width:100%!important;border-collapse:collapse!important}
.teacher-class-dashboard .teacher-home-student-table :is(th,td){padding:8px 10px!important;line-height:1.3!important}
.teacher-class-dashboard .teacher-absent-box{margin-bottom:10px!important}
@media(max-width:560px){.teacher-class-dashboard .teacher-student-controls{gap:8px!important}.teacher-class-dashboard .teacher-student-controls :is(select,input){font-size:14px!important}}

/* Enforce one-row Class + Student controls in teacher dashboard on all screen sizes. */
#app #content .teacher-class-dashboard .teacher-student-list .teacher-student-controls{
 display:grid!important;grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
 grid-auto-flow:column!important;column-gap:10px!important;align-items:end!important;
 width:100%!important;max-width:100%!important;min-width:0!important;
}
#app #content .teacher-class-dashboard .teacher-student-list .teacher-student-controls>label{
 display:flex!important;flex-direction:column!important;grid-column:auto!important;
 width:auto!important;max-width:100%!important;min-width:0!important;
 margin:0!important;padding:0!important;gap:5px!important;
}
#app #content .teacher-class-dashboard .teacher-student-list .teacher-student-controls>label>select{
 box-sizing:border-box!important;display:block!important;width:100%!important;
 min-width:0!important;max-width:100%!important;white-space:nowrap!important;
}
@media(max-width:480px){
 #app #content .teacher-class-dashboard .teacher-student-list .teacher-student-controls{column-gap:7px!important}
 #app #content .teacher-class-dashboard .teacher-student-list .teacher-student-controls>label>select{font-size:13px!important;padding-inline:7px!important}
}
