/* V66: the same student header stays visible from first paint on EVERY student
   portal route, including lessons, exams, assignments, wallet, community, and profile.
   Fixed (not scroll-activated) and with an exactly measured content offset.
   Scoped to the real student portal, not the public site or designer previews. */
.app.learner-app > .portal-body > .portal-header.kf-student-always-header {
  display: flex !important;
  visibility: visible !important;
  opacity: 1 !important;
  position: fixed !important;
  inset-inline: 0 !important;
  inset-block-start: var(--kf-student-header-top, 0px) !important;
  width: 100% !important;
  max-width: 100vw !important;
  margin: 0 !important;
  transform: none !important;
  box-sizing: border-box !important;
  z-index: 85 !important;
  background: var(--header-bg, var(--surface, #fff)) !important;
  color: var(--header-text, var(--ink, #1d2341));
  border-bottom: 1px solid var(--line, #e6e8f1) !important;
  box-shadow: 0 3px 13px rgba(20, 22, 44, .055);
  /* Never let fixed header paint under a phone's notch. */
  padding-inline-start: max(12px, env(safe-area-inset-right)) !important;
  padding-inline-end: max(12px, env(safe-area-inset-left)) !important;
}
.app.learner-app > .portal-body {
  box-sizing: border-box;
  padding-block-start: calc(var(--kf-student-header-top, 0px) + var(--kf-student-header-height, 80px)) !important;
}
/* Anchor scrolling should never put the requested section under the header. */
html.kf-student-header-pinned { scroll-padding-top: calc(var(--kf-student-header-top, 0px) + var(--kf-student-header-height, 80px) + 12px); }
.app.learner-app .portal-main :is([id],.learning-block,.student-page,.panel) { scroll-margin-top: calc(var(--kf-student-header-height, 80px) + 12px); }
/* V57's optional on-scroll shortcuts must sit BELOW the permanent header, not overlap it. */
html.kf-student-header-pinned .kf-student-dock {
  top: calc(var(--kf-student-header-top, 0px) + var(--kf-student-header-height, 80px) + 8px) !important;
  z-index: 60 !important;
}
@media (max-width:700px) {
 .app.learner-app > .portal-body > .portal-header.kf-student-always-header {
    min-height: 69px;
    padding-block: 10px !important;
    gap: 9px !important;
 }
 .app.learner-app > .portal-body > .portal-header.kf-student-always-header > div:first-child { min-width:0 !important; }
 .app.learner-app > .portal-body > .portal-header.kf-student-always-header > .header-user { flex-shrink:0; max-width:clamp(48px, 27vw, 120px); }
 .app.learner-app > .portal-body > .portal-header.kf-student-always-header > .header-user strong {
   display:block !important;
   font-size:11px;
   width:auto;
   max-width:clamp(18px, 14vw, 72px);
   overflow:hidden;
   white-space:nowrap;
   text-overflow:ellipsis;
 }
}
