:root{
  --bg:#F4F5FC;
  --surface:#FFFFFF;
  --ink:#1B1F33;
  --ink-2:#4C5470;
  --muted:#878EAA;
  --line:#E7E9F5;
  --brand:#5B57E0;
  --brand-2:#7C74FF;
  --brand-soft:#EDECFF;
  --blue:#2E7CE4;
  --blue-soft:#E6F0FF;
  --teal:#0FA47B;
  --teal-soft:#E2F7F1;
  --rose:#C0557F;
  --rose-soft:#FDECF3;
  --ok:#0F9D6E;
  --danger:#D2453F;
  --warn:#9A5B08;
  --warn-bg:#FFF6E6;
  --r-lg:24px;
  --r-md:18px;
  --r-sm:12px;
  --shadow:0 12px 30px -24px rgba(27,31,51,.55);
}

*,*::before,*::after{box-sizing:border-box}

html{-webkit-text-size-adjust:100%}

body{
  margin:0;
  min-height:100vh;
  font-family:'IBM Plex Sans Arabic',system-ui,-apple-system,'Segoe UI',sans-serif;
  font-size:15px;
  line-height:1.65;
  color:var(--ink);
  background:
    radial-gradient(760px 420px at 92% -8%, #E9E7FF 0%, rgba(233,231,255,0) 62%),
    radial-gradient(640px 380px at -6% 2%, #E3EEFF 0%, rgba(227,238,255,0) 58%),
    var(--bg);
  overflow-x:hidden;
  -webkit-font-smoothing:antialiased;
}

body.locked{overflow:hidden}

h1,h2,h3{font-family:'Tajawal','IBM Plex Sans Arabic',sans-serif;margin:0;line-height:1.35}
p{margin:0}
button{font-family:inherit}
svg{display:block}

.hidden{display:none !important}

/* ---------- shell ---------- */
.app-shell{
  max-width:720px;
  margin:0 auto;
  padding:0 16px 108px;
  min-height:100vh;
}

.topbar{
  position:sticky;
  top:0;
  z-index:30;
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  padding:12px 0 10px;
  background:linear-gradient(to bottom, rgba(244,245,252,.97) 60%, rgba(244,245,252,0));
  backdrop-filter:blur(10px);
}
.brand{display:flex;align-items:center;gap:10px;min-width:0}
.brand-mark{
  width:40px;height:40px;border-radius:14px;flex:none;
  display:grid;place-items:center;
  color:#fff;
  background:linear-gradient(140deg,var(--brand-2),var(--brand));
  box-shadow:0 10px 20px -12px rgba(91,87,224,.9);
}
.brand-mark svg{width:22px;height:22px}
.brand-text{display:flex;flex-direction:column;min-width:0;line-height:1.25}
.brand-text strong{font-family:'Tajawal',sans-serif;font-size:16px;font-weight:800;letter-spacing:0}
.brand-text span{font-size:11.5px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.avatar-btn{
  width:42px;height:42px;border-radius:50%;flex:none;
  border:1.5px solid #D9D6FF;background:#fff;color:var(--brand);
  font-weight:700;font-size:16px;font-family:'Tajawal',sans-serif;
  display:grid;place-items:center;cursor:pointer;
  transition:transform .15s ease, box-shadow .2s;
  user-select:none;
}
.avatar-btn:active{transform:scale(.94)}

/* ---------- focus bar ---------- */
.focus-bar{
  display:flex;align-items:center;justify-content:space-between;gap:12px;
  background:linear-gradient(135deg,#6E67F0,#5B57E0);
  color:#fff;border-radius:18px;padding:10px 14px;margin:2px 0 12px;
  box-shadow:0 14px 26px -20px rgba(91,87,224,.95);
}
.focus-info{display:flex;align-items:center;gap:10px;min-width:0}
.focus-dot{width:9px;height:9px;border-radius:50%;background:#B7FFE3;flex:none;animation:pulse 1.6s infinite}
.focus-text{display:flex;flex-direction:column;line-height:1.25;min-width:0}
.focus-text strong{font-size:18px;font-variant-numeric:tabular-nums;letter-spacing:.5px}
.focus-text span{font-size:11.5px;opacity:.85;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:52vw}
.focus-bar .btn.ghost{background:rgba(255,255,255,.16);border-color:rgba(255,255,255,.35);color:#fff}
@keyframes pulse{0%,100%{opacity:1}50%{opacity:.35}}

/* ---------- views ---------- */
.view{animation:fadeIn .28s ease-out both}
@keyframes fadeIn{from{opacity:0;transform:translateY(6px)}to{opacity:1;transform:none}}

.page-title{font-size:25px;font-weight:800;letter-spacing:-.2px}
.page-sub{color:var(--ink-2);font-size:13.5px;margin:4px 0 16px}

/* ---------- hero ---------- */
.hero{
  display:flex;align-items:center;justify-content:space-between;gap:14px;
  padding:16px 18px;border-radius:var(--r-lg);
  background:linear-gradient(135deg,#FFFFFF 0%,#F7F5FF 100%);
  border:1px solid #EAE7FF;
  box-shadow:var(--shadow);
  margin-bottom:14px;
}
.hero-main{min-width:0}
.hero-kicker{font-size:12px;color:var(--brand);font-weight:600;margin-bottom:2px}
.hero-title{font-size:23px;font-weight:800;letter-spacing:-.3px}
.hero-title span{color:var(--brand)}
.hero-sub{font-size:12.5px;color:var(--ink-2);margin-top:4px}
.ring-wrap{position:relative;width:76px;height:76px;flex:none}
.ring{width:76px;height:76px;transform:rotate(-90deg)}
.ring-bg{fill:none;stroke:#EDEBFB;stroke-width:9}
.ring-fg{
  fill:none;stroke:url(#g) ;stroke:var(--brand);stroke-width:9;stroke-linecap:round;
  stroke-dasharray:213.6;stroke-dashoffset:213.6;
  transition:stroke-dashoffset .6s ease;
}
.ring-label{
  position:absolute;inset:0;display:grid;place-items:center;
  font-family:'Tajawal',sans-serif;font-weight:800;font-size:15px;color:var(--brand);
}

/* ---------- stats ---------- */
.stat-row{display:grid;grid-template-columns:repeat(3,1fr);gap:10px;margin-bottom:14px}
.stat{
  background:#fff;border:1px solid var(--line);border-radius:16px;
  padding:10px 12px;display:flex;flex-direction:column;gap:1px;box-shadow:var(--shadow);
}
.stat strong{font-family:'Tajawal',sans-serif;font-size:17px;font-weight:800;line-height:1.2}
.stat span{font-size:11px;color:var(--muted);line-height:1.3}

/* ---------- buttons ---------- */
.btn{
  display:inline-flex;align-items:center;justify-content:center;gap:8px;
  min-height:46px;padding:0 18px;
  border-radius:15px;border:1.5px solid transparent;
  font-size:15px;font-weight:600;font-family:'IBM Plex Sans Arabic',sans-serif;
  cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;
  transition:transform .12s ease, background .18s ease, box-shadow .2s ease, opacity .2s;
}
.btn svg{width:19px;height:19px}
.btn:active{transform:scale(.975)}
.btn.primary{
  background:linear-gradient(135deg,var(--brand-2),var(--brand));
  color:#fff;box-shadow:0 14px 26px -18px rgba(91,87,224,.95);
}
.btn.ghost{background:#fff;border-color:var(--line);color:var(--ink)}
.btn.ghost:hover{border-color:#D6D3F7}
.btn.small{min-height:40px;padding:0 14px;font-size:13.5px;border-radius:12px}
.btn.small svg{width:16px;height:16px}
.btn.big{width:100%;min-height:54px;font-size:16.5px;border-radius:18px;margin-bottom:16px}
.btn.danger-ghost{
  width:100%;margin-top:10px;background:transparent;border-color:#F3D5D3;color:var(--danger);
}
.btn:disabled{opacity:.55;cursor:not-allowed;box-shadow:none;transform:none}

.link-btn{
  background:none;border:none;padding:4px;color:var(--brand);
  font-size:12.5px;font-weight:600;cursor:pointer;border-radius:8px;
}
.link-btn:active{opacity:.7}

.icon-btn{
  width:36px;height:36px;border-radius:11px;border:1px solid var(--line);
  background:#fff;color:var(--ink-2);display:grid;place-items:center;cursor:pointer;
  flex:none;
}
.icon-btn svg{width:17px;height:17px}
.icon-btn:active{transform:scale(.94)}

/* ---------- cards ---------- */
.card{
  background:var(--surface);border:1px solid var(--line);border-radius:var(--r-lg);
  padding:16px;box-shadow:var(--shadow);margin-bottom:14px;
}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}
.card-head h2{font-size:16px;font-weight:700}
.card.tip-card{background:linear-gradient(135deg,#FBFAFF,#F2F0FF);border-color:#E7E4FF}
.card.accent-card{background:linear-gradient(135deg,#FFFFFF,#F6F4FF);border-color:#E7E4FF}
.block{margin-bottom:16px}
.block-head{display:flex;align-items:baseline;justify-content:space-between;gap:8px;margin-bottom:10px}
.block-head h2{font-size:16.5px;font-weight:700}

.muted{color:var(--muted)}
.small{font-size:12.5px}
.center{text-align:center}
.stack{display:flex;flex-direction:column;gap:12px}

/* ---------- subjects ---------- */
.subjects-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}
.subject-card{
  display:flex;flex-direction:column;gap:6px;text-align:start;
  padding:14px;border-radius:20px;border:1px solid var(--line);
  background:#fff;box-shadow:var(--shadow);cursor:pointer;
  transition:transform .15s ease, box-shadow .2s ease;
  user-select:none;
}
.subject-card:active{transform:scale(.975)}
.subject-icon{
  width:40px;height:40px;border-radius:13px;display:grid;place-items:center;
  background:var(--st);color:var(--sc);
}
.subject-icon svg{width:21px;height:21px}
.subject-name{font-weight:700;font-size:14.5px;color:var(--ink)}
.subject-meta{font-size:11.5px;color:var(--muted);line-height:1.3}
.subject-bar{display:block;height:6px;border-radius:99px;background:#F0F1FA;overflow:hidden;margin-top:2px}
.subject-bar i{display:block;height:100%;border-radius:99px;background:var(--sc);transition:width .45s ease}

/* ---------- plan items ---------- */
.plan-item{
  display:flex;align-items:flex-start;gap:11px;padding:10px 0;
  border-bottom:1px solid var(--line);
}
.plan-item:last-child{border-bottom:none;padding-bottom:0}
.plan-item:first-child{padding-top:0}
.check{
  width:26px;height:26px;border-radius:9px;border:2px solid #D9DCEE;background:#fff;
  display:grid;place-items:center;flex:none;cursor:pointer;margin-top:1px;
  transition:background .15s, border-color .15s;
}
.check svg{width:14px;height:14px;color:#fff;opacity:0;transition:opacity .15s}
.check.done{background:var(--ok);border-color:var(--ok)}
.check.done svg{opacity:1}
.plan-main{min-width:0;flex:1}
.plan-title{font-size:14px;font-weight:600;display:block;line-height:1.4}
.plan-item.done .plan-title{color:var(--muted);text-decoration:line-through;text-decoration-thickness:1.5px}
.plan-meta{display:flex;flex-wrap:wrap;gap:8px;font-size:11.5px;color:var(--muted);margin-top:2px}
.plan-time{font-variant-numeric:tabular-nums;font-weight:600;color:var(--ink-2)}
.dot{width:4px;height:4px;border-radius:50%;background:#CBD0E4;display:inline-block;vertical-align:middle}

.day-group{margin-bottom:18px}
.day-group:last-child{margin-bottom:0}
.day-head{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  font-family:'Tajawal',sans-serif;font-weight:700;font-size:14px;
  padding:6px 10px;border-radius:12px;background:var(--brand-soft);color:var(--brand);
  margin-bottom:8px;
}
.day-head .small{font-weight:500;color:var(--brand);opacity:.75}

/* ---------- empty ---------- */
.empty{
  text-align:center;padding:18px 10px;color:var(--muted);font-size:13.5px;
  display:flex;flex-direction:column;align-items:center;gap:10px;
}
.empty .emoji{font-size:26px;line-height:1}

/* ---------- form ---------- */
.field{display:flex;flex-direction:column;gap:6px;margin-bottom:12px}
.field > span, .field-label{font-size:12.5px;font-weight:600;color:var(--ink-2)}
.field > label{font-size:12.5px;font-weight:600;color:var(--ink-2)}
input[type=text],input[type=date],input[type=time],input[type=number],textarea,select{
  width:100%;font-family:inherit;font-size:16px;color:var(--ink);
  background:#FBFBFE;border:1.5px solid var(--line);border-radius:14px;
  padding:11px 13px;outline:none;appearance:none;
  transition:border-color .16s ease, box-shadow .16s ease, background .16s;
}
textarea{resize:vertical;min-height:96px;line-height:1.6}
select{
  background-image:url("data:image/svg+xml;charset=utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23878EAA' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat:no-repeat;
  background-position:left 12px center;
  background-size:16px;
  padding-left:34px;
}
input:focus,textarea:focus,select:focus{border-color:var(--brand);background:#fff;box-shadow:0 0 0 4px rgba(91,87,224,.1)}
:focus-visible{outline:2px solid var(--brand);outline-offset:2px}
input::placeholder,textarea::placeholder{color:#A9AFC6}

.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:0 12px}
@media (max-width:400px){.grid-2{grid-template-columns:1fr}}

.row-between{display:flex;align-items:center;justify-content:space-between;gap:10px;flex-wrap:wrap;margin-bottom:12px}
.inline-select{display:flex;align-items:center;gap:8px}
.inline-select select{width:auto;min-width:104px;padding:8px 34px 8px 12px;font-size:14px;border-radius:12px}

.chip-row{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:12px}
.chip{
  min-height:38px;padding:0 14px;border-radius:999px;
  border:1.5px solid var(--line);background:#fff;color:var(--ink-2);
  font-size:13.5px;font-weight:600;cursor:pointer;user-select:none;
  -webkit-tap-highlight-color:transparent;
  transition:background .16s, border-color .16s, color .16s, transform .12s;
}
.chip:active{transform:scale(.96)}
.chip.active{background:var(--brand-soft);border-color:#C6C1FF;color:var(--brand)}

/* ---------- image preview ---------- */
#imagePreview{margin-bottom:12px}
.img-preview{
  position:relative;display:inline-block;border-radius:16px;overflow:hidden;
  border:1px solid var(--line);background:#fff;max-width:100%;
}
.img-preview img{display:block;max-height:170px;max-width:100%;object-fit:cover}
.img-remove{
  position:absolute;top:6px;inset-inline-start:6px;
  width:30px;height:30px;border-radius:50%;border:none;
  background:rgba(27,31,51,.72);color:#fff;display:grid;place-items:center;cursor:pointer;
}
.img-remove svg{width:14px;height:14px}

/* ---------- notice ---------- */
.notice{
  border-radius:16px;padding:11px 14px;font-size:12.8px;line-height:1.6;
  background:#F7F8FD;border:1px solid var(--line);color:var(--ink-2);
  margin-bottom:12px;display:flex;flex-direction:column;gap:4px;
}
.notice strong{font-size:13.2px;color:var(--ink)}
.notice.info{background:#F3F2FF;border-color:#E3E0FF;color:#4A4694}
.notice.warn{background:var(--warn-bg);border-color:#F6E3BD;color:var(--warn)}
.notice.error{background:#FDF0EF;border-color:#F6D7D4;color:#A23A34}
.notice a{color:inherit;font-weight:700}

/* ---------- teacher result ---------- */
.result-card{padding:18px}
.result-head{display:flex;align-items:center;gap:8px;margin-bottom:8px;flex-wrap:wrap}
.badge{
  font-size:11.5px;font-weight:700;padding:3px 10px;border-radius:99px;
  background:var(--brand-soft);color:var(--brand);
}
.result-title{font-size:18px;font-weight:800;flex:1;min-width:150px}
.result-summary{font-size:14px;color:var(--ink-2);line-height:1.75;margin-bottom:14px}

.sec{margin-top:16px}
.sec-title{
  font-family:'Tajawal',sans-serif;font-size:14.5px;font-weight:700;
  display:flex;align-items:center;gap:8px;margin-bottom:10px;color:var(--ink);
}
.sec-title::before{
  content:"";width:4px;height:16px;border-radius:99px;
  background:linear-gradient(var(--brand-2),var(--brand));
}

.steps{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:10px}
.step{display:flex;gap:10px;align-items:flex-start}
.step-num{
  width:24px;height:24px;border-radius:8px;flex:none;display:grid;place-items:center;
  background:var(--brand-soft);color:var(--brand);font-size:12.5px;font-weight:700;
  margin-top:1px;
}
.step-body{min-width:0;flex:1}
.step-body strong{display:block;font-size:13.8px;margin-bottom:1px}
.step-body p{font-size:13.5px;color:var(--ink-2);line-height:1.7}

.laws{display:flex;flex-direction:column;gap:8px}
.law{
  display:grid;grid-template-columns:auto 1fr;gap:10px;align-items:start;
  background:#FAFAFF;border:1px solid var(--line);border-radius:14px;padding:10px 12px;
}
.law-sym{
  font-family:'Tajawal',sans-serif;font-weight:800;font-size:15px;
  min-width:42px;padding:2px 8px;border-radius:9px;text-align:center;
  background:#fff;border:1px solid #E2E0FA;color:var(--brand);direction:ltr;
}
.law-name{font-weight:700;font-size:13.5px}
.law-mean{font-size:13px;color:var(--ink-2);line-height:1.6}

.example{
  background:linear-gradient(135deg,#F8F7FF,#F3F8FF);
  border:1px solid #E7E6FB;border-radius:16px;padding:14px;
}
.example-q{font-size:13.8px;font-weight:600;margin-bottom:8px}
.example-sol{display:flex;flex-direction:column;gap:6px;margin:0;padding:0;list-style:none}
.example-sol li{
  font-size:13.3px;color:var(--ink-2);padding-inline-start:16px;position:relative;line-height:1.65;
}
.example-sol li::before{
  content:"";position:absolute;inset-inline-start:2px;top:9px;
  width:5px;height:5px;border-radius:50%;background:var(--brand-2);
}
.example-answer{
  margin-top:10px;font-size:13.5px;font-weight:700;color:var(--ok);
  background:#fff;border-radius:11px;padding:8px 12px;border:1px solid #DDF1E8;
}

.quiz-hint{font-size:12.5px;color:var(--muted);margin-bottom:10px}
.quiz-q{
  border:1px solid var(--line);border-radius:16px;padding:12px;margin-bottom:10px;background:#fff;
}
.quiz-question{font-size:13.8px;font-weight:600;margin-bottom:9px;line-height:1.6}
.quiz-options{display:flex;flex-direction:column;gap:7px}
.quiz-opt{
  text-align:start;padding:10px 13px;border-radius:12px;border:1.5px solid var(--line);
  background:#FBFBFE;color:var(--ink);font-size:13.6px;font-family:inherit;cursor:pointer;
  transition:background .15s, border-color .15s, transform .1s;
  min-height:44px;
}
.quiz-opt:active{transform:scale(.99)}
.quiz-opt:disabled{cursor:default;opacity:1}
.quiz-opt.ok{background:#E9F8F1;border-color:#9DE0C4;color:#0A7B55;font-weight:600}
.quiz-opt.bad{background:#FDEFEE;border-color:#F3C9C5;color:#A23A34}
.quiz-exp{
  margin-top:9px;font-size:12.8px;color:var(--ink-2);line-height:1.65;
  background:#F7F8FD;border-radius:11px;padding:9px 12px;
}
.quiz-summary{
  border-radius:16px;padding:14px;background:var(--brand-soft);color:#413C8F;
  font-size:13.5px;line-height:1.7;
}
.quiz-summary strong{display:block;font-family:'Tajawal',sans-serif;font-size:16px;margin-bottom:3px}

.review-chips{display:flex;flex-wrap:wrap;gap:8px}
.review-chip{
  font-size:12.5px;padding:6px 12px;border-radius:99px;
  background:#FFF6E6;border:1px solid #F6E3BD;color:var(--warn);
}

.rate-row{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin-top:16px;padding-top:14px;border-top:1px solid var(--line);
}
.rate-row .small{font-size:12.5px;color:var(--muted);font-weight:600}
.stars{display:flex;gap:6px}
.stars button{
  width:38px;height:38px;border-radius:12px;border:1.5px solid var(--line);
  background:#fff;color:var(--ink-2);font-weight:700;font-size:14px;
  cursor:pointer;transition:background .15s,border-color .15s,color .15s,transform .12s;
  font-family:'Tajawal',sans-serif;
}
.stars button:active{transform:scale(.93)}
.stars button.on{background:var(--brand);border-color:var(--brand);color:#fff}

.voice-btn{
  display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;
  border-radius:12px;border:1.5px solid #E2E0FA;background:#fff;color:var(--brand);
  font-size:13px;font-weight:600;cursor:pointer;font-family:inherit;
}
.voice-btn svg{width:16px;height:16px}
.voice-btn:active{transform:scale(.97)}

.plain-text{
  white-space:pre-wrap;font-size:13.8px;line-height:1.85;color:var(--ink-2);
}

/* ---------- tasks ---------- */
.task-row{
  display:flex;align-items:center;gap:10px;padding:11px 0;border-bottom:1px solid var(--line);
}
.task-row:last-child{border-bottom:none}
.task-main{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.task-title{font-size:14px;font-weight:600;line-height:1.4}
.task-row.done .task-title{text-decoration:line-through;color:var(--muted)}
.task-meta{font-size:11.5px;color:var(--muted);display:flex;flex-wrap:wrap;gap:7px;align-items:center}
.due-pill{
  font-size:11px;font-weight:700;padding:3px 9px;border-radius:99px;white-space:nowrap;
  background:#F1F2F9;color:var(--ink-2);
}
.due-pill.soon{background:#FFF6E6;color:var(--warn)}
.due-pill.late{background:#FDEFEE;color:var(--danger)}
.due-pill.ok{background:#EAF7F1;color:var(--ok)}

/* ---------- methods ---------- */
.method-card{cursor:default}
.method-head{display:flex;align-items:center;gap:10px;margin-bottom:6px}
.method-emoji{
  width:38px;height:38px;border-radius:13px;display:grid;place-items:center;font-size:19px;
  background:var(--brand-soft);flex:none;
}
.method-name{font-size:15px;font-weight:700}
.method-desc{font-size:13.2px;color:var(--ink-2);line-height:1.7}
.method-steps{margin:10px 0 0;padding:0;list-style:none;display:flex;flex-direction:column;gap:7px}
.method-steps li{
  font-size:13px;color:var(--ink-2);padding-inline-start:22px;position:relative;line-height:1.65;
}
.method-steps li::before{
  content:"";position:absolute;inset-inline-start:6px;top:9px;width:6px;height:6px;border-radius:50%;
  background:var(--brand-2);
}
.recommend{border-radius:16px;padding:14px;background:#fff;border:1px solid #E7E4FF;margin-top:10px}
.recommend h3{font-size:14.5px;margin-bottom:4px;color:var(--brand)}
.recommend p{font-size:13.2px;color:var(--ink-2);line-height:1.7}
.recommend .btn{margin-top:12px}

/* ---------- progress ---------- */
.subj-progress{margin-bottom:14px}
.subj-progress:last-child{margin-bottom:0}
.sp-head{display:flex;align-items:center;justify-content:space-between;gap:8px;margin-bottom:6px}
.sp-name{display:flex;align-items:center;gap:8px;font-size:13.5px;font-weight:600}
.sp-dot{width:9px;height:9px;border-radius:50%;background:var(--sc)}
.sp-val{font-size:12px;color:var(--muted);font-weight:600}
.sp-bar{height:8px;border-radius:99px;background:#F0F1FA;overflow:hidden}
.sp-bar i{display:block;height:100%;border-radius:99px;background:var(--sc);transition:width .5s ease}

.review-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 0;border-bottom:1px solid var(--line);
}
.review-row:last-child{border-bottom:none}
.review-topic{font-size:13.5px;font-weight:600;min-width:0;line-height:1.5}
.review-sub{font-size:11.5px;color:var(--muted)}

.session-row{
  display:flex;align-items:center;justify-content:space-between;gap:10px;
  padding:10px 0;border-bottom:1px solid var(--line);
}
.session-row:last-child{border-bottom:none}
.session-main{min-width:0}
.session-title{font-size:13.5px;font-weight:600}
.session-meta{font-size:11.5px;color:var(--muted)}

/* ---------- overlays ---------- */
.overlay{
  position:fixed;inset:0;z-index:90;
  background:rgba(22,25,43,.46);
  -webkit-backdrop-filter:blur(3px);backdrop-filter:blur(3px);
  display:flex;align-items:flex-end;justify-content:center;
}
.sheet{
  width:100%;max-width:520px;max-height:90vh;overflow-y:auto;
  background:#fff;border-radius:26px 26px 0 0;padding:20px 18px 26px;
  box-shadow:0 -18px 50px -20px rgba(20,22,40,.5);
  animation:sheetUp .26s cubic-bezier(.22,.9,.3,1) both;
}
@keyframes sheetUp{from{transform:translateY(28px);opacity:.6}to{transform:none;opacity:1}}
@media (min-width:640px){
  .overlay{align-items:center;padding:24px}
  .sheet{border-radius:26px}
}
.sheet-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:12px}
.sheet-head h2{font-size:17px;font-weight:800}
.sheet-actions{display:flex;gap:10px;margin-top:16px}
.sheet-actions .btn{flex:1}

/* ---------- toast ---------- */
#toastHost{
  position:fixed;inset-inline:0;bottom:86px;z-index:80;
  display:flex;flex-direction:column;align-items:center;gap:8px;pointer-events:none;
  padding:0 20px;
}
.toast{
  background:rgba(24,27,48,.95);color:#fff;font-size:13.5px;
  padding:10px 18px;border-radius:14px;max-width:340px;text-align:center;
  box-shadow:0 14px 30px -14px rgba(0,0,0,.6);
  animation:toastIn .26s ease-out both;transition:opacity .3s ease;
}
@keyframes toastIn{from{transform:translateY(10px);opacity:0}to{transform:none;opacity:1}}

/* ---------- tabbar ---------- */
.tabbar{
  position:fixed;inset-inline:0;bottom:0;z-index:60;
  display:flex;justify-content:center;gap:2px;
  padding:8px 8px 10px;
  background:rgba(255,255,255,.92);
  -webkit-backdrop-filter:blur(16px);backdrop-filter:blur(16px);
  border-top:1px solid var(--line);
}
.tab{
  flex:1;max-width:128px;
  display:flex;flex-direction:column;align-items:center;gap:3px;
  padding:6px 2px;border:none;background:none;border-radius:14px;
  color:var(--muted);font-size:10.5px;font-weight:600;font-family:inherit;
  cursor:pointer;user-select:none;-webkit-tap-highlight-color:transparent;
  transition:color .16s, background .16s;
}
.tab svg{width:22px;height:22px}
.tab.active{color:var(--brand);background:var(--brand-soft)}
.tab:active{transform:scale(.96)}

/* ---------- misc ---------- */
@media (min-width:560px){
  .stat-row{grid-template-columns:repeat(3,1fr)}
  .subjects-grid{grid-template-columns:repeat(4,1fr)}
}
@media (max-width:360px){
  .hero-title{font-size:20px}
  .stat strong{font-size:15px}
  .brand-text span{display:none}
}

@media (prefers-reduced-motion: reduce){
  *,*::before,*::after{animation-duration:.001ms !important;animation-iteration-count:1 !important;transition-duration:.001ms !important}
}