/* =====================================================================
   Bayan classroom — Notes for Innovation identity
   A full school room: the course plan, the lesson, the learner's notebook and progress.
   ===================================================================== */

/* ------------------------------------------------------------------ languages never share a voice
   Arabic: IBM Plex Sans Arabic (text) / Noto Naskh Arabic (titles), right to left.
   Spanish (and any Latin text): Inter (text) / Playfair Display (titles), left to right, isolated. */
.es, bdi.es, [lang='es'], [lang='es-ES'] {
  font-family: var(--font-latin);
  direction: ltr; unicode-bidi: isolate;
  font-feature-settings: 'ss01', 'cv11';
  letter-spacing: 0;
}
bdi.es { color: var(--es-ink, inherit); font-weight: 500; }
.caption bdi.es, .prompt bdi.es, .nb bdi.es, .plan-page bdi.es { color: var(--accent); }
.btn bdi.es, .btn-accent bdi.es, .st-chip bdi.es { color: inherit; }
h1 bdi.es, h2 bdi.es, h3 bdi.es, .cls-title bdi.es { font-family: var(--font-latin-display); font-style: italic; font-weight: 500; }
.es-block { direction: ltr; text-align: left; font-family: var(--font-latin); unicode-bidi: isolate; }
.es-tag { display: inline-flex; align-items: center; height: 18px; padding: 0 6px; border-radius: 4px; font-family: var(--font-latin); font-size: .64rem; font-weight: 700; letter-spacing: .08em; color: var(--accent); border: 1px solid var(--accent-line); direction: ltr; }
.ar-tag { font-family: var(--font); font-size: .7rem; font-weight: 600; color: var(--muted); }

/* ------------------------------------------------------------------ Notes header */
.topbar { height: 64px; padding: 0 clamp(14px, 3vw, 28px); background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom: 1px solid var(--line); }
.topbar.scrolled { border-bottom-color: var(--line-strong); }
.brand { gap: 12px; font-family: var(--font-display); font-weight: 700; font-size: 1.12rem; letter-spacing: 0; }
.brand .brand-mark { width: 28px; height: 28px; border-radius: 7px; display: grid; place-items: center; background: var(--cta); color: var(--cta-ink); font-family: var(--font-display); font-size: 1rem; font-weight: 700; line-height: 1; }
.brand .brand-sub { font-family: var(--font-latin); font-size: .7rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-inline-start: 1px solid var(--line-strong); padding-inline-start: 12px; }
.btn { border-radius: var(--r); box-shadow: none; }
.btn-lg { border-radius: var(--r); }
.btn-primary { background: var(--ink); color: var(--bg); }
.chip-btn, .pill, .verdict, .eyebrow, .feature, .lang-switch, .lang-switch button { border-radius: 999px; }
.avatar-btn { border-radius: 8px; font-family: var(--font-display); }
.meter { height: 4px; background: var(--surface-3); }
.meter > span { background: var(--accent); }
.section-label { font-family: var(--font-latin); font-size: .68rem; font-weight: 600; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }
.section-label.ar { font-family: var(--font); letter-spacing: .02em; text-transform: none; font-size: .78rem; }
.hairline { height: 1px; background: var(--line); border: 0; margin: 0; }
.num { font-family: var(--font-latin); font-variant-numeric: tabular-nums; }
.title-ar { font-family: var(--font-display); font-weight: 700; letter-spacing: 0; line-height: 1.45; }

/* ------------------------------------------------------------------ welcome (Notes) */
.welcome::before { background: radial-gradient(50% 60% at 50% 40%, rgba(234, 191, 75, .1), transparent 70%); }
.hero h1, .setup h1 { font-family: var(--font-display); font-weight: 700; }
.eyebrow::before { background: var(--accent); }
.feature .ico { color: var(--accent); }

/* ------------------------------------------------------------------ home */
.home2 { width: min(1180px, 100% - 2 * clamp(16px, 4vw, 40px)); margin: 0 auto; padding: 40px 0 80px; display: grid; gap: 48px; }
.home2 .greet h1 { font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4vw, 2.8rem); margin: 6px 0 6px; }
.home2 .greet p { color: var(--ink-2); margin: 0; max-width: 60ch; }
.resume-card { display: grid; grid-template-columns: auto 1fr auto; gap: 28px; align-items: center; padding: 28px; border: 1px solid var(--line); border-radius: var(--r-lg); background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 7%, var(--surface)) 0%, var(--surface) 60%); }
.resume-card h2 { margin: 4px 0; font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.resume-card p { margin: 0; color: var(--ink-2); }
.course-row { display: grid; grid-template-columns: 220px 1fr auto; gap: 28px; align-items: center; padding: 24px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); text-align: start; cursor: pointer; transition: border-color .2s, transform .25s var(--ease); width: 100%; color: inherit; }
.course-row:hover { border-color: var(--accent-line); transform: translateY(-2px); }
.course-art { height: 140px; border-radius: var(--r); position: relative; overflow: hidden; background: #050505; border: 1px solid var(--line); display: grid; place-items: center; }
.course-art::before { content: ''; position: absolute; inset: 0; background: radial-gradient(80% 90% at 80% 10%, rgba(234, 191, 75, .35), transparent 60%), radial-gradient(70% 80% at 10% 100%, rgba(121, 126, 246, .3), transparent 60%); }
.course-art .glyph2 { position: relative; font-family: var(--font-latin-display); font-style: italic; font-size: 3.6rem; color: #f3ead6; }
.course-art .lvl { position: absolute; bottom: 10px; inset-inline-start: 10px; font-family: var(--font-latin); font-size: .7rem; font-weight: 600; letter-spacing: .1em; color: #111; background: var(--cta); padding: 2px 8px; border-radius: 4px; }
.course-row h3 { margin: 0 0 6px; font-family: var(--font-display); font-size: 1.35rem; font-weight: 700; line-height: 1.5; }
.course-row p { margin: 0 0 12px; color: var(--ink-2); font-size: .95rem; }
.facts { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: .85rem; }
.facts b { color: var(--ink); font-weight: 600; }

/* progress ring */
.ring2 { width: 76px; height: 76px; flex: none; }
.ring2 circle { fill: none; stroke-width: 5; }
.ring2 .track { stroke: var(--surface-3); }
.ring2 .val { stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset 1s var(--ease); }
.ring2 text { font-family: var(--font-latin); font-size: 15px; font-weight: 600; fill: var(--ink); }
.ring2.sm { width: 52px; height: 52px; }

/* ------------------------------------------------------------------ course plan (syllabus) page */

.plan-page { width: min(1180px, 100% - 2 * clamp(16px, 4vw, 40px)); margin: 0 auto; padding: 36px 0 90px; display: grid; gap: 40px; }
.syl-hero { display: grid; grid-template-columns: 1fr 340px; gap: 40px; align-items: start; }
.syl-hero h1 { margin: 10px 0 12px; font-family: var(--font-display); font-weight: 700; font-size: clamp(2rem, 4.4vw, 3rem); line-height: 1.35; }
.syl-hero .lead { color: var(--ink-2); font-size: 1.08rem; max-width: 62ch; margin: 0 0 20px; }
.syl-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.stat-card { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); padding: 22px; display: grid; gap: 18px; }
.stat-top { display: flex; align-items: center; gap: 16px; }
.stat-top b { display: block; font-family: var(--font-display); font-size: 1.1rem; }
.stat-top small { color: var(--muted); }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.stat-grid div { background: var(--surface); padding: 12px 14px; display: grid; gap: 2px; }
.stat-grid strong { font-family: var(--font-latin); font-size: 1.35rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.stat-grid span { color: var(--muted); font-size: .8rem; }

.block-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.block-head h2 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.45rem; }

/* level journey: the stages of progress */
.journey { display: grid; grid-template-columns: repeat(var(--n, 3), 1fr); gap: 0; position: relative; }
.stage { position: relative; padding: 0 0 0; display: grid; gap: 10px; }
.stage-track { display: flex; align-items: center; gap: 0; }
.stage-node { min-width: 38px; height: 38px; padding: 0 6px; white-space: nowrap; border-radius: 999px; display: grid; place-items: center; flex: none; border: 1px solid var(--line-strong); background: var(--surface); font-family: var(--font-latin); font-size: .7rem; font-weight: 700; color: var(--muted); z-index: 1; }
.stage-line { flex: 1; height: 2px; background: var(--line); }
.stage.done .stage-node { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.stage.done .stage-line, .stage.now .stage-line.half { background: linear-gradient(to var(--fwd, left), var(--accent) var(--p, 0%), var(--line) var(--p, 0%)); }
.stage.done .stage-line { background: var(--accent); }
.stage.now .stage-node { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.stage-body { padding-inline-end: 24px; }
.stage-body b { display: block; font-family: var(--font-display); font-size: 1.02rem; }
.stage-body p { margin: 4px 0 0; color: var(--muted); font-size: .86rem; line-height: 1.6; }

.outcomes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; counter-reset: o; }
.outcomes li { counter-increment: o; display: grid; grid-template-columns: auto 1fr; gap: 14px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); line-height: 1.75; }
.outcomes li::before { content: counter(o, decimal-leading-zero); font-family: var(--font-latin-display); font-style: italic; font-size: 1.4rem; color: var(--accent); line-height: 1.2; }

.unit { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.unit + .unit { margin-top: 14px; }
.unit-head { display: grid; grid-template-columns: auto 1fr auto; gap: 18px; align-items: center; padding: 20px 22px; }
.unit-n { font-family: var(--font-latin-display); font-style: italic; font-size: 2rem; color: var(--accent); line-height: 1; min-width: 1.6em; }
.unit-head h3 { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; line-height: 1.5; }
.unit-head p { margin: 4px 0 0; color: var(--ink-2); font-size: .9rem; }
.unit-side { display: grid; justify-items: end; gap: 8px; min-width: 120px; }
.lvl-badge { font-family: var(--font-latin); font-size: .7rem; font-weight: 700; letter-spacing: .08em; padding: 3px 8px; border-radius: 4px; border: 1px solid var(--accent-line); color: var(--accent); }
.unit-side .meter { width: 120px; }
.unit-side small { color: var(--muted); font-size: .78rem; }
.lesson-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line); }
.lesson-item + .lesson-item { border-top: 1px solid var(--line); }
.lesson-row { width: 100%; display: grid; grid-template-columns: 44px 1fr auto auto; gap: 14px; align-items: center; padding: 14px 22px; background: none; border: 0; color: inherit; text-align: start; cursor: pointer; }
.lesson-row:hover { background: var(--surface-2); }
.lesson-num { font-family: var(--font-latin); font-variant-numeric: tabular-nums; font-size: .82rem; color: var(--muted); }
.lesson-row .lt { font-weight: 600; line-height: 1.55; }
.lesson-row .lo { display: block; color: var(--muted); font-size: .84rem; font-weight: 400; margin-top: 2px; }
.lesson-row .min { color: var(--muted); font-size: .8rem; white-space: nowrap; }
.st-chip { font-size: .74rem; font-weight: 600; padding: 3px 10px; border-radius: 999px; white-space: nowrap; border: 1px solid var(--line); color: var(--muted); }
.st-chip.mastered { color: var(--ok); border-color: color-mix(in srgb, var(--ok) 40%, transparent); background: var(--ok-soft); }
.st-chip.learning { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
.st-chip.review { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 40%, transparent); }
.st-chip.current { color: var(--cta-ink); background: var(--cta); border-color: transparent; }
.lesson-detail { padding: 4px 22px 20px calc(22px + 58px); display: grid; grid-template-columns: 1fr 1fr; gap: 22px; background: var(--surface-2); border-top: 1px dashed var(--line); }
[dir='rtl'] .lesson-detail { padding: 4px calc(22px + 58px) 20px 22px; }
.lesson-detail h4 { margin: 14px 0 8px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.lesson-detail ul { margin: 0; padding-inline-start: 18px; display: grid; gap: 4px; font-size: .9rem; line-height: 1.7; }

/* phrase list: Spanish and its meaning, side by side, never mixed */
.phrases { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.phrase { display: grid; grid-template-columns: 1fr 1fr auto; gap: 14px; align-items: center; padding: 9px 12px; background: var(--surface); }
.phrase .es-block { font-size: .95rem; font-weight: 500; color: var(--ink); }
.phrase .gloss { font-size: .86rem; color: var(--muted); }
.phrase .icon-btn { width: 28px; height: 28px; }

/* ------------------------------------------------------------------ the classroom (3 columns) */
.cls { flex: 1; display: grid; grid-template-columns: 290px minmax(0, 1fr) 330px; align-items: start; min-height: calc(100dvh - 64px); }
.rail, .notebook { position: sticky; top: 64px; height: calc(100dvh - 64px); overflow-y: auto; background: var(--bg-tint); scrollbar-width: thin; }
.rail { border-inline-end: 1px solid var(--line); padding: 20px 14px 40px; }
.notebook { border-inline-start: 1px solid var(--line); padding: 0 0 40px; }
.cls-main { min-width: 0; padding: 22px clamp(16px, 3vw, 36px) 0; display: flex; flex-direction: column; gap: 18px; max-width: 980px; width: 100%; margin: 0 auto; }

/* rail: the course plan inside the room */
.rail-course { display: grid; gap: 10px; padding: 4px 8px 16px; border-bottom: 1px solid var(--line); margin-bottom: 12px; }
.rail-course a { color: var(--ink); }
.rail-course .title-ar { font-size: 1.02rem; }
.rail-progress { display: flex; align-items: center; gap: 10px; font-size: .8rem; color: var(--muted); }
.rail-progress .meter { flex: 1; }
.rail-unit { margin-top: 10px; }
.rail-unit-head { display: flex; align-items: center; gap: 8px; padding: 8px; font-size: .8rem; color: var(--muted); font-weight: 600; }
.rail-unit-head .num { font-family: var(--font-latin-display); font-style: italic; color: var(--accent); font-size: 1rem; }
.rail-unit-head .t { flex: 1; line-height: 1.5; }
.rail-lesson { width: 100%; display: grid; grid-template-columns: 20px 1fr; gap: 10px; align-items: start; padding: 8px; border-radius: var(--r); background: none; border: 0; color: var(--ink-2); text-align: start; cursor: pointer; font-size: .88rem; line-height: 1.55; }
.rail-lesson:hover { background: var(--surface-2); color: var(--ink); }
.rail-lesson.current { background: var(--accent-soft); color: var(--ink); box-shadow: inset 2px 0 0 var(--accent); }
[dir='rtl'] .rail-lesson.current { box-shadow: inset -2px 0 0 var(--accent); }
.rdot { width: 16px; height: 16px; margin-top: 3px; border-radius: 50%; border: 1.5px solid var(--line-strong); display: grid; place-items: center; }
.rail-lesson.st-learning .rdot { border-color: var(--accent); }
.rail-lesson.st-mastered .rdot, .rail-lesson.done .rdot { background: var(--ok); border-color: var(--ok); }
.rail-lesson.st-mastered .rdot::after, .rail-lesson.done .rdot::after { content: '✓'; color: #04241d; font-size: .58rem; font-weight: 800; }
.rail-lesson.st-review .rdot { border-color: var(--bad); }
.rail-lesson.current .rdot { border-color: var(--accent); background: var(--accent); }
.rail-lesson.current .rdot::after { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--accent-ink); }

/* lesson header */
.cls-head { display: grid; gap: 10px; }
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }
.crumbs .sep { opacity: .5; }
.cls-title { margin: 0; font-family: var(--font-display); font-weight: 700; font-size: clamp(1.5rem, 2.6vw, 2.05rem); line-height: 1.45; }
.objs { display: flex; flex-wrap: wrap; gap: 6px; }
.obj-chip { font-size: .8rem; color: var(--ink-2); border: 1px solid var(--line); border-radius: var(--r); padding: 4px 10px; background: var(--surface); line-height: 1.6; }

/* the lesson journey: its stages, labelled */
.lj { display: grid; grid-template-columns: 1fr 2.4fr 1.6fr 1fr 1fr; gap: 6px; }
.lj-step { display: grid; gap: 6px; min-width: 0; }
.lj-bar { height: 4px; border-radius: 2px; background: var(--surface-3); overflow: hidden; display: flex; gap: 2px; }
.lj-bar i { flex: 1; background: var(--surface-3); }
.lj-bar i.on { background: var(--accent); }
.lj-bar i.now { background: var(--accent-line); }
.lj-step span { font-size: .74rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lj-step.now span { color: var(--ink); font-weight: 600; }
.lj-step.done span { color: var(--ink-2); }
.lj-step .cnt { font-family: var(--font-latin); font-variant-numeric: tabular-nums; margin-inline-start: 4px; }

/* teacher strip */
.teacher { padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.teacher-label { font-size: .74rem; letter-spacing: .02em; }
.caption { font-size: 1.14rem; line-height: 1.95; font-weight: 400; }

/* board in Notes */
.board { border-radius: var(--r-lg); padding: 22px 24px 26px; min-height: 320px; }
.board-title { font-family: var(--font-display); font-weight: 700; font-size: 1.32rem; }
.pill { border-radius: 4px; height: 24px; font-size: .72rem; }
.pill[data-phase='teach'], .pill[data-phase='warmup'] { background: var(--accent-soft); color: var(--accent); }
.pill[data-phase='practice'] { background: var(--teal-soft); color: var(--teal); }
.pill[data-phase='transfer'] { background: var(--indigo-soft); color: var(--indigo); }

/* dock */
.dock { padding: 12px 0 18px; }
.composer { border-radius: var(--r-lg); }
.chip-btn { border-radius: var(--r); height: 30px; font-size: .8rem; }
.prompt { font-size: 1rem; }
.prompt .ico { color: var(--accent); }

/* notebook */
.nb-tabs { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(4, 1fr); background: var(--bg-tint); border-bottom: 1px solid var(--line); }
.nb-tabs button { background: none; border: 0; border-bottom: 2px solid transparent; color: var(--muted); padding: 14px 4px 12px; cursor: pointer; font-size: .82rem; font-weight: 600; }
.nb-tabs button.on { color: var(--ink); border-bottom-color: var(--accent); }
.nb { padding: 18px 18px 0; display: grid; gap: 20px; }
.nb h4 { margin: 0 0 10px; font-size: .76rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; }
.goal-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.goal-list li { display: grid; grid-template-columns: 18px 1fr; gap: 10px; font-size: .9rem; line-height: 1.75; color: var(--ink-2); }
.goal-list li::before { content: ''; width: 14px; height: 14px; margin-top: .45em; border-radius: 4px; border: 1.5px solid var(--line-strong); }
.goal-list li.met { color: var(--ink); }
.goal-list li.met::before { background: var(--ok); border-color: var(--ok); }
.nb .phrases .phrase { grid-template-columns: 1fr auto; }
.nb .phrases .phrase .gloss { grid-column: 1; }
.nb .phrases .phrase .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
.mini-stats { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; }
.mini-stats div { background: var(--surface); padding: 10px; display: grid; gap: 2px; text-align: center; }
.mini-stats strong { font-family: var(--font-latin); font-size: 1.15rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.mini-stats span { font-size: .72rem; color: var(--muted); }
.ev-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.ev-list li { display: flex; align-items: center; gap: 10px; font-size: .84rem; color: var(--ink-2); }
.ev-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--line-strong); }
.ev-dot.correct { background: var(--ok); } .ev-dot.partial { background: var(--accent); } .ev-dot.incorrect, .ev-dot.revealed { background: var(--bad); } .ev-dot.skipped { background: var(--muted); }
.transcript li { border-radius: var(--r); line-height: 1.75; }
.transcript .tx-learner { background: var(--accent-soft); }

/* drawers for small screens */
.drawer-btn { display: none; }
.drawer { position: fixed; top: 0; bottom: 0; z-index: 61; width: min(360px, 92vw); background: var(--bg-tint); border-inline: 1px solid var(--line); overflow-y: auto; animation: sheet-in .3s var(--ease); }
.drawer.start { inset-inline-start: 0; }
.drawer.end { inset-inline-end: 0; }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--bg-tint); z-index: 3; }
.drawer-head b { font-family: var(--font-display); }

.start-overlay { background: color-mix(in srgb, var(--bg) 92%, transparent); }
.start-card h2 { font-family: var(--font-display); font-weight: 700; }
.start-card .kicker { font-size: .8rem; color: var(--accent); font-weight: 600; }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1320px) {
  .cls { grid-template-columns: 270px minmax(0, 1fr); }
  .cls > .notebook { display: none; }
  .drawer-btn.nb-btn { display: inline-flex; }
}
@media (max-width: 980px) {
  .cls { grid-template-columns: minmax(0, 1fr); }
  .cls > .rail { display: none; }
  .drawer-btn { display: inline-flex; }
  .syl-hero { grid-template-columns: 1fr; }
  .course-row { grid-template-columns: 1fr; }
  .course-art { height: 120px; }
  .resume-card { grid-template-columns: auto 1fr; }
  .resume-card > .btn { grid-column: 1 / -1; }
  .lesson-detail { grid-template-columns: 1fr; }
}
@media (max-width: 720px) {
  .journey { grid-template-columns: 1fr; gap: 14px; }
  .stage-line { display: none; }
  .stage-track { display: none; }
  .stage { grid-template-columns: auto 1fr; display: grid; }
  .lj { grid-template-columns: repeat(5, 1fr); }
  .lj-step span { font-size: .66rem; }
  .lj-step .cnt { display: none; }
  .lesson-row { grid-template-columns: 30px 1fr auto; padding: 12px 14px; }
  .lesson-row .min { display: none; }
  .lesson-detail, [dir='rtl'] .lesson-detail { padding: 4px 14px 16px; }
  .unit-head { grid-template-columns: auto 1fr; padding: 16px; }
  .unit-side { grid-column: 1 / -1; justify-items: start; }
  .phrase { grid-template-columns: 1fr auto; }
  .phrase .gloss { grid-column: 1; }
  .phrase .icon-btn { grid-row: 1 / span 2; grid-column: 2; }
  .brand .brand-sub { display: none; }
  .cls-main { padding-top: 16px; }
}

/* In the classroom the input sits under the board; it never covers it. */
.cls .dock { position: static; background: none; padding-bottom: 28px; }
/* The place/time line above a dialogue is a small Latin caption, not a headline. */
.viz-dialogue > .concept-label { font-family: var(--font-latin); font-size: .82rem; font-weight: 600; letter-spacing: .04em; color: var(--muted); direction: ltr; text-align: left; margin: 0; }
/* A short Spanish phrase is one unit: it never splits across lines. */
bdi.es.nw { white-space: nowrap; }
@media (max-width: 720px) { .cls-head .objs { display: none; } }

/* =====================================================================
   The live board — the lesson happens here, in motion.
   ===================================================================== */
.cls-head { gap: 8px; }
.cls-title { font-size: clamp(1.25rem, 2vw, 1.6rem); }
.cls .board { min-height: max(460px, calc(100dvh - 64px - 150px - 170px)); padding: 20px 22px 0; gap: 12px; overflow: hidden; }
.cls .board-head { align-items: center; }

/* modes: explain (narration plays, exercise waits) · task (your turn) · both (explanatory visual builds up) */
.stage-explain { display: grid; transition: all .55s var(--ease); }
.stage-task { display: flex; flex-direction: column; gap: 14px; flex: 1; }
.board[data-mode='explain'] .stage-task { display: none; }
.board[data-mode='explain'] .stage-explain { flex: 1; align-content: center; }
.board[data-mode='task'] .stage-task { animation: task-in .6s var(--ease) both; }
@keyframes task-in { from { opacity: 0; transform: translateY(26px) scale(.985); filter: blur(4px); } }
.board[data-mode='task'] .xcards { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; }
.board[data-mode='task'] .xcard { padding: 10px 12px; min-height: 0; }
.board[data-mode='task'] .xes { font-size: 1.02rem; }
.board[data-mode='task'] .xsyl, .board[data-mode='task'] .xwave { display: none; }
.board[data-mode='task'] .xgloss { font-size: .78rem; }
.board[data-mode='task'] .klines { display: none; }

/* Spanish cards */
.xcards { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xcards.n1 { grid-template-columns: minmax(0, 560px); justify-content: center; }
.xcards.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.xcards.n4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.xcard { position: relative; display: grid; gap: 10px; justify-items: start; align-content: center; min-height: 128px; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(160deg, var(--surface-2), var(--surface)); color: var(--ink); cursor: pointer; text-align: start;
  opacity: 0; transform: translateY(18px) scale(.97); filter: blur(3px);
  transition: opacity .5s var(--ease), transform .55s var(--spring), filter .5s var(--ease), border-color .3s, box-shadow .3s; }
.xcard.in { opacity: 1; transform: none; filter: none; }
.xcard.on { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent), 0 18px 50px -20px color-mix(in srgb, var(--accent) 55%, transparent); transform: translateY(-3px) scale(1.02); }
.xcard:hover { border-color: var(--accent-line); }
.xnum { position: absolute; top: 10px; inset-inline-end: 12px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-family: var(--font-latin); font-size: .72rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); }
.xcard.on .xnum { background: var(--accent); color: var(--accent-ink); }
.xes { font-family: var(--font-latin-display); font-size: clamp(1.45rem, 2.4vw, 2.1rem); font-weight: 500; line-height: 1.25; direction: ltr; text-align: left; justify-self: stretch; unicode-bidi: isolate; }
.xsyl { display: flex; gap: 6px; direction: ltr; justify-self: stretch; }
.xsyl i { font-style: normal; font-family: var(--font-latin); font-size: .86rem; padding: 2px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); }
.xsyl i.st { background: var(--accent-soft); color: var(--accent); font-weight: 700; }
.xcard.on .xsyl i { animation: syl-beat .5s var(--spring) both; }
.xcard.on .xsyl i:nth-child(2) { animation-delay: .12s; } .xcard.on .xsyl i:nth-child(3) { animation-delay: .24s; } .xcard.on .xsyl i:nth-child(4) { animation-delay: .36s; } .xcard.on .xsyl i:nth-child(5) { animation-delay: .48s; } .xcard.on .xsyl i:nth-child(6) { animation-delay: .6s; }
.xcard.on .xsyl i.st { animation-name: syl-stress; }
@keyframes syl-beat { 40% { transform: translateY(-4px); } }
@keyframes syl-stress { 40% { transform: translateY(-6px) scale(1.18); background: var(--accent); color: var(--accent-ink); } }
.xgloss { font-family: var(--font); font-size: .95rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 8px; justify-self: stretch; direction: rtl; text-align: right; }
[dir='ltr'] .xgloss { direction: ltr; text-align: left; }
.xwave { position: absolute; bottom: 14px; inset-inline-end: 14px; display: none; gap: 3px; align-items: center; height: 18px; color: var(--accent); }
.xcard.on .xwave { display: inline-flex; }
.xwave i { width: 3px; border-radius: 3px; background: currentColor; animation: wave .9s ease-in-out infinite; }
.xwave i:nth-child(2) { animation-delay: .12s; } .xwave i:nth-child(3) { animation-delay: .24s; } .xwave i:nth-child(4) { animation-delay: .36s; } .xwave i:nth-child(5) { animation-delay: .48s; }

/* Kinetic lines: an Arabic explanation that builds on the board as it is spoken */
.klines { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; width: 100%; }
.kline { margin: 0; font-family: var(--font-display); font-size: clamp(1.15rem, 1.9vw, 1.5rem); line-height: 1.8; color: var(--muted); padding-inline-start: 18px; border-inline-start: 2px solid var(--line);
  opacity: 0; transform: translateX(-14px); filter: blur(2px); transition: opacity .55s var(--ease), transform .6s var(--ease), filter .5s, color .4s, border-color .4s; }
[dir='rtl'] .kline { transform: translateX(14px); }
.kline.in { opacity: 1; transform: none; filter: none; }
.kline.on { color: var(--ink); border-color: var(--accent); }

/* Subtitle bar: the teacher speaks Arabic here, one sentence at a time */
.subbar { position: sticky; bottom: 0; margin: 4px -22px 0; padding: 14px 22px 16px; display: flex; align-items: center; gap: 14px; border-top: 1px solid var(--line); background: color-mix(in srgb, var(--board) 88%, transparent); backdrop-filter: blur(8px); }
.subbar .orb { --s: 36px; }
.subbar-text { flex: 1; min-width: 0; display: grid; gap: 2px; }
.subbar .caption { margin: 0; min-height: 2.2em; font-size: 1.08rem; line-height: 1.85; }
.subtitle { margin: 0; }
.subtitle.in { animation: sub-in .35s var(--ease); }
@keyframes sub-in { from { opacity: 0; transform: translateY(6px); } }
.subtitle .sw { color: var(--muted); transition: color .15s; }
.subtitle .sw.said { color: var(--ink); }
.mk { display: inline-grid; place-items: center; min-width: 22px; height: 22px; margin: 0 3px; padding: 0 5px; border-radius: 999px; font-family: var(--font-latin); font-size: .74rem; font-weight: 700; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); vertical-align: 2px; transition: background .2s, color .2s; }
.mk.said { background: var(--accent); color: var(--accent-ink); }
.stage-skip { flex: none; }

@media (max-width: 720px) {
  .xcards, .xcards.n3, .xcards.n4 { grid-template-columns: 1fr; }
  .xcard { min-height: 96px; }
  .subbar { margin: 4px -16px 0; padding: 12px 16px; }
  .cls .board { padding: 16px 16px 0; min-height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  .xcard, .kline, .stage-task, .subtitle { transition: none !important; animation: none !important; opacity: 1 !important; transform: none !important; filter: none !important; }
}

/* ---------- review fixes ---------- */
/* exercise mode: the exercise owns the board; the explanation steps aside (a replay button brings it back) */
.board[data-mode='task'] .stage-explain { display: none; }
/* number badge sits on the Arabic side, never over the Spanish text */
.xnum { inset-inline-end: auto; inset-inline-start: 12px; }
.xcard { padding-top: 36px; }
/* subtitles stay on screen while the board is taller than the viewport (sticky needs no clipping container) */
.cls .board { overflow: clip; overflow-clip-margin: 0; }
.subbar { z-index: 3; }
.stage-replay { flex: none; }
/* home: the course row has its own actions */
.course-row { cursor: pointer; }
.row-actions { display: grid; gap: 8px; justify-items: stretch; }
/* welcome carries the Notes identity */
.welcome-brand { position: absolute; top: 22px; inset-inline-start: clamp(16px, 4vw, 40px); display: flex; align-items: center; gap: 12px; z-index: 2; }
.welcome-brand .brand-mark { width: 30px; height: 30px; border-radius: 7px; display: grid; place-items: center; background: var(--cta); color: var(--cta-ink); font-family: var(--font-display); font-weight: 700; }
.welcome-brand .title-ar { font-size: 1.1rem; }
.welcome-brand .brand-sub { font-family: var(--font-latin); font-size: .7rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); border-inline-start: 1px solid var(--line-strong); padding-inline-start: 12px; }
.start-btn[disabled] { opacity: .85; cursor: progress; }
@media (max-width: 980px) { .row-actions { grid-template-columns: 1fr 1fr; } }
@media (max-width: 720px) { .welcome-brand .brand-sub { display: none; } }
/* phone: the subtitle gets the full width; the explanation buttons take their own row */
@media (max-width: 720px) {
  .subbar { flex-wrap: wrap; }
  .subbar .subbar-text { flex: 1 1 calc(100% - 60px); }
  .stage-skip, .stage-replay { order: 3; flex: 1 1 100%; }
}

/* Latin-script interfaces (English, Spanish) use Notes' Latin typefaces; Arabic keeps its own. */
html[lang='en'], html[lang='es'] { --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif; --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif; }
html[lang='en'] .xgloss, html[lang='es'] .xgloss { font-family: var(--font); }

/* ---------- authored media: games, animations, simulations, video ---------- */
.viz-interactive, .viz-video { width: 100%; }
.ix { display: grid; gap: 8px; width: 100%; }
.ix-frame { width: 100%; border: 1px solid var(--line, rgba(0,0,0,.12)); border-radius: 14px; background: #F2EDE3; display: block; transition: height .3s var(--ease, ease); }
.ix-frame:fullscreen { border-radius: 0; height: 100% !important; }
.ix-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ix-title { font-weight: 600; flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ix-status { min-width: 1.2em; font-weight: 700; color: var(--teal, #2DD4BF); }
.ix-btn { min-width: 38px; min-height: 38px; padding: 4px 10px; font-size: 1.05rem; }
.vid-fig { margin: 0; display: grid; gap: 6px; }
.vid { width: 100%; max-height: 70vh; border-radius: 14px; background: #000; }
@media (max-width: 640px) { .ix-frame { max-height: 70vh; } }

/* ======================= Bayan brand ======================= */
/* Logo: ink mark on paper, paper mark on the night theme. */
.bayan-logo { display: inline-flex; align-items: center; flex: none; }
.bayan-logo img { height: 34px; width: auto; display: block; }
.bayan-logo .on-light { display: none; }
html[data-theme='light'] .bayan-logo .on-light { display: block; }
html[data-theme='light'] .bayan-logo .on-dark { display: none; }
.brand .bayan-logo img { height: 34px; }
.bayan-logo.lg img { height: 76px; filter: drop-shadow(0 10px 24px rgba(121, 126, 246, .18)); }
.welcome-brand { display: flex; align-items: center; gap: 14px; }
.welcome-brand .wb-text { display: grid; gap: 4px; }
.welcome-brand .title-ar { font-size: 1.35rem; font-weight: 700; }
.welcome-brand .brand-sub { border: 0; padding: 0; }

/* Teacher presence: the Bayan seal (mark on a paper disc). Motion is slow and follows real states only. */
.orb .core { background: #F7F3EB !important; display: grid; place-items: center; overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 8px 26px -10px rgba(234, 191, 75, .55) !important; }
.orb .core::after { display: none; }
.orb .core img { width: 58%; height: auto; transform: translateY(2%); pointer-events: none; user-select: none; }
.orb .arc { position: absolute; inset: -3px; border-radius: 50%; border: 2px solid transparent; opacity: 0; transition: opacity .3s; }
.orb[data-state='thinking'] .arc { opacity: 1; border-top-color: #797EF6; border-right-color: rgba(121,126,246,.35); animation: seal-spin 1.1s linear infinite; }
.orb[data-state='thinking'] .core { animation: orb-breathe 2.4s ease-in-out infinite !important; box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 8px 26px -8px rgba(121, 126, 246, .6) !important; }
.orb[data-state='speaking'] .core { animation: seal-talk calc(.5s) ease-in-out infinite alternate !important; }
.orb[data-state='speaking'] .halo { border-color: #EABF4B; }
.orb[data-state='listening'] .halo { border-color: #2DD4BF !important; }
.orb[data-state='listening'] .core { transform: scale(calc(1 + var(--lvl, 0) * .12)); box-shadow: inset 0 0 0 1px rgba(0,0,0,.06), 0 0 0 calc(var(--lvl, 0) * 14px) rgba(45, 212, 191, .22) !important; transition: transform .08s, box-shadow .08s; }
.orb[data-state='live'] .halo { border-color: #2DD4BF; }
@keyframes seal-spin { to { transform: rotate(360deg); } }
@keyframes seal-talk { from { transform: scale(1); } to { transform: scale(1.045); } }
.boot .orb .core { animation: orb-breathe 2.4s ease-in-out infinite; }

/* Bayan shape language: small rotated diamonds as markers. */
.section-label::before, .start-card .kicker::before, .block-head h2::before {
  content: ''; display: inline-block; width: 7px; height: 7px; transform: rotate(45deg) translateY(-2px);
  background: #EABF4B; margin-inline-end: 9px; border-radius: 1px; }
.eyebrow::before { border-radius: 1px; transform: rotate(45deg); background: #EABF4B; }
.bayan-sign { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .78rem; }
.bayan-sign img { height: 18px; opacity: .85; }

/* ======================= learner tools ======================= */
.tools-host { display: flex; justify-content: center; }
.toolbar { display: inline-flex; align-items: center; gap: 4px; padding: 5px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-sm); flex-wrap: wrap; justify-content: center; }
.tool-btn { width: 40px; height: 40px; display: grid; place-items: center; border-radius: 10px; border: 0; background: transparent; color: var(--ink-2); cursor: pointer; transition: background .2s, color .2s, transform .1s; }
.tool-btn:hover { background: var(--surface-3); color: var(--ink); }
.tool-btn:active { transform: scale(.94); }
.tool-btn.on { background: var(--indigo-soft); color: var(--indigo); box-shadow: inset 0 0 0 1.5px var(--indigo); }
.tool-sep { width: 1px; height: 24px; background: var(--line-strong); margin: 0 4px; }
.toolbar .ann-only { display: none; }
.toolbar.drawing .ann-only { display: grid; }
/* drawing over the board */
.board.has-annot { position: relative; }
.annot { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 6; border-radius: inherit; }
.board.annotating { box-shadow: 0 0 0 2px var(--indigo), var(--shadow); cursor: crosshair; }
.board.annotating .annot { cursor: crosshair; }

/* floating panels (calculator, notes) */
.float-panel { position: fixed; z-index: 1000; inset-inline-end: 20px; top: 76px; width: min(340px, calc(100vw - 24px)); background: var(--surface); color: var(--ink); border: 1px solid var(--line-strong); border-radius: 16px; box-shadow: var(--shadow-lg); display: grid; animation: fp-in .25s var(--ease); }
.float-panel.fp-notes { width: min(380px, calc(100vw - 24px)); top: 116px; inset-inline-end: 48px; }
@keyframes fp-in { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.fp-head { display: flex; align-items: center; justify-content: space-between; padding: 10px 12px 8px 14px; border-bottom: 1px solid var(--line); cursor: grab; user-select: none; touch-action: none; }
.fp-head b::before { content: ''; display: inline-block; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold); margin-inline-end: 8px; border-radius: 1px; }
.calc { display: grid; gap: 8px; padding: 12px; }
.calc-in { font: 600 1.05rem var(--font-latin); background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; width: 100%; text-align: left; }
.calc-out { font: 700 1.5rem var(--font-latin); text-align: right; min-height: 1.6em; color: var(--indigo); font-variant-numeric: tabular-nums; }
.calc-out.err { color: var(--bad); font-size: 1rem; }
.calc-pad { display: grid; grid-template-columns: repeat(6, 1fr); gap: 5px; }
.ck { font: 600 .92rem var(--font-latin); border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); border-radius: 9px; min-height: 38px; cursor: pointer; padding: 0 2px; }
.ck:hover { background: var(--surface-3); }
.ck.num { background: var(--surface-3); }
.ck.fn { font-size: .74rem; color: var(--indigo); }
.ck.eq { grid-column: span 6; background: var(--cta); color: var(--cta-ink); border: 0; font-size: 1.1rem; }
.calc-hist { list-style: none; margin: 0; padding: 0; max-height: 110px; overflow: auto; display: grid; gap: 2px; direction: ltr; }
.calc-hist li { display: flex; justify-content: space-between; gap: 10px; font: .82rem var(--font-latin); color: var(--muted); padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.calc-hist li:hover { background: var(--surface-2); }
.calc-hist b { color: var(--ink); }
.notes { display: grid; gap: 8px; padding: 12px; }
.notes-ta { min-height: 220px; resize: vertical; font: 1rem/1.8 var(--font); background: var(--surface-2); color: var(--ink); border: 1px solid var(--line); border-radius: 10px; padding: 12px; }
.notes-foot { display: flex; justify-content: space-between; align-items: center; }

/* whiteboard */
.wb-scrim { z-index: 1090; }
.wb { position: fixed; z-index: 1100; inset: 3vh 3vw; display: grid; grid-template-rows: auto 1fr auto; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 18px; box-shadow: var(--shadow-lg); overflow: hidden; animation: fp-in .25s var(--ease); }
.wb-top { display: flex; align-items: center; gap: 10px; padding: 8px 10px 8px 14px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.wb-top > b { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.wb-tools { display: flex; align-items: center; gap: 3px; flex: 1; flex-wrap: wrap; justify-content: center; }
.wb-colors { display: flex; gap: 5px; padding: 0 4px; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--surface); background: var(--c); box-shadow: 0 0 0 1px var(--line-strong); cursor: pointer; }
.swatch.on { box-shadow: 0 0 0 2px var(--indigo); transform: scale(1.12); }
.wb-size { width: 84px; accent-color: var(--indigo); }
.wb-bg { width: auto !important; flex: none; padding: 6px 10px; min-height: 36px; }
.wb-stage { position: relative; background: #e9e4d8; padding: 12px; min-height: 0; }
.wb-canvas { width: 100%; height: 100%; display: block; border-radius: 10px; background: #fffdf8; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: crosshair; }
.wb-text-in { position: absolute; transform: translate(12px, 0); margin-top: -1em; font: 600 18px var(--font); padding: 4px 8px; border: 1.5px dashed #797EF6; background: #fff; color: #111; border-radius: 6px; min-width: 160px; z-index: 2; }
.wb-foot { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line); flex-wrap: wrap; }
.wb-foot small { flex: 1 1 220px; }
.wb-caption { flex: 1 1 220px; min-height: 40px; }
html[data-theme='light'] .wb-stage { background: #e7e0d1; }
@media (max-width: 640px) {
  .wb { inset: 0; border-radius: 0; }
  .wb-top > b { display: none; }
  .tool-btn { width: 36px; height: 36px; }
  .float-panel, .float-panel.fp-notes { inset-inline-end: 12px; top: auto; bottom: 12px; max-height: 70vh; overflow: auto; }
}

/* voice: settings and live conversation */
.voice-settings { display: grid; gap: 16px; min-width: min(420px, 80vw); }
.voice-settings .field { display: grid; gap: 6px; }
.v-range { width: 100%; accent-color: var(--indigo); }
.live-btn.on { background: var(--teal-soft); color: var(--teal); box-shadow: inset 0 0 0 1.5px var(--teal); }
.live-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.live-bar { background: var(--teal-soft) !important; color: var(--teal) !important; }
.live-bar .wave i { background: var(--teal); }
.course-art .bayan-logo.art { position: absolute; inset: 0; display: grid; place-items: center; }
.course-art .bayan-logo.art img { height: 62%; opacity: .95; }
.course-art .bayan-logo .on-dark { display: block !important; } .course-art .bayan-logo .on-light { display: none !important; }

/* review fixes */
.key-points { margin: 0; padding-inline-start: 18px; display: grid; gap: 8px; color: var(--ink-2); font-size: .92rem; line-height: 1.75; }
.key-points li::marker { color: var(--gold); }
.start-card { background: var(--surface); border: 1px solid var(--line-strong); border-radius: 22px; box-shadow: var(--shadow-lg); max-width: min(520px, 92vw); }
.welcome-card .bayan-logo { justify-self: center; margin-bottom: 4px; }
.status-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
@media (max-width: 560px) {
  .start-overlay { background: var(--bg); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .topbar-end { gap: 0; }
  .topbar-end .btn-icon, .topbar-end .drawer-btn, .topbar-end .live-btn { min-width: 36px; width: 36px; padding: 0; justify-content: center; }
  .app:has(.cls) .theme-btn { display: none; }
  .topbar .status-chips .schip { display: none; }
}
/* phones: the brand lockup sits above the hero instead of floating over it */
@media (max-width: 640px) {
  .welcome-brand { position: static; justify-content: center; margin: 4px auto 8px; gap: 10px; }
  .welcome-brand .bayan-logo.lg img { height: 46px; }
  .welcome-brand .title-ar { font-size: 1.1rem; }
  .hero .orb { --s: 84px; }
}
.acct { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 10px 14px; border-radius: 12px; background: var(--teal-soft); color: var(--teal); font-size: .9rem; }
.acct.guest { background: var(--accent-soft); color: var(--ink-2); justify-content: space-between; }
.board.loading .board-canvas, .board.loading .stage-explain { min-height: 220px; border-radius: 12px; background: linear-gradient(90deg, var(--surface-2) 0%, var(--surface-3) 50%, var(--surface-2) 100%); background-size: 200% 100%; animation: bayan-skel 1.4s ease-in-out infinite; }
@keyframes bayan-skel { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }
.lj-step .cnt { margin-inline-start: 4px; }

/* adaptive teaching */
.pill[data-phase='adapt-reteach'] { background: var(--indigo-soft); color: var(--indigo); box-shadow: inset 0 0 0 1px var(--indigo); }
.pill[data-phase='adapt-transfer'] { background: var(--teal-soft); color: var(--teal); box-shadow: inset 0 0 0 1px var(--teal); }
.iv-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.iv-list li { display: grid; gap: 4px; padding: 10px 12px; border-radius: 10px; background: var(--surface-2); border-inline-start: 3px solid var(--muted); font-size: .86rem; }
.iv-list .iv-r { font-weight: 600; font-size: .8rem; }
.iv-list .iv-transferred { border-color: var(--teal); } .iv-list .iv-transferred .iv-r { color: var(--teal); }
.iv-list .iv-not_yet { border-color: var(--bad); } .iv-list .iv-not_yet .iv-r { color: var(--bad); }
.iv-list .iv-pending { border-color: var(--indigo); } .iv-list .iv-pending .iv-r { color: var(--indigo); }
.iv-admin { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.iv-admin .iv-transferred { color: var(--teal); } .iv-admin .iv-not_yet { color: var(--bad); }

/* ======================= phone & app: spacing, type, stability ======================= */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { overscroll-behavior-y: none; -webkit-tap-highlight-color: transparent; }
.app { overflow-x: clip; }
/* nothing may push the page wider than the screen */
main, section, article, aside, .card, .syl-hero > *, .resume-card > *, .cls-main, .board, .dock { min-width: 0; }
.btn-lg { white-space: normal; text-align: center; line-height: 1.35; height: auto; min-height: 52px; padding-block: 10px; }
.btn-lg > span:not(.ico) { overflow-wrap: anywhere; }
.lvl-badge, .course-art .lvl { font-size: .75rem; }

@media (max-width: 640px) {
  /* header: safe areas and finger-sized targets */
  .topbar { padding-top: env(safe-area-inset-top); height: calc(56px + env(safe-area-inset-top)); }
  .brand { min-height: 44px; min-width: 44px; justify-content: center; }
  .avatar-btn, .topbar-end .btn-icon, .topbar-end .drawer-btn, .topbar-end .live-btn, .topbar-mid .btn { min-width: 40px; min-height: 40px; }
  .avatar-btn { width: 40px; height: 40px; }

  /* type scale for phones */
  .greet h1, .syl-hero h1 { font-size: clamp(1.6rem, 7vw, 2.1rem); line-height: 1.25; }
  .lead { font-size: 1rem; line-height: 1.75; }
  .block-head h2 { font-size: 1.3rem; }

  /* home: continue-learning card stacks */
  .resume-card { grid-template-columns: auto 1fr; gap: 14px 16px; padding: 18px; }
  .resume-card > :last-child { grid-column: 1 / -1; width: 100%; }
  .resume-card h2 { font-size: 1.2rem; line-height: 1.35; }
  .resume-card > svg:first-child { width: 58px; height: 58px; }

  /* classroom: tighter board, calmer explanation, a subtitle bar that never hides the board */
  .board { padding: 14px 14px 16px; border-radius: 14px; }
  .kline { font-size: 1.02rem; line-height: 1.7; padding-inline-start: 12px; }
  .klines { gap: 8px; }
  .subbar { margin: 4px -14px 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); gap: 10px; }
  .subbar .caption { font-size: .98rem; line-height: 1.65; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .board-title { font-size: 1.15rem; }
  .cls-title { font-size: 1.25rem; line-height: 1.35; }
  .prompt { font-size: 1rem; }

  /* answer box: one clean line of hint text */
  .composer textarea { font-size: 16px; } /* 16px stops phones from zooming into the field */
  .composer textarea::placeholder { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

  /* quick actions: labelled, finger-sized, one scrollable row */
  .quick { flex-wrap: nowrap; justify-content: flex-start; overflow-x: auto; scrollbar-width: none; padding: 2px 2px 6px; margin-inline: -4px; scroll-snap-type: x proximity; }
  .quick::-webkit-scrollbar { display: none; }
  .chip-btn { width: auto; height: 40px; flex: none; padding: 0 14px; gap: 6px; font-size: .86rem; scroll-snap-align: start; }
  .chip-btn > span:not(.ico) { display: inline !important; }
  .tool-btn { width: 42px; height: 42px; }
  .dock { gap: 10px; padding-bottom: env(safe-area-inset-bottom); }

  /* drawers and dialogs fit the phone */
  .drawer { width: min(92vw, 380px); }
  .modal-card { max-height: 86vh; overflow: auto; }
  .ix-frame { max-height: 64vh; }
}
@media (max-width: 380px) {
  .topbar-end .theme-btn { display: none; }
}
/* course cards never exceed the screen, even with large system text */
.course-row { min-width: 0; max-width: 100%; }
.course-row > * { min-width: 0; }
.row-actions { flex-wrap: wrap; }
@media (max-width: 640px) {
  .row-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; width: 100%; }
  .row-actions .btn { width: 100%; justify-content: center; white-space: normal; min-height: 44px; height: auto; }
  .course-row h3 { overflow-wrap: anywhere; }
}

/* ======================= my learning profile (/me) ======================= */
.me-page { max-width: 1080px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 64px; display: grid; gap: 22px; }
.me-hero { display: grid; grid-template-columns: auto 1fr auto; gap: 22px; align-items: center; padding: 26px; border: 1px solid var(--line); border-radius: var(--r-xl); background: linear-gradient(135deg, var(--surface) 0%, var(--surface-2) 100%); position: relative; overflow: hidden; }
.me-hero::after { content: ''; position: absolute; inset-inline-end: -60px; top: -60px; width: 220px; height: 220px; border-radius: 50%; background: radial-gradient(closest-side, var(--gold-soft), transparent); pointer-events: none; }
.me-avatar { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: #F7F3EB; color: #111; font: 700 2.1rem var(--font-display); box-shadow: 0 0 0 4px var(--surface), 0 0 0 6px var(--gold), 0 12px 32px -14px rgba(234, 191, 75, .6); }
.me-id { display: grid; gap: 8px; min-width: 0; }
.me-id h1 { margin: 0; font-family: var(--font-display); font-size: clamp(1.6rem, 3vw, 2.2rem); line-height: 1.25; }
.me-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.me-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); font-size: .82rem; color: var(--ink-2); }
.me-tag.ok { color: var(--teal); border-color: color-mix(in srgb, var(--teal) 40%, transparent); background: var(--teal-soft); }
.me-goal { margin: 0; color: var(--ink-2); line-height: 1.7; }
.me-edit { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.me-guest { margin: 0; }
.me-stats { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; }
.me-stat { display: grid; gap: 4px; padding: 16px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.me-stat-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); margin-bottom: 4px; }
.me-stat b { font: 700 1.7rem var(--font-latin); line-height: 1.1; }
.me-stat span:last-child { font-size: .82rem; color: var(--muted); }
.me-stat:nth-child(2) .me-stat-ico, .me-stat:nth-child(3) .me-stat-ico { background: var(--teal-soft); color: var(--teal); }
.me-stat:nth-child(6) .me-stat-ico { background: var(--gold-soft); color: var(--gold); }
.me-block { display: grid; gap: 14px; }
.me-block.card { padding: 20px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); }
.me-h { margin: 0; font-size: 1.05rem; font-weight: 700; display: flex; align-items: center; gap: 9px; }
.me-h::before { content: ''; width: 7px; height: 7px; transform: rotate(45deg); background: var(--gold); border-radius: 1px; }
.me-courses { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; }
.me-course { display: grid; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface); min-width: 0; }
.me-course-top { display: flex; gap: 14px; align-items: center; min-width: 0; }
.me-course-top svg { width: 54px; height: 54px; flex: none; }
.me-course-text { min-width: 0; }
.me-course h3 { margin: 0 0 4px; font-size: 1rem; line-height: 1.45; }
.me-course p { margin: 0; font-size: .84rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.me-course-foot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }
.me-course-foot .btn { margin-inline-start: auto; }
.me-two { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; }
.me-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.me-list li { display: flex; gap: 10px; align-items: flex-start; line-height: 1.6; font-size: .92rem; }
.me-list.good .ico { color: var(--teal); margin-top: 3px; }
.me-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--gold); flex: none; margin-top: 9px; }
.me-empty { padding: 18px; border: 1px dashed var(--line-strong); border-radius: var(--r); text-align: center; color: var(--muted); display: grid; gap: 10px; justify-items: center; }
.me-empty p { margin: 0; }
.me-history { list-style: none; margin: 0; padding: 0; display: grid; }
.me-history li { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.me-history li:last-child { border-bottom: 0; }
.me-history b { display: block; font-size: .93rem; }
.me-history small { font-size: .8rem; }
.me-badge { font-size: .74rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; background: var(--surface-3); color: var(--ink-2); white-space: nowrap; }
.me-badge.st-mastered { background: var(--teal-soft); color: var(--teal); }
.me-badge.st-review { background: var(--bad-soft); color: var(--bad); }
.me-badge.st-learning { background: var(--indigo-soft); color: var(--indigo); }
.me-set { display: grid; grid-template-columns: 160px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.me-set:last-child { border-bottom: 0; }
.me-set-l { font-weight: 600; }
.me-set-v { color: var(--muted); font-size: .9rem; }
.me-seg button { min-width: 40px; }
.me-out { grid-template-columns: 1fr; justify-items: start; }
@media (max-width: 900px) { .me-stats { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 640px) {
  .me-page { padding: 18px 14px 48px; gap: 16px; }
  .me-hero { grid-template-columns: auto 1fr; padding: 18px; gap: 14px; }
  .me-hero > .btn { grid-column: 1 / -1; width: 100%; justify-content: center; }
  .me-avatar { width: 64px; height: 64px; font-size: 1.6rem; }
  .me-stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .me-stat { padding: 14px; }
  .me-stat b { font-size: 1.45rem; }
  .me-two { grid-template-columns: 1fr; gap: 16px; }
  .me-courses { grid-template-columns: 1fr; }
  .me-set { grid-template-columns: 1fr auto; }
  .me-set-v { grid-column: 1 / -1; grid-row: 2; }
}
.me-page { width: min(1080px, 100%); max-width: none; box-sizing: border-box; }
.me-seg { display: inline-flex; gap: 4px; padding: 3px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); }
.me-seg button { border: 0; background: transparent; color: var(--ink-2); border-radius: 999px; min-height: 34px; padding: 0 12px; font-weight: 600; cursor: pointer; }
.me-seg button.on { background: var(--cta); color: var(--cta-ink); }
/* admin announcement shown to learners */
.ann-bar { display: flex; align-items: center; gap: 12px; justify-content: space-between; padding: 12px 16px; border-radius: 12px; margin-bottom: 18px; font-weight: 500; line-height: 1.6; }
.ann-info { background: var(--indigo-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--indigo); }
.ann-success { background: var(--teal-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--teal); }
.ann-warning { background: var(--gold-soft); color: var(--ink); box-shadow: inset 3px 0 0 var(--gold); }
[dir='rtl'] .ann-bar { box-shadow: none; border-inline-start: 3px solid currentColor; }
[dir='rtl'] .ann-info { border-color: var(--indigo); } [dir='rtl'] .ann-success { border-color: var(--teal); } [dir='rtl'] .ann-warning { border-color: var(--gold); }
.cls-main > .ann-bar, main.cls-main .ann-bar { margin: 0 0 12px; }

/* language switcher in every header */
.lang-menu { position: relative; }
.lang-menu > summary { list-style: none; display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 40px; padding: 0 10px; }
.lang-menu > summary::-webkit-details-marker { display: none; }
.lang-code { font: 700 .8rem var(--font-latin); letter-spacing: .04em; }
.lang-pop { position: absolute; top: calc(100% + 6px); inset-inline-end: 0; z-index: 60; min-width: 170px; display: grid; padding: 6px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line-strong); box-shadow: var(--shadow-lg); }
.lang-pop button { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; cursor: pointer; text-align: start; min-height: 42px; }
.lang-pop button:hover { background: var(--surface-3); }
.lang-pop button.on { color: var(--accent); font-weight: 700; }
.lang-pop button[lang='en'], .lang-pop button[lang='es'] { font-family: var(--font-latin); }
@media (max-width: 420px) { .app:has(.cls) .topbar .lang-menu { display: none; } }

/* ======================= practice arena ======================= */
.pr-nav.on { color: var(--accent); }
.pr-promo { display: flex; align-items: center; gap: 16px; width: 100%; padding: 18px 20px; border-radius: var(--r-lg); border: 1px solid var(--line); background: linear-gradient(110deg, var(--indigo-soft), var(--teal-soft)); color: var(--ink); font: inherit; text-align: start; cursor: pointer; transition: transform .15s, border-color .2s; }
.pr-promo:hover { border-color: var(--line-strong); transform: translateY(-1px); }
.pr-promo-ico { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--surface); color: var(--indigo); flex: none; }
.pr-promo-text { flex: 1; display: grid; gap: 3px; }
.pr-promo-text b { font-size: 1.08rem; } .pr-promo-text small { color: var(--ink-2); line-height: 1.6; }
.pr-page { width: min(1080px, 100%); margin: 0 auto; padding: 30px clamp(16px, 4vw, 40px) 64px; display: grid; gap: 22px; box-sizing: border-box; }
.pr-hero { display: grid; grid-template-columns: 1fr minmax(260px, 340px); gap: 24px; align-items: center; }
.pr-hero h1 { margin: 6px 0; font-family: var(--font-display); font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
.pr-hero .lead { margin: 0; color: var(--ink-2); line-height: 1.8; }
.pr-level { display: flex; gap: 16px; align-items: center; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.pr-level > div:last-child { flex: 1; display: grid; gap: 6px; }
.pr-level-ring { --p: 0; width: 76px; height: 76px; border-radius: 50%; flex: none; display: grid; place-content: center; text-align: center; background: radial-gradient(closest-side, var(--surface) 76%, transparent 78%), conic-gradient(var(--gold) calc(var(--p) * 1%), var(--surface-3) 0); }
.pr-level-ring b { font: 700 1.6rem var(--font-latin); line-height: 1; } .pr-level-ring small { font-size: .7rem; color: var(--muted); }
.pr-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.pr-stat { display: grid; gap: 4px; padding: 14px 16px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.pr-stat-ico { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; background: var(--indigo-soft); color: var(--indigo); }
.pr-stat.gold .pr-stat-ico { background: var(--gold-soft); color: var(--gold); } .pr-stat.teal .pr-stat-ico { background: var(--teal-soft); color: var(--teal); }
.pr-stat b { font: 700 1.5rem var(--font-latin); } .pr-stat span:last-child { font-size: .82rem; color: var(--muted); }
.pr-daily { display: flex; align-items: center; gap: 16px; padding: 18px 20px; border-radius: var(--r-lg); background: linear-gradient(110deg, var(--gold-soft), transparent 70%), var(--surface); border: 1px solid color-mix(in srgb, var(--gold) 45%, transparent); }
.pr-daily.done { opacity: .8; }
.pr-daily-badge { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: #111; flex: none; }
.pr-daily-text { flex: 1; min-width: 0; } .pr-daily-text p { margin: 4px 0 0; line-height: 1.7; }
.pr-chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-3); color: var(--ink-2); }
.pr-chip.ok { background: var(--teal-soft); color: var(--teal); }
.pr-block { display: grid; gap: 14px; }
.pr-packs { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pr-pack { --c: var(--indigo); display: grid; gap: 10px; align-content: start; padding: 18px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); border-top: 3px solid var(--c); transition: transform .15s, border-color .2s; }
.pr-pack:hover { transform: translateY(-2px); border-color: var(--line-strong); border-top-color: var(--c); }
.pr-pack.c-teal, .pr-run.c-teal { --c: var(--teal); } .pr-pack.c-gold, .pr-run.c-gold { --c: var(--gold); } .pr-run { --c: var(--indigo); }
.pr-pack h3 { margin: 0; font-size: 1.08rem; } .pr-pack p { margin: 0; font-size: .88rem; line-height: 1.7; }
.pr-pack-top, .pr-pack-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.pr-pack-foot { margin-top: 4px; font-size: .82rem; }
.pr-stars { letter-spacing: 2px; } .pr-stars i { font-style: normal; color: var(--surface-3); } .pr-stars i.on { color: var(--gold); }
.pr-games { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.pr-game { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-lg); border: 1px solid var(--line); background: var(--surface); }
.pr-game-art { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; background: var(--teal-soft); color: var(--teal); flex: none; }
.pr-game-body { flex: 1; min-width: 0; display: grid; gap: 3px; } .pr-game-body h3 { margin: 0; font-size: .95rem; }
.pr-player { position: fixed; inset: 0; z-index: 1200; display: grid; grid-template-rows: auto 1fr; background: var(--bg); }
.pr-player-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 16px; padding-top: calc(10px + env(safe-area-inset-top)); border-bottom: 1px solid var(--line); }
.pr-player-stage { overflow: hidden; padding: 12px; display: flex; min-height: 0; }
.pr-game-frame { width: 100%; height: 100%; flex: 1; border: 0; border-radius: 14px; background: #F2EDE3; display: block; }
.pr-run { width: min(760px, 100%); margin: 0 auto; min-height: 100vh; min-height: 100dvh; display: grid; grid-template-rows: auto 1fr auto; box-sizing: border-box; }
.pr-run-top { display: flex; align-items: center; gap: 14px; padding: 14px 16px; padding-top: calc(14px + env(safe-area-inset-top)); }
.pr-segs { flex: 1; display: flex; gap: 5px; }
.pr-segs i { flex: 1; height: 8px; border-radius: 99px; background: var(--surface-3); transition: background .3s; }
.pr-segs i.done { background: var(--c); } .pr-segs i.now { background: color-mix(in srgb, var(--c) 45%, var(--surface-3)); }
.pr-stage { padding: 8px 16px 24px; overflow: auto; }
.pr-card { display: grid; gap: 18px; }
.pr-in { animation: pr-in .35s var(--ease) both; }
@keyframes pr-in { from { opacity: 0; transform: translateY(14px); } }
.pr-prompt { margin: 6px 0 0; font-size: 1.28rem; line-height: 1.75; font-weight: 600; }
.pr-visual { padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pr-svg { width: 100%; height: auto; display: block; direction: ltr; overflow: visible; }
.pr-svg .pr-grid { stroke: var(--line); } .pr-svg .pr-axis { font: 11px var(--font-latin); fill: var(--muted); } .pr-svg .pr-axis.warn { fill: var(--bad); font-weight: 700; }
.pr-svg .pr-axisline { stroke: var(--ink-2); stroke-width: 1.4; }
.pr-bar rect { fill: var(--c, var(--indigo)); opacity: .85; transition: opacity .2s, fill .2s; }
.pr-bar .pr-val { font: 600 12px var(--font-latin); fill: var(--ink); } .pr-bar .pr-lbl { font: 12px var(--font); fill: var(--ink-2); }
.pr-bar.tappable { cursor: pointer; } .pr-bar.tappable:hover rect { opacity: 1; }
.pr-bar.sel rect { fill: var(--gold); opacity: 1; } .pr-bar.good rect { fill: var(--teal); opacity: 1; } .pr-bar.bad rect { fill: var(--bad); opacity: 1; }
.pr-dot { fill: var(--indigo); animation: pr-pop .4s var(--spring) both; transform-box: fill-box; transform-origin: center; } .pr-dot.hl { fill: var(--gold); }
@keyframes pr-pop { from { transform: scale(0); } }
.pr-formula { font: 600 1.25rem var(--font-latin); text-align: center; padding: 6px; }
.pr-grid-model { display: grid; gap: 4px; max-width: 320px; margin: 0 auto; }
.pr-grid-model i { aspect-ratio: 1; border-radius: 4px; background: var(--surface-3); animation: pr-in .3s both; } .pr-grid-model i.on { background: var(--c, var(--teal)); }
.pr-emoji { font-size: 2rem; text-align: center; letter-spacing: 8px; }
.pr-opts { display: grid; gap: 10px; }
.pr-opt { text-align: start; padding: 14px 16px; min-height: 54px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); font: inherit; font-size: 1.02rem; line-height: 1.6; cursor: pointer; transition: border-color .15s, background .15s, transform .1s; }
.pr-opt:hover:not(:disabled) { border-color: var(--line-strong); } .pr-opt:active:not(:disabled) { transform: scale(.99); }
.pr-opt.sel { border-color: var(--c); background: color-mix(in srgb, var(--c) 10%, var(--surface)); }
.pr-opt.good { border-color: var(--teal); background: var(--teal-soft); } .pr-opt.bad { border-color: var(--bad); background: var(--bad-soft); }
.pr-slide { display: grid; gap: 10px; padding: 18px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.pr-slide-val { justify-self: center; font: 700 2rem var(--font-latin); color: var(--c); } .pr-slide-val.good { color: var(--teal); } .pr-slide-val.bad { color: var(--bad); }
.pr-slider { width: 100%; accent-color: var(--c); height: 32px; }
.pr-slide-ends { display: flex; justify-content: space-between; font-size: .8rem; color: var(--muted); }
.pr-slide-truth { text-align: center; color: var(--teal); font-weight: 600; }
.pr-numwrap { display: flex; align-items: center; gap: 10px; }
.pr-num { font: 700 1.5rem var(--font-latin); text-align: center; max-width: 260px; min-height: 58px; }
.pr-num.good { border-color: var(--teal); } .pr-num.bad { border-color: var(--bad); }
.pr-order { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.pr-order.good .pr-tile { border-color: var(--teal); } .pr-order.bad .pr-tile { border-color: var(--bad); }
.pr-order-label { margin: 0; font-size: .88rem; }
.pr-tile { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); }
.pr-tile-n { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: .85rem; flex: none; }
.pr-tile-t { flex: 1; } .pr-tile-btns { display: flex; gap: 4px; } .pr-tile-btns .icon-btn { width: 40px; height: 40px; }
.pr-actionbar { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 16px; padding-bottom: calc(14px + env(safe-area-inset-bottom)); background: var(--bg); border-top: 1px solid var(--line); flex-wrap: wrap; }
.pr-actionbar .pr-check { flex: 1; }
.pr-actionbar.good { background: color-mix(in srgb, var(--teal) 14%, var(--bg)); border-top-color: var(--teal); }
.pr-actionbar.bad { background: color-mix(in srgb, var(--bad) 12%, var(--bg)); border-top-color: var(--bad); }
.pr-feedback { flex: 1 1 280px; display: grid; gap: 4px; }
.pr-feedback b { font-size: 1.1rem; } .pr-actionbar.good .pr-feedback b { color: var(--teal); } .pr-actionbar.bad .pr-feedback b { color: var(--bad); }
.pr-feedback p { margin: 0; line-height: 1.7; color: var(--ink-2); }
.pr-tag { display: inline-block; margin-inline-end: 6px; padding: 1px 8px; border-radius: 6px; background: var(--surface-3); color: var(--ink); font-size: .76rem; font-weight: 700; }
.pr-end { justify-items: center; text-align: center; padding: 40px 0; }
.pr-end h2 { margin: 0; font-family: var(--font-display); font-size: 1.8rem; }
.pr-end p { margin: 0; color: var(--ink-2); }
.pr-end-stars { display: flex; gap: 10px; font-size: 3rem; }
.pr-end-stars i { font-style: normal; color: var(--surface-3); animation: pr-pop .5s var(--spring) both; animation-delay: var(--d); }
.pr-end-stars i.on { color: var(--gold); text-shadow: 0 6px 24px rgba(234, 191, 75, .5); }
.pr-xp { color: var(--gold) !important; font-weight: 700; font-size: 1.1rem; }
@media (max-width: 760px) {
  .pr-hero { grid-template-columns: 1fr; }
  .pr-stats { gap: 8px; } .pr-stat { padding: 12px; } .pr-stat b { font-size: 1.25rem; }
  .pr-daily { flex-wrap: wrap; align-items: flex-start; gap: 12px; padding: 16px; } .pr-daily .btn { width: 100%; justify-content: center; }
  .pr-daily-badge { width: 36px; height: 36px; } .pr-daily-text { flex-basis: calc(100% - 48px); }
  .pr-prompt { font-size: 1.12rem; }
  .pr-player-stage { padding: 8px; }
}
.pr-svg .pr-axis { font-size: 13px; } .pr-bar .pr-val { font-size: 14px; } .pr-bar .pr-lbl { font-size: 14px; }
.pr-check:disabled { opacity: .4; cursor: not-allowed; filter: grayscale(.4); }
.pr-visual.k-bars, .pr-visual.k-dots, .pr-visual.k-numberline { padding: 14px 10px 8px; }
/* the player's card: content fills the width (an older .pr-card rule centers its children) */
.pr-run .pr-card { justify-items: stretch; text-align: start; padding: 20px; }
.pr-run .pr-card.pr-end { justify-items: center; text-align: center; }
.pr-run .pr-prompt { text-align: start; }
.pr-grid-model { width: 100%; }
@media (max-width: 640px) { .pr-run .pr-card { padding: 16px; } }

/* practice: leave-the-pack dialog */
.pr-leave .modal-card { width: min(420px, 100%); }
.pr-leave h3 { font-size: 1.15rem; line-height: 1.5; }
.pr-leave-actions { display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; margin-top: 12px; }
.pr-leave-actions .btn { min-height: 46px; flex: 1 1 140px; }

/* practice: compact game cards on phones (the course name stays on one line) */
@media (max-width: 600px) {
  .pr-game { padding: 12px; }
  .pr-game-art { width: 40px; height: 40px; }
  .pr-game-body small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
