/* EduHunt R491.1 | Principal layout only. No data or permission changes.
   Desktop (>1024 CSS px, excluding physical-mobile mode): expand exam rows
   and People guide. Mobile/tablet: remove only the menu-to-logo spacer. */
:root { --eduhunt-r491-principal-layout: 1; }

@media (min-width:1025px) {
  /* An older multi-column article layout must not confine the new row wrapper. */
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-next-exam .principal-next-exam-list--grouped {
    width:100%!important; max-width:none!important; min-width:0!important;
    grid-template-columns:minmax(0,1fr)!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-next-exam .principal-next-exam-list--grouped > article {
    display:block!important;
    width:100%!important; max-width:none!important; min-width:0!important;
    height:auto!important; box-sizing:border-box!important;
    grid-template-columns:none!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-next-exam .principal-next-exam-line {
    display:flex!important; flex-direction:row!important; flex-wrap:nowrap!important;
    align-items:center!important; justify-content:flex-start!important; gap:16px!important;
    width:100%!important; min-width:0!important; max-width:none!important;
    grid-column:1 / -1!important; grid-row:auto!important;
    position:static!important; float:none!important; margin:0!important;
    box-sizing:border-box!important; text-align:left!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-next-exam .principal-next-exam-line-test {
    display:block!important; position:static!important; float:none!important;
    flex:0 0 76px!important; width:76px!important; min-width:76px!important;
    max-width:none!important; margin:0!important; padding:0!important;
    white-space:nowrap!important; text-align:left!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-next-exam .principal-next-exam-line-summary {
    display:block!important; position:static!important; float:none!important;
    flex:1 1 0%!important; width:auto!important; max-width:none!important; min-width:0!important;
    grid-column:auto!important; grid-row:auto!important; margin:0!important; padding:0!important;
    white-space:nowrap!important; word-break:normal!important; overflow-wrap:normal!important;
    /* A truly oversized chapter stays readable by local horizontal scrolling;
       normal chapter names fit the available desktop row without clipping. */
    overflow-x:auto!important; overflow-y:hidden!important;
    text-overflow:clip!important; scrollbar-width:thin; text-align:left!important;
  }

  /* Fill the existing People information panel, rather than its first grid cell. */
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-people-login-guide,
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box {
    display:block!important; position:static!important; float:none!important;
    grid-column:1 / -1!important;
    width:100%!important; max-width:none!important; min-width:0!important;
    height:auto!important; max-height:none!important; flex:1 1 100%!important;
    box-sizing:border-box!important;
    column-count:1!important; text-align:left!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box { margin:0!important; }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box > p {
    display:block!important; width:100%!important; max-width:none!important; min-width:0!important;
    margin:0 0 16px!important; padding:0!important;
    height:auto!important; white-space:normal!important; overflow-wrap:break-word!important;
    line-height:1.55!important; text-align:left!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box > p:last-child { margin-bottom:0!important; }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box > p > b {
    display:block!important; margin:0 0 6px!important; line-height:1.3!important;
  }
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box > p > span {
    display:block!important; width:100%!important; max-width:none!important;
    min-width:0!important; white-space:normal!important;
  }
  /* R491 helper records each element's unmodified desktop size before enabling
     this rule. This adds exactly 2 CSS points, with no inherited double increase. */
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box.r491-guide-sized p,
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box.r491-guide-sized p b,
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box.r491-guide-sized p span,
  html:not(.eh-force-mobile) body[data-portal-role="PRINCIPAL"] #content
  .principal-mobile-hub--people .principal-login-guide-box.r491-guide-sized p strong {
    font-size:calc(var(--r491-original-desktop-font, 14px) + 2pt)!important;
  }
}

/* Keep existing menu hit area and logo size. Only the redundant horizontal
   margins go: 6px separates the menu button and the school branding. */
@media (max-width:1024px) {
  html body[data-portal-role="PRINCIPAL"] #portalView .topbar { grid-template-columns:max-content minmax(0,1fr)!important; column-gap:6px!important; }
  html body[data-portal-role="PRINCIPAL"] #portalView .topbar #drawerOpen { margin-right:0!important; }
  html body[data-portal-role="PRINCIPAL"] #portalView .topbar .topbar-title.principal-school-masthead {
    margin-left:0!important; padding-left:0!important; max-width:none!important;
  }
  html body[data-portal-role="PRINCIPAL"] #portalView .topbar #topbarSchoolLogo {
    margin-left:0!important; justify-self:start!important;
  }
}
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #portalView .topbar { grid-template-columns:max-content minmax(0,1fr)!important; column-gap:6px!important; }
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #portalView .topbar #drawerOpen { margin-right:0!important; }
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #portalView .topbar .topbar-title.principal-school-masthead {
  margin-left:0!important; padding-left:0!important; max-width:none!important;
}
html.eh-force-mobile body[data-portal-role="PRINCIPAL"] #portalView .topbar #topbarSchoolLogo {
  margin-left:0!important; justify-self:start!important;
}
