/* Alimun app: look and navigation (docs/DASHBOARD_PLAN.md, step 2).
   Shared by every new dashboard screen: tokens, type scale, shell (sidebar on desktop, bottom bar on phones),
   cards, buttons, bubbles, motion and the one loader. */

@font-face { font-family: Satoshi; src: url('../fonts/Satoshi-Variable.ttf') format('truetype'); font-weight: 300 900; font-style: normal; font-display: swap; }
@font-face { font-family: 'Coolvetica Condensed'; src: url('../fonts/coolvetica-condensed-rg.otf') format('opentype'); font-weight: 400; font-style: normal; font-display: swap; }

:root {
  /* Site colours */
  --ink: #080808; --lime: #ceff65; --bone: #f0efe9; --white: #fff;
  /* Logo and drawing palette (approved 24 Oct 2026) */
  --forest: #1a443c; --gold: #d5af33; --coral: #ff9f8a; --mint: #9fd6c7; --sun: #ffd166;
  /* Soft tints used behind drawings */
  --t-sun: #fff4e0; --t-mint: #eaf6f2; --t-coral: #fdeee9; --t-lime: #f4fbe0;
  --muted: rgba(8, 8, 8, .62); --faint: rgba(8, 8, 8, .08); --line: rgba(8, 8, 8, .1);
  --on-forest: rgba(240, 239, 233, .72);

  /* Type scale: Coolvetica Condensed for display, Satoshi for everything read */
  --fs-display: clamp(44px, 6vw, 72px);
  --fs-h1: clamp(36px, 4.4vw, 52px);
  --fs-h2: clamp(28px, 3vw, 36px);
  --fs-h3: 24px;
  --fs-lead: 19px; --fs-body: 16px; --fs-small: 14px; --fs-tiny: 12.5px;

  /* Shape and depth */
  --r-xl: 32px; --r-lg: 24px; --r-md: 16px; --r-sm: 12px;
  --shadow: 0 20px 60px rgba(8, 8, 8, .08);
  --shadow-lift: 0 26px 70px rgba(8, 8, 8, .13);
  --gap: 20px;

  /* Motion */
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: cubic-bezier(.3, 1.5, .5, 1);
  --t-fast: 160ms; --t-mid: 280ms; --t-slow: 520ms;

  --side-w: 272px; --bar-h: 72px;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Satoshi, system-ui, sans-serif; font-size: var(--fs-body); line-height: 1.5; color: var(--ink);
  background: var(--bone); -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
button { font: inherit; color: inherit; }
a { color: inherit; }
img, svg { display: block; }
:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; border-radius: 10px; }

.skip { position: fixed; left: 16px; top: -60px; z-index: 100; background: var(--lime); color: var(--forest); padding: 10px 16px; border-radius: var(--r-sm); font-weight: 700; text-decoration: none; transition: top var(--t-fast) var(--ease); }
.skip:focus { top: 16px; }

/* ---------- Type ---------- */
.t-display, .t-h1, .t-h2, .t-h3 { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-weight: 400; text-transform: uppercase; line-height: .92; letter-spacing: .005em; margin: 0; }
.t-display { font-size: var(--fs-display); }
.t-h1 { font-size: var(--fs-h1); }
.t-h2 { font-size: var(--fs-h2); }
.t-h3 { font-size: var(--fs-h3); line-height: 1; }
.t-lead { font-size: var(--fs-lead); line-height: 1.45; color: var(--muted); margin: 0; max-width: 62ch; }
.t-body { font-size: var(--fs-body); margin: 0; }
.t-small { font-size: var(--fs-small); color: var(--muted); margin: 0; }
.t-tiny { font-size: var(--fs-tiny); color: var(--muted); margin: 0; }
.t-num { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-size: 56px; line-height: .9; }

/* ---------- Shell ---------- */
.app { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: var(--side-w) 1fr; }

.side {
  position: sticky; top: 0; height: 100vh; height: 100dvh; background: var(--forest); color: var(--bone);
  display: flex; flex-direction: column; padding: 26px 18px 20px; overflow-y: auto; scrollbar-width: none;
}
.side::-webkit-scrollbar { display: none; }
.brand { display: flex; align-items: center; gap: 9px; padding: 0 10px 26px; text-decoration: none; }
.brand .book { width: 40px; height: 42px; overflow: visible; }
.side .book > path:first-child { fill: var(--bone); }
.wordmark { height: 23px; width: auto; aspect-ratio: 103.2 / 25.6; overflow: visible; }
.wordmark__letters { fill: var(--forest); }
.side .wordmark__letters { fill: var(--bone); }

.nav { display: flex; flex-direction: column; gap: 2px; }
.nav__group { margin-top: 18px; }
.nav__label { font-size: var(--fs-tiny); color: var(--on-forest); padding: 0 14px 6px; }
.nav a {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 11px 14px; border-radius: var(--r-md);
  text-decoration: none; color: var(--on-forest); font-weight: 600; font-size: 15.5px;
  transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.nav a svg { width: 22px; height: 22px; flex: none; }
.nav a:hover { background: rgba(240, 239, 233, .08); color: var(--bone); }
.nav a[aria-current="page"] { background: var(--lime); color: var(--forest); }
.nav a[aria-current="page"] svg { transform: scale(1.06); }
.nav a svg { transition: transform var(--t-mid) var(--spring); }

.side__foot { margin-top: auto; padding-top: 22px; }
.buddy-card {
  position: relative; background: rgba(240, 239, 233, .07); border-radius: var(--r-lg); padding: 16px; display: flex; gap: 12px; align-items: center;
  text-decoration: none; color: var(--bone); transition: background var(--t-fast) var(--ease);
}
.buddy-card:hover { background: rgba(240, 239, 233, .12); }
.buddy-card svg { width: 54px; height: 54px; flex: none; overflow: visible; }
.buddy-card b { display: block; font-size: 15px; }
.buddy-card small { color: var(--on-forest); font-size: var(--fs-tiny); }

.main { min-width: 0; display: flex; flex-direction: column; }
.top {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 14px; padding: 18px 40px;
  background: rgba(240, 239, 233, .86); backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  transition: box-shadow var(--t-mid) var(--ease);
}
.top.is-scrolled { box-shadow: 0 1px 0 var(--line); }
.top__brand { display: none; }
.top__title { font-family: 'Coolvetica Condensed', sans-serif; text-transform: uppercase; font-size: 26px; line-height: 1; margin: 0; opacity: 0; transform: translateY(6px); transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.top.is-scrolled .top__title { opacity: 1; transform: none; }
.top__actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
  width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--white); display: grid; place-items: center; cursor: pointer;
  box-shadow: 0 4px 14px rgba(8, 8, 8, .06); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.icon-btn:hover { transform: translateY(-1px); box-shadow: 0 8px 20px rgba(8, 8, 8, .1); }
.icon-btn svg { width: 22px; height: 22px; }
.course-btn {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 16px 0 6px; border: 0; border-radius: 22px; background: var(--white);
  cursor: pointer; font-weight: 700; font-size: 14.5px; box-shadow: 0 4px 14px rgba(8, 8, 8, .06);
}
.course-btn svg { width: 34px; height: 34px; overflow: visible; }
.avatar { width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--mint); color: var(--forest); font-weight: 800; font-size: 15px; display: grid; place-items: center; cursor: pointer; }

.view { flex: 1; padding: 8px 40px 64px; max-width: 1320px; width: 100%; }
.view__head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin: 6px 0 28px; flex-wrap: wrap; }
.view__head .t-lead { margin-top: 12px; }

/* Bottom bar and More sheet (phones) */
.bar { display: none; }
.sheet-scrim { position: fixed; inset: 0; background: rgba(8, 8, 8, .36); opacity: 0; pointer-events: none; transition: opacity var(--t-mid) var(--ease); z-index: 60; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 61; background: var(--white); border-radius: 28px 28px 0 0; padding: 12px 16px calc(20px + env(safe-area-inset-bottom));
  transform: translateY(105%); visibility: hidden; max-height: 80vh; overflow-y: auto;
  transition: transform var(--t-slow) var(--ease), visibility 0s linear var(--t-slow);
}
.sheet .nav__label { color: var(--muted); }
.sheet__grip { width: 44px; height: 5px; border-radius: 3px; background: var(--faint); margin: 0 auto 14px; }
.sheet .nav a { color: var(--ink); padding: 14px; }
.sheet .nav a:hover { background: var(--bone); }
.sheet .nav a[aria-current="page"] { background: var(--forest); color: var(--lime); }
.is-sheet-open .sheet-scrim { opacity: 1; pointer-events: auto; }
.is-sheet-open .sheet { transform: none; visibility: visible; transition: transform var(--t-slow) var(--ease); }

/* ---------- Grid and cards ---------- */
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(12, 1fr); }
.span-12 { grid-column: span 12; } .span-8 { grid-column: span 8; } .span-7 { grid-column: span 7; } .span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; } .span-4 { grid-column: span 4; } .span-3 { grid-column: span 3; }

.card {
  position: relative; background: var(--white); border-radius: var(--r-xl); padding: 28px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease);
}
a.card, button.card { display: block; text-align: start; text-decoration: none; border: 0; cursor: pointer; width: 100%; }
a.card:hover, button.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lift); }
a.card:active, button.card:active { transform: translateY(-1px) scale(.995); }
.card--forest { background: var(--forest); color: var(--bone); }
.card--forest .t-small, .card--forest .t-lead, .card--forest .t-tiny { color: var(--on-forest); }
.card--lime { background: var(--lime); color: var(--forest); }
.card--sun { background: var(--t-sun); box-shadow: none; } .card--mint { background: var(--t-mint); box-shadow: none; }
.card--coral { background: var(--t-coral); box-shadow: none; } .card--leaf { background: var(--t-lime); box-shadow: none; }
.card--bone { background: var(--bone); box-shadow: none; }
.card__row { display: flex; align-items: center; gap: 18px; }
.card__art { width: 120px; height: 120px; flex: none; overflow: visible; }
.card__art svg { width: 100%; height: 100%; overflow: visible; }
.card h3 + p, .card h2 + p { margin-top: 10px; }

/* A stage holds a drawing with its bubble, as on the approved boards */
.stage { position: relative; border-radius: var(--r-xl); padding: 92px 20px 20px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; min-height: 300px; }
.stage > svg { width: 100%; height: 170px; overflow: visible; }
.stage .bub { top: 16px; inset-inline-start: 18px; }

/* ---------- Bubbles (hand-drawn) ---------- */
.bub {
  position: absolute; max-width: 240px; padding: 12px 16px; background: var(--white); border: 3px solid var(--forest);
  font-weight: 600; font-size: 15px; line-height: 1.3; color: var(--forest);
  border-radius: 255px 18px 225px 18px / 18px 225px 18px 255px; box-shadow: 4px 5px 0 var(--forest);
  animation: bubIn .8s var(--spring) both; z-index: 2;
}
.bub.say::after { content: ""; position: absolute; inset-inline-start: 30px; bottom: -12px; width: 16px; height: 16px; background: var(--white); border-right: 3px solid var(--forest); border-bottom: 3px solid var(--forest); transform: rotate(45deg); }
.bub.think { border-radius: 40px; }
.bub.think::before, .bub.think::after { content: ""; position: absolute; background: var(--white); border: 3px solid var(--forest); border-radius: 50%; }
.bub.think::before { width: 16px; height: 16px; inset-inline-start: 26px; bottom: -24px; }
.bub.think::after { width: 9px; height: 9px; inset-inline-start: 16px; bottom: -38px; }
.bub--inline { position: relative; display: inline-block; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; height: 52px; padding: 0 24px; border-radius: 26px; border: 0;
  font-weight: 700; font-size: 16px; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 20px; height: 20px; }
.btn--primary { background: var(--forest); color: var(--lime); }
.btn--primary:hover { box-shadow: 0 10px 24px rgba(26, 68, 60, .28); }
.btn--lime { background: var(--lime); color: var(--forest); }
.btn--lime:hover { box-shadow: 0 10px 24px rgba(206, 255, 101, .4); }
.btn--ghost { background: transparent; color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.btn--ghost:hover { background: var(--forest); color: var(--bone); }
.btn--quiet { background: var(--bone); color: var(--ink); }
.btn--sm { height: 40px; padding: 0 18px; font-size: 14.5px; }

/* Progress meter */
.meter { height: 10px; border-radius: 5px; background: var(--faint); overflow: hidden; }
.meter i { display: block; height: 100%; border-radius: inherit; background: var(--forest); transform-origin: 0 50%; animation: grow 1.1s var(--ease) both .25s; }
.card--forest .meter { background: rgba(240, 239, 233, .14); }
.card--forest .meter i { background: var(--lime); }

/* Week strip for streaks (shapes, no labels inside) */
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 8px; margin-top: 18px; }
.week span { aspect-ratio: 1; border-radius: 12px; background: var(--faint); display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--muted); }
.week span.on { background: var(--forest); color: var(--lime); }
.week span.today { box-shadow: inset 0 0 0 2px var(--forest); color: var(--forest); }
.week span.on.today { color: var(--lime); box-shadow: 0 0 0 3px var(--t-lime), 0 0 0 5px var(--forest); }

/* ---------- Swatches and kit helpers ---------- */
.swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 14px; }
.swatch { border-radius: var(--r-lg); overflow: hidden; background: var(--white); box-shadow: var(--shadow); }
.swatch i { display: block; height: 72px; }
.swatch span { display: block; padding: 10px 14px; font-size: var(--fs-small); }
.swatch small { display: block; color: var(--muted); font-size: var(--fs-tiny); }
.type-row { display: grid; grid-template-columns: 140px 1fr; gap: 20px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); }
.type-row:first-child { border-top: 0; }
.moods { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.mood { border-radius: var(--r-lg); background: var(--bone); padding: 20px 12px 14px; display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.mood .book { width: 84px; height: 90px; overflow: visible; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }

/* ---------- Home (step 3) ---------- */
.home__section { margin: 18px 0 -4px; }
.card__row--split { align-items: center; justify-content: space-between; }
.card__art--lg { width: 150px; height: 150px; }
.card__art--end { margin-inline-start: auto; }
.card--center { display: flex; flex-direction: column; justify-content: center; }
.card--center > .card__row { width: 100%; }
.btn--on-forest { background: transparent; color: var(--bone); box-shadow: inset 0 0 0 2px rgba(240, 239, 233, .4); }
.btn--on-forest:hover { background: var(--bone); color: var(--forest); }
.card b { font-weight: 700; }
.sample-note .btn { flex: none; }
[dir="rtl"] .i-arrow { transform: scaleX(-1); }

/* ---------- Course book reader (step 4) ---------- */
[dir="rtl"] .i-back { transform: scaleX(-1); }
.rd-loading { min-height: 50vh; display: grid; place-items: center; }
.rd-back { display: inline-flex; align-items: center; gap: 8px; color: var(--forest); font-weight: 700; font-size: 15px; text-decoration: none; padding: 6px 0; margin: 4px 0 14px; }
.rd-back svg { width: 20px; height: 20px; transition: transform var(--t-fast) var(--ease); }
.rd-back:hover svg { transform: translateX(-3px); }
[dir="rtl"] .rd-back:hover svg { transform: scaleX(-1) translateX(-3px); }
.rd-unit.is-planned { opacity: .72; }
/* The free limit: units, texts, exercise kinds and test papers that come with a plan */
.rd-unit.is-locked .card__art { opacity: .8; }
.rd-lock, .lock-line { display: inline-flex; align-items: center; gap: 6px; color: var(--forest); font-weight: 700; }
.rd-lock svg, .lock-line svg { width: 16px; height: 16px; flex: none; }
.goal-card .card__art { width: 100px; height: 100px; }
.goal-card.is-mine { box-shadow: inset 0 0 0 2px var(--forest), var(--shadow); }
.goal-card .t-tiny { margin-top: 10px; }
.rd-unit .card__art { width: 96px; height: 96px; }
.rd-other { display: flex; flex-direction: column; justify-content: flex-end; }
.rd-other .card__art { margin-bottom: 18px; }
.draft-note { box-shadow: inset 0 0 0 1.5px var(--line); }
.rd-page .card__row { align-items: center; }
.rd-page__art { position: relative; width: 84px; height: 84px; flex: none; }
.rd-page__art > svg { width: 100%; height: 100%; overflow: visible; }
.rd-page:hover .rd-page__art > svg { animation: bob 1.4s ease-in-out infinite; }
.rd-mark { position: absolute; inset-inline-end: -6px; bottom: -4px; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--white); color: var(--forest); box-shadow: 0 4px 12px rgba(8, 8, 8, .12); }
.rd-mark svg { width: 16px; height: 16px; }
.rd-mark.is-done { background: var(--forest); color: var(--lime); }
.rd-page.is-next { box-shadow: inset 0 0 0 2px var(--forest), var(--shadow); }
.rd-page.is-next .rd-mark { background: var(--lime); }

/* Explanation language switch */
.xswitch { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 22px; background: var(--white); box-shadow: 0 4px 14px rgba(8, 8, 8, .06); }
.xswitch__label { font-size: var(--fs-tiny); color: var(--muted); padding: 0 8px 0 10px; }
.xswitch button { height: 34px; padding: 0 14px; border: 0; border-radius: 17px; background: none; font-weight: 700; font-size: 14px; cursor: pointer; color: var(--muted); transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease); }
.xswitch button[aria-pressed="true"] { background: var(--forest); color: var(--lime); }

/* A lesson: full pages turned one at a time */
.lesson { display: flex; flex-direction: column; min-height: calc(100dvh - 96px); }
.lesson__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.lesson__top .rd-back { margin: 0; }
.lesson__bar { height: 6px; border-radius: 3px; background: var(--faint); margin: 14px 0 18px; overflow: hidden; }
.lesson__bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: var(--forest); transition: width .6s var(--ease); }
.lesson__stage { position: relative; flex: 1; display: grid; perspective: 1800px; }
.spread {
  grid-area: 1 / 1; position: relative; background: var(--white); border-radius: var(--r-xl); box-shadow: var(--shadow);
  padding: clamp(28px, 4vw, 56px); min-height: calc(100dvh - 250px); display: flex; flex-direction: column; justify-content: center; gap: 28px;
  transform-origin: 0 50%; outline: none;
}
[dir="rtl"] .spread { transform-origin: 100% 50%; }
.spread__head { display: flex; align-items: center; justify-content: space-between; gap: 24px; animation: rise var(--t-slow) var(--ease) both; }
.spread__head .t-lead { margin-top: 14px; }
.spread__art { width: 150px; height: 150px; flex: none; }
.spread__art svg { width: 100%; height: 100%; overflow: visible; animation: float 3.2s ease-in-out infinite; }
.spread__cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.spread__cols--ex { grid-template-columns: 230px minmax(0, 1fr); align-items: start; }
.spread__cols--ex .spread__side { align-self: stretch; }
.spread__one { max-width: 860px; width: 100%; margin: 0 auto; }
.spread__main > .rd-block + .rd-block, .spread__one > .rd-block + .rd-block { margin-top: 24px; }
.spread .rd-block { animation: rise var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 120ms); }

/* Page turns */
.turn-in-next { animation: turnInNext .55s var(--ease) both; }
.turn-in-prev { animation: turnInPrev .55s var(--ease) both; }
.turn-out-next { animation: turnOutNext .5s var(--ease) both; pointer-events: none; z-index: 2; }
.turn-out-prev { animation: turnOutPrev .5s var(--ease) both; pointer-events: none; z-index: 2; }
@keyframes turnOutNext { to { transform: translateX(-8%) rotateY(14deg); opacity: 0; box-shadow: -40px 20px 80px rgba(8, 8, 8, .18); } }
@keyframes turnOutPrev { to { transform: translateX(8%) rotateY(-14deg); opacity: 0; } }
@keyframes turnInNext { from { transform: translateX(10%) rotateY(-10deg); opacity: 0; } }
@keyframes turnInPrev { from { transform: translateX(-10%) rotateY(10deg); opacity: 0; } }
[dir="rtl"] .turn-in-next { animation-name: turnInPrev; } [dir="rtl"] .turn-in-prev { animation-name: turnInNext; }
[dir="rtl"] .turn-out-next { animation-name: turnOutPrev; } [dir="rtl"] .turn-out-prev { animation-name: turnOutNext; }

.lesson__nav { position: sticky; bottom: 0; z-index: 5; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 16px; padding: 16px 0 8px; background: linear-gradient(transparent, var(--bone) 30%); }
.lesson__hint { margin: 0; text-align: center; font-size: var(--fs-small); color: var(--muted); }
.lesson__nav .btn[disabled], .lesson__nav .icon-btn[disabled] { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.lesson__next.is-ready { animation: nudge 1s var(--spring); }
@keyframes nudge { 0%, 100% { transform: none; } 30% { transform: translateX(6px) scale(1.04); } 60% { transform: translateX(-2px); } }

/* The end of a lesson */
.spread--end { text-align: center; align-items: center; }
.end { display: flex; flex-direction: column; align-items: center; }
.end .t-lead { margin-top: 12px; }
.end__art { position: relative; width: 200px; height: 200px; margin: 70px 0 18px; }
.end__art > svg { width: 100%; height: 100%; overflow: visible; animation: pop .9s var(--spring) .2s both, bob 1.4s ease-in-out 1.2s infinite; }
.end__bub { top: -70px; left: 0; right: 0; margin-inline: auto; width: max-content; max-width: 260px; animation-delay: .5s; }

/* The book character beside exercises */
.coach { position: sticky; top: 110px; display: flex; flex-direction: column; align-items: center; padding-top: 118px; }
.coach .book { width: 150px; height: 160px; overflow: visible; }
.coach .book--think { animation: shake .5s var(--ease); }
.coach .book--wow { animation: pop .9s var(--spring) both, bob 1.4s ease-in-out .9s infinite; }
.coach__bub { top: 0; inset-inline-start: 0; inset-inline-end: 0; max-width: none; text-align: center; }

/* Teaching blocks */
.rd-text p { margin: 0; font-size: 19px; line-height: 1.62; max-width: 62ch; }
.rd-text p + p { margin-top: 14px; }
.spread .rd-text b, .spread .rd-ex__s b {
  color: var(--forest); background: linear-gradient(var(--lime), var(--lime)) no-repeat 0 88% / 0% 42%;
  animation: highlight .8s var(--ease) both; animation-delay: calc(var(--i, 0) * 110ms + 700ms);
}
@keyframes highlight { to { background-size: 100% 42%; } }
.rd-text i, .rd-tip__bub i, .rd-ex__n i, .fb i { font-style: normal; font-weight: 700; color: var(--forest); }
.rd-examples { display: grid; gap: 12px; }
.rd-ex {
  display: block; width: 100%; text-align: start; border: 0; font: inherit; color: inherit; background: var(--bone); border-radius: var(--r-md);
  padding: 18px 22px; border-inline-start: 5px solid var(--forest); animation: rise .5s var(--ease) both; animation-delay: calc(var(--k, 0) * 90ms + 300ms);
}
.rd-ex.is-tap { cursor: pointer; transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.rd-ex.is-tap:hover { transform: translateX(4px); box-shadow: 0 8px 20px rgba(8, 8, 8, .06); }
[dir="rtl"] .rd-ex.is-tap:hover { transform: translateX(-4px); }
.rd-ex__s { display: block; margin: 0; font-size: 20px; font-weight: 600; line-height: 1.4; }
.rd-ex__hint { display: block; margin-top: 6px; font-size: var(--fs-tiny); color: var(--muted); transition: opacity var(--t-fast); }
.rd-ex__n { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--t-mid) var(--ease); }
.rd-ex__n > span { overflow: hidden; font-size: 15.5px; color: var(--ink); line-height: 1.45; }
.rd-ex[aria-expanded="true"] { background: var(--t-lime); }
.rd-ex[aria-expanded="true"] .rd-ex__n { grid-template-rows: 1fr; }
.rd-ex[aria-expanded="true"] .rd-ex__n > span { padding-top: 8px; }
.rd-ex[aria-expanded="true"] .rd-ex__hint { display: none; }
.rd-table { margin: 0; }
.rd-table__top { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rd-table figcaption, .rd-dialogue figcaption { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; text-transform: uppercase; font-size: 24px; line-height: 1; }
.rd-dialogue figcaption { margin-bottom: 14px; }
.rd-table__hint { display: none; margin: -4px 0 10px; }
.rd-table.is-hidden .rd-table__hint { display: block; }
.rd-table__scroll { position: relative; overflow: hidden; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--line); }
/* A table wider than the page is shown shrunk to fit; tapping it opens it full screen, where it can be zoomed */
.rd-table__scroll.is-fit { cursor: zoom-in; }
.rd-table__scroll.is-fit table { pointer-events: none; }
.rd-table__scroll.is-fit:focus-visible { outline: 3px solid var(--forest); outline-offset: 3px; }
.rd-table__scroll.is-fit table { transform-origin: 0 0; }
[dir="rtl"] .rd-table__scroll.is-fit table { transform-origin: 100% 0; }
.rd-table__open { position: absolute; inset-inline-end: 10px; bottom: 10px; z-index: 2; display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px; border: 0; border-radius: 18px; background: var(--forest); color: var(--lime); font: inherit; font-weight: 700; font-size: 13.5px; cursor: pointer; box-shadow: 0 8px 20px rgba(8, 8, 8, .2); }
.rd-table__open svg { width: 16px; height: 16px; }
.tv { position: fixed; inset: 0; z-index: 120; background: var(--bone); display: flex; flex-direction: column; animation: rise .3s var(--ease) both; }
.tv__top { display: flex; align-items: center; gap: 10px; padding: 12px 16px calc(12px); padding-top: calc(12px + env(safe-area-inset-top)); background: var(--white); box-shadow: 0 1px 0 var(--line); }
.tv__title { flex: 1; min-width: 0; margin: 0; font-family: 'Coolvetica Condensed', Satoshi, sans-serif; text-transform: uppercase; font-size: 22px; line-height: 1; }
.tv__body { flex: 1; overflow: auto; padding: 18px 16px calc(24px + env(safe-area-inset-bottom)); touch-action: pan-x pan-y; -webkit-overflow-scrolling: touch; }
.tv__body table { background: var(--white); border-radius: var(--r-md); overflow: hidden; width: max-content; min-width: 100%; box-shadow: inset 0 0 0 1px var(--line); }
.tv__hint { margin: 0; padding: 0 16px 10px; text-align: center; background: var(--white); }
.rd-table table { border-collapse: collapse; width: 100%; font-size: 16px; }
.rd-table th, .rd-table td { text-align: start; padding: 12px 16px; border-top: 1px solid var(--line); vertical-align: middle; }
.rd-table thead th { border-top: 0; background: var(--forest); color: var(--bone); font-weight: 700; font-size: var(--fs-small); }
.rd-table tbody th { font-weight: 700; white-space: nowrap; }
.rd-table tbody tr { animation: rise .45s var(--ease) both; animation-delay: calc(var(--k, 0) * 55ms + 350ms); transition: background var(--t-fast); }
.rd-table tbody tr:nth-child(even) { background: rgba(240, 239, 233, .55); }
.rd-table tbody tr:hover { background: var(--t-lime); }
.cell { all: unset; display: inline-block; border-radius: 6px; padding: 1px 4px; margin: -1px -4px; cursor: default; transition: background var(--t-mid) var(--ease), color var(--t-mid) var(--ease); }
.rd-table.is-hidden .cell { color: transparent; background: var(--mint); cursor: pointer; min-width: 3ch; }
.rd-table.is-hidden .cell:hover { background: var(--forest); }
.rd-table.is-hidden .cell.is-shown { color: var(--forest); background: var(--lime); animation: pop .45s var(--spring); }
.rd-table.is-hidden .cell:focus-visible { outline: 3px solid var(--forest); outline-offset: 2px; }
.rd-dialogue { margin: 0; background: var(--t-mint); border-radius: var(--r-lg); padding: 24px; }
.chat { display: flex; flex-direction: column; gap: 12px; }
.chat__line { display: flex; align-items: flex-end; gap: 10px; opacity: 0; transform: translateY(10px) scale(.96); transition: opacity .35s var(--ease), transform .45s var(--spring); }
.chat__line.is-typing, .chat__line.is-on { opacity: 1; transform: none; }
.chat__line--1 { flex-direction: row-reverse; }
.chat__who { width: 36px; height: 36px; flex: none; border-radius: 50%; display: grid; place-items: center; font-weight: 800; font-size: 14px; background: var(--sun); color: var(--forest); }
.chat__line--1 .chat__who { background: var(--coral); }
.chat__line p { margin: 0; max-width: 78%; padding: 12px 16px; border-radius: 20px 20px 20px 6px; background: var(--white); font-size: 17px; line-height: 1.45; box-shadow: 0 4px 12px rgba(8, 8, 8, .05); }
.chat__line--1 p { border-radius: 20px 20px 6px 20px; background: var(--forest); color: var(--bone); }
.chat__line p b { display: block; font-size: var(--fs-tiny); color: var(--forest); margin-bottom: 2px; }
.chat__line--1 p b { color: var(--lime); }
.chat__line.is-typing p span { color: transparent; position: relative; }
.chat__line.is-typing p span::after { content: "\2022\2002\2022\2002\2022"; position: absolute; left: 0; top: 0; color: var(--muted); animation: typing 1s steps(3) infinite; }
.chat__line--1.is-typing p span::after { color: var(--on-forest); }
@keyframes typing { 0% { opacity: .3; } 50% { opacity: 1; } 100% { opacity: .3; } }
.rd-dialogue .linkish { margin-top: 14px; }
.rd-tip { display: flex; align-items: flex-end; gap: 18px; padding: 6px 0 8px; }
.rd-tip__art { width: 100px; height: 100px; flex: none; animation: rise .6s var(--spring) both; animation-delay: calc(var(--i, 0) * 110ms + 200ms); }
.rd-tip__art svg { width: 100%; height: 100%; overflow: visible; }
.rd-tip__bub { max-width: 560px; font-size: 16.5px; font-weight: 500; line-height: 1.45; color: var(--ink); margin-bottom: 30px; animation-delay: calc(var(--i, 0) * 110ms + 450ms); }
.rd-tip__bub.say::after { inset-inline-start: -12px; bottom: 18px; transform: rotate(135deg); }
[dir="rtl"] .rd-tip__bub.say::after { transform: rotate(-45deg); }
.rd-reading { background: var(--t-sun); border-radius: var(--r-lg); padding: clamp(24px, 4vw, 48px); max-width: 780px; margin: 0 auto; }
.rd-reading p { margin: 16px 0 0; font-size: 19px; line-height: 1.75; animation: rise .6s var(--ease) both; }
.rd-reading p:nth-of-type(2) { animation-delay: .25s; } .rd-reading p:nth-of-type(3) { animation-delay: .5s; }
.paper { background: var(--white); border-radius: var(--r-xl); box-shadow: var(--shadow); padding: 52px clamp(22px, 6vw, 72px) 44px; max-width: 880px; }
.paper .rd-block + .rd-block { margin-top: 26px; }

/* Exercises */
.ex { background: var(--bone); border-radius: var(--r-lg); padding: 24px clamp(18px, 3vw, 30px); }
.ex__h { margin: 0 0 6px; font-size: 19px; font-weight: 800; color: var(--forest); }
.ex__hint { margin: 0 0 12px; }
.ex-item { padding: 16px 0; border-top: 1px solid var(--line); animation: rise .45s var(--ease) both; animation-delay: calc(var(--k, 0) * 70ms + 200ms); }
.ex.is-settled .ex-item, .ex.is-settled .opt, .ex.is-settled .tile--match { animation: none; }
.ex-item:first-of-type { border-top: 0; }
.ex-q { margin: 0 0 12px; font-size: 18.5px; line-height: 1.55; }
.gap { display: inline-block; min-width: 72px; border-bottom: 2.5px solid var(--forest); margin: 0 4px; line-height: 1.2; text-align: center; }
.gap.is-filled { min-width: 0; padding: 0 5px; background: var(--lime); border-radius: 6px 6px 0 0; font-weight: 700; color: var(--forest); animation: pop .5s var(--spring); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.opts { display: flex; flex-wrap: wrap; gap: 10px; }
.opts--stack { flex-direction: column; align-items: stretch; }
.opt {
  min-height: 48px; padding: 10px 20px; border-radius: 24px; border: 0; background: var(--white); font-weight: 600; font-size: 16.5px; cursor: pointer; text-align: start;
  box-shadow: inset 0 0 0 2px var(--line); transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
  animation: rise .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 50ms + 260ms);
}
.opts--stack .opt { border-radius: var(--r-md); }
.opt:hover:not([disabled]) { transform: translateY(-2px); box-shadow: inset 0 0 0 2px var(--forest); }
.opt:active:not([disabled]) { transform: scale(.97); }
.opt[disabled] { cursor: default; }
.opt.is-picked { background: var(--forest); color: var(--lime); box-shadow: none; }
.opt.is-right { background: var(--lime); color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); animation: pop .5s var(--spring); }
.opt.is-wrong { background: var(--t-coral); color: rgba(8, 8, 8, .55); box-shadow: inset 0 0 0 2px var(--coral); text-decoration: line-through; text-decoration-color: rgba(8, 8, 8, .35); }
.ex-item.is-wrong .opt.is-wrong, .ex-item.is-wrong .ord-line, .ex-item.is-wrong .gap-in { animation: shake .4s var(--ease); }
.gap-in {
  font: inherit; font-weight: 700; color: var(--forest); background: var(--white); border: 0; border-bottom: 2.5px solid var(--forest); border-radius: 8px 8px 0 0;
  padding: 3px 8px; margin: 0 4px; max-width: 100%; min-width: 4ch; outline-offset: 2px; transition: background var(--t-fast);
}
.gap-in:focus { background: var(--t-lime); }
.ex-item.is-right .gap-in { background: var(--lime); animation: pop .45s var(--spring); }
.ex-item.is-wrong .gap-in { background: var(--t-coral); border-bottom-color: var(--coral); }
.ex__foot { margin-top: 14px; }
.linkish { border: 0; background: none; padding: 6px 0; font: inherit; font-weight: 700; font-size: 15px; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.linkish + .linkish { margin-inline-start: 18px; }

/* Word order: tap or drag */
.ord-line {
  min-height: 60px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding: 9px 10px; border-radius: var(--r-md); background: var(--white);
  box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow var(--t-fast), background var(--t-fast);
  background-image: repeating-linear-gradient(90deg, transparent 0 14px, rgba(8, 8, 8, .06) 14px 22px); background-size: 100% 2px; background-repeat: no-repeat; background-position: 12px calc(100% - 14px);
}
.ord-line:not(.is-empty) { background-image: none; }
.ord-line.is-over { box-shadow: inset 0 0 0 2px var(--forest); background-color: var(--t-lime); }
.ex-item.is-right .ord-line { box-shadow: inset 0 0 0 2px var(--forest); background-color: var(--t-lime); }
.ex-item.is-wrong .ord-line { box-shadow: inset 0 0 0 2px var(--coral); }
.ord-pool { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tile {
  min-height: 44px; padding: 8px 15px; border: 0; border-radius: var(--r-sm); background: var(--white); font-weight: 700; font-size: 17px; cursor: grab;
  box-shadow: 0 3px 0 rgba(8, 8, 8, .12), inset 0 0 0 1.5px var(--line); transition: transform var(--t-fast) var(--spring), opacity var(--t-fast) var(--ease); touch-action: none; user-select: none;
}
.tile:hover:not([disabled]) { transform: translateY(-2px); }
.tile:active:not([disabled]) { cursor: grabbing; }
.ord-line .tile { background: var(--forest); color: var(--bone); box-shadow: 0 3px 0 rgba(8, 8, 8, .25); }
.ex-item.is-right .ord-line .tile { color: var(--lime); }
.tile.is-used { opacity: .22; transform: scale(.92); cursor: default; }
.tile.is-dragging { opacity: .25; }
.tile[disabled] { cursor: default; }
.tile--ghost { position: fixed; z-index: 200; margin: 0; pointer-events: none; background: var(--lime); color: var(--forest); box-shadow: 0 16px 34px rgba(8, 8, 8, .22); }

/* Matching, with a line drawn between each pair */
.match { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 12px clamp(40px, 8vw, 96px); }
.match__lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; z-index: 0; }
.match__lines path { fill: none; stroke-width: 3.5; stroke-linecap: round; stroke: var(--forest); }
.match__lines path.is-new { stroke-dasharray: 400; stroke-dashoffset: 400; animation: draw .6s var(--ease) forwards; }
.match__lines circle { fill: var(--forest); }
.match__lines .is-wrong { stroke: var(--coral); fill: var(--coral); }
.match__lines .p0 { stroke: var(--gold); fill: var(--gold); } .match__lines .p1 { stroke: #5fae99; fill: #5fae99; } .match__lines .p2 { stroke: var(--coral); fill: var(--coral); }
.match__lines .p3 { stroke: #9bc93a; fill: #9bc93a; } .match__lines .p4 { stroke: var(--gold); fill: var(--gold); } .match__lines .p5 { stroke: var(--forest); fill: var(--forest); }
@keyframes draw { to { stroke-dashoffset: 0; } }
.match__col { position: relative; z-index: 1; display: grid; gap: 12px; align-content: start; }
.tile--match { width: 100%; text-align: start; min-height: 52px; cursor: pointer; animation: rise .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 60ms + 250ms); }
.tile--match.is-sel { background: var(--forest); color: var(--lime); transform: scale(1.03); }
.tile--match.is-matched { background: var(--lime); color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.tile--match.is-wrong { background: var(--t-coral); color: var(--ink); box-shadow: inset 0 0 0 2px var(--coral); animation: shake .4s var(--ease); }
.tile--match.is-right { background: var(--lime); color: var(--forest); }
.tile--match[data-pair="0"] { background: var(--t-sun); box-shadow: inset 0 0 0 2px var(--gold); }
.tile--match[data-pair="1"] { background: var(--t-mint); box-shadow: inset 0 0 0 2px #5fae99; }
.tile--match[data-pair="2"] { background: var(--t-coral); box-shadow: inset 0 0 0 2px var(--coral); }
.tile--match[data-pair="3"] { background: var(--t-lime); box-shadow: inset 0 0 0 2px #9bc93a; }
.tile--match[data-pair="4"] { background: #f6ecd0; box-shadow: inset 0 0 0 2px var(--gold); }
.tile--match[data-pair="5"] { background: #e3ece9; box-shadow: inset 0 0 0 2px var(--forest); }
.tile--match.is-paired.is-sel { background: var(--forest); color: var(--lime); }

/* Tap the words in the text */
.spot { margin: 0; font-size: 19px; line-height: 1.95; }
.spot__w { font: inherit; border: 0; background: none; padding: 1px 2px; margin: 0 -2px; border-radius: 8px; cursor: pointer; color: inherit; transition: background var(--t-fast), color var(--t-fast); }
.spot__w:hover:not([disabled]) { background: var(--t-lime); }
.spot__w[disabled] { cursor: default; }
.spot__w.is-found, .spot__w.is-picked { background: var(--lime); color: var(--forest); font-weight: 700; animation: pop .45s var(--spring); }
.spot__w.is-picked { background: var(--forest); color: var(--lime); animation: none; }
.spot__w.is-bad { background: var(--t-coral); box-shadow: inset 0 0 0 2px var(--coral); animation: shake .4s var(--ease); }
.spot__w.is-missed { box-shadow: inset 0 -3px 0 var(--coral); font-weight: 700; }

/* Course audio in the reader (step 5) */
.rd-exrow { display: flex; align-items: flex-start; gap: 10px; }
.rd-exrow > .rd-ex { flex: 1; min-width: 0; }
.rd-say { flex: none; width: 44px; height: 44px; margin-top: 6px; border: 0; border-radius: 50%; background: var(--forest); color: var(--lime); display: grid; place-items: center; cursor: pointer; transition: transform var(--t-fast) var(--spring), background var(--t-fast); }
.rd-say svg { width: 18px; height: 18px; fill: currentColor; }
.rd-say:hover { transform: scale(1.08); }
.rd-say.is-playing { background: var(--lime); color: var(--forest); animation: pulse 1.2s ease-in-out infinite; }
.rd-exrow.is-speaking .rd-ex { box-shadow: inset 0 0 0 2px var(--forest); }
.listen { margin-top: 14px; gap: 8px; }
.listen svg { width: 16px; height: 16px; fill: currentColor; }
.listen.is-playing { background: var(--lime); color: var(--forest); }
.rd-reading .listen { margin: 0 0 14px; }
.chat__line.is-speaking p { box-shadow: 0 0 0 2.5px var(--forest), 0 4px 12px rgba(8, 8, 8, .05); }
.rd-reading p.is-speaking { background: var(--t-lime); border-radius: 8px; box-shadow: 0 0 0 6px var(--t-lime); }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 0 rgba(206, 255, 101, .7); } 50% { box-shadow: 0 0 0 8px rgba(206, 255, 101, 0); } }

/* Exercise types added in step 5 (js/app/exercises.js) */
.opts--odd .opt { min-width: 92px; text-align: center; }
.opt--sm { min-height: 42px; padding: 8px 16px; font-size: 15.5px; }
.opt.is-missed { box-shadow: inset 0 0 0 2px var(--coral); }

/* Drop-down in the gap */
.sel-wrap { position: relative; display: inline-block; margin: 0 4px; }
.gap-sel {
  font: inherit; font-weight: 700; color: var(--forest); background: var(--white); border: 0; border-bottom: 2.5px solid var(--forest); border-radius: 8px 8px 0 0;
  padding: 3px 26px 3px 8px; max-width: 100%; cursor: pointer; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--forest) 50%), linear-gradient(135deg, var(--forest) 50%, transparent 50%);
  background-position: calc(100% - 13px) 55%, calc(100% - 8px) 55%; background-size: 5px 5px; background-repeat: no-repeat; transition: background-color var(--t-fast);
}
[dir="rtl"] .gap-sel { padding: 3px 8px 3px 26px; background-position: 13px 55%, 8px 55%; }
.gap-sel:focus { background-color: var(--t-lime); }
.ex-item.is-right .gap-sel { background-color: var(--lime); animation: pop .45s var(--spring); }
.ex-item.is-wrong .gap-sel { background-color: var(--t-coral); border-bottom-color: var(--coral); animation: shake .4s var(--ease); }
.gap-sel[disabled] { cursor: default; opacity: 1; }

/* Word formation, transformation, conjugation */
.wf { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.wf .ex-q { margin-bottom: 0; }
.wf__base { flex: none; padding: 6px 12px; border-radius: var(--r-sm); background: var(--forest); color: var(--lime); font-weight: 800; letter-spacing: .06em; font-size: 15px; line-height: 1.3; margin-top: 3px; }
.tf-src { margin-bottom: 6px; }
.tf-cue { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; font-weight: 700; color: var(--forest); }
.tf-cue svg { width: 18px; height: 18px; flex: none; }
[dir="rtl"] .tf-cue svg, [dir="rtl"] .fix__row svg { transform: scaleX(-1); }
.gap-in--wide { display: block; width: 100%; margin: 0; font-size: 17.5px; padding: 8px 12px; }
.cj-verb { display: flex; align-items: baseline; flex-wrap: wrap; gap: 6px 14px; margin: 4px 0 6px; }
.cj-verb b { font-family: 'Coolvetica Condensed', sans-serif; font-weight: 400; font-size: 34px; line-height: 1; color: var(--forest); }
.cj-verb span { color: var(--muted); font-size: var(--fs-small); }
.ex--conjugate .ex-items { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); column-gap: 28px; }
.ex--conjugate .ex-item { padding: 10px 0; }
.ex--conjugate .ex-item:nth-of-type(2) { border-top: 0; }
.cj-row { display: flex; align-items: center; gap: 10px; font-size: 18px; }
.cj-p { min-width: 92px; color: var(--muted); font-weight: 600; }
.cj-row .gap-in { flex: 1; margin: 0; }

/* Find and fix the mistake */
.fix__row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 12px; font-size: 18px; }
.fix__row s { color: var(--muted); text-decoration-color: var(--coral); text-decoration-thickness: 2.5px; }
.fix__row svg { width: 18px; height: 18px; color: var(--forest); }
.fix__row .gap-in { margin: 0; }

/* Collocations */
.colloc { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.colloc__key { flex: none; min-width: 96px; padding: 10px 16px; border-radius: var(--r-md); background: var(--forest); color: var(--lime); font-weight: 800; font-size: 18px; text-align: center; }
.colloc__opts { display: flex; flex-wrap: wrap; gap: 8px; flex: 1; min-width: 200px; }

/* Word bank */
.bank { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px; margin-bottom: 6px; border-radius: var(--r-md); background: var(--white); box-shadow: inset 0 0 0 2px var(--line); }
.tile--bank { animation: rise .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 45ms + 200ms); }
.ex.is-settled .tile--bank, .ex.is-settled .tile--sort, .ex.is-settled .mem__card { animation: none; }
.tile.is-bad { background: var(--t-coral); box-shadow: inset 0 0 0 2px var(--coral); animation: shake .4s var(--ease); }
.gap--btn { font: inherit; min-width: 88px; min-height: 1.5em; padding: 0 6px; border: 0; border-bottom: 2.5px solid var(--forest); border-radius: 6px 6px 0 0; background: rgba(8, 8, 8, .04); cursor: pointer; color: var(--forest); font-weight: 700; vertical-align: baseline; transition: background var(--t-fast), box-shadow var(--t-fast); }
.gap--btn.is-sel { background: var(--t-lime); box-shadow: 0 0 0 2px var(--forest); border-radius: 6px; }
.gap--btn.is-over { background: var(--lime); }
.gap--btn[disabled] { cursor: default; }
.ex-item.is-right .gap--btn { background: var(--lime); }
.ex-item.is-wrong .gap--btn { animation: shake .4s var(--ease); }

/* Sort into groups */
.sort__pool { display: flex; flex-wrap: wrap; gap: 8px; min-height: 52px; padding: 14px; border-radius: var(--r-md); background: var(--white); box-shadow: inset 0 0 0 2px var(--line); }
.sort__groups { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.sort__group { display: flex; flex-direction: column; min-height: 150px; border-radius: var(--r-md); background: var(--t-mint); overflow: hidden; }
.sort__group:nth-child(2) { background: var(--t-sun); } .sort__group:nth-child(3) { background: var(--t-coral); } .sort__group:nth-child(4) { background: var(--t-lime); }
.sort__drop { border: 0; padding: 12px 10px; font: inherit; font-weight: 800; font-size: 17px; color: var(--forest); background: rgba(255, 255, 255, .55); cursor: pointer; transition: background var(--t-fast); }
.sort__drop:hover:not([disabled]), .sort__drop.is-over { background: var(--lime); }
.sort__drop[disabled] { cursor: default; }
.sort__in { display: flex; flex-wrap: wrap; gap: 6px; padding: 10px; align-content: flex-start; flex: 1; }
.tile--sort { animation: rise .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 45ms + 200ms); }
.tile--sort.is-sel { background: var(--forest); color: var(--lime); transform: scale(1.04); }
.tile--sort.is-right { background: var(--white); color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); animation: pop .45s var(--spring); }
.tile--sort.is-shown { background: var(--white); box-shadow: inset 0 0 0 2px var(--coral); }
.tile--sort.is-wrong { background: var(--t-coral); box-shadow: inset 0 0 0 2px var(--coral); }
.sort__in .tile--sort { min-height: 38px; padding: 6px 12px; font-size: 15.5px; }

/* Memory pairs */
.mem { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 10px; max-width: 640px; }
.mem__card { position: relative; aspect-ratio: 4 / 3; border: 0; padding: 0; background: none; cursor: pointer; perspective: 800px; animation: rise .4s var(--ease) both; animation-delay: calc(var(--k, 0) * 40ms + 200ms); }
.mem__in { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .45s var(--ease); }
.mem__card.is-up .mem__in { transform: rotateY(180deg); }
.mem__back, .mem__face { position: absolute; inset: 0; display: grid; place-items: center; border-radius: var(--r-md); backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.mem__back { background: var(--forest); }
.mem__back .book { width: 42%; height: auto; max-height: 70%; overflow: visible; }
.mem__back .book > path:first-child { fill: var(--bone); }
.mem__face { transform: rotateY(180deg); padding: 8px; background: var(--white); box-shadow: inset 0 0 0 2px var(--line); font-weight: 700; font-size: clamp(14px, 2vw, 17px); text-align: center; line-height: 1.25; }
.mem__face--b { background: var(--t-sun); }
.mem__card.is-got .mem__face { background: var(--lime); color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.mem__card.is-got { cursor: default; animation: pop .5s var(--spring); }

/* Word search */
.ws { display: flex; gap: 24px; flex-wrap: wrap; align-items: flex-start; }
.ws__grid { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 3px; width: min(100%, 460px); user-select: none; }
.ws__grid.is-wrong { animation: shake .4s var(--ease); }
.ws__c { aspect-ratio: 1; border: 0; padding: 0; border-radius: 6px; background: var(--white); font: inherit; font-weight: 700; font-size: clamp(12px, 2.6vw, 17px); cursor: pointer; transition: background var(--t-fast), color var(--t-fast); }
.ws__c:hover { background: var(--t-lime); }
.ws__c.is-start { background: var(--forest); color: var(--lime); }
.ws__c.is-found { background: var(--lime); color: var(--forest); }
.ws__list { display: flex; flex-direction: column; gap: 8px; font-weight: 700; font-size: 17px; min-width: 140px; }
.ws__w.is-found { color: var(--muted); text-decoration: line-through; text-decoration-color: var(--forest); text-decoration-thickness: 2.5px; }

/* Crossword */
.cw { display: grid; grid-template-columns: repeat(var(--w), minmax(0, 34px)); grid-template-rows: repeat(var(--h), minmax(0, 34px)); gap: 3px; margin: 8px 0 14px; max-width: 100%; }
.cw__c { display: grid; place-items: center; border-radius: 5px; background: var(--white); box-shadow: inset 0 0 0 1.5px var(--forest); font-weight: 800; font-size: clamp(11px, 2.4vw, 17px); color: var(--forest); aspect-ratio: 1; transition: background var(--t-fast); }
.cw__c.is-right { background: var(--lime); }
.cw__c.is-on { background: var(--t-lime); }
.cw-clue { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.cw-clue p { margin: 0; flex: 1; min-width: 180px; font-size: 17px; }
.cw-dir svg { width: 18px; height: 18px; color: var(--forest); }
.cw-len { color: var(--muted); font-size: var(--fs-small); }
.cw-clue .gap-in { text-transform: uppercase; letter-spacing: .08em; }
@media (max-width: 599px) {
  .sort__groups { grid-template-columns: minmax(0, 1fr); }
  .sort__group { min-height: 0; }
  .wf { flex-direction: column-reverse; gap: 8px; }
  .mem { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Listening exercises */
.hear-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 2px 0 12px; }
.hear { gap: 8px; }
.hear svg { width: 15px; height: 15px; fill: currentColor; }
.hear.is-playing { background: var(--lime); color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.dict-diff { margin: 0 0 4px; font-weight: 700; }
.dict-diff s { color: var(--coral); text-decoration-thickness: 2.5px; }
.fb--no > div { font-size: 15.5px; line-height: 1.45; }
.fb--no > div > span { color: var(--muted); }

/* Picture exercises (third cast) */
.pic { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 18px; align-items: center; }
.pic__art { background: var(--white); border-radius: var(--r-md); padding: 10px; box-shadow: inset 0 0 0 2px var(--line); }
.pic__art svg { width: 100%; height: auto; display: block; }
.lbl { position: relative; background: var(--white); border-radius: var(--r-md); box-shadow: inset 0 0 0 2px var(--line); margin-bottom: 14px; overflow: visible; }
.lbl__art svg { width: 100%; height: auto; display: block; }
.lbl__spot { position: absolute; transform: translate(-11px, -11px); display: flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; cursor: pointer; font: inherit; }
.lbl__spot i { flex: none; width: 22px; height: 22px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px var(--forest), 0 4px 10px rgba(8, 8, 8, .2); animation: beacon 1.8s ease-in-out infinite; }
@keyframes beacon { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.18); } }
.lbl__spot span { padding: 4px 10px; border-radius: 10px; background: var(--white); box-shadow: 0 0 0 2px var(--forest), 0 6px 14px rgba(8, 8, 8, .12); font-weight: 700; font-size: 14.5px; white-space: nowrap; color: var(--forest); }
.lbl__spot.is-left { flex-direction: row-reverse; transform: translate(calc(-100% + 11px), -11px); }
.lbl__spot.is-sel i { background: var(--forest); box-shadow: 0 0 0 3px var(--lime), 0 0 0 6px var(--forest); animation: none; }
.lbl__spot.is-right i { background: var(--forest); animation: none; }
.lbl__spot.is-right span { background: var(--lime); animation: pop .45s var(--spring); }
.lbl__spot.is-wrong i { background: var(--coral); animation: shake .4s var(--ease); }
.lbl__spot.is-wrong span { background: var(--t-coral); box-shadow: 0 0 0 2px var(--coral); }
.lbl__spot.is-over i { transform: scale(1.3); }
.lbl__spot[disabled] { cursor: default; }
@media (max-width: 599px) {
  .pic { grid-template-columns: 1fr; }
  .pic__art { max-width: 180px; }
  .lbl__spot span { font-size: 12.5px; padding: 3px 7px; }
}
.soon__spot { width: 88px; margin-bottom: 10px; }
.soon__spot svg { width: 100%; height: auto; display: block; }
/* Speaking */
.speak-tutor { width: 150px; margin: 0 auto 6px; }
.speak-tutor svg { width: 100%; height: auto; display: block; }
.speak-s { margin: 0 0 12px; font-size: 20px; line-height: 1.6; }
.sw { border-radius: 6px; padding: 0 2px; transition: background var(--t-mid) var(--ease); }
.sw.is-ok { background: var(--lime); color: var(--forest); font-weight: 700; }
.sw.is-miss { box-shadow: inset 0 -3px 0 var(--coral); }
.rec { gap: 9px; }
.rec i { width: 12px; height: 12px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--white); }
.rec.is-rec { background: var(--coral); color: var(--ink); }
.rec.is-rec i { background: var(--white); animation: beacon .9s ease-in-out infinite; }
.speak-heard { margin: 4px 0 0; color: var(--muted); }
.speak-heard q { color: var(--ink); font-weight: 600; }
.speak-note { margin: 6px 0 0; color: var(--forest); font-weight: 600; }
.speak-card__top { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: flex-start; justify-content: space-between; }
.tutors { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; margin-top: 18px; }
.tutor-pick { border: 0; padding: 8px 6px 10px; border-radius: var(--r-md); background: var(--bone); cursor: pointer; display: flex; flex-direction: column; align-items: center; gap: 4px; font-weight: 700; font-size: 14px; transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast) var(--spring); }
.tutor-pick svg { width: 100%; max-width: 110px; height: auto; display: block; }
.tutor-pick:hover { transform: translateY(-2px); }
.tutor-pick.is-on { background: var(--t-lime); box-shadow: inset 0 0 0 3px var(--forest); }
@media (max-width: 699px) { .tutors { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
/* Flashcards (step 6) */
.deck { display: flex; flex-direction: column; }
.deck__art { width: 76px; height: 76px; margin-bottom: 8px; }
.deck__art svg { width: 100%; height: 100%; display: block; }
.deck__sample { margin-top: 6px; color: var(--muted); }
.deck .btn-row { margin-top: auto !important; padding-top: 14px; }
.deck__done { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; color: var(--forest); }
.deck__done svg { width: 18px; height: 18px; }
.own__form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; margin-top: 16px; align-items: end; }
.own__form label { display: flex; flex-direction: column; gap: 6px; font-weight: 600; font-size: var(--fs-small); }
.own__form input { font: inherit; font-size: 16.5px; padding: 11px 14px; border-radius: var(--r-sm); border: 0; box-shadow: inset 0 0 0 2px var(--line); background: var(--white); }
.own__form input:focus { outline: none; box-shadow: inset 0 0 0 2px var(--forest); background: var(--t-lime); }
.own__wide { grid-column: 1 / -1; }
.own__form .btn { justify-self: start; }
.own__msg { margin: 0; align-self: center; font-weight: 600; color: var(--forest); }
.mine__top { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px; }
.mine__find { font: inherit; padding: 9px 14px; border-radius: 20px; border: 0; box-shadow: inset 0 0 0 2px var(--line); min-width: 220px; }
.mine__list { list-style: none; margin: 14px 0 0; padding: 0; columns: 2 320px; column-gap: 28px; }
.mine__list li { break-inside: avoid; display: flex; align-items: center; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line); }
.mine__list li > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.mine__list li > div span { color: var(--muted); font-size: var(--fs-small); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mine__list li.is-aside { opacity: .5; }
.mine__box { display: inline-flex; gap: 3px; }
.mine__box i { width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.mine__box i.on { background: var(--forest); }
.fc__stage { margin-top: 24px; }
.fc__wrap { display: flex; justify-content: center; }
.fc__main { width: 100%; max-width: 620px; min-width: 0; }
.fc__line { margin: 0 0 14px; text-align: center; color: var(--muted); font-weight: 600; }
/* Both faces share one grid cell, so the card is as tall as its longer face and never covers the buttons */
.fc__card { display: grid; perspective: 1400px; }
.fc__face { grid-area: 1 / 1; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 28px; text-align: center; border-radius: var(--r-xl);
  background: var(--white); box-shadow: var(--shadow); backface-visibility: hidden; -webkit-backface-visibility: hidden; transition: transform .6s var(--ease); }
.fc__back { transform: rotateY(180deg); background: var(--t-lime); }
.fc__card.is-flipped .fc__front { transform: rotateY(-180deg); }
.fc__card.is-flipped .fc__back { transform: rotateY(0); }
.fc__word { margin: 0; font-family: 'Coolvetica Condensed', sans-serif; font-size: clamp(40px, 6vw, 64px); line-height: 1; color: var(--forest); }
.fc__word--sm { font-size: 34px; }
.fc__def { margin: 0; font-size: 19px; line-height: 1.45; max-width: 460px; }
.fc__def--q { font-size: 22px; font-weight: 600; }
.fc__ex { margin: 6px 0 0; font-style: italic; color: var(--muted); max-width: 460px; }
.fc__art { width: 120px; }
.fc__art--sm { width: 72px; }
.fc__art--lg { width: 170px; }
.fc__art svg { width: 100%; height: auto; display: block; }
.fc__ctl { margin-top: 20px; justify-content: center; flex-wrap: wrap; }
.fc__opts { width: 100%; }
.fc__type { display: flex; gap: 10px; width: 100%; }
.fc__type input { flex: 1; }
.fc__verdict { width: 100%; margin: 0; text-align: center; font-size: 17px; }
.fc__verdict.is-ok { color: var(--forest); font-weight: 700; }
@media (max-width: 899px) {
  .fc__face { padding: 22px 16px; }
  .own__form { grid-template-columns: 1fr; }
}
/* Quizzes (step 7) */
.qcard__best { margin-top: 10px; font-weight: 700; color: var(--forest); }
.qunits__list { list-style: none; margin: 14px 0 0; padding: 0; }
.qunits__list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--line); }
.qunits__list li > div { flex: 1; min-width: 200px; display: flex; flex-direction: column; }
.qunits__list li > div span { color: var(--forest); font-size: var(--fs-small); font-weight: 600; }
.qz .paper { margin-top: 0; }
.qc__time { margin: 0; font-variant-numeric: tabular-nums; color: var(--forest); transition: color var(--t-fast), transform var(--t-fast) var(--spring); }
.qc__time.is-low { color: #c0392b; }
.qc__time.is-up { transform: scale(1.15); }
.qc__time.is-down { animation: shake .4s var(--ease); }
.qc .lesson__top { display: flex; justify-content: space-between; align-items: center; }
.qc__bar i { transition: width .2s linear; }
.qc__stage { max-width: 640px; margin: 28px auto 0; }
.qc__q { animation: rise .25s var(--ease) both; }
.qc__text { font-size: 22px; line-height: 1.5; margin: 0 0 18px; }
.qc__key { display: inline-grid; place-items: center; width: 24px; height: 24px; margin-inline-end: 10px; border-radius: 50%; background: var(--bone); font-size: 13px; font-weight: 800; color: var(--muted); }
.qc .opt { animation: none; }
/* Tutors (lip sync) */
.tutor-art .mo { display: none; }
.tutor-art[data-mouth="rest"] .mo-rest, .tutor-art:not([data-mouth]) .mo-rest, .tutor-art[data-mouth="m"] .mo-m, .tutor-art[data-mouth="e"] .mo-e, .tutor-art[data-mouth="a"] .mo-a, .tutor-art[data-mouth="o"] .mo-o { display: inline; }
.tutor-art .blink { animation: blink 4.2s infinite; transform-box: fill-box; transform-origin: center; }

/* Feedback with the book character */
.fb-slot:empty { display: none; }
.fb-slot { outline: none; }
.fb { display: flex; align-items: center; gap: 12px; margin-top: 12px; animation: rise .32s var(--ease) both; }
.fb .book { width: 44px; height: 47px; flex: none; overflow: visible; }
.fb--ok .book { animation: pop .6s var(--spring); }
.fb p { margin: 0; font-size: 15.5px; line-height: 1.45; }
.fb--ok > p > b:first-child { color: var(--forest); }
.fb span { color: var(--muted); }

/* End of a unit test */
.page-end { margin-top: var(--gap); max-width: 880px; }
.page-end .btn[disabled] { opacity: .4; cursor: not-allowed; transform: none; box-shadow: none; }
.test-result { margin-bottom: var(--gap); max-width: 880px; animation: rise .5s var(--ease) both; outline: none; }
.test-result__art { width: 120px; height: 128px; }
.test-result__art .book { width: 100%; height: 100%; overflow: visible; animation: pop .9s var(--spring) .2s both; }
.test-result .book > path:first-child { fill: var(--bone); }
.test-result .t-num { color: var(--lime); font-variant-numeric: tabular-nums; }
.rd-testcard .t-h2 { line-height: 1; }

@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-6px); } 50% { transform: translateX(5px); } 75% { transform: translateX(-3px); } }
@media (max-width: 1180px) {
  .spread__cols { grid-template-columns: minmax(0, 1fr); }
  .spread__cols--ex { grid-template-columns: minmax(0, 1fr); }
  .coach { position: relative; top: 0; flex-direction: row; justify-content: flex-start; padding-top: 0; gap: 14px; }
  .coach .book { width: 64px; height: 68px; order: -1; }
  .coach__bub { position: relative; top: auto; inset-inline-start: auto; inset-inline-end: auto; transform: none; max-width: none; text-align: start; }
  [dir="rtl"] .coach__bub { transform: none; }
  .coach__bub.say::after { inset-inline-start: -12px; bottom: 14px; transform: rotate(135deg); }
}

/* ---------- Empty screens (sections built in later steps) ---------- */
.soon { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--gap); align-items: stretch; }
.soon .card { display: flex; flex-direction: column; justify-content: center; gap: 14px; }

/* ---------- The one loader (owner's Alimun loader) ---------- */
.loader { position: relative; width: var(--w, 148px); height: var(--w, 148px); display: grid; place-items: center; }
.loader .mark { width: 68%; height: 68%; z-index: 2; }
.loader .mark svg { width: 100%; height: 100%; }
.whirl { position: absolute; inset: 0; border-radius: 50%;
  -webkit-mask: radial-gradient(closest-side, transparent calc(100% - var(--ring, 2.5px)), #000 calc(100% - var(--ring, 2.5px)));
          mask: radial-gradient(closest-side, transparent calc(100% - var(--ring, 2.5px)), #000 calc(100% - var(--ring, 2.5px))); }
.whirl--outer { background: conic-gradient(from 0deg, transparent 0deg, color-mix(in oklab, var(--forest), transparent 92%) 70deg, color-mix(in oklab, var(--forest), transparent 55%) 200deg, var(--forest) 320deg, transparent 360deg); animation: spin 1.5s cubic-bezier(.62, .04, .4, .96) infinite; }
.whirl--inner { inset: 13%; --ring: 1.5px; background: conic-gradient(from 180deg, transparent 0deg, transparent 220deg, color-mix(in oklab, var(--gold), transparent 50%) 330deg, transparent 360deg); animation: spinr 2.6s linear infinite; opacity: .9; }
.spark { position: absolute; inset: 0; z-index: 1; animation: spin 1.5s cubic-bezier(.62, .04, .4, .96) infinite; }
.spark::before { content: ""; position: absolute; top: 0; left: 50%; width: 5px; height: 5px; margin-left: -2.5px; border-radius: 50%; background: var(--gold); }

.loading-screen {
  position: fixed; inset: 0; z-index: 90; background: #f4f2ec; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 26px;
  transition: opacity var(--t-slow) var(--ease), visibility 0s linear var(--t-slow);
}
.loading-screen p { margin: 0; font-weight: 600; color: var(--forest); min-height: 1.5em; text-align: center; padding: 0 24px; }
.loading-screen.is-done { opacity: 0; visibility: hidden; }
.loading-screen.is-done .loader { transform: scale(.92); }
.loading-screen .loader { transition: transform var(--t-slow) var(--ease); }

/* ---------- Motion ---------- */
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes spinr { to { transform: rotate(-360deg); } }
@keyframes bubIn { from { opacity: 0; transform: scale(.6) rotate(-6deg); } to { opacity: 1; transform: none; } }
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes grow { from { transform: scaleX(0); } }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.12) rotate(-4deg); } 100% { transform: scale(1); } }

.rise > * { animation: rise var(--t-slow) var(--ease) both; animation-delay: calc(var(--i, 0) * 60ms); }
.view.is-leaving { opacity: 0; transform: translateY(8px); transition: opacity var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }

/* Drawing animations (from docs/design/sources/zoo.css) */
.sway { animation: sway 3s ease-in-out infinite; transform-origin: 50% 95%; } @keyframes sway { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
.look { animation: look 4s ease-in-out infinite; } @keyframes look { 0%, 40%, 100% { transform: translateX(0); } 50%, 85% { transform: translateX(-6px); } }
.bob { animation: bob 1.4s ease-in-out infinite; } @keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px) rotate(-2deg); } }
.breathe { animation: breathe 3s ease-in-out infinite; transform-origin: 50% 100%; } @keyframes breathe { 0%, 100% { transform: scaleY(1); } 50% { transform: scaleY(.95); } }
.zz text { animation: zz 3s ease-in-out infinite; } .zz text:nth-child(2) { animation-delay: .5s; } .zz text:nth-child(3) { animation-delay: 1s; }
@keyframes zz { 0% { opacity: 0; transform: translateY(8px); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(-10px); } }
.crawl { animation: crawl 6s ease-in-out infinite; } @keyframes crawl { 0%, 100% { transform: translateX(-6px); } 50% { transform: translateX(6px); } }
.wag .tail { animation: wag .35s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 0 100%; } @keyframes wag { from { transform: rotate(-14deg); } to { transform: rotate(14deg); } }
.float { animation: float 3.2s ease-in-out infinite; } @keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
.book--idle [class="eye"], .book--idle .eye { animation: blink 4s infinite; transform-origin: center; transform-box: fill-box; }
@keyframes blink { 0%, 92%, 100% { transform: scaleY(1); } 95% { transform: scaleY(.1); } }
.book--happy { animation: pop .9s var(--spring) both; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
  .whirl--outer, .whirl--inner, .spark { animation-duration: 4s !important; animation-iteration-count: infinite !important; animation-timing-function: linear !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1180px) {
  .span-3 { grid-column: span 6; } .span-4 { grid-column: span 6; } .span-5, .span-7, .span-8 { grid-column: span 12; }
  .moods { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 899px) {
  .app { grid-template-columns: 1fr; }
  .side { display: none; }
  .top { padding: 12px 16px; }
  .top__brand { display: flex; align-items: center; gap: 8px; text-decoration: none; }
  .top__brand .book { width: 32px; height: 34px; overflow: visible; }
  .top__brand .wordmark { height: 19px; }
  .top__title { display: none; }
  .course-btn span { display: none; }
  .course-btn { padding: 0 6px; width: 44px; justify-content: center; }
  .view { padding: 4px 16px calc(var(--bar-h) + 40px + env(safe-area-inset-bottom)); }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .grid > * { grid-column: 1 / -1; }
  /* Cards inside a display:contents wrapper are grid items too: a "span 12" there would add eleven empty columns and squeeze the card */
  .grid [class*="span-"] { grid-column: 1 / -1; }
  .card { padding: 22px; border-radius: var(--r-lg); }
  .card__art { width: 92px; height: 92px; }
  .card__art--lg { width: 104px; height: 104px; }
  .soon { grid-template-columns: 1fr; }
  .type-row { grid-template-columns: 1fr; gap: 6px; }
  .moods { grid-template-columns: repeat(2, 1fr); }
  .t-num { font-size: 46px; }
  .paper { padding: 30px 20px 26px; border-radius: var(--r-lg); }
  .spread { padding: 26px 20px; border-radius: var(--r-lg); min-height: calc(100dvh - 230px); justify-content: flex-start; }
  .spread--end { justify-content: center; }
  .spread__head .t-display { font-size: 40px; }
  .spread__art { width: 84px; height: 84px; }
  .rd-text p, .rd-reading p, .ex-q, .spot { font-size: 17px; }
  .rd-ex__s { font-size: 18px; }
  .rd-tip { gap: 10px; }
  .rd-tip__art { width: 72px; height: 72px; }
  .match { gap: 10px 28px; }
  .tile--match { font-size: 15px; padding: 8px 10px; }
  .rd-table th, .rd-table td { padding: 10px 12px; font-size: 15px; }
  .test-result__art { width: 84px; height: 90px; }
  .lesson { min-height: calc(100dvh - 80px); }
  .lesson__nav { padding: 12px 0 calc(10px + env(safe-area-inset-bottom)); }
  .lesson__hint { font-size: var(--fs-tiny); }
  .xswitch__label { display: none; }
  .end__art { width: 150px; height: 150px; }
  body.is-reading .bar { display: none; }
  body.is-reading .view { padding-bottom: 16px; }

  .bar {
    position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; height: var(--bar-h);
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; padding: 0 6px; border-radius: 26px;
    background: var(--forest); box-shadow: 0 16px 40px rgba(8, 8, 8, .22);
  }
  .bar a, .bar button {
    height: 58px; margin: 0 2px; border: 0; background: none; border-radius: 20px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--on-forest); font-size: 11.5px; font-weight: 700; text-decoration: none; cursor: pointer; transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
  }
  .bar svg { width: 23px; height: 23px; transition: transform var(--t-mid) var(--spring); }
  .bar [aria-current="page"], .bar .is-active { background: var(--lime); color: var(--forest); }
  .bar [aria-current="page"] svg { transform: translateY(-1px) scale(1.08); }
}
@media (min-width: 900px) { .sheet, .sheet-scrim { display: none; } }

/* ---------- Tests (step 8, js/app/tests.js) ---------- */
.mt-card__meta { margin-top: 10px; color: var(--muted); }
.mt-note { color: var(--muted); max-width: 72ch; }
.mt-papers .qunits__list li > div span + span { color: var(--muted); font-weight: 500; }
.mt-bar { display: flex; flex-direction: column; gap: 6px; margin: 0 0 14px; }
.mt-bar .rd-back { margin: 0; }
.mt-bar__title { margin: 0; }
.mt-nav {
  position: sticky; top: 76px; z-index: 15; display: flex; align-items: center; gap: 12px; margin: 0 -8px 22px; padding: 8px;
  background: rgba(240, 239, 233, .92); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-radius: var(--r-md);
}
.mt-tabs { flex: 1; min-width: 0; display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.mt-tabs::-webkit-scrollbar { display: none; }
.mt-tab {
  flex: none; position: relative; border: 0; background: none; font: inherit; font-weight: 700; font-size: 14.5px; color: var(--muted);
  padding: 10px 14px 12px; cursor: pointer; border-bottom: 3px solid transparent; transition: color var(--t-fast), border-color var(--t-fast);
}
.mt-tab:hover { color: var(--forest); }
.mt-tab.is-on { color: var(--forest); border-bottom-color: var(--forest); }
.mt-tab i { position: absolute; top: 8px; inset-inline-end: 4px; width: 6px; height: 6px; border-radius: 50%; background: transparent; transition: background var(--t-mid); }
.mt-tab i.is-done { background: var(--gold); }
.mt-timer { flex: none; border: 0; background: var(--white); border-radius: 22px; padding: 9px 16px; font: inherit; font-weight: 700; font-size: 14.5px; color: var(--forest); cursor: pointer; font-variant-numeric: tabular-nums; box-shadow: inset 0 0 0 2px var(--line); }
.mt-timer__t.is-low { color: #b0472f; }
.mt-timer__t.is-over { color: #b0472f; }
.mt-part { display: grid; gap: 18px; margin-bottom: 26px; }
.mt-part__head .t-h2 { margin: 0; }
.mt-part__ref { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.mt-part__about { margin: 10px 0 0; max-width: 70ch; }
.mt-mat { display: grid; gap: 16px; align-content: start; }
.mt-qs { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 1100px) {
  .mt-part.has-mat { grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: start; }
  .mt-part.has-mat .mt-part__head { grid-column: 1 / -1; }
  .mt-part.has-mat .mt-mat { position: sticky; top: 150px; max-height: calc(100dvh - 170px); overflow: auto; padding-inline-end: 6px; }
  .mt-result ~ .mt-part.has-mat .mt-mat { position: static; max-height: none; }
}
.mt-text { background: var(--white); border-radius: var(--r-lg); padding: 22px clamp(18px, 3vw, 28px); box-shadow: inset 0 0 0 1px var(--line); }
.mt-text .t-h3 { margin: 0 0 10px; }
.mt-text p { margin: 0 0 12px; font-size: 17px; line-height: 1.65; }
.mt-text p:last-child { margin-bottom: 0; }
.mt-player { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; background: var(--t-mint); border-radius: var(--r-lg); padding: 16px 18px; }
.mt-player .t-small { margin: 0; }
.mt-player__meter { flex: 1; min-width: 120px; }
.mt-player__meter i { animation: none; transition: width .4s var(--ease); }
.mt-player.is-review { background: var(--white); box-shadow: inset 0 0 0 1px var(--line); }
.mt-script { width: 100%; }
.mt-script summary { cursor: pointer; font-weight: 700; color: var(--forest); font-size: 14.5px; }
.mt-script > div { margin-top: 10px; max-height: 360px; overflow: auto; }
.mt-script p { margin: 0 0 8px; line-height: 1.55; }
.mt-script b { color: var(--forest); margin-inline-end: 4px; }
.mt-foot { margin: 10px 0 30px; }
.mt-foot__note { margin: 0 0 12px; color: #b0472f; font-weight: 700; }
.mt-confirm { background: var(--white); border-radius: var(--r-lg); padding: 20px; box-shadow: var(--shadow); }
.mt-confirm .btn-row { margin-top: 14px; }
.mt-result { margin-bottom: 18px; }
.mt-parts { margin-bottom: 26px; }
.mt-parts__row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(80px, 1fr) auto; gap: 14px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); }
.mt-parts__row:first-of-type { border-top: 0; margin-top: 8px; }
.mt-parts__row b { font-variant-numeric: tabular-nums; color: var(--forest); }
/* IELTS chart */
.mt-chart { margin: 0; background: var(--white); border-radius: var(--r-lg); padding: 18px; box-shadow: inset 0 0 0 1px var(--line); }
.mt-chart figcaption { margin-bottom: 8px; }
.mt-chart figcaption span { color: var(--muted); }
.mt-chart__svg { width: 100%; height: auto; display: block; }
.mt-chart__svg text { font-size: 12px; fill: var(--muted); font-family: inherit; }
.mt-chart__grid { stroke: var(--line); stroke-width: 1; }
.mt-chart__key { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 8px; font-size: 14px; }
.mt-chart__key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; margin-inline-end: 6px; vertical-align: -1px; }
/* Exam kinds in the engine */
.kwt__key { margin: 0 0 8px; font-weight: 800; letter-spacing: .06em; color: var(--forest); }
.pick-list { margin: 0 0 14px; display: grid; gap: 6px; }
.pick-list > div { display: grid; grid-template-columns: 28px 1fr; gap: 8px; align-items: baseline; }
.pick-list dt { font-weight: 800; color: var(--forest); }
.pick-list dd { margin: 0; line-height: 1.5; }
.opts--letters .opt { min-width: 48px; padding: 10px 14px; text-align: center; }
.cloze { background: var(--white); border-radius: var(--r-md); padding: 18px 20px; font-size: 17.5px; line-height: 2.1; }
.cloze p { margin: 0 0 12px; }
.cloze p:last-child { margin-bottom: 0; }
.cloze .gap-in { margin: 0 2px; }
.cz { display: inline-flex; align-items: baseline; gap: 4px; }
.cz__base { font-size: 12.5px; font-weight: 800; letter-spacing: .05em; color: var(--muted); }
.cz.is-right .gap-in, .cz.is-right .gap-sel { background-color: var(--lime); }
.cz.is-wrong .gap-in, .cz.is-wrong .gap-sel { background-color: var(--t-coral); border-bottom-color: var(--coral); text-decoration: line-through; text-decoration-color: rgba(8, 8, 8, .35); }
.cz__fix { margin: 0 6px 0 2px; padding: 0 6px; border-radius: 6px; background: var(--lime); color: var(--forest); }
.cz-why { margin-top: 14px; display: grid; gap: 6px; }
.cz-why__row { margin: 0; padding: 8px 12px; border-radius: var(--r-sm); background: var(--white); font-size: 15px; line-height: 1.5; }
.cz-why__row b { color: var(--forest); margin-inline-end: 6px; }
.cz-why__row.is-wrong { background: var(--t-coral); }
.wr-choose { display: grid; gap: 10px; margin: 6px 0 14px; }
.wr-task { text-align: start; border: 0; background: var(--white); border-radius: var(--r-md); padding: 14px 18px; font: inherit; cursor: pointer; box-shadow: inset 0 0 0 2px var(--line); transition: box-shadow var(--t-fast), background var(--t-fast); }
.wr-task:hover { box-shadow: inset 0 0 0 2px var(--forest); }
.wr-task.is-picked { background: var(--t-lime); box-shadow: inset 0 0 0 2px var(--forest); }
.wr-task p, .wr-brief p { margin: 0 0 8px; line-height: 1.55; }
.wr-task p:last-child, .wr-brief p:last-child { margin-bottom: 0; }
.wr { display: grid; gap: 10px; margin-top: 8px; }
.wr-brief { background: var(--white); border-radius: var(--r-md); padding: 14px 18px; }
.write-in { width: 100%; min-height: 260px; resize: vertical; border: 0; border-radius: var(--r-md); padding: 16px 18px; font: inherit; font-size: 17px; line-height: 1.6; background: var(--white); box-shadow: inset 0 0 0 2px var(--line); outline: none; transition: box-shadow var(--t-fast); }
.write-in:focus { box-shadow: inset 0 0 0 2px var(--forest); }
.wr-count { margin: 0; color: var(--muted); font-variant-numeric: tabular-nums; }
.wr-count.is-off { color: #b0472f; font-weight: 700; }
.wr-text { background: var(--white); border-radius: var(--r-md); padding: 14px 18px; }
.wr-text p { margin: 0 0 10px; line-height: 1.6; }
.talk-tutor { width: 130px; margin: 0 auto 4px; }
.talk-tutor svg { width: 100%; height: auto; display: block; }
.talk-item .hear-row { flex-wrap: wrap; align-items: center; }
.talk-q { margin: 0 0 12px; font-size: 18.5px; line-height: 1.55; }
.talk-time { color: var(--muted); font-variant-numeric: tabular-nums; }
.talk-scene { margin: 0 0 12px; display: grid; gap: 10px; }
.talk-scene--two { grid-template-columns: 1fr 1fr; }
.talk-scene svg { width: 100%; height: auto; display: block; border-radius: var(--r-md); }
.talk-notes { background: var(--white); border-radius: var(--r-md); padding: 14px 18px; margin: 0 0 12px; text-align: center; }
.talk-notes p { margin: 4px 0; font-weight: 600; }
.mark-slot:empty { display: none; }
.mt-mark { margin-top: 12px; background: var(--white); border-radius: var(--r-md); padding: 16px 18px; box-shadow: inset 0 0 0 2px var(--forest); }
.mt-mark.is-wait, .mt-mark.is-note { display: flex; align-items: center; gap: 12px; box-shadow: inset 0 0 0 1px var(--line); }
.mt-mark .t-h3 { margin: 0 0 10px; font-size: 19px; }
.mt-mark__row { padding: 8px 0; border-top: 1px solid var(--line); }
.mt-mark__row:first-of-type { border-top: 0; }
.mt-mark__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.mt-mark__top span { color: var(--forest); font-weight: 700; font-variant-numeric: tabular-nums; }
.mt-mark__row .t-small { margin: 6px 0 0; }
.mt-mark__sum { margin: 10px 0 0; }
.mt-mark__better { margin-top: 10px; background: var(--t-lime); border-radius: var(--r-sm); padding: 10px 14px; }
.mt-mark__better p { margin: 0; }
.mt-mark .t-tiny { margin: 10px 0 0; color: var(--muted); }
.model { margin-top: 10px; }
.model summary { cursor: pointer; font-weight: 700; color: var(--forest); }
.model > div { margin-top: 8px; background: var(--white); border-radius: var(--r-md); padding: 14px 18px; }
.model p { margin: 0 0 10px; line-height: 1.6; }
@media (max-width: 899px) {
  .mt-nav { top: 64px; margin-inline: -4px; }
  .mt-timer { padding: 8px 12px; font-size: 13.5px; }
  .cloze { padding: 14px; font-size: 16.5px; }
  .mt-parts__row { grid-template-columns: 1fr auto; }
  .mt-parts__row .meter { grid-column: 1 / -1; grid-row: 2; }
}
.mt-result { max-width: none; }
.talk-scene { max-width: 440px; }
.talk-scene--two { max-width: 760px; }

/* ---------- Library (step 9, js/app/library.js) ---------- */
.lb-levels { display: flex; gap: 4px; background: var(--white); border-radius: 26px; padding: 4px; box-shadow: inset 0 0 0 1px var(--line); }
.lb-level { padding: 9px 16px; border-radius: 22px; font-weight: 700; font-size: 14.5px; color: var(--muted); text-decoration: none; transition: background var(--t-fast), color var(--t-fast); }
.lb-level:hover { color: var(--forest); }
.lb-level.is-on { background: var(--forest); color: var(--lime); }
.lb-section-p { margin: -8px 0 4px; color: var(--muted); max-width: 70ch; }
.lb-card__meta, .lb-genre { margin: 10px 0 0; color: var(--muted); }
.lb-genre { margin: 10px 0 0; font-weight: 600; }
.lb-body { display: grid; gap: 22px; }
@media (min-width: 1100px) {
  .lb-body { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
  .lb-mat { position: sticky; top: 96px; max-height: calc(100dvh - 116px); overflow: auto; padding-inline-end: 6px; }
}
.lb-mat, .lb-qs { display: grid; gap: 16px; align-content: start; min-width: 0; }
.lb-qs .t-h2 { margin: 0; }
.lb-player { background: var(--t-mint); border-radius: var(--r-lg); padding: 18px 20px; display: grid; gap: 12px; }
.lb-player .t-body { margin: 0; }
.lb-player__meter i { animation: none; transition: width .4s var(--ease); }
.lb-script .t-h3 { margin: 0 0 10px; }
.lb-lines { background: var(--white); border-radius: var(--r-lg); padding: 18px 20px; box-shadow: inset 0 0 0 1px var(--line); }
.lb-lines hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.lb-line, .lb-para { margin: 0 0 10px; line-height: 1.65; border-radius: 8px; transition: background var(--t-mid), box-shadow var(--t-mid); }
.lb-line b { color: var(--forest); margin-inline-end: 4px; }
.lb-line.is-speaking, .lb-para.is-speaking { background: var(--t-lime); box-shadow: 0 0 0 6px var(--t-lime); }
.lb-text { background: var(--white); border-radius: var(--r-lg); padding: 22px clamp(18px, 3vw, 28px); box-shadow: inset 0 0 0 1px var(--line); font-size: 17.5px; }
.lb-para:last-child { margin-bottom: 0; }
.gl { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 2px; text-underline-offset: 4px; border-radius: 4px; }
.gl:hover, .gl[aria-expanded="true"] { background: var(--t-sun); }
.gl-tip { display: inline-block; margin: 0 4px; padding: 2px 10px; border-radius: 10px; background: var(--forest); color: var(--bone); font-size: 14.5px; line-height: 1.5; animation: pop .3s var(--spring); }
.lb-words .t-h3 { margin: 0 0 10px; }
.lb-wl { margin: 0; display: grid; gap: 0; }
.lb-wl > div { display: grid; grid-template-columns: minmax(110px, 0.8fr) minmax(0, 1.4fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.lb-wl > div:first-child { border-top: 0; }
.lb-wl dt { font-weight: 700; color: var(--forest); }
.lb-wl dd { margin: 0; color: var(--muted); }
.lb-words__note { margin: 8px 0 0; color: var(--forest); font-weight: 600; }
.lb-words__note:empty { display: none; }
.lb-end { margin-top: 8px; }
@media (max-width: 599px) { .lb-wl > div { grid-template-columns: 1fr; gap: 2px; } .lb-levels { width: 100%; overflow-x: auto; } }

/* ---------- Classes and calendar (step 10, js/app/classes.js) ---------- */
.cl-zone { color: var(--muted); margin: 0; }
.cl-next__in { margin: 10px 0 0; color: var(--on-forest); font-weight: 600; }
.cl-next__note { margin: 14px 0 0; color: var(--on-forest); }
.btn.is-off { opacity: .45; cursor: default; pointer-events: none; }
.cl-up .qunits__list li > div span { color: var(--muted); font-weight: 500; }
.cl-flash { margin: 0 0 14px; padding: 12px 16px; border-radius: var(--r-md); background: var(--t-lime); color: var(--forest); font-weight: 700; }
.cl-err { color: #b0472f; font-weight: 600; }
.cal__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cal__nav { display: flex; align-items: center; gap: 10px; }
.cal__nav .btn { width: 40px; padding: 0; justify-content: center; }
[dir="rtl"] .cal__nav .btn svg { transform: scaleX(-1); }
.cal__month { min-width: 150px; text-align: center; font-size: 17px; }
.cal__key { margin: 10px 0 14px; color: var(--muted); display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.cal__key .dot { margin-inline-start: 8px; }
.cal__key .dot:first-child { margin-inline-start: 0; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; flex: none; }
.dot--class { background: var(--forest); }
.dot--hw { background: var(--gold); }
.dot--oto { background: var(--coral); }
.cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__wd { text-align: center; font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 4px 0; text-transform: capitalize; }
.cal__cell { position: relative; min-height: 58px; border: 0; border-radius: var(--r-sm); background: var(--bone); font: inherit; font-weight: 600; color: var(--ink); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; transition: background var(--t-fast), box-shadow var(--t-fast); }
.cal__cell.is-pad { background: none; cursor: default; }
.cal__cell:hover:not(.is-pad) { box-shadow: inset 0 0 0 2px var(--forest); }
.cal__cell.is-today span { background: var(--lime); color: var(--forest); border-radius: 50%; width: 30px; height: 30px; display: grid; place-items: center; }
.cal__cell.is-on { background: var(--forest); color: var(--bone); }
.cal__cell.is-on .dot--class { background: var(--lime); }
.cal__dots { display: flex; gap: 4px; height: 8px; }
.cal__day { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.cal__day .t-h3 { margin: 0 0 10px; text-transform: capitalize; }
.cal__ev { display: flex; align-items: baseline; gap: 10px; margin: 0 0 8px; }
.cal__none { margin: 0; color: var(--muted); }
.cl-oto__row { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 14px 0; border-top: 1px solid var(--line); }
.cl-oto__row:first-of-type { border-top: 0; }
.cl-oto__row .t-h3 { margin: 0 0 4px; }
.cl-oto__row .t-body { margin: 0; }
.cl-oto__why { margin: 6px 0 0; color: var(--muted); }
.cl-oto__notes-h { margin: 20px 0 8px; }
.cl-note-mini { padding: 10px 0; border-top: 1px solid var(--line); }
.cl-note-mini p { margin: 0 0 4px; }
.cl-pick { margin-top: 10px; background: var(--bone); border-radius: var(--r-lg); padding: 18px 20px; outline: none; display: grid; gap: 10px; }
.cl-pick .t-h3, .cl-pick .t-small { margin: 0; }
.cl-pick__d { margin: 6px 0; font-weight: 700; text-transform: capitalize; }
.cl-pick__times { display: flex; flex-wrap: wrap; gap: 8px; }
.cl-pick__times .opt { min-width: 76px; text-align: center; animation: none; }
.cl-notes .cl-note { border-top: 1px solid var(--line); padding: 12px 0; }
.cl-note summary { cursor: pointer; display: flex; flex-wrap: wrap; gap: 4px 14px; align-items: baseline; list-style: none; }
.cl-note summary::-webkit-details-marker { display: none; }
.cl-note summary b { text-transform: capitalize; }
.cl-note summary span { color: var(--forest); font-weight: 600; }
.cl-note__body { display: grid; gap: 14px; margin-top: 12px; }
.cl-note__body h4 { margin: 0 0 4px; font-size: 14px; color: var(--muted); }
.cl-note__body p { margin: 0; line-height: 1.6; }
.cl-note__teacher { background: var(--t-lime); border-radius: var(--r-md); padding: 12px 16px; }
.cl-live { display: flex; flex-direction: column; gap: 14px; min-height: calc(100dvh - 120px); }
.cl-live__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.cl-live__top .rd-back, .cl-live__top .t-h2 { margin: 0; }
.cl-live__body { flex: 1; display: grid; gap: 16px; }
@media (min-width: 1100px) { .cl-live__body { grid-template-columns: minmax(0, 1fr) 300px; } }
.cl-live__frame { min-height: 70dvh; border-radius: 20px; background: var(--ink); overflow: hidden; display: grid; }
.cl-live__wait { display: grid; place-items: center; align-content: center; gap: 16px; padding: 24px; text-align: center; }
.cl-live__wait .t-body { color: var(--bone); max-width: 46ch; }
.cl-live__side { align-self: start; }
.cl-live__side .t-h3 { margin: 0 0 10px; }
@media (max-width: 599px) {
  .cal__cell { min-height: 46px; gap: 3px; font-size: 14px; }
  .cal__cell.is-today span { width: 26px; height: 26px; }
  .cal__grid { gap: 3px; }
  .cl-live__frame { min-height: 62dvh; }
}
.cl-next .mt-confirm { margin-top: 16px; color: var(--ink); }

/* ---------- Homework (step 11, js/app/homework.js) ---------- */
.hw-list .qunits__list li > div span { color: var(--muted); font-weight: 500; }
.hw-list .qunits__list li > div span.hw-late { color: #b0472f; font-weight: 700; }
.hw-fb__row { padding: 14px 0; border-top: 1px solid var(--line); }
.hw-fb__row:first-of-type { border-top: 0; }
.hw-fb__row .t-small { margin: 0 0 6px; color: var(--muted); }
.hw-fb__row p { margin: 0 0 8px; }
.hw-body { display: grid; gap: 18px; }
@media (min-width: 1100px) { .hw-body { grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); align-items: start; } .hw-task { position: sticky; top: 96px; } }
.hw-task .t-h3, .hw-edit .t-h3 { margin: 0 0 10px; }
.hw-task .t-body p { margin: 0 0 10px; line-height: 1.6; }
.hw-min { margin: 6px 0 0; color: var(--forest); font-weight: 700; }
.hw-status { margin: -4px 0 12px; color: var(--forest); font-weight: 600; }
.hw-in { min-height: 300px; }
.hw-edit .wr-count { margin: 8px 0 0; }
.hw-actions { margin-top: 16px; }
.hw-edit [data-msg] .mt-confirm, .hw-edit [data-msg] .cl-flash { margin-top: 14px; }
.hw-coach { margin-top: 14px; }
.hw-coach q { font-weight: 700; color: var(--forest); }
.hw-coach__good { margin: 0 0 6px; }
.hw-coach__note { margin: 12px 0 0; color: var(--muted); }
.hw-mark .t-num { margin: 8px 0 0; }
.hw-mark__fb { margin-top: 14px; }
.hw-mark__fb p { margin: 0 0 8px; }
.hw-answer p { margin: 0 0 10px; line-height: 1.6; }

/* ---------- Progress (step 12, js/app/progress.js) ---------- */
.pg-ladder { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 6px; margin-top: 22px; }
.pg-step { text-align: center; padding: 10px 0; border-radius: var(--r-sm); background: rgba(240, 239, 233, .1); color: var(--on-forest); font-weight: 700; }
.pg-step.is-past { background: rgba(206, 255, 101, .22); color: var(--bone); }
.pg-step.is-now { background: var(--lime); color: var(--forest); }
.pg-level__p { margin: 14px 0 0; color: var(--on-forest); }
.pg-level__meter { margin-top: 10px; }
.pg-words { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.pg-words .card__art { width: 84px; }
.pg-words .t-num { margin: 4px 0 0; }
.pg-words .t-h3, .pg-words .t-small { margin: 0; }
.pg-words .linkish { margin-top: auto; }
.pg-skills > .t-body { margin: 6px 0 10px; color: var(--muted); }
.pg-skill { padding: 12px 0; border-top: 1px solid var(--line); }
.pg-skill:first-of-type { border-top: 0; }
.pg-skill__top { display: flex; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.pg-skill__top span { color: var(--forest); font-weight: 800; font-variant-numeric: tabular-nums; }
.pg-skill .t-small { margin: 6px 0 0; color: var(--muted); }
.meter.is-empty { background: repeating-linear-gradient(90deg, var(--faint) 0 6px, transparent 6px 10px); }
.pg-rate { color: var(--forest); font-weight: 800; font-variant-numeric: tabular-nums; }
.pg-lessons .qunits__list li > div span { color: var(--muted); font-weight: 500; }
.pg-focus .t-h3 { margin: 0 0 6px; }
.pg-focus .t-body { margin: 0; }
.pg-history > .t-body { margin: 6px 0 0; color: var(--muted); }
.pg-weeks { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 170px; margin-top: 18px; }
.pg-week { height: 100%; display: grid; grid-template-rows: 18px 1fr 18px; align-items: end; justify-items: center; }
.pg-week i { width: 100%; max-width: 34px; border-radius: 4px 4px 0 0; background: var(--forest); align-self: end; transition: opacity var(--t-fast); }
.pg-week i.is-zero { background: var(--line); }
.pg-week:hover i { opacity: .8; }
.pg-week__v { font-size: 12px; font-weight: 700; color: var(--muted); }
.pg-week__l { font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.pg-ms-h { margin: 22px 0 0; }
.pg-ms li > div span { color: var(--muted); font-weight: 500; }
@media (max-width: 599px) { .pg-ladder { gap: 4px; } .pg-step { font-size: 13px; padding: 8px 0; } .pg-weeks { gap: 3px; height: 140px; } .pg-week__l { font-size: 10px; } }

/* ---------- Messages (step 13, js/app/messages.js) ---------- */
.ms { display: grid; grid-template-columns: 320px minmax(0, 1fr); gap: 18px; align-items: stretch; min-height: calc(100dvh - 260px); }
.ms-list { background: var(--white); border-radius: var(--r-lg); padding: 10px; display: flex; flex-direction: column; gap: 4px; box-shadow: var(--shadow); align-self: start; }
.ms-conv { display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: background var(--t-fast); }
.ms-conv:hover { background: var(--bone); }
.ms-conv.is-on { background: var(--t-lime); }
.ms-conv__art { width: 44px; height: 44px; border-radius: 50%; background: var(--t-mint); overflow: hidden; display: grid; place-items: center; }
.ms-conv__art svg { width: 100%; height: auto; display: block; }
.ms-conv__txt { display: flex; flex-direction: column; min-width: 0; }
.ms-conv__txt b { font-size: 15.5px; }
.ms-conv__txt > span { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ms-conv__pv { margin-top: 2px; }
.ms-conv.is-unread .ms-conv__pv { color: var(--ink); font-weight: 600; }
.ms-conv__new { font-size: 13px; font-weight: 800; color: var(--forest); white-space: nowrap; }
.ms-main { background: var(--white); border-radius: var(--r-lg); box-shadow: var(--shadow); display: flex; flex-direction: column; min-height: 460px; height: calc(100dvh - 250px); overflow: hidden; }
.ms-empty { margin: auto; text-align: center; padding: 30px; display: grid; justify-items: center; gap: 12px; }
.ms-empty__art { width: 140px; }
.ms-head { padding: 16px 22px; border-bottom: 1px solid var(--line); }
.ms-head .t-h3 { margin: 0; }
.ms-head .t-small { margin: 4px 0 0; color: var(--muted); }
.ms-back { display: none; }
.ms-msgs { flex: 1; overflow-y: auto; padding: 18px 22px; display: flex; flex-direction: column; gap: 10px; background: var(--bone); }
.ms-first { margin: auto; text-align: center; color: var(--muted); max-width: 40ch; }
.ms-day { align-self: center; margin: 8px 0 2px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ms-msg { max-width: min(78%, 560px); align-self: flex-start; display: flex; flex-direction: column; gap: 3px; }
.ms-msg.is-me { align-self: flex-end; align-items: flex-end; }
.ms-msg__who { margin: 0 0 0 4px; font-size: 12.5px; font-weight: 700; color: var(--muted); }
.ms-msg.is-teacher .ms-msg__who { color: var(--forest); }
.ms-bub { background: var(--white); border-radius: 4px 18px 18px 18px; padding: 10px 14px; line-height: 1.5; font-size: 15.5px; box-shadow: 0 1px 2px rgba(8, 8, 8, .06); overflow-wrap: anywhere; }
.ms-msg.is-teacher .ms-bub { background: var(--t-mint); }
.ms-msg.is-me .ms-bub { background: var(--lime); color: var(--forest); border-radius: 18px 4px 18px 18px; }
.ms-msg.is-pending { opacity: .6; }
.ms-msg__time { margin: 0 4px; font-size: 11.5px; color: var(--muted); }
.ms-form { display: flex; gap: 10px; align-items: flex-end; padding: 12px 16px; border-top: 1px solid var(--line); }
.ms-in { flex: 1; resize: none; min-height: 48px; max-height: 180px; border: 0; border-radius: 22px; padding: 13px 18px; font: inherit; font-size: 15.5px; background: var(--bone); outline: none; box-shadow: inset 0 0 0 2px transparent; transition: box-shadow var(--t-fast); }
.ms-in:focus { box-shadow: inset 0 0 0 2px var(--forest); }
.ms-err { margin: 0 18px 10px; color: #b0472f; font-weight: 600; }
.ms-err:empty { display: none; }
.ms-sample { grid-column: 1 / -1; margin: 0; }
@media (max-width: 899px) {
  .ms { grid-template-columns: 1fr; min-height: 0; }
  .ms.has-conv .ms-list { display: none; }
  .ms:not(.has-conv) .ms-main { display: none; }
  .ms-back { display: inline-flex; margin: 0 0 6px; }
  .ms-main { min-height: 0; height: calc(100dvh - 200px); }
  .ms-msg { max-width: 88%; }
}

/* ---------- Settings (step 14, js/app/settings.js) ---------- */
.st-form { display: grid; gap: 16px; margin-top: 18px; max-width: 760px; }
.st-form--cols { max-width: none; gap: 22px; }
.st-col { display: grid; gap: 16px; align-content: start; min-width: 0; }
@media (min-width: 1000px) { .st-form--cols { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 40px; } .st-save { grid-column: 1 / -1; } }
.st-save { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; padding-top: 18px; border-top: 1px solid var(--line); }
.st-save .st-msg { min-height: 0; }
.st-row { display: grid; gap: 16px; }
@media (min-width: 700px) { .st-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.st-field { display: grid; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.st-lbl { font-weight: 700; font-size: 15px; padding: 0; }
.st-hint, .st-note { color: var(--muted); margin: 0; }
.st-note { margin-top: -8px; }
.st-in { width: 100%; min-width: 0; min-height: 48px; border: 0; border-radius: var(--r-sm); padding: 12px 14px; font: inherit; font-size: 16px; background: var(--white); box-shadow: inset 0 0 0 2px var(--line); outline: none; transition: box-shadow var(--t-fast); }
.st-in:focus { box-shadow: inset 0 0 0 2px var(--forest); }
.st-in:disabled { background: var(--bone); color: var(--muted); }
.st-days { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 6px; }
@media (min-width: 560px) and (max-width: 999px) { .st-days { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.st-day { display: flex; align-items: center; gap: 10px; cursor: pointer; min-height: 46px; padding: 0 14px; border-radius: var(--r-sm); background: var(--bone); box-shadow: inset 0 0 0 2px transparent; transition: box-shadow var(--t-fast), background var(--t-fast); }
.st-day:hover { box-shadow: inset 0 0 0 2px var(--line); }
.st-day:has(input:checked) { background: var(--white); box-shadow: inset 0 0 0 2px var(--forest); font-weight: 700; }
.st-day:has(input:focus-visible) { outline: 3px solid var(--forest); outline-offset: 2px; }
.st-day input { width: 20px; height: 20px; accent-color: var(--forest); margin: 0; }
.st-ticks { display: grid; gap: 10px; margin-top: 14px; }
.st-day input:disabled + span { color: var(--muted); }
.st-msg { margin: 0; min-height: 1.4em; color: var(--forest); font-weight: 600; }
.st-msg.is-bad { color: #b0472f; }
.st-msg--light { color: var(--lime); margin-top: 12px; }
.st-msg--light.is-bad { color: var(--coral); }
.st-plan .st-msg:empty { display: none; }
.st-plan .linkish { color: var(--lime); }
.st-plan > .t-small:last-child { margin-top: 10px !important; }
.st-plan__p { margin: 10px 0 0; color: var(--on-forest); }
.st-card { align-self: start; }
@media (max-width: 599px) {
  .st-save .btn, .st-plan .btn, .st-acc-foot .btn { width: 100%; justify-content: center; }
  .st-acc-foot { flex-direction: column; align-items: stretch; text-align: center; }
  .st-stage { flex-direction: row; justify-content: space-between; align-items: center; gap: 12px; min-height: 0; padding: 16px 18px; }
  .st-stage .bub { position: relative; top: auto; inset-inline-start: auto; flex: 1 1 0; max-width: none; }
  .st-stage > svg { flex: 0 0 auto; width: auto; height: 104px; max-width: 45%; }
}
.st-acc-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 22px; margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--line); }
/* Deleting the account (js/app/delete-account.js): what the learner can do instead */
.dl-offers { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; margin-top: 22px; }
.dl-offer { display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--r-md); background: var(--t-lime); }
.dl-offer .btn-row { margin-top: auto; }
.dl-note { margin-top: 18px; padding: 14px 16px; border-radius: var(--r-sm); background: var(--t-sun); }

/* ---------- Teacher dashboard (step 15, js/app/teach.js) ---------- */
.tt-week { display: grid; margin-top: 10px; }
.tt-week__day { margin: 14px 0 2px; color: var(--muted); font-weight: 700; }
.tt-row { display: grid; grid-template-columns: 84px minmax(0, 1fr); gap: 14px; align-items: baseline; padding: 12px 0; border-top: 1px solid var(--line); color: inherit; text-decoration: none; }
.tt-week__day + .tt-row, .tt-week > .tt-row:first-child { border-top: 0; }
a.tt-row:hover b { text-decoration: underline; text-underline-offset: 3px; }
.tt-row__time { font-weight: 700; color: var(--forest); font-variant-numeric: tabular-nums; }
.tt-row b { display: block; font-weight: 700; }
.tt-row small { display: block; color: var(--muted); font-size: 14px; margin-top: 2px; }
.avatar { text-decoration: none; }
.tt-row--wide { grid-template-columns: 130px minmax(0, 1fr); }
@media (max-width: 520px) { .tt-row, .tt-row--wide { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Teacher dashboard, Classes (step 15 part 2, js/app/teach-classes.js) ---------- */
.tc-open-note { margin: 12px 0 0; color: var(--on-forest); }
.tc-row-btn { margin-top: 10px; }
.tc-row-link { display: inline-block; margin-top: 6px; font-size: 14px; }
.tc-past .tt-row { grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; }
@media (max-width: 520px) { .tc-past .tt-row { grid-template-columns: 1fr; } .tc-past .tt-row .btn { justify-self: start; } }
.tc-flash { margin: -6px 0 18px; }
.tc-ta { resize: vertical; min-height: 84px; line-height: 1.5; }
.tc-words { display: grid; gap: 10px; margin-top: 8px; }
.tc-word { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 8px; align-items: center; }
@media (max-width: 700px) { .tc-word { grid-template-columns: minmax(0, 1fr) auto; } .tc-word [name="w_word"] { grid-column: 1; } .tc-word__x { grid-column: 2; grid-row: 1; } .tc-word [name="w_def"], .tc-word [name="w_ex"] { grid-column: 1 / -1; } }
.tc-word__x { padding-inline: 12px; }
.tc-pub { align-self: start; position: sticky; top: 96px; }
.tc-pub .t-body, .tc-pub .t-small { color: var(--on-forest); }
.tc-slot { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; padding: 2px 0; }
.tc-slot b { display: inline; }
.tc-slot small { color: var(--muted); }
.tc-side { display: flex; flex-direction: column; min-height: 0; }
.tc-msgs { flex: none; height: 300px; border-radius: 16px; padding: 12px; margin-bottom: 10px; }
.tc-side .ms-form { display: flex; gap: 8px; align-items: flex-end; }
@media (min-width: 1100px) { .cl-live__body:has(.tc-side) { grid-template-columns: minmax(0, 1fr) 340px; } }
.tc-side .ms-form { padding: 0; border: 0; }

/* ---------- Teacher dashboard, Students (step 15 part 3, js/app/teach-students.js) ---------- */
.ts-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ts-flag { grid-template-columns: minmax(0, 1fr); }
.ts-scroll { overflow-x: auto; margin-top: 14px; -webkit-overflow-scrolling: touch; }
.ts-table { border-collapse: collapse; width: 100%; min-width: 520px; font-size: 15px; }
.ts-table th, .ts-table td { padding: 10px 8px; text-align: center; border-top: 1px solid var(--line); white-space: nowrap; }
.ts-table thead th { border-top: 0; font-size: 13px; font-weight: 700; color: var(--muted); }
.ts-table th[scope="row"], .ts-table thead th:first-child { text-align: start; }
.ts-dot { display: inline-block; width: 14px; height: 14px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--line); vertical-align: middle; }
.ts-dot.is-on { background: var(--forest); box-shadow: none; }
.ts-dot.is-na { box-shadow: none; background: var(--bone); }
.ts-key { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 12px; }
.ts-bookrow { grid-template-columns: minmax(0, 1fr); }
.ts-bookrow .meter { display: block; margin-top: 8px; }
.ts-notelist { margin-top: 18px; }
.ts-notelist .is-private .tt-row__time { color: var(--muted); }
.ts-note__text { display: block; line-height: 1.55; }
.ts-del { margin-top: 6px; font-size: 14px; }

/* ---------- Teacher dashboard, Homework (step 15 part 4, js/app/teach-homework.js) ---------- */
.th-wait .tt-row { border-color: rgba(240, 239, 233, .16); color: var(--bone); }
.th-wait .tt-row__time { color: var(--lime); }
.th-wait .tt-row small { color: var(--on-forest); }
.th-kinds { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px 18px; margin-top: 4px; }
.th-draft { align-self: start; position: sticky; top: 96px; }
.th-draft[hidden] { display: none; }
.th-in { grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; }
@media (max-width: 520px) { .th-in { grid-template-columns: 1fr; } .th-in .btn { justify-self: start; } }
.th-sub { margin: 20px 0 6px; }
.th-late { color: #b0472f; font-weight: 600; }
.th-mark { align-self: start; }
.th-score { max-width: 160px; }
[data-kindbox] { display: grid; gap: 16px; }
.hw-body .card > .t-h3 + .hw-answer { margin-top: 12px; }

/* ---------- Teacher dashboard, Material (step 15 part 5, js/app/teach-material.js) ---------- */
.tm-layout { display: grid; gap: 18px; }
@media (min-width: 1100px) { .tm-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } .tm-side { position: sticky; top: 96px; } }
.tm-main, .tm-side { display: grid; gap: 18px; min-width: 0; }
.tm-block { display: grid; gap: 12px; }
.tm-block__top { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.tm-block__tools { display: flex; gap: 6px; }
.tm-rows { display: grid; gap: 12px; }
.tm-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; align-items: start; padding: 14px; border-radius: var(--r-sm); background: var(--bone); }
.tm-row__fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 8px 10px; min-width: 0; }
.tm-f { display: grid; gap: 4px; min-width: 0; font-size: 13px; font-weight: 600; color: var(--muted); }
.tm-f--wide { grid-column: 1 / -1; }
.tm-f .st-in { padding: 10px 12px; font-size: 15px; }
.tm-issue { margin: 0; color: #b0472f; font-weight: 600; grid-column: 1 / -1; }
.tm-issue:empty { display: none; }
.tm-add__row { display: flex; gap: 10px; margin-top: 10px; flex-wrap: wrap; }
.tm-add__row .st-in { flex: 1; min-width: 200px; }
.tm-src { display: grid; gap: 8px; margin: 12px 0; }
.tm-save .t-body { color: var(--on-forest); }
.tm-del { justify-self: start; font-size: 14px; }
.tm-try { max-width: 900px; }
.st-field[hidden], .st-row[hidden] { display: none; }

/* ---------- Teacher dashboard, Messages, Payouts, Settings (step 15 part 6) ---------- */
.tms .ms-conv { grid-template-columns: minmax(0, 1fr) auto; }
.tms .tm-start { display: grid; gap: 6px; padding: 12px; margin-top: 6px; border-top: 1px solid var(--line); }
.tp-note { margin: 16px 0 0; color: var(--on-forest); }
.tp-row { grid-template-columns: 130px minmax(0, 1fr); }

/* ---------- Admin (step 15, admin pages, js/app/admin.js) ---------- */
.ad-att { grid-template-columns: minmax(0, 1fr); }
.ad-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; margin-top: 14px; }
.ad-tile { display: grid; gap: 2px; padding: 16px; border-radius: var(--r-md); background: var(--bone); color: inherit; text-decoration: none; transition: transform var(--t-fast) var(--ease); }
.ad-tile:hover { transform: translateY(-2px); }
.ad-tile b { font-weight: 700; }
.ad-tile small { color: var(--muted); font-size: 13px; }
.ad-today { grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; }
@media (max-width: 520px) { .ad-today { grid-template-columns: 1fr; } .ad-today .btn { justify-self: start; } }
.ad-job { grid-template-columns: minmax(0, 1fr); }
.ad-job.is-bad b { color: #b0472f; }
.ad-filters { display: grid; grid-template-columns: minmax(0, 2fr) repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 8px; }
.ad-filters:has(> :only-child) { grid-template-columns: minmax(0, 1fr); }
@media (max-width: 760px) { .ad-filters { grid-template-columns: 1fr 1fr; } .ad-filters > [type="search"] { grid-column: 1 / -1; } }
.ad-tabs { margin: 0 0 14px; }
.ad-bulk { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 6px 0 4px; min-height: 40px; }
.ad-trow { grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; }
.ad-trow > input { width: 20px; height: 20px; accent-color: var(--forest); margin: 0; }
.ad-trow .linkish { padding: 0; }
@media (max-width: 520px) { .ad-trow { grid-template-columns: auto minmax(0, 1fr); } .ad-trow > .btn { grid-column: 2; justify-self: start; } }
.ad-kv { grid-template-columns: 110px minmax(0, 1fr); align-items: baseline; }
.ad-confirm { display: grid; gap: 12px; margin-top: 12px; color: var(--ink); }
.ad-flash { margin: 0 0 12px; }
.ad-confirm .st-msg:empty { display: none; }
.ad-msg { margin: 10px 0 0; color: #b0472f; }
.ad-msg:empty { display: none; }
.ad-act { grid-template-columns: 130px minmax(0, 1fr) auto; align-items: center; }
.ad-act__btns { margin: 0; flex-wrap: wrap; justify-content: flex-end; }
.ad-act.is-off b, .ad-act.is-off .tt-row__time { color: var(--muted); text-decoration: line-through; }
.ad-act .linkish { padding: 0; }
@media (max-width: 520px) { .ad-act { grid-template-columns: 1fr; } .ad-act__btns { justify-content: flex-start; } }
.ad-item + .ad-item > .tt-row { border-top: 1px solid var(--line); }
.ad-item:first-child > .tt-row { border-top: 0; }
.ad-item > [data-box]:not(:empty) { padding-bottom: 12px; }
.ad-day { margin: 18px 0 2px; }
.tt-week > .ad-day:first-child { margin-top: 4px; }
.ad-inline { display: grid; gap: 12px; }
.ad-conv { padding: 0; overflow: hidden; }
.ad-msgs { max-height: none; overflow: visible; }
.ms-msg.is-hidden .ms-bub { background: transparent; box-shadow: none; outline: 2px dashed var(--line); color: var(--muted); }
.ad-hide { margin: 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; }
.ad-hide .linkish { padding: 2px 0; font-size: 13.5px; }
.ad-hide .linkish + .linkish { margin-inline-start: 0; }
.ms-msg.is-teacher .ad-hide { justify-content: flex-start; }
.ad-pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.ad-key { overflow-wrap: anywhere; }
.ad-act--2 { grid-template-columns: minmax(0, 1fr) auto; }
@media (max-width: 520px) { .ad-act--2 { grid-template-columns: 1fr; } }
.ad-jobw.is-bad b { color: #b0472f; }
.ad-details { margin-top: 6px; }
.ad-details summary { cursor: pointer; font-weight: 700; font-size: 14px; color: var(--forest); }
.ad-details p { margin: 4px 0 0; }

/* An admin viewing someone's dashboard (js/app/data.js) */
.va-bar { position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 90; max-width: calc(100% - 32px); padding: 10px 18px; border-radius: 999px; background: var(--ink); color: var(--bone); font-size: 14px; box-shadow: var(--shadow); text-align: center; }
.va-bar a { color: var(--lime); font-weight: 700; margin-inline-start: 8px; }
@media (max-width: 899px) { body.is-viewing-as .va-bar { bottom: 92px; } }

/* Finding a class (js/app/find.js) */
.fd-filter { max-width: 280px; margin-bottom: 6px; }
.fd-row small.fd-fit { color: var(--forest); font-weight: 700; }
.fd-seats { margin: 10px 0 16px; color: var(--on-forest); }
.fd-state { margin: 4px 0 14px; }
.fd-msg { margin-top: 10px; color: var(--on-forest); }
.fd-msg:empty { display: none; }
.fd-stars { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 6px; }
.fd-confirm { margin-top: 14px; }

/* Choosing a plan (js/app/plans.js) and the note after Stripe */
.app-note { padding: 0 40px; max-width: 1320px; width: 100%; }
.app-note:empty { display: none; }
@media (max-width: 899px) { .app-note { padding: 0 16px; } }
.pl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-top: 16px; }
.pl-card { display: grid; gap: 8px; align-content: start; padding: 18px; border-radius: var(--r-md); background: var(--bone); }
.pl-card .btn { justify-self: start; margin-top: 6px; }
.pl-card.is-needed { background: var(--t-lime); }
.pl-card.is-mine { outline: 2px solid var(--forest); outline-offset: -2px; }
.pl-price { color: var(--forest); }
.pl-note { font-weight: 700; color: var(--forest); }
.pl-msg { margin-top: 10px; }
.pl-msg:empty { display: none; }
.rd-listen { display: inline-flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Tutor (js/app/tutor.js; docs/AI_TUTOR_PLAN.md, part 2) ---------- */
.tu-head { align-items: flex-end; }
.tu-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.tu-board { background: var(--forest); color: var(--bone); border-radius: var(--r-xl); padding: 28px clamp(20px, 3vw, 36px); min-height: 360px; box-shadow: var(--shadow); }
.tu-board__ops { display: flex; flex-direction: column; gap: 12px; }
.tu-op { margin: 0; }
.tu-op--title { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-weight: 400; font-size: 34px; line-height: 1; color: var(--lime); text-transform: none; }
.tu-op--write { font-size: 20px; line-height: 1.45; }
.tu-op--write b, .tu-op--table b { color: var(--lime); font-weight: 700; }
.tu-op--note { font-size: 15.5px; color: var(--on-forest); border-inline-start: 3px solid var(--mint); padding-inline-start: 12px; }
.tu-op--fix { font-size: 19px; }
.tu-op--spell { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-size: 44px; line-height: 1.1; color: var(--lime); letter-spacing: .06em; }
.tu-sp { display: inline-block; }
.tu-op--spell.is-new .tu-sp { animation: tu-letter .35s var(--ease) both; animation-delay: calc(var(--i) * 140ms + .2s); }
@keyframes tu-letter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.tu-op--fix s { color: var(--coral); text-decoration-thickness: 2px; }
.tu-op--fix b { color: var(--lime); }
.tu-op--table table { border-collapse: collapse; width: 100%; font-size: 16px; }
.tu-op--table th { text-align: start; color: var(--lime); font-weight: 700; padding: 6px 10px; border-bottom: 2px solid rgba(240, 239, 233, .3); }
.tu-op--table td { padding: 6px 10px; border-bottom: 1px solid rgba(240, 239, 233, .14); vertical-align: top; }
.tu-op--empty { color: var(--on-forest); }
.tu-op.is-new { animation: tu-write .7s var(--ease) both; }
.tu-op.is-new:nth-child(2) { animation-delay: .25s; } .tu-op.is-new:nth-child(3) { animation-delay: .5s; } .tu-op.is-new:nth-child(4) { animation-delay: .75s; }
.tu-op.is-new:nth-child(5) { animation-delay: 1s; } .tu-op.is-new:nth-child(n+6) { animation-delay: 1.25s; }
@keyframes tu-write { from { clip-path: inset(0 100% 0 0); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
[dir="rtl"] .tu-op.is-new { animation-name: tu-write-rtl; }
@keyframes tu-write-rtl { from { clip-path: inset(0 0 0 100%); opacity: .3; } to { clip-path: inset(0 0 0 0); opacity: 1; } }
.tu-ex { margin-top: 22px; padding: 28px clamp(18px, 3vw, 32px); max-width: none; color: var(--ink); }
.tu-chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; max-height: calc(100vh - 160px); min-height: 420px; position: sticky; top: 20px; }
.tu-chat__face { width: 84px; margin: 14px auto 0; }
.tu-msgs { min-height: 200px; }
.tu-msgs--past { max-height: none; margin-top: 12px; border-radius: var(--r-md); }
.tu-wait { display: flex; align-items: center; min-height: 40px; }
.tu-form { flex-wrap: wrap; justify-content: flex-end; }
.tu-form .ms-in { flex: 1 1 100%; }
.tu-form [data-tu="rec"][aria-pressed="true"] { background: var(--forest); color: var(--bone); }
.tu-rec, .tu-note { margin: 0 18px 10px; }
.tu-rec:empty, .tu-note:empty { display: none; }
.tu-hear-box { display: block; }
.tu-hear-box:empty { display: none; }
.tu-hear { margin-top: 6px; padding: 0; border: 0; background: none; font: inherit; font-size: 13.5px; font-weight: 700; color: var(--forest); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }
.tu-hear:disabled { opacity: .55; cursor: default; }
.tu-sum { padding: 16px 20px; border-top: 1px solid var(--line); overflow-y: auto; }
.tu-sum .t-body { margin-top: 6px; }
/* Saying a sentence (part 4): the sentence with each word marked, the three scores, the sound that was off */
.tu-pron { margin-top: 22px; padding: 24px clamp(18px, 3vw, 32px); max-width: none; color: var(--ink); }
.tu-pron .t-body { margin-top: 8px; }
.tu-pron .tu-rec { margin: 10px 0 0; }
.tu-pron__s { margin: 10px 0 0; font-size: 24px; line-height: 1.6; }
.tu-pw { border-radius: 6px; padding: 0 3px; }
.tu-pw.is-ok { color: var(--forest); background: var(--t-mint); }
.tu-pw.is-diff { background: var(--t-coral); text-decoration: underline wavy var(--coral); text-decoration-thickness: 2px; text-underline-offset: 6px; }
.tu-pw.is-missed { color: rgba(8, 8, 8, .4); text-decoration: underline dotted rgba(8, 8, 8, .35); text-underline-offset: 6px; }
.tu-pron__scores { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; margin-top: 16px; }
.tu-pron__scores p { margin: 0; display: flex; flex-direction: column; gap: 2px; }
.tu-pron__n { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-size: 40px; line-height: 1; color: var(--forest); }
.tu-pron__scores small { font-size: 13px; line-height: 1.35; color: rgba(8, 8, 8, .62); }
.tu-pron [data-tu="pron-rec"][aria-pressed="true"] { background: var(--forest); color: var(--bone); }
@media (max-width: 899px) {
  .tu-grid { grid-template-columns: minmax(0, 1fr); }
  .tu-chat { position: static; max-height: none; }
  .tu-msgs { max-height: 60vh; }
  .tu-op--title { font-size: 28px; } .tu-op--write { font-size: 18px; }
  .tu-pron__s { font-size: 20px; } .tu-pron__n { font-size: 32px; } .tu-pron__scores { gap: 10px; }
}
/* The live call (js/app/tutor-live.js; part 7): the tutor's face beside what was said */
.tl-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(300px, 1fr); gap: 20px; align-items: start; }
.tl-side { display: flex; flex-direction: column; gap: 16px; position: sticky; top: 20px; }
.tl-board { min-height: 520px; }
.tl-stage { background: var(--t-mint); border-radius: var(--r-xl); padding: 20px 20px 18px; text-align: center; min-height: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; }
.tl-face { width: min(190px, 60%); }
.tl-face svg { width: 100%; height: auto; display: block; }
.tl-stage[data-state="speaking"] .tl-face { animation: tl-nod 2.4s var(--ease) infinite; }
@keyframes tl-nod { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
.tl-name { margin-top: 10px; }
.tl-state { margin-top: 6px; min-height: 28px; display: flex; align-items: center; justify-content: center; gap: 10px; color: var(--forest); font-weight: 700; }
.tl-captions { padding: 18px 0 0; display: flex; flex-direction: column; max-height: calc(100vh - 470px); min-height: 220px; overflow: hidden; }
.tl-captions > h2 { padding: 0 20px 10px; }
.tl-lines { flex: 1; min-height: 120px; }
.tl-lines .is-partial .ms-bub { opacity: .7; }
.tl-empty { padding: 4px 4px; color: var(--muted); }
.tl-sum { align-self: start; }
.tl-idle { margin-top: 12px; padding: 12px 14px; border-radius: var(--r-md); background: var(--t-sun); display: flex; flex-direction: column; align-items: center; gap: 8px; }
.tl-idle[hidden] { display: none; }
.tl-idle .t-body { margin: 0; }
@media (max-width: 899px) {
  .tl-grid { grid-template-columns: minmax(0, 1fr); }
  .tl-side { position: static; order: -1; }
  .tl-board { min-height: 0; }
  .tl-stage { padding: 14px 16px; }
  .tl-face { width: min(140px, 40%); }
  .tl-captions { position: static; min-height: 0; max-height: none; }
  .tl-lines { max-height: 45vh; }
}
.tl-bar { display: none; }
/* On a phone, the call fills the screen while it is on: the face large while talking, the board sliding up when it is used */
@media (max-width: 899px) {
  html.tl-incall, html.tl-incall body { overflow: hidden; }
  .tl-wrap.is-live { position: fixed; inset: 0; z-index: 110; background: var(--bone); display: flex; flex-direction: column; gap: 10px; padding: calc(12px + env(safe-area-inset-top)) 12px calc(12px + env(safe-area-inset-bottom)); overflow: hidden; animation: rise .3s var(--ease) both; }
  .tl-wrap.is-live .view__head { flex: 0 0 auto; margin: 0; padding: 0 4px; gap: 4px; flex-wrap: nowrap; align-items: baseline; }
  .tl-wrap.is-live .view__head .t-h1 { font-size: 24px; }
  .tl-wrap.is-live .view__head .t-lead { margin: 0; font-size: 14px; }
  .tl-wrap.is-live .view__head .btn-row { display: none; }
  .tl-wrap.is-live .tl-grid, .tl-wrap.is-live .tl-side { display: contents; }
  .tl-wrap.is-live .tl-stage { order: 1; flex: 1 1 auto; min-height: 0; }
  .tl-wrap.is-live .tl-face { width: min(220px, 52vw); }
  .tl-wrap.is-live .tl-board { order: 2; display: none; }
  .tl-wrap.is-live .tl-captions { order: 3; flex: 0 0 auto; min-height: 0; max-height: 30vh; padding-top: 10px; }
  .tl-wrap.is-live .tl-captions > h2 { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tl-wrap.is-live .tl-lines { max-height: none; min-height: 56px; }
  .tl-wrap.is-live .tl-bar { order: 4; flex: 0 0 auto; display: flex; gap: 8px; }
  .tl-wrap.is-live .tl-bar .btn { flex: 1 1 0; min-width: 0; padding-inline: 8px; font-size: 15px; white-space: normal; line-height: 1.15; }
  .tl-wrap.is-live .tl-bar [hidden] { display: none; }
  .tl-wrap.is-live .tl-bar [aria-expanded="true"], .tl-wrap.is-live .tl-bar [aria-pressed="true"] { background: var(--forest); color: var(--bone); }
  .tl-wrap.is-live .tl-sample { display: none; }
  /* The board up: the face shrinks to a row at the top, the board takes the room, the captions keep the last lines */
  .tl-wrap.is-live[data-board="open"] .tl-stage { flex: 0 0 auto; flex-direction: row; flex-wrap: wrap; justify-content: flex-start; gap: 4px 12px; padding: 8px 14px; text-align: start; }
  .tl-wrap.is-live[data-board="open"] .tl-face { width: 48px; }
  .tl-wrap.is-live[data-board="open"] .tl-name { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .tl-wrap.is-live[data-board="open"] .tl-state { margin: 0; min-height: 0; justify-content: flex-start; }
  .tl-wrap.is-live[data-board="open"] .tl-idle { flex-basis: 100%; margin-top: 4px; }
  .tl-wrap.is-live[data-board="open"] .tl-board { display: block; flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 20px 18px; animation: tl-sheet .45s var(--ease) both; }
  .tl-wrap.is-live[data-board="open"] .tl-captions { max-height: 17vh; }
  @media (max-height: 700px) { .tl-wrap.is-live[data-board="open"] .tl-captions { max-height: 13vh; } .tl-wrap.is-live .view__head .t-h1 { font-size: 20px; } }
  .tl-wrap.is-live[data-board="open"] .tu-ex, .tl-wrap.is-live[data-board="open"] .tu-pron { margin-top: 16px; padding: 18px 16px; }
}
@keyframes tl-sheet { from { opacity: 0; transform: translateY(48px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .tl-wrap.is-live, .tl-wrap.is-live[data-board="open"] .tl-board { animation: none; } }
@media (prefers-reduced-motion: reduce) { .tu-op.is-new, .tu-op--spell.is-new .tu-sp { animation: none; } .tl-stage[data-state="speaking"] .tl-face { animation: none; } }

/* AI tutor, part 5: connected to the dashboard */
.cl-note__tutor { background: var(--t-sun); box-shadow: inset 0 0 0 1px var(--line); border-radius: var(--r-md); padding: 12px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.cl-note__tutor p { flex: 1; min-width: 200px; }
.tu-after { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); display: grid; gap: 6px; }
.tu-after p { margin: 0; }
/* Part 6: the plans and the packs when the time is used up, at the end of a session or a call */
.tu-out { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line); }
.tl-sum .tu-out { margin-top: 16px; }
.ex-read { background: var(--t-mint); border-radius: var(--r-md); padding: 14px 18px; margin: 10px 0 14px; }
.ex-read p { margin: 0 0 8px; line-height: 1.6; }
.ex-read p:last-child { margin-bottom: 0; }
.mine__from { display: block; color: var(--muted); margin-top: 2px; }
.pg-tutor .qunits__list li > div span + span { color: var(--muted); font-weight: 500; }
.tw .write-in { width: 100%; margin-top: 14px; }
.tw .wr-count.is-off { color: #b0472f; }

/* Admin activity (js/app/admin-activity.js) */
.ac-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(130px, 1fr)); gap: 12px 20px; margin-top: 14px; }
.ac-stat b { display: block; font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-weight: 400; font-size: 44px; line-height: 1; color: var(--forest); }
.ac-stat span { display: block; margin-top: 4px; color: var(--muted); font-size: 14px; }
.ac-bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; margin-top: 22px; }
.ac-bar { flex: 1; min-width: 3px; height: max(var(--h), 2px); background: var(--forest); border-radius: 4px 4px 0 0; }
.ac-bar:last-child { background: var(--lime); }
.ac-axis { display: flex; justify-content: space-between; margin-top: 6px; color: var(--muted); font-size: 13px; }

/* Bell (js/app/bell.js) */
.top__actions { position: relative; }
.icon-btn.has-dot { position: relative; }
.icon-btn.has-dot::after { content: ""; position: absolute; top: 9px; right: 10px; width: 9px; height: 9px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px #fff; }
.nt-panel { position: absolute; top: calc(100% + 10px); right: 0; z-index: 60; width: min(380px, calc(100vw - 24px)); max-height: min(70vh, 560px); overflow: auto; background: #fff; border-radius: 22px; box-shadow: 0 18px 50px rgba(8, 8, 8, .16); padding: 18px 8px 8px; }
[dir="rtl"] .nt-panel { right: auto; left: 0; }
.nt-head { padding: 0 12px 8px; }
.nt-list { list-style: none; margin: 0; padding: 0; }
.nt-item { display: block; padding: 12px 12px 12px 26px; border-radius: 14px; color: inherit; text-decoration: none; position: relative; }
a.nt-item:hover { background: var(--bone, #f0efe9); }
.nt-item b { display: block; font-weight: 600; line-height: 1.35; }
.nt-item.is-new b { font-weight: 700; }
.nt-item.is-new::before { content: ""; position: absolute; left: 10px; top: 19px; width: 7px; height: 7px; border-radius: 50%; background: var(--coral); }
[dir="rtl"] .nt-item { padding: 12px 26px 12px 12px; } [dir="rtl"] .nt-item.is-new::before { left: auto; right: 10px; }
.nt-item.is-offer { background: #f3fbdf; margin: 2px 0; }
.nt-item span { display: block; margin-top: 3px; color: var(--ink, #080808); font-size: 14px; line-height: 1.45; }
.nt-item small { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.nt-none { padding: 4px 12px 12px; color: var(--muted); }

/* Admin campaigns (js/app/admin-campaigns.js) */
.ad-count { margin: 6px 0 2px; }
.ac-num { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-weight: 400; font-size: 34px; line-height: 1; color: var(--forest); }

/* ---------- Live board (js/app/board.js, docs/LESSONS_PLAN.md step L2) ---------- */
.cl-live__board { min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.cl-live.has-board .cl-live__frame { min-height: 240px; }
@media (min-width: 1100px) {
  .cl-live.has-board .cl-live__body { grid-template-columns: minmax(0, 1fr) 340px; grid-template-areas: "board frame" "board side"; align-items: start; }
  .cl-live.has-board .cl-live__board { grid-area: board; }
  .cl-live.has-board .cl-live__frame { grid-area: frame; min-height: 260px; aspect-ratio: 4 / 3; }
  .cl-live.has-board .cl-live__side { grid-area: side; }
}
.bd-digest { display: grid; gap: 16px; margin-top: 12px; }
.cl-note__board { display: grid; gap: 12px; margin-top: 8px; }
.tc-board-view { margin-top: 10px; }

/* ---------- Welcome poll (js/app/poll.js) ---------- */
.wp { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 16px; background: rgba(26, 68, 60, .45); backdrop-filter: blur(4px); opacity: 0; transition: opacity var(--t-mid) var(--ease); overflow-y: auto; }
.wp.is-in { opacity: 1; }
body.is-wp-open { overflow: hidden; }
.wp__card { width: 100%; max-width: 600px; background: var(--white); border-radius: var(--r-xl); box-shadow: var(--shadow-lift); padding: 28px 32px 26px; transform: translateY(14px) scale(.98); transition: transform var(--t-slow) var(--spring); }
.wp.is-in .wp__card { transform: none; }
.wp__top { display: flex; align-items: center; gap: 16px; margin-bottom: 18px; }
.wp__buddy { flex: none; width: 52px; height: 52px; border-radius: 50%; background: var(--t-mint); display: grid; place-items: center; }
.wp__buddy svg { width: 40px; height: 40px; }
.wp__bar { flex: 1; height: 8px; border-radius: 4px; background: var(--bone); overflow: hidden; }
.wp__bar i { display: block; height: 100%; background: var(--lime); box-shadow: inset 0 0 0 1px rgba(26, 68, 60, .18); border-radius: 4px; transition: width var(--t-mid) var(--ease); }
.wp__x { flex: none; width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--bone); color: var(--ink); display: grid; place-items: center; cursor: pointer; }
.wp__x svg { width: 18px; height: 18px; }
.wp__x:hover { background: var(--t-lime); }
.wp__h { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-weight: 400; text-transform: uppercase; letter-spacing: .005em; font-size: clamp(26px, 3vw, 32px); line-height: .95; margin: 0 0 10px; outline: none; }
.wp__sub { color: var(--muted); margin: 0 0 16px; }
.wp__intro { text-align: center; display: flex; flex-direction: column; align-items: center; }
.wp__hero { width: 128px; height: 128px; border-radius: 50%; background: var(--t-mint); display: grid; place-items: center; margin-bottom: 18px; }
.wp__hero svg { width: 96px; height: 96px; }
.wp__gift { display: flex; flex-direction: column; gap: 4px; width: 100%; background: var(--lime); color: var(--forest); border-radius: var(--r-lg); padding: 16px 20px; margin: 4px 0 18px; text-align: start; }
.wp__gift strong { font-size: 17px; }
.wp__opts { display: grid; gap: 10px; margin-bottom: 8px; }
.wp__opt { position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-radius: var(--r-md); background: var(--bone); cursor: pointer; transition: background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.wp__opt:hover { background: var(--t-lime); }
.wp__opt input { position: absolute; opacity: 0; pointer-events: none; }
.wp__opt:focus-within { box-shadow: 0 0 0 3px var(--white), 0 0 0 5px var(--forest); }
.wp__opt.is-on { background: var(--t-lime); box-shadow: inset 0 0 0 2px var(--forest); }
.wp__mark { flex: none; width: 24px; height: 24px; border-radius: 50%; border: 2px solid rgba(8, 8, 8, .25); display: grid; place-items: center; color: transparent; background: var(--white); }
.wp__opt input[type="checkbox"] + .wp__mark { border-radius: 7px; }
.wp__opt.is-on .wp__mark { background: var(--forest); border-color: var(--forest); color: var(--lime); }
.wp__mark svg { width: 15px; height: 15px; stroke-width: 3; }
.wp__label { display: block; font-weight: 700; font-size: var(--fs-small); margin: 14px 0 6px; }
.wp__select, .wp__text { width: 100%; font: inherit; color: var(--ink); background: var(--bone); border: 2px solid transparent; border-radius: var(--r-md); padding: 13px 16px; }
.wp__select:focus, .wp__text:focus { outline: none; border-color: var(--forest); background: var(--white); }
.wp__text { resize: vertical; min-height: 84px; }
.wp__err { color: #c0392b; font-size: var(--fs-small); margin: 10px 0 0; }
.wp__foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; width: 100%; margin-top: 20px; }
.wp__foot .btn[disabled] { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
@media (max-width: 560px) {
  .wp { padding: 0; align-items: end; }
  .wp__card { border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 22px 18px 20px; max-height: 100dvh; overflow-y: auto; }
  .wp__hero { width: 104px; height: 104px; } .wp__hero svg { width: 78px; height: 78px; }
}
html[lang="ar"] .wp__h, html[lang^="zh"] .wp__h { line-height: 1.3; }
@media (prefers-reduced-motion: reduce) { .wp, .wp__card, .wp__bar i { transition: none; } }

/* ---------- Checkout (js/app/pay.js): Alimun's own payment page over the dashboard ---------- */
html.pay-open, html.pay-open body { overflow: hidden; }
.pay { position: fixed; inset: 0; z-index: 120; background: var(--bone); overflow-y: auto; overscroll-behavior: contain; animation: payIn var(--t-slow) var(--ease) both; }
.pay:focus { outline: none; }
.pay [hidden] { display: none !important; }
.pay.is-leaving { animation: payOut 240ms var(--ease) both; }
@keyframes payIn { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes payOut { to { opacity: 0; transform: translateY(12px); } }
.pay .sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.pay__top { position: sticky; top: 0; z-index: 3; background: color-mix(in oklab, var(--bone), transparent 8%); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); max-width: 1240px; margin: 0 auto; padding: 22px 32px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.pay__brand { display: flex; align-items: center; gap: 9px; }
.pay__brand .book { width: 38px; height: 40px; overflow: visible; }
.pay__close { background: var(--white); }
[dir="rtl"] .pay__close svg { transform: scaleX(-1); }
.pay__grid { max-width: 1240px; margin: 0 auto; padding: 8px 32px 72px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 520px); gap: 56px; align-items: start; }
.pay__sum { padding-top: 18px; min-width: 0; animation: payRise var(--t-slow) var(--ease) 60ms both; }
.pay__form { animation: payRise var(--t-slow) var(--ease) 140ms both; }
@keyframes payRise { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }
.pay__title { font-size: clamp(60px, 7.4vw, 112px); overflow-wrap: anywhere; }
.pay__sub { margin-top: 14px; }
.pay__photo { margin: 30px 0 0; border-radius: var(--r-xl); overflow: hidden; aspect-ratio: 16 / 10; background: #e4e2da; }
.pay__photo img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 30%; }
.pay__bill { position: relative; margin: 30px 0 0; background: var(--white); border-radius: var(--r-lg); padding: 10px 26px 22px; box-shadow: var(--shadow); min-height: 96px; }
.pay__photo + .pay__bill { margin: -84px 28px 0; }
.pay__bill-wait { display: grid; place-items: center; padding: 14px 0 0; }
.pay__row { display: flex; justify-content: space-between; align-items: baseline; gap: 16px; padding: 13px 0; font-weight: 500; }
.pay__row + .pay__row { border-top: 1px solid var(--line); }
.pay__row > span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.pay__row--off > span:last-child { color: var(--forest); font-weight: 700; }
.pay__row--total { padding-top: 18px; font-weight: 700; }
.pay__total { font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-weight: 400; font-size: 52px; line-height: .9; }
.pay__then { margin-top: 2px; }
.pay__form { position: sticky; top: 104px; background: var(--white); border-radius: var(--r-xl); padding: 36px 36px 28px; box-shadow: var(--shadow-lift); min-width: 0; }
.pay__form > .t-h2 { margin-bottom: 24px; }
.pay__fields { position: relative; min-height: 280px; }
.pay__wait { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; }
.pay__pe { opacity: 0; transition: opacity var(--t-mid) var(--ease); }
.pay__fields.is-ready { min-height: 0; }
.pay__fields.is-ready .pay__pe { opacity: 1; }
.pay__code { margin-top: 16px; }
.pay__code-form { display: flex; gap: 10px; }
.pay__code-in { flex: 1; min-width: 0; height: 48px; border-radius: 14px; border: 2px solid var(--bone); background: var(--bone); padding: 0 16px; font: inherit; font-weight: 600; letter-spacing: .04em; color: var(--ink); transition: border-color var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
.pay__code-in:focus { outline: none; border-color: var(--forest); background: var(--white); }
.pay__code-form .btn { height: 48px; }
.pay__code-msg { margin-top: 6px; color: #b3412c; }
.pay__code-msg:empty { display: none; }
.pay__go { width: 100%; height: 64px; margin-top: 24px; font-size: 18px; border-radius: 32px; }
.pay__go:disabled { opacity: .45; cursor: not-allowed; transform: none; box-shadow: none; }
.pay__go.is-busy { opacity: .8; cursor: progress; }
.pay__go.is-busy span { animation: payPulse 1.2s var(--ease) infinite; }
@keyframes payPulse { 50% { opacity: .45; } }
.pay__msg { margin-top: 12px; color: #b3412c; font-weight: 600; text-align: center; }
.pay__msg:empty { display: none; }
.pay__safe { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 16px; text-align: center; }
.pay__safe svg { flex: none; color: var(--forest); }
@media (max-width: 959px) {
  .pay__grid { grid-template-columns: minmax(0, 1fr); gap: 24px; padding: 0 16px 40px; max-width: 640px; }
  .pay__top { padding: 14px 16px; max-width: 640px; }
  .pay__sum { padding-top: 8px; }
  .pay__title { font-size: clamp(52px, 15vw, 84px); }
  .pay__photo { aspect-ratio: 2 / 1; margin-top: 20px; border-radius: var(--r-lg); }
  .pay__photo + .pay__bill { margin: -56px 14px 0; }
  .pay__bill { padding: 6px 20px 18px; }
  .pay__total { font-size: 44px; }
  .pay__form { position: static; padding: 26px 20px 22px; border-radius: var(--r-lg); }
}
html[lang="ar"] .pay__title, html[lang^="zh"] .pay__title { line-height: 1.15; }
@media (prefers-reduced-motion: reduce) { .pay, .pay.is-leaving, .pay__sum, .pay__form, .pay__go.is-busy span { animation: none; } }

/* ---------- The classroom (js/app/classroom.js): inside the dashboard, in its own parts (owner, 10 Nov 2026) ---------- */
body.is-class .view { max-width: 1640px; }
.cr { display: flex; flex-direction: column; }
.cr-head { margin-bottom: 22px; }
.cr-head .t-lead a { color: var(--forest); }
.cr-actions .btn svg, .cr-tab svg, .cr-fab svg { width: 18px; height: 18px; }
.cr-i { width: 20px; height: 20px; flex: none; }

.cr-body { display: grid; gap: var(--gap); grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "video side"; align-items: start; }
.cr-video { grid-area: video; position: relative; border-radius: var(--r-xl); overflow: hidden; background: var(--forest); min-height: min(68dvh, 720px); box-shadow: var(--shadow); }
.cr-frame { position: absolute; inset: 0; display: grid; }
.cr-frame > iframe { width: 100%; height: 100%; }
.cr-wait { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; padding: 110px 24px 28px; }
.cr-wait .bub { top: 20px; inset-inline-start: 20px; max-width: min(320px, calc(100% - 92px)); }
.cr-wait > svg { width: 100%; max-width: 260px; height: 170px; overflow: visible; }
.cr-wait .loader { margin-top: 4px; }
.cr-grow { position: absolute; z-index: 3; top: 14px; inset-inline-end: 14px; display: none; color: var(--forest); }
.cr-grow svg { width: 20px; height: 20px; }
.cr-side { grid-area: side; align-self: stretch; position: sticky; top: 92px; display: flex; flex-direction: column; gap: 14px; padding: 18px; min-height: 0; max-height: calc(100dvh - 110px); }
.cr-board { grid-area: board; min-width: 0; max-width: 100%; padding: 18px; overflow: visible; }
.cr-board.is-in { animation: rise var(--t-slow) var(--ease) backwards; }

/* With the board: the board takes the main column, the video sits above the side panel */
.cr.has-board .cr-body { grid-template-areas: "board video" "board side"; grid-template-rows: auto minmax(0, 1fr); }
.cr.has-board .cr-video { min-height: 0; aspect-ratio: 4 / 3; }
.cr.has-board .cr-grow { display: grid; }
.cr.has-board .cr-side { position: static; max-height: none; min-height: 340px; }
.cr.has-board .cr-wait { padding: 76px 16px 16px; }
.cr.has-board .cr-wait > svg { height: 100px; }
.cr.has-board .cr-wait .bub { top: 14px; inset-inline-start: 14px; font-size: 13.5px; padding: 8px 12px; max-width: calc(100% - 80px); }
.cr.has-board .cr-wait .loader { display: none; }
/* The large video: it takes the board's place; the board waits underneath */
.cr.has-board.is-big .cr-body { grid-template-areas: "video side"; grid-template-rows: auto; }
.cr.has-board.is-big .cr-video { aspect-ratio: auto; min-height: min(68dvh, 720px); }
.cr.has-board.is-big .cr-board { display: none; }
.cr.has-board.is-big .cr-side { position: sticky; max-height: calc(100dvh - 110px); }
.cr.has-board.is-big .cr-wait { padding: 110px 24px 28px; }
.cr.has-board.is-big .cr-wait > svg { height: 170px; }

/* The side panel: chat, notes, words */
.cr-tabs { display: flex; align-items: center; gap: 8px; }
.cr-tab { position: relative; flex: 1; gap: 8px; padding: 0 12px; }
.cr-dot { position: absolute; top: 6px; inset-inline-end: 8px; width: 10px; height: 10px; border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 2px var(--white); }
.cr-x { display: none; flex: none; background: var(--bone); box-shadow: none; }
.cr-x svg { width: 20px; height: 20px; }
.cr-panel { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: 12px; }
.cr-panel[hidden] { display: none; }
.cr-panel > .t-small { margin: 0; color: var(--muted); }
.cr-msgs { flex: 1; min-height: 240px; border-radius: var(--r-lg); padding: 14px; }
.cr-send { padding: 0; border: 0; }
.cr-words { margin: 0; }
.cr-notes { max-width: none; gap: 14px; }
.cr-notes .st-row { grid-template-columns: 1fr; }
.cr-notes .tc-word { grid-template-columns: 1fr 1fr auto; }
.cr-notes .tc-word input[name="w_ex"] { grid-column: 1 / 3; }
.cr-more { margin: 0; font-size: 14px; }
.cr-fab { display: none; }

/* Notices: the dashboard's speech bubble, beside the person's initials */
.cr-toasts { position: fixed; z-index: 80; top: 84px; inset-inline-end: 28px; display: grid; justify-items: end; gap: 12px; width: min(400px, calc(100vw - 24px)); pointer-events: none; }
.cr-toast { display: flex; align-items: flex-start; gap: 12px; pointer-events: auto; opacity: 0; transform: translateY(-10px) scale(.96); transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--spring); }
.cr-toast.is-in { opacity: 1; transform: none; }
.cr-toast__av { flex: none; margin-top: 2px; cursor: default; box-shadow: 0 6px 16px rgba(8, 8, 8, .12); }
.cr-toast--msg .cr-toast__av { background: var(--lime); }
.cr-toast__bub { position: relative; inset: auto; max-width: none; animation: none; font-size: 14.5px; margin-bottom: 12px; }
.cr-toast__bub b { display: block; font-size: 13px; }
.cr-toast__bub b:empty { display: none; }
.cr-toast__bub span { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; font-weight: 600; }
.cr-toast--msg { cursor: pointer; }

@media (max-width: 1099px) and (min-width: 900px) {
  .cr-body { grid-template-columns: minmax(0, 1fr) 300px; }
}
/* Phones: video on top, the board under it, the side panel as a sheet opened from a button */
@media (max-width: 899px) {
  .cr-head { margin-bottom: 14px; }
  .cr-head .t-h1 { font-size: 36px; }
  .cr-actions { width: 100%; }
  .cr-actions .btn { flex: 1; }
  .cr-body, .cr.has-board .cr-body, .cr.has-board.is-big .cr-body { display: flex; flex-direction: column; gap: 14px; }
  .cr-video { order: 0; width: 100%; min-height: 0; aspect-ratio: 4 / 3; border-radius: var(--r-lg); }
  .cr.has-board .cr-video { aspect-ratio: 16 / 10; }
  .cr.has-board.is-big .cr-video { aspect-ratio: auto; height: 72dvh; min-height: 0; }
  .cr-wait, .cr.has-board.is-big .cr-wait { padding: 84px 16px 16px; }
  .cr-wait > svg { height: 120px; }
  .cr-grow { display: grid; }
  .cr-board { order: 1; padding: 12px; border-radius: var(--r-lg); }
  .cr.has-board.is-big .cr-board { display: block; }
  .cr-side, .cr.has-board .cr-side, .cr.has-board.is-big .cr-side { position: fixed; z-index: 70; left: 0; right: 0; bottom: 0; top: auto; height: min(80dvh, 660px); max-height: none; min-height: 0; border-radius: var(--r-xl) var(--r-xl) 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom)); box-shadow: 0 -20px 60px rgba(8, 8, 8, .22); transform: translateY(105%); transition: transform var(--t-slow) var(--ease); }
  .cr-body.rise > .cr-side { animation: none; }
  .cr.is-sheet .cr-side { transform: none; }
  .cr-x { display: grid; }
  .cr-fab { position: fixed; z-index: 60; inset-inline-end: 16px; bottom: calc(16px + env(safe-area-inset-bottom)); display: inline-flex; box-shadow: 0 14px 34px rgba(26, 68, 60, .35); transition: transform var(--t-mid) var(--spring), opacity var(--t-fast); }
  .cr.is-sheet .cr-fab { opacity: 0; pointer-events: none; transform: translateY(20px); }
  .cr-count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--lime); color: var(--forest); font-size: 12.5px; line-height: 22px; text-align: center; }
  .cr-toasts { top: 76px; inset-inline-end: 12px; }
  html.cr-locked, html.cr-locked body { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  .cr-board.is-in, .cr-toast, .cr-side, .cr-fab { animation: none; transition: none; }
}

/* ---------- The board, in the dashboard's parts ---------- */
.bd-shell { position: relative; display: flex; flex-direction: column; gap: 14px; min-width: 0; max-width: 100%; }
.bd-i { width: 20px; height: 20px; flex: none; }
.bd-head { position: relative; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; min-width: 0; max-width: 100%; }
.bd-nav { display: flex; align-items: center; gap: 8px; min-width: 0; flex: 1 1 300px; }
.bd-arrow { width: 40px; padding: 0; flex: none; }
.bd-arrow:disabled { opacity: .35; cursor: default; transform: none; }
.bd-pagebtn { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 10px; padding: 6px 10px; border: 0; border-radius: var(--r-sm); background: none; color: var(--ink); font: inherit; cursor: pointer; text-align: start; transition: background var(--t-fast) var(--ease); }
.bd-pagebtn:hover, .bd-pagebtn[aria-expanded="true"] { background: var(--bone); }
.bd-pagebtn__t { margin: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.bd-pagebtn__n { flex: none; color: var(--muted); font-variant-numeric: tabular-nums; }
.bd-pagebtn .bd-i { align-self: center; width: 18px; height: 18px; color: var(--forest); transition: transform var(--t-fast) var(--ease); }
.bd-pagebtn[aria-expanded="true"] .bd-i { transform: rotate(180deg); }
.bd-ctls { display: flex; align-items: flex-end; gap: 10px; flex-wrap: wrap; }
.bd-ctls .btn svg { width: 18px; height: 18px; }
.bd-field { display: inline-flex; flex-direction: column; gap: 4px; }
.bd-field .t-small { color: var(--muted); font-weight: 600; }
.bd-field .st-in { height: 40px; width: auto; min-width: 140px; padding-top: 0; padding-bottom: 0; }
.bd-field--solo { flex-direction: row; align-items: center; gap: 6px; }
.bd-field--solo .st-in { min-width: 92px; }
.bd-head--student { align-items: center; }
.bd-title { margin: 0; }
.bd-you { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--forest); font-weight: 700; font-size: 14.5px; }
.bd-you .bd-i { width: 18px; height: 18px; }
.bd-banner { display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: var(--forest); }
.bd-banner p { margin: 0; }

/* The page menu */
.bd-menu { position: absolute; z-index: 20; top: calc(100% + 10px); left: 0; width: min(460px, 100%); max-height: min(70dvh, 620px); overflow-y: auto; padding: 14px; box-shadow: var(--shadow-lift); animation: rise var(--t-mid) var(--ease) both; overscroll-behavior: contain; }
.bd-menu__h { margin: 12px 8px 8px; font-weight: 700; color: var(--muted); }
.bd-menu__h:first-child { margin-top: 2px; }
.bd-menu__list { display: grid; gap: 2px; }
.bd-mi { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 48px; padding: 8px 12px; border: 0; border-radius: var(--r-md); background: none; color: var(--ink); font: inherit; font-size: 15.5px; text-align: start; cursor: pointer; transition: background var(--t-fast) var(--ease); }
.bd-mi:hover, .bd-mi:focus-visible { background: var(--bone); }
.bd-mi.is-on { background: var(--lime); color: var(--forest); font-weight: 700; }
.bd-mi > span:not(.bd-mi__n) { flex: 1; min-width: 0; }
.bd-mi small { display: block; font-size: 13px; color: var(--muted); font-weight: 400; }
.bd-mi__n { width: 28px; height: 28px; flex: none; border-radius: 50%; background: var(--bone); display: grid; place-items: center; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.bd-mi.is-on .bd-mi__n { background: var(--forest); color: var(--lime); }
.bd-mi .bd-i { width: 18px; height: 18px; color: var(--forest); }
.bd-menu__grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; padding: 0 2px 6px; }
.bd-tile { display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 10px 10px 12px; border: 0; border-radius: var(--r-md); color: var(--forest); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: transform var(--t-mid) var(--ease), box-shadow var(--t-mid) var(--ease); }
.bd-tile:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.bd-tile--lined { background: var(--t-mint); } .bd-tile--grid { background: var(--t-sun); } .bd-tile--cols { background: var(--t-coral); }
.bd-tile--mind { background: var(--t-lime); } .bd-tile--time { background: var(--t-mint); } .bd-tile--table { background: var(--t-sun); }
.bd-tile__pic { width: 100%; aspect-ratio: 16 / 10; border-radius: var(--r-sm); background: var(--white); }
.bd-tile__pic--lined { background: repeating-linear-gradient(var(--white) 0 9px, rgba(26, 68, 60, .2) 9px 10px); }
.bd-tile__pic--grid { background-color: var(--white); background-image: linear-gradient(rgba(26, 68, 60, .16) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 68, 60, .16) 1px, transparent 1px); background-size: 9px 9px; }
.bd-tile__pic--cols { background: linear-gradient(90deg, transparent calc(50% - 1px), var(--forest) calc(50% - 1px) calc(50% + 1px), transparent calc(50% + 1px)), linear-gradient(var(--forest), var(--forest)) center 22% / 80% 2px no-repeat, var(--white); }
.bd-tile__pic--mind { background: radial-gradient(ellipse 18% 16% at 50% 50%, transparent 85%, var(--forest) 88% 100%, transparent 102%), radial-gradient(circle at 18% 25%, var(--mint) 0 7%, transparent 8%), radial-gradient(circle at 82% 25%, var(--mint) 0 7%, transparent 8%), radial-gradient(circle at 18% 78%, var(--mint) 0 7%, transparent 8%), radial-gradient(circle at 82% 78%, var(--mint) 0 7%, transparent 8%), var(--white); }
.bd-tile__pic--time { background: radial-gradient(circle at 20% 50%, var(--forest) 0 5%, transparent 6%), radial-gradient(circle at 50% 50%, var(--forest) 0 5%, transparent 6%), radial-gradient(circle at 80% 50%, var(--forest) 0 5%, transparent 6%), linear-gradient(var(--forest), var(--forest)) center / 86% 2px no-repeat, var(--white); }
.bd-tile__pic--table { background-color: var(--white); background-image: linear-gradient(rgba(26, 68, 60, .2) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 68, 60, .2) 1px, transparent 1px); background-size: 25% 20%; }
.bd-lesson summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 46px; padding: 8px 12px; border-radius: var(--r-md); font-weight: 700; font-size: 15px; cursor: pointer; list-style: none; }
.bd-lesson summary::-webkit-details-marker { display: none; }
.bd-lesson summary:hover { background: var(--bone); }
.bd-lesson summary .bd-i { width: 18px; height: 18px; color: var(--forest); transition: transform var(--t-fast) var(--ease); }
.bd-lesson[open] summary .bd-i { transform: rotate(180deg); }
.bd-lesson .bd-mi { padding-inline-start: 22px; font-size: 15px; }

/* The page and its ink */
.bd-paper { position: absolute; left: 0; top: 0; transform-origin: 0 0; padding: 36px 44px; box-sizing: border-box; background: var(--white); }
.bd-paper.is-pen, .bd-paper.is-marker { cursor: crosshair; touch-action: none; }
.bd-paper.is-text { cursor: text; touch-action: none; }
.bd-paper.is-eraser { cursor: cell; touch-action: none; }
.bd-paper .t-h2 { margin-bottom: 18px; }
.bd-ink { position: absolute; left: 0; top: 0; pointer-events: none; }
.bd-notes { position: absolute; inset: 0; pointer-events: none; }
.bd-note { position: absolute; font-weight: 700; font-size: 24px; line-height: 1.2; white-space: pre; }
.bd-input { position: absolute; width: 340px; font-size: 20px; z-index: 2; }
.bd-content { font-size: 20px; line-height: 1.55; }
.bd-content .rd-text p { font-size: 20px; }
.bd-content .rd-table { margin: 14px 0; }
.bd-ex { margin: 22px 0; }
.bd-ex__h { font-weight: 700; margin: 0 0 8px; }
.bd-list { margin: 0; padding-left: 1.4em; }
.bd-list li { margin: 6px 0; }
.bd-abc { list-style: lower-alpha; }
.bd-opts { display: inline-flex; flex-wrap: wrap; gap: 8px; margin-left: 6px; vertical-align: middle; }
.bd-opt { padding: 2px 12px; border-radius: var(--r-sm); background: var(--bone); }
.bd-opt.is-right { background: var(--lime); font-weight: 700; }
.bd-why { display: block; font-size: 16px; color: var(--muted); }
.bd-base { font-weight: 700; letter-spacing: .04em; }
.bd-bank { margin: 0 0 8px; }
.bd-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.bd-tip { background: var(--t-lime); border-radius: var(--r-md); padding: 14px 18px; margin: 14px 0; }
.bd-dialogue, .bd-reading { margin: 14px 0; }
.bd-dialogue p, .bd-reading p { margin: 4px 0; }
.bd-wait { display: grid; place-items: center; min-height: 200px; background: var(--bone); border-radius: var(--r-lg); padding: 24px; text-align: center; }
.bd-content .rd-table tbody tr { animation: none; }
.bd-stage { position: relative; overflow: hidden; border-radius: var(--r-lg); background: var(--white); box-shadow: inset 0 0 0 2px var(--bone); }
.bd-tpl { margin-top: 6px; height: 640px; border-radius: 12px; }
.bd-tpl--lined { background: repeating-linear-gradient(transparent 0 47px, rgba(26, 68, 60, .18) 47px 48px); }
.bd-tpl--grid { background-image: linear-gradient(rgba(26, 68, 60, .12) 1px, transparent 1px), linear-gradient(90deg, rgba(26, 68, 60, .12) 1px, transparent 1px); background-size: 32px 32px; }
.bd-tpl--cols { display: grid; grid-template-columns: 1fr 1fr; }
.bd-tpl--cols > div { border-top: 3px solid var(--forest); padding-top: 64px; background: repeating-linear-gradient(transparent 0 63px, rgba(26, 68, 60, .14) 63px 64px); }
.bd-tpl--cols > div:first-child { border-right: 2px solid rgba(26, 68, 60, .3); margin-right: 16px; padding-right: 16px; }
.bd-tpl--mind, .bd-tpl--time { color: var(--forest); }
.bd-tpl__svg { width: 100%; height: 100%; }
.bd-tpl--mind ellipse:not(:first-child) { stroke: var(--mint); }
.bd-tpl--table table { width: 100%; height: 100%; border-collapse: collapse; table-layout: fixed; }
.bd-tpl--table td { border: 1.5px solid rgba(26, 68, 60, .25); }
.bd-tpl--table tr:first-child td { background: var(--t-mint); border-bottom-width: 3px; border-bottom-color: var(--forest); }

/* The tools: round buttons in a white tray floating under the page; the chosen tool in the sidebar's lime */
.bd-dock { position: sticky; bottom: 16px; z-index: 5; align-self: center; display: flex; align-items: center; gap: 6px; max-width: 100%; margin-top: -84px; margin-bottom: 18px; padding: 8px; border-radius: 30px; background: var(--white); box-shadow: var(--shadow-lift); overflow-x: auto; scrollbar-width: none; animation: rise var(--t-slow) var(--ease) both; }
.bd-dock::-webkit-scrollbar { display: none; }
.bd-tool { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; min-width: 44px; padding: 0 10px; flex: none; border: 0; border-radius: 22px; background: var(--bone); color: var(--forest); font: inherit; font-weight: 700; font-size: 14px; cursor: pointer; transition: background var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.bd-tool:hover { transform: translateY(-1px); }
.bd-tool.is-on { background: var(--lime); color: var(--forest); box-shadow: inset 0 0 0 2px var(--forest); }
.bd-tool.is-warn { background: var(--coral); color: var(--ink); }
.bd-sep { width: 2px; height: 26px; flex: none; border-radius: 2px; background: var(--bone); margin: 0 4px; }
.bd-sws { display: inline-flex; gap: 6px; align-items: center; }
.bd-sw { width: 36px; height: 36px; flex: none; border-radius: 50%; border: 3px solid var(--white); padding: 0; cursor: pointer; background: var(--sw); box-shadow: 0 0 0 1px var(--line); transition: box-shadow var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
.bd-sw:hover { transform: scale(1.06); }
.bd-sw.is-on { box-shadow: 0 0 0 3px var(--lime), 0 0 0 5px var(--forest); }
.bd-paper.is-hand { cursor: grab; touch-action: pan-x pan-y; }
.bd-stage.is-zoom { overflow: auto; overscroll-behavior: contain; }
.bd-sizer { position: absolute; left: 0; top: 0; pointer-events: none; }
@media (min-width: 900px) { .bd-narrow { display: none; } }

/* "Everyone solves this" */
.bd-solo { display: grid; gap: 14px; padding: 18px 20px; }
.bd-solo__top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.bd-solo__top .t-h3 { margin: 0; }
.bd-solo__row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.bd-solo__people { display: flex; flex-wrap: wrap; gap: 8px; }
.bd-clock { display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 20px; background: var(--white); font-family: 'Coolvetica Condensed', Satoshi, sans-serif; font-size: 24px; font-variant-numeric: tabular-nums; color: var(--forest); }
.bd-clock .bd-i { width: 18px; height: 18px; }
.bd-person { gap: 8px; }
.bd-person small { font-weight: 400; opacity: .75; }
.bd-person__dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sun); }
.bd-person.is-done .bd-person__dot { background: var(--lime); box-shadow: 0 0 0 2px var(--forest); }

@media (max-width: 899px) {
  .bd-nav { flex-basis: 100%; }
  .bd-pagebtn__t { font-size: 21px; }
  .bd-ctls { flex: 1 1 100%; min-width: 0; max-width: 100%; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  .bd-ctls::-webkit-scrollbar { display: none; }
  .bd-ctls > * { flex: none; }
  .bd-field .st-in { min-width: 120px; }
  .bd-stage { border-radius: var(--r-md); }
  .bd-menu { position: fixed; z-index: 75; left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 74dvh; border-radius: var(--r-xl); box-shadow: 0 -10px 60px rgba(8, 8, 8, .25); }
  /* On phones the tools are a row above the page, so nothing floats over the page, the video or the chat button */
  .bd-head, .bd-solo, .bd-banner { order: 0; }
  .bd-dock { order: 1; position: static; margin: 0; align-self: stretch; justify-content: flex-start; border-radius: var(--r-md); box-shadow: none; background: var(--bone); padding: 6px; animation: none; }
  .bd-dock .bd-tool { background: var(--white); }
  .bd-dock .bd-tool.is-on { background: var(--lime); }
  .bd-dock .bd-sep { background: var(--white); }
  .bd-stage { order: 2; }
  .bd-head--student { flex-wrap: nowrap; }
}

/* Admin → Matching (js/app/admin-matching.js): heat map of when learners can start a class */
.mx-heat { overflow-x: auto; margin-top: 14px; -webkit-overflow-scrolling: touch; }
.mx-heat table { border-collapse: separate; border-spacing: 3px; font-size: 13px; min-width: 640px; }
.mx-heat th { font-weight: 600; color: var(--muted); padding: 2px 4px; text-align: center; }
.mx-heat th[scope="row"] { text-align: left; color: var(--ink); }
.mx-heat td { width: 32px; height: 30px; text-align: center; border-radius: 6px; font-weight: 700; color: var(--forest); box-shadow: inset 0 0 0 1px var(--line); }
.mx-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.mx-group .tt-week { margin-bottom: 4px; }

/* ---------- The English launch class on Home (js/app/launch-pop.js): banner and window ---------- */
.ln-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 28px; align-items: stretch; background: var(--lime); color: var(--forest); padding: 30px; }
.ln-card__text { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.ln-card .t-h1 { color: var(--forest); }
.ln-card__photo { border-radius: var(--r-lg); overflow: hidden; min-height: 260px; background: var(--bone); }
.ln-card__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.ln__facts { display: grid; gap: 8px; margin-top: 16px; }
.ln__facts p { margin: 0; background: var(--white); border-radius: var(--r-md); padding: 13px 16px; font-weight: 600; line-height: 1.45; color: var(--ink); }
.ln-win .ln__facts p { background: var(--bone); }
.ln__count { margin: 12px 0 0; font-weight: 600; }
.ln-card .ln__count, .ln-card .ln__msg { color: var(--forest); }
.ln__btns { margin-top: 18px; }
.ln__msg { margin: 10px 0 0; }
.ln__msg:empty { display: none; }
.ln-win__card { position: relative; max-width: 560px; }
.ln-win__photo { margin: -8px -10px 20px; border-radius: var(--r-lg); overflow: hidden; height: 230px; background: var(--bone); }
.ln-win__photo img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center 28%; }
.ln-win__x { position: absolute; top: 28px; right: 30px; z-index: 2; background: var(--white); box-shadow: var(--shadow-lift); }
@media (max-width: 760px) {
  .ln-card { grid-template-columns: 1fr; padding: 22px; gap: 18px; }
  .ln-card__photo { order: -1; min-height: 0; height: 190px; }
}
@media (max-width: 560px) {
  .ln-win__photo { height: 180px; margin: -4px -4px 16px; }
  .ln-win__x { top: 26px; right: 22px; }
}

/* ---------- Offline and the installed app (docs/APP_PLAN.md, step 1; js/app/offline.js) ---------- */
.net-note { position: fixed; left: 50%; bottom: 24px; z-index: 90; max-width: min(560px, calc(100vw - 32px)); padding: 14px 20px; border-radius: var(--r-md);
  background: var(--white); color: var(--ink); box-shadow: var(--shadow-lift), inset 0 0 0 2px var(--forest); font-size: var(--fs-small); line-height: 1.45;
  transform: translate(-50%, calc(100% + 40px)); opacity: 0; transition: transform var(--t-mid) var(--spring), opacity var(--t-fast) var(--ease); pointer-events: none; }
.net-note.is-on { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; cursor: pointer; }
@media (max-width: 899px) { .net-note { bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom, 0px)); } }
.off-list { display: grid; gap: 10px; margin-top: 18px; }
.off-list:empty { display: none; }
.off-row { display: flex; align-items: center; gap: 16px; padding: 14px 18px; border-radius: var(--r-md); background: var(--bone); }
.off-row__text { flex: 1; min-width: 0; display: grid; gap: 4px; }
.off-row__text .t-small { color: var(--muted); }
.off-meter { display: block; height: 6px; border-radius: 3px; background: var(--faint); overflow: hidden; margin-top: 4px; }
.off-meter i { display: block; height: 100%; border-radius: inherit; background: var(--forest); transition: width var(--t-mid) var(--ease); }
.off-msg:empty { display: none; }
.off-msg { margin-top: 10px; color: var(--coral); }
.off-install { margin-top: 18px; }
.off-install:empty { display: none; }
.off-cover { gap: 8px; }
.off-cover svg { width: 18px; height: 18px; }
.off-cover.is-saved { box-shadow: none; background: var(--t-lime); cursor: default; }
.off-cover.is-saved:hover { background: var(--t-lime); color: var(--forest); }

/* ---------- Tutor: the 3-minute feedback banner (js/app/tutor.js, owner 12 Nov 2026) ---------- */
.tfb { position: fixed; z-index: 70; right: 24px; bottom: 24px; width: min(400px, calc(100vw - 32px)); background: var(--white); color: var(--ink);
  border-radius: var(--r-lg); box-shadow: 0 22px 60px rgba(8, 8, 8, .18), inset 0 0 0 2px var(--lime); padding: 18px 20px;
  opacity: 0; transform: translateY(16px); transition: opacity var(--t-mid) var(--ease), transform var(--t-mid) var(--ease); }
.tfb.is-in { opacity: 1; transform: none; }
.tfb__q { margin: 0; font-size: 16px; line-height: 1.35; }
.tfb__q b { font-weight: 700; }
.tfb__sub { margin: 4px 0 12px; color: var(--muted); font-size: 14px; }
.tfb__moods { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.tfb__lbl { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.tfb__ta { resize: vertical; min-height: 64px; font-size: 15px; }
.tfb__msg { margin: 6px 0 0; min-height: 1.2em; font-size: 14px; color: #b0472f; }
.tfb__msg:empty { display: none; }
.tfb .btn-row { margin-top: 10px; }
@media (max-width: 899px) { .tfb { right: 16px; left: 16px; width: auto; bottom: calc(var(--bar-h) + 12px + env(safe-area-inset-bottom)); } }
@media (prefers-reduced-motion: reduce) { .tfb { transition: none; } }
/* The recording notice under a group class's title (js/app/classroom.js) */
.cr-rec { margin: 8px 0 0; max-width: 72ch; color: var(--muted); }

/* The store app (js/app/device.js adds .is-native): no tap flash, no long-press menu or selection on buttons, links,
   menus and cards; reading text and fields stay selectable. */
.is-native, .is-native * { -webkit-tap-highlight-color: transparent; }
.is-native a, .is-native button, .is-native .btn, .is-native .card, .is-native nav, .is-native [role="button"], .is-native .top, .is-native .bar {
  -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.is-native img, .is-native svg { -webkit-touch-callout: none; -webkit-user-drag: none; }
.is-native body { overscroll-behavior: none; }

/* Teacher check-in on the next class (js/app/teach.js, owner 13 Nov 2026) */
.tc-check { margin-top: 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; }
.tc-check .t-small, .tc-check.t-small { color: var(--on-forest); margin: 0; }
.tc-check.is-done { color: var(--lime); font-weight: 700; }
.tc-checknote { margin: 0 0 14px; padding: 12px 16px; border-radius: var(--r-md); background: var(--t-lime); color: var(--forest); font-weight: 600; }
/* Teacher interview times (js/app/teach.js, docs/TEACHER_HIRING_PLAN.md) */
.iv-days { display: grid; gap: 14px; margin-top: 14px; }
.iv-day b { display: block; font-weight: 700; margin-bottom: 6px; }
.iv-times { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- The app's motion (docs/APP_PLAN.md, "The complete app", step 1; js/app/feel.js) ----------
   On phones a change of screen moves: a deeper screen slides in from the side, going back slides the other way, a
   change of section rises and fades. The top bar and the bottom bar stay where they are. */
@media (max-width: 899px) {
  .view { view-transition-name: view; }
  .bar { view-transition-name: bar; }
  .top { view-transition-name: top; }
  ::view-transition-old(view), ::view-transition-new(view) { animation-duration: 300ms; animation-timing-function: cubic-bezier(.22, .8, .24, 1); animation-fill-mode: both; mix-blend-mode: normal; }
  html[data-nav="forward"]::view-transition-old(view) { animation-name: navAwayStart; }
  html[data-nav="forward"]::view-transition-new(view) { animation-name: navFromEnd; }
  html[data-nav="back"]::view-transition-old(view) { animation-name: navAwayEnd; z-index: 1; }
  html[data-nav="back"]::view-transition-new(view) { animation-name: navFromStart; }
  html[dir="rtl"][data-nav="forward"]::view-transition-old(view) { animation-name: navAwayStartRtl; }
  html[dir="rtl"][data-nav="forward"]::view-transition-new(view) { animation-name: navFromEndRtl; }
  html[dir="rtl"][data-nav="back"]::view-transition-old(view) { animation-name: navAwayEndRtl; }
  html[dir="rtl"][data-nav="back"]::view-transition-new(view) { animation-name: navFromStartRtl; }
  /* The screen on top covers the one under it while it moves */
  html[data-nav="forward"]::view-transition-new(view), html[data-nav="back"]::view-transition-old(view) { background: var(--bone); box-shadow: 0 0 40px rgba(8, 8, 8, .12); min-height: 100vh; }
  html[data-nav="tab"]::view-transition-old(view) { animation-name: navFade; animation-duration: 120ms; }
  html[data-nav="tab"]::view-transition-new(view) { animation-name: navRise; }
  html[data-nav="none"]::view-transition-old(view), html[data-nav="none"]::view-transition-new(view) { animation-duration: 140ms; }

  /* Pressed looks under a finger */
  .bar a, .bar button { transition: background var(--t-fast) var(--ease), color var(--t-fast) var(--ease), transform var(--t-fast) var(--ease); }
  .bar a:active, .bar button:active { transform: scale(.9); }
  .bar [aria-current="page"] svg { animation: barPop .5s var(--spring) both; }
  .sheet .nav a { transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease); }
  .sheet .nav a:active { transform: scale(.97); background: var(--bone); }
  .icon-btn:active, .avatar:active, .course-btn:active { transform: scale(.92); }
  .is-sheet-open .sheet .nav__group { animation: rise var(--t-slow) var(--ease) both; }
  .is-sheet-open .sheet .nav__group:nth-child(2) { animation-delay: 60ms; }
  .is-sheet-open .sheet .nav__group:nth-child(3) { animation-delay: 120ms; }

  /* The keyboard is open: the bottom bar and the notes above it are put away */
  .is-kb .bar, .is-kb .net-note { display: none; }
  .is-kb .view { padding-bottom: 24px; }
}
@keyframes navAwayStart { to { transform: translateX(-24%); opacity: 0; } }
@keyframes navFromEnd { from { transform: translateX(100%); } }
@keyframes navAwayEnd { to { transform: translateX(100%); } }
@keyframes navFromStart { from { transform: translateX(-24%); opacity: 0; } }
@keyframes navAwayStartRtl { to { transform: translateX(24%); opacity: 0; } }
@keyframes navFromEndRtl { from { transform: translateX(-100%); } }
@keyframes navAwayEndRtl { to { transform: translateX(-100%); } }
@keyframes navFromStartRtl { from { transform: translateX(24%); opacity: 0; } }
@keyframes navFade { to { opacity: 0; } }
@keyframes navRise { from { opacity: 0; transform: translateY(14px) scale(.985); } }
@keyframes barPop { 0% { transform: scale(.7); } 60% { transform: translateY(-3px) scale(1.18); } 100% { transform: translateY(-1px) scale(1.08); } }

/* Pulling down to refresh in the store app (js/app/native.js): the Alimun loader comes down from the top */
.ptr { position: fixed; top: calc(env(safe-area-inset-top, 0px) + 6px); left: 50%; z-index: 80; width: 48px; height: 48px; margin-left: -24px; border-radius: 50%;
  background: var(--white); box-shadow: var(--shadow-lift); display: grid; place-items: center; pointer-events: none; opacity: 0;
  transform: translateY(calc(var(--pull, 0px) - 64px)) scale(.7); transition: transform var(--t-mid) var(--spring), opacity var(--t-fast) var(--ease); }
.ptr.is-moving { transition: none; }
.ptr.is-on { opacity: 1; transform: translateY(calc(var(--pull, 0px) - 40px)) scale(.85); }
.ptr.is-ready { transform: translateY(calc(var(--pull, 0px) - 40px)) scale(1); }
.ptr .whirl, .ptr .spark { animation-play-state: paused; }
.ptr.is-ready .whirl, .ptr.is-ready .spark, .ptr.is-busy .whirl, .ptr.is-busy .spark { animation-play-state: running; }

@media (max-width: 899px) { .view:focus { outline: none; } }

/* ---------- Signing in and the first set-up inside the store app (js/app/account.js) ---------- */
.ac { min-height: 100dvh; display: flex; flex-direction: column; padding: calc(env(safe-area-inset-top, 0px) + 14px) 16px calc(env(safe-area-inset-bottom, 0px) + 28px); max-width: 560px; margin: 0 auto; width: 100%; }
.ac__top { display: flex; align-items: center; gap: 8px; height: 44px; }
.ac__top .book { width: 32px; height: 34px; overflow: visible; }
.ac__top .wordmark { height: 19px; }
.ac__body { flex: 1; view-transition-name: view; outline: none; }
.ac__in { display: grid; gap: 16px; padding-top: 8px; }
.ac__back { border: 0; background: none; cursor: pointer; font: inherit; font-weight: 700; justify-self: start; margin: 0; }
.ac__stage { min-height: 0; height: 190px; padding: 16px; justify-content: flex-end; }
.ac__stage > svg { width: 132px; height: 132px; }
.ac__stage .bub { top: 14px; inset-inline-start: 16px; }
.ac__card .t-h1 { font-size: 38px; }
.ac__lead { margin: 8px 0 0; color: var(--muted); }
.ac__form { display: grid; gap: 14px; margin-top: 20px; }
.ac__form .st-in { box-shadow: inset 0 0 0 2px var(--line); background: var(--white); min-height: 50px; }
.ac-pw { position: relative; }
.ac-pw .st-in { padding-inline-end: 84px; }
.ac-pw .linkish { position: absolute; inset-inline-end: 12px; top: 50%; transform: translateY(-50%); font-size: 14px; }
.ac__link { justify-self: start; }
.ac__go { width: 100%; justify-content: center; min-height: 54px; }
.ac__alt { margin: 18px 0 0; text-align: center; color: var(--muted); }
.ac__hint { margin: 0; color: var(--muted); }
.ac__hint a { color: var(--forest); font-weight: 700; }
.ac__ticks { margin-top: 0; }
.ac__choices { display: grid; gap: 10px; margin-top: 20px; }
.ac__choice { display: grid; gap: 2px; text-align: start; border: 0; border-radius: var(--r-md); padding: 16px 18px; background: var(--bone); color: var(--ink); font: inherit; cursor: pointer;
  box-shadow: inset 0 0 0 2px transparent; transition: transform var(--t-fast) var(--ease), background var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.ac__choice b { font-size: 17px; }
.ac__choice span { color: var(--muted); font-size: var(--fs-small); }
.ac__choice:active { transform: scale(.98); }
.ac__choice[aria-pressed="true"] { background: var(--lime); box-shadow: inset 0 0 0 2px var(--forest); }
.ac__choices + .st-msg { margin-top: 12px; }
.ac__choices ~ .ac__go { margin-top: 8px; }

/* ---------- Help and Support (docs/HELP_PLAN.md, Part 2; js/app/help.js) ---------- */
.hp-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp-h { margin: 52px 0 20px; }
.hp-h--sm { margin: 36px 0 16px; }
.hp-back { display: inline-flex; align-items: center; gap: 8px; margin: 4px 0 18px; color: var(--forest); font-weight: 700; text-decoration: none; }
.hp-back svg { width: 18px; height: 18px; transition: transform var(--t-fast) var(--ease); }
.hp-back:hover svg { transform: translateX(-3px); }
[dir="rtl"] .hp-back svg, [dir="rtl"] .hp-row > svg, [dir="rtl"] .hp-topic__go svg, [dir="rtl"] .hp-suggest a svg, [dir="rtl"] .hp-related a svg, [dir="rtl"] .hp-turn__from a svg, [dir="rtl"] .hp-cta .btn svg { transform: scaleX(-1); }
.hp-sample { margin-top: 22px; }

/* Hero: the question box on forest (Help) or on coral (Support), the lifebuoy beside it */
.hp-hero, .sp-hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 12px 32px; align-items: center; padding: 44px 44px 40px; overflow: visible; }
.hp-hero__main { display: grid; gap: 18px; min-width: 0; }
.hp-hero .t-display, .sp-hero .t-display, .hp-topic-hero .t-display { text-wrap: balance; }
.hp-hero .t-lead { color: var(--on-forest); margin: -4px 0 6px; }
.sp-hero .t-lead { margin: -4px 0 0; }
.hp-hero__art { position: relative; align-self: stretch; min-height: 250px; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; }
.hp-hero__art > svg { width: 230px; height: 230px; overflow: visible; filter: drop-shadow(0 18px 22px rgba(8, 8, 8, .18)); }
.hp-hero__art .bub { top: -6px; inset-inline-start: 0; max-width: 260px; }
.sp-hero { padding-block: 36px; }
.sp-hero .hp-hero__art { min-height: 210px; }
.sp-hero .hp-hero__art > svg { width: 190px; height: 190px; filter: drop-shadow(0 14px 18px rgba(176, 71, 47, .18)); }

/* The question box */
.hp-ask { position: relative; display: flex; align-items: flex-end; background: var(--white); border-radius: 32px; padding: 7px 7px 7px 26px; box-shadow: 0 14px 34px rgba(0, 0, 0, .22); transition: box-shadow var(--t-fast) var(--ease); }
.hp-ask:focus-within { box-shadow: 0 0 0 4px var(--lime), 0 14px 34px rgba(0, 0, 0, .22); }
.hp-ask__in { flex: 1; min-width: 0; border: 0; background: transparent; resize: none; font: inherit; font-size: 18px; line-height: 1.45; padding: 14px 0; min-height: 54px; max-height: 180px; outline: none; color: var(--ink); }
.hp-ask__in::placeholder { color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hp-ask__go { flex: none; width: 54px; height: 54px; border-radius: 50%; border: 0; background: var(--lime); color: var(--forest); display: grid; place-items: center; cursor: pointer; transition: transform var(--t-fast) var(--spring), background var(--t-fast); }
.hp-ask__go svg { width: 24px; height: 24px; }
.hp-ask__go:hover { transform: scale(1.07) rotate(-8deg); }
.hp-ask.is-busy .hp-ask__go { background: var(--bone); pointer-events: none; }
[dir="rtl"] .hp-ask { padding: 7px 26px 7px 7px; }
[dir="rtl"] .hp-ask__go svg { transform: scaleX(-1); }

/* Suggestions and common questions, on forest */
.hp-suggest:empty, .hp-answer:empty { display: none; }
.hp-suggest { display: grid; gap: 2px; }
.hp-suggest .t-tiny { margin: 0 0 4px; color: var(--lime); font-weight: 700; }
.hp-suggest a { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 14px; margin-inline: -14px; border-radius: var(--r-sm); color: var(--bone); text-decoration: none; font-weight: 600; font-size: 16.5px; transition: background var(--t-fast), color var(--t-fast); }
.hp-suggest a + a { box-shadow: inset 0 1px 0 rgba(240, 239, 233, .12); }
.hp-suggest a:hover { background: rgba(240, 239, 233, .08); color: var(--lime); box-shadow: none; }
.hp-suggest a:hover + a { box-shadow: none; }
.hp-suggest a svg { width: 18px; height: 18px; flex: none; color: var(--lime); transition: transform var(--t-fast) var(--ease); }
.hp-suggest a:hover svg { transform: translateX(4px); }
.hp-ai { margin: 14px 4px 0; max-width: 80ch; }

/* One question and its answer, under the hero */
.hp-answer { margin-top: var(--gap); }
.hp-turn { display: grid; gap: 16px; padding: 28px 32px; animation: rise var(--t-slow) var(--ease) both; }
.hp-turn__q { justify-self: end; max-width: 80%; margin: 0; background: var(--forest); color: var(--bone); padding: 12px 18px; border-radius: 22px 22px 6px 22px; font-weight: 600; font-size: 16.5px; overflow-wrap: anywhere; }
.hp-turn__row { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; align-items: start; }
.hp-turn__av { width: 64px; height: 64px; border-radius: 50%; background: var(--t-mint); display: grid; place-items: center; overflow: hidden; }
.hp-turn__av svg { width: 96%; height: 96%; margin-top: 6%; }
.hp-turn__body { display: grid; gap: 14px; min-width: 0; }
.hp-turn__a { background: var(--t-lime); border-radius: 6px 24px 24px 24px; padding: 20px 22px; display: grid; gap: 14px; }
.hp-turn__a p { margin: 0; font-size: 17px; line-height: 1.6; }
.hp-turn__a.is-unsure { background: var(--t-sun); }
.hp-turn__a.is-wait { width: max-content; padding: 18px 24px; }
.hp-turn__from { display: grid; gap: 2px; border-top: 1px solid var(--line); padding-top: 12px; }
.hp-turn__from .t-tiny { font-weight: 700; }
.hp-turn__from a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 10px; margin-inline: -10px; border-radius: var(--r-sm); color: var(--forest); text-decoration: none; font-weight: 700; transition: background var(--t-fast); }
.hp-turn__from a:hover { background: rgba(255, 255, 255, .75); }
.hp-turn__from a svg { width: 18px; height: 18px; flex: none; }
.hp-turn__foot { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 12px; }
.hp-turn__foot .t-small { margin: 0; flex-basis: 100%; }
.hp-turn__foot > span.t-small { flex-basis: auto; margin-inline-end: 4px; }
.hp-thanks { display: inline-flex; align-items: center; gap: 8px; margin: 0; color: var(--forest); font-weight: 700; }
.hp-thanks svg { width: 22px; height: 22px; padding: 3px; border-radius: 50%; background: var(--lime); }
.hp-dots { display: inline-flex; gap: 6px; }
.hp-dots i { width: 8px; height: 8px; border-radius: 50%; background: var(--forest); animation: typing 1.2s infinite; }
.hp-dots i:nth-child(2) { animation-delay: .2s; } .hp-dots i:nth-child(3) { animation-delay: .4s; }

/* Topics: tinted cards with their drawing, as on Home */
.hp-topic { display: grid !important; grid-template-rows: auto 1fr auto; gap: 14px; padding: 26px 26px 22px; min-height: 270px; }
.hp-topic__art { width: 104px; height: 104px; display: block; }
.hp-topic__art svg { width: 100%; height: 100%; overflow: visible; transition: transform var(--t-mid) var(--spring); }
.hp-topic:hover .hp-topic__art svg { transform: rotate(-6deg) scale(1.06); }
.hp-topic__txt { display: grid; gap: 8px; align-content: start; min-width: 0; }
.hp-topic__txt .t-h3 { font-weight: 400; color: var(--ink); font-size: 30px; line-height: .95; }
.hp-topic__txt small { font-size: 14.5px; color: var(--muted); line-height: 1.45; }
.hp-topic__go { justify-self: end; width: 44px; height: 44px; border-radius: 50%; background: var(--white); color: var(--forest); display: grid; place-items: center; transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast) var(--ease); }
.hp-topic__go svg { width: 20px; height: 20px; }
.hp-topic:hover .hp-topic__go { background: var(--forest); color: var(--lime); transform: translateX(3px); }
.card--bone.hp-topic .hp-topic__go { background: var(--white); }

/* Support banner on Help */
.hp-cta { display: grid !important; grid-template-columns: 110px minmax(0, 1fr) auto; align-items: center; gap: 18px 28px; margin-top: 52px; padding: 22px 34px 22px 22px; }
.hp-cta__art svg { width: 110px; height: 110px; overflow: visible; }
.hp-cta__txt { display: grid; gap: 8px; }
.hp-cta .t-body { color: var(--forest); opacity: .8; }

/* A topic */
.hp-topic-hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 34px 40px; margin-bottom: var(--gap); min-height: 190px; }
.hp-topic-hero__art { width: 150px; height: 150px; flex: none; }
.hp-topic-hero__art svg { width: 100%; height: 100%; overflow: visible; }

/* Article rows */
.card.hp-rows, .hp-rows { padding: 10px; display: grid; }
.hp-row { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) 40px; align-items: center; gap: 18px; padding: 18px 20px; border-radius: var(--r-md); color: var(--ink); text-decoration: none; transition: background var(--t-fast); }
.hp-row + .hp-row::before { content: ""; position: absolute; top: 0; inset-inline: 20px; height: 1px; background: var(--line); }
.hp-row:hover { background: var(--t-lime); }
.hp-row:hover::before, .hp-row:hover + .hp-row::before { opacity: 0; }
.hp-row b { display: block; font-size: 17px; }
.hp-row small { display: block; margin-top: 5px; font-size: 14.5px; color: var(--muted); line-height: 1.45; }
.hp-row > svg { width: 40px; height: 40px; padding: 10px; border-radius: 50%; color: var(--forest); background: var(--bone); transition: background var(--t-fast), color var(--t-fast); }
.hp-row:hover > svg { background: var(--forest); color: var(--lime); }
.card--bone .hp-row > svg { background: var(--white); }
.card--bone .hp-row:hover { background: var(--white); }
section.card .hp-rows { padding: 0; margin: 12px -12px -8px; }

/* One article */
.hp-doc { padding: clamp(28px, 4vw, 48px); }
.hp-doc h1 { margin-bottom: 20px; }
.hp-doc p { max-width: 66ch; font-size: 17px; line-height: 1.72; margin: 0 0 16px; }
.hp-doc .hp-doc__sum { font-size: 19px; line-height: 1.55; font-weight: 600; background: var(--t-lime); border-radius: var(--r-md); padding: 18px 22px; margin-bottom: 26px; }
.hp-doc .hp-doc__date { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: var(--fs-tiny); }
.hp-side { display: grid; gap: var(--gap); align-content: start; }
.hp-stage { position: relative; }
.hp-stage--sm { min-height: 250px; }
.hp-stage--sm > svg { height: 140px; }
.hp-rate { display: grid; gap: 12px; padding: 22px 24px; }
.hp-rate .btn-row { gap: 10px; }
.hp-related { padding: 22px 14px 12px; }
.hp-related h2 { margin: 0 10px 8px; }
.hp-related a { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 10px; border-radius: var(--r-sm); color: var(--ink); text-decoration: none; font-weight: 600; transition: background var(--t-fast); }
.hp-related a:hover { background: var(--t-lime); }
.hp-related a svg { width: 18px; height: 18px; flex: none; color: var(--forest); }

/* Support */
.sp-grid { margin-top: var(--gap); align-items: start; }
.sp-compose { display: grid; gap: 16px; align-content: start; padding: 32px; }
.sp-compose .t-small { margin-top: -6px; }
.sp-msg { resize: vertical; min-height: 150px; line-height: 1.5; }
.sp-send { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 18px; }
.sp-send .st-msg { flex: 1; }
.sp-attached { background: var(--t-lime); border-radius: var(--r-md); padding: 12px 16px; }
.sp-attached p { margin: 4px 0 0; font-weight: 600; overflow-wrap: anywhere; }
.sp-aside { display: grid; gap: var(--gap); align-content: start; min-width: 0; }
.sp-mine .sp-list { box-shadow: none; padding: 0; margin: 12px -12px -8px; background: transparent; }
.sp-quick { padding: 26px 28px 22px; }
.sp-conv { grid-template-columns: 44px minmax(0, 1fr) auto; }
.sp-conv .ms-conv__art svg { width: 100%; }
.sp-conv__when { align-self: start; margin-top: 3px; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.sp-conv.is-unread .sp-conv__when { color: var(--forest); font-weight: 800; }
.hp-none { padding: 12px; margin: 0; }
.sp-side { gap: 4px; }
.sp-new { margin: 6px 4px 4px; align-self: flex-start; }
.sp-new svg { width: 18px; height: 18px; }
.sp-head { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.sp-head > div { min-width: 0; }
.sp-wait { align-self: center; display: flex; align-items: center; gap: 10px; margin: 10px 0 0; padding: 8px 16px 8px 8px; border-radius: 30px; background: var(--white); color: var(--muted); font-size: 14px; }
.sp-wait svg { width: 36px; height: 36px; flex: none; }
.sp-closed { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.sp-layout .ms-msg__time { margin-top: 2px; }
.sp-layout .ms-msg.is-teacher .ms-bub { background: var(--t-mint); }

@media (max-width: 1099px) {
  .hp-topics > .hp-topic { grid-column: span 6; }
  .hp-hero, .sp-hero { grid-template-columns: minmax(0, 1fr) 220px; padding: 36px; }
  .hp-hero__art > svg { width: 180px; height: 180px; }
  .sp-hero .hp-hero__art > svg { width: 160px; height: 160px; }
  .hp-hero__art .bub { max-width: 210px; }
}
@media (max-width: 899px) {
  .hp-article > *, .sp-grid > *, .sp-aside { grid-column: span 12; }
  .hp-article .hp-stage { display: none; }
  .hp-hero, .sp-hero { grid-template-columns: 1fr; padding: 26px 22px 24px; }
  .hp-hero__art { order: -1; min-height: 0; flex-direction: row-reverse; justify-content: flex-end; align-items: center; gap: 4px; }
  .hp-hero__art > svg, .sp-hero .hp-hero__art > svg { width: 84px; height: 84px; filter: none; }
  .hp-hero__art .bub { position: relative; inset: auto; animation: none; max-width: none; font-size: 14px; padding: 9px 13px; }
  .hp-hero__art .bub.say::after { inset-inline-start: -11px; bottom: 50%; transform: translateY(50%) rotate(135deg); }
  .hp-hero__art .bub.think::before, .hp-hero__art .bub.think::after { display: none; }
  .hp-turn { padding: 22px 18px; }
  .hp-turn__row { grid-template-columns: 44px minmax(0, 1fr); gap: 10px; }
  .hp-turn__av { width: 44px; height: 44px; }
  .hp-topic-hero { padding: 26px 24px; min-height: 0; }
  .hp-topic-hero__art { width: 96px; height: 96px; }
  .hp-cta { grid-template-columns: 72px minmax(0, 1fr); padding: 20px 22px; }
  .hp-cta__art svg { width: 72px; height: 72px; }
  .hp-cta .btn { grid-column: 1 / -1; justify-self: start; }
}
@media (max-width: 599px) {
  .hp-topics > .hp-topic { grid-column: span 12; min-height: 0; grid-template-columns: 72px minmax(0, 1fr) 40px; grid-template-rows: none; align-items: center; padding: 18px; }
  .hp-topic__art { width: 72px; height: 72px; }
  .hp-topic__txt .t-h3 { font-size: 24px; }
  .hp-topic__go { width: 40px; height: 40px; }
  .hp-ask { padding-inline-start: 20px; }
  .hp-ask__in { font-size: 16.5px; }
  .hp-turn__q { max-width: 92%; }
  .hp-doc p { font-size: 16.5px; }
  .sp-compose { padding: 24px 20px; }
}
@media (prefers-reduced-motion: reduce) { .hp-turn { animation: none; } .hp-dots i { animation: none; } .hp-topic:hover .hp-topic__art svg { transform: none; } }
.hp-hero__art::before { content: ""; position: absolute; bottom: -6px; left: 50%; width: 250px; height: 250px; margin-left: -125px; border-radius: 50%; background: var(--t-mint); }
.sp-hero .hp-hero__art::before { width: 210px; height: 210px; margin-left: -105px; background: var(--white); opacity: .7; }
.hp-hero__art > svg { position: relative; margin-bottom: 4px; }
.hp-hero__art .bub { z-index: 3; }
.card--white { background: var(--white); }
@media (max-width: 1099px) { .hp-hero__art::before { width: 190px; height: 190px; margin-left: -95px; } .sp-hero .hp-hero__art::before { width: 170px; height: 170px; margin-left: -85px; } }
@media (max-width: 899px) { .hp-hero__art::before { width: 84px; height: 84px; left: auto; margin: 0; bottom: auto; inset-inline-start: 0; top: 50%; transform: translateY(-50%); } .sp-hero .hp-hero__art::before { width: 84px; height: 84px; margin: 0; } }
.hp-hero__art .bub { top: auto; bottom: 236px; }
.sp-hero .hp-hero__art .bub { bottom: 196px; }
@media (max-width: 1099px) { .hp-hero__art .bub { bottom: 178px; } .sp-hero .hp-hero__art .bub { bottom: 160px; } }
@media (max-width: 899px) { .hp-hero__art .bub, .sp-hero .hp-hero__art .bub { bottom: auto; } }
@media (max-width: 899px) { .sp-hero .hp-hero__art { min-height: 0; } .sp-hero { padding-block: 24px; } }

/* The tutor says it is AI (owner, 16 Nov 2026; EU AI Act): under the Tutor heading and in every session */
.tu-ai { display: inline-flex; align-items: center; gap: 8px; margin: 10px 0 0; padding: 6px 12px 6px 10px; border-radius: 10px; background: var(--t-lime); color: var(--forest); font-size: 14px; font-weight: 600; line-height: 1.4; }
.tu-ai::before { content: ""; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--lime); box-shadow: 0 0 0 3px rgba(206, 255, 101, .35); }

/* The practice classroom (docs/TEACHER_ONBOARDING_PLAN.md) */
.pr-tips .t-small + .t-small { margin-top: 8px; }
/* A row with no time in front (course contracts): the text, then its buttons on the right */
.tt-row--plain { grid-template-columns: minmax(0, 1fr) auto; align-items: center; }
@media (max-width: 520px) { .tt-row--plain { grid-template-columns: 1fr; gap: 10px; } .tt-row--plain .btn-row { margin: 0; } }
/* A side panel with one part only (practice classroom): its name as a heading */
.cr-tabs--one { justify-content: space-between; }
.cr-one { margin: 0; }
/* Board controls (teacher): one bar under the page switcher, each label beside its menu, "Everyone solves this" at the end */
.bd-ctls { flex: 1 1 100%; align-items: center; gap: 8px; padding: 8px; border-radius: var(--r-md); background: var(--bone); }
.bd-ctls .btn--quiet, .bd-ctls .st-in { background: var(--white); }
.bd-field { flex-direction: row; align-items: center; gap: 8px; }
.bd-field > .t-small { white-space: nowrap; padding-inline-start: 6px; }
.bd-field--solo { margin-inline-start: auto; }
/* Room under the page's last line for the floating pen toolbar */
.bd-paper { padding-bottom: 130px; }
/* Practice classroom: no empty video box in the sample; the guide at reading size, without a scroll box */
.cr--novideo .cr-video { display: none; }
.cr--novideo.has-board .cr-body { grid-template-areas: "board side"; grid-template-rows: auto; }
.cr--novideo:not(.has-board) .cr-body { grid-template-columns: minmax(0, 1fr); grid-template-areas: "side"; }
.cr--practice .cr-side { max-height: none; }
.cr--practice .cr-panel { overflow: visible; }
.pr-tips { display: flex; flex-direction: column; gap: 20px; }
.pr-tips section > .t-h3 { margin: 0 0 6px; }
.pr-tips .t-body { font-size: 16px; line-height: 1.5; }
.pr-note { margin: 0; padding: 12px 14px; border-radius: var(--r-md); background: var(--t-sun); font-size: 15px; line-height: 1.45; }
@media (max-width: 899px) { .bd-paper { padding-bottom: 36px; } }
/* The dashboard tour (js/app/teach-tour.js): the screen dims, the real element is lit up, a card says what it is */
.tour { position: fixed; inset: 0; z-index: 900; }
.tour__dim { position: absolute; inset: 0; background: rgba(8, 8, 8, .55); }
.tour__spot { position: absolute; border-radius: var(--r-md); box-shadow: 0 0 0 3px var(--lime), 0 0 0 9999px rgba(8, 8, 8, .55); pointer-events: none; transition: left .3s var(--ease), top .3s var(--ease), width .3s var(--ease), height .3s var(--ease); }
.tour__card { position: absolute; width: min(400px, calc(100vw - 32px)); padding: 22px 22px 18px; border-radius: var(--r-lg); background: var(--white); box-shadow: var(--shadow-lift); transition: opacity .15s var(--ease); }
.tour.is-moving .tour__card { opacity: 0; }
.tour__card .t-h3 { margin: 0 0 8px; margin-inline-end: 40px; }
.tour__card .t-body { font-size: 16px; line-height: 1.5; }
.tour__row { display: flex; justify-content: space-between; gap: 10px; margin-top: 18px; }
.tour__x { position: absolute; top: 12px; inset-inline-end: 12px; width: 36px; height: 36px; background: var(--bone); box-shadow: none; }
.tour__x svg { width: 18px; height: 18px; }
.tour__card.is-center { left: 50%; top: 50%; transform: translate(-50%, -50%); width: min(480px, calc(100vw - 32px)); padding: 30px 30px 24px; }
.tour__card.is-center .t-h3 { font-size: 30px; }
.tour__card.is-dock { left: 12px; right: 12px; top: auto; bottom: calc(var(--bar-h) + 28px + env(safe-area-inset-bottom)); width: auto; }
