:root{
  --bg:#f5f7fb;--card:#fff;--ink:#152033;--muted:#718096;--line:#e5e9f2;
  --nav:#101a30;--brand:#3f5bd8;--brand2:#7c83ff;--soft:#eef2ff;
  --ok:#0f9f6e;--bad:#c43d4f;--warn:#e89b17;
}
*{box-sizing:border-box}
body{margin:0;background:var(--bg);color:var(--ink);font-family:Inter,ui-sans-serif,system-ui,-apple-system,"Segoe UI",Tahoma,Arial,sans-serif}
a{text-decoration:none;color:inherit}button,input,select{font:inherit}
.shell{min-height:100vh;display:grid;grid-template-columns:270px 1fr}
.sidebar{background:linear-gradient(180deg,#0f182b,#111c34);color:#fff;padding:20px 16px;display:flex;flex-direction:column;gap:18px}
.brand{display:flex;align-items:center;gap:10px;font-weight:900;font-size:21px}.brand small{display:block;font-weight:500;color:#9eacc8;font-size:10px;margin-top:3px}
.brand-mark{width:42px;height:42px;border-radius:14px;display:grid;place-items:center;background:linear-gradient(135deg,var(--brand),var(--brand2));font-size:24px}
.role-badge{padding:8px 10px;border:1px solid #ffffff20;border-radius:12px;color:#cbd5e1;font-size:12px}
.sidebar nav{display:grid;gap:6px}.sidebar nav a{display:flex;gap:10px;align-items:center;color:#cad4e6;padding:10px 11px;border-radius:12px}.sidebar nav a:hover{background:#ffffff0e;color:#fff}
.nav-ico{width:28px;height:28px;border-radius:9px;background:#ffffff0c;display:grid;place-items:center}
.sidebar-foot{margin-top:auto;border-top:1px solid #ffffff15;padding-top:14px}.mini-user{display:flex;gap:9px;align-items:center}.mini-user small{display:block;color:#94a3b8;font-size:10px;margin-top:2px}.avatar{width:36px;height:36px;border-radius:50%;display:grid;place-items:center;background:#253657;color:#fff;font-weight:800}.logout{display:block;margin-top:10px;color:#f4a9b4;font-size:12px}
.main{padding:24px}.topbar{display:flex;justify-content:space-between;align-items:center;margin-bottom:18px}.topbar h1{margin:0;font-size:26px}.topbar p{margin:5px 0 0;color:var(--muted)}
.card{background:var(--card);border:1px solid var(--line);border-radius:20px;padding:18px;box-shadow:0 8px 28px rgba(26,37,67,.045)}
.grid{display:grid;grid-template-columns:repeat(12,1fr);gap:16px}.span4{grid-column:span 4}.span6{grid-column:span 6}.span8{grid-column:span 8}.span12{grid-column:span 12}
.stat strong{font-size:32px;display:block}.muted{color:var(--muted)}.section-title{display:flex;align-items:center;justify-content:space-between;margin:22px 0 10px}
.btn{border:0;border-radius:12px;padding:10px 14px;cursor:pointer}.btn.primary{background:var(--brand);color:#fff}.btn.ghost{background:#fff;border:1px solid var(--line)}.btn.danger{background:#fff0f2;color:var(--bad);border:1px solid #ffd8df}
.form-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:12px}.field{display:grid;gap:6px}.field.full{grid-column:1/-1}.field label{font-size:13px;font-weight:700}.field input,.field select{width:100%;padding:11px 12px;border:1px solid var(--line);border-radius:12px;background:#fff}.actions{display:flex;gap:8px;justify-content:flex-end;margin-top:14px}
.table-wrap{overflow:auto}.table{width:100%;border-collapse:collapse;min-width:720px}.table th,.table td{padding:12px 10px;border-bottom:1px solid var(--line);text-align:right}.table th{font-size:12px;color:var(--muted);font-weight:700}.pill{display:inline-flex;padding:4px 8px;border-radius:999px;background:#edf8f3;color:#0c7a59;font-size:11px}.pill.blue{background:#eef2ff;color:#3654c7}.pill.gray{background:#f1f3f6;color:#64748b}.alert{padding:12px 14px;border-radius:14px;margin-bottom:14px}.alert.success{background:#eaf8f2;color:#0f7657}.alert.error{background:#fff0f2;color:#a82d40}
.login-page{min-height:100vh;background:radial-gradient(circle at 15% 10%,#e8edff,#f7f9fd 42%,#eef3fb);display:grid;place-items:center;padding:20px}.login-card{width:min(470px,100%);background:#fff;border:1px solid var(--line);border-radius:26px;padding:28px;box-shadow:0 24px 70px rgba(25,42,90,.12)}.login-logo{display:flex;gap:10px;align-items:center;margin-bottom:20px}.login-logo .brand-mark{color:#fff}.login-card h1{margin:0 0 6px}.login-card p{color:var(--muted)}.hint{background:#f7f9fe;border:1px dashed #cfd7e8;border-radius:14px;padding:11px;font-size:12px;color:#64748b}
.hero{background:linear-gradient(135deg,#17264b,#3f5bd8);color:#fff}.hero p{color:#d9e1f5}.progress{height:9px;border-radius:999px;background:#edf0f5;overflow:hidden}.progress span{display:block;height:100%;background:linear-gradient(90deg,var(--brand),var(--brand2))}
.subject-card{display:flex;justify-content:space-between;gap:12px;align-items:center}.subject-icon{width:48px;height:48px;border-radius:14px;display:grid;place-items:center;background:var(--soft);font-size:22px}
.install-wrap{max-width:900px;margin:40px auto;padding:18px}.step{display:flex;gap:10px;align-items:flex-start}.step-no{width:30px;height:30px;border-radius:50%;background:var(--soft);color:#304bbd;display:grid;place-items:center;font-weight:800;flex:0 0 auto}
@media(max-width:900px){.shell{grid-template-columns:1fr}.sidebar{display:none}.main{padding:14px}.span4,.span6,.span8,.span12{grid-column:span 12}.form-grid{grid-template-columns:1fr}}

/* =========================================================
   V2.8 — Student Experience
   ========================================================= */

.student-hero{
  display:grid;grid-template-columns:minmax(0,1fr) 190px;gap:22px;
  padding:30px;border-radius:28px;background:
  radial-gradient(circle at 15% 0%,rgba(124,131,255,.38),transparent 32%),
  linear-gradient(135deg,#17264b,#3654c7 62%,#596fea);
  color:#fff;box-shadow:0 22px 50px rgba(39,61,141,.18)
}
.student-hero-copy{display:flex;flex-direction:column;align-items:flex-start;justify-content:center}
.student-eyebrow{font-size:13px;font-weight:800;color:#cdd8ff;margin-bottom:8px}
.student-hero h2{font-size:32px;line-height:1.35;margin:0 0 8px}
.student-hero p{margin:0;color:#dfe6ff;max-width:690px}
.student-cta{margin-top:22px;display:inline-flex;align-items:center;gap:18px;padding:11px 14px;
  border-radius:14px;background:#fff;color:#263c93;font-size:13px}
.student-cta b{color:#101a30}
.student-hero-progress{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:10px}
.student-hero-progress small{color:#dbe4ff;font-weight:700}

.mastery-ring{
  --value:0;width:128px;height:128px;border-radius:50%;display:grid;place-items:center;
  background:conic-gradient(#fff calc(var(--value)*1%),rgba(255,255,255,.18) 0);
  position:relative
}
.mastery-ring:after{content:"";position:absolute;inset:9px;border-radius:50%;background:#2d47a2}
.mastery-ring>div{position:relative;z-index:1;text-align:center}
.mastery-ring strong{display:block;font-size:26px}
.mastery-ring span{font-size:11px;color:#dfe6ff}
.mastery-ring.small{width:112px;height:112px;background:conic-gradient(var(--brand) calc(var(--value)*1%),#e8ecf5 0)}
.mastery-ring.small:after{background:#fff}
.mastery-ring.small strong{color:var(--ink)}
.mastery-ring.small span{color:var(--muted)}

.student-metrics{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-top:16px}
.student-metrics.compact{margin-top:14px}
.student-metric{display:flex;align-items:center;gap:12px;background:#fff;border:1px solid var(--line);
  border-radius:18px;padding:16px;box-shadow:0 8px 24px rgba(26,37,67,.035)}
.metric-icon{width:42px;height:42px;border-radius:13px;background:var(--soft);display:grid;place-items:center;font-size:18px}
.student-metric strong{font-size:23px;display:block;line-height:1.1}
.student-metric small{color:var(--muted)}

.student-section-head{display:flex;align-items:end;justify-content:space-between;margin:28px 0 12px}
.student-section-head.compact{margin-top:24px}
.student-section-head span,.student-page-intro span{font-size:12px;color:var(--brand);font-weight:800}
.student-section-head h3{margin:3px 0 0;font-size:20px}
.student-section-head>a{font-size:13px;color:var(--brand);font-weight:700}

.student-subject-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:16px}
.student-subject-grid.wide{grid-template-columns:repeat(2,minmax(0,1fr))}
.student-subject-card{background:#fff;border:1px solid var(--line);border-radius:22px;padding:19px;
  box-shadow:0 10px 30px rgba(26,37,67,.045);transition:.2s ease}
.student-subject-card:hover{transform:translateY(-2px);box-shadow:0 14px 36px rgba(26,37,67,.075)}
.subject-card-top{display:flex;align-items:center;justify-content:space-between}
.subject-badge-icon{width:45px;height:45px;border-radius:14px;background:linear-gradient(135deg,#eef2ff,#e5eaff);
  color:#3852c0;display:grid;place-items:center;font-size:21px;font-weight:900}
.subject-status{font-size:11px;padding:5px 9px;border-radius:99px;background:#f2f5fa;color:#667085}
.student-subject-card h3{font-size:19px;margin:15px 0 3px}
.student-subject-card>p{font-size:12px;color:var(--muted);margin:0 0 18px}
.subject-progress-row{display:flex;justify-content:space-between;font-size:12px;margin-bottom:7px}
.student-progress{height:8px;border-radius:99px;background:#edf0f5;overflow:hidden}
.student-progress i{display:block;height:100%;border-radius:inherit;background:linear-gradient(90deg,#4b61dd,#7b83ff)}
.subject-facts{display:flex;gap:14px;flex-wrap:wrap;margin-top:14px;font-size:11px;color:var(--muted)}
.subject-facts b{color:var(--ink)}
.subject-open{margin-top:17px;padding-top:13px;border-top:1px solid var(--line);display:flex;justify-content:space-between;
  color:#3654c7;font-weight:800;font-size:13px}
.subject-stats-grid{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin:15px 0}
.subject-stats-grid div{background:#f7f8fc;border-radius:11px;padding:9px;text-align:center}
.subject-stats-grid strong{display:block;font-size:17px}
.subject-stats-grid span{font-size:10px;color:var(--muted)}

.student-focus-card{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:14px;background:#fff;
  border:1px solid #dfe5ff;border-radius:20px;padding:17px;box-shadow:0 8px 24px rgba(26,37,67,.035)}
.focus-icon{width:48px;height:48px;border-radius:15px;background:#eef2ff;display:grid;place-items:center;font-size:20px}
.student-focus-card p{margin:4px 0 0;color:var(--muted);font-size:12px}
.student-focus-card a{padding:9px 13px;border-radius:11px;background:var(--brand);color:#fff;font-size:12px;font-weight:800}

.student-page-intro{padding:26px;border-radius:24px;background:#fff;border:1px solid var(--line);margin-bottom:18px}
.student-page-intro h2{font-size:28px;margin:5px 0}
.student-page-intro p{margin:0;color:var(--muted)}

.student-empty{grid-column:1/-1;text-align:center;background:#fff;border:1px dashed #ccd4e5;border-radius:22px;padding:36px}
.student-empty.slim{padding:26px}
.empty-icon{font-size:28px;margin-bottom:7px}
.student-empty h3{margin:0 0 5px}
.student-empty p{margin:0;color:var(--muted)}

.student-subject-switcher{display:flex;align-items:center;justify-content:space-between;gap:18px;background:#fff;
  border:1px solid var(--line);border-radius:20px;padding:16px 18px;margin-bottom:15px}
.student-subject-switcher span{font-size:11px;color:var(--muted)}
.student-subject-switcher h2{margin:2px 0 0;font-size:20px}
.student-subject-tabs{display:flex;gap:7px;flex-wrap:wrap}
.student-subject-tabs a{padding:8px 12px;border-radius:11px;background:#f4f6fa;color:#63708b;font-size:12px}
.student-subject-tabs a.active{background:var(--brand);color:#fff}

.adaptive-overview{display:grid;grid-template-columns:1fr auto;gap:20px;align-items:center;padding:25px;border-radius:24px;
  background:linear-gradient(135deg,#fff,#f2f5ff);border:1px solid #e1e6f5}
.adaptive-main h2{font-size:28px;margin:5px 0}
.adaptive-main p{margin:0;color:var(--muted);max-width:660px}

.student-action-panel{display:grid;grid-template-columns:auto 1fr auto;gap:18px;align-items:center;background:#fff;
  border:1px solid var(--line);border-radius:22px;padding:22px;margin-top:18px}
.student-action-panel.success{background:#f2fbf7;border-color:#d6f0e4}
.action-panel-icon{width:54px;height:54px;border-radius:17px;background:#eef2ff;display:grid;place-items:center;font-size:23px}
.student-action-panel span{font-size:11px;color:var(--brand);font-weight:800}
.student-action-panel h3{margin:3px 0;font-size:20px}
.student-action-panel p{margin:0;color:var(--muted);font-size:12px}
.student-primary-btn{border:0;border-radius:13px;padding:12px 17px;background:var(--brand);color:#fff;font-weight:800;cursor:pointer}

.assessment-shell{margin-top:18px}
.assessment-head{background:#15223f;color:#fff;border-radius:18px 18px 0 0;padding:15px 20px}
.assessment-head>div:first-child{display:flex;justify-content:space-between;gap:12px;font-size:12px}
.assessment-head span{color:#bcc8df}
.assessment-progress{height:5px;background:#ffffff1a;border-radius:99px;margin-top:12px;overflow:hidden}
.assessment-progress i{display:block;height:100%;background:#7f8cff}
.assessment-card{background:#fff;border:1px solid var(--line);border-top:0;border-radius:0 0 22px 22px;padding:26px}
.question-meta{display:flex;justify-content:space-between;gap:12px;align-items:center}
.question-meta>span{padding:5px 9px;border-radius:99px;background:#eef2ff;color:#3e57c7;font-size:11px;font-weight:700}
.question-meta small{color:var(--muted)}
.assessment-card>h2{font-size:23px;line-height:1.7;margin:22px 0}
.answer-options{display:grid;grid-template-columns:repeat(2,1fr);gap:10px;margin-bottom:18px}
.answer-option{display:flex;gap:11px;align-items:center;border:1px solid var(--line);border-radius:14px;padding:13px;cursor:pointer;transition:.15s}
.answer-option:hover{border-color:#9eacf2;background:#fafbff}
.answer-option input{accent-color:var(--brand)}
.answer-letter{width:28px;height:28px;border-radius:9px;background:#f0f3fa;display:grid;place-items:center;font-weight:800;color:#506080}
.student-answer-input{display:grid;gap:7px;margin-bottom:16px}
.student-answer-input input{padding:13px;border:1px solid var(--line);border-radius:13px;font-size:18px}
.student-answer-form>.student-primary-btn{min-width:170px}

.student-feedback{display:flex;gap:12px;align-items:flex-start;border-radius:17px;padding:14px 16px;margin-bottom:14px}
.student-feedback.is-correct{background:#ecf9f3;color:#0c7757}
.student-feedback.is-wrong{background:#fff3f4;color:#a63043}
.feedback-icon{width:34px;height:34px;border-radius:50%;display:grid;place-items:center;background:#fff;font-weight:900}
.student-feedback p{margin:3px 0}.student-feedback small{opacity:.8}

.recommendation-list{display:grid;gap:10px}
.recommendation-item{display:grid;grid-template-columns:auto 1fr auto;gap:14px;align-items:center;background:#fff;border:1px solid var(--line);
  border-radius:17px;padding:15px 17px}
.recommendation-type{font-size:10px;background:#eef2ff;color:#3f58c6;padding:5px 8px;border-radius:99px;font-weight:800}
.recommendation-item h4{margin:0 0 4px}.recommendation-item p{margin:0;color:var(--muted);font-size:12px}
.recommendation-arrow{color:#7b86a5;font-size:18px}

.student-mobile-nav{display:none}

@media(max-width:1100px){
  .student-subject-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:900px){
  body{padding-bottom:78px}
  .student-hero{grid-template-columns:1fr;padding:22px}
  .student-hero-progress{display:none}
  .student-hero h2{font-size:26px}
  .student-metrics{grid-template-columns:1fr 1fr 1fr}
  .student-subject-grid,.student-subject-grid.wide{grid-template-columns:1fr}
  .student-action-panel{grid-template-columns:auto 1fr}.student-action-panel form{grid-column:1/-1}
  .student-action-panel .student-primary-btn{width:100%}
  .student-subject-switcher{align-items:flex-start;flex-direction:column}
  .answer-options{grid-template-columns:1fr}
  .student-mobile-nav{
    position:fixed;display:grid;grid-template-columns:repeat(3,1fr);left:0;right:0;bottom:0;z-index:900;
    background:rgba(255,255,255,.96);backdrop-filter:blur(12px);border-top:1px solid var(--line);
    padding:8px 14px calc(8px + env(safe-area-inset-bottom))
  }
  .student-mobile-nav a{display:grid;place-items:center;gap:2px;color:#67748e}
  .student-mobile-nav span{font-size:20px}.student-mobile-nav small{font-size:10px}
}
@media(max-width:620px){
  .student-metrics{grid-template-columns:1fr}
  .student-hero{border-radius:22px}
  .student-cta{width:100%;justify-content:space-between}
  .adaptive-overview{grid-template-columns:1fr}.adaptive-score{display:none}
  .student-focus-card{grid-template-columns:auto 1fr}.student-focus-card a{grid-column:1/-1;text-align:center}
  .recommendation-item{grid-template-columns:1fr}.recommendation-arrow{display:none}
}


/* =========================================================
   KAVENA V2.9 — Learning Experience Core
   ========================================================= */
.learn-hero{display:flex;justify-content:space-between;align-items:end;gap:24px;padding:28px;border-radius:26px;
 background:linear-gradient(135deg,#17264b,#3d5ad2);color:#fff;margin-bottom:20px}
.learn-hero h2{font-size:29px;margin:5px 0}.learn-hero p{margin:0;color:#dce5ff}
.learn-subject-pills{display:flex;gap:8px;flex-wrap:wrap;justify-content:flex-end}
.learn-subject-pills a{padding:9px 13px;border-radius:12px;background:#ffffff14;color:#e7ecff;border:1px solid #ffffff1f}
.learn-subject-pills a.active{background:#fff;color:#2f48ad}
.learning-heading{display:flex;align-items:end;justify-content:space-between;margin:20px 2px 12px}
.learning-heading span{font-size:11px;color:var(--muted)}.learning-heading h3{font-size:24px;margin:3px 0}
.learning-heading small{color:var(--muted)}
.unit-roadmap{display:grid;gap:16px}
.unit-card{display:grid;grid-template-columns:64px 1fr;gap:16px;background:#fff;border:1px solid var(--line);border-radius:22px;padding:18px}
.unit-index{width:54px;height:54px;border-radius:16px;background:#eef2ff;color:#4059c7;display:grid;place-items:center;font-weight:900;font-size:18px}
.unit-title-row{display:flex;justify-content:space-between;align-items:end;margin-bottom:10px}
.unit-title-row span{font-size:10px;color:var(--muted)}.unit-title-row h3{margin:3px 0;font-size:19px}.unit-title-row>b{color:#4059c7}
.lesson-list{display:grid;gap:7px;margin-top:14px}
.lesson-row{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:12px;padding:11px;border-radius:14px;background:#f8f9fc;color:var(--ink)}
.lesson-row:hover{background:#f1f4ff}.lesson-row div b{display:block}.lesson-row div small{display:block;color:var(--muted);font-size:10px;margin-top:2px}
.lesson-state{width:31px;height:31px;border-radius:10px;background:#e9edf5;display:grid;place-items:center;font-size:11px;font-weight:800}
.lesson-state.completed{background:#e7f7ef;color:#14815e}.lesson-state.in_progress{background:#eef2ff;color:#4059c7}
.lesson-progress-label{font-size:11px;color:#4059c7;font-weight:800}.lesson-placeholder{padding:12px;color:var(--muted);font-size:12px}

.lesson-breadcrumb{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--muted);margin-bottom:10px}
.lesson-breadcrumb a{color:var(--brand);font-weight:800}
.classroom-head{display:flex;justify-content:space-between;align-items:center;gap:20px;padding:25px 28px;border-radius:24px;
 background:linear-gradient(135deg,#18294f,#405fd8);color:#fff;margin-bottom:16px}
.classroom-head h2{font-size:30px;margin:5px 0}.classroom-head p{margin:0;color:#dce5ff}
.classroom-progress{text-align:center;min-width:90px}.classroom-progress small{display:block;color:#cbd7ff}.classroom-progress strong{font-size:27px}
.classroom-grid{display:grid;grid-template-columns:minmax(0,1fr) 330px;gap:16px;align-items:start}
.lesson-stage{display:grid;gap:14px}
.lesson-block{background:#fff;border:1px solid var(--line);border-radius:21px;padding:23px}
.block-kicker{font-size:10px;color:#4b61d8;text-transform:uppercase;font-weight:900}.lesson-block h3{font-size:21px;margin:5px 0 14px}
.lesson-copy{font-size:15px;line-height:2;color:#26334d}.objectives-block ul{margin:8px 0 0;padding-right:20px;line-height:2}
.understand-btn{margin-top:18px;border:1px solid #dce3f5;background:#f7f9ff;color:#4059c7;border-radius:11px;padding:9px 12px;cursor:pointer;font-weight:800}
.understand-btn.done{background:#eaf8f1;color:#167a5b;border-color:#d4efe3}
.lesson-source-wait{background:#fffdf7;border-color:#eee6c9}.lesson-source-wait p{color:#6e674e;line-height:1.8}
.mini-question{padding:12px 0;border-bottom:1px solid var(--line)}.mini-question b{display:block;line-height:1.7}.mini-question small{color:var(--muted)}
.inline-btn{display:inline-block;margin-top:15px}
.lesson-complete{display:flex;align-items:center;justify-content:space-between;gap:18px;background:#eef8f3;border:1px solid #d7eee3;border-radius:20px;padding:20px}
.lesson-complete span{font-size:11px;color:#19805f}.lesson-complete h3{margin:3px 0}
.next-lesson-link{display:flex;justify-content:space-between;align-items:center;padding:17px 20px;border-radius:18px;background:#17264b;color:#fff}
.next-lesson-link span{color:#cbd7ee;font-size:11px}.next-lesson-link.is-disabled{opacity:.45;pointer-events:none}

.kavena-teacher{position:sticky;top:16px;background:#fff;border:1px solid var(--line);border-radius:22px;padding:18px;box-shadow:0 12px 35px rgba(26,37,67,.06)}
.teacher-avatar{width:48px;height:48px;border-radius:16px;background:linear-gradient(135deg,#435ddd,#7b82ff);color:#fff;display:grid;place-items:center;font-size:20px;font-weight:900;float:right;margin-left:10px}
.kavena-teacher>div:nth-child(2) span{font-size:10px;color:var(--muted)}.kavena-teacher h3{margin:2px 0 12px}
.kavena-teacher>p{clear:both;color:var(--muted);font-size:12px;line-height:1.7;padding-top:12px}
.teacher-skills{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
.teacher-skills button{border:0;background:#f0f3ff;color:#4059c7;padding:7px 9px;border-radius:9px;font-size:10px;cursor:pointer}
.teacher-chat{height:280px;overflow:auto;background:#f7f8fb;border-radius:15px;padding:10px;display:flex;flex-direction:column;gap:8px}
.teacher-message,.student-message{max-width:90%;padding:9px 11px;border-radius:12px;font-size:12px;line-height:1.7}
.teacher-message{background:#fff;border:1px solid var(--line);align-self:flex-start}.student-message{background:#4059c7;color:#fff;align-self:flex-end}
.teacher-form{display:grid;grid-template-columns:1fr auto;gap:7px;margin-top:9px}.teacher-form input{min-width:0;border:1px solid var(--line);border-radius:11px;padding:10px}
.teacher-form button{border:0;border-radius:11px;background:#4059c7;color:#fff;padding:0 12px}.teacher-note{display:block;color:#8a94a8;font-size:9px;margin-top:8px;line-height:1.5}
.subject-secondary{display:block;text-align:center;margin-top:9px;font-size:11px;color:var(--muted)}
.student-mobile-nav{grid-template-columns:repeat(4,1fr)}

@media(max-width:980px){
 .classroom-grid{grid-template-columns:1fr}.kavena-teacher{position:static}
 .learn-hero{align-items:flex-start;flex-direction:column}.learn-subject-pills{justify-content:flex-start}
}
@media(max-width:620px){
 .classroom-head{align-items:flex-start}.classroom-progress{display:none}.classroom-head h2{font-size:24px}
 .unit-card{grid-template-columns:1fr}.unit-index{width:42px;height:42px}
 .lesson-row{grid-template-columns:auto 1fr}.lesson-progress-label{grid-column:2}
 .lesson-complete{align-items:stretch;flex-direction:column}.lesson-complete button{width:100%}
}


/* =========================================================
   KAVENA V2.9.1 — Curriculum Book Ingestion
   ========================================================= */
.ingestion-hero{display:flex;justify-content:space-between;align-items:center;gap:22px;
 padding:24px 26px;border-radius:24px;background:linear-gradient(135deg,#17264b,#3b58ce);color:#fff;margin-bottom:16px}
.ingestion-hero h2{font-size:27px;margin:8px 0 5px}.ingestion-hero p{margin:0;color:#dce4ff;max-width:760px}
.ingestion-flow{display:flex;gap:8px;align-items:center;white-space:nowrap}.ingestion-flow span{padding:8px 10px;border:1px solid #ffffff2c;background:#ffffff12;border-radius:10px;font-size:11px}
.source-summary{display:grid;gap:4px;padding:13px;border-radius:13px;background:#f7f8fc;margin:12px 0}
.source-summary span{font-size:11px;color:var(--muted)}
.ingestion-run-form{display:grid;gap:12px}.ingestion-status-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:9px}
.ingestion-status-grid>div{padding:13px;background:#f7f8fc;border-radius:13px}.ingestion-status-grid span{display:block;font-size:10px;color:var(--muted);margin-bottom:3px}
.ingestion-status-grid b{font-size:13px}
.ingestion-review-head{display:grid;grid-template-columns:2fr 1fr 1fr;gap:12px;margin-bottom:12px}
.ingestion-review-head>div{padding:11px;border-radius:12px;background:#f7f8fc}.ingestion-review-head span{display:block;font-size:10px;color:var(--muted)}
.ingestion-outline{display:grid;gap:14px}
.ingestion-unit{background:#fff;border:1px solid var(--line);border-radius:18px;padding:16px}
.ingestion-unit-head{display:grid;grid-template-columns:auto minmax(0,1fr) auto;gap:12px;align-items:end}
.ingestion-unit-head .unit-no{width:38px;height:38px;display:grid;place-items:center;border-radius:11px;background:#eef2ff;color:#4059c7;font-weight:900}
.ingestion-unit-head small{color:var(--muted);font-size:10px;padding-bottom:9px}
.ingestion-lessons{display:grid;gap:7px;margin-top:12px;padding-right:50px}
.ingestion-lesson{display:grid;grid-template-columns:30px 1fr;gap:9px;align-items:start;background:#f8f9fc;border-radius:12px;padding:10px}
.ingestion-lesson>span{width:27px;height:27px;border-radius:9px;background:#fff;display:grid;place-items:center;font-size:10px;font-weight:800}
.ingestion-lesson input{width:100%;border:1px solid #dfe4ef;border-radius:9px;padding:8px;background:#fff}
.ingestion-lesson small{display:block;color:var(--muted);font-size:9px;margin-top:5px}.ingestion-lesson p{margin:6px 0 0;color:#5f6c85;font-size:11px;line-height:1.7}
.ingestion-actions{position:sticky;bottom:12px;display:flex;gap:8px;justify-content:flex-start;background:#fffffff2;backdrop-filter:blur(10px);border:1px solid var(--line);border-radius:15px;padding:10px;margin-top:14px;z-index:20}
@media(max-width:800px){
 .ingestion-hero{align-items:flex-start;flex-direction:column}.ingestion-flow{flex-wrap:wrap}
 .ingestion-review-head{grid-template-columns:1fr}.ingestion-unit-head{grid-template-columns:auto 1fr}.ingestion-unit-head small{grid-column:2}
 .ingestion-lessons{padding-right:0}.ingestion-status-grid{grid-template-columns:1fr}
}


/* KAVENA V2.9.1b1 — ingestion processing lock */
.kavena-process-overlay[hidden]{display:none!important}
.kavena-process-overlay{
 position:fixed;inset:0;z-index:6000;display:grid;place-items:center;padding:20px;
 background:rgba(8,18,38,.76);backdrop-filter:blur(8px)
}
.kavena-process-modal{
 width:min(560px,94vw);background:#fff;border-radius:26px;padding:30px 28px;
 text-align:center;box-shadow:0 30px 90px rgba(0,0,0,.30)
}
.kavena-process-spinner{
 width:58px;height:58px;margin:0 auto 12px;border-radius:50%;
 border:5px solid #eef1f7;border-top-color:#4059d6;
 animation:kavenaSpin .9s linear infinite
}
@keyframes kavenaSpin{to{transform:rotate(360deg)}}
.kavena-process-kicker{font-size:10px;color:#5368cf;font-weight:900;letter-spacing:.04em}
.kavena-process-modal h3{font-size:24px;margin:7px 0 5px}
.kavena-process-modal>p{margin:0 0 18px;color:var(--muted);font-size:12px}
.kavena-process-percent{font-size:30px;font-weight:900;color:#3852c4;margin-bottom:8px}
.kavena-process-track{height:12px;border-radius:99px;background:#edf0f6;overflow:hidden}
.kavena-process-track i{
 display:block;height:100%;border-radius:inherit;
 background:linear-gradient(90deg,#4059d6,#7683ff);
 transition:width .45s ease
}
.kavena-process-stage{margin-top:14px;font-weight:800;color:#26344f}
.kavena-process-note{margin-top:10px;padding:10px;border-radius:12px;background:#f7f8fc;color:#6a7488;font-size:10px;line-height:1.6}
html.kavena-processing body{overflow:hidden}
html.kavena-processing .sidebar,
html.kavena-processing .topbar,
html.kavena-processing main{pointer-events:none;user-select:none}
html.kavena-processing .kavena-process-overlay{pointer-events:auto;user-select:auto}


/* KAVENA V2.9.1b2 — real resumable background ingestion */
#kavenaResumeBtn{margin-top:14px}
.kavena-process-modal .kavena-upload-error{margin-top:14px}


/* KAVENA V2.9.2 — Curriculum Review & Validation */
.review-dashboard{display:grid;grid-template-columns:2.1fr repeat(5,1fr);gap:10px;margin-bottom:14px}
.review-score{display:flex;align-items:center;gap:16px}
.review-score p{margin:5px 0 0;color:var(--muted);font-size:11px}
.review-score-ring{
 --score:0;width:78px;height:78px;min-width:78px;border-radius:50%;
 display:grid;place-items:center;position:relative;
 background:conic-gradient(#4560db calc(var(--score)*1%),#edf0f7 0)
}
.review-score-ring:after{content:"";position:absolute;inset:7px;background:#fff;border-radius:50%}
.review-score-ring strong,.review-score-ring span{position:relative;z-index:1;grid-area:1/1}
.review-score-ring strong{font-size:18px;color:#344dbd;margin-top:-8px}
.review-score-ring span{font-size:8px;color:#7b8498;margin-top:22px}
.review-stat{display:flex;flex-direction:column;justify-content:center;align-items:center;min-height:92px}
.review-stat span{font-size:10px;color:var(--muted)}
.review-stat b{font-size:24px;margin-top:5px}
.review-stat.warn b{color:#b05a18}
.review-toolbar{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:14px 0}
.review-toolbar>div:first-child{display:flex;flex-direction:column;gap:4px}
.review-toolbar-actions{display:flex;gap:8px;flex-wrap:wrap}
.review-accordion{display:grid;gap:10px}
.review-unit{background:#fff;border:1px solid #dfe4ef;border-radius:18px;overflow:hidden;box-shadow:0 7px 22px rgba(30,47,83,.04)}
.review-unit.has-issues{border-color:#ead8bf}
.review-unit.approved{border-color:#cfe8dc}
.review-unit summary{list-style:none;cursor:pointer;display:grid;grid-template-columns:auto 1fr auto;gap:13px;align-items:center;padding:15px 17px}
.review-unit summary::-webkit-details-marker{display:none}
.review-unit[open] summary{border-bottom:1px solid #edf0f5;background:#fbfcff}
.review-unit-number{width:38px;height:38px;border-radius:12px;background:#eef2ff;color:#4059c7;display:grid;place-items:center;font-weight:900}
.review-unit-title{display:flex;flex-direction:column;gap:3px}
.review-unit-title span{font-size:10px;color:var(--muted)}
.review-unit-badges{display:flex;gap:6px;align-items:center;flex-wrap:wrap}
.review-ok,.review-warning{font-size:9px;padding:6px 8px;border-radius:99px;font-weight:800}
.review-ok{background:#eaf8f1;color:#177257}
.review-warning{background:#fff3e5;color:#a45c18}
.review-unit-body{padding:16px}
.review-edit-row{display:flex;align-items:end;gap:12px}
.review-pages{min-width:130px;padding:10px 12px;border-radius:12px;background:#f7f8fb;display:flex;flex-direction:column}
.review-pages span{font-size:9px;color:var(--muted)}
.review-pages b{font-size:11px;margin-top:3px}
.review-issues{display:flex;gap:6px;flex-wrap:wrap;margin:10px 0}
.review-issues span{background:#fff5e8;color:#955313;border-radius:8px;padding:6px 8px;font-size:9px}
.review-issues.compact{margin:8px 0}
.review-lessons{display:grid;gap:9px;margin-top:12px}
.review-lesson{border:1px solid #e6e9f0;border-radius:14px;padding:12px;background:#fcfdff}
.review-lesson.has-issues{border-color:#eadcc9}
.review-lesson-head{display:flex;align-items:center;gap:10px}
.lesson-number{width:30px;height:30px;border-radius:9px;background:#f0f2f7;display:grid;place-items:center;font-weight:800;font-size:10px}
.review-lesson-head input{width:100%;font-weight:700}
.review-lesson-head small{display:block;margin-top:4px;color:var(--muted);font-size:9px}
.lesson-score{font-size:10px;font-weight:900;color:#4a5eb8;background:#eef2ff;padding:6px 8px;border-radius:9px}
.lesson-preview-grid{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-top:9px}
.lesson-preview-grid>div{background:#f7f8fb;border-radius:10px;padding:9px}
.lesson-preview-grid span{font-size:9px;font-weight:800;color:#53607a}
.lesson-preview-grid p{font-size:10px;line-height:1.65;margin:5px 0 0;color:#465168}
.review-tags{display:flex;gap:5px;flex-wrap:wrap;margin-top:8px}
.review-tags span{font-size:9px;background:#f0f3fa;color:#46516a;border-radius:99px;padding:5px 7px}
.unit-review-footer{display:grid;grid-template-columns:1fr 1fr;gap:12px;align-items:end;margin-top:14px;padding-top:13px;border-top:1px dashed #dde2ec}
.review-check{display:flex;align-items:center;gap:9px;padding:11px;border-radius:12px;background:#eef9f4;color:#24634f;font-size:10px;font-weight:800}
.review-check input{width:17px;height:17px}
.sticky-review-actions{position:sticky;bottom:12px;z-index:30;margin-top:16px;background:rgba(255,255,255,.96);backdrop-filter:blur(10px);border:1px solid #dfe4ef;border-radius:16px;padding:12px 14px;box-shadow:0 12px 35px rgba(26,42,75,.12);display:flex;justify-content:space-between;align-items:center;gap:12px}
.sticky-review-actions>div:last-child{display:flex;gap:8px;flex-wrap:wrap}
.sticky-review-actions small{display:block;color:var(--muted);margin-top:3px}
.sticky-review-actions button:disabled{opacity:.45;cursor:not-allowed}
@media(max-width:1100px){.review-dashboard{grid-template-columns:repeat(3,1fr)}.review-score{grid-column:1/-1}}
@media(max-width:700px){
 .review-dashboard{grid-template-columns:1fr 1fr}
 .review-score{grid-column:1/-1}
 .review-toolbar,.sticky-review-actions{align-items:stretch;flex-direction:column}
 .review-unit summary{grid-template-columns:auto 1fr}.review-unit-badges{grid-column:1/-1}
 .review-edit-row,.unit-review-footer{display:grid;grid-template-columns:1fr}
 .lesson-preview-grid{grid-template-columns:1fr}
}


/* KAVENA V2.9.2a — Curriculum Review UI Polish */
.review-context{
 display:flex;align-items:center;justify-content:space-between;gap:18px;
 padding:18px 20px;margin-bottom:14px;overflow:hidden
}
.review-context-main{min-width:0}
.review-context-kicker{
 display:block;font-size:9px;font-weight:900;letter-spacing:.04em;
 color:#5268cf;margin-bottom:4px
}
.review-context-main>b{
 display:block;font-size:18px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.review-context-meta{
 display:flex;flex-wrap:wrap;gap:7px 14px;margin-top:8px;
 font-size:10px;color:var(--muted)
}
.review-context-meta strong{color:#2d3952}
.review-context-status{
 min-width:150px;padding:11px 14px;border-radius:14px;background:#fff7e9;
 text-align:center
}
.review-context-status span{display:block;font-weight:900;color:#9a5b18}
.review-context-status small{display:block;margin-top:2px;font-size:9px;color:#9c7a55}
.review-context-status.is-ready{background:#edf9f3}
.review-context-status.is-ready span{color:#196c52}
.review-context-status.is-ready small{color:#5c8e7d}

.review-dashboard{
 grid-template-columns:minmax(260px,1.6fr) repeat(5,minmax(100px,.72fr));
 align-items:stretch
}
.review-dashboard>.card{min-width:0}
.review-score-card{min-height:104px;padding:14px 16px}
.review-stat{min-height:104px;padding:12px 10px}
.review-stat b{font-size:22px}
.review-score-ring{width:70px;height:70px;min-width:70px}
.review-score-ring strong{font-size:17px}

.review-toolbar{padding:12px 14px}
.review-toolbar .muted{max-width:760px;line-height:1.5}

.review-unit{border-radius:16px}
.review-unit summary{
 position:relative;grid-template-columns:auto minmax(0,1fr) auto auto auto;
 padding:13px 15px;gap:10px
}
.review-unit-title{min-width:0}
.review-unit-title b{
 white-space:nowrap;overflow:hidden;text-overflow:ellipsis;font-size:13px
}
.review-unit-title span{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.review-lesson-count{
 font-size:9px;font-weight:800;color:#53607a;background:#f1f4f9;
 padding:6px 8px;border-radius:99px;white-space:nowrap
}
.review-chevron{
 width:27px;height:27px;border-radius:8px;background:#f3f5f9;
 display:grid;place-items:center;font-size:16px;color:#6f7a90;
 transition:transform .18s ease
}
.review-unit[open] .review-chevron{transform:rotate(180deg)}
.review-unit-body{padding:14px 15px 16px}

.review-lessons{gap:8px}
.review-lesson{padding:10px 11px;border-radius:12px}
.review-lesson-head{align-items:flex-start}
.review-lesson-head .grow{min-width:0}
.review-lesson-head input{
 min-width:0;height:38px;padding:8px 10px;font-size:11px
}
.lesson-score{margin-top:4px;white-space:nowrap}
.review-issues.compact span{padding:5px 7px}

.lesson-preview-details{
 margin-top:8px;border:1px solid #e7eaf1;border-radius:10px;overflow:hidden;background:#fff
}
.lesson-preview-details>summary{
 cursor:pointer;list-style:none;padding:8px 10px;font-size:9px;font-weight:800;
 color:#4d5b77;background:#f8f9fc
}
.lesson-preview-details>summary::-webkit-details-marker{display:none}
.lesson-preview-details[open]>summary{border-bottom:1px solid #e7eaf1}
.lesson-preview-details .lesson-preview-grid{margin:8px}
.lesson-preview-details .review-tags{padding:0 8px 8px}

.unit-review-footer{grid-template-columns:minmax(260px,.9fr) minmax(280px,1.1fr)}
.review-check{min-height:44px}
.review-check span{line-height:1.5}

.sticky-review-actions{
 bottom:10px;padding:11px 13px;border-radius:14px
}
.sticky-review-copy{min-width:0}
.sticky-review-copy b{display:block}
.sticky-review-copy small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sticky-review-actions>div:last-child{justify-content:flex-end}

@media(max-width:1280px){
 .review-dashboard{grid-template-columns:repeat(3,minmax(0,1fr))}
 .review-score-card{grid-column:1/-1}
}
@media(max-width:900px){
 .review-context{align-items:stretch;flex-direction:column}
 .review-context-status{width:auto}
 .review-unit summary{grid-template-columns:auto minmax(0,1fr) auto}
 .review-unit-badges{grid-column:2/4}
 .review-lesson-count{grid-column:3}
 .review-chevron{grid-column:1;grid-row:2}
}
@media(max-width:700px){
 .review-dashboard{grid-template-columns:1fr 1fr}
 .review-score-card{grid-column:1/-1}
 .review-stat{min-height:88px}
 .review-unit summary{grid-template-columns:auto minmax(0,1fr)}
 .review-lesson-count{grid-column:2;justify-self:start}
 .review-unit-badges{grid-column:1/-1}
 .review-chevron{position:absolute;left:12px;top:12px}
 .unit-review-footer{grid-template-columns:1fr}
 .sticky-review-copy small{white-space:normal}
 .sticky-review-actions>div:last-child{display:grid;grid-template-columns:1fr}
 .sticky-review-actions .btn{width:100%}
}


/* KAVENA V2.9.2b — Review Layout Fix */

/* Top "choose source / source status" area:
   span5/span7 were never defined in the global 12-column grid, which caused
   both cards to collapse into narrow auto-sized columns on the right. */
.ingestion-setup-grid{
  grid-template-columns:repeat(12,minmax(0,1fr));
  align-items:start;
  margin-top:14px;
}
.ingestion-source-card{grid-column:span 8;min-width:0}
.ingestion-status-card{grid-column:span 4;min-width:0}

.ingestion-source-card,
.ingestion-status-card{
  align-self:start;
}

.ingestion-source-card h3,
.ingestion-status-card h3{
  margin-top:0;
}

.source-summary-polished{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:14px;
  margin:12px 0;
  padding:12px 14px;
  border-radius:14px;
  background:#f7f8fc;
  border:1px solid #e7eaf2;
}
.source-summary-title{
  min-width:0;
  display:flex;
  flex-direction:column;
  gap:3px;
}
.source-summary-title b{
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.source-summary-title span{
  color:var(--muted);
  font-size:10px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.source-summary-meta{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  justify-content:flex-start;
}
.source-summary-meta span{
  padding:5px 8px;
  border-radius:99px;
  background:#eef2ff;
  color:#465bc1;
  font-size:9px;
  font-weight:800;
  white-space:nowrap;
}

/* Critical flex sizing fix.
   The review markup uses .grow, but the class had no flex-grow declaration.
   That made the lesson title/editor remain narrow while the lesson card itself
   occupied the entire page, creating the huge empty rectangles seen on screen. */
.review-lesson-head>.grow,
.review-edit-row>.grow,
.unit-review-footer>.grow{
  flex:1 1 auto;
  min-width:0;
}

.review-lesson-head{
  width:100%;
}
.review-lesson-head input{
  display:block;
  width:100%;
  max-width:none;
  box-sizing:border-box;
}
.review-edit-row .field input,
.unit-review-footer .field input{
  width:100%;
  max-width:none;
  box-sizing:border-box;
}

/* Keep lesson cards content-sized instead of looking like empty banners. */
.review-lesson{
  min-height:0;
}
.review-lessons{
  width:100%;
}
.review-lesson-head small{
  line-height:1.45;
}
.lesson-preview-details{
  width:100%;
}

/* More balanced unit footer. */
.unit-review-footer{
  grid-template-columns:minmax(320px,.9fr) minmax(360px,1.1fr);
}

/* Give status grid a readable desktop proportion. */
.ingestion-status-grid{
  grid-template-columns:repeat(2,minmax(0,1fr));
}
.ingestion-status-grid>div{
  min-height:72px;
  display:flex;
  flex-direction:column;
  justify-content:center;
}

/* Slightly reduce dead space between setup and review sections. */
.ingestion-setup-grid + .section-title{
  margin-top:20px;
}

@media(max-width:1100px){
  .ingestion-source-card{grid-column:span 7}
  .ingestion-status-card{grid-column:span 5}
}

@media(max-width:900px){
  .ingestion-source-card,
  .ingestion-status-card{
    grid-column:1/-1;
  }
  .source-summary-polished{
    align-items:stretch;
    flex-direction:column;
  }
}

@media(max-width:700px){
  .ingestion-status-grid{grid-template-columns:1fr 1fr}
  .unit-review-footer{grid-template-columns:1fr}
}


/* KAVENA V2.9.2c — Responsive Review & Form Polish */

/* Prevent any review content from forcing horizontal overflow */
html,body{max-width:100%;overflow-x:hidden}
main,.page,.content,.container,
.review-accordion,.review-unit,.review-unit-body,
.review-lessons,.review-lesson,.review-lesson-head,
.review-edit-row,.unit-review-footer,
.review-dashboard,.review-context,.review-toolbar,
.sticky-review-actions{
  min-width:0;
  max-width:100%;
  box-sizing:border-box;
}

.review-unit summary{
  width:100%;
  box-sizing:border-box;
}
.review-unit-title,
.review-unit-title b,
.review-unit-title span,
.review-lesson-head>.grow,
.lesson-title-editor{
  min-width:0;
  max-width:100%;
}

/* Professional editable fields */
.review-title-input,
.review-note-input,
.review-field input,
.review-lesson-head input{
  appearance:none;
  border:1px solid #dfe4ee !important;
  background:#fff !important;
  border-radius:11px !important;
  box-shadow:0 1px 2px rgba(24,39,75,.03);
  min-height:42px;
  padding:9px 12px !important;
  font:inherit;
  line-height:1.4;
  transition:border-color .15s ease, box-shadow .15s ease, background .15s ease;
}

.review-title-input:hover,
.review-note-input:hover,
.review-field input:hover,
.review-lesson-head input:hover{
  border-color:#cbd4e3 !important;
  background:#fcfdff !important;
}

.review-title-input:focus,
.review-note-input:focus,
.review-field input:focus,
.review-lesson-head input:focus{
  outline:none;
  border-color:#6e7fe8 !important;
  box-shadow:0 0 0 3px rgba(76,94,216,.10) !important;
  background:#fff !important;
}

.lesson-title-editor{
  position:relative;
  width:100%;
}
.lesson-title-editor .review-title-input{
  width:100%;
  padding-left:54px !important;
}
.lesson-title-editor .edit-hint{
  position:absolute;
  left:9px;
  top:50%;
  transform:translateY(-50%);
  font-size:8px;
  font-weight:800;
  color:#6c7890;
  background:#f2f4f8;
  border-radius:7px;
  padding:4px 7px;
  pointer-events:none;
}

.review-field label{
  display:block;
  margin-bottom:6px;
  font-size:10px;
  font-weight:800;
  color:#526078;
}

.review-pages{
  border:1px solid #e6eaf1;
  background:#f8f9fc;
}

.review-lesson{
  overflow:hidden;
}
.review-lesson-head{
  display:grid;
  grid-template-columns:auto minmax(0,1fr) auto;
  align-items:start;
}
.review-lesson-head .lesson-number{grid-column:1}
.review-lesson-head .grow{grid-column:2}
.review-lesson-head .lesson-score{grid-column:3}

.sticky-review-actions{
  width:100%;
  max-width:100%;
  left:auto;
  right:auto;
}

/* Tablet */
@media(max-width:900px){
  .review-context-meta{gap:6px 10px}
  .review-dashboard{grid-template-columns:repeat(2,minmax(0,1fr))}
  .review-score-card{grid-column:1/-1}

  .review-unit summary{
    grid-template-columns:auto minmax(0,1fr) auto;
    gap:8px;
  }
  .review-unit-number{width:34px;height:34px}
  .review-unit-title b{font-size:12px}
  .review-unit-badges{grid-column:2/-1}
  .review-lesson-count{grid-column:3}
  .review-chevron{display:none}
}

/* Phone / narrow screens */
@media(max-width:640px){
  body{font-size:14px}

  .ingestion-setup-grid,
  .review-dashboard{
    display:grid !important;
    grid-template-columns:1fr !important;
    width:100% !important;
  }

  .ingestion-source-card,
  .ingestion-status-card,
  .review-score-card,
  .review-stat{
    grid-column:1 !important;
    width:100% !important;
  }

  .review-context,
  .review-toolbar{
    width:100%;
    padding:12px;
  }

  .review-context-main>b{
    white-space:normal;
    overflow:visible;
    text-overflow:clip;
    font-size:15px;
    line-height:1.5;
  }

  .review-context-meta{
    display:grid;
    grid-template-columns:1fr 1fr;
    width:100%;
  }

  .review-context-meta span{
    min-width:0;
    white-space:normal;
  }

  .review-unit{
    width:100%;
    border-radius:14px;
  }

  .review-unit summary{
    display:grid !important;
    grid-template-columns:34px minmax(0,1fr) !important;
    width:100% !important;
    padding:12px !important;
    gap:9px !important;
  }

  .review-unit-number{
    grid-column:1 !important;
    grid-row:1 !important;
  }

  .review-unit-title{
    grid-column:2 !important;
    grid-row:1 !important;
  }

  .review-unit-title b,
  .review-unit-title span{
    white-space:normal !important;
    overflow:visible !important;
    text-overflow:clip !important;
    overflow-wrap:anywhere;
  }

  .review-lesson-count{
    grid-column:2 !important;
    justify-self:start;
  }

  .review-unit-badges{
    grid-column:1/-1 !important;
    width:100%;
  }

  .review-unit-body{
    padding:10px !important;
  }

  .review-edit-row{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:9px;
  }

  .review-pages{
    width:100%;
    min-width:0;
  }

  .review-lesson{
    width:100%;
    padding:10px;
  }

  .review-lesson-head{
    display:grid !important;
    grid-template-columns:32px minmax(0,1fr) !important;
    gap:8px;
  }

  .review-lesson-head .lesson-number{
    grid-column:1 !important;
    grid-row:1 !important;
  }

  .review-lesson-head .grow{
    grid-column:2 !important;
    grid-row:1 !important;
    width:100%;
  }

  .review-lesson-head .lesson-score{
    grid-column:2 !important;
    grid-row:2 !important;
    justify-self:start;
    margin-top:0;
  }

  .lesson-title-editor{
    width:100% !important;
  }

  .lesson-title-editor .review-title-input{
    width:100% !important;
    min-width:0 !important;
    padding-left:48px !important;
    font-size:12px !important;
  }

  .review-lesson-head small{
    white-space:normal;
    overflow-wrap:anywhere;
  }

  .lesson-preview-grid{
    grid-template-columns:1fr !important;
  }

  .unit-review-footer{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:9px;
  }

  .review-check{
    width:100%;
    box-sizing:border-box;
    align-items:flex-start;
  }

  .review-check span{
    white-space:normal;
    line-height:1.6;
  }

  .sticky-review-actions{
    position:static !important;
    display:grid !important;
    grid-template-columns:1fr !important;
    width:100% !important;
    margin-top:12px;
    padding:11px;
    border-radius:14px;
  }

  .sticky-review-actions>div:last-child{
    display:grid !important;
    grid-template-columns:1fr !important;
    gap:8px;
    width:100%;
  }

  .sticky-review-actions .btn{
    width:100% !important;
    min-width:0 !important;
    white-space:normal;
  }

  .sticky-review-copy small{
    white-space:normal !important;
    line-height:1.5;
  }
}

/* Extra narrow phones */
@media(max-width:420px){
  .review-context-meta{grid-template-columns:1fr}
  .review-unit-body{padding:8px !important}
  .review-lesson{padding:8px}
  .review-lesson-head{grid-template-columns:28px minmax(0,1fr) !important}
  .lesson-number{width:28px;height:28px}
  .review-title-input,
  .review-note-input,
  .review-field input,
  .review-lesson-head input{
    min-height:40px;
    font-size:11px !important;
  }
}


/* =========================================================
   KAVENA V3.0 — Source-Grounded AI Learning Engine
   ========================================================= */
.classroom-metrics{display:flex;gap:9px;align-items:stretch}
.classroom-mastery,.classroom-progress{
 min-width:116px;padding:11px 13px;border:1px solid #e2e7f1;border-radius:14px;background:#fff;
 display:flex;flex-direction:column;justify-content:center
}
.classroom-mastery small,.classroom-progress small{font-size:9px;color:var(--muted)}
.classroom-mastery strong,.classroom-progress strong{font-size:19px;margin-top:2px;color:#3852c4}

.lesson-source-banner{
 display:flex;justify-content:space-between;align-items:center;gap:14px;
 margin:12px 0 16px;padding:12px 14px;border:1px solid #dfe7f6;border-radius:14px;
 background:#f8faff
}
.lesson-source-banner>div:first-child{display:flex;flex-direction:column;gap:3px;min-width:0}
.lesson-source-banner span{font-size:9px;color:var(--muted)}
.lesson-source-banner b{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.lesson-source-meta{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}
.lesson-source-meta span,.grounded-badge{
 padding:5px 8px;border-radius:99px;background:#eaf7f1;color:#176b52;font-size:9px;font-weight:800
}

.block-head-row{display:flex;align-items:center;justify-content:space-between;gap:12px}
.block-head-row h3{margin-bottom:0}
.block-head-row>strong{font-size:10px;padding:6px 8px;border-radius:99px;background:#eef2ff;color:#4059c7}

.mastery-skill-list{display:grid;gap:8px;margin-top:12px}
.mastery-skill{
 display:grid;grid-template-columns:minmax(150px,1.15fr) minmax(120px,2fr) auto;
 gap:10px;align-items:center;padding:9px 10px;border-radius:11px;background:#f8f9fc
}
.mastery-skill>div:first-child{display:flex;flex-direction:column;min-width:0}
.mastery-skill b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mastery-skill span{font-size:8px;color:var(--muted);margin-top:2px}
.mastery-skill>strong{font-size:10px;color:#4257bb}
.mastery-track{height:7px;background:#e9edf5;border-radius:99px;overflow:hidden}
.mastery-track i{display:block;height:100%;background:#5368dd;border-radius:99px;transition:width .25s ease}

.teacher-mode-row{display:flex;gap:5px;margin:10px 0}
.teacher-mode{
 border:1px solid #e0e5ef;background:#f8f9fc;color:#576279;border-radius:9px;
 padding:6px 8px;font-size:9px;cursor:pointer
}
.teacher-mode.active{background:#eef2ff;color:#4059c7;border-color:#cdd6ff;font-weight:800}

.teacher-message,.student-message{white-space:pre-wrap}
.teacher-source-refs{display:flex;gap:4px;flex-wrap:wrap;margin-top:8px}
.teacher-source-refs span{
 padding:4px 6px;border-radius:7px;background:#eef6f2;color:#28705a;font-size:8px;font-weight:800
}

.lesson-check-shell{margin-top:12px}
.check-loading,.check-error,.check-finished{
 padding:14px;border-radius:12px;background:#f7f8fc;color:#59657c;font-size:11px
}
.check-error{background:#fff1f2;color:#9d3346}
.check-finished{display:flex;flex-direction:column;gap:4px;background:#edf9f3;color:#236b55}
.check-question-card{padding:14px;border:1px solid #e1e6ef;border-radius:14px;background:#fff}
.check-question-top{display:flex;justify-content:space-between;gap:10px;margin-bottom:8px}
.check-question-top span,.check-question-top small{font-size:9px;color:var(--muted)}
.check-question-card h4{font-size:14px;line-height:1.7;margin:8px 0 12px}
.check-options{display:grid;gap:7px}
.check-option{
 width:100%;text-align:right;border:1px solid #dfe4ee;background:#fbfcfe;border-radius:11px;
 padding:10px 12px;cursor:pointer;font:inherit;font-size:11px;transition:.15s
}
.check-option:hover{border-color:#bfc9df;background:#f8faff}
.check-option.selected{border-color:#7888e6}
.check-option.correct{background:#edf9f3;border-color:#b8dfcf;color:#17664f}
.check-option.wrong{background:#fff0f2;border-color:#e8bec5;color:#9c3346}
.check-feedback{margin-top:10px;padding:11px;border-radius:11px}
.check-feedback.ok{background:#edf9f3;color:#256b56}
.check-feedback.needs-work{background:#fff7ea;color:#875a20}
.check-feedback b{display:block;font-size:11px}
.check-feedback p{font-size:10px;line-height:1.65;margin:5px 0 9px}

@media(max-width:820px){
 .classroom-metrics{width:100%}
 .classroom-mastery,.classroom-progress{flex:1;min-width:0}
 .lesson-source-banner{align-items:stretch;flex-direction:column}
 .lesson-source-meta{justify-content:flex-start}
 .mastery-skill{grid-template-columns:1fr auto}
 .mastery-track{grid-column:1/-1;grid-row:2}
}
@media(max-width:520px){
 .classroom-metrics{display:grid;grid-template-columns:1fr 1fr}
 .mastery-skill{grid-template-columns:minmax(0,1fr) auto}
 .check-question-card{padding:11px}
 .check-option{font-size:10px}
}


/* KAVENA V3.0.1 — Curriculum Integrity & Publish Repair */
.ingestion-integrity-link{display:flex;justify-content:flex-start;margin:0 0 10px}
.integrity-hero{
 display:flex;justify-content:space-between;align-items:center;gap:18px;
 padding:22px 24px;border-radius:20px;background:linear-gradient(120deg,#1c315f,#405ed9);color:#fff;margin-bottom:14px
}
.integrity-hero span,.section-title-row span,.repair-card>div>span{font-size:9px;font-weight:800;letter-spacing:.02em}
.integrity-hero h2{margin:5px 0 6px;font-size:22px}
.integrity-hero p{margin:0;opacity:.84;max-width:820px}
.integrity-source-card{margin-bottom:14px}
.integrity-source-form{display:flex;align-items:end;gap:10px}
.integrity-score-row{display:grid;grid-template-columns:1.25fr repeat(4,1fr);gap:10px;margin-bottom:12px}
.integrity-score-card,.integrity-metric{
 background:#fff;border:1px solid #e2e7f0;border-radius:15px;padding:14px 16px;display:flex;flex-direction:column;gap:3px
}
.integrity-score-card{background:#f7f9ff}
.integrity-score-card small,.integrity-metric small{font-size:9px;color:var(--muted)}
.integrity-score-card strong{font-size:28px;color:#3f58cb}
.integrity-score-card span{font-size:9px;color:#6c7890}
.integrity-metric b{font-size:18px}
.integrity-context{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:18px}
.integrity-context>div{padding:9px 10px;border-radius:11px;background:#f8f9fc;display:flex;flex-direction:column;gap:3px;min-width:0}
.integrity-context span{font-size:8px;color:var(--muted)}
.integrity-context b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.integrity-section{margin:18px 0}
.section-title-row{display:flex;align-items:end;justify-content:space-between;gap:12px;margin-bottom:10px}
.section-title-row h3{margin:3px 0 0}
.integrity-ok{padding:6px 9px;border-radius:99px;background:#eaf8f1;color:#176c52}
.integrity-issues{display:grid;gap:8px}
.integrity-issue{display:flex;align-items:flex-start;gap:10px;padding:12px 14px;border-radius:13px;border:1px solid}
.integrity-issue>span{font-size:8px;font-weight:900;padding:5px 7px;border-radius:99px}
.integrity-issue>div{display:flex;flex-direction:column;gap:3px}
.integrity-issue b{font-size:11px}
.integrity-issue small{font-size:8px;opacity:.72}
.integrity-issue.critical{background:#fff3f4;border-color:#efc8ce;color:#8e3041}
.integrity-issue.critical>span{background:#f8dfe3}
.integrity-issue.warning{background:#fff9ee;border-color:#eeddb8;color:#7b5a26}
.integrity-issue.warning>span{background:#f7e9c9}
.integrity-clean{padding:18px;border:1px solid #cfe8dd;border-radius:14px;background:#eff9f4;color:#246b55;display:flex;flex-direction:column;gap:4px}
.repair-card{display:flex;align-items:center;justify-content:space-between;gap:20px;border-color:#d7def6;background:#fafbff}
.repair-card h3{margin:4px 0 6px}
.repair-card p{margin:0;max-width:900px;color:var(--muted);line-height:1.7}
.repair-result{margin-top:12px}
.repair-stats{display:grid;grid-template-columns:repeat(5,1fr);gap:8px}
.repair-stats>div{padding:10px;border-radius:10px;background:#f7f8fc;display:flex;flex-direction:column;gap:3px}
.repair-stats small{font-size:8px;color:var(--muted)}
.repair-stats b{font-size:16px}
@media(max-width:900px){
 .integrity-score-row{grid-template-columns:repeat(2,1fr)}
 .integrity-score-card{grid-column:1/-1}
 .integrity-context{grid-template-columns:1fr}
 .repair-stats{grid-template-columns:repeat(2,1fr)}
}
@media(max-width:640px){
 .integrity-hero,.repair-card,.integrity-source-form{align-items:stretch;flex-direction:column}
 .integrity-score-row{grid-template-columns:1fr 1fr}
 .repair-card form,.repair-card .btn,.integrity-source-form .btn{width:100%}
}


/* KAVENA V3.0.1c — Integrity UI Polish */
.integrity-hero .btn.ghost{
  background:rgba(255,255,255,.96);
  color:#2948b8 !important;
  border-color:rgba(255,255,255,.75);
  box-shadow:0 6px 18px rgba(12,30,77,.12);
  white-space:nowrap;
}
.integrity-hero .btn.ghost:hover{
  background:#fff;
  color:#1f3da5 !important;
  transform:translateY(-1px);
}
@media(max-width:640px){
  .integrity-hero .btn.ghost{
    width:100%;
    text-align:center;
  }
}


/* KAVENA V3.0.2 — Multilingual Learning Runtime */
.language-switch{
 display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:5px;margin-bottom:10px;
 padding:5px;border:1px solid #e1e6ef;border-radius:11px;background:#f7f8fb
}
.locale-btn{
 border:0;border-radius:8px;background:transparent;color:#6b7589;
 padding:6px 8px;font-size:9px;font-weight:800;cursor:pointer
}
.locale-btn.active{background:#fff;color:#4059c7;box-shadow:0 2px 7px rgba(27,43,77,.08)}
.topbar{display:flex;justify-content:space-between;align-items:center;gap:12px}
.topbar-language span{
 display:inline-grid;place-items:center;min-width:34px;height:28px;padding:0 8px;
 border-radius:9px;background:#eef2ff;color:#4059c7;font-size:9px;font-weight:900
}
.lesson-language-note{
 margin:-7px 0 14px;padding:8px 10px;border-radius:10px;background:#fff8e9;
 color:#7d6030;font-size:9px;line-height:1.55;border:1px solid #f0e2bf
}

/* Flip directional flex/layout behavior naturally when UI is LTR. */
html[dir="ltr"] .lesson-breadcrumb span{transform:scaleX(-1)}
html[dir="ltr"] .check-option{text-align:left}
html[dir="ltr"] .teacher-form input{text-align:left}
html[dir="ltr"] .lesson-stage,
html[dir="ltr"] .kavena-teacher,
html[dir="ltr"] .lesson-block{text-align:left}
html[dir="ltr"] .student-mobile-nav{text-align:center}
html[dir="ltr"] .sidebar nav a{text-align:left}
html[dir="ltr"] .mini-user{text-align:left}
html[dir="ltr"] .teacher-source-refs{justify-content:flex-start}
html[dir="ltr"] .lesson-source-meta{justify-content:flex-end}

@media(max-width:700px){
 .language-switch{grid-template-columns:1fr 1fr}
 .topbar-language{display:none}
}


/* KAVENA V3.0.3 — Full Bilingual Learning UX */

/* Sidebar visibility / active state */
.sidebar{
  display:flex;
  flex-direction:column;
  min-height:100vh;
}
.sidebar nav{
  flex:0 0 auto;
}
.sidebar nav a{
  position:relative;
  transition:background .15s ease,color .15s ease,transform .15s ease;
}
.sidebar nav a.active{
  background:#1a2a46;
  color:#fff;
  font-weight:800;
  box-shadow:inset 3px 0 0 #6f84ff;
}
html[dir="rtl"] .sidebar nav a.active{
  box-shadow:inset -3px 0 0 #6f84ff;
}
.sidebar nav a.active .nav-ico{
  background:#5e72e8;
  color:#fff;
}

.sidebar-profile-zone{
  margin-top:24px;
  padding-top:14px;
  border-top:1px solid rgba(255,255,255,.08);
}
.sidebar-profile-zone .mini-user{
  margin-bottom:10px;
}
.sidebar-profile-zone .language-switch{
  margin:0 0 8px;
}
.sidebar-profile-zone .logout{
  display:block;
}

/* learn page multilingual consistency */
.locale-en .learn-hero,
.locale-en .learning-subject-head,
.locale-en .unit-card,
.locale-en .lesson-row{
  text-align:left;
}
.locale-en .lesson-row{
  direction:ltr;
}
.locale-en .unit-card{
  direction:ltr;
}
.locale-en .learning-subject-head{
  direction:ltr;
}
.locale-en .learn-hero{
  direction:ltr;
}

/* full-width AI teacher */
.classroom-grid-wide{
  display:block !important;
}
.classroom-grid-wide .lesson-stage{
  width:100%;
  max-width:none;
}
.kavena-teacher-wide{
  margin-top:16px;
  width:100%;
  max-width:none;
  min-height:420px;
  padding:18px;
  border:1px solid #dfe5f0;
  border-radius:18px;
  background:#fff;
  box-shadow:0 8px 24px rgba(30,47,83,.05);
}
.teacher-wide-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}
.teacher-wide-head span{
  font-size:9px;
  color:#5368cf;
  font-weight:900;
}
.teacher-wide-head h3{
  margin:4px 0 0;
  font-size:16px;
}
.kavena-teacher-wide .teacher-chat{
  min-height:260px;
  max-height:520px;
  overflow:auto;
  padding:12px;
  border-radius:14px;
  background:#f8f9fc;
}
.kavena-teacher-wide .teacher-form{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:8px;
  margin-top:10px;
}
html[dir="rtl"] .kavena-teacher-wide .teacher-form{
  grid-template-columns:auto minmax(0,1fr);
}
.kavena-teacher-wide .teacher-form input{
  min-width:0;
  width:100%;
}
.kavena-teacher-wide .teacher-message,
.kavena-teacher-wide .student-message{
  max-width:min(760px,92%);
}
.kavena-teacher-wide .teacher-source-refs{
  margin-top:8px;
}

@media(max-width:900px){
  .sidebar-profile-zone{
    margin-top:16px;
  }
  .kavena-teacher-wide{
    min-height:360px;
  }
}

@media(max-width:700px){
  .sidebar-profile-zone{
    margin-top:12px;
    padding-top:10px;
  }
  .kavena-teacher-wide{
    min-height:320px;
    padding:12px;
  }
  .kavena-teacher-wide .teacher-form,
  html[dir="rtl"] .kavena-teacher-wide .teacher-form{
    grid-template-columns:1fr;
  }
  .kavena-teacher-wide .teacher-form button{
    width:100%;
  }
}


/* ============================================================
   KAVENA V3.1 — Immersive AI Lesson Experience
   ============================================================ */
.legacy-teacher-hidden{display:none!important}

.immersive-lesson-shell{
  margin:18px 0;
  border:1px solid #dfe5f0;
  border-radius:24px;
  background:#fff;
  box-shadow:0 18px 60px rgba(25,42,78,.08);
  overflow:hidden;
}
.lesson-player-top{
  display:flex;
  justify-content:space-between;
  align-items:center;
  gap:16px;
  padding:18px 20px;
  background:linear-gradient(135deg,#101f43,#3e5ed9);
  color:#fff;
}
.player-kicker{
  display:block;
  font-size:9px;
  font-weight:900;
  opacity:.8;
  margin-bottom:5px;
}
.lesson-player-top h2{margin:0;font-size:22px}
.player-status{
  display:inline-flex;
  margin:7px 0 0;
  font-size:9px;
  padding:5px 8px;
  border-radius:99px;
  background:rgba(255,255,255,.12)
}
.player-status.ready{color:#dff8ee}
.player-status.missing{color:#ffe8c8}
.player-step{
  min-width:110px;
  text-align:center;
  padding:9px 12px;
  border-radius:12px;
  background:rgba(255,255,255,.12);
  font-size:10px;
  font-weight:800;
}

.lesson-stage-pro{
  display:grid;
  grid-template-columns:minmax(0,1.75fr) minmax(300px,.75fr);
  gap:0;
  min-height:560px;
}
.lesson-scene-area{
  padding:26px;
  background:
    radial-gradient(circle at 20% 15%,rgba(89,111,223,.08),transparent 30%),
    #fbfcff;
  display:flex;
  flex-direction:column;
}
.scene-card{
  flex:1;
  min-height:390px;
  border:1px solid #e1e6ef;
  border-radius:20px;
  background:#fff;
  padding:28px;
  display:flex;
  flex-direction:column;
  justify-content:center;
  box-shadow:0 10px 30px rgba(29,46,82,.05);
}
.scene-type{
  font-size:9px;
  font-weight:900;
  color:#5066cd;
  text-transform:uppercase;
  margin-bottom:8px;
}
.scene-card h3{
  margin:0 0 16px;
  font-size:28px;
  line-height:1.35;
}
.scene-body{
  white-space:pre-wrap;
  font-size:17px;
  line-height:1.95;
  color:#2f3b52;
  max-width:920px;
}
.scene-controls{
  display:grid;
  grid-template-columns:auto 1fr auto;
  align-items:center;
  gap:12px;
  margin-top:14px;
}
.scene-dots{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:6px;
  flex-wrap:wrap;
}
.scene-dot{
  width:8px;
  height:8px;
  padding:0;
  border:0;
  border-radius:50%;
  background:#dbe1ef;
  cursor:pointer;
}
.scene-dot.active{
  width:24px;
  border-radius:99px;
  background:#5369db;
}

.interactive-avatar-panel{
  position:relative;
  padding:24px 20px;
  border-inline-start:1px solid #e2e7f0;
  background:linear-gradient(180deg,#f7f9ff,#eef2fb);
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
}
.avatar-stage{
  position:relative;
  width:190px;
  height:240px;
  display:grid;
  place-items:center;
  margin-bottom:12px;
}
.avatar-halo{
  position:absolute;
  width:180px;
  height:180px;
  border-radius:50%;
  background:radial-gradient(circle,rgba(93,116,236,.24),rgba(93,116,236,0) 68%);
  animation:kavenaHalo 3.2s ease-in-out infinite;
}
@keyframes kavenaHalo{50%{transform:scale(1.08);opacity:.72}}
.avatar-character{
  position:relative;
  width:118px;
  height:188px;
  z-index:2;
}
.avatar-face{
  position:absolute;
  top:0;
  left:50%;
  transform:translateX(-50%);
  width:96px;
  height:96px;
  border-radius:36px 36px 42px 42px;
  background:linear-gradient(145deg,#ffffff,#e9efff);
  border:2px solid #d6def4;
  box-shadow:0 14px 30px rgba(55,77,157,.12);
}
.avatar-eye{
  position:absolute;
  top:38px;
  width:10px;
  height:14px;
  border-radius:50%;
  background:#324aa8;
}
.avatar-eye.left{left:25px}
.avatar-eye.right{right:25px}
.avatar-mouth{
  position:absolute;
  width:28px;
  height:12px;
  left:50%;
  bottom:20px;
  transform:translateX(-50%);
  border-bottom:3px solid #6073ca;
  border-radius:50%;
}
.avatar-body{
  position:absolute;
  left:50%;
  bottom:0;
  transform:translateX(-50%);
  width:118px;
  height:105px;
  border-radius:44px 44px 24px 24px;
  background:linear-gradient(145deg,#405bd5,#263b9c);
  box-shadow:0 18px 40px rgba(42,62,147,.18);
}
.avatar-status-dot{
  position:absolute;
  bottom:25px;
  right:20px;
  width:12px;
  height:12px;
  border-radius:50%;
  background:#46b98a;
  box-shadow:0 0 0 5px rgba(70,185,138,.12);
}
.avatar-copy{text-align:center}
.avatar-copy span{font-size:9px;color:#63708c}
.avatar-copy h3{font-size:20px;margin:3px 0}
.avatar-copy p{
  margin:6px auto 0;
  max-width:300px;
  min-height:42px;
  font-size:11px;
  line-height:1.6;
  color:#536079;
}
.coach-actions{
  display:grid;
  grid-template-columns:1fr;
  width:100%;
  gap:7px;
  margin-top:14px;
}
.coach-action,.voice-btn{
  border:1px solid #d9e0ee;
  background:#fff;
  color:#3c4a67;
  border-radius:11px;
  padding:9px 10px;
  font-size:10px;
  font-weight:800;
  cursor:pointer;
}
.coach-action:hover,.voice-btn:hover{border-color:#aebae0;background:#f9faff}
.voice-actions{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:7px;
  width:100%;
  margin-top:7px;
}
.coach-response{
  width:100%;
  margin-top:10px;
  padding:11px 12px;
  border-radius:12px;
  background:#fff;
  border:1px solid #dde4f0;
  font-size:10px;
  line-height:1.7;
  max-height:180px;
  overflow:auto;
}
.coach-loading{color:#69758d}

@media(max-width:1000px){
  .lesson-stage-pro{grid-template-columns:1fr}
  .interactive-avatar-panel{
    border-inline-start:0;
    border-top:1px solid #e2e7f0;
    display:grid;
    grid-template-columns:auto 1fr;
    align-items:center;
    gap:16px;
  }
  .avatar-stage{width:150px;height:180px;margin:0}
  .avatar-character{transform:scale(.78)}
  .avatar-copy{text-align:start}
  .coach-actions,.voice-actions,.coach-response{grid-column:1/-1}
}
@media(max-width:640px){
  .lesson-player-top{align-items:flex-start;flex-direction:column}
  .player-step{min-width:0}
  .lesson-scene-area{padding:12px}
  .scene-card{padding:18px;min-height:320px}
  .scene-card h3{font-size:22px}
  .scene-body{font-size:15px;line-height:1.85}
  .scene-controls{grid-template-columns:1fr 1fr}
  .scene-dots{grid-column:1/-1;grid-row:2}
  .interactive-avatar-panel{display:flex;padding:18px 14px}
  .avatar-stage{height:160px}
  .avatar-copy{text-align:center}
  .voice-actions{grid-template-columns:1fr}
}


/* ============================================================
   KAVENA V3.2 — Voice-First AI Tutor
   ============================================================ */
.voice-first-panel{
  justify-content:flex-start;
  padding-top:18px;
}
.voice-mode-header{
  width:100%;
  display:flex;
  justify-content:space-between;
  align-items:flex-start;
  gap:10px;
  padding-bottom:12px;
  border-bottom:1px solid #dfe5ef;
}
.voice-mode-header>div{display:flex;flex-direction:column;gap:3px;min-width:0}
.voice-mode-header>div>span{font-size:8px;color:#5368cf;font-weight:900}
.voice-mode-header>div>b{font-size:13px}
.voice-mode-header>div>small{font-size:9px;line-height:1.5;color:#68748a}
.voice-toggle{
  display:flex;
  align-items:center;
  gap:6px;
  font-size:8px;
  color:#5d6980;
  white-space:nowrap;
}
.voice-toggle input{accent-color:#5267dc}

.voice-primary-wrap{
  width:100%;
  display:grid;
  place-items:center;
  margin:4px 0 12px;
}
.voice-orb-btn{
  position:relative;
  width:180px;
  height:180px;
  border:0;
  border-radius:50%;
  background:linear-gradient(145deg,#314ec3,#5571ef);
  color:#fff;
  cursor:pointer;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:4px;
  box-shadow:0 22px 50px rgba(54,77,181,.28);
  isolation:isolate;
}
.voice-orb-ring{
  position:absolute;
  inset:-11px;
  border-radius:50%;
  border:2px solid rgba(82,106,226,.18);
  z-index:-1;
}
.voice-orb-icon{font-size:34px}
.voice-orb-btn strong{font-size:13px}
.voice-orb-btn small{
  max-width:125px;
  font-size:8px;
  line-height:1.45;
  opacity:.82;
}
.voice-orb-btn:hover{transform:translateY(-2px)}
.voice-first-panel[data-voice-state="listening"] .voice-orb-btn{
  animation:voicePulse 1s ease-in-out infinite;
  background:linear-gradient(145deg,#325e9c,#4787d0);
}
.voice-first-panel[data-voice-state="processing"] .voice-orb-btn{
  background:linear-gradient(145deg,#5b4fc7,#7b6ee6);
}
.voice-first-panel[data-voice-state="speaking"] .voice-orb-btn{
  background:linear-gradient(145deg,#218a6b,#43b58f);
}
@keyframes voicePulse{
  50%{box-shadow:0 0 0 18px rgba(80,110,224,.12),0 22px 50px rgba(54,77,181,.28)}
}

.avatar-stage[data-state="speaking"] .avatar-mouth{
  animation:avatarTalk .34s ease-in-out infinite alternate;
}
.avatar-stage[data-state="listening"] .avatar-eye{
  animation:avatarBlink 1.1s ease-in-out infinite;
}
@keyframes avatarTalk{to{height:20px;border-bottom-width:5px}}
@keyframes avatarBlink{50%{height:3px;top:43px}}

.coach-actions-pro{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.voice-actions-pro{
  grid-template-columns:repeat(3,minmax(0,1fr));
}
.coach-actions-pro .coach-action,
.voice-actions-pro .voice-btn{
  min-height:42px;
  white-space:normal;
}

.transcript-toggle{
  border:0;
  background:transparent;
  color:#5669c6;
  font-size:9px;
  font-weight:800;
  margin-top:9px;
  cursor:pointer;
}
.voice-transcript{
  width:100%;
  margin-top:7px;
  display:grid;
  gap:6px;
}
.voice-transcript>div{
  padding:8px 10px;
  background:#fff;
  border:1px solid #dfe5ef;
  border-radius:10px;
}
.voice-transcript span{
  display:block;
  font-size:8px;
  color:#788298;
  margin-bottom:3px;
}
.voice-transcript p{
  margin:0;
  font-size:9px;
  line-height:1.55;
}
.coach-response-voice{
  max-height:150px;
}
.scene-audio-strip{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-top:14px;
}
.scene-audio-primary{
  border:0;
  border-radius:11px;
  padding:9px 14px;
  background:#eef2ff;
  color:#4059c7;
  font-size:10px;
  font-weight:900;
  cursor:pointer;
}
.scene-audio-strip>span{
  font-size:8px;
  color:#8a93a6;
}

@media(max-width:1000px){
  .voice-first-panel{
    display:flex;
  }
  .voice-orb-btn{width:150px;height:150px}
  .coach-actions-pro,
  .voice-actions-pro{grid-template-columns:repeat(3,1fr)}
}
@media(max-width:640px){
  .voice-mode-header{flex-direction:column}
  .voice-toggle{white-space:normal}
  .voice-orb-btn{width:142px;height:142px}
  .coach-actions-pro,
  .voice-actions-pro{grid-template-columns:1fr}
  .scene-audio-strip{align-items:stretch;flex-direction:column}
  .scene-audio-primary{width:100%}
}


/* KAVENA V3.2a — Premium Voice Tutor Response */
.coach-response-voice{
  display:grid;
  gap:8px;
  max-height:none;
  background:transparent;
  border:0;
  padding:0;
}
.coach-screen-summary{
  background:#fff;
  border:1px solid #dfe5ef;
  border-radius:12px;
  padding:12px 13px;
  font-size:11px;
  line-height:1.65;
  color:#344158;
  box-shadow:0 5px 16px rgba(30,47,83,.04);
}
.coach-next-question{
  background:#eef3ff;
  color:#3650bb;
  border-radius:11px;
  padding:10px 12px;
  font-size:10px;
  font-weight:800;
  line-height:1.55;
}
.coach-response-voice .teacher-source-refs{
  margin-top:0;
}
.voice-first-panel[data-voice-state="speaking"] .avatar-halo{
  animation:kavenaHalo 1.25s ease-in-out infinite;
}


/* ============================================================
   KAVENA V3.2b — Premium Voice & Digital Tutor UX
   ============================================================ */

/* tighter, premium lesson composition */
.immersive-lesson-shell{
  border-radius:28px;
  overflow:hidden;
  border:1px solid #dce3ef;
  box-shadow:0 24px 80px rgba(20,37,73,.10);
  background:#fff;
}
.lesson-stage-pro{
  grid-template-columns:minmax(0,1.8fr) minmax(360px,.72fr);
  min-height:610px;
}
.lesson-scene-area{
  padding:30px;
  background:linear-gradient(180deg,#fbfcff,#f6f8fc);
}
.scene-card{
  justify-content:flex-start;
  padding:42px 46px;
  min-height:430px;
  border-radius:24px;
  border:1px solid #e1e6ef;
  background:#fff;
  box-shadow:0 12px 36px rgba(30,47,83,.045);
}
.scene-card h3{
  font-size:32px;
  max-width:920px;
  margin-bottom:18px;
}
.scene-body{
  max-width:980px;
  font-size:18px;
  line-height:2;
  color:#27354e;
}

/* digital tutor pane */
.voice-first-panel{
  padding:22px;
  background:
    radial-gradient(circle at 50% 10%,rgba(80,105,221,.12),transparent 35%),
    linear-gradient(180deg,#f5f8ff 0%,#eef3fb 100%);
  border-inline-start:1px solid #dfe5ef;
}
.voice-mode-header{
  border-bottom:0;
  padding-bottom:6px;
}
.voice-mode-header>div>b{font-size:15px}
.voice-mode-header>div>small{font-size:10px}
.voice-toggle{
  padding:6px 8px;
  border-radius:9px;
  background:rgba(255,255,255,.75);
  border:1px solid #dfe5ef;
}

.avatar-stage{
  width:220px;
  height:250px;
  margin:4px auto 4px;
}
.avatar-halo{
  width:205px;
  height:205px;
  background:radial-gradient(circle,rgba(79,105,226,.18),rgba(79,105,226,0) 70%);
}
.avatar-premium{
  width:132px;
  height:205px;
}
.avatar-premium .avatar-head{
  position:absolute;
  top:0;left:50%;transform:translateX(-50%);
  width:104px;height:112px;
}
.avatar-premium .avatar-hair{
  position:absolute;
  z-index:3;
  top:0;left:8px;right:8px;height:42px;
  border-radius:42px 42px 24px 24px;
  background:linear-gradient(145deg,#1c2c55,#344a80);
}
.avatar-premium .avatar-face{
  top:10px;
  width:98px;
  height:103px;
  border-radius:38px 38px 44px 44px;
  background:linear-gradient(160deg,#fbfcff,#e8eefb);
  box-shadow:0 16px 34px rgba(42,60,119,.12);
}
.avatar-brow{
  position:absolute;top:33px;width:17px;height:2px;border-radius:2px;background:#51639b
}
.avatar-brow.left{left:19px;transform:rotate(-5deg)}
.avatar-brow.right{right:19px;transform:rotate(5deg)}
.avatar-premium .avatar-eye{top:43px;width:9px;height:11px;background:#344ea9}
.avatar-premium .avatar-nose{
  position:absolute;top:54px;left:50%;width:2px;height:15px;
  background:#b8c4e1;border-radius:2px
}
.avatar-premium .avatar-mouth{
  bottom:18px;width:29px;height:10px;border-bottom:3px solid #5870c6
}
.avatar-neck{
  position:absolute;top:105px;left:50%;transform:translateX(-50%);
  width:30px;height:25px;background:#e9eef9;border-radius:0 0 10px 10px
}
.avatar-premium .avatar-body{
  width:132px;height:105px;border-radius:44px 44px 20px 20px;
  background:linear-gradient(150deg,#243b9c,#526fe3);
}
.avatar-collar{
  position:absolute;top:0;left:50%;transform:translateX(-50%);
  width:52px;height:20px;border-radius:0 0 22px 22px;background:#eef2ff
}
.avatar-status-pill{
  position:absolute;right:10px;bottom:20px;
  display:flex;align-items:center;gap:5px;
  padding:5px 8px;border-radius:99px;
  background:#fff;border:1px solid #dfe6ef;
  font-size:8px;font-weight:800;color:#44516c;
  box-shadow:0 6px 18px rgba(25,41,76,.08)
}
.avatar-status-pill i{
  width:7px;height:7px;border-radius:50%;background:#3fba88;
  box-shadow:0 0 0 4px rgba(63,186,136,.11)
}

/* voice first: less "button wall", more premium interaction */
.voice-intent-title{
  text-align:center;
  font-size:12px;
  font-weight:900;
  color:#263a75;
  margin:4px 0 10px;
}
.voice-orb-btn{
  width:164px;
  height:164px;
  box-shadow:0 24px 50px rgba(55,77,178,.24);
  background:linear-gradient(155deg,#344ec5,#627cf0);
}
.voice-orb-icon{font-size:31px}
.voice-orb-btn strong{font-size:14px}
.voice-orb-btn small{font-size:8px}
.voice-live-caption{
  margin-top:12px;
  min-height:32px;
  max-width:290px;
  padding:8px 11px;
  border-radius:10px;
  background:#fff;
  border:1px solid #dfe5ef;
  font-size:9px;
  color:#4d5b75;
  text-align:center;
  line-height:1.5;
}

.coach-actions-pro{
  grid-template-columns:repeat(3,1fr);
  gap:6px;
}
.coach-actions-pro .coach-action{
  background:rgba(255,255,255,.9);
  border-color:#dbe2ef;
  min-height:39px;
  font-size:9px;
}
.voice-actions-pro{
  grid-template-columns:repeat(3,1fr);
  gap:6px;
}
.voice-actions-pro .voice-btn{
  border:0;
  min-height:34px;
  background:transparent;
  color:#59677e;
  font-size:8px;
}
.transcript-toggle{
  margin-top:5px;
  color:#6d7890;
  font-weight:700;
}

.coach-screen-summary{
  font-size:11px;
  line-height:1.7;
  padding:12px 13px;
}
.coach-next-question{
  cursor:pointer;
  position:relative;
  padding-inline-end:30px;
}
.coach-next-question:after{
  content:"›";
  position:absolute;
  inset-inline-end:12px;
  top:50%;
  transform:translateY(-50%);
  font-size:18px;
}

/* audio controls */
.scene-audio-strip{
  margin-top:16px;
  justify-content:flex-start;
}
.scene-audio-primary{
  display:inline-flex;
  align-items:center;
  gap:6px;
  padding:9px 13px;
  border-radius:10px;
}
.scene-audio-strip>span{display:none}

/* responsive */
@media(max-width:1100px){
  .lesson-stage-pro{grid-template-columns:1fr}
  .voice-first-panel{
    border-inline-start:0;
    border-top:1px solid #dfe5ef;
  }
  .avatar-stage{height:215px}
}
@media(max-width:700px){
  .lesson-scene-area{padding:14px}
  .scene-card{padding:22px 18px;min-height:340px}
  .scene-card h3{font-size:24px}
  .scene-body{font-size:15px;line-height:1.85}
  .voice-first-panel{padding:16px}
  .voice-orb-btn{width:145px;height:145px}
  .coach-actions-pro{grid-template-columns:1fr 1fr 1fr}
}

/* =========================================================
   KAVENA V4.0 — Focus Learning Experience
   One learning focus at a time. Voice-first. Responsive.
   ========================================================= */
:root{
  --kv4-ink:#0f1b35;--kv4-muted:#70809f;--kv4-line:#e5eaf4;
  --kv4-blue:#4564e8;--kv4-blue2:#6f7cff;--kv4-soft:#f6f8fc;
}
.immersive-lesson-shell{background:transparent!important;border:0!important;box-shadow:none!important;padding:0!important;margin-top:18px!important}
.lesson-player-top{display:flex!important;align-items:flex-end!important;justify-content:space-between!important;background:linear-gradient(125deg,#152750,#4564e8)!important;color:#fff!important;border-radius:26px!important;padding:26px 30px!important;margin-bottom:18px!important}
.lesson-player-top h2{font-size:clamp(24px,2.1vw,36px)!important;line-height:1.25!important;margin:5px 0!important;color:#fff!important}.lesson-player-top p,.lesson-player-top span{color:#dce4ff!important}.player-step{background:#ffffff18!important;border:1px solid #ffffff2b!important;padding:10px 14px!important;border-radius:999px!important;white-space:nowrap}
.lesson-stage-pro{display:grid!important;grid-template-columns:minmax(0,1fr) 360px!important;gap:18px!important;align-items:stretch!important}
.lesson-scene-area{background:#fff!important;border:1px solid var(--kv4-line)!important;border-radius:28px!important;box-shadow:0 18px 50px rgba(21,39,80,.07)!important;padding:clamp(22px,3vw,44px)!important;min-height:610px!important;display:flex!important;flex-direction:column!important}
.scene-card{border:0!important;background:transparent!important;box-shadow:none!important;padding:0!important;min-height:0!important;flex:1!important;display:flex!important;flex-direction:column!important;justify-content:center!important;max-width:900px!important;margin:auto!important;width:100%!important}
.scene-type{display:inline-flex!important;width:max-content!important;background:#eef2ff!important;color:var(--kv4-blue)!important;padding:7px 12px!important;border-radius:999px!important;font-size:12px!important;font-weight:800!important;letter-spacing:.02em!important}
.scene-card h3{font-size:clamp(27px,3vw,46px)!important;line-height:1.25!important;color:var(--kv4-ink)!important;margin:18px 0 14px!important}.scene-body{font-size:clamp(17px,1.35vw,21px)!important;line-height:1.9!important;color:#34425f!important;max-width:820px!important;white-space:pre-line!important}
.scene-audio-strip{border:0!important;background:var(--kv4-soft)!important;border-radius:18px!important;padding:10px 12px!important;display:flex!important;align-items:center!important;justify-content:space-between!important}.scene-audio-primary{border:0!important;background:#fff!important;color:var(--kv4-blue)!important;border-radius:14px!important;padding:11px 16px!important;font-weight:800!important;cursor:pointer!important}.scene-audio-strip span{font-size:12px!important;color:var(--kv4-muted)!important}
.scene-controls{margin-top:18px!important;display:grid!important;grid-template-columns:110px 1fr 110px!important;align-items:center!important;gap:12px!important}.scene-dots{justify-self:center!important}.scene-dot{width:8px!important;height:8px!important;border-radius:99px!important}.scene-dot.active{width:26px!important}
.interactive-avatar-panel.voice-first-panel{position:relative!important;overflow:hidden!important;border:1px solid var(--kv4-line)!important;border-radius:28px!important;background:linear-gradient(180deg,#f4f7ff 0%,#fff 54%)!important;box-shadow:0 18px 50px rgba(21,39,80,.07)!important;padding:18px!important;display:flex!important;flex-direction:column!important;min-width:0!important}
.voice-mode-header{display:flex!important;justify-content:space-between!important;gap:10px!important;align-items:flex-start!important}.voice-mode-header>div small{display:none!important}.voice-mode-header>div span{font-size:11px!important;color:var(--kv4-muted)!important}.voice-mode-header>div b{display:block!important;font-size:15px!important;color:var(--kv4-ink)!important}.voice-toggle{font-size:10px!important}
.avatar-stage{height:245px!important;min-height:245px!important;margin:8px -18px 0!important;border-radius:0!important;background:linear-gradient(180deg,#edf2ff,#f9fbff)!important;overflow:hidden!important;position:relative!important}.avatar-halo{display:none!important}
.avatar-character.avatar-premium.avatar-visual-v4{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;transform:none!important;background-image:url('kavena-tutor-v4.png')!important;background-repeat:no-repeat!important;background-size:1160px auto!important;background-position:82% 37%!important;filter:saturate(.96) contrast(1.02)!important;border:0!important;border-radius:0!important}
.avatar-status-pill{position:absolute!important;top:14px!important;inset-inline-start:16px!important;background:#ffffffea!important;backdrop-filter:blur(10px)!important;border:1px solid #fff!important;box-shadow:0 8px 20px #1d32661a!important}
.avatar-copy{text-align:center!important;padding:12px 8px 4px!important}.avatar-copy span{font-size:10px!important;color:var(--kv4-muted)!important}.avatar-copy h3{font-size:22px!important;margin:2px 0!important;color:var(--kv4-ink)!important}.avatar-copy p{font-size:12px!important;line-height:1.6!important;min-height:38px!important;max-height:42px!important;overflow:hidden!important;color:#566681!important}
.voice-primary-wrap{display:flex!important;flex-direction:column!important;align-items:center!important;margin-top:4px!important}.voice-intent-title{display:none!important}.voice-orb-btn{width:112px!important;height:112px!important;min-width:112px!important;border-radius:50%!important;background:linear-gradient(145deg,var(--kv4-blue2),#3657df)!important;border:8px solid #edf0ff!important;box-shadow:0 0 0 1px #cfd7ff,0 14px 30px rgba(69,100,232,.25)!important;color:#fff!important}.voice-orb-icon{font-size:27px!important}.voice-orb-btn strong{font-size:12px!important}.voice-orb-btn small{display:none!important}.voice-live-caption{margin-top:10px!important;background:#fff!important;border:1px solid var(--kv4-line)!important;border-radius:12px!important;padding:8px 10px!important;font-size:12px!important;width:100%!important;text-align:center!important}
.coach-actions-pro{display:grid!important;grid-template-columns:repeat(3,1fr)!important;gap:7px!important;margin-top:14px!important}.coach-action{min-height:42px!important;padding:8px!important;border-radius:12px!important;background:#fff!important;border:1px solid var(--kv4-line)!important;font-size:11px!important;color:#273756!important;font-weight:750!important}.voice-actions-pro{display:none!important}.transcript-toggle{margin-top:8px!important;border:0!important;background:transparent!important;color:var(--kv4-muted)!important;font-size:10px!important}.voice-transcript{font-size:11px!important;max-height:120px!important;overflow:auto!important}.coach-response-voice{margin-top:8px!important;background:#fff!important;border:1px solid var(--kv4-line)!important;border-radius:14px!important;padding:10px!important;font-size:11px!important;line-height:1.55!important;max-height:135px!important;overflow:auto!important}
.voice-first-panel[data-voice-state="listening"] .voice-orb-btn{animation:kv4Pulse 1.15s infinite!important}.voice-first-panel[data-voice-state="processing"] .voice-orb-btn{opacity:.78!important}.voice-first-panel[data-voice-state="speaking"] .avatar-stage:after{content:'KAVENA';position:absolute;inset-inline-end:14px;bottom:12px;background:#4564e8e8;color:#fff;padding:6px 10px;border-radius:999px;font-size:10px;font-weight:800}
@keyframes kv4Pulse{50%{box-shadow:0 0 0 12px rgba(69,100,232,.10),0 14px 30px rgba(69,100,232,.28)}}
.v4-support-content{margin-top:20px!important}.v4-support-content .lesson-stage{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:14px!important}.v4-support-content .lesson-block{margin:0!important;border-radius:20px!important}.v4-support-content .lesson-section{display:none!important}.v4-support-content .lesson-complete,.v4-support-content .next-lesson-link{grid-column:1/-1!important}.legacy-teacher-hidden{display:none!important}
@media(max-width:1100px){.lesson-stage-pro{grid-template-columns:1fr!important}.interactive-avatar-panel.voice-first-panel{display:grid!important;grid-template-columns:210px 1fr!important;grid-template-areas:'avatar head' 'avatar copy' 'avatar voice' 'actions actions'!important;column-gap:18px!important}.voice-mode-header{grid-area:head!important}.avatar-stage{grid-area:avatar!important;margin:-18px 0 -18px -18px!important;height:auto!important;min-height:360px!important}.avatar-copy{grid-area:copy!important;text-align:start!important}.voice-primary-wrap{grid-area:voice!important}.coach-actions-pro{grid-area:actions!important}.avatar-character.avatar-premium.avatar-visual-v4{background-size:1320px auto!important;background-position:83% 38%!important}.transcript-toggle,.voice-transcript,.coach-response-voice{grid-column:1/-1!important}}
@media(max-width:720px){.lesson-player-top{padding:20px!important;border-radius:20px!important;align-items:flex-start!important}.lesson-player-top p{display:none!important}.player-step{font-size:10px!important}.lesson-stage-pro{display:block!important}.lesson-scene-area{min-height:480px!important;border-radius:20px!important;padding:20px!important}.scene-card h3{font-size:clamp(24px,8vw,34px)!important}.scene-body{font-size:17px!important;line-height:1.8!important}.scene-controls{grid-template-columns:90px 1fr 90px!important}.interactive-avatar-panel.voice-first-panel{margin-top:14px!important;display:flex!important;border-radius:20px!important}.avatar-stage{height:230px!important;min-height:230px!important;margin:8px -18px 0!important}.avatar-character.avatar-premium.avatar-visual-v4{background-size:1080px auto!important;background-position:82% 37%!important}.coach-actions-pro{grid-template-columns:1fr 1fr 1fr!important}.v4-support-content .lesson-stage{grid-template-columns:1fr!important}}


/* =========================================================
   KAVENA V4.1 — Global Identity + Tutor Choice
   ========================================================= */
:root{--kavena-navy:#0d1a34;--kavena-blue:#3564f5;--kavena-line:#e2e8f3;--kavena-text:#14213d;--kavena-muted:#72809c}
.sidebar{background:radial-gradient(circle at 40% 12%,rgba(72,101,213,.16),transparent 28%),linear-gradient(180deg,var(--kavena-navy),#0b172d)!important;border:0!important}
.brand{padding:16px 14px!important}.brand-mark{background:linear-gradient(145deg,#6380ff,#3156df)!important;color:#fff!important;box-shadow:0 10px 24px rgba(43,75,200,.30)!important}.brand>span:last-child{font-weight:900!important}.brand small{font-size:8px!important;opacity:.68!important;margin-top:2px!important}
.role-badge{background:rgba(255,255,255,.035)!important;border-color:rgba(255,255,255,.10)!important}
.sidebar nav a{border-radius:12px!important;margin:3px 7px!important;padding:10px 11px!important;color:#c5d0e4!important}
.sidebar nav a:hover{background:rgba(255,255,255,.055)!important;color:#fff!important}
.sidebar nav a.active{background:linear-gradient(90deg,rgba(65,96,218,.34),rgba(58,84,180,.16))!important;color:#fff!important;box-shadow:inset 3px 0 0 #6f87ff!important}
html[dir="rtl"] .sidebar nav a.active{box-shadow:inset -3px 0 0 #6f87ff!important}.sidebar nav a.active .nav-ico{background:#526de8!important;color:#fff!important}
.sidebar-tutor-card{width:100%;display:grid;grid-template-columns:44px minmax(0,1fr) auto;gap:9px;align-items:center;text-align:start;padding:8px;margin-bottom:10px;border-radius:13px;border:1px solid rgba(255,255,255,.10);background:rgba(255,255,255,.045);color:#fff;cursor:pointer}
.sidebar-tutor-card:hover{background:rgba(255,255,255,.075)}.sidebar-tutor-card img{width:44px;height:52px;object-fit:cover;border-radius:10px;border:1px solid rgba(255,255,255,.16)}.sidebar-tutor-card span{display:flex;flex-direction:column;min-width:0}.sidebar-tutor-card small{font-size:7px;color:#8ea1c5}.sidebar-tutor-card b{font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.sidebar-tutor-card i{font-style:normal;color:#8194bd;font-size:12px}
.tutor-picker-open{overflow:hidden}.tutor-picker-overlay{position:fixed;inset:0;z-index:10050;display:grid;place-items:center;padding:20px;background:rgba(8,17,36,.64);backdrop-filter:blur(9px)}.tutor-picker-overlay[hidden]{display:none!important}
.tutor-picker-dialog{position:relative;width:min(820px,96vw);max-height:92vh;overflow:auto;border-radius:28px;padding:28px;background:radial-gradient(circle at 15% 0%,rgba(81,111,237,.10),transparent 32%),#fff;box-shadow:0 36px 100px rgba(4,16,44,.28);border:1px solid #dfe6f3}
.tutor-picker-close{position:absolute;top:15px;inset-inline-end:15px;width:34px;height:34px;border-radius:50%;border:1px solid var(--kavena-line);background:#fff;color:#60708e;font-size:20px;cursor:pointer}.tutor-picker-overlay.is-required .tutor-picker-close{display:none}
.tutor-picker-head{text-align:center;max-width:600px;margin:0 auto 22px}.tutor-picker-head>span{font-size:9px;font-weight:900;color:var(--kavena-blue);letter-spacing:.08em}.tutor-picker-head h2{font-size:clamp(24px,3vw,34px);color:var(--kavena-text);margin:5px 0 7px}.tutor-picker-head p{font-size:12px;line-height:1.7;color:var(--kavena-muted);margin:0}
.tutor-choice-grid{display:grid;grid-template-columns:1fr 1fr;gap:16px}.tutor-choice-card{position:relative;min-width:0;border:2px solid var(--kavena-line);border-radius:22px;padding:10px 10px 15px;background:#f8faff;cursor:pointer;text-align:center;transition:.18s ease}.tutor-choice-card:hover{transform:translateY(-2px);border-color:#bdc9f3}.tutor-choice-card.selected{border-color:#4768ec;background:#f3f6ff;box-shadow:0 12px 28px rgba(61,91,211,.12)}
.tutor-choice-card img{width:100%;height:330px;object-fit:cover;object-position:center top;border-radius:16px;background:#eef3ff}.tutor-choice-card strong{display:block;font-size:16px;color:var(--kavena-text);margin:12px 0 4px}.tutor-choice-card small{display:block;font-size:10px;line-height:1.5;color:var(--kavena-muted);min-height:31px}
.tutor-choice-check{position:absolute;top:19px;inset-inline-end:19px;width:29px;height:29px;border-radius:50%;display:grid;place-items:center;background:#fff;color:#a2abc0;border:1px solid #d9e0ed;font-size:12px;font-weight:900}.tutor-choice-card.selected .tutor-choice-check{background:#4162e7;color:#fff;border-color:#4162e7}
.tutor-picker-confirm{width:100%;margin-top:18px;border:0;border-radius:14px;padding:13px 18px;background:linear-gradient(90deg,#3459e5,#4f70f1);color:#fff;font-weight:900;font-size:13px;cursor:pointer;box-shadow:0 12px 26px rgba(53,89,229,.20)}.tutor-picker-confirm:disabled{opacity:.42;cursor:not-allowed;box-shadow:none}
.avatar-stage{overflow:hidden!important;border-radius:22px!important;background:linear-gradient(180deg,#eef4ff,#f8fbff)!important}.avatar-portrait-v41{position:absolute;inset:0;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center top!important;border:0!important;border-radius:0!important;filter:saturate(.98) contrast(1.01)!important}.avatar-halo{display:none!important}
.sidebar-profile-zone{margin-top:18px!important;padding-top:13px!important;border-top:1px solid rgba(255,255,255,.08)!important}.mini-user{margin-bottom:8px!important}.language-switch{margin-bottom:7px!important}.lesson-language-note{display:none!important}
@media(max-width:720px){.tutor-picker-dialog{padding:20px 14px;border-radius:22px}.tutor-choice-grid{grid-template-columns:1fr 1fr;gap:9px}.tutor-choice-card{padding:7px 7px 11px;border-radius:16px}.tutor-choice-card img{height:230px;border-radius:12px}.tutor-choice-card strong{font-size:13px}.tutor-choice-card small{font-size:8px}}
@media(max-width:460px){.tutor-choice-grid{grid-template-columns:1fr}.tutor-choice-card img{height:300px}}

/* =========================================================
   KAVENA V4.2 — Global Design System & Responsive Navigation
   Applies to Student / Parent / Admin through app/layout.php
   ========================================================= */
:root{
  --kv-bg:#f4f7fc;
  --kv-surface:#ffffff;
  --kv-surface-soft:#f8faff;
  --kv-navy:#0d1b36;
  --kv-navy-2:#132746;
  --kv-blue:#3564f5;
  --kv-blue-2:#5277ff;
  --kv-blue-soft:#eef3ff;
  --kv-text:#14213d;
  --kv-muted:#72809a;
  --kv-line:#dfe6f2;
  --kv-success:#31b77c;
  --kv-warning:#e7a23a;
  --kv-danger:#e85d6a;
  --kv-shadow:0 18px 50px rgba(20,38,77,.075);
  --kv-sidebar:252px;
  --kv-rail:86px;
  --kv-radius:22px;
}
*{box-sizing:border-box}
html,body{margin:0;min-height:100%;background:var(--kv-bg);color:var(--kv-text)}
body{font-family:Inter,"Noto Sans Arabic",Tahoma,Arial,sans-serif!important;overflow-x:hidden}
.app-shell{display:flex!important;direction:ltr!important;min-height:100dvh;background:var(--kv-bg)!important}
.main{min-width:0!important;flex:1!important;direction:ltr!important;padding:0!important;margin:0!important;background:var(--kv-bg)!important}
.dir-rtl .main{direction:rtl!important}.dir-ltr .main{direction:ltr!important}
.page-content{padding:24px 28px 42px!important;max-width:1760px!important;margin:0 auto!important;width:100%!important}

/* ---------- Sidebar ---------- */
.sidebar{
  position:sticky!important;top:0!important;left:0!important;right:auto!important;
  width:var(--kv-sidebar)!important;min-width:var(--kv-sidebar)!important;height:100dvh!important;
  display:flex!important;flex-direction:column!important;z-index:900!important;padding:14px 12px!important;
  background:radial-gradient(circle at 30% 0%,rgba(74,103,228,.19),transparent 27%),linear-gradient(180deg,#0d1b36,#0a162c)!important;
  color:#fff!important;border:0!important;box-shadow:18px 0 55px rgba(10,24,52,.08)!important;
  direction:ltr!important;overflow:hidden!important;
}
.dir-rtl .sidebar{direction:rtl!important}
.sidebar-top{display:flex;align-items:center;justify-content:space-between;gap:8px}
.brand{display:flex!important;align-items:center!important;gap:11px!important;padding:7px 6px 16px!important;text-decoration:none!important;color:#fff!important}
.brand-mark{width:43px!important;height:43px!important;min-width:43px!important;border-radius:13px!important;display:grid!important;place-items:center!important;background:linear-gradient(145deg,#6b84ff,#3157e2)!important;color:#fff!important;font-weight:950!important;font-size:24px!important;box-shadow:0 13px 30px rgba(50,82,210,.30)!important}
.brand-copy{display:flex;flex-direction:column;min-width:0;line-height:1.05}.brand-copy b{font-size:19px;letter-spacing:.04em;font-weight:950}.brand-copy small{margin-top:5px;font-size:8px;color:#8fa0c2;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-close{display:none;width:34px;height:34px;border-radius:10px;border:1px solid rgba(255,255,255,.1);background:rgba(255,255,255,.05);color:#fff;font-size:22px;cursor:pointer}
.role-badge{margin:0 2px 13px!important;padding:8px 10px!important;border:1px solid rgba(255,255,255,.10)!important;border-radius:11px!important;background:rgba(255,255,255,.035)!important;color:#aebbd4!important;font-size:9px!important;font-weight:750!important;text-align:start!important}
.primary-nav{display:flex!important;flex-direction:column!important;gap:4px!important;min-height:0!important;overflow:auto!important;padding:2px 0 8px!important;scrollbar-width:none}.primary-nav::-webkit-scrollbar{display:none}
.sidebar nav a{display:flex!important;align-items:center!important;gap:11px!important;min-height:46px!important;padding:9px 11px!important;margin:0!important;border-radius:13px!important;color:#bdc9de!important;text-decoration:none!important;font-size:12px!important;font-weight:720!important;transition:.18s ease!important;position:relative!important}
.sidebar nav a:hover{background:rgba(255,255,255,.055)!important;color:#fff!important;transform:translateX(1px)}
.sidebar nav a.active{background:linear-gradient(90deg,rgba(62,94,220,.44),rgba(46,71,166,.20))!important;color:#fff!important;box-shadow:inset 3px 0 0 #6e88ff,0 8px 24px rgba(7,18,43,.12)!important}
.dir-rtl .sidebar nav a.active{box-shadow:inset -3px 0 0 #6e88ff,0 8px 24px rgba(7,18,43,.12)!important}
.nav-ico{width:31px!important;height:31px!important;min-width:31px!important;border-radius:9px!important;display:grid!important;place-items:center!important;background:rgba(255,255,255,.055)!important;color:#aebbd5!important}
.nav-ico svg{width:17px;height:17px;fill:none;stroke:currentColor;stroke-width:1.75;stroke-linecap:round;stroke-linejoin:round}.nav-ico svg path[fill],.nav-ico svg circle[fill]{fill:currentColor}
.sidebar nav a.active .nav-ico{background:#4d69e2!important;color:#fff!important;box-shadow:0 8px 16px rgba(63,90,211,.24)!important}.nav-label{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.sidebar-profile-zone{margin-top:auto!important;padding:12px 2px 0!important;border-top:1px solid rgba(255,255,255,.08)!important}
.sidebar-tutor-card{width:100%!important;display:grid!important;grid-template-columns:42px minmax(0,1fr) auto!important;gap:9px!important;align-items:center!important;padding:7px!important;margin:0 0 8px!important;border-radius:12px!important;border:1px solid rgba(255,255,255,.09)!important;background:rgba(255,255,255,.04)!important;color:#fff!important;text-align:start!important;cursor:pointer!important}.sidebar-tutor-card:hover{background:rgba(255,255,255,.07)!important}.sidebar-tutor-card img{width:42px!important;height:46px!important;object-fit:cover!important;object-position:center 10%!important;border-radius:9px!important}.sidebar-tutor-card small{font-size:7px!important;color:#8799ba!important}.sidebar-tutor-card b{font-size:10px!important}.sidebar-tutor-card i{font-size:16px!important;color:#6f82a8!important}
.mini-user{display:flex!important;align-items:center!important;gap:8px!important;padding:6px 4px!important;margin:0 0 6px!important}.mini-user .avatar{width:34px!important;height:34px!important;min-width:34px!important;display:grid!important;place-items:center!important;border-radius:50%!important;background:linear-gradient(145deg,#4968ea,#3154d7)!important;color:#fff!important;font-size:10px!important;font-weight:900!important}.mini-user-copy{min-width:0;display:flex;flex-direction:column;text-align:start}.mini-user-copy b{font-size:9px!important;color:#fff!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.mini-user-copy small{font-size:7px!important;color:#7f91b3!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.language-switch{display:grid!important;grid-template-columns:1fr 1fr!important;gap:4px!important;padding:4px!important;margin:0 0 6px!important;border-radius:10px!important;background:rgba(255,255,255,.045)!important;border:1px solid rgba(255,255,255,.08)!important}.locale-btn{height:28px!important;border:0!important;border-radius:7px!important;background:transparent!important;color:#8294b8!important;font-size:8px!important;font-weight:900!important;cursor:pointer!important}.locale-btn.active{background:#fff!important;color:#3359da!important;box-shadow:0 5px 12px rgba(0,0,0,.12)!important}
.logout{display:flex!important;align-items:center!important;gap:8px!important;padding:8px 7px!important;color:#ff8390!important;text-decoration:none!important;font-size:9px!important;font-weight:800!important}.logout-ico{font-size:15px}
.sidebar-backdrop{display:none;position:fixed;inset:0;z-index:880;background:rgba(5,15,34,.56);backdrop-filter:blur(3px)}

/* ---------- Topbar ---------- */
.topbar{position:sticky!important;top:0!important;z-index:700!important;height:76px!important;display:flex!important;align-items:center!important;gap:14px!important;padding:0 28px!important;background:rgba(244,247,252,.86)!important;backdrop-filter:blur(16px)!important;border-bottom:1px solid rgba(215,224,239,.72)!important}
.menu-toggle{display:none;width:40px;height:40px;min-width:40px;border-radius:12px;border:1px solid var(--kv-line);background:#fff;place-items:center;padding:10px;cursor:pointer}.menu-toggle span{display:block;width:18px;height:2px;border-radius:3px;background:#41516f;margin:2px 0}
.topbar-title{min-width:0;flex:1;text-align:start}.topbar-title h1{margin:0!important;font-size:18px!important;line-height:1.2!important;color:var(--kv-text)!important;font-weight:900!important}.topbar-title p{margin:4px 0 0!important;font-size:9px!important;color:var(--kv-muted)!important}
.topbar-actions{display:flex;align-items:center;gap:8px}.topbar-icon{width:36px;height:36px;border:1px solid var(--kv-line);border-radius:11px;background:#fff;color:#5570d7;font-size:8px;cursor:pointer}.topbar-user{display:flex;align-items:center;gap:8px;padding:5px 9px 5px 5px;border:1px solid var(--kv-line);border-radius:12px;background:#fff;min-width:145px;box-shadow:0 6px 20px rgba(32,50,87,.04)}.dir-rtl .topbar-user{padding:5px 5px 5px 9px}.topbar-user>span{width:32px;height:32px;display:grid;place-items:center;border-radius:10px;background:linear-gradient(145deg,#4868eb,#3157db);color:#fff;font-size:10px;font-weight:900}.topbar-user>div{display:flex;flex-direction:column;text-align:start;min-width:0}.topbar-user b{font-size:9px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.topbar-user small{font-size:7px;color:var(--kv-muted)}

/* ---------- Global content language / cards ---------- */
.card,.lesson-block,.integrity-source-card,.repair-card,.repair-result{border:1px solid var(--kv-line)!important;background:var(--kv-surface)!important;border-radius:var(--kv-radius)!important;box-shadow:0 10px 34px rgba(31,48,84,.045)!important}
.alert{border-radius:14px!important;border:1px solid transparent!important;padding:11px 14px!important;font-size:10px!important}.alert.success{background:#eaf8f2!important;color:#177354!important;border-color:#d4efe4!important}.alert.error,.alert.danger{background:#fff0f2!important;color:#af3d50!important;border-color:#f4d7dc!important}
.btn,.student-primary-btn{border-radius:12px!important;min-height:40px!important;padding:9px 15px!important;font-weight:850!important}.btn.primary,.student-primary-btn{background:linear-gradient(90deg,var(--kv-blue),var(--kv-blue-2))!important;color:#fff!important;border:0!important;box-shadow:0 9px 20px rgba(53,100,245,.18)!important}.btn.ghost{background:#fff!important;border:1px solid var(--kv-line)!important;color:#41516e!important}
input,select,textarea{border-radius:11px!important;border:1px solid #dbe3ef!important;background:#fff!important;min-height:42px!important;color:var(--kv-text)!important;box-shadow:none!important}input:focus,select:focus,textarea:focus{outline:0!important;border-color:#8ba1f5!important;box-shadow:0 0 0 3px rgba(53,100,245,.08)!important}
table{width:100%!important;border-collapse:separate!important;border-spacing:0!important;background:#fff!important;border:1px solid var(--kv-line)!important;border-radius:17px!important;overflow:hidden!important}th{background:#f8faff!important;color:#64718a!important;font-size:9px!important;font-weight:850!important}th,td{padding:11px 12px!important;border-bottom:1px solid #e8edf5!important}tbody tr:last-child td{border-bottom:0!important}tbody tr:hover td{background:#fbfcff!important}

/* ---------- Lesson: reference-design rebuild ---------- */
.lesson-breadcrumb{display:flex!important;align-items:center!important;gap:7px!important;margin:0 0 14px!important;font-size:9px!important;color:#71809a!important}.lesson-breadcrumb a{color:#526bd1!important;text-decoration:none!important;font-weight:800!important}
.classroom-head{display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;align-items:center!important;gap:18px!important;padding:20px 22px!important;margin-bottom:12px!important;border-radius:22px!important;background:linear-gradient(115deg,#fff,#f7f9ff)!important;border:1px solid var(--kv-line)!important;box-shadow:var(--kv-shadow)!important}.classroom-head h2{margin:4px 0 5px!important;font-size:clamp(25px,2.2vw,38px)!important;line-height:1.2!important;color:var(--kv-text)!important}.classroom-head p{margin:0!important;font-size:11px!important;color:var(--kv-muted)!important}.student-eyebrow{display:inline-flex;padding:5px 8px;border-radius:999px;background:#edf2ff;color:#4a65d5;font-size:8px;font-weight:900}.classroom-metrics{display:flex!important;gap:8px!important}.classroom-progress,.classroom-mastery{min-width:96px!important;padding:10px 12px!important;border:1px solid var(--kv-line)!important;border-radius:13px!important;background:#fff!important;text-align:center!important}.classroom-metrics small{display:block!important;font-size:7px!important;color:var(--kv-muted)!important}.classroom-metrics strong{font-size:18px!important;color:#3359d9!important}
.lesson-source-banner{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;padding:10px 14px!important;margin-bottom:14px!important;border:1px solid #dfe7f3!important;border-radius:15px!important;background:#f9fbff!important}.lesson-source-banner>div:first-child{display:flex;flex-direction:column!important}.lesson-source-banner span{font-size:7px!important;color:#78859d!important}.lesson-source-banner b{font-size:9px!important}.lesson-source-meta{display:flex!important;gap:5px!important;flex-wrap:wrap!important}.lesson-source-meta span{padding:5px 7px!important;border-radius:999px!important;background:#edf7f2!important;color:#2d7f62!important;font-weight:800!important}
.immersive-lesson-shell{overflow:visible!important;border:0!important;background:transparent!important;box-shadow:none!important;margin:0!important}.lesson-player-top{display:none!important}
.lesson-stage-pro{display:grid!important;grid-template-columns:minmax(0,1.65fr) minmax(280px,.62fr)!important;gap:16px!important;min-height:0!important;background:transparent!important}
.lesson-scene-area{min-width:0!important;padding:0!important;background:transparent!important;display:flex!important;flex-direction:column!important}
.scene-card{position:relative!important;min-height:460px!important;padding:34px 38px!important;border-radius:24px!important;background:#fff!important;border:1px solid var(--kv-line)!important;box-shadow:var(--kv-shadow)!important;justify-content:flex-start!important;overflow:hidden!important}.scene-card:before{content:'';position:absolute;inset-inline-start:0;top:0;width:5px;height:100%;background:linear-gradient(180deg,#5277ff,#9bb0ff)}.scene-type{display:none!important}.scene-card h3{margin:0 0 18px!important;font-size:clamp(28px,2.6vw,42px)!important;line-height:1.25!important;color:var(--kv-text)!important;max-width:980px!important}.scene-body{white-space:pre-line!important;font-size:clamp(16px,1.2vw,20px)!important;line-height:2!important;color:#33415d!important;max-width:980px!important}
.scene-audio-strip{display:flex!important;align-items:center!important;justify-content:flex-start!important;gap:10px!important;margin-top:10px!important}.scene-audio-primary{border:1px solid #dce4f1!important;border-radius:12px!important;background:#fff!important;color:#4965d7!important;padding:9px 13px!important;font-size:9px!important;font-weight:850!important;cursor:pointer!important}.scene-audio-strip>span{display:none!important}
.scene-controls{display:grid!important;grid-template-columns:110px 1fr 110px!important;align-items:center!important;gap:12px!important;margin-top:12px!important}.scene-controls .btn{min-height:42px!important}.scene-dots{display:flex!important;justify-content:center!important;align-items:center!important;gap:6px!important}.scene-dot{width:8px!important;height:8px!important;border:0!important;border-radius:50%!important;background:#dce3f0!important;padding:0!important}.scene-dot.active{width:26px!important;border-radius:999px!important;background:#4865df!important}
.interactive-avatar-panel.voice-first-panel{position:relative!important;min-width:0!important;padding:0!important;border:1px solid var(--kv-line)!important;border-radius:24px!important;background:linear-gradient(180deg,#f6f9ff,#eef3fb)!important;overflow:hidden!important;box-shadow:var(--kv-shadow)!important;display:flex!important;flex-direction:column!important;align-items:stretch!important;justify-content:flex-start!important}
.voice-mode-header{display:flex!important;align-items:flex-start!important;justify-content:space-between!important;gap:8px!important;padding:16px 16px 8px!important;border:0!important}.voice-mode-header>div{display:flex!important;flex-direction:column!important;gap:2px!important;text-align:start!important}.voice-mode-header span{font-size:7px!important;color:#516bd4!important;font-weight:900!important}.voice-mode-header b{font-size:12px!important}.voice-mode-header small{display:none!important}.voice-toggle{font-size:7px!important;color:#6f7c95!important;padding:4px 6px!important;border-radius:8px!important;background:#fff!important;border:1px solid var(--kv-line)!important}
.avatar-stage{position:relative!important;width:auto!important;height:270px!important;min-height:270px!important;margin:0 12px!important;border-radius:18px!important;overflow:hidden!important;background:#eaf0fb!important}.avatar-portrait-v41{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;object-fit:cover!important;object-position:center 10%!important;border-radius:0!important}.avatar-status-pill{position:absolute!important;top:10px!important;inset-inline-end:10px!important;bottom:auto!important;display:flex!important;align-items:center!important;gap:5px!important;padding:5px 8px!important;border-radius:999px!important;background:rgba(255,255,255,.88)!important;backdrop-filter:blur(8px)!important;border:1px solid rgba(222,230,243,.9)!important;color:#41506d!important;font-size:7px!important;font-weight:850!important}.avatar-status-pill i{width:7px!important;height:7px!important;border-radius:50%!important;background:#37b780!important}
.avatar-copy{padding:11px 16px 4px!important;text-align:center!important}.avatar-copy span{font-size:7px!important;color:#78849b!important}.avatar-copy h3{margin:3px 0 4px!important;font-size:17px!important}.avatar-copy p{margin:0 auto!important;max-width:250px!important;font-size:9px!important;line-height:1.55!important;color:#66738b!important;min-height:28px!important}
.voice-primary-wrap{display:grid!important;place-items:center!important;padding:8px 16px 12px!important;margin:0!important}.voice-intent-title{font-size:9px!important;color:#4159bd!important;font-weight:850!important;margin:0 0 8px!important}.voice-orb-btn{width:112px!important;height:112px!important;border-radius:50%!important;background:linear-gradient(145deg,#3157de,#5577f4)!important;border:8px solid #dde6ff!important;color:#fff!important;box-shadow:0 14px 32px rgba(53,87,220,.24)!important;display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:3px!important;cursor:pointer!important}.voice-orb-ring{display:none!important}.voice-orb-icon{font-size:25px!important}.voice-orb-btn strong{font-size:10px!important}.voice-orb-btn small{display:none!important}.voice-live-caption{width:100%!important;margin-top:8px!important;padding:7px 9px!important;border-radius:10px!important;background:#fff!important;border:1px solid var(--kv-line)!important;font-size:8px!important;text-align:center!important}
.coach-actions-pro{display:grid!important;grid-template-columns:repeat(3,minmax(0,1fr))!important;gap:6px!important;padding:0 12px 12px!important;margin:0!important}.coach-action{min-height:39px!important;border:1px solid var(--kv-line)!important;border-radius:11px!important;background:#fff!important;color:#31415f!important;font-size:8px!important;font-weight:850!important;padding:7px!important}.voice-actions-pro{display:none!important}.transcript-toggle{display:block!important;margin:0 auto 8px!important;border:0!important;background:transparent!important;color:#71809a!important;font-size:7px!important}.voice-transcript,.coach-response-voice{margin:0 12px 12px!important;border-radius:11px!important;background:#fff!important;border:1px solid var(--kv-line)!important;padding:8px!important;font-size:8px!important;max-height:120px!important;overflow:auto!important}.coach-response-voice[hidden],.voice-transcript[hidden]{display:none!important}
.voice-first-panel[data-voice-state="listening"] .voice-orb-btn{animation:kvPulse 1.1s infinite}.voice-first-panel[data-voice-state="speaking"] .avatar-status-pill{background:#eaf8f2!important;color:#267258!important}@keyframes kvPulse{50%{box-shadow:0 0 0 12px rgba(66,99,228,.10),0 14px 32px rgba(53,87,220,.28)}}
.v4-support-content{margin-top:18px!important}.v4-support-content .lesson-stage{display:grid!important;grid-template-columns:1fr 1fr!important;gap:14px!important}.v4-support-content .lesson-block{margin:0!important;padding:18px!important;border-radius:18px!important}.v4-support-content .lesson-section{display:none!important}.objectives-block ul{margin:10px 0 0!important;padding-inline-start:20px!important}.objectives-block li{margin:7px 0!important;font-size:10px!important;line-height:1.6!important}.mastery-skill{padding:8px 0!important}.mastery-skill b{font-size:9px!important}.lesson-complete,.next-lesson-link{grid-column:1/-1!important}

/* ---------- Student mobile navigation ---------- */
.student-mobile-nav{display:none!important}

/* ---------- Tablet rail ---------- */
@media (min-width:781px) and (max-width:1180px){
  :root{--kv-sidebar:var(--kv-rail)}
  .sidebar{width:var(--kv-rail)!important;min-width:var(--kv-rail)!important;padding:12px 9px!important}
  .brand{justify-content:center!important;padding:5px 0 14px!important}.brand-copy,.role-badge,.nav-label,.sidebar-tutor-card span,.sidebar-tutor-card i,.mini-user-copy,.language-switch,.logout span:last-child{display:none!important}.brand-mark{width:42px!important;height:42px!important;min-width:42px!important}
  .sidebar nav a{justify-content:center!important;padding:8px!important;min-height:49px!important}.nav-ico{width:34px!important;height:34px!important}.sidebar-profile-zone{padding-top:10px!important}.sidebar-tutor-card{display:flex!important;justify-content:center!important;padding:4px!important;border:0!important;background:transparent!important}.sidebar-tutor-card img{width:42px!important;height:48px!important}.mini-user{justify-content:center!important;padding:4px!important}.mini-user .avatar{width:38px!important;height:38px!important}.logout{justify-content:center!important}.topbar{padding:0 20px!important}.page-content{padding:20px 20px 38px!important}.lesson-stage-pro{grid-template-columns:minmax(0,1fr) 260px!important}.avatar-stage{height:235px!important;min-height:235px!important}.coach-actions-pro{grid-template-columns:1fr!important}.coach-action{min-height:34px!important}.scene-card{padding:28px!important}
}

/* ---------- Mobile / small screens ---------- */
@media(max-width:780px){
  body{padding-bottom:70px!important}.app-shell{display:block!important}.main{width:100%!important}
  .sidebar{position:fixed!important;left:0!important;top:0!important;transform:translateX(-105%)!important;width:min(310px,88vw)!important;min-width:0!important;height:100dvh!important;transition:transform .22s ease!important;box-shadow:25px 0 70px rgba(5,16,36,.28)!important;z-index:950!important}.dir-rtl .sidebar{direction:rtl!important}.nav-open .sidebar{transform:translateX(0)!important}.nav-open .sidebar-backdrop{display:block!important}.sidebar-close{display:grid!important;place-items:center!important}.brand-copy,.role-badge,.nav-label,.sidebar-tutor-card span,.sidebar-tutor-card i,.mini-user-copy,.language-switch,.logout span:last-child{display:initial!important}.primary-nav{max-height:none!important}.sidebar-profile-zone{margin-top:auto!important}
  .topbar{height:66px!important;padding:0 14px!important;gap:10px!important}.menu-toggle{display:block!important}.topbar-title h1{font-size:15px!important}.topbar-title p{display:none!important}.topbar-user{min-width:0!important;border:0!important;background:transparent!important;padding:0!important;box-shadow:none!important}.topbar-user>div{display:none!important}.topbar-icon{display:none!important}.page-content{padding:14px 12px 24px!important}
  .classroom-head{grid-template-columns:1fr!important;padding:17px!important;border-radius:18px!important}.classroom-head h2{font-size:28px!important}.classroom-metrics{justify-content:stretch!important}.classroom-progress,.classroom-mastery{flex:1!important}.lesson-source-banner{align-items:flex-start!important;flex-direction:column!important}.lesson-stage-pro{display:block!important}.scene-card{min-height:360px!important;padding:23px 19px!important;border-radius:19px!important}.scene-card h3{font-size:28px!important}.scene-body{font-size:16px!important;line-height:1.85!important}.scene-controls{grid-template-columns:90px 1fr 90px!important}.interactive-avatar-panel.voice-first-panel{margin-top:12px!important;border-radius:19px!important}.avatar-stage{height:250px!important;min-height:250px!important}.voice-mode-header{padding:13px 13px 7px!important}.voice-toggle{display:none!important}.coach-actions-pro{grid-template-columns:repeat(3,1fr)!important}.v4-support-content .lesson-stage{grid-template-columns:1fr!important}.student-mobile-nav{position:fixed!important;left:8px!important;right:8px!important;bottom:8px!important;z-index:820!important;height:58px!important;display:grid!important;grid-template-columns:repeat(4,1fr)!important;align-items:center!important;padding:5px!important;border:1px solid rgba(218,226,239,.92)!important;border-radius:18px!important;background:rgba(255,255,255,.94)!important;backdrop-filter:blur(15px)!important;box-shadow:0 14px 38px rgba(23,39,73,.16)!important}.student-mobile-nav a{display:flex!important;flex-direction:column!important;align-items:center!important;justify-content:center!important;gap:2px!important;color:#71809a!important;text-decoration:none!important;font-size:7px!important;border-radius:12px!important;height:48px!important}.student-mobile-nav a span{width:22px!important;height:22px!important;display:grid!important;place-items:center!important}.student-mobile-nav a span svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.8}.student-mobile-nav a.active{background:#eef3ff!important;color:#365ee5!important;font-weight:900!important}.student-mobile-nav small{font-size:7px!important}
  .tutor-picker-dialog{width:min(96vw,620px)!important;max-height:90vh!important;padding:18px 12px!important}.tutor-choice-card img{height:220px!important}
}
@media(max-width:460px){
  .coach-actions-pro{grid-template-columns:1fr!important}.coach-action{min-height:36px!important}.scene-controls{grid-template-columns:80px 1fr 80px!important}.classroom-head h2{font-size:25px!important}.scene-card h3{font-size:25px!important}.tutor-choice-grid{grid-template-columns:1fr!important}.tutor-choice-card img{height:280px!important}
}
