/* PE-Class v1.20.09 — final Settings save alignment and compact footer polish. */

/* The Home/Design group uses the same highlighted icon tile as every other
   Settings group. Geometry stays on the shared 12008 alignment tokens. */
#settingsCWorkspace.settingsC
.settingsCGroup[data-settings-group="home"] > .settingsCGroupHeader > .settingsCGroupIcon {
  background: var(--sc-blue-soft) !important;
  color: var(--sc-blue) !important;
}

/* PC, MacBook, iPad landscape and Galaxy Fold7 unfolded. */
@media (min-width: 769px) {
  /* The captain grid is self-explanatory once its title is visible. Removing
     the helper copy also brings the editable rows naturally upward. */
  #settingsCWorkspace.settingsC
  .settingsCGridStudents > .adminHeadTeacherCard > p.hint {
    display: none !important;
  }

  #settingsCWorkspace.settingsC
  .settingsCGridStudents > .adminHeadTeacherCard > .peSettingsCardSaveHeader {
    top: 16px !important;
  }

  /* Match the period action to the scoped school Save button and align it to
     the title's top edge instead of centering against two lines of helper copy. */
  #settingsCWorkspace.settingsC
  .settingsCGridEducation > .adminSemesterPeriodCard > .adminSemesterPeriodHead {
    align-items: start !important;
  }

  #settingsCWorkspace.settingsC
  .settingsCGridEducation > .adminSemesterPeriodCard #saveSemesterPeriods {
    align-self: start !important;
    width: 78px !important;
    min-width: 78px !important;
    max-width: 78px !important;
    height: 34px !important;
    min-height: 34px !important;
    max-height: 34px !important;
    margin: 0 !important;
  }

  /* Place management is the requested size reference for class management. */
  #settingsCWorkspace.settingsC :is(#saveAdminPlaces, #saveAdminClasses) {
    width: 92px !important;
    min-width: 92px !important;
    max-width: 92px !important;
    height: 35px !important;
    min-height: 35px !important;
    max-height: 35px !important;
  }
}

/* The iPad curriculum cards are too narrow to keep the complete semester
   title and its auto-save pill on one line. Give the title the full content
   width, then place the status pill on its own right-aligned row. */
@media (min-width: 769px) and (max-width: 1366px) and (orientation: landscape) {
  html:is(.pe87Ipad, .pe87IpadRuntime, [data-pe-ipados="true"]):not(.pe87FoldWide)
  #settingsCWorkspace.settingsC .settingsCGridEducation
  > .adminSemesterCard.peSettingsCardSaveHost--semester > h2 {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-height: 42px !important;
    height: auto !important;
    overflow: visible !important;
    text-overflow: clip !important;
    white-space: normal !important;
    word-break: keep-all !important;
    line-height: 1.3 !important;
  }

  html:is(.pe87Ipad, .pe87IpadRuntime, [data-pe-ipados="true"]):not(.pe87FoldWide)
  #settingsCWorkspace.settingsC .settingsCGridEducation
  > .adminSemesterCard.peSettingsCardSaveHost--semester > .peSettingsCardSaveHeader {
    top: 56px !important;
  }

  html:is(.pe87Ipad, .pe87IpadRuntime, [data-pe-ipados="true"]):not(.pe87FoldWide)
  #settingsCWorkspace.settingsC .settingsCGridEducation
  > .adminSemesterCard.peSettingsCardSaveHost--semester > .adminSemesterHint {
    margin-top: 38px !important;
  }
}

/* iPad and Fold-wide apply a 44px minimum touch target to the reference Place
   Save action. Keep Class Save exactly on that device-specific reference. */
@media (min-width: 769px) {
  html:is(.pe87Ipad, .pe87IpadRuntime, .pe87FoldWide, [data-pe-ipados="true"], [data-pe-fold-wide="true"])
  #settingsCWorkspace.settingsC :is(#saveAdminPlaces, #saveAdminClasses) {
    height: 44px !important;
    min-height: 44px !important;
    max-height: 44px !important;
  }
}

/* iPhone 15 Pro + Galaxy Fold7 folded only. */
@media (max-width: 768px) {
  /* Make the compact period action read exactly like the other scoped saves. */
  html[data-pe-device="compact"][data-pe-tab="admin"]:is(.pe87IPhone, .pe87FoldDevice:not(.pe87FoldWide)):not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"])
  #settingsCWorkspace.settingsC #saveSemesterPeriods::before {
    content: "💾";
    display: inline-block;
    margin-right: 5px;
  }

  /* The stronger open-card selectors below intentionally outrank 12007.
     Remove the divider and leave a visible 14px safety gap above the card
     border instead of letting the full-width button touch that border. */
  html[data-pe-device="compact"][data-pe-tab="admin"]:is(.pe87IPhone, .pe87FoldDevice:not(.pe87FoldWide)):not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"])
  #settingsCWorkspace.settingsC
  :is(.settingsCHomeEditors, .settingsCHomeEditors > .adminHomeCopyGrid)
  > details.peSettingsCardSaveHost[open][data-pe-settings-save-scope]
  > .peSettingsHomeSaveSlot {
    margin: 10px 0 0 !important;
    padding: 0 0 14px !important;
    border: 0 !important;
    border-top: 0 !important;
  }

  html[data-pe-device="compact"][data-pe-tab="admin"]:is(.pe87IPhone, .pe87FoldDevice:not(.pe87FoldWide)):not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"])
  #settingsCWorkspace.settingsC
  .peMobileSettingsSubcard.is-open.peSettingsCardSaveHost--headTeachers
  > p.hint {
    display: none !important;
  }

  html[data-pe-device="compact"][data-pe-tab="admin"]:is(.pe87IPhone, .pe87FoldDevice:not(.pe87FoldWide)):not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"])
  #settingsCWorkspace.settingsC
  .peMobileSettingsSubcard.is-open.peSettingsCardSaveHost--headTeachers
  > .peSettingsCardSaveHeader {
    margin: 10px 0 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-top: 0 !important;
  }
}
