/* StudyBuddy — design tokens. Logical properties (margin-inline etc.) throughout so RTL works. */
:root {
  --navy: #1B3A6B; --navy-700: #142D55; --navy-50: #EEF3FB;
  --teal: #0B7F70; --teal-600: #096B5E; --teal-400: #14A38F; --teal-50: #E8F6F3;
  --yellow: #FFC93C; --yellow-600: #B88400; --yellow-50: #FFF7DD;
  --bg: #F6F8FC; --surface: #FFFFFF; --ink: #1E2533; --muted: #566074; --line: #DDE3EE;
  --ok: #157A3D; --ok-50: #E7F6EC; --bad: #B4410F; --bad-50: #FDEEE6; --info-50: #EEF3FB;
  --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(20,45,85,.06), 0 6px 20px rgba(20,45,85,.07);
  --font: 'Nunito', 'Segoe UI', system-ui, -apple-system, 'Noto Sans Arabic', Tahoma, sans-serif;
  --focus: 0 0 0 3px #fff, 0 0 0 6px var(--teal-400);
}
* { box-sizing: border-box; }
html { font-size: 17px; -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.6; min-height: 100vh; display: flex; flex-direction: column; }
img, svg { max-width: 100%; }
h1, h2, h3, h4 { color: var(--navy); line-height: 1.25; margin: 0 0 .5em; font-weight: 800; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); } h2 { font-size: 1.35rem; } h3 { font-size: 1.1rem; }
p { margin: 0 0 .8em; }
a { color: var(--teal); font-weight: 700; text-underline-offset: 3px; }
a:hover { color: var(--teal-600); }
main:focus, main:focus-visible { box-shadow: none; outline: none; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: 6px; }
.sr-only { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; inset-inline-start: 12px; top: -60px; background: var(--navy); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; }

/* ---------- header / nav ---------- */
.topbar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.12); }
.topbar-inner { max-width: 1200px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 10px 16px; }
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; font-weight: 800; font-size: 1.25rem; letter-spacing: -.3px; }
.brand img { width: 38px; height: 38px; border-radius: 10px; box-shadow: 0 0 0 2px rgba(255,255,255,.15); }
.brand .b2 { color: #7FE0D0; }
.nav { display: flex; gap: 4px; margin-inline-start: auto; align-items: center; flex-wrap: wrap; }
.nav a { color: #DCE6F7; text-decoration: none; padding: 8px 12px; border-radius: 999px; font-weight: 700; font-size: .95rem; }
.nav a:hover { background: rgba(255,255,255,.1); color: #fff; }
.nav a[aria-current="page"] { background: #fff; color: var(--navy); }
.nav .xp-pill { background: var(--yellow); color: var(--navy-700); }
.menu-btn { display: none; margin-inline-start: auto; background: transparent; border: 2px solid rgba(255,255,255,.4); color: #fff; border-radius: 10px; padding: 6px 10px; font: inherit; font-weight: 800; cursor: pointer; }
.banner { padding: 8px 16px; text-align: center; font-size: .9rem; font-weight: 700; }
.banner.demo { background: var(--yellow-50); color: #6B4E00; border-bottom: 1px solid #F3DB8F; }
.banner.env { background: #5B21B6; color: #fff; letter-spacing: .04em; }
.banner.verify { background: var(--teal-50); color: var(--teal-600); }
@media (max-width: 860px) {
  .menu-btn { display: block; }
  .nav { display: none; position: absolute; inset-inline: 0; top: 100%; background: var(--navy); flex-direction: column; align-items: stretch; padding: 8px 12px 14px; }
  .nav.open { display: flex; }
  .nav a { padding: 12px 14px; }
}

/* ---------- layout ---------- */
main { flex: 1; width: 100%; max-width: 1200px; margin: 0 auto; padding: 24px 16px 64px; }
main.narrow { max-width: 760px; }
footer.site { text-align: center; color: var(--muted); font-size: .85rem; padding: 20px 16px 28px; }
.grid { display: grid; gap: 18px; }
.grid.cols-3 { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid.cols-4 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; } .row.between { justify-content: space-between; }
.stack > * + * { margin-top: 14px; }
.spacer { flex: 1; }
.muted { color: var(--muted); } .small { font-size: .88rem; } .tiny { font-size: .78rem; }
.center { text-align: center; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 22px; }
.page-head p { margin: 0; color: var(--muted); }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 6px; }
.crumbs a { font-weight: 700; }
.two-col > * { min-width: 0; }
.two-col { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: 24px; align-items: start; }
@media (max-width: 980px) { .two-col, .two-col[style] { grid-template-columns: minmax(0, 1fr) !important; } .two-col > aside { order: -1; } }

/* ---------- cards ---------- */
.card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 22px; border: 1px solid #E8EDF5; }
.card.flat { box-shadow: none; }
.card h2:first-child, .card h3:first-child { margin-top: 0; }
.card.hero-card { position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 8px; min-height: 210px; text-decoration: none; color: inherit; transition: transform .2s, box-shadow .2s; }
a.card:hover, .card.hoverable:hover { transform: translateY(-3px); box-shadow: 0 10px 30px rgba(20,45,85,.13); }
.hero-card .icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.6rem; }
.hero-card.continue { background: linear-gradient(135deg, var(--navy) 0%, #24508F 100%); color: #fff; }
.hero-card.continue h2, .hero-card.continue h3 { color: #fff; }
.hero-card.continue .icon { background: rgba(255,255,255,.15); }
.hero-card.practice .icon { background: var(--teal-50); }
.hero-card.progress .icon { background: var(--yellow-50); }
.hero-card .cta { margin-top: auto; font-weight: 800; }
.hero-card.continue .cta { color: var(--yellow); }

/* ---------- buttons & forms ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: inherit; font-weight: 800; border-radius: 12px; padding: 11px 18px; border: 2px solid transparent; cursor: pointer; text-decoration: none; line-height: 1.2; min-height: 44px; transition: background .15s, transform .1s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--teal); color: #fff; }
.btn.primary:hover { background: var(--teal-600); color: #fff; }
.btn.secondary { background: #fff; color: var(--navy); border-color: var(--line); }
.btn.secondary:hover { border-color: var(--navy); }
.btn.ghost { background: transparent; color: var(--teal); padding-inline: 10px; }
.btn.ghost:hover { background: var(--teal-50); }
.btn.navy { background: var(--navy); color: #fff; }
.btn.danger { background: #fff; color: var(--bad); border-color: #F2C6B2; }
.btn.danger:hover { background: var(--bad-50); }
.btn.yellow { background: var(--yellow); color: var(--navy-700); }
.btn.small { padding: 6px 12px; min-height: 36px; font-size: .9rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .5; cursor: not-allowed; }
label.field { display: block; font-weight: 700; margin-bottom: 14px; color: var(--navy-700); }
label.field > span.hint { display: block; font-weight: 400; color: var(--muted); font-size: .85rem; }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=search], select, textarea {
  width: 100%; font: inherit; font-weight: 400; color: var(--ink); background: #fff; border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; margin-top: 6px; min-height: 46px; }
textarea { min-height: 90px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--teal-400); outline: none; box-shadow: 0 0 0 3px rgba(20,163,143,.2); }
.form-error { background: var(--bad-50); color: var(--bad); border-radius: 10px; padding: 10px 14px; font-weight: 700; margin-bottom: 14px; }
.form-ok { background: var(--ok-50); color: var(--ok); border-radius: 10px; padding: 10px 14px; font-weight: 700; margin-bottom: 14px; }
.segmented { display: inline-flex; background: var(--navy-50); border-radius: 12px; padding: 4px; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.segmented label { position: relative; }
.segmented input { position: absolute; opacity: 0; inset: 0; }
.segmented span { display: block; padding: 8px 14px; border-radius: 9px; font-weight: 800; color: var(--navy); cursor: pointer; }
.segmented input:checked + span { background: #fff; box-shadow: var(--shadow); color: var(--teal); }
.segmented input:focus-visible + span { box-shadow: var(--focus); }
fieldset { border: 0; padding: 0; margin: 0 0 14px; }
legend { font-weight: 700; color: var(--navy-700); padding: 0; }

/* ---------- chips & badges ---------- */
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--navy-50); color: var(--navy); white-space: nowrap; max-width: 100%; }
.chip.source { white-space: normal; }
.chip.teal { background: var(--teal-50); color: var(--teal-600); }
.chip.yellow { background: var(--yellow-50); color: #7A5600; }
.chip.ok { background: var(--ok-50); color: var(--ok); }
.chip.bad { background: var(--bad-50); color: var(--bad); }
.chip.gray { background: #EEF0F4; color: #4B5563; }
.chip.source { background: #F1EAFE; color: #5B21B6; }
.chip.generated { background: var(--teal-50); color: var(--teal-600); }
.chip.spin::before { content: ''; width: 10px; height: 10px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- stats ---------- */
.stat { background: #fff; border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); border: 1px solid #E8EDF5; }
.stat .label { color: var(--muted); font-weight: 700; font-size: .85rem; }
.stat .value { font-size: 1.8rem; font-weight: 900; color: var(--navy); line-height: 1.2; }
.stat.xp .value { color: #8A6300; }
.bar { height: 12px; background: var(--navy-50); border-radius: 999px; overflow: hidden; }
.bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--teal-400), var(--teal)); border-radius: 999px; transition: width .6s ease; }
.bar.yellow > span { background: linear-gradient(90deg, #FFD966, var(--yellow)); }
.bar.low > span { background: linear-gradient(90deg, #F59E7A, #E26D3D); }

/* ---------- lessons list ---------- */
.unit { margin-bottom: 26px; }
.unit-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.lesson-list { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 10px; }
.lesson-item { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: #fff; border-radius: 14px; padding: 14px 16px; box-shadow: var(--shadow); border: 1px solid #E8EDF5; text-decoration: none; color: inherit; }
a.lesson-item:hover { border-color: var(--teal-400); }
.lesson-item .num { width: 40px; height: 40px; border-radius: 12px; background: var(--navy-50); color: var(--navy); display: grid; place-items: center; font-weight: 900; flex-shrink: 0; }
.lesson-item.done .num { background: var(--ok-50); color: var(--ok); }
.lesson-item.locked { opacity: .6; }
.lesson-item .title { font-weight: 800; color: var(--navy); }

/* ---------- lesson page ---------- */
.lesson-nav { position: sticky; top: 80px; }
.lesson-nav ol { list-style: none; padding: 0; margin: 0; display: grid; gap: 2px; }
.lesson-nav a { display: block; padding: 7px 12px; border-radius: 10px; text-decoration: none; color: var(--muted); font-weight: 700; font-size: .92rem; }
.lesson-nav a:hover { background: var(--navy-50); color: var(--navy); }
@media (max-width: 980px) { .lesson-nav { position: static; } .lesson-nav ol { display: flex; overflow-x: auto; gap: 6px; padding-bottom: 6px; } .lesson-nav a { white-space: nowrap; background: #fff; border: 1px solid var(--line); } }
.lesson-section { scroll-margin-top: 90px; margin-bottom: 22px; }
.section-title { display: flex; align-items: center; gap: 10px; }
.section-title .ico { width: 36px; height: 36px; border-radius: 10px; background: var(--navy-50); display: grid; place-items: center; font-size: 1.1rem; flex-shrink: 0; }
.objectives { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.objectives li { display: flex; gap: 10px; align-items: flex-start; }
.objectives li::before { content: '✓'; flex-shrink: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--teal-50); color: var(--teal); display: grid; place-items: center; font-weight: 900; font-size: .8rem; margin-top: 2px; }
.concept { border-inline-start: 4px solid var(--teal-400); padding: 6px 14px; background: var(--teal-50); border-radius: 0 10px 10px 0; }
[dir=rtl] .concept { border-radius: 10px 0 0 10px; }
.explain-block + .explain-block { margin-top: 18px; padding-top: 18px; border-top: 1px dashed var(--line); }
.simpler { background: var(--yellow-50); border-radius: 12px; padding: 14px 16px; margin-top: 10px; animation: pop .3s ease; }
.source-ref { font-size: .8rem; color: var(--muted); }
.example { border: 2px solid var(--navy-50); border-radius: 14px; padding: 16px; }
.example + .example { margin-top: 14px; }
.example .problem { font-weight: 800; color: var(--navy); font-size: 1.05rem; }
.steps { counter-reset: step; list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.steps li { counter-increment: step; display: flex; gap: 10px; animation: pop .25s ease; }
.steps li::before { content: counter(step); flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; background: var(--navy); color: #fff; font-weight: 800; font-size: .8rem; display: grid; place-items: center; margin-top: 2px; }
.answer-line { margin-top: 10px; background: var(--ok-50); color: var(--ok); padding: 8px 12px; border-radius: 10px; font-weight: 800; }
.mistake { display: grid; gap: 4px; padding: 14px 16px; border-radius: 12px; background: #FFFBF3; border: 1px solid #F6E3B4; }
.mistake + .mistake { margin-top: 10px; }
.mistake .m { font-weight: 800; color: var(--bad); } .mistake .f { color: var(--ok); font-weight: 700; }
.visual { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; }
.visual figcaption { font-size: .9rem; color: var(--muted); margin-top: 6px; }
.frac { display: inline-flex; flex-direction: column; vertical-align: middle; text-align: center; font-size: .85em; line-height: 1.05; margin: 0 2px; }
.frac > .num { border-bottom: 2px solid currentColor; padding: 0 3px; }
.frac > .den { padding: 0 3px; }
.mixed-whole { margin-inline-end: 1px; }

/* ---------- questions ---------- */
.question { border: 2px solid var(--line); border-radius: 16px; padding: 18px; background: #fff; transition: border-color .2s; }
.question + .question { margin-top: 14px; }
.question.correct { border-color: #9FD9B5; background: linear-gradient(0deg, #fff, #fff), var(--ok-50); }
.question.wrong { border-color: #F3C2AA; }
.question .q-meta { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 8px; }
.question .q-prompt { font-size: 1.08rem; font-weight: 700; margin-bottom: 12px; }
.question .q-input { display: flex; gap: 10px; flex-wrap: wrap; align-items: flex-end; }
.question .q-input input { max-width: 260px; margin: 0; }
.options { display: grid; gap: 8px; margin-bottom: 12px; }
.option { display: flex; align-items: center; gap: 12px; border: 2px solid var(--line); border-radius: 12px; padding: 10px 14px; cursor: pointer; font-weight: 700; }
.option:hover { border-color: var(--teal-400); }
.option input { width: 20px; height: 20px; accent-color: var(--teal); margin: 0; }
.option.picked { border-color: var(--teal); background: var(--teal-50); }
.feedback { margin-top: 12px; border-radius: 12px; padding: 12px 14px; font-weight: 700; animation: pop .25s ease; }
.feedback.ok { background: var(--ok-50); color: var(--ok); }
.feedback.no { background: var(--bad-50); color: var(--bad); }
.feedback.info { background: var(--info-50); color: var(--navy); font-weight: 600; }
.hint-box { margin-top: 10px; background: var(--yellow-50); border-radius: 12px; padding: 10px 14px; }
.hint-box ol { margin: 4px 0 0; padding-inline-start: 22px; }
.solution { margin-top: 12px; background: var(--navy-50); border-radius: 12px; padding: 12px 14px; }
.xp-pop { display: inline-block; background: var(--yellow); color: var(--navy-700); font-weight: 900; padding: 2px 10px; border-radius: 999px; margin-inline-start: 8px; animation: float-up 1s ease; }
@keyframes pop { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }
@keyframes float-up { 0% { transform: translateY(8px); opacity: 0; } 40% { transform: translateY(-4px); opacity: 1; } 100% { transform: none; } }
.sparkle { position: fixed; pointer-events: none; z-index: 90; font-size: 22px; animation: sparkle 1s ease-out forwards; }
@keyframes sparkle { from { opacity: 1; transform: translate(0,0) scale(.6); } to { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1.2); } }
.dots { display: flex; gap: 6px; flex-wrap: wrap; }
.dots button { width: 34px; height: 34px; border-radius: 50%; border: 2px solid var(--line); background: #fff; font: inherit; font-weight: 800; cursor: pointer; color: var(--navy); }
.dots button.cur { border-color: var(--navy); background: var(--navy); color: #fff; }
.dots button.ok { border-color: #9FD9B5; background: var(--ok-50); color: var(--ok); }
.dots button.no { border-color: #F3C2AA; background: var(--bad-50); color: var(--bad); }

/* ---------- tutor drawer ---------- */
.tutor-fab { position: fixed; inset-inline-end: 20px; bottom: 20px; z-index: 50; box-shadow: 0 8px 24px rgba(11,127,112,.35); border-radius: 999px; padding: 14px 20px; }
.drawer { position: fixed; inset-block: 0; inset-inline-end: 0; width: min(420px, 100vw); background: #fff; z-index: 60; box-shadow: -10px 0 40px rgba(0,0,0,.15); display: flex; flex-direction: column; transform: translateX(105%); transition: transform .25s ease; }
[dir=rtl] .drawer { transform: translateX(-105%); }
.drawer.open { transform: none !important; }
.drawer header { background: var(--navy); color: #fff; padding: 14px 16px; display: flex; align-items: center; gap: 10px; }
.drawer header h2 { color: #fff; margin: 0; font-size: 1.1rem; }
.drawer .msgs { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--bg); }
.msg { max-width: 88%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; }
.msg.user { align-self: flex-end; background: var(--teal); color: #fff; border-end-end-radius: 4px; }
.msg.assistant { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-end-start-radius: 4px; }
.msg .refs { font-size: .75rem; color: var(--muted); margin-top: 4px; }
.drawer form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid var(--line); }
.drawer form input { margin: 0; }
.scrim { position: fixed; inset: 0; background: rgba(15,30,60,.35); z-index: 55; }
@media (max-width: 600px) { .drawer { width: 100vw; } }

/* ---------- misc ---------- */
.toast-region { position: fixed; bottom: 18px; inset-inline-start: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
[dir=rtl] .toast-region { transform: translateX(50%); }
.toast { background: var(--navy); color: #fff; padding: 12px 16px; border-radius: 14px; box-shadow: 0 10px 30px rgba(0,0,0,.2); font-weight: 700; animation: pop .25s ease; display: flex; gap: 10px; align-items: center; }
.toast.ok { background: var(--ok); } .toast.bad { background: var(--bad); } .toast.badge { background: var(--yellow); color: var(--navy-700); }
.loading { display: grid; place-items: center; padding: 60px 16px; color: var(--muted); gap: 12px; text-align: center; }
.spinner { width: 42px; height: 42px; border: 4px solid var(--navy-50); border-top-color: var(--teal); border-radius: 50%; animation: spin .9s linear infinite; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); }
.empty svg { width: 110px; height: 110px; margin-bottom: 8px; }
.error-box { background: var(--bad-50); border: 1px solid #F3C2AA; color: var(--bad); padding: 16px; border-radius: 14px; }
.notice { background: var(--info-50); border-radius: 12px; padding: 12px 16px; color: var(--navy); }
.notice.warn { background: var(--yellow-50); color: #6B4E00; }
table.table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.table th, .table td { text-align: start; padding: 10px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table th { color: var(--muted); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.table-wrap { overflow-x: auto; }
details.box { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 10px 14px; }
details.box + details.box { margin-top: 10px; }
details.box summary { cursor: pointer; font-weight: 800; color: var(--navy); }
.badge-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
.badge-tile { text-align: center; padding: 14px 10px; border-radius: 14px; background: #fff; border: 2px solid var(--yellow); }
.badge-tile .em { font-size: 2rem; }
.badge-tile.locked { border-color: var(--line); filter: grayscale(1); opacity: .55; }
.badge-tile .n { font-weight: 800; color: var(--navy); font-size: .9rem; }
.avatar { width: 48px; height: 48px; border-radius: 50%; background: var(--yellow-50); display: grid; place-items: center; font-size: 1.6rem; flex-shrink: 0; border: 2px solid var(--yellow); }
.avatar.lg { width: 72px; height: 72px; font-size: 2.4rem; }
.avatar-pick { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.avatar-pick label { position: relative; }
.avatar-pick input { position: absolute; opacity: 0; }
.avatar-pick span { display: grid; place-items: center; width: 54px; height: 54px; border-radius: 50%; font-size: 1.7rem; border: 3px solid transparent; background: var(--navy-50); cursor: pointer; }
.avatar-pick input:checked + span { border-color: var(--teal); background: var(--teal-50); }
.avatar-pick input:focus-visible + span { box-shadow: var(--focus); }
.ring { --p: 0; width: 86px; height: 86px; border-radius: 50%; background: conic-gradient(var(--yellow) calc(var(--p) * 1%), var(--navy-50) 0); display: grid; place-items: center; }
.ring > div { width: 66px; height: 66px; border-radius: 50%; background: #fff; display: grid; place-items: center; font-weight: 900; color: var(--navy); }
.cal { display: flex; gap: 5px; }
.cal span { width: 22px; height: 22px; border-radius: 6px; background: var(--navy-50); }
.cal span.on { background: var(--teal-400); } .cal span.hi { background: var(--teal); }
.workflow { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: .82rem; font-weight: 800; }
.workflow span { background: var(--navy-50); color: var(--navy); padding: 4px 10px; border-radius: 999px; }
.workflow i { color: var(--muted); font-style: normal; }
.tree-unit { border: 1px solid var(--line); border-radius: 14px; background: #fff; padding: 14px 16px; }
.tree-unit + .tree-unit { margin-top: 12px; }
.tree-lessons { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.tree-lessons li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.dropzone { border: 3px dashed var(--line); border-radius: 16px; padding: 28px; text-align: center; background: #fff; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone.over, .dropzone:hover { border-color: var(--teal-400); background: var(--teal-50); }
.progress-line { height: 8px; border-radius: 999px; background: var(--navy-50); overflow: hidden; margin-top: 10px; }
.progress-line span { display: block; height: 100%; background: var(--teal); width: 0; transition: width .2s; }
.page-preview { white-space: pre-wrap; font-family: ui-monospace, Menlo, Consolas, monospace; font-size: .85rem; background: var(--bg); border-radius: 10px; padding: 12px; max-height: 360px; overflow: auto; }
.preview-frame { width: 100%; height: 560px; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.editor-q { border: 1px solid var(--line); border-radius: 12px; padding: 14px; background: #FBFCFE; }
.editor-q + .editor-q { margin-top: 12px; }
.sticky-actions { position: sticky; bottom: 0; background: rgba(246,248,252,.95); backdrop-filter: blur(6px); padding: 12px 0; border-top: 1px solid var(--line); z-index: 5; }
.hero { display: grid; grid-template-columns: 1.1fr .9fr; gap: 30px; align-items: center; padding: 30px 0 10px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3rem); }
.hero .lead { font-size: 1.2rem; color: var(--muted); }
@media (max-width: 800px) { .hero { grid-template-columns: 1fr; text-align: center; } .hero .row { justify-content: center; } }
.mascot { animation: bob 3.5s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px); } }
.auth-wrap { max-width: 440px; margin: 20px auto; }
.auth-wrap .logo { display: block; margin: 0 auto 18px; width: 220px; }
.mail-item { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: #fff; }
.mail-item + .mail-item { margin-top: 10px; }
.mail-item pre { white-space: pre-wrap; font-family: inherit; margin: 6px 0 0; font-size: .9rem; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
