/* Small, additive correction for the published portal preferences controls.
   The board's original px !important declarations otherwise ignore the
   saved font/control scales. Keep its 100% dimensions unchanged. */
html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot {
  --student-board-name-base: 14px;
  --student-board-number-base: 22px;
  --student-board-number-font-base: 10px;
  --student-board-circle-base: 44px;
  --student-board-circle-font-base: 15px;
  --student-board-header-base: 14px;
  --student-board-first-header-base: 12px;
  --student-board-header-small-base: 10px;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-activity-name {
  font-size: calc(var(--student-board-name-base) * var(--student-prefs-font-scale, 1)) !important;
  white-space: normal !important;
  overflow-wrap: anywhere !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-activity-number {
  width: calc(var(--student-board-number-base) * var(--student-prefs-control-scale, 1)) !important;
  height: calc(var(--student-board-number-base) * var(--student-prefs-control-scale, 1)) !important;
  font-size: calc(var(--student-board-number-font-base) * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-time:not(.is-empty) {
  width: calc(var(--student-board-circle-base) * var(--student-prefs-control-scale, 1)) !important;
  height: calc(var(--student-board-circle-base) * var(--student-prefs-control-scale, 1)) !important;
  min-width: calc(var(--student-board-circle-base) * var(--student-prefs-control-scale, 1)) !important;
  min-height: calc(var(--student-board-circle-base) * var(--student-prefs-control-scale, 1)) !important;
  font-size: calc(var(--student-board-circle-font-base) * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-time.is-empty {
  width: calc(8px * var(--student-prefs-control-scale, 1)) !important;
  height: calc(8px * var(--student-prefs-control-scale, 1)) !important;
  min-width: calc(8px * var(--student-prefs-control-scale, 1)) !important;
  min-height: calc(8px * var(--student-prefs-control-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-time.is-done::after {
  width: calc(16px * var(--student-prefs-control-scale, 1)) !important;
  height: calc(16px * var(--student-prefs-control-scale, 1)) !important;
  font-size: calc(11px * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-table thead th {
  font-size: calc(var(--student-board-header-base) * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-table thead th:first-child {
  font-size: calc(var(--student-board-first-header-base) * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot .focus-weekly-table thead th small {
  font-size: calc(var(--student-board-header-small-base) * var(--student-prefs-font-scale, 1)) !important;
}

/* The dashboard's greeting, navigation and summary figures also use fixed
   pixels, so scaling the root alone leaves them unchanged. */
html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content #focus-weekly-title > span:nth-of-type(2),
html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content #focus-weekly-title > .focus-weekly-greeting-name {
  font-size: calc(clamp(25px, 3.25vw, 40px) * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-sidebar__nav-btn {
  font-size: calc(16px * var(--student-prefs-font-scale, 1)) !important;
  white-space: normal !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-home-insights .portal-home-card h2 {
  font-size: calc(11px * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-home-insights .portal-home-card strong {
  font-size: calc(clamp(26px, 2vw, 34px) * var(--student-prefs-font-scale, 1)) !important;
}

html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-home-insights .portal-home-card small {
  font-size: calc(11px * var(--student-prefs-font-scale, 1)) !important;
}

@media (min-width: 70rem) {
  /* The portal gives the embedded board a viewport-height flex box. Once
     circles grow, its table can exceed that box and the following action
     overlays the last row. Let the board and its wrapper grow with content. */
  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content:not(.portal-page--mobile-focus) .portal-focus-content-slot {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }

  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content:not(.portal-page--mobile-focus) .portal-focus-content-slot .focus-weekly-board {
    height: auto !important;
    min-height: 100% !important;
    flex: 1 0 auto !important;
  }

  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content:not(.portal-page--mobile-focus) .portal-focus-content-slot .focus-weekly-table-wrap {
    min-height: calc(132px + 440px * var(--student-prefs-control-scale, 1)) !important;
    flex-shrink: 0 !important;
  }

  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content:not(.portal-page--mobile-focus) .portal-focus-content-slot .focus-weekly-table {
    grid-template-rows: 48px repeat(10, minmax(calc(44px * var(--student-prefs-control-scale, 1) + 4px), 1fr)) 44px !important;
    min-height: calc(132px + 440px * var(--student-prefs-control-scale, 1)) !important;
  }
}

@media (max-width: 69.999rem) {
  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot {
    --student-board-name-base: clamp(11px, 1.3vw, 16px);
    --student-board-number-base: 27px;
    --student-board-number-font-base: 11px;
    --student-board-circle-base: 39px;
    --student-board-circle-font-base: 15px;
    --student-board-header-base: 18px;
    --student-board-first-header-base: 18px;
    --student-board-header-small-base: 8px;
  }
}

@media (max-width: 48rem) {
  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot {
    --student-board-name-base: 11px;
    --student-board-number-base: 19px;
    --student-board-number-font-base: 9px;
    --student-board-circle-base: 30px;
    --student-board-circle-font-base: 11px;
    --student-board-header-small-base: 7px;
  }
}

@media (max-width: 700px) {
  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot {
    --student-board-header-base: 14px;
    --student-board-first-header-base: 14px;
  }
}

@media (max-width: 340px) {
  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-focus-content-slot {
    --student-board-header-base: 12px;
    --student-board-first-header-base: 12px;
  }
}

@media (max-width: 700px) {
  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-mobile-access__card--conversation .portal-mobile-access__text strong {
    font-size: calc(17px * var(--student-prefs-font-scale, 1)) !important;
  }

  html[data-student-preferences] body .portal-page--brand-red-preview.portal-page--local-focus-content .portal-mobile-access__card--conversation .portal-mobile-access__text small {
    font-size: calc(13px * var(--student-prefs-font-scale, 1)) !important;
  }

  .student-preferences {
    --student-prefs-launcher-block-size: 52px;
    inset-inline-start: max(0.75rem, env(safe-area-inset-left, 0px));
    inset-inline-end: auto;
    bottom: max(10px, env(safe-area-inset-bottom, 0px));
    align-items: flex-start;
  }

  .student-preferences__launcher {
    align-self: flex-start;
    inline-size: 52px;
    block-size: 52px;
    min-inline-size: 52px;
    min-block-size: 52px;
    padding: 0;
    font-size: calc(16px * var(--student-prefs-font-scale, 1));
  }

  .student-preferences__panel {
    inset-inline-start: 0;
    inset-inline-end: auto;
  }

}
