/* V1.26 Preview final cascade layer. Loaded after the legacy stylesheet. */
:root{--tp-navy:#082D57;--tp-navy-2:#104A82;--tp-blue:#175FA7;--tp-gold:#F4B928;--tp-bg:#F5F7FB;--tp-ink:#10233F;--tp-muted:#66758A;--tp-line:#DFE6EF;--tp-success:#16805D;--tp-shadow:0 6px 22px rgba(8,45,87,.055)}
body{background:var(--tp-bg);color:var(--tp-ink);font-family:"Cairo","IBM Plex Sans Arabic",Tahoma,Arial,sans-serif}
button,input,select,textarea{font-family:inherit}
.page-kicker{display:block;margin-bottom:3px;color:var(--tp-blue);font-size:11px;font-weight:800}
.login-product-lockup{display:flex;align-items:center;justify-content:center;gap:12px;direction:ltr;text-align:left}
.login-product-lockup>div:last-child{display:grid;gap:1px}.login-product-lockup strong{font-size:20px;line-height:1.2}.login-product-lockup small{font-size:11px;opacity:.72}
.login-kicker{display:block;margin:22px 0 7px;text-align:center;color:var(--tp-gold);font-size:12px;font-weight:800}
#loginView .mini-logo{position:relative;overflow:hidden;isolation:isolate}#loginView .mini-logo::before{content:"";position:absolute;inset:7px;border:1px solid currentColor;border-radius:13px;opacity:.45}#loginView .mini-logo span{position:relative;z-index:1}
@media(max-width:900px){
  #loginView.login-shell:not(.hidden){padding:32px 22px max(28px,env(safe-area-inset-bottom))!important;background:radial-gradient(circle at 84% 10%,rgba(244,185,40,.16),transparent 25%),radial-gradient(circle at 12% 92%,rgba(23,95,167,.3),transparent 34%),linear-gradient(158deg,#0C4076 0%,var(--tp-navy) 54%,#061E3B 100%)!important}
  #loginView .login-card{width:min(100%,390px)!important;max-width:390px!important}
  #loginView .login-product-lockup .mini-logo{display:grid!important;width:58px!important;height:66px!important;margin:0!important;border:1.5px solid rgba(244,185,40,.9)!important;border-radius:17px 17px 21px 21px!important;background:rgba(255,255,255,.045)!important;color:var(--tp-gold)!important;font-size:18px!important}
  #loginView .login-product-lockup strong{color:#fff;font-size:21px}#loginView .login-product-lockup small{color:rgba(255,255,255,.72);font-size:11px}
  #loginView .login-card h2{font-size:25px!important}#loginView #loginIntro{font-size:13px!important;line-height:1.75!important;margin-bottom:20px!important}#loginView label{font-size:13px!important}#loginView input{height:52px!important;border-radius:14px!important}
  #loginView #loginBtn{height:52px!important;border-radius:14px!important;background:#fff!important;color:var(--tp-navy)!important}#loginView #loginBtn::after{content:"  ←";color:var(--tp-gold)}
  #loginView .teacher-signup-entry{border-color:rgba(244,185,40,.42)!important;color:#FFE39A!important}
  body[data-role="teacher"] .app-header{height:60px!important;min-height:60px!important;padding:0 18px!important;background:linear-gradient(100deg,var(--tp-navy),var(--tp-navy-2))!important}
  body[data-role="teacher"] #headerScreenTitle{font-size:17px!important}body[data-role="teacher"] .content{padding:20px 18px calc(78px + env(safe-area-inset-bottom))!important}
  body[data-role="teacher"] .section-head{margin-bottom:16px;align-items:flex-end}body[data-role="teacher"] .section-head h2{margin:0;color:var(--tp-ink);font-size:26px;line-height:1.35;font-weight:850}body[data-role="teacher"] .section-head .muted{margin:4px 0 0;font-size:12px;line-height:1.6}
  body[data-role="teacher"] .teacher-mobile-nav:not(.hidden){height:calc(62px + env(safe-area-inset-bottom))!important;padding:3px 10px calc(3px + env(safe-area-inset-bottom))!important;background:rgba(8,45,87,.98)!important}
  body[data-role="teacher"] .teacher-mobile-nav .mobile-nav-item{height:54px!important;min-height:54px!important;max-height:54px!important;border-radius:12px!important;font-size:10px!important}
  body[data-role="teacher"] .teacher-mobile-nav .mobile-nav-item.active,body[data-role="teacher"] .teacher-mobile-nav .mobile-more-trigger.active{background:rgba(255,255,255,.075)!important;color:var(--tp-gold)!important}
  #homeSection #statsGrid{display:none!important}#homeSection #homePanels{display:block!important;margin:0!important}#homeSection .teacher-command-center{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}#homeSection .smart-dashboard{display:grid;gap:14px}
  #homeSection .smart-dashboard-hero{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0;padding:0 2px;background:transparent;border:0;box-shadow:none}#homeSection .smart-dashboard-hero .eyebrow,#homeSection .smart-dashboard-hero p{display:none}#homeSection .smart-dashboard-hero h3{margin:0;color:var(--tp-muted);font-size:12px;font-weight:650}
  #homeSection .smart-next-lesson{position:relative;order:-2;display:grid;grid-template-columns:44px minmax(0,1fr);gap:4px 12px;padding:18px;border:0;border-radius:20px;background:linear-gradient(135deg,var(--tp-navy),#12528F);color:#fff;box-shadow:0 12px 34px rgba(8,45,87,.10);overflow:hidden}
  #homeSection .smart-next-icon{grid-row:1/3;width:44px;height:44px;border-radius:14px;background:rgba(255,255,255,.1);color:var(--tp-gold);display:grid;place-items:center}#homeSection .smart-next-copy h4{margin:3px 0;color:#fff;font-size:18px}#homeSection .smart-next-copy p{display:block;margin:0;color:rgba(255,255,255,.72);font-size:11px}#homeSection .smart-next-copy span{color:rgba(255,255,255,.7);font-size:11px}#homeSection .smart-next-copy b{display:inline-block;margin-top:8px;padding:5px 9px;border-radius:99px;background:rgba(244,185,40,.16);color:#FFE18A;font-size:10px}
  #homeSection .smart-next-lesson>.primary-btn,#homeSection .smart-next-lesson>.secondary-btn{grid-column:1/-1;width:100%;min-height:44px;margin:12px 0 0;border-radius:12px;background:var(--tp-gold);color:var(--tp-navy);box-shadow:none}
  #homeSection .dashboard-quick-actions{order:-1;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0}#homeSection .dashboard-quick-actions button{min-width:0;min-height:76px;padding:10px 4px;border:1px solid var(--tp-line);border-radius:15px;background:#fff;color:var(--tp-ink);box-shadow:none}#homeSection .dashboard-quick-actions button span{width:31px;height:31px;margin:auto auto 6px;border-radius:10px;background:#EDF4FC;color:var(--tp-blue);display:grid;place-items:center;font-size:16px}#homeSection .dashboard-quick-actions button b{font-size:9.5px;line-height:1.35;white-space:normal}
  #homeSection .smart-kpis{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:8px;margin:0}#homeSection .smart-kpis>div{min-width:0;padding:11px 6px;border:1px solid var(--tp-line);border-radius:14px;background:#fff;text-align:center}#homeSection .smart-kpis span{font-size:8.5px;color:var(--tp-muted)}#homeSection .smart-kpis b{display:block;margin-top:5px;color:var(--tp-navy);font-size:16px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#homeSection .dashboard-secondary-grid{display:none!important}
  #studentsSection #addStudentBtn{width:auto!important;min-width:118px;min-height:42px;margin:0!important;padding:10px 13px;border-radius:13px;background:var(--tp-navy);box-shadow:none;font-size:11px;white-space:nowrap}#studentsSection #addStudentBtn span{color:var(--tp-gold);font-size:15px}
  #studentsSection .students-list-panel{padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important}#studentsSection .student-search-wrap{position:relative;margin:0 0 12px!important}#studentsSection .student-search-wrap .search-icon{position:absolute;right:15px;top:50%;width:16px;height:16px;border:2px solid #8290A3;border-radius:50%;transform:translateY(-60%);z-index:2}#studentsSection .student-search-wrap .search-icon::after{content:"";position:absolute;width:7px;height:2px;background:#8290A3;left:-5px;bottom:-2px;transform:rotate(45deg)}
  #studentsSection #studentSearch{max-width:none;width:100%;height:48px;margin:0;padding:10px 44px 10px 14px;border:1px solid var(--tp-line);border-radius:15px;background:#fff;box-shadow:none;font-size:14px}
  #studentsSection .students-data-table tbody{gap:10px}#studentsSection .students-data-table tr.student-row-card{grid-template-columns:minmax(0,1fr) auto!important;padding:14px!important;border-color:var(--tp-line)!important;border-radius:18px!important;box-shadow:var(--tp-shadow)!important}#studentsSection .students-data-table tr.student-row-card td[data-label="الاسم"]{display:grid!important;grid-template-columns:42px minmax(0,1fr);align-items:center;gap:10px}
  #studentsSection .student-avatar{width:42px;height:42px;border-radius:13px;background:linear-gradient(145deg,#EAF2FC,#F7FAFE);border:1px solid #DCE7F4;color:var(--tp-blue);display:grid;place-items:center;font-size:14px;font-weight:850}#studentsSection .student-identity-copy{min-width:0;display:block}#studentsSection .student-name{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;color:var(--tp-ink);font-size:14px}#studentsSection .student-inline-meta{margin-top:2px;font-size:10px;color:var(--tp-muted)}
  #studentsSection .student-primary-actions{display:grid!important;grid-template-columns:42px minmax(0,1fr) minmax(0,1fr)!important;gap:8px!important;direction:ltr}#studentsSection .student-primary-actions .action-btn{height:40px!important;min-height:40px!important;border-radius:12px!important;font-size:10px!important;direction:rtl}#studentsSection .student-primary-actions .whatsapp-action{grid-column:3;background:#ECF8F3!important;border-color:#BFE4D5!important;color:var(--tp-success)!important}#studentsSection .student-primary-actions .qr-action{grid-column:2;background:#EDF5FC!important;border-color:#CFE1F2!important;color:var(--tp-navy)!important}#studentsSection .student-primary-actions .row-more-menu{grid-column:1;grid-row:1}#studentsSection .row-more-trigger{width:42px!important;height:40px!important;border-radius:12px!important;border:1px solid var(--tp-line)!important;background:#fff!important;color:var(--tp-navy)!important;font-size:22px!important}
}
@media(max-width:380px){body[data-role="teacher"] .content{padding-inline:14px!important}body[data-role="teacher"] .section-head h2{font-size:23px}#homeSection .dashboard-quick-actions{gap:6px}#studentsSection #addStudentBtn{min-width:106px;padding-inline:10px}}

/* V1.26.1 — real-device stabilization. */
@media(max-width:900px){
  #loginView.login-shell:not(.hidden){align-items:flex-start!important;padding-top:max(24px,env(safe-area-inset-top))!important;padding-bottom:max(22px,env(safe-area-inset-bottom))!important;overflow:auto!important}
  #loginView .login-product-lockup{gap:10px!important}
  #loginView .login-product-lockup .mini-logo{width:52px!important;height:59px!important;border-radius:15px 15px 18px 18px!important}
  #loginView .login-product-lockup strong{font-size:19px!important}#loginView .login-product-lockup small{font-size:10px!important}
  #loginView .login-kicker{margin:15px 0 4px!important;font-size:11px!important}
  #loginView .login-card h2{margin-bottom:3px!important;font-size:23px!important}
  #loginView #loginIntro{margin-bottom:13px!important;font-size:12px!important;line-height:1.55!important}
  #loginView label{margin-top:10px!important;font-size:12px!important}
  #loginView input{height:48px!important;min-height:48px!important;margin-top:5px!important;padding-block:9px!important;font-size:15px!important}
  #loginView #loginBtn{height:48px!important;margin-top:15px!important}
  #loginView #installBtn{min-height:42px!important;margin-top:8px!important}
  #loginView .forgot-password-entry{margin-top:10px!important}#loginView .teacher-signup-entry{margin-top:10px!important;padding:10px!important}

  body[data-role="teacher"] .content{padding-top:16px!important}
  #homeSection .home-page-head{align-items:center!important;margin-bottom:12px!important}
  #homeSection .home-page-head h2{margin:0!important;font-size:27px!important;line-height:1.25!important;letter-spacing:-.02em!important}
  #homeSection .home-page-head .muted{font-size:11px!important;max-width:245px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #homeSection .home-page-head .icon-action-btn{position:relative!important;width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;border:1px solid var(--tp-line)!important;border-radius:13px!important;background:#fff!important;color:var(--tp-navy)!important;font-size:22px!important;line-height:1!important;box-shadow:none!important}
  #homeSection .home-page-head .icon-action-btn::before,#homeSection .home-page-head .icon-action-btn::after{display:none!important;content:none!important}
  #homeSection .smart-dashboard{gap:12px!important}
  #homeSection .smart-next-lesson{grid-template-columns:minmax(0,1fr) auto!important;gap:4px 10px!important;padding:16px!important;border-radius:18px!important}
  #homeSection .smart-next-lesson::after{width:110px!important;height:110px!important;inset-inline-start:-54px!important;bottom:-62px!important;border-width:18px!important;opacity:.55!important;pointer-events:none}
  #homeSection .smart-next-icon{display:none!important}
  #homeSection .smart-next-copy{grid-column:1/-1!important;min-width:0!important}
  #homeSection .smart-next-copy h4{font-size:18px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #homeSection .smart-next-copy b{max-width:100%;white-space:nowrap}
  #homeSection .smart-next-lesson>.primary-btn,#homeSection .smart-next-lesson>.secondary-btn{min-height:42px!important;margin-top:9px!important}
  #homeSection .dashboard-quick-actions{gap:7px!important}
  #homeSection .dashboard-quick-actions button{min-height:70px!important;padding:8px 3px!important;border-radius:14px!important}
  #homeSection .dashboard-quick-actions button span{width:29px!important;height:29px!important;margin-bottom:4px!important}
  #homeSection .dashboard-quick-actions button b{font-size:9px!important}
  #homeSection .smart-dashboard-hero{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:8px!important;padding:0!important}
  #homeSection .smart-dashboard-hero h3{font-size:11px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #homeSection .smart-dashboard-hero .secondary-btn{width:auto!important;min-width:92px!important;min-height:36px!important;margin:0!important;padding:7px 10px!important}
  #homeSection .smart-kpis{gap:7px!important}
  #homeSection .smart-kpis>div{min-width:0!important;padding:10px 4px!important;border-radius:13px!important}
  #homeSection .smart-kpis span{display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:8px!important}
  #homeSection .smart-kpis b{font-size:14px!important;direction:rtl;text-overflow:clip!important}
  #homeSection .smart-kpis>div:last-child b{font-size:10.5px!important;white-space:normal!important;line-height:1.25!important;max-height:27px;overflow:hidden}
  #homeSection .smart-alert-dashboard-card{padding:15px!important;border-radius:18px!important}
  #homeSection .smart-alert-dashboard-card h4{font-size:16px!important}

  #homeSection .smart-today-mini{padding:14px!important;border-radius:18px!important;overflow:hidden!important}
  #homeSection .smart-today-mini .smart-section-title{display:flex!important;align-items:center!important;justify-content:space-between!important;margin-bottom:9px!important}
  #homeSection .smart-today-mini .smart-section-title b{font-size:18px!important;color:var(--tp-ink)!important}
  #homeSection .smart-today-mini .smart-section-title span{font-size:10px!important;color:var(--tp-muted)!important}
  #homeSection .smart-today-mini .schedule-list{display:grid!important;gap:8px!important}
  #homeSection .smart-today-mini .schedule-session-card,#homeSection .smart-today-mini .schedule-session-card.compact{display:grid!important;grid-template-columns:62px minmax(0,1fr)!important;gap:3px 10px!important;padding:12px!important;border:1px solid var(--tp-line)!important;border-radius:15px!important;background:#fff!important;box-shadow:none!important}
  #homeSection .smart-today-mini .schedule-session-time{grid-column:1!important;grid-row:1!important;padding:0!important;text-align:right!important}
  #homeSection .smart-today-mini .schedule-session-time b{font-size:13px!important;color:var(--tp-navy)!important}#homeSection .smart-today-mini .schedule-session-time span{font-size:9px!important;color:var(--tp-muted)!important}
  #homeSection .smart-today-mini .schedule-session-main{grid-column:2!important;grid-row:1!important;min-width:0!important}
  #homeSection .smart-today-mini .schedule-session-title{display:flex!important;align-items:center!important;gap:6px!important;min-width:0!important}
  #homeSection .smart-today-mini .schedule-session-title h4{margin:0!important;min-width:0!important;font-size:13px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #homeSection .smart-today-mini .schedule-session-status{flex:0 0 auto!important;padding:4px 6px!important;font-size:7.5px!important}
  #homeSection .smart-today-mini .schedule-session-main p{margin:3px 0 0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #homeSection .smart-today-mini .schedule-lesson-btn{grid-column:1/-1!important;grid-row:2!important;width:100%!important;min-height:36px!important;margin-top:7px!important;border:1px solid #EEDB9B!important;border-radius:11px!important;background:#FFF9E8!important;color:var(--tp-navy)!important;font-size:10px!important;font-weight:800!important}

  #studentsSection .students-page-head h2{font-size:26px!important}
  #studentsSection .student-avatar{width:40px!important;height:40px!important;border-radius:50%!important}
  #studentsSection .students-data-table tr.student-row-card{padding:13px!important}
  #studentsSection .students-data-table tr.student-row-card td[data-label="الاسم"]{grid-template-columns:40px minmax(0,1fr)!important}
  #studentsSection .students-data-table tr.student-row-card td[data-label="ولي الأمر"]{margin-top:8px!important;padding-top:8px!important}
  #studentsSection .students-data-table tr.student-row-card td[data-label="الإجراءات"]{margin-top:9px!important}
  #studentsSection .student-primary-actions{grid-template-columns:42px minmax(0,1fr) minmax(0,1fr)!important;grid-template-rows:40px!important;align-items:stretch!important}
  #studentsSection .student-primary-actions .row-more-menu{grid-column:1!important;grid-row:1!important}
  #studentsSection .student-primary-actions .qr-action{grid-column:2!important;grid-row:1!important;width:100%!important;margin:0!important}
  #studentsSection .student-primary-actions .whatsapp-action{grid-column:3!important;grid-row:1!important;width:100%!important;margin:0!important}

  body[data-role="teacher"] .teacher-mobile-nav:not(.hidden){height:calc(58px + env(safe-area-inset-bottom))!important;padding-top:2px!important}
  body[data-role="teacher"] .teacher-mobile-nav .mobile-nav-item{height:50px!important;min-height:50px!important;max-height:50px!important;font-size:9px!important;gap:2px!important}
  body[data-role="teacher"] .teacher-mobile-nav .mobile-nav-icon,body[data-role="teacher"] .teacher-mobile-nav .mobile-nav-icon svg{width:20px!important;height:20px!important}
}

@media(max-width:370px){
  #homeSection .home-page-head h2{font-size:24px!important}
  #homeSection .dashboard-quick-actions button b{font-size:8.4px!important}
  #homeSection .smart-kpis b{font-size:13px!important}
  #studentsSection #addStudentBtn{min-width:100px!important;font-size:10px!important}
}

/* ==========================================================
   V1.31.0 PREVIEW — TEACHER PROFILE, HOME HERO & PARENT CARD
   ========================================================== */
.teacher-profile-media-editor{display:flex;align-items:center;gap:18px;margin-bottom:20px;padding:18px;border:1px solid var(--tp-border,#dfe6ef);border-radius:20px;background:#f8fafd}
.teacher-photo-preview{width:112px;height:112px;min-width:112px;display:grid;place-items:center;overflow:hidden;border:3px solid var(--gold,#e8ad22);border-radius:28px;background:linear-gradient(145deg,#eaf3fd,#fff);color:var(--navy,#0b2f66);font-size:34px;font-weight:900;box-shadow:0 10px 24px rgba(11,47,102,.12)}
.teacher-photo-preview img{width:100%;height:100%;object-fit:cover}.teacher-photo-controls{flex:1}.teacher-photo-controls p{margin:5px 0 12px}.teacher-photo-controls>div{display:flex;gap:8px;flex-wrap:wrap}

.teacher-home-profile-hero{position:relative;order:-3!important;display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:22px;padding:26px 28px;overflow:hidden;border-radius:28px;background:linear-gradient(125deg,#082d66 0%,#0c4b85 74%,#0b3769 100%);color:#fff;box-shadow:0 18px 38px rgba(11,47,102,.2)}
.teacher-home-profile-hero::after{content:"";position:absolute;inset:auto -70px -100px auto;width:260px;height:260px;border:44px solid rgba(232,173,34,.13);border-radius:50%}
.teacher-home-photo{position:relative;z-index:1;width:124px;height:124px;display:grid;place-items:center;overflow:hidden;border:4px solid var(--gold,#e8ad22);border-radius:34px;background:#eef5fc;color:var(--navy,#0b2f66);font-size:38px;font-weight:900;box-shadow:0 12px 28px rgba(0,0,0,.2)}
.teacher-home-photo img{width:100%;height:100%;object-fit:cover}.teacher-home-profile-copy{position:relative;z-index:1}.teacher-home-profile-copy .eyebrow{color:#ffd46b}.teacher-home-profile-copy h2{margin:4px 0 2px;color:#fff;font-size:30px}.teacher-home-profile-copy>b{color:#ffd46b}.teacher-home-profile-copy p{max-width:590px;margin:8px 0 0;color:#dbe7f5;line-height:1.8}
.teacher-home-profile-contact{position:relative;z-index:1;display:grid;gap:10px;min-width:205px;padding:13px;border:1px solid rgba(255,255,255,.2);border-radius:18px;background:rgba(255,255,255,.08)}
.teacher-home-phone-block{display:flex;align-items:center;gap:10px;direction:ltr;text-align:left}.teacher-home-phone-icon{width:38px;height:38px;display:grid;place-items:center;flex:0 0 38px;border-radius:12px;background:rgba(255,208,76,.16);color:#ffd04c!important;font-size:19px!important}.teacher-home-phone-block>div{display:grid;min-width:0}.teacher-home-phone-block small{color:#bdd0e6;font-size:10px}.teacher-home-phone-block a{color:#fff;text-decoration:none;font-family:Arial,Tahoma,sans-serif;font-size:17px;font-weight:850;letter-spacing:.5px;white-space:nowrap}.teacher-home-profile-contact .secondary-btn{width:100%;min-height:38px;margin:0;background:#fff;color:var(--navy,#0b2f66)}

.paper-parent-card{position:relative;display:grid!important;grid-template-columns:29% 47% 24%;grid-template-rows:1fr auto;min-height:520px;overflow:hidden;border:1px solid #d8e0eb!important;border-radius:26px!important;background:#fff!important;box-shadow:0 16px 40px rgba(10,45,90,.11)!important}
.paper-card-teacher{grid-row:1/3;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:26px 18px;background:linear-gradient(155deg,#082d66,#0c4983);color:#fff;text-align:center;border-inline-end:9px solid var(--gold,#e8ad22)}
.paper-card-teacher-photo{width:132px;height:132px;display:grid;place-items:center;overflow:hidden;border:5px solid var(--gold,#e8ad22);border-radius:34px;background:#edf5fd;color:var(--navy,#0b2f66);font-size:42px;font-weight:900}.paper-card-teacher-photo img{width:100%;height:100%;object-fit:cover}
.paper-card-teacher strong{margin-top:20px;font-size:22px}.paper-card-teacher>b{color:#ffc83e;font-size:17px}.paper-card-teacher small{margin-top:5px;color:#dbe7f5}.paper-card-teacher i{width:70px;margin:15px;border-top:2px solid #e8ad22}.paper-card-teacher>span{font-weight:800}
.paper-card-student{padding:42px 24px 20px;direction:rtl}.paper-card-student-row{display:grid;grid-template-columns:125px minmax(0,1fr);align-items:center;min-height:62px;border-bottom:2px solid #efc34e}.paper-card-student-row span{color:#0b2f66;font-weight:800}.paper-card-student-row b{font-size:19px;overflow-wrap:anywhere}.paper-card-student-row .muted-login{color:#687386;font-size:13px}.paper-card-fast-link{margin-top:24px;text-align:center;color:#0b2f66}.paper-card-fast-link span{color:#e8ad22}.paper-card-fast-link b,.paper-card-fast-link code{display:block;margin-top:8px}.paper-card-fast-link code{font-size:11px;overflow-wrap:anywhere}
.paper-card-access{padding:42px 20px 20px;text-align:center}.paper-card-qr-frame{padding:13px;border:3px solid var(--gold,#e8ad22);border-radius:20px}.paper-card-qr-frame img{width:170px;height:170px;display:block;margin:auto}.paper-card-qr-frame b{display:block;color:#0b2f66}.paper-card-scan-note{display:grid;grid-template-columns:auto 1fr;align-items:center;gap:8px;margin-top:15px;padding:14px;border-radius:16px;background:#0b2f66;color:#fff;font-size:12px;line-height:1.65}.paper-card-scan-note span{color:#e8ad22;font-size:25px}
.paper-card-footer{grid-column:2/4;display:flex!important;justify-content:space-between;gap:12px;padding:12px 24px!important;border-top:1px solid #dfe5ee!important;color:#687386!important;font-size:11px!important}.paper-card-footer span:last-child{max-width:70%;text-align:end}

@media(max-width:760px){
  .teacher-profile-media-editor{align-items:flex-start}.teacher-photo-preview{width:92px;height:92px;min-width:92px;border-radius:23px}
  .teacher-home-profile-hero{grid-template-columns:92px 1fr;gap:15px;padding:20px}.teacher-home-photo{width:92px;height:92px;border-radius:26px}.teacher-home-profile-copy h2{font-size:23px}.teacher-home-profile-copy p{font-size:12px}.teacher-home-profile-contact{grid-column:1/-1;display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 14px}.teacher-home-phone-block{flex:1}.teacher-home-profile-contact .secondary-btn{width:auto;min-width:105px;flex:0 0 auto}
  .paper-parent-card{display:block!important}.paper-card-teacher{padding:22px;border-inline-end:0;border-bottom:7px solid var(--gold,#e8ad22)}.paper-card-teacher-photo{width:108px;height:108px}.paper-card-student{padding:24px 18px}.paper-card-student-row{grid-template-columns:105px 1fr;min-height:58px}.paper-card-access{padding:10px 18px 24px}.paper-card-qr-frame{max-width:250px;margin:auto}.paper-card-footer{display:flex!important}.paper-card-footer span:last-child{max-width:58%}
}
@media(max-width:430px){.teacher-profile-media-editor{display:block}.teacher-photo-preview{margin:0 auto 14px}.teacher-photo-controls{text-align:center}.teacher-photo-controls>div{justify-content:center}.paper-card-student-row{grid-template-columns:92px 1fr}.paper-card-student-row b{font-size:16px}}

/* ==========================================================
   V1.28.0 PREVIEW — FOLLOW-UP CENTER / PHASE 3
   Finance, Communication, Smart Alerts and Reports.
   ========================================================== */
@media(max-width:900px){
  #studentFinanceSection .section-head,#communicationSection .section-head,#smartAlertsSection .section-head,#reportsSection .section-head{align-items:flex-end!important;margin-bottom:15px!important}
  #studentFinanceSection .section-head h2,#communicationSection .section-head h2,#smartAlertsSection .section-head h2,#reportsSection .section-head h2{margin:0!important;font-size:25px!important;line-height:1.35!important;color:var(--tp-ink)!important}
  #studentFinanceSection .section-head p,#communicationSection .section-head p,#smartAlertsSection .section-head p,#reportsSection .section-head p{margin:4px 0 0!important;font-size:10px!important;line-height:1.55!important}
  #studentFinanceSection .section-head .compact,#communicationSection .section-head .compact{width:auto!important;min-width:72px!important;min-height:38px!important;margin:0!important;padding:8px 10px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#fff!important;color:var(--tp-navy)!important;font-size:10px!important}

  /* Student finance. */
  #studentFinanceSection .student-finance-stats{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-bottom:11px!important}
  #studentFinanceSection .student-finance-stats .stat-card{min-width:0!important;padding:11px!important;border:1px solid var(--tp-line)!important;border-radius:14px!important;background:#fff!important;box-shadow:none!important}
  #studentFinanceSection .student-finance-stats span{font-size:8.5px!important}#studentFinanceSection .student-finance-stats b{margin-top:4px!important;font-size:17px!important;color:var(--tp-navy)!important}
  #studentFinanceSection .student-finance-toolbar-panel{padding:13px!important;margin-bottom:11px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #studentFinanceSection .student-finance-toolbar{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important}
  #studentFinanceSection .student-finance-toolbar label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #studentFinanceSection .student-finance-search-label{grid-column:1/-1!important}
  #studentFinanceSection .student-finance-toolbar input,#studentFinanceSection .student-finance-toolbar select{width:100%!important;height:42px!important;min-height:42px!important;margin-top:4px!important;padding:8px 10px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:11px!important}
  #studentFinanceSection .student-finance-filter-bar{display:flex!important;gap:6px!important;margin:10px -2px 0!important;padding:2px!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none!important}
  #studentFinanceSection .student-finance-filter-bar::-webkit-scrollbar{display:none}
  #studentFinanceSection .tenant-filter-chip{flex:0 0 auto!important;min-height:34px!important;padding:7px 10px!important;border:1px solid var(--tp-line)!important;border-radius:99px!important;background:#fff!important;color:var(--tp-muted)!important;font-size:8.5px!important;white-space:nowrap!important}
  #studentFinanceSection .tenant-filter-chip.active{border-color:var(--tp-navy)!important;background:var(--tp-navy)!important;color:#fff!important}
  #studentFinanceSection .student-finance-list{display:grid!important;gap:9px!important}
  #studentFinanceSection .student-finance-card{padding:13px!important;border:1px solid var(--tp-line)!important;border-inline-start-width:4px!important;border-radius:17px!important;background:#fff!important;box-shadow:none!important}
  #studentFinanceSection .student-finance-card-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:10px!important}
  #studentFinanceSection .student-finance-card-head h3{margin:5px 0 2px!important;font-size:15px!important;color:var(--tp-ink)!important}#studentFinanceSection .student-finance-card-head p{font-size:8.5px!important}
  #studentFinanceSection .student-finance-status{padding:4px 7px!important;font-size:8px!important}
  #studentFinanceSection .student-finance-remaining{text-align:left!important;flex:none!important}#studentFinanceSection .student-finance-remaining span{font-size:8px!important}#studentFinanceSection .student-finance-remaining b{font-size:17px!important;color:var(--tp-navy)!important}
  #studentFinanceSection .student-finance-numbers{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin:10px 0!important}
  #studentFinanceSection .student-finance-numbers>div{min-width:0!important;padding:8px 5px!important;border:1px solid #EAF0F6!important;border-radius:11px!important;background:#F8FAFD!important;text-align:center!important}
  #studentFinanceSection .student-finance-numbers span{font-size:7.5px!important}#studentFinanceSection .student-finance-numbers b{font-size:10.5px!important;white-space:nowrap!important}
  #studentFinanceSection .student-finance-card-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  #studentFinanceSection .student-finance-card-actions .inline-btn{width:100%!important;min-height:38px!important;margin:0!important;padding:8px!important;border-radius:11px!important;font-size:8.5px!important}
  #studentFinanceSection .student-finance-card-actions .primary-btn{background:var(--tp-navy)!important}

  /* Parent communication. */
  #communicationSection>.panel{padding:13px!important;margin-bottom:10px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:none!important}
  #communicationSection .communication-select-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important}
  #communicationSection .communication-select-grid label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #communicationSection .communication-select-grid input,#communicationSection .communication-select-grid select{width:100%!important;height:42px!important;min-height:42px!important;margin-top:4px!important;padding:8px 10px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:11px!important}
  #communicationSection .communication-student-identity{margin-top:9px!important}
  #communicationSection .communication-identity-main{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important}
  #communicationSection .communication-identity-main>div{min-width:0!important;padding:10px!important;border:1px solid #EAF0F6!important;border-radius:12px!important;background:#F8FAFD!important}
  #communicationSection .communication-identity-main span{font-size:8px!important}#communicationSection .communication-identity-main b{font-size:12px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#communicationSection .communication-identity-main small{font-size:8px!important}
  #communicationSection .communication-panel-head{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:9px!important;margin-bottom:9px!important}
  #communicationSection .communication-panel-head .eyebrow{font-size:8px!important}#communicationSection .communication-panel-head h3{margin:2px 0 0!important;font-size:18px!important;color:var(--tp-ink)!important}
  #communicationSection .communication-safe-note{max-width:190px!important;font-size:8px!important;line-height:1.5!important}
  #communicationSection .communication-template-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:7px!important}
  #communicationSection .communication-template{min-height:68px!important;padding:10px!important;border:1px solid var(--tp-line)!important;border-radius:13px!important;background:#fff!important;text-align:right!important;box-shadow:none!important}
  #communicationSection .communication-template b{margin:0 0 3px!important;font-size:12px!important;color:var(--tp-navy)!important}#communicationSection .communication-template span{font-size:8px!important;line-height:1.4!important}
  #communicationSection .communication-template.active{border-color:#E1BF4A!important;background:#FFF9E7!important;box-shadow:inset 0 0 0 1px rgba(225,191,74,.22)!important}
  #communicationSection .communication-message{width:100%!important;min-height:180px!important;margin:0!important;padding:12px!important;border:1px solid var(--tp-line)!important;border-radius:13px!important;background:#FBFCFE!important;font-size:11px!important;line-height:1.75!important}
  #communicationSection .communication-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;margin-top:9px!important}
  #communicationSection .communication-actions .inline-btn{width:100%!important;min-height:38px!important;margin:0!important;padding:8px!important;border-radius:11px!important;font-size:8.5px!important}
  #communicationSection .communication-whatsapp-btn{grid-column:1/-1!important;min-height:42px!important;background:#16805D!important;font-size:10px!important}

  /* Smart alerts. */
  #smartAlertsSection #runSmartAlertsBtn{width:auto!important;min-width:92px!important;min-height:40px!important;margin:0!important;padding:9px 12px!important;border-radius:12px!important;background:var(--tp-navy)!important;font-size:10px!important}
  #smartAlertsSection .smart-alert-controls-panel{padding:13px!important;margin-bottom:10px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #smartAlertsSection .smart-alert-controls{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important}
  #smartAlertsSection .smart-alert-controls label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #smartAlertsSection .smart-alert-controls input,#smartAlertsSection .smart-alert-controls select{width:100%!important;height:42px!important;min-height:42px!important;margin-top:4px!important;padding:8px 10px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:11px!important}
  #smartAlertsSection .smart-alert-analysis-note{display:grid!important;grid-template-columns:1fr!important;gap:3px!important;margin-top:9px!important;padding:10px!important;border:1px solid #DCE8F4!important;border-radius:12px!important;background:#F4F8FC!important}
  #smartAlertsSection .smart-alert-analysis-note b{font-size:11px!important;color:var(--tp-navy)!important}#smartAlertsSection .smart-alert-analysis-note span{font-size:8.5px!important;line-height:1.55!important}
  #smartAlertsSection .smart-alert-stats{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin-bottom:10px!important}
  #smartAlertsSection .smart-alert-stats .stat-card{min-width:0!important;padding:9px 4px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#fff!important;text-align:center!important;box-shadow:none!important}
  #smartAlertsSection .smart-alert-stats span{display:block!important;font-size:7px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#smartAlertsSection .smart-alert-stats b{margin-top:4px!important;font-size:15px!important;color:var(--tp-navy)!important}
  #smartAlertsSection .smart-alert-filter-panel{padding:11px!important;margin-bottom:10px!important;border:1px solid var(--tp-line)!important;border-radius:15px!important;background:#fff!important;box-shadow:none!important}
  #smartAlertsSection .smart-alert-filter-row{display:grid!important;gap:6px!important}#smartAlertsSection .smart-alert-filter-row+ .smart-alert-filter-row{margin-top:9px!important}
  #smartAlertsSection .smart-alert-filter-row>span{font-size:8.5px!important;color:var(--tp-muted)!important}
  #smartAlertsSection .smart-alert-filter-chips{display:flex!important;gap:5px!important;margin:0!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none!important}
  #smartAlertsSection .smart-alert-filter-chips::-webkit-scrollbar{display:none}
  #smartAlertsSection .tenant-filter-chip{flex:0 0 auto!important;min-height:32px!important;padding:6px 9px!important;border:1px solid var(--tp-line)!important;border-radius:99px!important;background:#fff!important;color:var(--tp-muted)!important;font-size:8px!important}
  #smartAlertsSection .tenant-filter-chip.active{border-color:var(--tp-navy)!important;background:var(--tp-navy)!important;color:#fff!important}
  #smartAlertsSection .smart-alert-list{display:grid!important;gap:9px!important}
  #smartAlertsSection .smart-alert-card{padding:13px!important;border:1px solid var(--tp-line)!important;border-inline-start-width:4px!important;border-right-width:1px!important;border-radius:17px!important;background:#fff!important;box-shadow:none!important}
  #smartAlertsSection .smart-alert-person{gap:9px!important}#smartAlertsSection .smart-alert-avatar{width:38px!important;height:38px!important;min-width:38px!important;border-radius:50%!important;font-size:13px!important}
  #smartAlertsSection .smart-alert-badges{gap:4px!important}#smartAlertsSection .smart-alert-priority,#smartAlertsSection .smart-alert-type,#smartAlertsSection .smart-alert-state{padding:4px 6px!important;font-size:7px!important}
  #smartAlertsSection .smart-alert-person h3{margin:5px 0 2px!important;font-size:14px!important;color:var(--tp-ink)!important}#smartAlertsSection .smart-alert-person p{font-size:8px!important}
  #smartAlertsSection .smart-alert-reason{margin-top:9px!important;padding:10px!important;border:1px solid #EAF0F6!important;border-radius:12px!important;background:#F8FAFD!important}#smartAlertsSection .smart-alert-reason b{font-size:11px!important}#smartAlertsSection .smart-alert-reason p{font-size:9px!important;line-height:1.6!important}
  #smartAlertsSection .smart-alert-actions{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin-top:9px!important}
  #smartAlertsSection .smart-alert-actions .inline-btn{width:100%!important;min-height:36px!important;margin:0!important;padding:7px!important;border-radius:10px!important;font-size:8px!important}

  /* Reports. */
  #reportsSection .report-mode-switch{display:grid!important;grid-template-columns:1fr 1fr!important;gap:5px!important;margin-bottom:10px!important;padding:4px!important;border:1px solid var(--tp-line)!important;border-radius:14px!important;background:#EDF3F9!important}
  #reportsSection .report-mode-btn{min-height:40px!important;padding:8px!important;border:0!important;border-radius:10px!important;background:transparent!important;color:var(--tp-muted)!important;font-size:10px!important}
  #reportsSection .report-mode-btn.active{background:var(--tp-navy)!important;color:#fff!important;box-shadow:none!important}
  #reportsSection .report-controls-panel{padding:13px!important;margin-bottom:10px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #reportsSection .report-controls-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important}
  #reportsSection .report-controls-grid label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #reportsSection .report-controls-grid input,#reportsSection .report-controls-grid select{width:100%!important;height:42px!important;min-height:42px!important;margin-top:4px!important;padding:8px 10px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:11px!important}
  #reportsSection .report-actions-row{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;margin-top:10px!important}
  #reportsSection .report-actions-row .inline-btn{width:100%!important;min-height:40px!important;margin:0!important;padding:8px!important;border-radius:11px!important;font-size:9px!important}
  #reportsSection .report-actions-row .secondary-btn{background:#EDF5FC!important;color:var(--tp-navy)!important}#reportsSection .report-actions-row .primary-btn{background:var(--tp-navy)!important}
  #reportsSection .report-preview-wrap{margin-top:10px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;overflow:auto!important;box-shadow:var(--tp-shadow)!important}
}

@media(max-width:370px){
  #studentFinanceSection .section-head h2,#communicationSection .section-head h2,#smartAlertsSection .section-head h2,#reportsSection .section-head h2{font-size:22px!important}
  #communicationSection .communication-safe-note{display:none!important}
  #smartAlertsSection #runSmartAlertsBtn{min-width:82px!important;padding-inline:9px!important}
}

/* V1.26.2 — login viewport fill + exact row-menu anchoring support. */
body:has(#loginView:not(.hidden)){min-height:100dvh!important;background:#061E3B!important}
@media(max-width:900px){
  #loginView.login-shell:not(.hidden){width:100%!important;min-height:100dvh!important;height:auto!important;background-color:#061E3B!important}
  .row-more-popover.row-more-portal{right:auto!important;bottom:auto!important}
}

/* ==========================================================
   V1.27.0 PREVIEW — DAILY OPERATIONS / PHASE 2
   Groups, Schedule and Lesson Registration.
   ========================================================== */
@media(max-width:900px){
  /* Shared phase-two page heads. */
  #groupsSection .section-head,#scheduleSection .section-head,#lessonSection .section-head{align-items:flex-end!important;margin-bottom:15px!important}
  #groupsSection .section-head h2,#scheduleSection .section-head h2,#lessonSection .section-head h2{margin:0!important;font-size:26px!important;line-height:1.3!important;color:var(--tp-ink)!important}
  #groupsSection .section-head p,#scheduleSection .section-head p,#lessonSection .section-head p{margin:4px 0 0!important;font-size:11px!important;line-height:1.5!important}

  /* Groups. */
  #groupsSection #addGroupBtn{width:auto!important;min-width:126px!important;min-height:42px!important;margin:0!important;padding:10px 13px!important;border-radius:13px!important;background:var(--tp-navy)!important;box-shadow:none!important;font-size:11px!important;white-space:nowrap}
  #groupsSection #addGroupBtn span{color:var(--tp-gold);font-size:15px}
  #groupsSection .groups-master-grid{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  #groupsSection .master-group-card{padding:14px!important;border:1px solid var(--tp-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important;overflow:visible!important}
  #groupsSection .group-card-title-row{align-items:flex-start!important;gap:10px!important}
  #groupsSection .group-card-title-row h3{margin:0!important;font-size:16px!important;line-height:1.45!important;color:var(--tp-ink)!important}
  #groupsSection .group-card-title-row p{display:flex!important;align-items:center!important;gap:6px!important;margin:4px 0 0!important;font-size:10px!important}
  #groupsSection .group-id-chip{padding:3px 6px!important;border-radius:7px!important;background:#F2F5F9!important;color:var(--tp-muted)!important;font-size:9px!important}
  #groupsSection .status{padding:5px 8px!important;border-radius:99px!important;font-size:9px!important}
  #groupsSection .group-summary-strip{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;margin:12px 0!important;padding:9px 0!important;border:1px solid #EAF0F6!important;border-radius:13px!important;background:#F8FAFD!important}
  #groupsSection .group-summary-strip>div{min-width:0!important;padding:0 8px!important;text-align:center!important}
  #groupsSection .group-summary-strip span{display:block!important;font-size:8.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #groupsSection .group-summary-strip b{display:block!important;margin-top:4px!important;font-size:12px!important;color:var(--tp-navy)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #groupsSection .group-schedule-preview{min-height:0!important;padding:0!important}
  #groupsSection .group-schedule-preview>span{font-size:9px!important;color:var(--tp-muted)!important}
  #groupsSection .group-schedule-chips{margin-top:6px!important;gap:5px!important}
  #groupsSection .group-schedule-chips b,#groupsSection .group-schedule-chips em{padding:5px 7px!important;border-radius:8px!important;background:#F1F5F9!important;color:#42566F!important;font-size:8.5px!important}
  #groupsSection .master-group-actions{display:grid!important;grid-template-columns:42px minmax(0,1fr)!important;gap:8px!important;margin-top:11px!important;padding-top:11px!important;border-top:1px solid #EEF2F6!important;direction:ltr}
  #groupsSection .master-group-actions .row-more-menu{grid-column:1!important;grid-row:1!important}
  #groupsSection .master-group-actions .row-more-trigger{width:42px!important;height:40px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#fff!important;color:var(--tp-navy)!important;font-size:22px!important}
  #groupsSection .master-group-actions .group-lesson-btn{grid-column:2!important;grid-row:1!important;width:100%!important;min-height:40px!important;margin:0!important;border-radius:12px!important;background:var(--tp-navy)!important;font-size:10px!important;direction:rtl}

  /* Schedule. */
  #scheduleSection .schedule-page-head .icon-action-btn{position:relative!important;width:40px!important;height:40px!important;min-width:40px!important;padding:0!important;border:1px solid var(--tp-line)!important;border-radius:13px!important;background:#fff!important;color:var(--tp-navy)!important;font-size:21px!important;box-shadow:none!important}
  #scheduleSection .schedule-page-head .icon-action-btn::before,#scheduleSection .schedule-page-head .icon-action-btn::after{display:none!important;content:none!important}
  #scheduleSection .schedule-summary-grid{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:7px!important;margin:0 0 13px!important}
  #scheduleSection .schedule-summary-grid .stat-card{min-width:0!important;padding:10px 5px!important;border:1px solid var(--tp-line)!important;border-radius:13px!important;background:#fff!important;text-align:center!important;box-shadow:none!important}
  #scheduleSection .schedule-summary-grid .stat-card:nth-child(4){display:none!important}
  #scheduleSection .schedule-summary-grid .stat-card span{display:block!important;font-size:8px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #scheduleSection .schedule-summary-grid .stat-card b{margin-top:4px!important;font-size:16px!important;color:var(--tp-navy)!important}
  #scheduleSection .mobile-schedule-browser{display:block!important}
  #scheduleSection .schedule-day-selector{display:flex!important;gap:7px!important;margin-inline:-1px!important;padding:1px 1px 9px!important;direction:rtl!important}
  #scheduleSection .schedule-day-chip{flex:0 0 58px!important;min-height:62px!important;padding:7px 4px!important;border:1px solid var(--tp-line)!important;border-radius:14px!important;background:#fff!important;color:var(--tp-muted)!important;box-shadow:none!important}
  #scheduleSection .schedule-day-chip span{font-size:9px!important}#scheduleSection .schedule-day-chip b{font-size:16px!important;color:var(--tp-navy)!important}
  #scheduleSection .schedule-day-chip.active{border-color:#E2C45D!important;background:var(--tp-gold)!important;color:var(--tp-navy)!important}
  #scheduleSection .schedule-day-chip.active b{color:var(--tp-navy)!important}
  #scheduleSection .schedule-mobile-timeline{padding:14px!important;border:1px solid var(--tp-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #scheduleSection .schedule-mobile-date{display:flex!important;align-items:center!important;justify-content:space-between!important;margin-bottom:10px!important;padding:0 2px!important}
  #scheduleSection .schedule-mobile-date b{font-size:18px!important;color:var(--tp-ink)!important}#scheduleSection .schedule-mobile-date span{font-size:9px!important;color:var(--tp-muted)!important}
  #scheduleSection .schedule-timeline-list{display:grid!important;gap:8px!important;padding:0!important;border:0!important}
  #scheduleSection .schedule-timeline-list .schedule-session-card{display:grid!important;grid-template-columns:62px minmax(0,1fr)!important;gap:3px 10px!important;padding:12px!important;border:1px solid var(--tp-line)!important;border-radius:15px!important;background:#fff!important;box-shadow:none!important}
  #scheduleSection .schedule-timeline-list .schedule-session-card::before{display:none!important}
  #scheduleSection .schedule-session-time{grid-column:1!important;grid-row:1!important;text-align:right!important}
  #scheduleSection .schedule-session-time b{font-size:13px!important;color:var(--tp-navy)!important}#scheduleSection .schedule-session-time span{font-size:9px!important}
  #scheduleSection .schedule-session-main{grid-column:2!important;grid-row:1!important;min-width:0!important}
  #scheduleSection .schedule-session-title{display:flex!important;align-items:center!important;gap:6px!important;min-width:0!important}
  #scheduleSection .schedule-session-title h4{margin:0!important;min-width:0!important;font-size:13px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #scheduleSection .schedule-session-status{flex:none!important;padding:4px 6px!important;font-size:7.5px!important}
  #scheduleSection .schedule-session-main p{margin:3px 0 0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #scheduleSection .schedule-lesson-btn{grid-column:1/-1!important;grid-row:2!important;width:100%!important;min-height:36px!important;margin-top:7px!important;border:1px solid #EEDB9B!important;border-radius:11px!important;background:#FFF9E8!important;color:var(--tp-navy)!important;font-size:10px!important;font-weight:800!important}
  #scheduleSection .schedule-today-panel,#scheduleSection .mobile-schedule-browser~.panel{display:none!important}

  /* Lesson registration. */
  #lessonSection .lesson-stepper{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:0!important;margin:0 0 14px!important}
  #lessonSection .lesson-step{position:relative!important;display:flex!important;flex-direction:column!important;align-items:center!important;gap:5px!important;color:#8996A7!important;text-align:center!important}
  #lessonSection .lesson-step:not(:last-child)::after{content:""!important;position:absolute!important;top:14px!important;right:calc(50% + 15px)!important;width:calc(100% - 30px)!important;height:2px!important;background:#E0E6EE!important;z-index:0!important}
  #lessonSection .lesson-step span{position:relative!important;z-index:1!important;width:29px!important;height:29px!important;border:1px solid #DDE5EE!important;border-radius:50%!important;background:#F4F7FA!important;color:#7B899B!important;font-size:10px!important}
  #lessonSection .lesson-step b{font-size:8.5px!important;white-space:nowrap!important}
  #lessonSection .lesson-step.active{color:var(--tp-navy)!important}#lessonSection .lesson-step.active span{border-color:#E2C45D!important;background:var(--tp-gold)!important;color:var(--tp-navy)!important}
  #lessonSection .lesson-step.complete{color:var(--tp-success)!important}#lessonSection .lesson-step.complete span{border-color:#BFE5D6!important;background:#EAF8F2!important;color:var(--tp-success)!important}#lessonSection .lesson-step.complete span::after{content:"✓";position:absolute;inset:0;display:grid;place-items:center;background:inherit;border-radius:50%;font-size:11px}
  #lessonSection .lesson-step.complete::after{background:#BFE5D6!important}
  #lessonSection .lesson-setup-panel{padding:14px!important;margin-bottom:14px!important;border:1px solid var(--tp-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #lessonSection .lesson-setup-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #lessonSection .lesson-setup-grid label{min-width:0!important;margin:0!important;font-size:10px!important;color:var(--tp-muted)!important}
  #lessonSection .lesson-setup-grid label:first-child,#lessonSection .lesson-title-field{grid-column:1/-1!important}
  #lessonSection .lesson-setup-grid input,#lessonSection .lesson-setup-grid select{width:100%!important;height:44px!important;min-height:44px!important;margin-top:5px!important;padding:9px 11px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#FBFCFE!important;font-size:12px!important}
  #lessonSection .lesson-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:8px!important;margin-top:12px!important;padding-top:11px!important;border-top:1px solid #EEF2F6!important}
  #lessonSection .lesson-id-preview{min-height:0!important;font-size:8.5px!important;color:#8996A7!important;text-align:right!important;direction:ltr!important;overflow-wrap:anywhere}
  #lessonSection .lesson-continue-btn{width:100%!important;min-height:42px!important;margin:0!important;border-radius:12px!important;background:var(--tp-navy)!important;font-size:11px!important}
  #lessonSection .lesson-roster-head{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;margin:4px 1px 9px!important}
  #lessonSection .lesson-roster-head h3{margin:0!important;font-size:18px!important;color:var(--tp-ink)!important}#lessonSection .lesson-roster-head p{margin:2px 0 0!important;font-size:9px!important}
  #lessonSection .lesson-roster-head>span{padding:6px 9px!important;border-radius:99px!important;background:#EDF4FC!important;color:var(--tp-navy)!important;font-size:9px!important}
  #lessonSection .lesson-default-note{padding:10px 11px!important;margin-bottom:9px!important;border:1px solid #EEDB9B!important;border-radius:13px!important;background:#FFF9E8!important;color:#725515!important;font-size:9.5px!important;line-height:1.65!important}
  #lessonSection .lesson-roster{display:grid!important;gap:9px!important}
  #lessonSection .lesson-student-card{padding:13px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:none!important}
  #lessonSection .lesson-student-card.student-absent-card{border-color:#F0CDD2!important;background:#FFFAFA!important}
  #lessonSection .lesson-student-head{margin-bottom:9px!important}
  #lessonSection .lesson-student-head b{font-size:14px!important;color:var(--tp-ink)!important}#lessonSection .lesson-student-head span{font-size:9px!important}
  #lessonSection .lesson-fields-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  #lessonSection .lesson-fields-grid label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #lessonSection .lesson-field{width:100%!important;height:40px!important;min-height:40px!important;margin-top:4px!important;padding:7px 8px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:11px!important}
  #lessonSection .absent-auto-note{margin-top:9px!important;padding:8px 9px!important;border-radius:10px!important;font-size:8.5px!important;line-height:1.5!important}
  #lessonSection .lesson-save-bar{position:sticky!important;bottom:calc(64px + env(safe-area-inset-bottom))!important;z-index:20!important;margin-top:11px!important;padding:9px 10px!important;border:1px solid var(--tp-line)!important;border-radius:15px!important;background:rgba(255,255,255,.96)!important;box-shadow:0 10px 30px rgba(8,45,87,.12)!important;backdrop-filter:blur(12px)!important}
  #lessonSection .lesson-save-bar>div{font-size:10px!important;white-space:nowrap}#lessonSection .lesson-save-bar .primary-btn{min-height:40px!important;margin:0!important;border-radius:11px!important;background:var(--tp-navy)!important;font-size:10px!important}
}

@media(max-width:370px){
  #groupsSection .section-head h2,#scheduleSection .section-head h2,#lessonSection .section-head h2{font-size:23px!important}
  #groupsSection #addGroupBtn{min-width:112px!important;padding-inline:10px!important;font-size:10px!important}
  #scheduleSection .schedule-day-chip{flex-basis:54px!important}
  #lessonSection .lesson-step b{font-size:8px!important}
}

/* ==========================================================
   V1.28.1 PREVIEW — PHASE 3 POLISH / REAL-DEVICE FIXES
   ========================================================== */
@media(max-width:900px){
  /* Finance: show every filter without a cropped trailing chip. */
  #studentFinanceSection .student-finance-filter-bar{
    display:grid!important;
    grid-template-columns:repeat(3,minmax(0,1fr))!important;
    gap:6px!important;
    margin:10px 0 0!important;
    padding:0!important;
    overflow:visible!important;
  }
  #studentFinanceSection .student-finance-filter-bar .tenant-filter-chip{
    width:100%!important;min-width:0!important;min-height:34px!important;padding:6px 4px!important;
    overflow:hidden!important;text-overflow:ellipsis!important;font-size:8px!important
  }
  #studentFinanceSection .student-finance-filter-bar .tenant-filter-chip:nth-child(4){grid-column:1/2!important}
  #studentFinanceSection .student-finance-filter-bar .tenant-filter-chip:nth-child(5){grid-column:2/4!important}
  #studentFinanceSection .student-finance-card{border-inline-start-width:1px!important;border-inline-end:4px solid #DDE6F0!important}
  #studentFinanceSection .student-finance-card.paid{border-inline-end-color:#9EDBC5!important}
  #studentFinanceSection .student-finance-card.partial{border-inline-end-color:#E9C85B!important}
  #studentFinanceSection .student-finance-card.unpaid{border-inline-end-color:#E7A8AF!important}
  #studentFinanceSection .student-finance-remaining b,
  #studentFinanceSection .student-finance-numbers b,
  #studentFinanceSection .student-finance-stats b{direction:rtl!important;unicode-bidi:isolate!important;white-space:nowrap!important}

  /* Communication: predictable select text and clean message preview. */
  #communicationSection #communicationStudent{font-size:10px!important;text-overflow:ellipsis!important;white-space:nowrap!important;overflow:hidden!important}
  #communicationSection .communication-identity-main b{overflow:hidden!important;text-overflow:ellipsis!important;white-space:nowrap!important}
  #communicationSection .communication-phone-box b{direction:ltr!important;unicode-bidi:isolate!important;text-align:right!important}
  #communicationSection .communication-panel-head .eyebrow{color:#9B7417!important;letter-spacing:0!important}
  #communicationSection .communication-message{
    min-height:190px!important;height:190px!important;resize:none!important;overflow:auto!important;
    direction:rtl!important;text-align:right!important;white-space:pre-wrap!important;overflow-wrap:anywhere!important;
    caret-color:var(--tp-navy)!important
  }
  #communicationSection .communication-message::-webkit-resizer{display:none!important}
  #communicationSection .communication-actions{align-items:stretch!important}

  /* Reports: the main action must read as the next step. */
  #reportsSection #loadStudentReportBtn,#reportsSection #loadGroupReportBtn{
    background:var(--tp-navy)!important;border-color:var(--tp-navy)!important;color:#fff!important;
    font-weight:800!important;box-shadow:none!important
  }
  #reportsSection .report-controls-grid select,#reportsSection .report-controls-grid input{min-width:0!important}
  #reportsSection .report-mode-btn{white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
}

@media(max-width:370px){
  #studentFinanceSection .student-finance-filter-bar{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  #studentFinanceSection .student-finance-filter-bar .tenant-filter-chip:nth-child(4){grid-column:auto!important}
  #studentFinanceSection .student-finance-filter-bar .tenant-filter-chip:nth-child(5){grid-column:1/-1!important}
  #communicationSection .communication-template{min-height:64px!important;padding:9px!important}
  #communicationSection .communication-template b{font-size:11px!important}
  #reportsSection .report-mode-btn{font-size:9px!important}
}

/* ==========================================================
   V1.29.0 PREVIEW — ACADEMIC GROWTH & ACCOUNT / PHASE 4
   Monthly Exam, Parent Cards, Leaderboard and Account.
   ========================================================== */
@media(max-width:900px){
  /* Shared phase-four heads. */
  #examSection .section-head,#cardsSection .section-head,#leaderboardSection .section-head,#accountSection .section-head{align-items:flex-end!important;margin-bottom:15px!important}
  #examSection .section-head h2,#cardsSection .section-head h2,#leaderboardSection .section-head h2,#accountSection .section-head h2{margin:0!important;font-size:25px!important;line-height:1.3!important;color:var(--tp-ink)!important}
  #examSection .section-head p,#cardsSection .section-head p,#leaderboardSection .section-head p,#accountSection .section-head p{margin:4px 0 0!important;font-size:10px!important;line-height:1.55!important}

  /* Monthly exam. */
  #examSection .exam-setup-panel{padding:14px!important;margin-bottom:12px!important;border:1px solid var(--tp-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #examSection .exam-setup-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important}
  #examSection .exam-setup-grid label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #examSection .exam-setup-grid input,#examSection .exam-setup-grid select{width:100%!important;height:44px!important;min-height:44px!important;margin-top:5px!important;padding:9px 10px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#FBFCFE!important;font-size:11px!important}
  #examSection .lesson-toolbar{display:grid!important;grid-template-columns:1fr!important;gap:7px!important;margin-top:11px!important;padding-top:11px!important;border-top:1px solid #EEF2F6!important}
  #examSection #loadExamRosterBtn{width:100%!important;min-height:42px!important;margin:0!important;border-radius:12px!important;background:var(--tp-navy)!important;border-color:var(--tp-navy)!important;color:#fff!important;font-size:10px!important}
  #examSection .lesson-id-preview{font-size:8px!important;text-align:center!important;direction:ltr!important;overflow-wrap:anywhere!important}
  #examSection .lesson-default-note{padding:10px 11px!important;margin-bottom:9px!important;border:1px solid #EEDB9B!important;border-radius:13px!important;background:#FFF9E8!important;color:#725515!important;font-size:9px!important;line-height:1.6!important}
  #examSection .exam-roster{display:grid!important;gap:9px!important}
  #examSection .exam-student-card{padding:13px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:none!important}
  #examSection .exam-student-head{margin-bottom:9px!important;align-items:flex-start!important}
  #examSection .exam-student-head b{font-size:14px!important;color:var(--tp-ink)!important}#examSection .exam-student-head span{font-size:8.5px!important}
  #examSection .exam-student-fields{display:grid!important;grid-template-columns:92px minmax(0,1fr)!important;gap:8px!important}
  #examSection .exam-student-fields label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #examSection .score-input-wrap{gap:5px!important}#examSection .score-input-wrap input{height:40px!important;min-height:40px!important;margin-top:4px!important;padding:7px!important;border-radius:11px!important;text-align:center!important;font-size:12px!important}#examSection .score-input-wrap span{margin-top:4px!important;font-size:9px!important}
  #examSection .exam-note{height:40px!important;min-height:40px!important;margin-top:4px!important;padding:8px!important;border-radius:11px!important;resize:none!important;font-size:10px!important;line-height:1.45!important}
  #examSection .lesson-save-bar{position:sticky!important;bottom:calc(64px + env(safe-area-inset-bottom))!important;z-index:20!important;margin-top:11px!important;padding:9px 10px!important;border:1px solid var(--tp-line)!important;border-radius:15px!important;background:rgba(255,255,255,.96)!important;box-shadow:0 10px 30px rgba(8,45,87,.12)!important;backdrop-filter:blur(12px)!important}
  #examSection .lesson-save-bar .primary-btn{min-height:40px!important;margin:0!important;border-radius:11px!important;background:var(--tp-navy)!important;font-size:10px!important}

  /* Parent follow-up cards. */
  #cardsSection .cards-toolbar-panel{padding:14px!important;margin-bottom:12px!important;border:1px solid var(--tp-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #cardsSection .cards-toolbar-grid{display:grid!important;grid-template-columns:1fr!important;gap:9px!important}
  #cardsSection .cards-toolbar-grid label{margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #cardsSection .cards-toolbar-grid select{width:100%!important;height:44px!important;min-height:44px!important;margin-top:5px!important;padding:9px 10px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#FBFCFE!important;font-size:11px!important}
  #cardsSection .cards-link-box{padding:10px 11px!important;border:1px solid #DCE8F4!important;border-radius:12px!important;background:#F4F8FC!important}
  #cardsSection .cards-link-box span{margin-bottom:4px!important;font-size:8.5px!important}#cardsSection .cards-link-box code{font-size:8.5px!important;line-height:1.5!important;color:var(--tp-navy)!important}
  #cardsSection .cards-toolbar-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:7px!important;margin-top:10px!important}
  #cardsSection .cards-toolbar-actions .inline-btn{width:100%!important;min-height:40px!important;margin:0!important;padding:8px!important;border-radius:11px!important;font-size:9px!important}
  #cardsSection #generateGroupCardsBtn{background:var(--tp-navy)!important;border-color:var(--tp-navy)!important;color:#fff!important}
  #cardsSection .parent-cards-grid{display:grid!important;grid-template-columns:1fr!important;gap:10px!important}
  #cardsSection .paper-parent-card{border:1px solid var(--tp-line)!important;border-radius:18px!important;box-shadow:var(--tp-shadow)!important}
  #cardsSection .paper-card-top{padding:11px 12px!important;background:linear-gradient(110deg,var(--tp-navy),var(--tp-navy-2))!important}
  #cardsSection .paper-card-mark{width:39px!important;min-width:39px!important;height:39px!important;border-radius:11px!important;font-size:13px!important}#cardsSection .paper-card-brand strong{font-size:13px!important}#cardsSection .paper-card-brand small{font-size:8px!important}#cardsSection .paper-card-label{font-size:9px!important}
  #cardsSection .paper-card-body{grid-template-columns:minmax(0,1fr) 104px!important;gap:9px!important;padding:12px!important}
  #cardsSection .paper-card-info h3{margin:0 0 8px!important;font-size:15px!important}#cardsSection .paper-card-meta{gap:5px!important}#cardsSection .paper-card-meta>div,#cardsSection .paper-card-login-row{padding:7px!important;border-radius:9px!important}#cardsSection .paper-card-meta span,#cardsSection .paper-card-login-row span{font-size:7.5px!important}#cardsSection .paper-card-meta b,#cardsSection .paper-card-login-row b{font-size:9px!important}
  #cardsSection .paper-card-qr img{width:92px!important;height:92px!important;margin-bottom:3px!important;border-width:5px!important}#cardsSection .paper-card-qr b{font-size:9px!important}#cardsSection .paper-card-qr span{font-size:7px!important}
  #cardsSection .paper-card-footer{padding:7px 10px!important;font-size:7px!important}#cardsSection .paper-card-footer code{font-size:6.5px!important}

  /* Leaderboard and rewards. */
  #leaderboardSection .section-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:9px!important}
  #leaderboardSection .leaderboard-head-actions{display:grid!important;grid-template-columns:1fr!important;gap:6px!important;width:105px!important}
  #leaderboardSection .leaderboard-head-actions .compact{width:100%!important;min-height:36px!important;margin:0!important;padding:7px 8px!important;border-radius:10px!important;font-size:8.5px!important}
  #leaderboardSection #runLeaderboardBtn{background:var(--tp-navy)!important}
  #leaderboardSection .leaderboard-controls-panel{padding:13px!important;margin-bottom:10px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #leaderboardSection .leaderboard-controls{display:grid!important;grid-template-columns:1fr 1fr!important;gap:9px!important}
  #leaderboardSection .leaderboard-controls label{min-width:0!important;margin:0!important;font-size:9px!important;color:var(--tp-muted)!important}
  #leaderboardSection .leaderboard-controls input,#leaderboardSection .leaderboard-controls select{width:100%!important;height:42px!important;min-height:42px!important;margin-top:4px!important;padding:8px 9px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:10px!important}
  #leaderboardSection .leaderboard-note{margin-top:9px!important;padding:10px!important;border:1px solid #DCE8F4!important;border-radius:12px!important;background:#F4F8FC!important}#leaderboardSection .leaderboard-note b{font-size:11px!important}#leaderboardSection .leaderboard-note span{font-size:8px!important;line-height:1.55!important}
  #leaderboardSection .leaderboard-config-summary{margin:9px 0!important}#leaderboardSection .leaderboard-config-chips{display:flex!important;gap:5px!important;overflow-x:auto!important;flex-wrap:nowrap!important;scrollbar-width:none!important}#leaderboardSection .leaderboard-config-chips::-webkit-scrollbar{display:none}#leaderboardSection .leaderboard-config-chips span{flex:0 0 auto!important;padding:5px 7px!important;font-size:7.5px!important}
  #leaderboardSection .leaderboard-stats{display:grid!important;grid-template-columns:repeat(4,minmax(0,1fr))!important;gap:6px!important;margin-bottom:10px!important}
  #leaderboardSection .leaderboard-stats .stat-card{min-width:0!important;padding:9px 4px!important;border:1px solid var(--tp-line)!important;border-radius:12px!important;background:#fff!important;text-align:center!important;box-shadow:none!important}#leaderboardSection .leaderboard-stats span{display:block!important;font-size:7px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#leaderboardSection .leaderboard-stats b{margin-top:4px!important;font-size:14px!important;color:var(--tp-navy)!important}
  #leaderboardSection .leaderboard-podium{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin:10px 0!important}
  #leaderboardSection .leaderboard-winner{min-width:0!important;padding:11px 5px!important;border-radius:14px!important;box-shadow:none!important}#leaderboardSection .leaderboard-medal{font-size:23px!important}#leaderboardSection .leaderboard-winner>span{font-size:7px!important}#leaderboardSection .leaderboard-winner h3{margin:4px 0!important;font-size:10.5px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#leaderboardSection .leaderboard-winner>b{font-size:12px!important}#leaderboardSection .leaderboard-winner>small{min-height:22px!important;margin:2px 0 6px!important;font-size:6.5px!important;line-height:1.35!important}#leaderboardSection .leaderboard-winner .inline-btn{width:100%!important;min-height:31px!important;margin:0!important;padding:5px 2px!important;border-radius:9px!important;font-size:7px!important}
  #leaderboardSection .leaderboard-table-panel{padding:13px!important;border:1px solid var(--tp-line)!important;border-radius:17px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}#leaderboardSection .leaderboard-table-head{margin-bottom:8px!important}#leaderboardSection .leaderboard-table-head h3{margin:2px 0 0!important;font-size:17px!important}#leaderboardSection #printLeaderboardBtn{width:auto!important;min-height:34px!important;margin:0!important;padding:6px 8px!important;font-size:8px!important}
  #leaderboardSection .table-wrap{border:1px solid #EEF2F6!important;border-radius:12px!important;overflow:auto!important}#leaderboardSection .leaderboard-data-table{min-width:760px!important}#leaderboardSection .leaderboard-data-table th,#leaderboardSection .leaderboard-data-table td{padding:8px 7px!important;font-size:8px!important}

  /* Account, subscription and receipts. */
  #accountSection .account-summary-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;margin-bottom:11px!important}
  #accountSection .account-summary-card{min-width:0!important;padding:11px!important;border:1px solid var(--tp-line)!important;border-radius:14px!important;background:#fff!important;box-shadow:none!important}#accountSection .account-summary-card span{margin-bottom:4px!important;font-size:8.5px!important}#accountSection .account-summary-card b{font-size:14px!important;color:var(--tp-navy)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #accountSection .teacher-renewal-panel,#accountSection .teacher-payments-panel,#accountSection .account-panel{padding:14px!important;margin-bottom:11px!important;border:1px solid var(--tp-line)!important;border-radius:18px!important;background:#fff!important;box-shadow:var(--tp-shadow)!important}
  #accountSection .teacher-renewal-panel{border-top:1px solid var(--tp-line)!important;border-inline-end:4px solid var(--tp-gold)!important}
  #accountSection .teacher-renewal-head{display:flex!important;gap:9px!important;margin-bottom:10px!important}#accountSection .teacher-renewal-head h3{margin:2px 0 3px!important;font-size:18px!important}#accountSection .teacher-renewal-head p{font-size:8.5px!important;line-height:1.5!important}#accountSection .renewal-expiry-pill{padding:6px 8px!important;font-size:8px!important}
  #accountSection .renewal-plan-strip{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin-bottom:10px!important}#accountSection .renewal-plan-strip>div{min-width:0!important;padding:8px 5px!important;border-radius:10px!important;text-align:center!important}#accountSection .renewal-plan-strip span{margin-bottom:3px!important;font-size:7px!important}#accountSection .renewal-plan-strip b{font-size:9px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #accountSection .renewal-current-request{padding:10px!important;margin:9px 0!important;border-radius:12px!important}#accountSection .renewal-current-request b{font-size:10px!important}#accountSection .renewal-current-request small,#accountSection .renewal-current-request p{font-size:8px!important}
  #accountSection #openTeacherRenewalRequestBtn{min-height:40px!important;margin-top:8px!important;border-radius:11px!important;background:var(--tp-navy)!important;font-size:10px!important}
  #accountSection .teacher-payments-panel{border-top:1px solid var(--tp-line)!important}
  #accountSection .teacher-payments-head{display:flex!important;gap:9px!important;margin-bottom:10px!important}#accountSection .teacher-payments-head h3{margin:2px 0 3px!important;font-size:18px!important}#accountSection .teacher-payments-head p{font-size:8px!important}#accountSection #refreshTeacherPaymentsBtn{min-width:68px!important;min-height:34px!important;padding:6px 8px!important;border-radius:10px!important;font-size:8px!important}
  #accountSection .teacher-payments-summary{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;margin-bottom:10px!important}#accountSection .teacher-payments-summary>div{min-width:0!important;padding:8px 5px!important;border-radius:10px!important;text-align:center!important}#accountSection .teacher-payments-summary span{margin-bottom:3px!important;font-size:6.8px!important}#accountSection .teacher-payments-summary b{font-size:11px!important;white-space:nowrap!important}
  #accountSection .teacher-payments-list{gap:8px!important}#accountSection .teacher-payment-item{padding:11px!important;border-radius:14px!important}#accountSection .teacher-payment-main b{font-size:10px!important}#accountSection .teacher-payment-main strong{font-size:14px!important}#accountSection .teacher-payment-main small,#accountSection .payment-receipt-number{font-size:7.5px!important}#accountSection .teacher-payment-meta{grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:5px!important;margin:8px 0!important}#accountSection .teacher-payment-meta>span{min-width:0!important;padding:6px!important;border-radius:8px!important;font-size:7px!important}#accountSection .teacher-payment-meta b{font-size:8px!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}#accountSection .payment-receipt-btn{min-height:36px!important;margin:0!important;padding:7px!important;border-radius:10px!important;font-size:8px!important}
  #accountSection .account-layout{display:grid!important;grid-template-columns:1fr!important;gap:0!important}
  #accountSection .account-panel-head{margin-bottom:10px!important}#accountSection .account-panel-head h3{margin:0 0 3px!important;font-size:18px!important}#accountSection .account-panel-head p{font-size:8.5px!important;line-height:1.5!important}
  #accountSection .account-panel label{margin-top:10px!important;font-size:9px!important;color:var(--tp-muted)!important}#accountSection .account-panel input{height:42px!important;min-height:42px!important;margin-top:4px!important;padding:8px 10px!important;border:1px solid var(--tp-line)!important;border-radius:11px!important;background:#FBFCFE!important;font-size:11px!important}#accountSection .account-panel .field-help{font-size:7.5px!important}
  #accountSection .signup-form-grid{display:grid!important;grid-template-columns:1fr 1fr!important;gap:8px!important}#accountSection .account-readonly-note,#accountSection .account-security-tip{padding:9px 10px!important;margin:10px 0!important;border-radius:11px!important;font-size:8.5px!important;line-height:1.6!important}#accountSection .account-password-rules{padding:9px!important;margin-top:10px!important;border-radius:11px!important}#accountSection .account-password-rules b,#accountSection .account-password-rules span{font-size:8px!important}#accountSection #saveTeacherProfileBtn,#accountSection #changeTeacherPasswordBtn{min-height:42px!important;margin-top:12px!important;border-radius:11px!important;background:var(--tp-navy)!important;font-size:10px!important}
}

@media(max-width:370px){
  #examSection .section-head h2,#cardsSection .section-head h2,#leaderboardSection .section-head h2,#accountSection .section-head h2{font-size:22px!important}
  #examSection .exam-student-fields{grid-template-columns:82px minmax(0,1fr)!important}
  #cardsSection .paper-card-body{grid-template-columns:minmax(0,1fr) 94px!important}
  #cardsSection .paper-card-qr img{width:82px!important;height:82px!important}
  #leaderboardSection .leaderboard-head-actions{width:94px!important}
  #accountSection .signup-form-grid{grid-template-columns:1fr!important}
}

/* ==========================================================
   V1.29.1 PREVIEW — COMPACT MOBILE LEADERBOARD CARDS
   ========================================================== */
@media(max-width:900px){
  #leaderboardSection .leaderboard-table-panel{overflow:visible!important}
  #leaderboardSection .leaderboard-table-panel .table-wrap{border:0!important;border-radius:0!important;overflow:visible!important}
  #leaderboardSection .leaderboard-data-table{display:block!important;width:100%!important;min-width:0!important;border:0!important}
  #leaderboardSection .leaderboard-data-table thead{display:none!important}
  #leaderboardSection .leaderboard-data-table tbody{display:grid!important;width:100%!important;gap:9px!important}
  #leaderboardSection .leaderboard-data-table tr{
    display:grid!important;grid-template-columns:46px minmax(0,1fr) minmax(74px,.72fr) minmax(74px,.72fr)!important;
    gap:6px!important;width:100%!important;padding:10px!important;border:1px solid var(--tp-line)!important;
    border-radius:15px!important;background:#fff!important;box-shadow:none!important;overflow:hidden!important
  }
  #leaderboardSection .leaderboard-data-table td{
    display:block!important;width:auto!important;min-width:0!important;min-height:0!important;margin:0!important;
    padding:7px 8px!important;border:1px solid #EAF0F6!important;border-radius:10px!important;
    background:#F8FAFD!important;color:var(--tp-ink)!important;font-size:9px!important;text-align:right!important
  }
  #leaderboardSection .leaderboard-data-table td::before{
    content:attr(data-label)!important;display:block!important;margin:0 0 3px!important;color:#8793A4!important;
    font-size:6.8px!important;font-weight:750!important;text-align:right!important;line-height:1.2!important
  }
  #leaderboardSection .leaderboard-data-table td>b{display:block!important;font-size:11px!important;color:var(--tp-navy)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  #leaderboardSection .leaderboard-data-table td>small{display:block!important;margin-top:2px!important;font-size:6.8px!important;color:var(--tp-muted)!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

  #leaderboardSection .leaderboard-data-table td[data-label="المركز"]{
    grid-column:1!important;grid-row:1!important;display:grid!important;place-items:center!important;padding:5px!important;
    background:#FFF9E7!important;border-color:#EEDB9B!important;text-align:center!important
  }
  #leaderboardSection .leaderboard-data-table td[data-label="المركز"]::before{display:none!important}
  #leaderboardSection .leaderboard-rank-cell{font-size:20px!important;line-height:1!important;text-align:center!important}
  #leaderboardSection .leaderboard-data-table td[data-label="الطالب"]{grid-column:2/4!important;grid-row:1!important;background:#fff!important}
  #leaderboardSection .leaderboard-data-table td[data-label="الطالب"]::before{display:none!important}
  #leaderboardSection .leaderboard-data-table td[data-label="الطالب"]>b{font-size:12px!important}
  #leaderboardSection .leaderboard-data-table td[data-label="النقاط"]{grid-column:4!important;grid-row:1!important;background:#EDF5FC!important;border-color:#D5E5F3!important}
  #leaderboardSection .leaderboard-data-table td[data-label="النقاط"]>b{font-size:13px!important}

  #leaderboardSection .leaderboard-data-table td[data-label="الأداء"],
  #leaderboardSection .leaderboard-data-table td[data-label="الحضور"],
  #leaderboardSection .leaderboard-data-table td[data-label="الواجب"],
  #leaderboardSection .leaderboard-data-table td[data-label="التسميع"]{grid-column:span 1!important}
  #leaderboardSection .leaderboard-data-table td[data-label="المشاركة"]{grid-column:1/3!important}
  #leaderboardSection .leaderboard-data-table td[data-label="الامتحان"]{grid-column:3/5!important}
  #leaderboardSection .leaderboard-data-table td[data-label="الأداء"]>b{color:var(--tp-success)!important}

  #leaderboardSection .leaderboard-data-table td[data-label="الشهادة"]{
    grid-column:1/-1!important;padding:0!important;border:0!important;background:transparent!important
  }
  #leaderboardSection .leaderboard-data-table td[data-label="الشهادة"]::before{display:none!important}
  #leaderboardSection .certificate-action-btn{
    display:block!important;width:100%!important;min-height:36px!important;margin:0!important;padding:7px 10px!important;
    border:1px solid #D5E2F0!important;border-radius:10px!important;background:#EDF5FC!important;color:var(--tp-navy)!important;
    font-size:8.5px!important;font-weight:850!important;line-height:1.2!important;text-align:center!important;opacity:1!important
  }
  #leaderboardSection .leaderboard-data-table tr:first-child{border-color:#E8D17C!important;box-shadow:inset 3px 0 0 var(--tp-gold)!important}
}

@media(max-width:370px){
  #leaderboardSection .leaderboard-data-table tr{grid-template-columns:42px minmax(0,1fr) minmax(66px,.7fr) minmax(66px,.7fr)!important;padding:8px!important;gap:5px!important}
  #leaderboardSection .leaderboard-data-table td{padding:6px!important;font-size:8.5px!important}
}

/* V1.29.2 — rank, empty state and dual certificate actions. */
@media(max-width:900px){
  #leaderboardSection .leaderboard-rank-cell{
    display:grid!important;place-items:center!important;gap:1px!important;width:100%!important;overflow:visible!important;
    color:var(--tp-navy)!important;font-size:17px!important;font-family:Arial,Tahoma,sans-serif!important;line-height:1!important
  }
  #leaderboardSection .leaderboard-rank-cell span{display:block!important;color:#9A7418!important;font-size:6px!important;font-family:"Cairo",Tahoma,Arial,sans-serif!important}
  #leaderboardSection .leaderboard-empty-row{
    display:block!important;width:100%!important;padding:0!important;border:0!important;background:transparent!important;box-shadow:none!important
  }
  #leaderboardSection .leaderboard-empty-row td{
    display:block!important;width:100%!important;min-height:112px!important;padding:28px 18px!important;border:1px dashed #CDD7E4!important;
    border-radius:15px!important;background:#FBFCFE!important;color:var(--tp-muted)!important;text-align:center!important;font-size:11px!important;line-height:1.8!important
  }
  #leaderboardSection .leaderboard-empty-row td::before{display:none!important}
  #leaderboardSection .leaderboard-certificate-actions,#leaderboardSection .leaderboard-winner-actions{display:grid!important;grid-template-columns:1fr 1fr!important;gap:6px!important;width:100%!important}
  #leaderboardSection .leaderboard-winner-actions .inline-btn{width:100%!important;min-width:0!important}
  #leaderboardSection .leaderboard-certificate-actions .certificate-action-btn{min-width:0!important}
  #leaderboardSection .leaderboard-certificate-actions .png-action{background:#FFF9E7!important;border-color:#E8D17C!important;color:#755611!important}
}

/* ==========================================================
   V1.29.3 PREVIEW — LEADERBOARD CARD ALIGNMENT & SAFE AREA
   ========================================================== */
@media(max-width:900px){
  #leaderboardSection{padding-bottom:calc(28px + env(safe-area-inset-bottom))!important}
  #leaderboardSection .leaderboard-table-panel{margin-bottom:22px!important}
  #leaderboardSection .leaderboard-data-table tr{
    grid-template-columns:64px minmax(0,1.35fr) minmax(72px,.72fr) minmax(72px,.72fr)!important;
    overflow:visible!important
  }
  #leaderboardSection .leaderboard-data-table td[data-label="المركز"]{
    width:64px!important;min-width:64px!important;min-height:78px!important;padding:7px 4px!important;
    overflow:hidden!important;isolation:isolate!important
  }
  #leaderboardSection .leaderboard-rank-cell{
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    width:52px!important;height:64px!important;min-width:52px!important;margin:auto!important;padding:5px 3px!important;
    overflow:hidden!important;border:1px solid #E7CB66!important;border-radius:12px!important;
    background:linear-gradient(180deg,#FFFDF5 0%,#FFF6D8 100%)!important;box-shadow:inset 0 1px 0 #fff!important
  }
  #leaderboardSection .leaderboard-rank-caption{
    display:block!important;max-width:100%!important;margin:0 0 3px!important;color:#927019!important;
    font-family:"Cairo",Tahoma,Arial,sans-serif!important;font-size:6px!important;font-weight:750!important;
    line-height:1.2!important;white-space:nowrap!important;overflow:hidden!important
  }
  #leaderboardSection .leaderboard-rank-number{
    display:block!important;color:var(--tp-navy)!important;font-family:Arial,Tahoma,sans-serif!important;
    font-size:21px!important;font-weight:900!important;line-height:1!important
  }
  #leaderboardSection .leaderboard-data-table td[data-label="الطالب"]{
    padding-inline:9px!important;overflow:hidden!important
  }
  #leaderboardSection .leaderboard-data-table td[data-label="الطالب"]>b{
    max-width:100%!important;line-height:1.45!important
  }
  #leaderboardSection .leaderboard-certificate-actions{margin-top:2px!important}
}
@media(max-width:370px){
  #leaderboardSection .leaderboard-data-table tr{
    grid-template-columns:58px minmax(0,1.25fr) minmax(64px,.7fr) minmax(64px,.7fr)!important
  }
  #leaderboardSection .leaderboard-data-table td[data-label="المركز"]{width:58px!important;min-width:58px!important}
  #leaderboardSection .leaderboard-rank-cell{width:48px!important;min-width:48px!important}
}

/* V1.29.4 — one clean rank badge (remove the nested double frame). */
@media(max-width:900px){
  #leaderboardSection .leaderboard-data-table td[data-label="المركز"]{
    display:flex!important;align-items:center!important;justify-content:center!important;
    width:64px!important;min-width:64px!important;min-height:78px!important;padding:0!important;
    overflow:hidden!important;border:1px solid #E7CB66!important;border-radius:13px!important;
    background:linear-gradient(180deg,#FFFDF5 0%,#FFF6D8 100%)!important;
    box-shadow:inset 0 1px 0 rgba(255,255,255,.96)!important
  }
  #leaderboardSection .leaderboard-rank-cell{
    display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;
    width:100%!important;height:100%!important;min-width:0!important;margin:0!important;padding:8px 4px!important;
    overflow:hidden!important;border:0!important;border-radius:0!important;background:transparent!important;box-shadow:none!important
  }
  #leaderboardSection .leaderboard-rank-caption{margin-bottom:5px!important;font-size:6.5px!important;line-height:1!important}
  #leaderboardSection .leaderboard-rank-number{font-size:22px!important;line-height:1!important}
}
@media(max-width:370px){
  #leaderboardSection .leaderboard-data-table td[data-label="المركز"]{width:58px!important;min-width:58px!important}
  #leaderboardSection .leaderboard-rank-cell{width:100%!important;min-width:0!important}
}

/* Keep the new parent-card anatomy authoritative over legacy mobile card rules. */
@media(max-width:900px){
  body[data-role="teacher"] #homeSection>.home-page-head{display:none!important}
  #homeSection .teacher-home-profile-hero{order:-3!important;margin-top:0!important}
  #homeSection .smart-next-lesson,#homeSection .smart-next-lesson.no-schedule{order:-2!important;display:grid!important;grid-template-columns:minmax(0,1fr) 108px!important;align-items:center!important;gap:10px 14px!important;min-height:0!important;padding:15px 16px!important;border:1px solid #D5E2EF!important;border-radius:18px!important;background:linear-gradient(135deg,#F7FBFF 0%,#EDF5FC 100%)!important;color:var(--tp-navy,#0b2f66)!important;box-shadow:0 8px 22px rgba(8,45,87,.07)!important;overflow:hidden!important}
  #homeSection .smart-next-lesson::before,#homeSection .smart-next-lesson::after{display:none!important;content:none!important}
  #homeSection .smart-next-icon{display:none!important}
  #homeSection .smart-next-copy{grid-column:1!important;grid-row:1!important;min-width:0!important;padding:0!important}
  #homeSection .smart-next-copy>span{color:#55728F!important;font-size:9px!important;font-weight:750!important}
  #homeSection .smart-next-copy h4{margin:3px 0 2px!important;color:var(--tp-navy,#0b2f66)!important;font-size:16px!important;line-height:1.45!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  #homeSection .smart-next-copy p{margin:0!important;color:#73869A!important;font-size:9.5px!important;line-height:1.5!important}
  #homeSection .smart-next-copy>b{display:inline-flex!important;margin-top:7px!important;padding:5px 8px!important;border-radius:99px!important;background:#E5F0FA!important;color:#315E86!important;font-size:9px!important}
  #homeSection .smart-next-lesson>.primary-btn,#homeSection .smart-next-lesson>.secondary-btn{grid-column:2!important;grid-row:1!important;width:108px!important;min-width:108px!important;min-height:42px!important;margin:0!important;padding:8px 10px!important;border:0!important;border-radius:12px!important;background:var(--tp-navy,#0b2f66)!important;color:#fff!important;font-size:10px!important;box-shadow:none!important}
  #cardsSection .paper-parent-card{display:block!important;border-radius:22px!important;box-shadow:0 12px 30px rgba(10,45,90,.1)!important}
  #cardsSection .paper-card-teacher{padding:20px!important;border-bottom:6px solid var(--gold,#e8ad22)!important}
  #cardsSection .paper-card-teacher-photo{width:102px!important;height:102px!important}
  #cardsSection .paper-card-student{padding:22px 17px!important}
  #cardsSection .paper-card-access{padding:8px 17px 22px!important}
  #cardsSection .paper-card-footer{display:flex!important;padding:10px 17px!important;font-size:9px!important}
}
@media(max-width:390px){
  .teacher-home-profile-contact{display:grid;grid-template-columns:1fr auto}.teacher-home-phone-block a{font-size:15px}.teacher-home-profile-contact .secondary-btn{min-width:94px;padding-inline:10px}
  #homeSection .smart-next-lesson,#homeSection .smart-next-lesson.no-schedule{grid-template-columns:minmax(0,1fr) 94px!important;padding:13px 14px!important}
  #homeSection .smart-next-lesson>.primary-btn,#homeSection .smart-next-lesson>.secondary-btn{width:94px!important;min-width:94px!important}
}
