.settingsCDataGrid > .templateManagementCard {grid-column:1 / -1;min-width:0;}
/* 1.22.88 — match the integrated-upload heading without changing its controls.
   Scoped layered rules beat the compact app's generic centered summary style. */
@layer peLocalTypography {
  html body #adminTemplateManagement12252.templateManagementCard {
    padding:0!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary {
    display:grid!important;
    grid-template-columns:minmax(0,1fr) 34px!important;
    align-items:center!important;
    gap:10px!important;
    width:100%!important;
    min-height:58px!important;
    margin:0!important;
    padding:12px 16px!important;
    box-sizing:border-box!important;
    text-align:left!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary > .templateManagerTitle {
    display:block!important;
    min-width:0!important;
    font-size:16px!important;
    font-weight:700!important;
    line-height:1.3!important;
    text-align:left!important;
    white-space:nowrap!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard .templateManagerIcon {
    font-size:inherit!important;
    font-weight:inherit!important;
    line-height:inherit!important;
    vertical-align:baseline!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary > i {
    display:grid!important;
    place-items:center!important;
    justify-self:end!important;
    align-self:center!important;
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    margin:0!important;
    padding:0!important;
    border:1px solid #d7e2eb!important;
    border-radius:10px!important;
    background:#fff!important;
    color:#557087!important;
    font-size:0!important;
    line-height:0!important;
    box-sizing:border-box!important;
    transform:none!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary > i::before {
    content:""!important;
    display:block!important;
    width:8px!important;
    height:8px!important;
    border-right:2px solid currentColor!important;
    border-bottom:2px solid currentColor!important;
    transform:translateY(-2px) rotate(45deg)!important;
    box-sizing:content-box!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard[open] > .templateManagerSummary > i::before {
    transform:translateY(2px) rotate(225deg)!important;
  }
  html body #adminTemplateManagement12252.templateManagementCard #templateManagerReplace12252 {
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:4px!important;
    text-align:center!important;
    white-space:nowrap!important;
  }
  /* Both settings modals use the same 12px inner gutter as the upload card. */
  html body :is(#peLocalSettingsModal,#peMobileSettingsModal) #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary {
    grid-template-columns:minmax(0,1fr) 28px!important;
    min-height:64px!important;
    height:64px!important;
    padding:10px 12px!important;
    background:#fff!important;
  }
  html.pe-local-app body #peLocalSettingsModal #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary {
    min-height:54px!important;
    height:54px!important;
  }
  html body :is(#peLocalSettingsModal,#peMobileSettingsModal) #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary > .templateManagerTitle {
    font-weight:850!important;
    line-height:1.35!important;
    color:#284b68!important;
  }
  html body :is(#peLocalSettingsModal,#peMobileSettingsModal) #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary > i {
    width:34px!important;
    height:34px!important;
    min-width:34px!important;
    min-height:34px!important;
    border-radius:8px!important;
    background:#f0f5fb!important;
  }
  html body :is(#peLocalSettingsModal,#peMobileSettingsModal) #adminTemplateManagement12252.templateManagementCard > .templateManagerSummary > i::before {
    width:7px!important;
    height:7px!important;
    border-color:#7690a7!important;
  }
  /* Keep the reference upload heading left-aligned in the native modal too. */
  html.pe-local-app body #peLocalSettingsModal .adminDataImportHub > .peMobileSettingsSubcardToggle,
  html.pe-local-app body #peLocalSettingsModal .adminDataImportHub > .peMobileSettingsSubcardToggle > .peMobileSettingsSubcardLabel {
    text-align:left!important;
  }
}
.templateManagementCard .templateManagerHeading {display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;}
.templateManagementCard .templateManagerHeading h2 {margin:0;font-size:19px;}
.templateManagerHeading > span {color:#176b45;background:#eaf7f0;padding:5px 10px;border-radius:6px;font-size:12px;font-weight:800;}
.templateManagementCard .templateManagerIntro {line-height:1.65;margin:14px 0;color:#46627b;word-break:keep-all;overflow-wrap:anywhere;}
.templateManagerFields {display:grid;grid-template-columns:minmax(140px,1.3fr) repeat(4,minmax(100px,1fr));gap:12px;}
.templateManagerFields label {display:grid;gap:7px;font-size:13px;font-weight:800;color:#365a78;min-width:0;}
.templateManagerFields label[hidden] {display:none!important;}
.templateManagerFields select {width:100%;min-width:0;min-height:44px;text-align:center;padding:8px 24px 8px 10px;box-sizing:border-box;}
.templateManagerFields:has(.templateManagerSemester[hidden]) {grid-template-columns:minmax(140px,1.3fr) repeat(3,minmax(100px,1fr));}
.templateManagerFooter {display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:16px;padding-top:14px;border-top:1px solid #e3edf5;flex-wrap:wrap;}
.templateManagerFooter strong {font-size:14px;color:#254c70;word-break:keep-all;}
.templateManagementCard .btn,.templateManagerModal .btn {display:inline-flex;align-items:center;justify-content:center;text-align:center;min-height:44px;white-space:nowrap;}
.templateManagementCard .templateManagerGuide {line-height:1.65;color:#6a7f93;font-size:12px;margin:14px 0 0;word-break:keep-all;overflow-wrap:anywhere;}
.templateManagerResult {margin:12px 0 0;line-height:1.6;font-size:13px;color:#167149;white-space:pre-wrap;overflow-wrap:anywhere;}
.templateManagerResult:empty {display:none;}
.templateManagerResult[data-error="true"] {color:#b53137;}
.templateManagerPhoneHint {display:none;}
.templateManagerModal .studentStatusDialog {width:min(680px,100%);grid-template-rows:auto minmax(0,1fr) auto;}
.templateManagerModal p {line-height:1.65;word-break:keep-all;overflow-wrap:anywhere;margin:0;}
.templateManagerEvents {display:flex;flex-wrap:wrap;gap:7px;}
.templateManagerEvents span {padding:6px 10px;border-radius:6px;background:#eef6fc;color:#315c7d;font-size:13px;}
.templateManagerConfirm {display:flex;align-items:center;gap:10px;min-height:48px;padding:12px;border:1px solid #bdd8ec;border-radius:10px;line-height:1.55;cursor:pointer;}
.templateManagerConfirm input {width:20px!important;min-width:20px;flex:0 0 20px;height:20px;min-height:20px;padding:0;}
html.templateManagerModalOpen,body.templateManagerModalOpen {overflow:hidden!important;}
@media(max-width:1000px){.templateManagerFields,.templateManagerFields:has(.templateManagerSemester[hidden]){grid-template-columns:repeat(4,minmax(0,1fr));}.templateManagerKind{grid-column:1 / -1;}}
@media(max-width:768px){.templateManagerFields,.templateManagerFields:has(.templateManagerSemester[hidden]){grid-template-columns:repeat(2,minmax(0,1fr));}.templateManagementCard .templateManagerHeading h2{font-size:17px;}
html:not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"]):not(.pe87FoldWide):not([data-pe-fold-wide="true"]) #templateManagerReplace12252{display:none!important;}
html:not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"]):not(.pe87FoldWide):not([data-pe-fold-wide="true"]) .templateManagerPhoneHint{display:block;color:#687f91;font-size:12px;line-height:1.5;}}
@media(pointer:coarse) and (orientation:landscape) and (max-width:1000px) and (max-height:500px){
html:not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"]):not(.pe87FoldWide):not([data-pe-fold-wide="true"]) #templateManagerReplace12252{display:none!important;}
html:not(.pe87Ipad):not(.pe87IpadRuntime):not([data-pe-ipados="true"]):not(.pe87FoldWide):not([data-pe-fold-wide="true"]) .templateManagerPhoneHint{display:block;}}
/* 1.22.87 — the original-template controls form one compact, collapsible card. */
#adminTemplateManagement12252 > .templateManagerSummary {
  display:flex; align-items:center; justify-content:space-between; gap:12px;
  cursor:pointer; list-style:none; min-width:0;
}
#adminTemplateManagement12252 > .templateManagerSummary::-webkit-details-marker { display:none; }
#adminTemplateManagement12252 > .templateManagerSummary > span { min-width:0; flex:1; }
#adminTemplateManagement12252 > .templateManagerSummary b { word-break:keep-all; overflow-wrap:anywhere; }
#adminTemplateManagement12252 > .templateManagerSummary > i { flex:0 0 auto; }
#adminTemplateManagement12252 > .templateManagerSummary:focus-visible { outline:2px solid #2679c0; outline-offset:-3px; border-radius:10px; }
#adminTemplateManagement12252:not([open]) > .templateManagerBody { display:none!important; }
#adminTemplateManagement12252 .templateManagerActions {
  display:flex; align-items:center; justify-content:flex-end; gap:8px; flex-wrap:wrap; margin-bottom:14px;
}
html body #adminTemplateManagement12252 #templateManagerReplace12252 {
  display:inline-flex!important; width:auto!important; max-width:100%;
}
#adminTemplateManagement12252 .templateManagerPolicy {
  display:block!important; white-space:pre-line; line-height:1.65; margin:12px 0 0;
  word-break:keep-all; overflow-wrap:anywhere;
}
#adminTemplateManagement12252 .templateManagerBody { min-width:0; }
#adminTemplateManagement12252 .templateManagerResult:empty { display:none!important; }
#adminFactoryResetCard .peMobileSettingsSubcardLabel .adminFactoryResetCardIcon {
  display:inline-flex; align-items:center; justify-content:center; flex:0 0 auto;
  margin-right:6px; vertical-align:middle;
}
@media(max-width:768px) {
  /* Reserve the arrow area for the longer year label in the compact web card. */
  html:not(.pe-local-app) #adminTemplateManagement12252 #templateManagerYear12252 {
    font-size:clamp(12px,3.4vw,14px)!important;
    padding-left:18px!important;
    padding-right:24px!important;
  }
}

/* 1.23.23 — help only; original replacement/upload controls stay unchanged. */
html body #adminTemplateManagement12252 #templateManagerHelp12252 {
  display:inline-flex!important;
  width:auto!important;
  margin-inline-end:auto;
  align-items:center;
  justify-content:center;
  white-space:nowrap;
}
html.peTemplateHelpOpen12323,
body.peTemplateHelpOpen12323 {
  overflow:hidden!important;
  overscroll-behavior:none!important;
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 {
  z-index:100100;
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 .studentStatusDialog {
  width:min(600px,100%);
  grid-template-rows:auto minmax(0,1fr);
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 .studentStatusHead {
  display:grid;
  grid-template-columns:44px minmax(0,1fr) 44px;
  align-items:center;
  gap:4px;
  padding:12px;
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 .studentStatusHead h2 {
  grid-column:2;
  grid-row:1;
  width:100%;
  margin:0;
  text-align:center!important;
  font-size:clamp(12px,3.5vw,16px)!important;
  line-height:1.4;
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 .studentStatusClose {
  grid-column:3;
  grid-row:1;
  justify-self:end;
  display:grid;
  place-items:center;
  width:44px;
  min-width:44px;
  height:44px;
  margin:0;
  padding:0;
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 .studentStatusBody {
  display:grid;
  gap:10px;
  padding:16px;
}
#templateManagerHelpModal44.peTemplateHelpCompact12323 .studentStatusBody p {
  margin:0;
  min-width:0;
  text-align:left!important;
  font-size:clamp(11px,3.1vw,14px)!important;
  line-height:1.6;
  word-break:keep-all;
  overflow-wrap:break-word;
}
