/* Elementary Profile V3 — presentation-only, additive.
 * Retain all original DOM, buttons, guardian consent and educational systems.
 * Titles Cinzel; body Nunito; normal weight; 16px minimum; 7px corners.
 */
body[data-profile-stage="elementary"]{
 --kep-charcoal:#202724;--kep-parchment:#f5f0e6;--kep-leaf:#315c49;
}
body[data-profile-stage="elementary"] main{
 max-width:1160px;
 padding-inline:clamp(14px,3vw,32px);
}
body[data-profile-stage="elementary"] main>.eyebrow,
body[data-profile-stage="elementary"] main>h1,
body[data-profile-stage="elementary"] main>p.muted:first-of-type{
 text-align:center;
}
body[data-profile-stage="elementary"] main>.eyebrow{color:var(--kep-leaf);font-size:16px;letter-spacing:.045em}
body[data-profile-stage="elementary"] main>h1{font:400 clamp(33px,4vw,44px)/1.23 Cinzel,Georgia,serif;margin:8px auto 15px;color:var(--ink)}
body[data-profile-stage="elementary"] main>p.muted:first-of-type{max-width:860px;margin:0 auto 25px;font-size:18px;line-height:1.6}
body[data-profile-stage="elementary"] main .card{border-radius:7px;box-shadow:0 4px 17px rgba(24,49,43,.075)}
body[data-profile-stage="elementary"] main .card.hero{
 
 color:#fff8e9;
 border:2px solid #b48b45;
 padding:clamp(23px,3vw,36px);
 margin:16px 0;
}
/* Retired forced-white hero typography: current selected/default card colors set ink. */
body[data-profile-stage="elementary"] main .card.hero .portrait{
 box-shadow:0 0 0 2px #b48b45;
}
body[data-profile-stage="elementary"] main .grid{gap:18px;align-items:stretch;margin:22px 0}
body[data-profile-stage="elementary"] main .grid>.card{min-width:0;height:100%;display:flex;flex-direction:column;gap:4px;padding:clamp(21px,2.5vw,28px)}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+2),
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+3){background:#e6f0e8;color:#202724;border-color:#b2c6b5}
body[data-profile-stage="elementary"] main .card .actions{gap:9px}
body[data-profile-stage="elementary"] main .card .actions button,
body[data-profile-stage="elementary"] main .card .actions a.button{
 min-height:48px;
 font:400 16px/1.42 Nunito,Arial,sans-serif!important;
 border-radius:7px;
}
body[data-profile-stage="elementary"] main .grid>.card .actions:last-child{margin-top:auto}
body[data-profile-stage="elementary"] main #gradePreview,
body[data-profile-stage="elementary"] main #academyStudio{margin:21px 0;padding:clamp(22px,3vw,32px)}
body[data-profile-stage="elementary"] main #gradePreview{background:#e7f0e8;color:#202724;border:2px solid #aac4b5}
body[data-profile-stage="elementary"] main #academyStudio{border:2px solid #b48b45}
body[data-profile-stage="elementary"] main :is(p,li,label,summary,small,button,select,textarea,input,.status){font-size:max(16px,1rem);line-height:1.5}
body[data-profile-stage="elementary"] main .card p,
body[data-profile-stage="elementary"] main .card label{font-size:18px;line-height:1.55}
body[data-profile-stage="elementary"] main h2{font-weight:400;line-height:1.35}
body[data-profile-stage="elementary"] main :is(.card,#khaemenesElementaryProfileTools) button:focus-visible{outline:3px solid #b48b45;outline-offset:3px}
#khaemenesElementaryProfileTools .kep-backup{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:10px;margin:13px auto}
#khaemenesElementaryProfileTools .kep-backup button,
#khaemenesElementaryProfileTools .kep-backup label{display:inline-flex;align-items:center;justify-content:center;min-height:47px;padding:9px 13px;border:1px solid #315c49;border-radius:7px;background:#fff8e9;color:#202724;font:400 16px/1.4 Nunito,Arial,sans-serif!important;cursor:pointer}
#khaemenesElementaryProfileTools .kep-backup input{width:min(100%,250px);max-width:230px;font-size:16px}
#khaemenesElementaryProfileTools .kep-backup-status{text-align:center;min-height:20px;font:400 16px/1.45 Nunito,Arial,sans-serif!important}
@media(max-width:760px){
 body[data-profile-stage="elementary"] main .card.hero{grid-template-columns:1fr;text-align:center}
 body[data-profile-stage="elementary"] main .grid>.card{height:auto}
}
@media print{
 body[data-profile-stage="elementary"] main .card.hero{color:#202724;background:#fff}
 body[data-profile-stage="elementary"] main .card.hero :is(.eyebrow,.muted,h2){color:#202724}
}

/* ================================================================
   ELEMENTARY COLOR-BLOCK STUDIO — reference-inspired visual layer
   Deliberately scoped to Elementary profile; no learner data changes.
   Bright primary-color rectangles with charcoal/cream reading surfaces.
   ================================================================ */
body[data-profile-stage="elementary"]{
 --kep-turquoise:#008e9b;
 --kep-cobalt:#183ba5;
 --kep-cobalt-deep:#122878;
 --kep-red:#c92b20;
 --kep-yellow:#f1b82b;
 --kep-orange:#eb7926;
 --kep-ink:#202724;
 --kep-cream:#fff8e9;
}
/* The default page canvas stays crisp parchment. Students can still select
   the existing background themes in the native Elementary appearance editor.
   Patchwork colors belong to cards, button tiles and picture frames only. */
body[data-profile-stage="elementary"][data-theme="parchment"]{
 background:#fff8e9;
 background-image:none;
 background-attachment:scroll;
}
body[data-profile-stage="elementary"] main{
 background:#fff8e9;
 border-left:2px solid #ddd1b8;
 border-right:2px solid #ddd1b8;
 box-shadow:none;
 padding-top:clamp(29px,4vw,48px);
}
body[data-profile-stage="elementary"] main>.eyebrow{
 color:#263c70;
 font-size:17px!important;
 letter-spacing:.075em;
}
body[data-profile-stage="elementary"] main>h1{
 color:#132f82;
 font-size:clamp(38px,4.7vw,55px);
 line-height:1.2;
 margin-bottom:15px;
}
body[data-profile-stage="elementary"] main>p.muted:first-of-type{
 max-width:900px;
 color:#2e403c;
 font:400 18px/1.6 Nunito,Arial,sans-serif;
}
body[data-profile-stage="elementary"] main>.notice{
 background:#fff1bb;
 border:2px solid #bb841e;
 border-left:8px solid #c92b20;
 color:#392a19;
 font-size:17px;
}
body[data-profile-stage="elementary"] main .card{
 border:2px solid #233d52;
 box-shadow:6px 7px 0 rgba(22,54,108,.13);
 border-radius:7px;
}
body[data-profile-stage="elementary"] main .card.hero{
 
 border:3px solid #162c70;
 border-left:12px solid #e8b02e;
 border-right:12px solid #cd3427;
 box-shadow:0 10px 0 #0791a3;
 padding:clamp(26px,3.2vw,38px);
 margin:21px 0 31px;
}
body[data-profile-stage="elementary"] main .card.hero .portrait{
 border:5px solid var(--kep-cream);
 outline:3px solid #efb42c;
 box-shadow:5px 7px 0 rgba(9,30,60,.28);
}
body[data-profile-stage="elementary"] main .card.hero :is(.pill){
 background:#fff8e9;
 color:#202724;
 border:1px solid #b57d15;
 border-radius:7px;
 font-size:16px!important;
 min-height:33px;
 display:inline-flex;
 align-items:center;
 padding:6px 10px;
}
body[data-profile-stage="elementary"] main .card.hero .actions{
 margin-top:15px;
}
body[data-profile-stage="elementary"] main .card.hero .actions :is(a,button){
 background:#efb82d;
 color:#202724;
 border:2px solid #162b62;
 border-radius:7px;
 box-shadow:3px 3px 0 #172958;
 font-size:16px!important;
 font-weight:400;
}
body[data-profile-stage="elementary"] main .card.hero .actions :is(a,button):nth-child(even){
 background:#fff8e9;
 color:#202724;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools{
 background:#fff8e9;
 border:4px solid #173e8c;
 border-top:13px solid #efb82d;
 border-right:13px solid #ca3327;
 border-bottom:13px solid #008f9c;
 box-shadow:10px 12px 0 rgba(14,44,91,.2);
 padding:clamp(20px,3vw,35px);
 margin:28px auto 33px;
 border-radius:7px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-heading{
 border-bottom:3px solid #192e75;
 padding:0 0 15px;
 margin-bottom:20px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-heading .eyebrow{
 color:#18458c;
 font-size:17px!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-heading h2{
 color:#173b9a;
 font-size:clamp(30px,3.3vw,42px);
 line-height:1.23;
 font-weight:400!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-guardian label{
 background:#e3f4f1;
 border:2px solid #008f9c;
 padding:13px 19px;
 border-radius:7px;
 font-size:17px!important;
 color:#1d3634;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles{
 display:grid;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:12px;
 padding:12px;
 background:
 linear-gradient(90deg,#f2ba2d 0 26%,#008e9b 26% 51%,#c83325 51% 74%,#193aa0 74% 100%);
 border:3px solid #202724;
 border-radius:7px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool{
 min-height:65px;
 padding:12px 8px;
 border:2px solid #142d57!important;
 border-radius:7px!important;
 box-shadow:3px 4px 0 rgba(10,25,43,.35)!important;
 font:400 16px/1.35 Nunito,Arial,sans-serif!important;
 transition:filter .12s ease,transform .12s ease;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool:nth-child(4n+1){
 background:#16388d!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool:nth-child(4n+2){
 background:#007e8e!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool:nth-child(4n+3){
 background:#b9271b!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool:nth-child(4n+4){
 background:#f2c43a!important;color:#202724!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool:hover{
 filter:brightness(1.1);
 transform:translateY(-2px);
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools :is(.kep-backup,.kep-foot,.kep-backup-status){
 color:#243a37;
}
body[data-profile-stage="elementary"] main .grid>.card{
 border:3px solid #202724;
 box-shadow:6px 7px 0 rgba(17,39,77,.13);
 padding:clamp(21px,2.7vw,29px);
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+1){
 background:#fce4b6;
 border-top:12px solid #eab324;
 color:#26322d;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+2){
 background:#d6f2ef;
 border-top:12px solid #00909a;
 color:#202e32;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+3){
 background:#e0e8ff;
 border-top:12px solid #1c49ab;
 color:#22314e;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+4){
 background:#ffe3d8;
 border-top:12px solid #c32a20;
 color:#3c2925;
}
body[data-profile-stage="elementary"] main .grid>.card :is(h2,h3){
 color:#153a82;
 font-weight:400;
}
body[data-profile-stage="elementary"] main .grid>.card .actions :is(button,a.button){
 background:#202724;
 color:#fff8e9;
 border:1px solid #202724;
 border-radius:7px;
 font-size:16px!important;
}
body[data-profile-stage="elementary"] main .grid>.card .actions :is(button,a.button).secondary{
 background:#fff8e9;
 color:#202724;
}
body[data-profile-stage="elementary"] main #gradePreview{
 background:#e3f3ee;
 border:3px solid #144c90;
 border-left:12px solid #f1bb2e;
 border-right:12px solid #0b8d9b;
}
body[data-profile-stage="elementary"] main #academyStudio{
 border:3px solid #1e3e91;
 border-left:12px solid #c83225;
 border-top:12px solid #eebb30;
 background:var(--panel);
}
body[data-profile-stage="elementary"] main :is(input,select,textarea){
 max-width:100%;
 border-radius:7px;
}
@media(max-width:650px){
 body[data-profile-stage="elementary"] main{
  border-left-width:3px;border-right-width:3px;
  padding-inline:13px;
 }
 body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools{
  border-right-width:7px;border-bottom-width:7px;
 }
 body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles{
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:9px;
  padding:9px;
 }
 body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool{
  min-height:56px;
 }
 body[data-profile-stage="elementary"] main .card.hero{
  border-left-width:7px;border-right-width:7px;
 }
}
@media(prefers-reduced-motion:reduce){
 body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-tiles .kep-tool{transition:none}
}
@media print{
 body[data-profile-stage="elementary"] main{background:#fff;border:0;box-shadow:none}
 body[data-profile-stage="elementary"] main .card,
 body[data-profile-stage="elementary"] main .grid>.card{background:#fff!important;color:#202724!important;box-shadow:none}
 body[data-profile-stage="elementary"] main .card.hero{border:2px solid #202724;box-shadow:none}
}

/* ================================================================
   ELEMENTARY LEARNING HOME — BALANCED MID-TONE PALETTE / V4
   No pastels, no charcoal-colored feature blocks.
   Crisp parchment page, medium-vivid buttons and card framing.
   Never apply the patchwork artwork to the page background.
   ================================================================ */
body[data-profile-stage="elementary"]{
 --kep-turquoise:#167c86;
 --kep-cobalt:#276eb1;
 --kep-red:#be4837;
 --kep-yellow:#dfa536;
 --kep-orange:#c97537;
 --kep-cream:#fff8e9;
}
body[data-profile-stage="elementary"][data-theme="parchment"]{
 background:#fff8e9!important;
 background-image:none!important;
 background-attachment:scroll!important;
}
body[data-profile-stage="elementary"] main{
 width:min(100%,1160px);
 max-width:1160px;
 background:#fff8e9;
 border-left:1px solid #d5cbb9;
 border-right:1px solid #d5cbb9;
 padding-inline:clamp(18px,3.5vw,44px);
}
body[data-profile-stage="elementary"] main>.eyebrow,
body[data-profile-stage="elementary"] main>h1,
body[data-profile-stage="elementary"] main>p.muted:first-of-type{
 text-align:center;
}
body[data-profile-stage="elementary"] main .card.hero{
 
 color:#fff8e9;
 border:2px solid #28546f;
 border-left:9px solid #dfa536;
 border-right:9px solid #be4837;
 border-bottom:7px solid #167c86;
 box-shadow:0 7px 0 rgba(39,110,177,.1);
 min-height:230px;
}
body[data-profile-stage="elementary"] main .card.hero .portrait{
 width:180px; height:180px;
 max-width:100%;
 border:6px solid #fff8e9;
 outline:3px solid #dfa536;
 border-radius:7px;
 box-shadow:0 4px 0 #24527c;
 font-size:76px;
}
body[data-profile-stage="elementary"] main .card.hero h2{
 font-size:clamp(28px,3vw,37px);
 font-weight:400;
 line-height:1.2;
}
body[data-profile-stage="elementary"] main .card.hero .actions .kep-hero-edit,
body[data-profile-stage="elementary"] main .card.hero .actions .kep-hero-start{
 min-height:51px;
 font:400 17px/1.4 Nunito,Arial,sans-serif;
 border:2px solid #fff8e9;
 border-radius:7px;
 box-shadow:none;
}
body[data-profile-stage="elementary"] main .card.hero .actions .kep-hero-edit{
 background:#fff8e9;color:#202724;
}
body[data-profile-stage="elementary"] main .card.hero .actions .kep-hero-start{
 background:#dfa536;color:#202724;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools{
 border:2px solid #28546f;
 border-top:9px solid #276eb1;
 border-right:9px solid #167c86;
 border-bottom:9px solid #be4837;
 background:#fffaf1;
 box-shadow:0 8px 0 rgba(39,110,177,.08);
 padding:clamp(22px,3vw,35px);
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-heading h2{
 color:#23577e;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-groups{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:16px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group{
 min-width:0;
 border:2px solid #d4c9b7;
 border-radius:7px;
 padding:14px;
 background:#fff8e9;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-title{
 font:400 22px/1.3 Cinzel,Georgia,serif;
 text-align:center;
 margin:0 0 12px;
 color:#202724;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tiles{
 background:transparent;
 border:0;
 border-radius:0;
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 padding:0;
 gap:9px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool{
 border:1px solid rgba(32,39,36,.5)!important;
 box-shadow:none!important;
 min-height:57px;
 padding:9px 10px;
 font:400 17px/1.35 Nunito,Arial,sans-serif!important;
 transform:none;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-school{
 border-top:8px solid #276eb1;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-learning{
 border-top:8px solid #167c86;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-create{
 border-top:8px solid #be4837;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-personal{
 border-top:8px solid #dfa536;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-school .kep-tool{
 background:#276eb1!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-learning .kep-tool{
 background:#167c86!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-create .kep-tool{
 background:#be4837!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-personal .kep-tool{
 background:#dfa536!important;color:#202724!important;
}
body[data-profile-stage="elementary"] main :is(.kep-adventure,.kep-advanced){
 border:2px solid #d2b878;
 border-radius:7px;
 background:#fffaf1;
 padding:clamp(19px,3vw,27px);
 margin:22px auto;
}
body[data-profile-stage="elementary"] main .kep-adventure{
 border-left:8px solid #276eb1;
 border-top:8px solid #dfa536;
}
body[data-profile-stage="elementary"] main .kep-adventure :is(h2,.kep-adventure-eyebrow){
 color:#23577e;
}
body[data-profile-stage="elementary"] main .kep-adventure h2{
 font:400 clamp(26px,3vw,33px)/1.3 Cinzel,Georgia,serif;
 margin:6px 0 11px;
}
body[data-profile-stage="elementary"] main .kep-adventure :is(p,button){
 font:400 17px/1.5 Nunito,Arial,sans-serif;
}
body[data-profile-stage="elementary"] main .kep-adventure-links{
 display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:11px;margin-top:16px;
}
body[data-profile-stage="elementary"] main .kep-adventure-button{
 min-height:54px;
 padding:10px;
 color:#fff8e9;
 border:1px solid #3b5258;
 border-radius:7px;
 background:#276eb1;
}
body[data-profile-stage="elementary"] main .kep-adventure-button:nth-child(2){background:#167c86}
body[data-profile-stage="elementary"] main .kep-adventure-button:nth-child(3){background:#be4837}
body[data-profile-stage="elementary"] main .kep-adventure-button:nth-child(4){background:#dfa536;color:#202724}
body[data-profile-stage="elementary"] main .kep-advanced{
 border-left:8px solid #167c86;
}
body[data-profile-stage="elementary"] main .kep-advanced summary{
 cursor:pointer;font:400 20px/1.45 Cinzel,Georgia,serif;
 color:#202724;padding:6px;
}
body[data-profile-stage="elementary"] main .kep-advanced-panels{
 display:grid;
 grid-template-columns:repeat(2,minmax(0,1fr));
 gap:16px;
 margin:15px 0;
}
body[data-profile-stage="elementary"] main .kep-advanced-panels>.card{
 min-width:0;box-shadow:none;
 background:#fff8e9;
 border:2px solid #baab8c;
}
body[data-profile-stage="elementary"] main .grid>.card{
 border:2px solid #b9ab8e;
 background:#fffaf1;
 box-shadow:none;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+1){
 background:#fffaf1;border-top:9px solid #dfa536;color:#202724;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+2){
 background:#fffaf1;border-top:9px solid #167c86;color:#202724;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+3){
 background:#fffaf1;border-top:9px solid #276eb1;color:#202724;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(4n+4){
 background:#fffaf1;border-top:9px solid #be4837;color:#202724;
}
body[data-profile-stage="elementary"] main .grid>.card .actions :is(button,a.button){
 background:#276eb1;color:#fff8e9;
 border:1px solid #28546f;box-shadow:none;
}
body[data-profile-stage="elementary"] main .grid>.card:nth-child(2n) .actions :is(button,a.button){
 background:#167c86;color:#fff8e9;
}
body[data-profile-stage="elementary"] main .grid>.card .actions :is(button,a.button).secondary{
 background:#fff8e9;color:#202724;border:1px solid #315c49;
}
body[data-profile-stage="elementary"] main #gradePreview,
body[data-profile-stage="elementary"] main #academyStudio{
 background:#fffaf1;color:#202724;
 border:2px solid #baab8e;
}
body[data-profile-stage="elementary"] main #gradePreview{border-top:9px solid #be4837}
body[data-profile-stage="elementary"] main #academyStudio{border-top:9px solid #276eb1}
body[data-profile-stage="elementary"] main :is(.kep-adventure,.kep-advanced,.kep-group,.grid>.card) :is(p,li,small,summary,label){
 font-size:16px;line-height:1.55;
}
@media(max-width:780px){
 body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-groups{grid-template-columns:1fr}
 body[data-profile-stage="elementary"] main .kep-advanced-panels{grid-template-columns:1fr}
 body[data-profile-stage="elementary"] main .kep-adventure-links{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:480px){
 body[data-profile-stage="elementary"] main .card.hero .portrait{width:145px;height:145px}
 body[data-profile-stage="elementary"] main .kep-adventure-links{grid-template-columns:1fr}
}
@media print{
 body[data-profile-stage="elementary"] main .kep-advanced{display:block}
 body[data-profile-stage="elementary"] main .kep-adventure{display:none}
}

/* ================================================================
   ELEMENTARY APPROVED HERO V5 — cream canvas / playful flowing accents
   Applied to default appearance only. Native card-color selections win.
   Action buttons are moved below via additive Account Cloud module.
   ================================================================ */
body[data-profile-stage="elementary"]{
 --kep-play-coral:#f05249;
 --kep-play-teal:#008f9c;
 --kep-play-gold:#ffcb23;
 --kep-play-violet:#953fc0;
 --kep-play-blue:#1465ba;
 --kep-play-lime:#65c531;
}
body[data-profile-stage="elementary"][data-theme="parchment"]{
 background:#fff8e9!important;
 background-image:none!important;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced{
 position:relative;
 isolation:isolate;
 overflow:hidden;
 display:grid;
 grid-template-columns:minmax(150px,190px) minmax(0,1fr);
 align-items:center;
 gap:clamp(20px,3vw,40px);
 min-height:245px;
 padding:clamp(25px,3.8vw,43px);
 border:2px solid #1699a5;
 border-radius:14px;
 box-shadow:0 4px 0 rgba(0,143,156,.11);
 color:#162d51;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced[data-kep-custom-color="false"]{
 background:#fff8e9!important;
 background-image:none!important;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced[data-kep-custom-color="false"]::before,
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced[data-kep-custom-color="false"]::after{
 content:"";
 position:absolute;
 pointer-events:none;
 z-index:0;
 opacity:1;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced[data-kep-custom-color="false"]::before{
 left:-12%;top:-65%;width:52%;height:215%;
 background:
 radial-gradient(ellipse 55% 44% at 18% 82%,#03b8b7 0 40%,transparent 41%),
 radial-gradient(ellipse 54% 52% at 16% 22%,#ff534c 0 47%,#ff8732 48% 60%,#ffc827 61% 72%,transparent 73%);
 transform:rotate(-14deg);
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced[data-kep-custom-color="false"]::after{
 right:-18%;top:-42%;width:66%;height:190%;
 background:
 radial-gradient(ellipse 70% 60% at 94% 94%,#9b43c9 0 32%,transparent 33%),
 radial-gradient(ellipse 64% 63% at 78% 5%,#146dd1 0 27%,#00a8d9 28% 39%,#03b8ac 40% 50%,#70cd25 51% 60%,#ffcb23 61% 70%,transparent 71%);
 transform:rotate(10deg);
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced>*{
 position:relative;z-index:1;min-width:0;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced>div:last-child{
 padding:14px clamp(10px,3vw,34px);
 background:rgba(255,248,233,.90);
 border-radius:36% 7px 7px 32% / 45% 7px 7px 42%;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced[data-kep-custom-color="true"]>div:last-child{
 background:transparent;
 border-radius:7px;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .portrait{
 width:clamp(142px,15vw,175px);
 height:clamp(142px,15vw,175px);
 max-width:100%;
 min-width:0;
 border:6px solid #fff8e9;
 outline:3px solid #ffcb23;
 border-radius:50%;
 box-shadow:0 4px 14px rgba(24,52,63,.18);
 font-size:76px;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .eyebrow{
 color:#174b98;
 font:400 16px/1.35 Nunito,Arial,sans-serif;
 letter-spacing:.065em;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced #childName{
 font-size:clamp(36px,4vw,55px);
 font-weight:400;
 line-height:1.2;
 color:inherit;
 margin:9px 0 6px;
 text-shadow:none;
 overflow-wrap:anywhere;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced #childStage{
 color:inherit;
 font:400 18px/1.5 Nunito,Arial,sans-serif;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .pills{
 display:flex;flex-wrap:wrap;gap:10px;margin-top:14px;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .pill{
 border:1px solid rgba(32,39,36,.22);
 border-radius:999px;
 background:#ffcb23;
 color:#202724;
 font:400 16px/1.4 Nunito,Arial,sans-serif;
 padding:8px 13px;
 min-height:36px;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .pill:nth-child(2){background:#99e4dc;color:#123c41}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .pill:nth-child(3){background:#d4b3ed;color:#322247}
body[data-profile-stage="elementary"] main .kep-hero-actions-below{
 display:grid;
 grid-template-columns:repeat(4,minmax(0,1fr));
 gap:12px;
 margin:20px 0 25px;
 padding:0;
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below :is(button,a.button){
 display:inline-flex;
 align-items:center;
 justify-content:center;
 min-width:0;
 min-height:59px;
 padding:12px 11px;
 border:1px solid rgba(32,39,36,.4);
 border-radius:7px;
 box-shadow:none;
 font:400 17px/1.35 Nunito,Arial,sans-serif;
 text-decoration:none;
 text-align:center;
 transition:filter .16s ease;
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below :is(button,a.button):hover{
 filter:brightness(1.07);
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below .kep-hero-edit{
 background:#f05249!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below .kep-hero-start{
 background:#008f9c!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below .kep-first-step{
 background:#ffcb23!important;color:#202724!important;
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below .kep-full-profile{
 background:#953fc0!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools{
 background:#fff8e9;
 border:3px solid #078ea4;
 border-radius:12px;
 box-shadow:none;
 margin:18px 0 28px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group{
 background:#fffaf2;
 border-radius:7px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-school{border-top:5px solid #1465ba}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-learning{border-top:5px solid #008f9c}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-create{border-top:5px solid #f05249}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group-personal{border-top:5px solid #ffcb23}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool{
 border-radius:7px!important;
 min-height:55px;
 font:400 17px/1.35 Nunito,Arial,sans-serif!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool:nth-child(4n+1){
 background:#165bc1!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool:nth-child(4n+2){
 background:#008b92!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool:nth-child(4n+3){
 background:#da3e31!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool:nth-child(4n+4){
 background:#ffcb23!important;color:#202724!important;
}
@media(max-width:790px){
 body[data-profile-stage="elementary"] main .kep-hero-actions-below{grid-template-columns:repeat(2,minmax(0,1fr))}
 body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced{grid-template-columns:145px minmax(0,1fr);gap:15px}
 body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced>div:last-child{padding:12px}
}
@media(max-width:520px){
 body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced{grid-template-columns:1fr;text-align:center;padding:20px 15px;gap:16px}
 body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .portrait{margin:auto}
 body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced .pills{justify-content:center}
 body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced>div:last-child{border-radius:7px}
 body[data-profile-stage="elementary"] main .kep-hero-actions-below :is(button,a.button){font-size:16px;min-height:55px;padding:10px 7px}
}
@media(prefers-reduced-motion:reduce){
 body[data-profile-stage="elementary"] main .kep-hero-actions-below :is(button,a.button){transition:none}
}

/* Accessible vivid fills for 16px+ action labels (cream contrast >=4.5:1). */
body[data-profile-stage="elementary"] main .kep-hero-actions-below .kep-hero-edit{
 background:#cf372e!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main .kep-hero-actions-below .kep-hero-start{
 background:#007b85!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool:nth-child(4n+2){
 background:#007b85!important;color:#fff8e9!important;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools .kep-group .kep-tool:nth-child(4n+3){
 background:#cf372e!important;color:#fff8e9!important;
}

/* ================================================================
   ELEMENTARY TITLE HERO / READING & CORNER STANDARD — V7
   Grade 09 organization, Elementary personality. Pure presentation.
   Keep the child hero, native editor, appearance frames and evidence intact.
   ================================================================ */
body[data-profile-stage="elementary"] main>.elementary-page-title-hero{
 position:relative;
 max-width:100%;
 margin:0 0 26px;
 padding:clamp(33px,4.4vw,55px) clamp(22px,4vw,46px);
 background:#fff8e9;
 border:2px solid #157e91;
 border-top:9px solid #2874b5;
 border-bottom:7px solid #d89d28;
 border-radius:7px;
 text-align:center;
 box-shadow:none;
}
body[data-profile-stage="elementary"] main>.elementary-page-title-hero .eyebrow{
 color:#194f7b!important;
 font:400 16px/1.5 Cinzel,Georgia,serif!important;
 letter-spacing:.06em!important;
 text-transform:uppercase;
 margin:0 auto 9px;
}
body[data-profile-stage="elementary"] main>.elementary-page-title-hero h1{
 color:#174b88!important;
 font:400 clamp(33px,4.3vw,49px)/1.22 Cinzel,Georgia,serif!important;
 margin:0 auto 14px;
 letter-spacing:0;
 overflow-wrap:anywhere;
}
body[data-profile-stage="elementary"] main>.elementary-page-title-hero p.muted{
 color:#354d4d!important;
 font:400 18px/1.65 Nunito,"Avenir Next",Arial,sans-serif!important;
 margin:0 auto;
 max-width:850px;
}
/* Exactly one corners standard for UI surfaces. Never flatten intentionally
   circular portraits or student-selected photo-frame silhouettes. */
body[data-profile-stage="elementary"] main :is(.card,.notice,.activity,.kep-group,.kep-adventure,.kep-advanced,#khaemenesElementaryProfileTools,.elementary-page-title-hero,.kep-hero-actions-below :is(button,a.button),.kep-tool,.kep-adventure-button,.kep-backup :is(button,label),input,select,textarea,button,a.button){
 border-radius:7px!important;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced{
 border-radius:7px!important;
}
body[data-profile-stage="elementary"] main .card.hero.kep-card-enhanced>div:last-child{
 border-radius:7px!important;
}
/* Text minimum for Elementary main profile and its locally added mini tools.
   Titles are deliberately governed separately and remain larger. */
body[data-profile-stage="elementary"] main :is(p,li,label,summary,small,button,input,select,textarea,option,output,legend,figcaption,dt,dd,.status,.muted,.eyebrow,.pill,.kep-tool,.kep-foot,.kep-group-title),
body[data-profile-stage="elementary"] main :is(a,a.button,.activity,.notice){
 font-size:max(16px,1rem)!important;
 font-weight:400;
}
body[data-profile-stage="elementary"] main :is(h2,h3,h4,h5,h6){
 font-size:max(20px,1.25rem);
 font-weight:400;
}
body[data-profile-stage="elementary"] :is(header,nav,footer) :is(a,button,small,span,p){
 font-size:max(16px,1rem);
}
body[data-profile-stage="elementary"] #kepDialog :is(p,label,button,a,textarea,small,span,output){
 font-size:max(16px,1rem)!important;
}
body[data-profile-stage="elementary"] #kepDialog :is(button,input,textarea){
 border-radius:7px!important;
}
@media(max-width:520px){
 body[data-profile-stage="elementary"] main>.elementary-page-title-hero{
  padding:30px 17px;
  margin-bottom:20px;
 }
 body[data-profile-stage="elementary"] main>.elementary-page-title-hero h1{
  font-size:clamp(30px,7vw,38px)!important;
 }
}
@media print{
 body[data-profile-stage="elementary"] main>.elementary-page-title-hero{
  border:1px solid #444;
  background:#fff;
 }
}

/* ================================================================
   ELEMENTARY PROFILE COLLAPSIBLE PANELS — V8
   Native details preserve original section IDs, controls and event handlers.
   Hero remains immediately visible; long sections are compact by default.
   ================================================================ */
body[data-profile-stage="elementary"] main #kepFoldQuickControls{
 display:flex;align-items:center;justify-content:flex-end;gap:11px;flex-wrap:wrap;
 margin:17px 0 9px;padding:10px 0;
}
body[data-profile-stage="elementary"] main #kepFoldQuickControls span{
 margin-right:auto;color:#274c60;font:400 18px/1.4 Nunito,Arial,sans-serif;
}
body[data-profile-stage="elementary"] main #kepFoldQuickControls button{
 border:1px solid #255b75;border-radius:7px;background:#fff8e9;color:#202724;
 min-height:46px;padding:9px 14px;font:400 16px/1.4 Nunito,Arial,sans-serif;
}
body[data-profile-stage="elementary"] main .kep-fold{
 display:block;width:100%;min-width:0;
}
body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary{
 display:flex;align-items:center;gap:12px;
 min-height:54px;padding:10px 12px;
 border:1px solid #aebec0;border-left:6px solid #167c86;border-radius:7px;
 background:#fff8e9;color:#202724;
 font:400 19px/1.4 Nunito,Arial,sans-serif;
 cursor:pointer;list-style:none;
}
body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary::-webkit-details-marker{display:none}
body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary::after{
 content:"+";display:grid;place-items:center;
 flex:none;margin-left:auto;width:30px;height:30px;
 border:1px solid #899c9f;border-radius:7px;background:#fff;color:#202724;
 font:400 22px/1 Nunito,Arial,sans-serif;
}
body[data-profile-stage="elementary"] main .kep-fold[open]>.kep-fold-summary::after{content:"−"}
body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary h2{
 margin:0;font:400 clamp(20px,2.1vw,24px)/1.35 Cinzel,Georgia,serif!important;
 color:#23496c;
}
body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary:focus-visible,
body[data-profile-stage="elementary"] main #kepFoldQuickControls button:focus-visible{
 outline:3px solid #bc8a24;outline-offset:3px;
}
body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-content{
 padding:17px 4px 6px;min-width:0;
}
body[data-profile-stage="elementary"] main .kep-fold:not([open])>.kep-fold-content{display:none}
body[data-profile-stage="elementary"] main .grid>.card:has(>.kep-fold){
 height:auto;min-height:86px;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools>.kep-fold>.kep-fold-summary{
 background:#e8f5f2;border-left-color:#276eb1;
}
body[data-profile-stage="elementary"] main #khaemenesElementaryProfileTools>.kep-fold>.kep-fold-content{
 padding:18px 0 0;
}
body[data-profile-stage="elementary"] main #gradePreview>.kep-fold>.kep-fold-summary{border-left-color:#dfa536}
body[data-profile-stage="elementary"] main #academyStudio>.kep-fold>.kep-fold-summary{border-left-color:#be4837}
body[data-profile-stage="elementary"] main #gradePreview>.kep-fold>.kep-fold-content,
body[data-profile-stage="elementary"] main #academyStudio>.kep-fold>.kep-fold-content{
 padding:19px 3px 4px;
}
body[data-profile-stage="elementary"] main :is(#academyStudio,#gradePreview,#nextSteps,#pinned,#profileStudio){
 scroll-margin-top:155px;
}
@media(max-width:620px){
 body[data-profile-stage="elementary"] main #kepFoldQuickControls{justify-content:center}
 body[data-profile-stage="elementary"] main #kepFoldQuickControls span{width:100%;text-align:center}
 body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary{padding:10px 9px}
}
@media print{
 body[data-profile-stage="elementary"] main #kepFoldQuickControls{display:none}
 body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-content{display:block!important}
 body[data-profile-stage="elementary"] main .kep-fold>.kep-fold-summary::after{display:none}
}
