*{box-sizing:border-box}
body{margin:0;font-family:Arial,sans-serif;background:#fbf8f0;color:#30143d}
button{font:inherit}.page{width:min(1100px,calc(100% - 32px));margin:48px auto}
h1{margin-bottom:8px}h2{margin-top:0}.intro{color:#6d6272;margin-bottom:28px}
.summary,.heading-card,.lesson-card,.assessment-start,.assessment-card,.results-card,.profile-banner{background:white;border:1px solid #e4dce7;border-radius:18px;padding:20px}
.summary{margin-bottom:18px}.profile-banner{margin-bottom:18px;background:#f3eafb}
.profile-banner strong{color:#5d1889}.assessment-start{display:flex;justify-content:space-between;align-items:center;gap:20px;margin-bottom:32px;background:#f5f9d6}
.assessment-start p,.world-card p,.mission-card p,.heading-card p,.lesson-card p,.results-card p,.notice p{color:#6d6272;line-height:1.5}
.primary-button{border:0;background:#5d1889;color:white;border-radius:12px;padding:13px 18px;font-weight:bold;cursor:pointer}
.primary-button:disabled{opacity:.45;cursor:not-allowed}.back-button{border:0;background:none;color:#5d1889;font-weight:bold;padding:0;margin-bottom:24px;cursor:pointer}
.eyebrow,.subject{font-size:12px;font-weight:bold;text-transform:uppercase;letter-spacing:1.2px;color:#5d1889}.eyebrow{margin:0 0 8px}
.world-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:18px}.world-card,.mission-card{width:100%;text-align:left;background:white;border:1px solid #e4dce7;border-radius:18px;padding:20px;cursor:pointer;color:inherit}
.world-card:hover,.mission-card:hover{transform:translateY(-2px)}.world-card .dot{width:18px;height:18px;border-radius:50%;margin-bottom:14px}
.world-card h3,.mission-card h3{margin:0 0 8px}.world-card strong{display:block;margin-top:14px}.heading-card{margin-bottom:20px}
.mission-list,.task-list{display:grid;gap:12px}.subject{display:inline-block;margin-bottom:8px}.lesson-card{max-width:850px}.lesson-card h2{font-size:32px;margin-bottom:10px}
.hook{font-size:18px}.lesson-block{border-top:1px solid #eee5f2;margin-top:24px;padding-top:20px}.lesson-block h3{margin-top:0}
.lesson-block li{margin-bottom:8px;line-height:1.5}.task{background:#faf7fc;border:1px solid #e4dce7;border-radius:14px;padding:16px}
.task strong{display:block;margin-bottom:6px}.task small{color:#6d6272}
.assessment-card,.results-card{max-width:780px;margin:0 auto}.assessment-top{display:flex;justify-content:space-between;align-items:center;gap:12px}
.progress-track{height:8px;background:#eee8f2;border-radius:999px;overflow:hidden;margin:16px 0 20px}.progress-fill{height:100%;width:0;background:#5d1889;transition:width .2s}
.adaptive-note{background:#f5f9d6;border-radius:12px;padding:12px 14px;color:#53645e;margin-bottom:22px}
.option-list{display:grid;gap:12px;margin-top:24px}.option-button{width:100%;text-align:left;border:2px solid #e4dce7;background:white;border-radius:14px;padding:16px;cursor:pointer;color:#30143d}
.option-button.selected{border-color:#5d1889;background:#f5eef9}.assessment-actions{display:flex;justify-content:flex-end;margin-top:24px}
.result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:24px 0}.result-card{background:#faf7fc;border:1px solid #e4dce7;border-radius:14px;padding:16px}
.result-card strong{display:block;font-size:18px;color:#5d1889;margin:6px 0}.result-card small{display:block;color:#6d6272;line-height:1.5}
.support-pill{display:inline-block;margin-top:10px;border-radius:999px;padding:5px 9px;background:#eee5f2;color:#5d1889;font-size:12px;font-weight:bold}
.notice{background:#f5f9d6;border-radius:14px;padding:16px;margin:20px 0}.error{color:#8d2f2f;white-space:pre-wrap}
@media(max-width:800px){.world-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.assessment-start{align-items:flex-start;flex-direction:column}}
@media(max-width:520px){.world-grid,.result-grid{grid-template-columns:1fr}.page{margin-top:24px}.lesson-card h2{font-size:26px}}

.skill-card{background:#f7f1fb;border:1px solid #dccbe7;border-radius:14px;padding:16px}
.skill-card h4{margin:16px 0 8px;color:#5d1889}
.skill-card ul{margin-bottom:0}

.language-bar{
  display:flex;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
  background:white;
  border:1px solid #e4dce7;
  border-radius:16px;
  padding:14px 16px;
  margin-bottom:18px;
}
.language-bar select{
  border:1px solid #cdbfd6;
  border-radius:10px;
  padding:9px 12px;
  background:white;
  color:#30143d;
}
.language-bar span{
  color:#6d6272;
  font-size:13px;
}
.language-active{
  background:#f5f9d6;
  border:1px solid #dce7a1;
  border-radius:12px;
  padding:10px 12px;
  margin-bottom:16px;
  color:#53645e;
}

.speech-row{display:flex;justify-content:flex-end;margin-bottom:14px}
.speech-button{
  border:1px solid #cdbfd6;
  background:#fff;
  color:#5d1889;
  border-radius:12px;
  padding:9px 13px;
  font-weight:bold;
  cursor:pointer;
}
.speech-button[aria-pressed="true"]{
  background:#5d1889;
  color:white;
  border-color:#5d1889;
}

.choice-options{display:grid;gap:10px;margin:14px 0}
.choice-option{
  width:100%;
  text-align:left;
  border:2px solid #e4dce7;
  background:#fff;
  color:#30143d;
  border-radius:12px;
  padding:12px 14px;
  cursor:pointer;
}
.choice-option:hover{border-color:#bda7ca}
.choice-option.selected{border-color:#5d1889;background:#f5eef9}
.choice-option.correct{border-color:#6f9e55;background:#eef7e8}
.choice-option.incorrect{border-color:#bd6c6c;background:#fbefef}
.task-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-top:12px}
.task-feedback{margin-top:12px;padding:12px 14px;border-radius:12px;background:#f5f9d6;line-height:1.5}
.task-feedback.error{background:#fbefef;color:#7f3030}
.task-feedback strong{display:block;margin-bottom:4px}
.task-coming{margin-top:10px;font-size:12px;color:#6d6272;font-style:italic}

.number-answer-row{
  display:flex;
  gap:10px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:14px;
}
.number-answer-row input{
  min-width:160px;
  flex:1;
  border:2px solid #e4dce7;
  border-radius:12px;
  padding:12px 14px;
  font:inherit;
  color:#30143d;
  background:#fff;
}
.number-answer-row input:focus{
  outline:none;
  border-color:#5d1889;
}
.number-unit{
  font-weight:bold;
  color:#6d6272;
}
.order-list{
  display:grid;
  gap:10px;
  margin-top:14px;
}
.order-item{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto auto;
  gap:8px;
  align-items:center;
  background:#fff;
  border:2px solid #e4dce7;
  border-radius:12px;
  padding:10px 12px;
}
.order-item button{
  border:1px solid #cdbfd6;
  background:#fff;
  color:#5d1889;
  width:36px;
  height:34px;
  border-radius:9px;
  cursor:pointer;
  font-weight:bold;
}
.order-item button:disabled{
  opacity:.35;
  cursor:not-allowed;
}
.order-item.correct{
  border-color:#6f9e55;
  background:#eef7e8;
}

.special-control{
  margin-top:14px;
  border:1px solid #e4dce7;
  border-radius:14px;
  background:#faf7fc;
  padding:14px;
}
.special-row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.special-button{
  border:1px solid #cdbfd6;
  background:#fff;
  color:#5d1889;
  border-radius:10px;
  padding:9px 12px;
  font-weight:bold;
  cursor:pointer;
}
.special-button:disabled{opacity:.4;cursor:not-allowed}
.array-groups{display:flex;gap:8px;flex-wrap:wrap;margin:12px 0}
.array-group{display:grid;grid-template-columns:repeat(3,12px);gap:3px;padding:8px;border:1px solid #d9cbe3;border-radius:10px;background:#fff}
.array-dot{width:12px;height:12px;border-radius:50%;background:#5d1889}
.shadow-demo{display:flex;align-items:flex-end;gap:20px;margin:14px 0;min-height:110px}
.shadow-card{width:34px;height:52px;background:#b692c9;border-radius:6px}
.shadow-shape{background:#5d1889;opacity:.35;border-radius:8px}
.meter{height:12px;background:#eee8f2;border-radius:999px;overflow:hidden;flex:1;min-width:180px}
.meter > span{display:block;height:100%;background:#5d1889}
.compass-grid{display:grid;grid-template-columns:repeat(5,42px);grid-template-rows:repeat(5,42px);gap:4px;margin:14px 0}
.compass-cell{display:grid;place-items:center;border:1px solid #e4dce7;border-radius:8px;background:#fff;font-size:14px}
.compass-cell.current{background:#f5eef9;border-color:#5d1889;font-weight:bold}
.compass-cell.target{outline:2px dashed #7c9b55}
.tile-grid{display:grid;grid-template-columns:repeat(4,44px);gap:6px;margin:14px 0}
.tile{
  width:44px;height:44px;border:2px solid #d9cbe3;background:#fff;border-radius:8px;cursor:pointer
}
.tile.selected{background:#5d1889;border-color:#5d1889}
.perimeter-box{position:relative;width:220px;height:160px;margin:18px auto}
.edge{position:absolute;background:#d7cbe0;cursor:pointer;border-radius:8px}
.edge.selected{background:#5d1889}
.edge.top,.edge.bottom{left:20px;width:180px;height:14px}
.edge.top{top:0}.edge.bottom{bottom:0}
.edge.left,.edge.right{top:20px;height:120px;width:14px}
.edge.left{left:0}.edge.right{right:0}
.circuit-board{display:flex;gap:14px;align-items:center;flex-wrap:wrap;margin:14px 0}
.switch{
  border:2px solid #d9cbe3;background:#fff;border-radius:12px;padding:12px;cursor:pointer
}
.switch.closed{border-color:#5d1889;background:#f5eef9}
.lamp{width:54px;height:54px;border-radius:50%;display:grid;place-items:center;border:2px solid #d9cbe3;background:#fff}
.lamp.on{background:#f5f2a6;border-color:#afa32e}
.chart-bars{display:flex;align-items:flex-end;gap:18px;min-height:170px;margin:18px 0}
.chart-bar-wrap{display:flex;flex-direction:column;align-items:center;gap:7px}
.chart-bar{width:54px;border:2px solid #d9cbe3;background:#ede5f2;border-radius:8px 8px 0 0;cursor:pointer}
.chart-bar.selected{border-color:#5d1889;background:#c6a7d7}
.chart-bar.correct{border-color:#6f9e55;background:#cfe5c2}

.journey-progress{
  background:#fff;
  border:1px solid #e4dce7;
  border-radius:18px;
  padding:16px 20px;
  margin-bottom:22px;
}
.journey-progress-top{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  margin-bottom:10px;
}
.journey-progress-top strong{color:#5d1889}
.world-card.locked,
.mission-card.locked{
  opacity:.55;
  cursor:not-allowed;
  transform:none!important;
}
.world-card.completed,
.mission-card.completed{
  border-color:#91b875;
  background:#f4f9ef;
}
.status-pill{
  display:inline-block;
  margin-top:12px;
  padding:5px 9px;
  border-radius:999px;
  background:#eee5f2;
  color:#5d1889;
  font-size:12px;
  font-weight:bold;
}
.status-pill.done{
  background:#e6f3dc;
  color:#527341;
}
.status-pill.locked{
  background:#f0eeee;
  color:#777;
}
.mission-progress{
  margin:18px 0;
  padding:16px;
  border:1px solid #e4dce7;
  border-radius:14px;
  background:#faf7fc;
}
.mission-progress.done{
  background:#f0f8e9;
  border-color:#b9d6a5;
}
.mission-progress-row{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:12px;
  flex-wrap:wrap;
}
.task.persisted-complete{
  border-color:#b9d6a5;
}
.task-complete-badge{
  display:inline-block;
  margin-top:10px;
  padding:5px 9px;
  border-radius:999px;
  background:#e6f3dc;
  color:#527341;
  font-size:12px;
  font-weight:bold;
}

.backend-status{
  display:flex;
  align-items:center;
  gap:9px;
  margin:0 0 14px;
  font-size:14px;
  color:#5f5664;
}
.backend-dot{
  width:10px;
  height:10px;
  border-radius:50%;
  display:inline-block;
  background:#b7b0bb;
}
.backend-dot.connected{background:#6f9e55}
.backend-dot.offline{background:#c88945}
.backend-dot.checking{background:#9b90a1}

.tutor-card{
  border:1px solid #d9cbe3;
  background:#fbf8fd;
  border-radius:16px;
  padding:18px;
}
.tutor-heading{
  display:flex;
  justify-content:space-between;
  gap:14px;
  align-items:flex-start;
  margin-bottom:14px;
}
.tutor-heading h3{margin-top:0}
.tutor-heading p{margin-bottom:0}
.tutor-local-badge{
  white-space:nowrap;
  padding:5px 9px;
  border-radius:999px;
  background:#eee5f2;
  color:#5d1889;
  font-size:12px;
  font-weight:bold;
}
.tutor-messages{
  display:grid;
  gap:10px;
  margin:14px 0;
}
.tutor-message{
  max-width:88%;
  padding:11px 13px;
  border-radius:14px;
  line-height:1.5;
  white-space:pre-wrap;
}
.tutor-message.user{
  justify-self:end;
  background:#5d1889;
  color:#fff;
}
.tutor-message.assistant{
  justify-self:start;
  background:#fff;
  border:1px solid #e4dce7;
  color:#30143d;
}
.tutor-message strong{
  display:block;
  font-size:12px;
  margin-bottom:4px;
}
.tutor-label{
  display:block;
  font-weight:bold;
  margin-bottom:7px;
}
.tutor-question{
  width:100%;
  box-sizing:border-box;
  border:2px solid #e4dce7;
  border-radius:12px;
  padding:12px 14px;
  font:inherit;
  resize:vertical;
  color:#30143d;
  background:#fff;
}
.tutor-question:focus{
  outline:none;
  border-color:#5d1889;
}
.tutor-actions{
  display:flex;
  justify-content:space-between;
  gap:12px;
  align-items:center;
  flex-wrap:wrap;
  margin-top:10px;
}
.tutor-status{
  min-height:20px;
  color:#6d6272;
  font-size:13px;
}

.next-activity-focus{
  outline:3px solid rgba(93, 24, 137, 0.22);
  outline-offset:4px;
  transition:outline-color .35s ease;
}

.path-card{
  display:flex;
  justify-content:space-between;
  gap:18px;
  align-items:center;
  background:#f7f1fa;
  border:1px solid #d9cbe3;
  border-radius:18px;
  padding:18px 20px;
  margin:0 0 22px;
}
.path-card[hidden]{display:none}
.path-card h3{margin:4px 0 7px}
.path-card p{margin:4px 0}
.path-retrieval{
  font-size:13px;
  color:#6d6272;
  margin-top:9px!important;
}
.intervention-card{
  background:#fff9e8;
  border:1px solid #ead7a1;
}
.intervention-card[hidden]{display:none}
.intervention-card p{line-height:1.55}
.storyteller-card{
  margin-top:22px;
  padding:20px;
  border:1px solid #d9cbe3;
  border-radius:18px;
  background:#fbf8fd;
}
.storyteller-card[hidden]{display:none}


/* ==========================================================
   STEP 28.5 — ORIGINAL ANANSESEM VISUAL RESTORATION
   The working Step 28 architecture remains unchanged.
   These styles restore the V8 purple/lime brand language,
   paper cards, Story Map atmosphere and responsive rhythm.
   ========================================================== */

:root{
  --night:#351044;
  --night2:#4a145f;
  --night3:#5d1889;
  --mint:#d0ee30;
  --mint2:#b4d333;
  --cream:#fbf8f0;
  --paper:#fffefd;
  --ink:#30143d;
  --muted:#6d6272;
  --line:#e4dce7;
  --gold:#d0ee30;
  --coral:#f1a16e;
  --sky:#b9dff0;
  --lavender:#c5a1ff;
  --brand-purple:#5d1889;
  --brand-purple-dark:#351044;
  --brand-lime:#d0ee30;
  --brand-lavender:#c5a1ff;
  --shadow:0 14px 42px rgba(53,16,68,.09);
}

html,body{height:100%;}
body{
  margin:0;
  overflow:hidden;
  background:var(--cream);
  color:var(--ink);
  font-family:"Trebuchet MS","Avenir Next","Segoe UI",sans-serif;
}
#quest-app{
  height:100vh;
  height:100dvh;
  overflow:auto;
  background:
    radial-gradient(circle at 8% 14%,rgba(197,161,255,.12),transparent 27%),
    radial-gradient(circle at 92% 88%,rgba(208,238,48,.10),transparent 25%),
    var(--cream);
  color:var(--ink);
  isolation:isolate;
}
#quest-app *{box-sizing:border-box;}
#quest-app [hidden]{display:none!important;}
#quest-app h1,#quest-app h2,#quest-app h3,#quest-app h4,#quest-app p{margin-top:0;}
#quest-app button,#quest-app textarea,#quest-app select,#quest-app input{font:inherit;}
#quest-app button{transition:transform .12s ease,filter .12s ease,box-shadow .12s ease;}
#quest-app button:hover:not(:disabled){filter:brightness(1.025);}
#quest-app button:active:not(:disabled){transform:translateY(1px);}
#quest-app :focus-visible{outline:3px solid #704000;outline-offset:4px;}

.topbar{
  position:sticky;
  top:0;
  z-index:50;
  min-height:76px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:22px;
  padding:14px max(22px,calc((100vw - 1430px)/2));
  color:#f7f9ed;
  background:linear-gradient(110deg,var(--brand-purple-dark),#4b1165 60%,var(--brand-purple));
  border-bottom:1px solid rgba(255,255,255,.12);
  box-shadow:0 8px 28px rgba(53,16,68,.16);
}
.brand{display:flex;align-items:center;gap:11px;min-width:0;}
.brandmark{
  width:46px;height:46px;display:grid;place-items:center;overflow:hidden;
  flex:0 0 auto;border-radius:14px;background:var(--brand-lavender);
  border:1px solid rgba(225,208,255,.42);
}
.brandmark img{width:100%;height:100%;object-fit:cover;display:block;}
.brand strong{display:block;font-size:20px;letter-spacing:-.45px;}
.brand small{display:block;margin-top:2px;color:#e7d8ef;font-size:10px;letter-spacing:1.25px;text-transform:uppercase;}
.topbar-flourish{color:var(--brand-lime);font-size:20px;letter-spacing:4px;opacity:.92;white-space:nowrap;}

.page{
  width:min(1180px,calc(100% - 40px));
  margin:0 auto;
  padding:30px 0 54px;
}
.brand-hero{
  display:grid;
  grid-template-columns:minmax(155px,260px) 1fr;
  gap:30px;
  align-items:center;
  padding:28px 31px;
  margin-bottom:22px;
  background:linear-gradient(135deg,#f3eafb,#fff 58%,#f1f7c5);
  border:1px solid #ddcde8;
  border-radius:25px;
  box-shadow:var(--shadow);
  overflow:hidden;
  position:relative;
}
.brand-hero::after{
  content:"";position:absolute;width:170px;height:170px;border-radius:50%;right:-50px;top:-72px;
  border:26px solid rgba(93,24,137,.05);pointer-events:none;
}
.brand-hero-logo{display:grid;place-items:center;min-height:125px;}
.brand-hero-logo img{width:100%;max-width:235px;max-height:128px;object-fit:contain;}
.brand-hero-copy{min-width:0;}
.brand-hero h1{font-size:clamp(30px,4vw,45px);letter-spacing:-1.5px;line-height:1.06;margin:3px 0 10px;color:var(--brand-purple);}
.brand-hero .intro{margin:0;color:#52665a;font-size:16px;line-height:1.65;max-width:650px;}

.eyebrow,.subject{
  color:var(--brand-purple);
  font-size:11px;
  font-weight:900;
  text-transform:uppercase;
  letter-spacing:1.4px;
}
.eyebrow{margin:0 0 8px;}

.summary,.heading-card,.lesson-card,.assessment-start,.assessment-card,.results-card,.profile-banner,
.language-bar,.journey-progress,.backend-status{
  background:var(--paper);
  border:1px solid var(--line);
  box-shadow:0 8px 26px rgba(53,16,68,.045);
}
.summary{border-radius:18px;padding:15px 18px;margin-bottom:14px;color:#56465e;}
.profile-banner{border-radius:18px;padding:17px 19px;margin-bottom:14px;background:#f4edf8;}
.profile-banner strong{color:var(--brand-purple);}

.language-bar{
  border-radius:16px;padding:13px 15px;margin-bottom:14px;
  display:flex;align-items:center;gap:12px;flex-wrap:wrap;
}
.language-bar select{
  border:1px solid #cdbfd6;border-radius:10px;padding:9px 12px;background:white;color:var(--ink);font-weight:700;
}
.language-bar span{color:#6f6076;font-size:12px;}

.backend-status{
  display:inline-flex;align-items:center;gap:8px;border-radius:999px;padding:8px 12px;
  margin:0 0 14px;font-size:12px;color:#5a4c60;
}
.backend-dot{width:8px;height:8px;border-radius:50%;background:#d0b866;box-shadow:0 0 0 3px rgba(208,184,102,.16);}
.backend-dot.online{background:#7cae55;box-shadow:0 0 0 3px rgba(124,174,85,.14);}
.backend-dot.offline{background:#bf6767;box-shadow:0 0 0 3px rgba(191,103,103,.14);}

.journey-progress{border-radius:20px;padding:17px 19px;margin-bottom:18px;}
.journey-progress-top{display:flex;align-items:center;justify-content:space-between;gap:14px;margin-bottom:9px;font-size:13px;}
.journey-progress-top strong{color:var(--brand-purple);}
.progress-track{height:8px;border-radius:999px;overflow:hidden;background:#e6e8dc;margin:0;}
.progress-fill{height:100%;background:linear-gradient(90deg,var(--brand-purple),#7c39a1);border-radius:999px;}

.path-card{
  display:grid;grid-template-columns:minmax(0,1fr) auto;gap:22px;align-items:center;
  margin:0 0 22px;padding:22px 24px;border-radius:23px;
  background:linear-gradient(145deg,#e6f56e,var(--brand-lime));
  border:1px solid #c0d82a;box-shadow:0 12px 30px rgba(92,110,18,.09);color:var(--ink);
}
.path-card h3{font-size:24px;margin:3px 0 8px;letter-spacing:-.5px;}
.path-card p{color:#49513c;margin:5px 0;line-height:1.55;}
.path-card .eyebrow{color:#4c5d09;}
.path-retrieval{font-size:12px!important;font-weight:700;}

.assessment-start{
  border-radius:20px;padding:21px 23px;margin-bottom:27px;
  display:flex;justify-content:space-between;align-items:center;gap:20px;
  background:linear-gradient(135deg,#f5f2e5,#f3eafb 52%,#f3f8ca);
}
.assessment-start h2{font-size:24px;letter-spacing:-.5px;margin-bottom:6px;}
.assessment-start p{color:#5f665e;line-height:1.55;}

.primary-button{
  border:0;border-radius:12px;padding:12px 17px;background:var(--brand-purple);color:#fffdf2;
  font-weight:900;cursor:pointer;box-shadow:0 4px 0 #350c4b;min-height:44px;
}
.primary-button:hover:not(:disabled){transform:translateY(-1px);}
.primary-button:disabled{opacity:.45;cursor:not-allowed;box-shadow:none;}
.back-button{
  border:0;background:transparent;color:var(--brand-purple);font-weight:900;padding:8px 2px;margin-bottom:15px;cursor:pointer;
}
.speech-button{
  border:1px solid #d3c6db;background:white;color:var(--brand-purple);border-radius:11px;padding:8px 12px;font-weight:900;cursor:pointer;
}
.speech-button[aria-pressed="true"]{background:var(--brand-purple);color:white;border-color:var(--brand-purple);}

/* STORY MAP */
#worlds-section>h2{font-size:31px;letter-spacing:-1px;margin:28px 0 14px;}
.world-grid{
  position:relative;display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px;
  padding:27px;border-radius:27px;overflow:hidden;
  background:
    radial-gradient(ellipse at 45% 70%,#27524e 0,transparent 64%),
    radial-gradient(circle at 85% 15%,rgba(197,161,255,.15),transparent 20%),
    var(--night);
  border:1px solid #4f2660;
  box-shadow:0 18px 44px rgba(53,16,68,.13);
}
.world-grid::before{
  content:"STORY MAP";position:absolute;left:25px;top:16px;color:var(--brand-lime);
  font-size:9px;font-weight:900;letter-spacing:2px;opacity:.82;
}
.world-card{
  position:relative;min-height:210px;text-align:left;padding:24px 19px 18px;margin-top:12px;
  border-radius:20px;border:1px solid rgba(255,255,255,.15);
  background:linear-gradient(150deg,rgba(255,255,255,.11),rgba(255,255,255,.055));
  color:var(--cream);cursor:pointer;box-shadow:inset 0 1px rgba(255,255,255,.06);
}
.world-card::after{content:"";position:absolute;inset:7px;border-radius:16px;border:1px dashed rgba(255,255,255,.06);pointer-events:none;}
.world-card .dot{width:42px;height:42px;border-radius:14px;margin-bottom:14px;box-shadow:0 7px 18px rgba(0,0,0,.18);border:3px solid rgba(255,255,255,.45);}
.world-card h3{font-size:20px;line-height:1.15;margin:0 0 8px;color:#fff;}
.world-card p{font-size:12px!important;line-height:1.55!important;color:#e7d8ef!important;margin:0 0 12px;}
.world-card strong{color:var(--brand-lime);font-size:12px;}
.world-card:hover:not(:disabled){transform:translateY(-3px);border-color:rgba(208,238,48,.55);}
.world-card.completed{background:linear-gradient(145deg,rgba(208,238,48,.18),rgba(255,255,255,.08));border-color:rgba(208,238,48,.56);}
.world-card.locked{opacity:.42;filter:saturate(.55);}
.status-pill{display:inline-flex;margin-top:12px;padding:5px 9px;border-radius:999px;background:#f0e6f6;color:#61247f;font-size:10px;font-weight:900;letter-spacing:.2px;}
.world-card .status-pill{background:rgba(255,255,255,.12);color:#fff;}
.status-pill.done{background:#dcecbf;color:#365016;}
.status-pill.locked{background:#eee;color:#6f6a71;}

/* WORLD + MISSIONS */
.heading-card{border-radius:23px;padding:22px 24px;margin-bottom:14px;background:linear-gradient(135deg,#fffefd,#faf6ff);}
.heading-card h2{font-size:31px;letter-spacing:-.9px;margin:3px 0 8px;}
.heading-card p{color:#5f665e;line-height:1.62;}
.mission-list{display:grid;gap:10px;}
.mission-card{
  width:100%;display:grid;grid-template-columns:minmax(0,1fr) auto;text-align:left;gap:4px 16px;
  padding:17px 20px;border-radius:16px;border:1px solid var(--line);background:var(--paper);color:var(--ink);cursor:pointer;
}
.mission-card .subject{grid-column:1;font-size:9px;}
.mission-card h3{grid-column:1;font-size:17px;letter-spacing:-.25px;margin:2px 0 4px;}
.mission-card p{grid-column:1;color:#617064!important;font-size:12px!important;line-height:1.5!important;margin:0;}
.mission-card .status-pill{grid-column:2;grid-row:1/4;align-self:center;justify-self:end;margin:0;}
.mission-card:hover:not(:disabled){transform:translateY(-1px);border-color:#cdb8da;box-shadow:0 9px 22px rgba(53,16,68,.06);}
.mission-card.completed{background:#f4f8ed;border-color:#cadbb2;}
.mission-card.locked{opacity:.52;cursor:not-allowed;}

/* LESSON WORKSPACE */
#lesson-section{max-width:1120px;margin:0 auto;}
.lesson-card{max-width:none;border-radius:26px;padding:0;overflow:hidden;box-shadow:var(--shadow);}
.lesson-card>.speech-row{padding:20px 28px 0;margin:0;}
.lesson-card>#lesson-subject,.lesson-card>#lesson-title,.lesson-card>#lesson-hook,
.lesson-card>.lesson-block,.lesson-card>#mission-progress{margin-left:30px;margin-right:30px;}
.lesson-card>#lesson-subject{display:inline-flex;margin-top:4px;margin-bottom:8px;padding:6px 10px;border-radius:9px;background:#f0e6f6;}
.lesson-card>#lesson-title{font-size:clamp(29px,4vw,40px);letter-spacing:-1.1px;line-height:1.12;margin-bottom:12px;}
.lesson-card>#lesson-hook{font-size:16px;color:#52665a!important;line-height:1.7!important;max-width:820px;}
.lesson-block{border-top:1px solid var(--line);padding-top:20px;margin-top:22px;}
.lesson-block h3{font-size:17px;letter-spacing:-.25px;margin-bottom:12px;}
.lesson-block li{line-height:1.58;margin-bottom:7px;}
#lesson-teach{background:#edf3e6;border:1px solid #dbe6d2;border-radius:16px;padding:17px 20px 12px 38px;}
#lesson-curriculum{background:#faf7fc;border:1px solid var(--line);border-radius:14px;padding:14px 16px;color:#56465e!important;}
.skill-card{background:#f7f1fb;border:1px solid #dccbe7;border-radius:17px;padding:18px!important;}
.skill-card h4{color:var(--brand-purple);}
.mission-progress{border-radius:16px;background:#f4f8ed;border:1px solid #dce8d2;margin-top:20px;padding:14px 16px;}
.task-list{display:grid;gap:12px;}
.task{background:#faf7fc;border:1px solid var(--line);border-radius:17px;padding:17px;}
.task>strong{color:var(--ink);font-size:15px;}
.choice-option,.option-button{border:2px solid var(--line);background:white;color:var(--ink);border-radius:13px;padding:13px 14px;}
.choice-option:hover,.option-button:hover{border-color:#bda7ca;}
.choice-option.selected,.option-button.selected{border-color:var(--brand-purple);background:#f5eef9;}
.choice-option.correct{border-color:#78a65a;background:#eef7e8;}
.choice-option.incorrect{border-color:#bd6c6c;background:#fbefef;}
.task-feedback{background:#f0f7cb;border:1px solid #d8e999;border-radius:13px;}
.task-feedback.error{background:#fbefef;border-color:#efd0d0;}

/* AI feels native to Anansesem rather than bolted on. */
.intervention-card{background:linear-gradient(135deg,#fff9de,#f1f7c5);border:1px solid #d9e38e;border-radius:18px;padding:18px!important;}
.intervention-card .eyebrow{color:#6f7f13;}
.tutor-card{
  margin-bottom:30px!important;padding:21px!important;border:0!important;border-radius:22px!important;
  color:var(--cream);background:linear-gradient(145deg,#351044,#5d1889)!important;
  box-shadow:0 16px 34px rgba(53,16,68,.18);
}
.tutor-card h3,.tutor-card p,.tutor-card label{color:var(--cream)!important;}
.tutor-card .tutor-local-badge{background:var(--brand-lime);color:var(--brand-purple-dark);}
.tutor-card .tutor-question{background:#fff;color:var(--ink);border-color:#e2d5e9;}
.tutor-card .tutor-message.assistant{background:#fff;color:var(--ink);border-color:#e4dce7;}
.tutor-card .tutor-message.user{background:var(--brand-lime);color:var(--brand-purple-dark);}
.tutor-heading{display:flex;align-items:flex-start;justify-content:space-between;gap:15px;margin-bottom:12px;}
.tutor-local-badge{display:inline-flex;white-space:nowrap;padding:5px 9px;border-radius:999px;background:#eee5f2;color:var(--brand-purple);font-size:10px;font-weight:900;}
.tutor-messages{display:grid;gap:9px;margin:12px 0;}
.tutor-message{max-width:88%;padding:11px 13px;border-radius:14px;line-height:1.5;white-space:pre-wrap;}
.tutor-message.user{justify-self:end;background:var(--brand-purple);color:#fff;}
.tutor-message.assistant{justify-self:start;background:#fff;border:1px solid var(--line);color:var(--ink);}
.tutor-message strong{display:block;font-size:10px;margin-bottom:4px;letter-spacing:.6px;text-transform:uppercase;}
.tutor-label{display:block;font-weight:900;margin-bottom:7px;}
.tutor-question{width:100%;border:2px solid var(--line);border-radius:12px;padding:12px 14px;resize:vertical;color:var(--ink);background:#fff;}
.tutor-question:focus{outline:none;border-color:var(--brand-purple);}
.tutor-actions{display:flex;justify-content:space-between;gap:12px;align-items:center;flex-wrap:wrap;margin-top:10px;}
.tutor-status{font-size:12px;color:#766a7a;}
.tutor-card .tutor-status{color:#e7d8ef;}

.storyteller-card{
  margin-top:20px;padding:22px;border:1px solid #d5c4df;border-radius:20px;
  background:linear-gradient(135deg,#f7f0fb,#fff 60%,#f0f7cb);box-shadow:var(--shadow);
}
.storyteller-card h3{color:var(--brand-purple);font-size:22px;margin-bottom:6px;}
.storyteller-card .eyebrow{color:#6b258f;}

/* ASSESSMENT + RESULTS */
.assessment-card,.results-card{max-width:820px;margin:0 auto;border-radius:24px;padding:26px;box-shadow:var(--shadow);}
.assessment-card h2{font-size:27px;letter-spacing:-.6px;line-height:1.28;}
.assessment-top{display:flex;justify-content:space-between;gap:12px;align-items:center;}
.adaptive-note{background:#f1f1e6;border:1px solid #e1e1d0;border-radius:13px;padding:12px 14px;color:#56625a;margin:18px 0;}
.option-list{display:grid;gap:10px;margin-top:20px;}
.assessment-actions{display:flex;justify-content:flex-end;margin-top:21px;}
.result-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;margin:22px 0;}
.result-card{background:#faf7fc;border:1px solid var(--line);border-radius:16px;padding:16px;}
.result-card strong{color:var(--brand-purple);}
.notice{background:#f0f7cb;border:1px solid #d8e999;border-radius:15px;padding:16px;margin:18px 0;}
.support-pill{background:#f0e6f6;color:#61247f;}

/* Controls used by special interactive activities */
.special-control{background:#faf7fc;border-color:var(--line);border-radius:16px;}
.special-button,.order-item button{color:var(--brand-purple);border-color:#d4c6dc;}
.array-dot,.meter>span,.edge.selected,.tile.selected{background:var(--brand-purple);}
.compass-cell.current,.switch.closed{border-color:var(--brand-purple);background:#f5eef9;}
.chart-bar.selected{border-color:var(--brand-purple);background:#c6a7d7;}
.number-answer-row input:focus{border-color:var(--brand-purple);}

.next-activity-focus{outline-color:rgba(93,24,137,.28)!important;}

@media(max-width:880px){
  .page{width:min(100% - 30px,1180px);padding-top:23px;}
  .brand-hero{grid-template-columns:150px 1fr;padding:23px;gap:20px;}
  .world-grid{grid-template-columns:repeat(2,minmax(0,1fr));}
  .path-card{grid-template-columns:1fr;}
}
@media(max-width:600px){
  .topbar{padding:11px 15px;min-height:66px;}
  .brandmark{width:39px;height:39px;border-radius:12px;}
  .brand strong{font-size:17px;}
  .brand small{font-size:8px;letter-spacing:1px;}
  .topbar-flourish{display:none;}
  .page{width:min(100% - 24px,1180px);padding:16px 0 32px;}
  .brand-hero{grid-template-columns:1fr;padding:20px;text-align:left;gap:10px;}
  .brand-hero-logo{display:none;}
  .brand-hero h1{font-size:31px;}
  .language-bar{align-items:flex-start;}
  .assessment-start{flex-direction:column;align-items:stretch;padding:18px;}
  .assessment-start .primary-button{width:100%;}
  .world-grid{grid-template-columns:1fr;padding:22px 14px 14px;}
  .world-card{min-height:0;margin-top:7px;padding:19px 17px;}
  .mission-card{grid-template-columns:1fr;}
  .mission-card .status-pill{grid-column:1;grid-row:auto;justify-self:start;margin-top:8px;}
  .lesson-card>.speech-row{padding:17px 18px 0;}
  .lesson-card>#lesson-subject,.lesson-card>#lesson-title,.lesson-card>#lesson-hook,
  .lesson-card>.lesson-block,.lesson-card>#mission-progress{margin-left:18px;margin-right:18px;}
  .lesson-card>#lesson-title{font-size:29px;}
  .result-grid{grid-template-columns:1fr;}
  .tutor-heading{flex-direction:column;}
}
@media(max-width:380px){
  .brand small{display:none;}
  .page{width:min(100% - 18px,1180px);}
}
@media(prefers-reduced-motion:reduce){
  #quest-app *,#quest-app *::before,#quest-app *::after{animation:none!important;transition:none!important;scroll-behavior:auto!important;}
}


/* STEP 28.5.1 — faithful V8 journey + coherent UX */
:root{--brand-purple:#5d1889;--brand-purple-dark:#351044;--brand-lime:#d0ee30;--cream:#f7f4e8;--paper:#fffefa;--ink:#30143d;--night:#17383b;--line:#e1ddd0;--muted:#53645e;--shadow:0 14px 34px rgba(53,16,68,.08)}
body{background:#f7f4e8;color:var(--ink)}
#quest-app{min-height:100vh;background:#f7f4e8}
.page{width:min(1180px,calc(100% - 40px));margin:0 auto;padding:30px 0 48px}
.sr-only{position:absolute!important;width:1px!important;height:1px!important;padding:0!important;margin:-1px!important;overflow:hidden!important;clip:rect(0,0,0,0)!important;white-space:nowrap!important;border:0!important}
[hidden]{display:none!important}

.topbar{background:linear-gradient(110deg,var(--brand-purple-dark),#4b1165 60%,var(--brand-purple));color:#f7f9ed;display:flex;align-items:center;justify-content:space-between;gap:22px;padding:14px max(22px,calc((100vw - 1430px)/2));border-bottom:1px solid #ffffff1f;position:sticky;top:0;z-index:20}
.brand{border:0;background:none;color:inherit;display:flex;align-items:center;gap:11px;text-align:left;padding:0;cursor:pointer;flex-shrink:0}
.brandmark{width:43px;height:43px;overflow:hidden;border:1px solid #e1d0ff66;border-radius:14px;background:#cdb9e7;display:block}
.brandmark img{width:100%;height:100%;object-fit:cover;display:block}
.brand strong{display:block;font-size:20px;letter-spacing:-.45px}.brand small{display:block;color:#e7d8ef;font-size:9px;letter-spacing:1.35px;text-transform:uppercase;margin-top:2px}
.topnav{display:flex;gap:5px;padding:4px;background:#25092f66;border:1px solid #ffffff0c;border-radius:15px}.nav-btn{border:0;background:none;color:#e6dcee;min-height:42px;padding:0 15px;border-radius:11px;font-weight:800;cursor:pointer}.nav-btn.active{background:var(--brand-lime);color:var(--brand-purple-dark);box-shadow:0 3px 9px #0002}
.head-tools{display:flex;align-items:center;gap:12px}.student-language-switch select{border:1px solid #ffffff2e;background:#ffffff10;color:#fff;border-radius:10px;padding:8px 9px;font-weight:800}.student-language-switch option{color:#30143d;background:#fff}.star-count{display:flex;align-items:center;gap:5px;color:var(--brand-lime);font-weight:900;white-space:nowrap}.star-count small{color:#e7d8ef;font-weight:700}

.dev-only{font-size:11px!important;opacity:.7}.summary.dev-only,.backend-status.dev-only{margin:0 0 8px!important;padding:7px 10px!important;border-radius:10px!important}

.page-heading{display:flex;justify-content:space-between;gap:24px;align-items:flex-end;margin:4px 0 24px}.page-heading h1{font-size:clamp(34px,4.2vw,48px);letter-spacing:-1.7px;line-height:1.08;margin:4px 0 10px}.page-heading p{max-width:760px;color:#5f6d64;line-height:1.65;margin:0}.journey-heading .eyebrow{color:#6b258f;font-weight:900;letter-spacing:1.5px}
#journey-widgets{display:grid;gap:12px;margin-bottom:20px}.assessment-start{margin:0}.profile-banner{margin:0}.journey-progress{margin:0}
.journey-grid{display:grid;grid-template-columns:minmax(0,1fr) 285px;gap:22px;align-items:start}.journey-main{min-width:0}

.atlas-map{height:358px;position:relative;overflow:hidden;background:radial-gradient(ellipse at 45% 68%,#27524e 0,transparent 65%),var(--night);border-radius:27px;color:var(--cream);border:1px solid #29514c;box-shadow:0 16px 36px rgba(23,56,59,.12)}
.map-label{position:absolute;left:24px;top:21px;z-index:2;pointer-events:none}.map-label strong{display:block;font-size:11px;font-weight:500;letter-spacing:2px;text-transform:uppercase;color:#edf5ed}.map-label span{display:block;font-size:11px;color:#c4d7cf;margin-top:4px}.map-stars{position:absolute;inset:0;background-image:radial-gradient(circle,#d3e9c477 .7px,transparent 1px),radial-gradient(circle,#b4d2ba55 .8px,transparent 1.3px);background-size:51px 59px,93px 83px;background-position:9px 16px,29px 41px;opacity:.7;pointer-events:none}.map-drawing{position:absolute;inset:0;width:100%;height:100%;pointer-events:none}.mobile-route{display:none}
.world-node{position:absolute;width:15.4%;height:150px;transform:translate(-50%,-50%);border:0;background:none;color:var(--cream);display:flex;align-items:center;flex-direction:column;justify-content:center;padding:0;z-index:3;border-radius:18px;cursor:pointer}.world-node .island{width:100%;max-width:132px;height:104px;transition:transform .2s;filter:drop-shadow(0 6px 9px #0002)}.world-node:hover .island{transform:translateY(-5px)}.world-node.locked .island{opacity:.6;filter:saturate(.45)}.world-node.locked .node-title{color:#d0ddd8}.world-node.selected::before{content:"";position:absolute;inset:12px 1px 28px;border:1px dashed #d0ee3099;border-radius:50%;background:#d0ee300d;pointer-events:none}.node-title{font-size:10px;line-height:1.2;font-weight:900;text-align:center;margin-top:-7px;z-index:1}.node-number{font-size:8px;color:#adc4bb;letter-spacing:.6px;text-transform:uppercase;margin-top:3px}.you-are-here{position:absolute;top:-3px;z-index:4;background:var(--brand-lime);color:var(--brand-purple-dark);font-size:7px;font-weight:900;letter-spacing:.6px;text-transform:uppercase;padding:4px 7px;border-radius:999px}.map-foot{position:absolute;left:24px;right:24px;bottom:17px;display:flex;justify-content:space-between;gap:10px;font-size:9px;color:#c5d7cf;letter-spacing:1px;text-transform:uppercase;pointer-events:none}

.current-world{margin-top:20px;background:var(--paper);border:1px solid var(--line);border-radius:23px;overflow:hidden;box-shadow:var(--shadow)}.world-heading{padding:23px 25px 13px;display:flex;align-items:center;gap:15px}.world-seal{display:grid;place-items:center;width:48px;height:48px;border-radius:16px;flex-shrink:0;font-size:23px}.world-heading>div{min-width:0;flex:1}.world-heading .eyebrow{margin-bottom:5px;font-size:9px;letter-spacing:1.5px}.world-heading h2{font-size:24px;margin:0}.world-heading .mini-progress{margin-left:auto;white-space:nowrap;color:var(--muted);font-size:12px}.world-tag{color:#7a647f!important;font-size:12px;margin:5px 0 0!important}.world-intro{padding:0 25px 18px;color:#5e6b61;line-height:1.65;margin:0}.mission-row{border-top:1px solid #e3e5d8;display:flex;align-items:center;gap:13px;padding:16px 25px;width:100%;background:none;color:var(--ink);text-align:left;min-height:79px;border-right:0;border-left:0;border-bottom:0;cursor:pointer}.mission-row.current{background:#e7f0df}.mission-row:hover{background:#eff4e9}.mission-row .subject-icon{height:41px;width:41px;border-radius:13px;display:grid;place-items:center;flex-shrink:0;background:#f0e6f6}.mission-row strong{font-size:14px;display:block}.mission-row small{font-size:11px;color:var(--muted);display:block;margin-top:3px}.mission-row .row-end{margin-left:auto;display:flex;align-items:center;gap:9px;font-size:11px;font-weight:800;color:#4d7761;white-space:nowrap}.locked-next{display:flex;align-items:center;gap:9px;padding:14px 25px;border-top:1px dashed var(--line);font-size:11px;color:var(--muted);background:#f8f7ef}.world-reward{display:grid;grid-template-columns:1fr 1fr;gap:8px;padding:14px 20px;background:#f3f8ca;border-top:1px solid #dbe697}.world-reward span{font-size:11px;color:#53645e}.world-reward strong{display:block;color:#5d1889;margin-bottom:2px}

.side-stack{display:flex;flex-direction:column;gap:17px}.next-card{background:linear-gradient(145deg,#e6f56e,var(--brand-lime));border:1px solid #c0d82a;border-radius:23px;padding:23px;position:relative;overflow:hidden}.next-card .eyebrow{font-size:9px;color:#51355c;margin-bottom:12px}.next-card h2{font-size:24px;line-height:1.18;margin:0}.next-card p{font-size:12px;color:#57415f;margin:10px 0;line-height:1.55}.next-card .next-hook{font-weight:700}.next-card .path-explanation{padding-top:9px;border-top:1px solid #8aa71640}.next-card .primary-button{width:100%;margin-top:7px}.next-card .subject-label{font-size:10px;display:flex;gap:6px;align-items:center;margin-top:13px;color:#60446b}.pip-card{border:1px solid var(--line);border-radius:22px;padding:20px;background:#f0efe4}.pip-top{display:flex;gap:11px;align-items:center}.pip-top strong{display:block;color:#5d1889}.pip-top small{display:block;color:#68756d;margin-top:2px}.pip-mini{display:grid;place-items:center;width:42px;height:42px;border-radius:14px;background:#5d1889;color:#d0ee30;font-size:20px}.pip-card p{font-size:12px;color:#586958;line-height:1.65;margin:13px 0 0}.pathway-card{border:1px solid var(--line);border-radius:23px;padding:21px;background:var(--paper)}.pathway-card h3{font-size:13px;margin:0 0 15px}.path-row{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-top:12px;font-size:11px}.path-row>span{display:flex;gap:7px;align-items:center}.path-dot{width:7px;height:7px;border-radius:50%;display:inline-block;background:#5d1889}.subject-maths{background:#7560a8!important}.subject-science{background:#3d8178!important}.subject-reading{background:#b56a4b!important}.subject-culture{background:#8c7a2c!important}.path-level{font-size:9px;color:#667166;background:#f1f2e9;padding:4px 7px;border-radius:7px}.language-note,.pathway-empty{font-size:10px!important;color:#7a8276!important;margin:13px 0 0!important}.micro-footer{display:flex;gap:16px;justify-content:center;flex-wrap:wrap;color:#7a8276;font-size:10px;margin:22px 0 0}

/* Coherent top-level Progress and Guide destinations. */
#progress-section,#guide-section{max-width:1120px;margin:0 auto}.progress-hero{background:linear-gradient(135deg,#351044,#5d1889);color:#fff;border-radius:23px;padding:22px;margin-bottom:18px}.progress-hero>strong{font-size:38px}.progress-hero .progress-track{margin-top:12px;background:#ffffff24}.progress-layout{display:grid;grid-template-columns:1fr 1fr;gap:18px}.panel{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:21px}.panel h2{font-size:20px}.progress-domains,.progress-worlds{display:grid;gap:10px}.progress-domain,.progress-world{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:11px 0;border-top:1px solid #ece8dc}.progress-domain span,.progress-world small{color:#68756d;font-size:11px}.progress-world{justify-content:flex-start}.progress-world>div{display:flex;flex-direction:column}.progress-world-symbol{width:39px;height:39px;border-radius:12px;display:grid;place-items:center;font-size:19px}.guide-grid-native{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}.guide-native-card{background:var(--paper);border:1px solid var(--line);border-radius:22px;padding:22px}.guide-native-card>strong{width:36px;height:36px;border-radius:12px;background:#f0e6f6;color:#5d1889;display:grid;place-items:center}.guide-native-card h2{font-size:19px;margin:14px 0 7px}.guide-native-card p{color:#5f6d64;line-height:1.6}

/* V8-style activity progress, without changing proven Step 28 task logic. */
.stepper{display:flex;gap:5px;padding:18px 29px 0}.stepper span{flex:1;display:flex;gap:6px;flex-direction:column;font-size:9px;color:#687b69;text-align:center}.stepper i{height:4px;display:block;border-radius:5px;background:#e6e8dc}.stepper .passed i{background:#7c39a1}.stepper .current i{background:#e8af60}.stepper .current{color:#865e28;font-weight:bold}

@media(max-width:1000px){.journey-grid{grid-template-columns:minmax(0,1fr)}.side-stack{display:grid;grid-template-columns:repeat(2,minmax(0,1fr))}.next-card{grid-column:1/-1}.progress-layout{grid-template-columns:1fr}}
@media(max-width:820px){.topbar{flex-wrap:wrap;padding:12px 18px 10px;gap:10px}.topnav{order:3;width:100%;display:grid;grid-template-columns:repeat(4,1fr)}.nav-btn{padding:0 7px}.page{width:min(100% - 30px,1180px);padding-top:22px}.atlas-map{height:350px}.side-stack{grid-template-columns:1fr 1fr}.guide-grid-native{grid-template-columns:1fr}.world-heading{align-items:flex-start;flex-wrap:wrap}.world-heading .mini-progress{margin-left:0}}
@media(max-width:600px){.brand small{font-size:8px}.brand strong{font-size:16px}.brandmark{width:37px;height:37px}.star-count small{display:none}.head-tools{margin-left:auto}.page{width:calc(100% - 28px);padding-top:20px}.page-heading h1{font-size:31px}.journey-grid{gap:15px}.atlas-map{height:360px;border-radius:22px}.map-label{left:19px;top:19px}.map-label strong{font-size:9px;letter-spacing:1.7px}.map-label span{font-size:9px}.world-node{width:27%;height:136px;left:var(--mobile-x)!important;top:var(--mobile-y)!important}.world-node .island{max-width:104px;height:85px}.node-title{font-size:9px;white-space:normal;max-width:105px}.node-number{font-size:7px}.world-node.selected::before{inset:10px 0 28px}.you-are-here{font-size:6px;top:3px}.desktop-route{display:none}.mobile-route{display:block}.map-foot{left:19px;right:19px;bottom:17px;font-size:7px}.map-foot span:first-child{display:none}.current-world{margin-top:16px;border-radius:20px}.world-heading{padding:20px 18px 13px;gap:11px}.world-heading h2{font-size:20px}.world-seal{width:41px;height:41px;border-radius:13px}.world-intro{padding:0 18px 18px;font-size:12px}.mission-row{padding:15px 17px;gap:10px}.mission-row .row-end span{display:none}.mission-row .subject-icon{height:37px;width:37px;border-radius:11px}.locked-next{padding:13px 18px}.side-stack{grid-template-columns:1fr}.pip-card{display:none}.next-card{grid-column:auto;padding:22px}.next-card h2{font-size:25px}.pathway-card{padding:20px}.micro-footer{font-size:9px;gap:10px}.assessment-start{align-items:flex-start;flex-direction:column}.progress-layout{grid-template-columns:1fr}.guide-grid-native{grid-template-columns:1fr}.stepper{padding:16px 17px 0}.lesson-card>.speech-row{padding-top:14px}}

/* STEP 28.5.2 — UI/UX regression fixes
   Keeps the V8 visual language while preventing legacy Step 28 component
   layout rules from leaking into the restored Story Map interface. */
html,body{max-width:100%;overflow-x:hidden}
#quest-app,.page,.journey-grid,.journey-main,.side-stack,#next-card-slot,
.current-world,.lesson-card,.task,.panel,.guide-native-card,.storyteller-card,
.intervention-card,.tutor-card{min-width:0}
#quest-app p,#quest-app h1,#quest-app h2,#quest-app h3,#quest-app h4,
#quest-app button,#quest-app label,#quest-app small,#quest-app strong{overflow-wrap:anywhere;word-break:normal}
#quest-app img,#quest-app video,#quest-app canvas{max-width:100%;height:auto}

/* The next-story card is a vertical V8 card. The old Step 28 .path-card grid
   made each child a separate grid cell, which caused the overlap seen on mobile. */
.path-card.next-card{
  display:block;
  width:100%;
  max-width:100%;
  min-width:0;
  margin:0;
  padding:23px;
  overflow:hidden;
}
.path-card.next-card[hidden]{display:none!important}
.path-card.next-card>*{display:block;min-width:0;max-width:100%;width:auto}
.path-card.next-card .eyebrow{margin:0 0 10px;font-size:9px;line-height:1.35}
.path-card.next-card h2{margin:0 0 10px;font-size:24px;line-height:1.17;letter-spacing:-.55px}
.path-card.next-card .next-hook{margin:0 0 13px;font-size:12px;line-height:1.55;font-weight:800}
.path-card.next-card .path-explanation{
  margin:0;
  padding:12px 0 0;
  border-top:1px solid rgba(93,24,137,.14);
  font-size:12px;
  line-height:1.58;
}
.path-card.next-card .path-retrieval{
  margin:10px 0 0!important;
  padding:8px 10px;
  border-radius:10px;
  background:rgba(255,255,255,.35);
  font-size:10px!important;
  line-height:1.45;
}
.path-card.next-card .primary-button{
  display:flex;
  align-items:center;
  justify-content:center;
  width:100%;
  min-height:46px;
  margin:17px 0 0;
  white-space:normal;
  text-align:center;
}
.path-card.next-card .subject-label{
  display:flex;
  width:100%;
  margin:12px 0 0;
  line-height:1.45;
  font-size:10px;
}

/* Keep the right rail predictable at every breakpoint. */
.side-stack{width:100%;min-width:0}
#next-card-slot{width:100%;min-width:0}
@media(max-width:1000px){
  .side-stack{grid-template-columns:minmax(0,1fr) minmax(0,1fr)}
  #next-card-slot{grid-column:1/-1}
}
@media(max-width:600px){
  .side-stack{display:flex;flex-direction:column;gap:15px}
  #next-card-slot{width:100%}
  .path-card.next-card{padding:20px;border-radius:20px}
  .path-card.next-card h2{font-size:22px;line-height:1.2}
  .path-card.next-card .next-hook,.path-card.next-card .path-explanation{font-size:12px}
}

/* Story-map and mission rows must never create sideways scrolling. */
.atlas-map,.current-world,.mission-row{max-width:100%}
.mission-row>span:nth-child(2){min-width:0;flex:1}
.mission-row strong,.mission-row small{overflow-wrap:anywhere}

/* Child-facing support panels use the same spacing rhythm as the rest of V8. */
.intervention-card,.tutor-card,.storyteller-card{overflow:hidden}
.tutor-heading>div{min-width:0;flex:1}
.tutor-local-badge{flex:0 0 auto}
.tutor-question{max-width:100%}
.tutor-actions .primary-button,.tutor-actions .back-button{max-width:100%}

/* Better phone ergonomics. */
@media(max-width:600px){
  .topbar{position:relative}
  .topnav{min-width:0}
  .nav-btn{min-width:0;overflow-wrap:normal}
  .page-heading{display:block}
  .page-heading p{max-width:none}
  .world-heading .mini-progress{margin-left:auto}
  .mission-row{align-items:flex-start}
  .mission-row .row-end{align-self:center;flex:0 0 auto}
  .tutor-heading{display:flex;flex-direction:row;align-items:flex-start}
  .tutor-local-badge{font-size:9px}
}

@media(max-width:420px){
  .page{width:calc(100% - 20px)}
  .topbar{padding-left:10px;padding-right:10px}
  .topnav{gap:2px;padding:3px}
  .nav-btn{font-size:11px;padding:0 4px}
  .atlas-map{height:350px}
  .path-card.next-card{padding:18px}
  .path-card.next-card h2{font-size:21px}
  .mission-row{padding-left:14px;padding-right:14px}
  .mission-row .row-end span{display:none}
}

/* Step 29D: account + adult dashboard, matched to the Anansesem visual system */
.account-button{border:1px solid #ffffff2b;background:#ffffff0d;color:#f7f9ed;border-radius:11px;min-height:39px;padding:0 12px;font:inherit;font-weight:800;white-space:nowrap}
.account-button:hover{background:#ffffff18}
.account-menu{position:fixed;right:18px;top:72px;z-index:90;width:min(320px,calc(100vw - 30px));padding:17px;background:#fff;border:1px solid #ddcde8;border-radius:18px;box-shadow:0 18px 50px #25102f33;display:grid;gap:8px;color:#351044}
.account-menu[hidden]{display:none!important}.account-menu>span{font-size:12px;color:#6f6076;text-transform:capitalize}.account-menu .text-btn{text-align:left;padding:8px 0}.link-token-box{font-size:11px;line-height:1.4;overflow-wrap:anywhere;background:#f4edf8;border:1px solid #ddcde8;border-radius:10px;padding:10px}
.auth-overlay{position:fixed;inset:0;z-index:150;background:linear-gradient(135deg,#351044ee,#5d1889e8);display:grid;place-items:center;padding:20px;overflow:auto}.auth-overlay[hidden]{display:none!important}.auth-card{width:min(480px,100%);background:#fffdf8;border:1px solid #ffffff66;border-radius:26px;padding:28px;box-shadow:0 30px 80px #1d082966;color:#351044}.auth-brand{display:flex;justify-content:space-between;align-items:baseline;gap:14px;margin-bottom:20px}.auth-brand strong{font-size:25px;color:#5d1889}.auth-brand span{font-size:11px;color:#6f6076}.auth-tabs{display:flex;background:#f4edf8;border-radius:13px;padding:4px;margin-bottom:22px}.auth-tab{flex:1;border:0;border-radius:10px;padding:10px;background:transparent;font:inherit;font-weight:800;color:#5d1889}.auth-tab.active{background:#d8ef38;color:#351044}.auth-copy{color:#62536a;margin:7px 0 18px}.auth-form{display:grid;gap:13px}.auth-form[hidden]{display:none!important}.auth-form label{display:grid;gap:6px;font-size:13px;font-weight:800}.auth-form input,.auth-form select,.auth-form textarea,.dashboard-tool input,.dashboard-tool select,.dashboard-tool textarea{width:100%;box-sizing:border-box;border:1px solid #d9cce1;border-radius:11px;padding:11px 12px;background:#fff;color:#351044;font:inherit}.auth-message,.dashboard-message{min-height:22px;margin-top:12px;color:#8a3152;font-weight:700;font-size:13px}
.adult-tools{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:16px;margin-bottom:22px}.dashboard-tool{background:#fff;border:1px solid #ddcde8;border-radius:20px;padding:18px;display:grid;gap:11px}.dashboard-tool[hidden]{display:none!important}.dashboard-tool h3{color:#5d1889}.dashboard-tool p{color:#6f6076;font-size:13px}.dashboard-tool label{display:grid;gap:6px;font-size:12px;font-weight:800}.learner-dashboard-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:18px}.learner-dashboard-card{background:#fff;border:1px solid #ddcde8;border-radius:22px;padding:20px;box-shadow:0 10px 30px #35104410}.learner-dashboard-card h2{font-size:22px;color:#351044}.learner-dashboard-meta{display:flex;gap:8px;flex-wrap:wrap;margin:8px 0 14px}.learner-dashboard-meta span{background:#f4edf8;color:#5d1889;border-radius:999px;padding:5px 8px;font-size:11px;font-weight:800}.dashboard-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin:14px 0}.dashboard-stat{background:#f7f7ee;border-radius:13px;padding:11px;text-align:center}.dashboard-stat strong{display:block;font-size:22px;color:#5d1889}.dashboard-stat span{font-size:10px;color:#6f6076}.dashboard-actions{display:flex;gap:8px;flex-wrap:wrap}.dashboard-actions .primary-button,.dashboard-actions .back-button{min-height:42px}.recent-activity{margin-top:13px;padding-top:12px;border-top:1px solid #ece3ef}.recent-activity strong{font-size:12px}.recent-activity ul{margin:8px 0 0;padding-left:18px;color:#6f6076;font-size:11px}
@media(max-width:780px){.adult-tools,.learner-dashboard-grid{grid-template-columns:1fr}.dashboard-stats{grid-template-columns:repeat(3,minmax(0,1fr))}.account-button{padding:0 8px;font-size:12px}}
@media(max-width:480px){.auth-card{padding:21px 17px;border-radius:21px}.auth-brand{display:block}.auth-brand span{display:block;margin-top:4px}.dashboard-stats{grid-template-columns:1fr 1fr}.dashboard-stat:first-child{grid-column:1/-1}}


/* Step 29E: Teacher Copilot + Student Story Copilot */
.teacher-copilot-panel{
  background:linear-gradient(145deg,#fff,#f7f2fa);
  border:1px solid #ddcde8;
  border-radius:24px;
  padding:22px;
  margin:0 0 24px;
  box-shadow:0 12px 34px #35104412;
}
.teacher-copilot-panel[hidden],.student-story-copilot[hidden]{display:none!important}
.copilot-heading{display:flex;justify-content:space-between;gap:18px;align-items:flex-start;margin-bottom:18px}
.copilot-heading h2,.copilot-heading h3{margin:2px 0 6px;color:#5d1889}
.copilot-heading p:not(.eyebrow){margin:0;color:#6f6076;line-height:1.5}
.teacher-copilot-controls{display:grid;grid-template-columns:220px minmax(0,1fr);gap:14px}
.teacher-copilot-controls label{display:grid;gap:7px;font-size:12px;font-weight:800;color:#4e3856}
.teacher-copilot-controls select,.teacher-copilot-controls textarea{
  width:100%;border:1px solid #d9cce1;border-radius:12px;padding:11px 12px;background:#fff;color:#351044;font:inherit
}
.copilot-quick-actions{display:flex;gap:8px;flex-wrap:wrap;margin:14px 0}
.copilot-chip{border:1px solid #d6c4e2;background:#fff;color:#5d1889;border-radius:999px;padding:8px 11px;font-weight:800;cursor:pointer}
.copilot-chip:hover{border-color:#5d1889;background:#f6eff9}
.teacher-copilot-actions{justify-content:flex-end}
.teacher-copilot-response{margin-top:14px;padding:17px;border-radius:16px;background:#351044;color:#fffdf8;white-space:pre-wrap;line-height:1.65}

.student-story-copilot{
  margin:20px 30px 0;
  padding:20px;
  border-radius:20px;
  border:1px solid #d8e58c;
  background:linear-gradient(145deg,#fbffe8,#fffdf8 64%);
  box-shadow:0 10px 28px #35104410;
}
.story-copilot-actions{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.student-story-scene{font-size:16px;line-height:1.7;color:#351044;background:#fff;border:1px solid #e7dfeb;border-radius:16px;padding:16px;margin-bottom:16px;white-space:pre-wrap}
.story-choice-label{font-weight:900;color:#5d1889;margin:0 0 10px}
.student-story-choices{display:grid;gap:9px;margin-bottom:16px}
.student-story-choice{width:100%;text-align:left;border:2px solid #e1d5e8;background:#fff;color:#351044;border-radius:13px;padding:12px 14px;cursor:pointer;font-weight:700}
.student-story-choice:hover{border-color:#a98dbc}
.student-story-choice.selected{border-color:#5d1889;background:#f3eafb}
.student-story-closing{margin-top:12px;padding:16px;border-radius:15px;background:#351044;color:#fffdf8;line-height:1.65;white-space:pre-wrap}

@media(max-width:780px){
  .teacher-copilot-controls{grid-template-columns:1fr}
  .student-story-copilot{margin-left:18px;margin-right:18px}
  .copilot-heading{flex-direction:column}
}

/* Step 29F: adaptive curriculum layer */
.adaptive-learning-card{
  margin:22px 0 8px;
  padding:20px;
  border:1px solid #d7cbe0;
  border-radius:18px;
  background:linear-gradient(145deg,#f7f1fb,#fbfce7);
}
.adaptive-learning-heading{
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:18px;
}
.adaptive-learning-heading h3{margin:0 0 7px;font-size:22px}
.adaptive-learning-heading p{margin:0}
.adaptive-learning-status{font-size:13px;margin:12px 0 0;color:#6d6272}
.adaptive-why{font-weight:bold;color:#5d1889!important;margin:18px 0 4px!important}
.adaptive-section{margin-top:18px;padding-top:16px;border-top:1px solid #e3d9e8}
.adaptive-section h4,.adaptive-mini-card h4{margin:0 0 8px;color:#5d1889}
.adaptive-section p,.adaptive-mini-card p{margin:0;line-height:1.6}
.adaptive-example{background:#fff;border:1px solid #e4dce7;border-radius:14px;padding:16px;margin-top:18px}
.adaptive-example ol{margin:10px 0;padding-left:22px}
.adaptive-example li{margin:7px 0;line-height:1.5}
.adaptive-grid{display:grid;grid-template-columns:1fr 1fr;gap:12px;margin-top:18px}
.adaptive-mini-card{background:white;border:1px solid #e4dce7;border-radius:14px;padding:15px}
.adaptive-stretch{margin-top:16px;background:#f5f9d6;border-radius:12px;padding:13px 14px;line-height:1.5;color:#53645e}
@media(max-width:700px){
  .adaptive-learning-heading{flex-direction:column}
  .adaptive-grid{grid-template-columns:1fr}
}

/* Step 30A: dynamic mastery checkpoint */
.mastery-checkpoint-card{
  margin:22px 30px 8px;
  padding:22px;
  border:1px solid #e4dce7;
  border-radius:18px;
  background:#fbf8fd;
  box-shadow:0 10px 26px rgba(53,16,68,.06);
}
.mastery-checkpoint-card[hidden]{display:none!important}
.mastery-question-prompt{
  margin:18px 0 14px;
  padding:16px;
  border-radius:14px;
  background:#fff;
  border:1px solid #e4dce7;
  color:#351044;
  font-size:17px;
  line-height:1.55;
  font-weight:700;
}
.mastery-options{display:grid;gap:9px;margin-bottom:16px}
.mastery-option{
  width:100%;
  text-align:left;
  border:2px solid #e1d5e8;
  background:#fff;
  color:#351044;
  border-radius:13px;
  padding:12px 14px;
  cursor:pointer;
  font-weight:650;
  line-height:1.45;
}
.mastery-option:hover{border-color:#a98dbc}
.mastery-option.selected{border-color:#5d1889;background:#f3eafb}
.mastery-option:disabled{cursor:default;opacity:.72}
.mastery-feedback{
  margin-top:14px;
  padding:14px 16px;
  border-radius:13px;
  background:#f5f9d6;
  color:#53645e;
  line-height:1.55;
}
.mastery-feedback.error{background:#fff1f3;color:#7d2940}
.mastery-stage-complete{background:#f5f9d6!important;color:#53645e!important}
@media(max-width:720px){
  .mastery-checkpoint-card{margin-left:18px;margin-right:18px;padding:18px}
}


/* ============================================================
   Anansesem 0.4.2 - Duolingo-inspired story quest cards
   Keeps the proven multi-card mission layout and removes learner-facing
   curriculum/admin walls. Each quest carries story + inline Ananse support.
   ============================================================ */

.pedagogy-only,
#adaptive-learning-card,
.legacy-mission-tutor,
#intervention-card {
  display: none !important;
}

.mission-game-meta {
  margin: 18px 30px 4px;
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  border: 1px solid #e5dbea;
  border-radius: 15px;
  background: #fbf8fc;
}

.mission-level-chip,
.mission-quest-count {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 11px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}

.mission-level-chip {
  color: #5b1683;
  background: #f0e6f6;
  border: 1px solid #dfcdea;
}

.mission-level-note {
  flex: 1 1 320px;
  color: #675d6b;
  font-size: 13px;
  line-height: 1.45;
}

.mission-quest-count {
  color: #405114;
  background: #f0f7cb;
  border: 1px solid #d9e5a3;
}

.quest-deck {
  border-top: 0 !important;
  padding-top: 6px !important;
}

.quest-deck > h3 {
  font-size: 20px !important;
  margin-bottom: 14px !important;
}

.task-list {
  gap: 18px !important;
}

.task.quest-card {
  padding: 0 !important;
  overflow: hidden;
  border: 1px solid #e1d6e6 !important;
  border-radius: 22px !important;
  background: #fff !important;
  box-shadow: 0 10px 28px rgba(54, 32, 62, .07);
}

.task.quest-card.next-activity-focus {
  box-shadow: 0 0 0 3px rgba(91, 22, 131, .15), 0 14px 32px rgba(54, 32, 62, .10);
}

.quest-story-scene {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 17px 18px;
  background: linear-gradient(135deg, #f4ecf8 0%, #fbf8f1 100%);
  border-bottom: 1px solid #e8dfe9;
}

.quest-story-avatar {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: #fff;
  border: 1px solid #e0d4e5;
  font-size: 22px;
  box-shadow: 0 4px 12px rgba(70, 35, 80, .08);
}

.quest-story-kicker {
  margin-bottom: 5px;
  color: #6a168f;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.quest-story-scene p {
  margin: 0 !important;
  color: #493f4b !important;
  font-size: 15px;
  line-height: 1.6 !important;
}

.quest-card-body {
  padding: 19px 20px 18px;
}

.quest-card-title {
  display: inline-flex !important;
  align-items: center;
  margin: 0 0 10px !important;
  padding: 6px 10px;
  border-radius: 999px;
  background: #5b1683;
  color: #fff !important;
  font-size: 12px !important;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.quest-card.persisted-complete .quest-card-title {
  background: #6f8f22;
}

.quest-card.persisted-complete .quest-story-scene {
  background: linear-gradient(135deg, #f2f7d8 0%, #fbfbf5 100%);
}

.quest-guide {
  border-top: 1px solid #ece4ee;
  background: #fcfafc;
  padding: 13px 18px 16px;
}

.quest-guide-toggle {
  appearance: none;
  border: 1px solid #d9c8e2;
  border-radius: 999px;
  background: #fff;
  color: #5b1683;
  min-height: 40px;
  padding: 8px 13px;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.quest-guide-toggle:hover,
.quest-guide-toggle:focus-visible {
  border-color: #8b4cab;
  box-shadow: 0 0 0 3px rgba(91, 22, 131, .10);
}

.quest-guide-panel {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid #e5dbea;
  background: #fff;
}

.quest-guide-panel[hidden] {
  display: none !important;
}

.quest-guide-intro {
  color: #6d6272;
  font-size: 13px;
  line-height: 1.5;
  margin-bottom: 10px;
}

.quest-guide-quick {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.quest-guide-quick button {
  border: 1px solid #dfd3e5;
  border-radius: 999px;
  background: #f8f4fa;
  color: #4c3158;
  padding: 7px 10px;
  font: inherit;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.quest-guide-messages {
  display: grid;
  gap: 8px;
  max-height: 220px;
  overflow: auto;
  margin: 8px 0;
}

.quest-guide-message {
  display: grid;
  gap: 3px;
  padding: 9px 11px;
  border-radius: 12px;
  font-size: 13px;
  line-height: 1.45;
}

.quest-guide-message.ananse {
  background: #f4ecf8;
  color: #493653;
}

.quest-guide-message.learner {
  margin-left: 8%;
  background: #f0f7cb;
  color: #405114;
}

.quest-guide-ask-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
}

.quest-guide-ask-row input {
  min-width: 0;
  min-height: 42px;
  border: 1px solid #ded3e4;
  border-radius: 12px;
  padding: 9px 11px;
  font: inherit;
  color: #2f2351;
  background: #fff;
}

.quest-guide-status {
  min-height: 18px;
  margin-top: 6px;
  color: #756b78;
  font-size: 12px;
}

.bonus-challenge-card {
  margin: 22px 30px 0;
  overflow: hidden;
  border: 1px solid #d7df9b;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(54, 32, 62, .06);
}

.bonus-challenge-card[hidden] {
  display: none !important;
}

.bonus-story-strip {
  display: flex;
  gap: 11px;
  align-items: center;
  padding: 15px 18px;
  background: #f4f8d9;
  border-bottom: 1px solid #dde6a7;
}

.bonus-story-strip > span {
  font-size: 25px;
}

.bonus-story-strip div {
  display: grid;
  gap: 2px;
}

.bonus-story-strip strong {
  color: #415019;
}

.bonus-story-strip div > span {
  color: #65713e;
  font-size: 13px;
}

.bonus-body {
  padding: 18px 20px 20px;
}

.bonus-body h3 {
  margin: 0 0 14px;
  font-size: 17px;
  line-height: 1.45;
}

.bonus-options {
  display: grid;
  gap: 9px;
  margin-bottom: 12px;
}

.bonus-hint {
  margin-top: 12px;
  padding: 11px 13px;
  border-radius: 12px;
  background: #f4ecf8;
  color: #493653;
  line-height: 1.5;
}

.mastery-checkpoint-card {
  margin-top: 22px !important;
  border-radius: 22px !important;
}

.student-story-copilot {
  border-radius: 22px !important;
}

@media (max-width: 700px) {
  .mission-game-meta,
  .bonus-challenge-card {
    margin-left: 18px;
    margin-right: 18px;
  }

  .mission-level-note {
    flex-basis: 100%;
  }

  .quest-card-body,
  .quest-guide,
  .bonus-body {
    padding-left: 15px;
    padding-right: 15px;
  }

  .quest-story-scene {
    grid-template-columns: 38px minmax(0, 1fr);
    padding: 15px;
  }

  .quest-story-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    font-size: 19px;
  }

  .quest-guide-ask-row {
    grid-template-columns: 1fr;
  }

  .quest-guide-ask-row .primary-button {
    width: 100%;
  }
}

/* 0.4.2: bounded cards, explicit reading notes, keyboard access. */
#lesson-section [hidden] { display: none !important; }
.quest-listen { border:1px solid #d3c3df; border-radius:999px; background:#fff; color:#56177c; font:inherit; font-size:13px; padding:8px 12px; min-height:40px; cursor:pointer; }
.quest-evidence { margin-top:12px; border-top:1px solid #e7ddec; padding-top:10px; }
.quest-evidence summary { cursor:pointer; color:#56177c; font-weight:700; }
.quest-evidence p { white-space:pre-line; }
.quest-locked-note { padding:20px; color:#6d6375; background:#f7f3f9; line-height:1.6; }
#lesson-section button:focus-visible, #lesson-section input:focus-visible, #lesson-section summary:focus-visible { outline:3px solid #5b1683; outline-offset:3px; }
#lesson-section .quest-card-body input { max-width:100%; }
.quest-guide-message span { white-space:pre-wrap; overflow-wrap:anywhere; }
.quest-guide-toggle, .quest-guide-quick button { min-height:44px; }
#mastery-checkpoint-card > [data-mastery-retry] { margin-top:12px; }
@media (max-width:480px) { .quest-story-kicker { line-height:1.6; } .quest-story-scene p { font-size:16px; } .quest-guide-quick button { flex:1 1 130px; } }
@media (prefers-reduced-motion:reduce) { #quest-app *, #quest-app *::before, #quest-app *::after { scroll-behavior:auto !important; animation:none !important; transition:none !important; } }

/* 0.4.3: scoped Final Quest guide. Existing quest-card styling is unchanged. */
#mastery-guide[hidden] { display: none !important; }
#mastery-guide .quest-guide { margin-top: 20px; padding-left: 0; padding-right: 0; }
#mastery-guide .quest-guide-ask-row textarea {
  flex: 1 1 240px; width: 100%; min-width: 0; box-sizing: border-box;
  border: 1px solid #d8c7e6; border-radius: 12px; padding: 12px 14px;
  font: inherit; line-height: 1.45; color: inherit; background: #fff;
  resize: vertical; min-height: 76px;
}
#mastery-guide button:disabled, #mastery-guide textarea:disabled { opacity: .65; }
#mastery-guide button:focus-visible, #mastery-guide textarea:focus-visible {
  outline: 3px solid #571a83; outline-offset: 3px;
}

/* v0.6.0 integrated learner reporting */
.dashboard-stats{grid-template-columns:repeat(4,minmax(0,1fr))}
.dashboard-levels{margin-top:-4px}
.learner-results-detail{background:#faf7fb;border:1px solid #eadff0;border-radius:14px;padding:10px 12px}
.learner-results-detail summary{cursor:pointer;color:#5d1889}
.learner-results-detail ul{margin-bottom:0}
@media(max-width:780px){.dashboard-stats{grid-template-columns:repeat(2,minmax(0,1fr))}}
