@font-face { font-family: "Work Sans"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/work-sans-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Work Sans"; font-weight: 600; font-style: normal; font-display: swap; src: url("vendor/fonts/work-sans-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Aref Ruqaa"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/aref-ruqaa-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }
@font-face { font-family: "Noto Naskh Arabic"; font-weight: 700; font-style: normal; font-display: swap; src: url("vendor/fonts/noto-naskh-arabic-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }

@font-face { font-family: "Fraunces"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/fraunces-latin-400-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: normal; font-display: swap; src: url("vendor/fonts/fraunces-latin-600-normal.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-weight: 600; font-style: italic; font-display: swap; src: url("vendor/fonts/fraunces-latin-600-italic.woff2") format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Amiri"; font-weight: 400; font-style: normal; font-display: swap; src: url("vendor/fonts/amiri-arabic-400-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }
@font-face { font-family: "Amiri"; font-weight: 700; font-style: normal; font-display: swap; src: url("vendor/fonts/amiri-arabic-700-normal.woff2") format("woff2"); unicode-range: U+0600-06FF, U+0750-077F, U+FB50-FDFF, U+FE70-FEFF, U+200C-200F, U+25CC; }

:root {
  --navy: #0B1B33; --deep: #1F3550; --orange: #C8963E; --mint: #D3E3DA; --cream: #FAF6EF; --slate: #5B6573;
  --ok: #2E7D5B; --bad: #B5473A; --line: #E4DACB; --white: #FFFFFF;
  --gold: #C8963E; --gold-deep: #876020; --ink-soft: #3A4B63; --sage: #2F6F6A; --ivory-2: #F3ECDF;
  --shadow-1: 0 1px 2px rgba(11,27,51,.05), 0 4px 14px rgba(11,27,51,.06);
  --shadow-2: 0 2px 4px rgba(11,27,51,.05), 0 14px 36px rgba(11,27,51,.10);
  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-ar: "Amiri", "Noto Naskh Arabic", "Geeza Pro", "Droid Naskh Shared", "Segoe UI", Tahoma, serif;
  --font-ar-display: "Aref Ruqaa", "Amiri", "Noto Naskh Arabic", serif;
  --font-ui: "Work Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --s1: 0.375rem; --s2: 0.75rem; --s3: 1.125rem; --s4: 1.5rem; --radius: 20px; --touch: 48px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--cream); background-image: radial-gradient(1200px 500px at 50% -120px, #fffdf8 0%, rgba(255,253,248,0) 70%); background-repeat: no-repeat; color: var(--navy); font: 1rem/1.55 var(--font-ui); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
.page { max-inline-size: 30rem; margin-inline: auto; }
.screen { padding: var(--s3); display: grid; gap: var(--s3); outline: none; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); padding: 6px var(--s3); background: var(--navy); color: var(--white); min-block-size: 56px; }
.brand { color: var(--white); text-decoration: none; font: 600 1.125rem var(--font-ui); display: inline-flex; align-items: center; min-block-size: 44px; }
.brand { gap: 0.3em; }
.brand b { color: var(--orange); font-weight: 600; }
.pill { min-block-size: 44px; border: 1px solid rgba(255,255,255,.6); background: transparent; color: var(--white); border-radius: 999px; padding: 0 var(--s2); font: 400 0.8125rem var(--font-ui); cursor: pointer; }
.pill[aria-pressed="true"] { background: var(--orange); border-color: var(--orange); color: var(--navy); }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }
.card :focus-visible, .btn:focus-visible, .opt:focus-visible { outline-color: var(--navy); }

.progress { block-size: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress__fill { inline-size: var(--p); block-size: 100%; background: var(--orange); border-radius: 999px; transition: inline-size .2s; }
.eyebrow { margin: 0; font-size: 0.8125rem; color: var(--slate); }
.top { display: grid; gap: var(--s1); }
/* the lesson header, with the tutor, stays with the learner as the page scrolls (Michael, 2026-11-17); it gets smaller once the page has moved */
.top--lesson { position: sticky; inset-block-start: 0; z-index: 30; background: var(--cream); padding-block: 6px; margin-block: -6px 0; }
.top--lesson[data-stuck] .eyebrow, .top--lesson[data-stuck] .title-en, .top--lesson[data-stuck] .lesson-look__chip, .top--lesson[data-stuck] .lesson-look__full, .top--lesson[data-stuck] .lesson-look__tag, .top--lesson[data-stuck] .lesson-look__pick { display: none; }
.top--lesson[data-stuck] .lesson-tutor, .top--lesson[data-stuck] .lesson-look__frame { inline-size: 52px; }
.top--lesson[data-stuck] .lesson-look[data-look="photo"] .lesson-look__frame { inline-size: 64px; }
.top--lesson[data-stuck] .title-ar { font-size: 1.375rem; line-height: 1.5; }
h1, h2 { margin: 0; }
.title-ar { font-family: var(--font-ar-display); font-weight: 400; font-size: 2rem; line-height: 2; color: var(--navy); }
.title-en { margin: 0; color: var(--slate); font-size: 0.9375rem; }
.h2 { font: 600 1.125rem/1.3 var(--font-ui); }
.card { background: var(--white); box-shadow: 0 1px 0 var(--line); border-radius: var(--radius); padding: var(--s3); min-inline-size: 0; display: grid; gap: var(--s2); }
.label { margin: 0; font: 600 0.75rem/1.3 var(--font-ui); letter-spacing: 0.04em; text-transform: uppercase; color: var(--slate); }
.prompt { margin: 0; font-size: 1.0625rem; }
.help { margin: 0; color: var(--slate); font-size: 0.9375rem; }
.tr { margin: 0; font-style: italic; color: var(--deep); font-size: 0.9375rem; }

/* Arabic: rtl, start aligned (right edge), generous line height so marks are not clipped. */
.ar { font-family: var(--font-ar); line-height: 2.1; font-size: 1.375rem; margin: 0; direction: rtl; text-align: start; unicode-bidi: isolate; overflow-wrap: anywhere; }
.ar--lg { font-size: 1.75rem; line-height: 2.2; }
.ar--xl { font-size: 3rem; line-height: 2; }
.item { display: grid; gap: 0; justify-items: stretch; padding-block: var(--s1); border-block-end: 1px solid var(--line); }
.item:last-child { border: 0; }
.item .row { display: flex; flex-direction: column; align-items: stretch; gap: var(--s1); }
.item .row > .play { align-self: flex-start; }
.item .txt { min-inline-size: 0; flex: 1; }
.name { font-family: var(--font-ar-display); font-size: 1.5rem; line-height: 2; direction: rtl; text-align: start; margin: 0; }

.btn { min-block-size: var(--touch); min-inline-size: 6.5rem; padding-inline: var(--s3); display: inline-flex; align-items: center; justify-content: center; gap: var(--s1); font: 600 1rem var(--font-ui); border-radius: 999px; border: 2px solid var(--navy); cursor: pointer; background: transparent; color: var(--navy); }
.btn--primary { background: var(--orange); border-color: var(--orange); }
.btn--mint { background: var(--mint); border-color: var(--mint); }
.btn[disabled] { opacity: .45; cursor: default; }
.nav { display: flex; justify-content: space-between; gap: var(--s2); }
.play { min-block-size: 44px; min-inline-size: 44px; border-radius: 999px; border: 2px solid var(--navy); background: var(--white); color: var(--navy); font: 600 0.875rem var(--font-ui); cursor: pointer; padding: 0 var(--s2); flex: none; }
.play.is-missing { border-style: dashed; color: var(--slate); border-color: var(--slate); }
.play.is-playing { background: var(--mint); }
.audio-state { margin: 0; font-size: 0.8125rem; color: var(--slate); }
.audio-state.is-missing { background: var(--cream); border-radius: 8px; padding: 2px var(--s1); color: var(--deep); }

.options { display: grid; grid-template-columns: 1fr; gap: var(--s2); }
.options--row { grid-template-columns: repeat(auto-fit, minmax(5.5rem, 1fr)); }
.opt { min-block-size: var(--touch); padding: var(--s1) var(--s2); background: var(--white); color: var(--navy); border: 2px solid var(--line); border-radius: 12px; cursor: pointer; text-align: center; font: 400 1rem var(--font-ui); display: grid; gap: 0; align-content: center; }
.opt .ar { text-align: center; }
.opt .opt-help { font-size: 0.8125rem; color: var(--slate); }
.opt.is-ok { border-color: var(--ok); background: #EAF6EF; }
.opt.is-bad { border-color: var(--bad); background: #FBECEA; }
.opt.is-sel { border-color: var(--navy); background: var(--mint); }
.opt[disabled] { cursor: default; }
.feedback { margin: 0; padding: var(--s2); border-radius: 12px; font-size: 0.9375rem; }
.feedback.ok { background: #EAF6EF; color: #1d5c3a; }
.feedback.bad { background: #FBECEA; color: #8a2f25; }
.match { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.match .col { display: grid; gap: var(--s2); align-content: start; }
.tiles, .answer { display: flex; flex-wrap: wrap; gap: var(--s1); direction: rtl; min-block-size: 3.25rem; }
.answer { border: 2px dashed var(--line); border-radius: 12px; padding: var(--s1); background: var(--cream); }
.tile { min-block-size: var(--touch); min-inline-size: var(--touch); border-radius: 12px; border: 2px solid var(--navy); background: var(--white); font: 400 1.5rem/1 var(--font-ar); cursor: pointer; }
.field { min-block-size: var(--touch); inline-size: 100%; border: 2px solid var(--line); border-radius: 12px; padding: 0 var(--s2); font: 400 1.5rem var(--font-ar); direction: rtl; text-align: start; background: var(--white); color: var(--navy); }
.keys { display: flex; gap: var(--s1); flex-wrap: wrap; direction: rtl; }
.rec { display: flex; flex-wrap: wrap; gap: var(--s2); }
.who { font-size: 0.75rem; color: var(--slate); margin: 0; }
.chips { display: flex; gap: var(--s1); flex-wrap: wrap; }
.result { text-align: center; display: grid; gap: var(--s2); justify-items: center; }
.big { font: 600 2.25rem/1 var(--font-ui); margin: 0; }
.lessons { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.lesson-link { display: grid; gap: 0; text-decoration: none; color: var(--navy); background: var(--white); border-radius: var(--radius); padding: var(--s3); box-shadow: 0 1px 0 var(--line); min-block-size: var(--touch); }
.lesson-link .state { font-size: 0.8125rem; color: var(--slate); }
.lesson-link.is-done { border-inline-start: 6px solid var(--ok); }
.foot { margin: 0; padding: var(--s2) var(--s3); font-size: 0.75rem; color: var(--slate); border-block-start: 1px solid var(--line); }
.honest { margin: 0; padding: var(--s1) var(--s2); font-size: 0.75rem; background: var(--mint); border-radius: 8px; justify-self: start; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }
.feedback .ar { display: inline-block; margin-inline: 0.5rem; vertical-align: middle; }

/* talk page and typed-answer marks keys */
.keys--marks { gap: var(--s1); }
.tile--mark { font-size: 1.25rem; }
.banked-label { margin: 0; padding: var(--s1) var(--s2); font-size: 0.8125rem; font-weight: 600; background: var(--mint); border-radius: 8px; justify-self: start; }
.title-en--h1 { font: 600 1.375rem/1.3 var(--font-ui); color: var(--navy); }
.chat { gap: var(--s2); }
.bubble { display: grid; gap: 0; padding: var(--s2); border-radius: 14px; max-inline-size: 100%; min-inline-size: 0; }
.bubble--tutor { background: var(--cream); border: 1px solid var(--line); }
.bubble--you { background: var(--white); border: 2px solid var(--line); }
.bubble--you[data-verdict="clear"] { border-color: var(--ok); background: #EAF6EF; }
.bubble--you[data-verdict="close"] { border-color: var(--orange); }
.bubble--you[data-verdict="not_yet"] { border-color: var(--bad); background: #FBECEA; }
.bubble--sys { background: var(--mint); }
.chip { margin: 0; font-size: 0.875rem; font-weight: 600; }
.sys-note { margin: 0; font-size: 0.875rem; color: var(--slate); text-align: center; }
.recap-line { padding-block: var(--s1); border-block-end: 1px solid var(--line); text-align: start; justify-self: stretch; }
.result .line { justify-self: stretch; }

/* talk page tutor (avatar from app/vendor/avatar) */
.tutor-card { display: grid; grid-template-columns: 116px minmax(0, 1fr); gap: var(--s2); align-items: center; position: sticky; inset-block-start: 0; z-index: 5; padding: var(--s2); }
.tutor-stage { inline-size: 116px; border-radius: 14px; overflow: hidden; background: var(--mint); }
.tutor-side { display: grid; gap: var(--s1); justify-items: start; min-inline-size: 0; }
.tutor-frame { position: relative; inline-size: 116px; border-radius: 14px; overflow: hidden; }
.tutor-photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; display: block; background: var(--cream); }
.tutor-photo[hidden] { display: none; }
.tutor-video { z-index: 1; background: transparent; }
.tutor-video[hidden] { display: none; }
.tutor-card[data-video="playing"] canvas.tutor-mouth { visibility: hidden; }
.tutor-ai { margin: 0; font-size: 0.75rem; color: var(--slate); }
.tutor-look { min-block-size: 36px; font-size: 0.8125rem; }
/* real-looking tutor: a large photo, like a video call. The drawn tutor stays in the page under it and gives the mouth its timing. */
.tutor-card[data-look="photo"] { grid-template-columns: minmax(0, 1fr); position: static; }
/* the big photo follows the learner as a small picture at the top corner once the page has scrolled past it; tap it to go back up to the tutor */
.tutor-card[data-look="photo"].is-docked .tutor-frame { position: fixed; inset-block-start: max(8px, env(safe-area-inset-top)); inset-inline-end: 10px; inline-size: 92px; max-inline-size: 92px; z-index: 40; border-radius: 50%; box-shadow: 0 4px 16px rgba(12, 31, 57, 0.35); border: 3px solid var(--white); cursor: pointer; }
.tutor-card[data-look="photo"].is-docked .tutor-full, .tutor-card[data-look="photo"].is-docked .tutor-text { display: none; }
.tutor-card[data-look="photo"] .tutor-frame { inline-size: 100%; max-inline-size: 420px; aspect-ratio: 1; justify-self: center; border-radius: 18px; }
.tutor-card[data-look="photo"] .tutor-stage { position: absolute; inset: 0; inline-size: 100%; opacity: 0; pointer-events: none; }
.tutor-full, .tutor-text { position: absolute; inset-block-start: 10px; z-index: 2; min-block-size: 40px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(12, 31, 57, 0.78); color: #fff; font: 600 0.875rem var(--font-ui); cursor: pointer; }
.tutor-full { inset-inline-end: 10px; }
.tutor-text { inset-inline-start: 10px; }
.tutor-full[hidden], .tutor-text[hidden], .tutor-capbox[hidden] { display: none; }
.tutor-capbox { display: grid; gap: 4px; }
.tutor-cap { margin: 0; font: 400 1.5rem/1.7 var(--font-ar); }
.tutor-cap-en { margin: 0; font-size: 0.9375rem; }
/* full screen: the card fills the window, the photo fills the card, the line sits over the lower part of the picture */
html.tutor-full-on, html.tutor-full-on body { overflow: hidden; }
.tutor-card.is-full { position: fixed; inset: 0; z-index: 60; margin: 0; padding: 0; border-radius: 0; background: #0c1f39; display: block; max-inline-size: none; }
.tutor-card.is-full .tutor-frame { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; max-inline-size: none; aspect-ratio: auto; border-radius: 0; }
.tutor-card.is-full .tutor-full { inset-inline-end: auto; inset-inline-start: 12px; inset-block-start: max(12px, env(safe-area-inset-top)); }
.tutor-card.is-full .tutor-text { inset-inline-start: auto; inset-inline-end: 12px; inset-block-start: max(12px, env(safe-area-inset-top)); }
.tutor-card.is-full .tutor-side { position: absolute; inset-inline: 12px; inset-block-end: max(16px, env(safe-area-inset-bottom)); z-index: 2; padding: 14px 16px; border-radius: 18px; background: rgba(12, 31, 57, 0.82); color: #fff; justify-items: stretch; }
.tutor-card.is-full .tutor-name, .tutor-card.is-full .tutor-name .ar, .tutor-card.is-full .tutor-ai, .tutor-card.is-full .tutor-note { color: #fff; }
.tutor-card.is-full .tutor-change, .tutor-card.is-full .tutor-look { display: none; }
.tutor-card.is-full.no-text .tutor-side > :not([data-act="hear-again"]) { display: none; }
.tutor-card.is-full.no-text .tutor-side { background: transparent; inline-size: max-content; }
.tutor-name { margin: 0; font: 600 1.0625rem var(--font-ui); color: var(--navy); }
.tutor-name .ar { font: 400 1.25rem var(--font-ar); color: var(--deep); }
.tutor-note { margin: 0; font-size: 0.8125rem; color: var(--slate); }
.tutor-change__label { margin: 0; font: 600 0.8125rem var(--font-ui); color: var(--deep); }
.tutor-change summary { cursor: pointer; font: 600 0.875rem var(--font-ui); color: var(--deep); min-block-size: 32px; display: flex; align-items: center; }
.tutor-pick { display: flex; flex-wrap: wrap; gap: 6px; padding-block-start: 6px; }
.chip-btn { min-block-size: 40px; padding: 0 var(--s2); border-radius: 999px; border: 2px solid var(--line); background: var(--white); color: var(--navy); font: 600 0.875rem var(--font-ui); cursor: pointer; }
.chip-btn.is-on { border-color: var(--navy); background: var(--mint); }
.play--sm { min-block-size: 36px; min-inline-size: 36px; font-size: 0.8125rem; justify-self: start; margin-block-start: 4px; }
.top-row { display: grid; gap: var(--s1); min-inline-size: 0; }
.top-row--tutor { grid-template-columns: auto minmax(0, 1fr); gap: var(--s2); align-items: center; }
.top-text { display: grid; gap: var(--s1); min-inline-size: 0; }
.lesson-tutor { inline-size: 76px; border-radius: 12px; overflow: hidden; background: var(--mint); }
.lesson-look { display: grid; gap: 4px; justify-items: stretch; }
.lesson-look__frame { position: relative; inline-size: 76px; border-radius: 12px; overflow: hidden; background: var(--mint); justify-self: start; }
.lesson-look__frame .lesson-tutor { inline-size: 100%; border-radius: 0; }
.lesson-look[data-look="photo"] .lesson-look__frame { inline-size: 120px; aspect-ratio: 1; }
.lesson-look[data-look="photo"] .lesson-look__drawn { position: absolute; inset: 0; inline-size: 100%; opacity: 0; pointer-events: none; }
.lesson-look__frame .tutor-photo { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; object-fit: cover; display: block; background: var(--cream); }
.lesson-look__frame .tutor-photo[hidden], .lesson-look__frame .tutor-video[hidden] { display: none; }
.lesson-look__frame .tutor-video { z-index: 1; background: transparent; }
.lesson-look[data-video="playing"] canvas.tutor-mouth { visibility: hidden; }
.lesson-look__chip, .lesson-look__full { min-block-size: 30px; padding: 0 8px; font-size: 0.75rem; }
.lesson-look__pick { display: flex; flex-wrap: wrap; gap: 4px; }
.lesson-look__pick[hidden] { display: none; }
.lesson-look__who { min-block-size: 30px; padding: 0 8px; font-size: 0.75rem; }
.lesson-look.is-full .lesson-look__pick { display: none; }
.lesson-look__tag { margin: 0; font-size: 0.6875rem; line-height: 1.3; color: var(--slate); max-inline-size: 120px; }
.lesson-look.is-full { position: fixed; inset: 0; z-index: 60; background: #0c1f39; display: grid; grid-template-rows: 1fr auto auto; place-items: center; align-content: center; padding: max(12px, env(safe-area-inset-top)) 12px max(16px, env(safe-area-inset-bottom)); gap: 12px; }
.lesson-look.is-full .lesson-look__frame { inline-size: min(100%, 70svh, 520px); aspect-ratio: 1; border-radius: 18px; justify-self: center; }
.lesson-look.is-full .lesson-look__full { position: absolute; inset-block-start: max(12px, env(safe-area-inset-top)); inset-inline-start: 12px; min-block-size: 40px; font-size: 0.875rem; }
.lesson-look.is-full .lesson-look__chip { display: none; }
.lesson-look__again[hidden] { display: none; }
.lesson-look.is-full .lesson-look__again { inline-size: min(100%, 320px); min-block-size: 56px; }
.lesson-look.is-full .lesson-look__tag { color: #fff; max-inline-size: none; font-size: 0.8125rem; }
/* tap to speak (speech module from Bridge English in app/vendor/speech) */
.mic { display: grid; gap: var(--s1); justify-items: center; padding-block: var(--s1); }
.mic-btn { min-block-size: 64px; min-inline-size: 12rem; padding-inline: var(--s3); border-radius: 999px; border: 0; background: var(--navy); color: var(--white); font: 600 1.0625rem var(--font-ui); cursor: pointer; }
.mic-btn[data-mic="listening"] { background: var(--bad, #B3261E); }
.mic-btn:disabled { opacity: .7; cursor: default; }
.mic-wave { display: flex; align-items: center; justify-content: center; gap: 3px; block-size: 44px; inline-size: 100%; max-inline-size: 18rem; }
.mic-bar { inline-size: 5px; block-size: 100%; border-radius: 3px; background: var(--line); transform: scaleY(0.08); transform-origin: center; transition: transform .08s linear; }
.mic[data-state="listening"] .mic-bar { background: var(--orange); }
.mic-btn[data-mic="opening"] { background: var(--deep); }
.mic[data-state="opening"] .mic-bar { background: var(--deep); animation: mic-pulse 0.7s ease-in-out infinite; }
.mic[data-state="opening"] .mic-bar:nth-child(3n) { animation-delay: .12s; }
.mic[data-state="opening"] .mic-bar:nth-child(3n+1) { animation-delay: .24s; }
/* the learner's newest answer: brought into view and marked for a moment */
.bubble--you.is-new { scroll-margin-block: 96px; animation: you-new 1.4s ease-out 1; }
@keyframes you-new { 0% { box-shadow: 0 0 0 3px var(--orange); } 100% { box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { .bubble--you.is-new { animation: none; } .mic[data-state="opening"] .mic-bar { animation: none; transform: scaleY(0.3); } }
.mic[data-state="checking"] .mic-bar { background: var(--deep); animation: mic-pulse 0.9s ease-in-out infinite; }
.mic[data-state="checking"] .mic-bar:nth-child(3n) { animation-delay: .15s; }
.mic[data-state="checking"] .mic-bar:nth-child(3n+1) { animation-delay: .3s; }
@keyframes mic-pulse { 0%, 100% { transform: scaleY(0.15); } 50% { transform: scaleY(0.7); } }
@media (prefers-reduced-motion: reduce) { .mic[data-state="checking"] .mic-bar { animation: none; transform: scaleY(0.4); } }
.mic-status { margin: 0; min-block-size: 1.5em; text-align: center; font-size: 0.9375rem; color: var(--deep); }

/* home: units */
.unit { background: var(--white); border: 1px solid var(--line); border-radius: 16px; margin-block: var(--s3); }
.unit__head { display: grid; gap: 6px; padding: var(--s3); cursor: pointer; list-style: none; }
.unit__head::-webkit-details-marker { display: none; }
.unit__name { font-weight: 600; font-size: 1.05rem; color: var(--navy); }
.unit__name::after { content: " +"; color: var(--slate); font-weight: 400; }
.unit[open] > .unit__head .unit__name::after { content: ""; }
.unit__count { color: var(--slate); font-size: .9rem; }
.unit > .lessons, .unit > .h3 { margin-inline: var(--s3); }
.unit > .lessons { margin-block-end: var(--s3); }
.h3 { font-size: .95rem; color: var(--slate); margin-block: var(--s3) var(--s2); font-weight: 600; }

/* check result: missed items */
.missed { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s2); }
.missed li { display: grid; gap: 2px; padding: var(--s2) 0; border-block-start: 1px solid var(--line); }
.missed__link { color: var(--navy); font-weight: 600; text-decoration: underline; min-block-size: var(--touch); display: inline-flex; align-items: center; }

/* home: review card */
.review-card { display: flex; align-items: center; gap: var(--s2); padding: var(--s3); margin-block: var(--s3); background: var(--mint); color: var(--navy); border-radius: 16px; text-decoration: none; font-weight: 600; min-block-size: var(--touch); }
.review-card__n { font-size: 1.6rem; font-weight: 700; min-inline-size: 2ch; text-align: center; }

.words-link { display: block; padding: var(--s3); margin-block: var(--s3); background: var(--white); color: var(--navy); border: 1px solid var(--line); border-radius: 16px; text-decoration: none; font-weight: 600; min-block-size: var(--touch); }
.unit > .words { margin-inline: var(--s3); margin-block-end: var(--s3); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); margin-block: var(--s3); }
.stat { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: var(--s3); display: grid; gap: 2px; }
.stat__n { font-size: 1.35rem; font-weight: 700; color: var(--navy); }
.stat__l { color: var(--slate); font-size: .9rem; }
.cando { margin: 0 var(--s3) var(--s3); padding-inline-start: 1.2em; display: grid; gap: 6px; }
.cando-none { margin: 0 var(--s3) var(--s3); color: var(--slate); }
.reset { margin-block: var(--s4, 24px) var(--s3); }
.reset__confirm { background: var(--white); border: 1px solid var(--line); border-radius: 16px; padding: var(--s3); margin-block-start: var(--s2); }
.review-card--later { background: var(--white); border: 1px solid var(--line); font-weight: 400; }
@media print {
  .topbar, .no-print, .play, .audio-state, .nav, .honest, .tr { display: none !important; }
  body { background: #fff; color: #000; }
  .unit { border: 0; margin: 0 0 12pt; break-inside: auto; }
  .unit__head { padding: 0 0 4pt; border-block-end: 1pt solid #000; }
  .unit__name::after { content: ""; }
  .unit > .words { margin: 0; columns: 2; column-gap: 18pt; }
  .item { break-inside: avoid; padding-block: 3pt; border-block-end: 0.5pt solid #bbb; }
  .item .ar { font-size: 15pt; }
}
.help-card { margin-block: var(--s3); }

/* streak card, daily goal and the toast (motivation, app.js) */
.streak { display: grid; gap: var(--s1); margin-block: var(--s3); padding: var(--s3); }
.streak__top { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s2); flex-wrap: wrap; }
.streak__n { margin: 0; font: 600 1.0625rem var(--font-ui); color: var(--navy); }
.streak__num { font-size: 2rem; line-height: 1; color: var(--orange); }
.streak__best, .streak__tot { margin: 0; font-size: 0.8125rem; color: var(--slate); }
.streak__days { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.streak__day { display: grid; justify-items: center; gap: 2px; font-size: 0.6875rem; color: var(--slate); }
.streak__dot { inline-size: 28px; block-size: 28px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; font-size: 0.875rem; color: var(--navy); background: var(--white); }
.streak__day.is-done .streak__dot { background: var(--orange); border-color: var(--orange); }
.streak__day.is-today .streak__dot { border-color: var(--navy); }
.streak__goal { margin: 0; font-size: 0.875rem; color: var(--deep); }
.streak .bar { block-size: 10px; border-radius: 999px; background: var(--line); overflow: hidden; }
.streak .bar__fill { display: block; block-size: 100%; background: var(--orange); border-radius: 999px; transition: inline-size .4s ease; }
.streak[data-today="done"] .bar__fill { background: var(--navy); }
.toast { position: fixed; inset-inline: 16px; inset-block-end: max(16px, env(safe-area-inset-bottom)); z-index: 70; margin: 0 auto; max-inline-size: 420px; padding: 14px 16px; border-radius: 14px; background: var(--navy); color: #fff; font: 600 0.9375rem var(--font-ui); text-align: center; box-shadow: 0 6px 24px rgba(12, 31, 57, 0.25); }
.toast[hidden] { display: none; }

.settings { display: grid; gap: 4px; }
.setting label { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; min-block-size: 44px; cursor: pointer; }
.setting input[type=checkbox] { inline-size: 24px; block-size: 24px; flex: none; margin-block-start: 2px; accent-color: var(--deep); }
.setting__t { display: grid; gap: 2px; }
.setting__d { color: var(--slate); font-size: 0.875rem; }
.talk-skip { margin-block-start: 8px; }

.fb { margin-block-start: 8px; padding: 10px 12px; border-radius: 10px; background: var(--cream); border: 1px solid var(--line, #e6d9cf); display: grid; gap: 6px; font-size: 0.9375rem; }
.fb p { margin: 0; }
.fb-row { display: grid; grid-template-columns: 52px 1fr; gap: 8px; align-items: baseline; }
.fb-lab { font-weight: 600; color: var(--slate); font-size: 0.8125rem; }
.fb-line { font-size: 1.25rem; line-height: 1.9; direction: rtl; text-align: start; unicode-bidi: isolate; }   /* Arabic word order: first word on the right (2026-11-18, Michael) */
.fb-line .ar { font-size: 1.35rem; }
.fb mark.fb-bad, .fb mark.fb-extra { background: #f6d6cf; color: #8a2a1c; border-radius: 4px; padding: 0 4px; }
.fb mark.fb-extra { text-decoration: line-through; }
.fb mark.fb-letter { background: #f8a43033; color: #8a2a1c; border-radius: 3px; padding: 0 1px; font-weight: 700; border-block-end: 2px solid #c0392b; }
.fb-gap { color: var(--slate); font-size: 0.875rem; }
.fb-notes { margin: 0; padding-inline-start: 18px; display: grid; gap: 6px; color: var(--deep); }
.fb-fine { color: var(--slate); font-size: 0.75rem; }

.tutor-pick { flex-wrap: nowrap; overflow-x: auto; padding-block-end: 4px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.tutor-pick::-webkit-scrollbar { display: none; }
.tutor-pick .chip-btn { flex: none; min-block-size: 36px; padding: 0 12px; }
.fb mark.fb-bad.ar { white-space: nowrap; }
.tutor-side, .tutor-change, .tutor-pick { min-inline-size: 0; max-inline-size: 100%; }
.tutor-card { min-inline-size: 0; }
.lesson-look, .top-row--tutor > * { min-inline-size: 0; }
.lesson-look__sel { inline-size: 100%; max-inline-size: 132px; min-block-size: 34px; font: 600 0.8125rem var(--font-ui); color: var(--deep); background: var(--cream); border: 1px solid var(--line, #e6d9cf); border-radius: 10px; padding: 0 6px; }

/* ===== Design 2 (2026-11-17): a quieter, higher-end look. Ivory paper, deep ink, one muted gold, serif headings, hairlines and soft shadow. ===== */
.topbar { background: rgba(250,246,239,.88); -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px); color: var(--navy); border-block-end: 1px solid var(--line); min-block-size: 56px; }
.brand { color: var(--navy); font: 600 1.25rem/1 var(--font-display); letter-spacing: .01em; gap: .5em; }
.brand b { color: var(--gold-deep); font: 400 .8125rem var(--font-ui); letter-spacing: .14em; text-transform: uppercase; }
.brand::before { content: ""; inline-size: 10px; block-size: 10px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 0 4px rgba(200,150,62,.18); }
.pill { border-color: rgba(11,27,51,.25); color: var(--navy); }
.pill[aria-pressed="true"] { background: var(--navy); border-color: var(--navy); color: var(--white); }
.title-en, .title-en--h1 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.01em; }
.h2, h2.h2 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.005em; }
.eyebrow { letter-spacing: .06em; font-size: .75rem; font-weight: 600; color: var(--gold-deep); }
.card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-1); }
.btn { border-radius: 999px; font-weight: 600; letter-spacing: .01em; }
.btn--primary { background: var(--navy); color: var(--white); border-color: var(--navy); box-shadow: 0 6px 18px rgba(11,27,51,.22); }
.btn--primary:hover { background: var(--deep); }
.honest { background: transparent; color: var(--slate); border: 0; padding: 0; font-size: .75rem; }
.lesson-link, .review-card, .words-link, .unit { border-radius: var(--radius); border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow-1); }
.progress { block-size: 4px; } .progress__fill { background: linear-gradient(90deg, var(--gold), #E3B766); }
.foot { color: var(--slate); font-size: .6875rem; text-align: center; padding: 0 16px 32px; }

/* ===== the first screen ===== */
.page.is-wide { max-inline-size: 66rem; }
.hero { display: grid; gap: 14px; padding: 30px 4px 6px; }
.hero__ar { font-family: var(--font-ar-display); font-size: clamp(2.6rem, 11vw, 4.6rem); line-height: 1.5; color: var(--navy); margin: 0; direction: rtl; }
.hero__h { font: 600 clamp(1.7rem, 6.4vw, 2.7rem)/1.12 var(--font-display); letter-spacing: -.02em; margin: 0; max-inline-size: 18ch; }
.hero__h em { font-style: italic; color: var(--gold-deep); }
.hero__p { margin: 0; color: var(--ink-soft); font-size: 1.0625rem; max-inline-size: 36ch; }
.today { display: grid; gap: 14px; padding: 22px; border-radius: 26px; color: var(--white); background: radial-gradient(520px 260px at 100% 0%, rgba(200,150,62,.35), rgba(200,150,62,0) 60%), linear-gradient(160deg, #10284a, #0b1b33 70%); box-shadow: var(--shadow-2); border: 0; }
.today .eyebrow { color: #E3B766; }
.today__t { font: 600 1.5rem/1.2 var(--font-display); margin: 0; letter-spacing: -.01em; }
.today__s { margin: 0; color: rgba(255,255,255,.78); font-size: .9375rem; }
.today__row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.today .btn { background: var(--gold); color: var(--navy); border-color: var(--gold); box-shadow: 0 8px 22px rgba(200,150,62,.35); }
.today .btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.35); box-shadow: none; }
.today .progress { background: rgba(255,255,255,.18); }
.sect { display: grid; gap: 14px; margin-block-start: 10px; }
.sect__h { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.sect__h h2 { font: 600 1.375rem/1.2 var(--font-display); margin: 0; letter-spacing: -.01em; }
.sect__h p { margin: 0; color: var(--slate); font-size: .8125rem; }
.courses { display: grid; gap: 14px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .courses { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .courses { grid-template-columns: repeat(3, 1fr); } }
.course { position: relative; display: grid; align-content: space-between; gap: 22px; min-block-size: 188px; padding: 20px; border-radius: 24px; text-decoration: none; color: var(--navy); border: 1px solid var(--line); background: var(--white); box-shadow: var(--shadow-1); overflow: hidden; transition: transform .25s cubic-bezier(.2,.7,.2,1), box-shadow .25s; }
.course:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.course__ar { font-family: var(--font-ar-display); font-size: 2.6rem; line-height: 1.4; margin: 0; direction: rtl; text-align: start; }
.course__n { font: 600 1.25rem/1.2 var(--font-display); margin: 0; letter-spacing: -.01em; }
.course__t { margin: 4px 0 0; font-size: .875rem; color: inherit; opacity: .78; }
.course__tag { display: inline-flex; align-items: center; gap: 6px; font: 600 .6875rem var(--font-ui); letter-spacing: .1em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; background: rgba(11,27,51,.07); inline-size: fit-content; }
.course[data-theme="navy"] { background: linear-gradient(160deg, #10284a, #0b1b33); color: var(--white); border-color: transparent; }
.course[data-theme="navy"] .course__tag { background: rgba(255,255,255,.14); }
.course[data-theme="cream"] { background: var(--ivory-2); }
.course[data-theme="mint"] { background: var(--mint); }
.course[data-theme="deep"] { background: linear-gradient(160deg, #2a4766, #1f3550); color: var(--white); border-color: transparent; }
.course[data-theme="deep"] .course__tag { background: rgba(255,255,255,.14); }
.course[data-theme="orange"] { background: linear-gradient(160deg, #e0b25e, #c8963e); border-color: transparent; }
.course--open { outline: 2px solid var(--gold); outline-offset: 2px; }
.course--soon { cursor: default; box-shadow: none; }
.course--soon:hover { transform: none; box-shadow: none; }
.course--soon .course__ar, .course--soon .course__n, .course--soon .course__t { opacity: .72; }
.homelinks { display: flex; flex-wrap: wrap; gap: 8px 18px; padding: 8px 2px 24px; }
.homelinks a { color: var(--deep); font-size: .875rem; text-decoration: none; border-block-end: 1px solid var(--line); padding-block: 6px; min-block-size: 32px; }
.homelinks a:hover { border-color: var(--gold); }
.backlink { display: inline-flex; align-items: center; gap: 6px; color: var(--deep); font-size: .875rem; text-decoration: none; min-block-size: 44px; }
.pv { display: grid; gap: 10px; }
.pv a, .pv button { text-decoration: none; text-align: start; }
.pv__row { display: grid; gap: 4px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); background: var(--white); color: var(--navy); font: inherit; cursor: pointer; box-shadow: var(--shadow-1); }
.pv__row b { font: 600 1rem var(--font-display); } .pv__row span { color: var(--slate); font-size: .8125rem; }
@media (prefers-reduced-motion: reduce) { .course { transition: none; } }

.screen:focus, .screen:focus-visible { outline: none; }
.btn, a.btn { text-decoration: none; }
.courses--open { grid-template-columns: 1fr; }
.courses--open .course { min-block-size: 220px; }
.courses--open .course__ar { font-size: 3.4rem; }
.courses--open .course__n { font-size: 1.625rem; }
.courses--soon { grid-template-columns: repeat(2, 1fr); gap: 10px; }
.courses--soon .course { min-block-size: 132px; padding: 14px; gap: 10px; border-radius: 20px; }
.courses--soon .course__ar { font-size: 1.9rem; }
.courses--soon .course__n { font-size: 1rem; }
.courses--soon .course__t { font-size: .75rem; line-height: 1.35; }
.courses--soon .course__t + .course__t { display: none; }
.courses--soon .course__tag { display: none; }
.sect__h--sub { margin-block-start: 8px; }
@media (min-width: 640px) { .courses--soon { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 900px) {
  .courses--soon { grid-template-columns: repeat(4, 1fr); }
  .courses--open .course { grid-template-columns: 1fr auto; grid-template-rows: 1fr auto; align-items: end; min-block-size: 200px; padding: 28px 36px; }
  .courses--open .course__ar { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-size: 5.5rem; }
  .courses--open .course > div { grid-column: 1; grid-row: 1; align-self: start; }
  .courses--open .course__tag { grid-column: 1; grid-row: 2; }
  .hero { grid-template-columns: 1.15fr 1fr; align-items: center; column-gap: 32px; padding-block: 48px 18px; }
  .hero__ar { grid-column: 2; grid-row: 1 / span 5; text-align: center; font-size: 6rem; }
  .hero > :not(.hero__ar) { grid-column: 1; }
}

/* ===== Design 3 (2026-11-17): depth, motion and faded imagery ===== */
:root {
  --shadow-1: 0 1px 0 rgba(255,255,255,.9) inset, 0 1px 2px rgba(11,27,51,.06), 0 6px 16px -4px rgba(11,27,51,.10), 0 18px 36px -14px rgba(11,27,51,.14);
  --shadow-2: 0 1px 0 rgba(255,255,255,.14) inset, 0 2px 4px rgba(11,27,51,.10), 0 14px 30px -6px rgba(11,27,51,.28), 0 34px 70px -20px rgba(11,27,51,.38);
  --ease: cubic-bezier(.2,.7,.2,1);
}
.bg-art { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.bg-art__pattern { position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96' fill='none' stroke='%230B1B33' stroke-width='1' stroke-opacity='0.9'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate%2845 48 48%29'/%3E%3Ccircle cx='48' cy='48' r='13'/%3E%3Cpath d='M0 48h24M72 48h24M48 0v24M48 72v24' stroke-opacity='.6'/%3E%3Ccircle cx='0' cy='0' r='5'/%3E%3Ccircle cx='96' cy='0' r='5'/%3E%3Ccircle cx='0' cy='96' r='5'/%3E%3Ccircle cx='96' cy='96' r='5'/%3E%3C/svg%3E"); background-size: 96px 96px; opacity: .05; -webkit-mask-image: radial-gradient(900px 560px at 50% 0%, #000 0%, transparent 72%); mask-image: radial-gradient(900px 560px at 50% 0%, #000 0%, transparent 72%); }
.bg-art__glow { position: absolute; border-radius: 50%; }
.bg-art__glow--a { inset-block-start: -260px; inset-inline-end: -180px; inline-size: 620px; block-size: 620px; background: radial-gradient(closest-side, rgba(200,150,62,.22), rgba(200,150,62,0)); animation: drift-a 26s ease-in-out infinite alternate; }
.bg-art__glow--b { inset-block-end: -280px; inset-inline-start: -220px; inline-size: 680px; block-size: 680px; background: radial-gradient(closest-side, rgba(47,111,106,.16), rgba(47,111,106,0)); animation: drift-b 32s ease-in-out infinite alternate; }
.bg-art__g { position: absolute; font-family: var(--font-ar-display); color: var(--navy); opacity: .045; line-height: 1; user-select: none; }
.bg-art__g--1 { font-size: 30rem; inset-block-start: 3rem; inset-inline-end: -6rem; transform: rotate(-8deg); animation: drift-a 40s ease-in-out infinite alternate; }
.bg-art__g--2 { font-size: 22rem; inset-block-end: 4rem; inset-inline-start: -5rem; transform: rotate(10deg); animation: drift-b 46s ease-in-out infinite alternate; }
.bg-art__g--3 { font-size: 16rem; inset-block-start: 46%; inset-inline-end: 8%; transform: rotate(4deg); opacity: .03; animation: drift-a 52s ease-in-out infinite alternate; }
body:not([data-route="home"]) .bg-art__g--1 { font-size: 20rem; opacity: .03; } body:not([data-route="home"]) .bg-art__g--2, body:not([data-route="home"]) .bg-art__g--3 { opacity: .02; }
@keyframes drift-a { from { translate: 0 0; } to { translate: -28px 34px; } }
@keyframes drift-b { from { translate: 0 0; } to { translate: 30px -26px; } }
.topbar { box-shadow: 0 1px 0 rgba(255,255,255,.7) inset, 0 8px 24px -14px rgba(11,27,51,.25); }
@keyframes view-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
.rv { opacity: 0; transform: translateY(18px) scale(.985); transition: opacity .7s var(--ease), transform .7s var(--ease); transition-delay: calc(var(--i, 0) * 55ms); }
.rv.in { opacity: 1; transform: none; }
.hero__ar { background: linear-gradient(135deg, #0b1b33 35%, #9a6f25 100%); -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: float-y 8s ease-in-out infinite alternate; filter: drop-shadow(0 14px 22px rgba(11,27,51,.18)); }
@keyframes float-y { from { translate: 0 -4px; } to { translate: 0 8px; } }
.hero__h { text-shadow: 0 1px 0 rgba(255,255,255,.8); }
.btn { transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s; position: relative; overflow: hidden; }
.btn:hover { transform: translateY(-2px); } .btn:active { transform: translateY(0) scale(.98); }
.btn--primary::after, .today .btn::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.35) 50%, transparent 65%); transform: translateX(-120%); transition: transform .8s var(--ease); }
.btn--primary:hover::after, .today .btn:hover::after { transform: translateX(120%); }
.today { position: relative; overflow: hidden; }
.today::before { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96' fill='none' stroke='%230B1B33' stroke-width='1' stroke-opacity='0.9'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate%2845 48 48%29'/%3E%3Ccircle cx='48' cy='48' r='13'/%3E%3Cpath d='M0 48h24M72 48h24M48 0v24M48 72v24' stroke-opacity='.6'/%3E%3Ccircle cx='0' cy='0' r='5'/%3E%3Ccircle cx='96' cy='0' r='5'/%3E%3Ccircle cx='0' cy='96' r='5'/%3E%3Ccircle cx='96' cy='96' r='5'/%3E%3C/svg%3E"); background-size: 96px 96px; filter: invert(1); opacity: .06; -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000 100%); mask-image: linear-gradient(120deg, transparent 30%, #000 100%); pointer-events: none; }
.today::after { content: ""; position: absolute; inset: -40% -20%; background: linear-gradient(100deg, transparent 42%, rgba(255,255,255,.10) 50%, transparent 58%); animation: sheen 7s ease-in-out infinite; pointer-events: none; }
@keyframes sheen { 0%, 55% { transform: translateX(-60%); } 100% { transform: translateX(60%); } }
.today > * { position: relative; z-index: 1; }
.course { isolation: isolate; box-shadow: var(--shadow-1); }
.course::before { content: ""; position: absolute; inset: 0; z-index: -1; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96' fill='none' stroke='%230B1B33' stroke-width='1' stroke-opacity='0.9'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate%2845 48 48%29'/%3E%3Ccircle cx='48' cy='48' r='13'/%3E%3Cpath d='M0 48h24M72 48h24M48 0v24M48 72v24' stroke-opacity='.6'/%3E%3Ccircle cx='0' cy='0' r='5'/%3E%3Ccircle cx='96' cy='0' r='5'/%3E%3Ccircle cx='0' cy='96' r='5'/%3E%3Ccircle cx='96' cy='96' r='5'/%3E%3C/svg%3E"); background-size: 96px 96px; opacity: .06; -webkit-mask-image: linear-gradient(135deg, transparent 20%, #000 100%); mask-image: linear-gradient(135deg, transparent 20%, #000 100%); }
.course[data-theme="navy"]::before, .course[data-theme="deep"]::before { filter: invert(1); opacity: .08; }
.course::after { content: ""; position: absolute; inset: 0; z-index: -1; background: radial-gradient(260px circle at var(--mx, 70%) var(--my, 0%), rgba(255,255,255,.35), transparent 60%); opacity: 0; transition: opacity .3s; }
.course:hover::after { opacity: 1; }
.course--open { box-shadow: var(--shadow-2); outline: 0; border: 1px solid rgba(200,150,62,.6); }
.course--open::before { opacity: .12; }
.course:not(.course--soon):hover { transform: translateY(-5px); box-shadow: var(--shadow-2); }
.course--soon:hover { transform: translateY(-2px); box-shadow: var(--shadow-1); }
.course__ar { text-shadow: 0 6px 18px rgba(11,27,51,.18); }
.card, .lesson-link, .review-card, .words-link, .unit { transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.lesson-link:hover, .review-card:hover, .words-link:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.sect__h h2 { position: relative; padding-inline-start: 14px; }
.sect__h h2::before { content: ""; position: absolute; inset-inline-start: 0; inset-block: .25em; inline-size: 3px; border-radius: 3px; background: linear-gradient(var(--gold), var(--gold-deep)); }
.streak { box-shadow: var(--shadow-1); }
@media (prefers-reduced-motion: reduce) { .bg-art__glow, .bg-art__g, .hero__ar, .today::after { animation: none !important; } .screen > * { animation: none !important; } .rv { opacity: 1; transform: none; transition: none; } .btn, .course { transition: none; } }
.hero__ar { background: linear-gradient(135deg, #0b1b33 40%, #2a4766 100%); -webkit-background-clip: text; background-clip: text; }
.screen > .streak { max-inline-size: 36rem; }
.sect__h--sub p { display: none; }
@media (min-width: 640px) { .sect__h--sub p { display: block; } }
.course--open { background: radial-gradient(420px 220px at 100% 0%, rgba(200,150,62,.30), rgba(200,150,62,0) 65%), linear-gradient(160deg, #10284a, #0b1b33 70%); }

/* ===== Design 4 (2026-11-17): the talk page as an exchange. The tutor picture stays at the top, the answer dock (tap to speak) stays at the bottom,
   and the conversation moves between them, so nobody scrolls to answer. One menu for tutor and look. ===== */
.tutor-card, .tutor-card[data-look="photo"] { display: block; position: sticky; inset-block-start: 0; z-index: 30; padding: 8px; background: rgba(255,255,255,.94); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-radius: 0 0 22px 22px; margin-inline: -4px; }
.tutor-card .tutor-frame, .tutor-card[data-look="photo"] .tutor-frame { position: relative; inline-size: min(100%, 34svh); max-inline-size: 420px; aspect-ratio: 1; margin-inline: auto; border-radius: 18px; overflow: hidden; background: var(--mint); }
.tutor-card .tutor-stage { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; border-radius: 0; opacity: 1; pointer-events: auto; }
.tutor-card[data-look="photo"] .tutor-stage { opacity: 0; pointer-events: none; }
.tutor-card .tutor-side { display: none; }
.tutor-card.is-full .tutor-side { display: grid; }
.tutor-card .tutor-full { inset-block-start: 8px; inset-inline-end: 8px; min-block-size: 36px; padding: 0 12px; font-size: .8125rem; }
.tm { position: absolute; inset-block-start: 8px; inset-inline-start: 8px; z-index: 4; }
.tm-btn { display: inline-flex; align-items: center; gap: 6px; min-block-size: 36px; padding: 0 12px; border: 0; border-radius: 999px; background: rgba(11,27,51,.78); color: #fff; font: 600 .8125rem var(--font-ui); cursor: pointer; -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.tm-chev { font-size: .7rem; opacity: .8; }
.tm-pop { position: absolute; inset-block-start: 42px; inset-inline-start: 0; min-inline-size: 230px; padding: 8px; border-radius: 16px; background: #fff; color: var(--navy); box-shadow: var(--shadow-2); border: 1px solid var(--line); display: grid; gap: 6px; }
.tm-pop[hidden] { display: none; }
.tm-row { display: grid; grid-template-columns: 1fr auto auto; gap: 6px; align-items: center; }
.tm-name { font: 600 .9375rem var(--font-display); padding-inline-start: 6px; }
.tm-item { min-block-size: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--cream); color: var(--navy); font: 600 .8125rem var(--font-ui); cursor: pointer; }
.tm-item.is-on { background: var(--navy); border-color: var(--navy); color: #fff; }
.tm-fine { margin: 2px 6px 0; font-size: .6875rem; color: var(--slate); }
.tutor-card .tutor-ai { position: absolute; inset-block-end: 8px; inset-inline-start: 8px; z-index: 2; padding: 3px 8px; border-radius: 999px; background: rgba(11,27,51,.55); color: #fff; font-size: .625rem; max-inline-size: 58%; line-height: 1.3; }
.tutor-card .tutor-note { position: absolute; inset-block-end: 40px; inset-inline: 8px; z-index: 2; text-align: center; color: #fff; text-shadow: 0 1px 3px rgba(0,0,0,.6); font-size: .75rem; }
.tutor-card .tutor-again { position: absolute; inset-block-end: 8px; inset-inline-end: 8px; z-index: 3; min-block-size: 36px; padding: 0 12px; border-radius: 999px; border: 0; background: rgba(255,255,255,.92); color: var(--navy); font: 600 .8125rem var(--font-ui); box-shadow: 0 4px 14px rgba(11,27,51,.25); }
.tutor-card.is-full .tm { display: none; }
.tutor-card.is-full .tutor-frame { inline-size: 100%; max-inline-size: none; aspect-ratio: auto; }
.tutor-card.is-full .tutor-stage { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; background: var(--mint); }
.tutor-card.is-full .tutor-again { inset-block-end: auto; inset-block-start: 60px; inset-inline-start: 12px; inset-inline-end: auto; min-block-size: 44px; }
.tutor-card.is-full .tutor-ai { inset-block-end: auto; inset-block-start: 14px; inset-inline-start: 50%; transform: translateX(-50%); }
.talk-panel { position: sticky; inset-block-end: 0; z-index: 25; margin-inline: -4px; border-radius: 22px 22px 0 0; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); max-block-size: 46svh; overflow-y: auto; background: rgba(255,255,255,.96); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); box-shadow: 0 -12px 32px -14px rgba(11,27,51,.32); border-color: var(--line); gap: 8px; }
.talk-panel > .label { display: none; }
.talk-panel > .prompt, .talk-panel > p.prompt { margin: 0; font-size: .875rem; color: var(--ink-soft); }
.talk-panel .banked-label { margin: 0; font-size: .625rem; color: var(--slate); background: transparent; padding: 0; border: 0; font-weight: 400; }
.talk-panel .mic-btn { min-block-size: 52px; }
.chat { padding-block-end: 6px; }
html.tutor-full-on .talk-panel { display: none; }

.tutor-card .tutor-frame, .tutor-card[data-look="photo"] .tutor-frame { inline-size: min(100%, 31svh); }
.talk-panel { max-block-size: 42svh; }
.talk-panel .options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.talk-panel .opt { padding: 8px 10px; min-block-size: 0; display: grid; gap: 0; text-align: center; border-radius: 14px; }
.talk-panel .opt .ar { font-size: 1.25rem; line-height: 1.6; text-align: center; }
.talk-panel .opt .opt-help { font-size: .75rem; }
.talk-panel .field { min-block-size: 44px; }
@media (max-height: 640px) { .tutor-card .tutor-frame, .tutor-card[data-look="photo"] .tutor-frame { inline-size: min(100%, 26svh); } }

.tutor-card .tutor-full { inline-size: 36px; padding: 0; font-size: 1.05rem; line-height: 1; display: inline-grid; place-items: center; }
.tutor-card.is-full .tutor-full { inline-size: auto; padding: 0 16px; font-size: .875rem; }
.tm-btn { font-size: .75rem; padding: 0 10px; }
.talk-panel .mic-wave { block-size: 14px; }

.lesson-look__row { display: flex; gap: 6px; align-items: center; }
.lesson-look__pick { display: block; }
.lesson-look .tm { position: static; }
.lesson-look .tm-btn { background: var(--navy); }
.lesson-look .tm-pop { inset-block-start: 40px; }
.lesson-look__full { inline-size: 34px; padding: 0; font-size: 1rem; display: inline-grid; place-items: center; }
.lesson-look.is-full .lesson-look__full { inline-size: auto; padding: 0 14px; }
.lesson-look.is-full .lesson-look__row { position: static; }
.lesson-look.is-full .lesson-look__pick { display: none; }
.top--lesson[data-stuck] .lesson-look__row { display: none; }
.tutor-card.is-full, .tutor-card.is-full[data-look="photo"] { position: fixed; inset: 0; margin: 0; padding: 0; border-radius: 0; background: #0c1f39; z-index: 60; display: block; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tutor-card.is-full .tutor-frame, .tutor-card.is-full[data-look="photo"] .tutor-frame { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; max-inline-size: none; aspect-ratio: auto; border-radius: 0; }
.lesson-look .tm { position: relative; z-index: 6; }
.lesson-look .tm-pop { inset-block-start: 42px; max-inline-size: calc(100vw - 36px); }
.lesson-look__tag { margin-block-start: 6px; }
.lesson-look__row { margin-block-start: 2px; }

.talk-type { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: center; }
.talk-type .btn { min-block-size: 44px; padding-inline: 18px; }
.talk-panel .rec { display: flex; justify-content: center; }
.talk-panel .rec .btn { min-block-size: 36px; font-size: .8125rem; border-color: transparent; color: var(--slate); }

/* ===== Design 5: layered cards ===== */
.bg-art { inset: -160px 0; transform: translate3d(0, var(--py, 0px), 0); will-change: transform; }
.chat .bubble { transition: opacity .5s var(--ease), transform .5s var(--ease), box-shadow .5s var(--ease); box-shadow: var(--shadow-1); }
.chat .bubble[data-age="1"] { opacity: .96; } .chat .bubble[data-age="2"] { opacity: .9; transform: scale(.992); } .chat .bubble[data-age="3"], .chat .bubble[data-age="4"] { opacity: .84; transform: scale(.985); box-shadow: 0 1px 2px rgba(11,27,51,.05); }
.chat .bubble:hover, .chat .bubble:focus-within { opacity: 1; transform: none; }
.tutor-card { box-shadow: 0 1px 0 rgba(255,255,255,.9) inset, 0 12px 30px -12px rgba(11,27,51,.28), 0 2px 6px rgba(11,27,51,.08); }
.talk-panel { box-shadow: 0 -16px 40px -16px rgba(11,27,51,.34), 0 -2px 8px rgba(11,27,51,.06); }
.opt { transition: transform .2s var(--ease), box-shadow .25s var(--ease), background .2s; }
.opt:active { transform: scale(.975); }
.opt:hover { box-shadow: var(--shadow-1); transform: translateY(-1px); }
.mic-btn { transition: transform .2s var(--ease), box-shadow .3s var(--ease), background .2s; box-shadow: 0 10px 24px -8px rgba(11,27,51,.5); }
.mic[data-state="listening"] .mic-btn { animation: mic-breathe 1.6s ease-in-out infinite; }
@keyframes mic-breathe { 0%, 100% { box-shadow: 0 10px 24px -8px rgba(11,27,51,.5), 0 0 0 0 rgba(200,150,62,.45); } 50% { box-shadow: 0 10px 24px -8px rgba(11,27,51,.5), 0 0 0 12px rgba(200,150,62,0); } }
@media (prefers-reduced-motion: reduce) { .mic[data-state="listening"] .mic-btn { animation: none; } .chat .bubble { transition: none; } }

.screen { position: relative; }
.hero-gl { position: absolute; inset-block-start: -56px; inset-inline: -16px; inline-size: calc(100% + 32px); block-size: 520px; z-index: -1; pointer-events: none; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
@media (min-width: 900px) { .hero-gl { block-size: 600px; } }
.hero-gl { inset-inline: 0; inline-size: 100%; }

/* ===== Design 6: the picture fills the top; the dock folds ===== */
.tutor-card, .tutor-card[data-look="photo"] { container-type: inline-size; padding: 0; margin-inline: calc(-1 * var(--s3)); border-radius: 0 0 24px 24px; overflow: hidden; }
.tutor-card .tutor-frame, .tutor-card[data-look="photo"] .tutor-frame { inline-size: 100%; max-inline-size: none; aspect-ratio: auto; block-size: min(70cqw, 36svh); border-radius: 0; margin: 0; background: var(--mint); }
.tutor-card .tutor-zoom { position: absolute; inline-size: 112%; aspect-ratio: 1; inset-inline-start: -6%; inset-block-start: -13.7cqw; }
.tutor-card[data-look="drawn"] .tutor-zoom { inline-size: 100%; inset-inline-start: 0; inset-block-start: -5cqw; }
.tutor-card .tutor-zoom .tutor-stage { inset: 0; }
.tutor-card.is-full .tutor-zoom, .tutor-card.is-full[data-look="drawn"] .tutor-zoom { inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; }
.tutor-card.is-full { container-type: normal; overflow: visible; }
.dock-handle { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; justify-items: center; inline-size: 100%; min-block-size: 30px; padding: 0; border: 0; background: none; color: var(--slate); font: 600 .6875rem var(--font-ui); cursor: pointer; margin-block: -4px 2px; position: relative; }
.dock-handle__bar { position: absolute; inset-block-start: 4px; inset-inline-start: 50%; translate: -50% 0; inline-size: 38px; block-size: 4px; border-radius: 4px; background: var(--line); }
.dock-handle__t { grid-column: 2; padding-block-start: 9px; }
.dock-handle__c { grid-column: 3; justify-self: end; padding-block-start: 6px; padding-inline-end: 6px; font-size: 1rem; transition: transform .35s var(--ease); }
.talk-panel.is-min .dock-handle__c { transform: rotate(180deg); }
.dock-fold { display: grid; grid-template-rows: 1fr; transition: grid-template-rows .38s var(--ease), opacity .3s; }
.dock-fold__in { min-block-size: 0; overflow: hidden; display: grid; gap: 8px; }
.talk-panel.is-min .dock-fold { grid-template-rows: 0fr; opacity: 0; }
.talk-panel.is-min .dock-fold__in { pointer-events: none; }
.talk-panel { gap: 6px; }
@media (prefers-reduced-motion: reduce) { .dock-fold, .dock-handle__c { transition: none; } }
.tutor-card .tutor-zoom { inline-size: 108%; inset-inline-start: -4%; inset-block-start: -11cqw; }
.tutor-card[data-look="drawn"] .tutor-zoom { inline-size: 100%; inset-inline-start: 0; inset-block-start: -5cqw; }
.tutor-card.is-full .tutor-zoom, .tutor-card.is-full[data-look="drawn"] .tutor-zoom { inset: 0; inline-size: 100%; block-size: 100%; aspect-ratio: auto; }
.talk-panel .mic-status:empty { display: none; }
/* hover must not move a button: a button that moves under a still pointer never counts as stable, and a phone keeps hover after a tap */
.btn:hover { transform: none; filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.lesson-link:hover, .review-card:hover, .words-link:hover, .opt:hover { transform: none; }
/* phone first: on the lesson and talk pages nothing in the background moves (battery and frame rate); the first screen keeps its slow drift */
body:not([data-route="home"]) .bg-art__glow, body:not([data-route="home"]) .bg-art__g { animation: none; }
body:not([data-route="home"]) .bg-art { will-change: auto; }

/* ===== Design 7: speaking first; a pencil in the corner swaps the microphone for one line to type ===== */
.dock-speak { position: relative; display: grid; place-items: center; }
.dock-swap { display: inline-grid; place-items: center; inline-size: 40px; block-size: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--cream); color: var(--deep); cursor: pointer; padding: 0; transition: background .2s, transform .2s var(--ease); }
.dock-swap:active { transform: scale(.94); }
.dock-swap--pen { position: absolute; inset-inline-end: 0; inset-block-end: 6px; }
.talk-panel[data-input="type"] .dock-speak { display: none; }
.talk-panel[data-input="speak"] .talk-type, .talk-panel[data-input="speak"] .feedback.bad { display: none; }
.talk-panel[data-input="type"] .talk-type { grid-template-columns: auto 1fr auto; }
.talk-panel .talk-type .field { min-block-size: 44px; }
.mic-btn::before { content: ""; display: inline-block; inline-size: 20px; block-size: 20px; margin-inline-end: 10px; vertical-align: -4px; background: currentColor; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5.5 11a6.5 6.5 0 0 0 13 0M12 17.5V21'/%3E%3C/svg%3E") center / contain no-repeat; }
.mic[data-state="checking"] .mic-btn::before, .mic[data-state="opening"] .mic-btn::before { opacity: .5; }

.dock-hint { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dock-hint .btn { min-block-size: 30px; padding: 0 10px; font-size: .75rem; color: var(--slate); border-color: transparent; background: transparent; white-space: nowrap; }

/* ===== Design 8: the full screen keeps the activity. The dock floats over the picture as glass; the tutor's line sits above it. ===== */
html.tutor-full-on .talk-panel { display: grid; position: fixed; inset-inline: 10px; inset-block-end: max(10px, env(safe-area-inset-bottom)); margin: 0; z-index: 70; max-block-size: 48svh; color: #fff; background: rgba(11,27,51,.5); -webkit-backdrop-filter: blur(18px) saturate(1.3); backdrop-filter: blur(18px) saturate(1.3); border: 1px solid rgba(255,255,255,.2); border-radius: 24px; box-shadow: 0 18px 50px -12px rgba(0,0,0,.55); }
html.tutor-full-on .talk-panel .prompt, html.tutor-full-on .talk-panel .dock-handle, html.tutor-full-on .talk-panel .banked-label, html.tutor-full-on .talk-panel .dock-hint .btn { color: rgba(255,255,255,.82); }
html.tutor-full-on .talk-panel .dock-handle__bar { background: rgba(255,255,255,.4); }
html.tutor-full-on .talk-panel .opt { background: rgba(255,255,255,.14); border-color: rgba(255,255,255,.28); color: #fff; box-shadow: none; }
html.tutor-full-on .talk-panel .opt .ar, html.tutor-full-on .talk-panel .opt .opt-help { color: #fff; }
html.tutor-full-on .talk-panel .mic-btn { background: #fff; color: var(--navy); box-shadow: 0 10px 28px -8px rgba(0,0,0,.5); }
html.tutor-full-on .talk-panel .mic-status, html.tutor-full-on .talk-panel .mic-bar { color: rgba(255,255,255,.85); }
html.tutor-full-on .talk-panel .field { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
html.tutor-full-on .talk-panel .dock-swap { background: rgba(255,255,255,.16); border-color: rgba(255,255,255,.3); color: #fff; }
html.tutor-full-on .talk-panel .talk-type .btn--primary { background: #fff; color: var(--navy); border-color: #fff; }
.tutor-card.is-full .tutor-side { inset-block-end: calc(var(--dock-h, 0px) + 22px + env(safe-area-inset-bottom)); background: rgba(11,27,51,.5); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); padding: 10px 14px; border: 1px solid rgba(255,255,255,.18); }
.tutor-card.is-full .tutor-side .tutor-name { display: none; }
.tutor-card.is-full .tutor-cap { font-size: 1.35rem; line-height: 1.6; }
.tutor-card.is-full .tutor-ai { inset-block-start: 62px; inset-inline-start: auto; inset-inline-end: 12px; transform: none; max-inline-size: 46%; text-align: end; }
.tutor-toast { position: absolute; inset-block-start: max(64px, calc(env(safe-area-inset-top) + 56px)); inset-inline: 12px; z-index: 75; margin-inline: auto; inline-size: fit-content; max-inline-size: calc(100% - 24px); padding: 10px 16px; border-radius: 999px; background: rgba(255,255,255,.94); color: var(--navy); font: 600 .9375rem var(--font-ui); box-shadow: 0 10px 30px -8px rgba(0,0,0,.5); text-align: center; }
.tutor-toast[data-verdict="clear"] { background: #e6f5ec; color: #1d6b43; }
.tutor-toast[data-verdict="not_yet"] { background: #fbe9e5; color: #9a3a2c; }

/* full screen: the picture takes what the dock leaves, so the mouth is never under the glass */
.tutor-card.is-full .tutor-frame, .tutor-card.is-full[data-look="photo"] .tutor-frame { inset: 0 0 auto 0; block-size: calc(100% - var(--dock-h, 0px) - 8px); transition: block-size .38s var(--ease); }
.tutor-card.is-full .tutor-zoom, .tutor-card.is-full[data-look="drawn"] .tutor-zoom { inset-inline-start: -4%; inline-size: 108%; block-size: auto; aspect-ratio: 1; inset-block-start: -4vw; }
.tutor-card.is-full[data-look="drawn"] .tutor-zoom { inset-inline-start: 0; inline-size: 100%; inset-block-start: 0; }
.tutor-toast { inset-block-start: 112px; }
.tutor-toast { inset-block-start: auto; inset-block-end: calc(var(--dock-h, 0px) + 150px); }

/* ===== Design 9: the course map. Stages fold into units, units fold into lessons; one stage open at a time ===== */
.cm-hero { display: grid; grid-template-columns: auto 1fr; gap: 16px; align-items: center; padding: 18px; border-radius: 24px; color: #fff; background: radial-gradient(420px 220px at 100% 0%, rgba(200,150,62,.34), rgba(200,150,62,0) 62%), linear-gradient(160deg, #10284a, #0b1b33 72%); box-shadow: var(--shadow-2); position: relative; overflow: hidden; }
.cm-hero::before { content: ""; position: absolute; inset: 0; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='96' height='96' viewBox='0 0 96 96' fill='none' stroke='white' stroke-width='1'%3E%3Crect x='24' y='24' width='48' height='48'/%3E%3Crect x='24' y='24' width='48' height='48' transform='rotate(45 48 48)'/%3E%3Ccircle cx='48' cy='48' r='13'/%3E%3C/svg%3E"); background-size: 96px; opacity: .06; -webkit-mask-image: linear-gradient(120deg, transparent 30%, #000); mask-image: linear-gradient(120deg, transparent 30%, #000); pointer-events: none; }
.cm-hero > * { position: relative; }
.cm-hero__ring { --p: 0; inline-size: 84px; block-size: 84px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--gold) calc(var(--p) * 1%), rgba(255,255,255,.16) 0); position: relative; }
.cm-hero__ring::before { content: ""; position: absolute; inset: 7px; border-radius: 50%; background: #0f2442; }
.cm-hero__pct { position: relative; font: 600 1.25rem var(--font-display); }
.cm-hero__t { display: grid; gap: 6px; justify-items: start; min-inline-size: 0; }
.cm-hero__n { margin: 0; font: 600 1.0625rem var(--font-display); }
.cm-hero__s { margin: 0; color: rgba(255,255,255,.78); font-size: .875rem; }
.cm-hero .btn { background: var(--gold); color: var(--navy); border-color: var(--gold); margin-block-start: 4px; }
.cm-tabs { display: grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: 999px; background: var(--ivory-2); border: 1px solid var(--line); position: sticky; inset-block-start: 8px; z-index: 12; box-shadow: var(--shadow-1); }
.cm-tab { min-block-size: 40px; border: 0; border-radius: 999px; background: transparent; color: var(--slate); font: 600 .875rem var(--font-ui); cursor: pointer; transition: background .25s var(--ease), color .25s, box-shadow .25s; }
.cm-tab.is-on { background: var(--navy); color: #fff; box-shadow: 0 6px 16px -6px rgba(11,27,51,.5); }
.cm-panel { display: grid; gap: 12px; }
.cm-panel[hidden] { display: none; }
details.stage { border: 1px solid var(--line); border-radius: 22px; background: var(--white); box-shadow: var(--shadow-1); overflow: hidden; }
details.stage[open] { box-shadow: var(--shadow-2); }
.stage__head { list-style: none; display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; align-items: center; padding: 14px 16px; cursor: pointer; min-block-size: 64px; }
.stage__head::-webkit-details-marker { display: none; }
.stage__head::after { content: "⌄"; position: absolute; }
.stage__head { position: relative; }
.stage__head::after { inset-inline-end: 18px; inset-block-start: 14px; font-size: 1.1rem; color: var(--slate); transition: transform .3s var(--ease); }
details.stage[open] > .stage__head::after { transform: rotate(180deg); }
.stage__head .progress { grid-column: 1 / -1; }
.stage__no { inline-size: 38px; block-size: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--navy); color: #fff; font: 600 1.05rem var(--font-display); }
.stage__t { display: grid; gap: 2px; min-inline-size: 0; padding-inline-end: 24px; }
.stage__name { font: 600 1.0625rem/1.25 var(--font-display); }
.stage__sub { font-size: .8125rem; color: var(--slate); }
.stage__body { display: grid; gap: 8px; padding: 0 12px 14px; animation: stage-in .35s var(--ease) backwards; }
@keyframes stage-in { from { opacity: 0; transform: translateY(-6px); } }
details.unit { border: 1px solid var(--line); border-radius: 16px; background: var(--cream); box-shadow: none; }
details.unit[open] { background: #fff; }
details.unit > summary.unit__head { list-style: none; display: grid; grid-template-columns: 1fr auto; gap: 4px 10px; padding: 12px 14px; cursor: pointer; align-items: center; min-block-size: 52px; }
details.unit > summary.unit__head::-webkit-details-marker { display: none; }
.unit__name { font: 600 .9375rem var(--font-ui); } .unit__count { font-size: .75rem; color: var(--slate); }
details.unit .progress { grid-column: 1 / -1; block-size: 3px; }
details.unit .lessons { display: grid; gap: 6px; padding: 4px 8px 12px; margin: 0; list-style: none; }
.lessons .lesson-link { display: grid; grid-template-columns: auto 1fr auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--line); background: #fff; box-shadow: none; text-decoration: none; color: var(--navy); min-block-size: 56px; }
.lessons .lesson-link:hover { background: var(--cream); }
.lesson-link__dot { inline-size: 18px; block-size: 18px; border-radius: 50%; border: 2px solid var(--line); background: #fff; }
.lesson-link[data-dot="done"] .lesson-link__dot { border-color: var(--ok); background: var(--ok) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 70% no-repeat; }
.lesson-link[data-dot="part"] .lesson-link__dot { border-color: var(--gold); background: conic-gradient(var(--gold) 50%, #fff 0); }
.lesson-link__t { display: grid; gap: 1px; min-inline-size: 0; }
.lesson-link__t .state { font-size: .6875rem; color: var(--slate); }
.lesson-link .ar--lg { font-size: 1.25rem; line-height: 1.6; }
.cm-class { margin: 0; font: 600 .875rem var(--font-ui); color: var(--gold-deep); }
.cm-list { margin: 8px 0; padding-inline-start: 18px; display: grid; gap: 4px; }

/* the class setup and the settings with a choice list */
.setting--sel, .setting--t { display: grid; gap: 8px; }
.setting__sel { min-block-size: 44px; border-radius: 12px; border: 1px solid var(--line); background: #fff; color: var(--navy); font: 500 .9375rem var(--font-ui); padding: 0 10px; inline-size: 100%; }
.setting__lock { display: flex; gap: 8px; align-items: center; font-size: .8125rem; color: var(--slate); min-block-size: 32px; }
.teacher { display: grid; gap: 4px; }
.teacher__presets { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 4px 10px; }
.teacher__link { font-size: .8125rem; }
.teacher__share .rec { display: flex; flex-wrap: wrap; gap: 8px; }
.update-bar { position: fixed; inset-inline: 12px; inset-block-end: max(12px, env(safe-area-inset-bottom)); z-index: 90; min-block-size: 48px; border: 0; border-radius: 999px; background: var(--navy); color: #fff; font: 600 .9375rem var(--font-ui); box-shadow: var(--shadow-2); cursor: pointer; }

.lessons li.is-more { display: none; } .lessons.is-all li.is-more { display: list-item; }
.cm-more-row { list-style: none; } .cm-more { inline-size: 100%; min-block-size: 40px; font-size: .8125rem; }

/* Design 10 (2026-11-18, Michael): the fixed-list notice under Tap to speak is gone, so the dock gets that room back: a larger mic button and more air around it. */
.talk-panel { padding: 12px 14px calc(14px + env(safe-area-inset-bottom)); gap: 10px; }
.talk-panel .mic-btn { min-block-size: 60px; font-size: 1.125rem; }

/* Design 11 (2026-11-18, Michael): no repeated notices. The AI tutor tag, the fine print in the tutor menu and the how-to line over the replies are not shown; one short induction for the student will explain them once. */
.tutor-ai, .tutor-card .tutor-ai, .tm-fine, .dock-hint > .prompt { display: none !important; }

/* Design 12 (2026-11-18, Michael: the drawn tutor sits too low in the picture): raise the drawn face so the eyes are near the middle of the card. Not in full screen. */
.tutor-card[data-look="drawn"]:not(.is-full) .tutor-zoom { inset-block-start: -12cqw; }

/* speaking ladder (2026-11-19): six steps as a 3 by 2 grid, the chosen step opens its talks below */
.ladder { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.ladder__step { display: grid; justify-items: center; gap: 2px; padding: 10px 4px; min-block-size: 68px; border-radius: 16px; border: 1px solid var(--line); background: var(--ivory-2); color: var(--slate); font: 600 .8125rem var(--font-ui); cursor: pointer; transition: background .25s var(--ease), color .25s, box-shadow .25s; }
.ladder__step.is-on { background: var(--navy); color: #fff; border-color: var(--navy); box-shadow: 0 6px 16px -6px rgba(11,27,51,.5); }
.ladder__step.is-soon:not(.is-on) { opacity: .6; }
.ladder__n { font: 600 1.0625rem var(--font-display); color: var(--gold-deep); }
.ladder__step.is-on .ladder__n { color: var(--gold); }
.ladder__c { font-weight: 400; font-size: .75rem; opacity: .8; }
.ladder-body { display: grid; gap: 10px; } .ladder-page { display: grid; gap: 10px; } .ladder-page[hidden] { display: none; }
.ladder-now { margin: 0; font-size: .9375rem; color: var(--slate); }

/* ---------- Arabic pronunciation course (app/pron.js, app/pron-mouth.js) ---------- */
.pron-link .review-card__n { font-family: var(--font-ar, 'Amiri', serif); font-size: 1.6rem; line-height: 1; }
.pron-hero { grid-template-columns: 1fr; gap: var(--s3); }
.pron-art { max-inline-size: 15rem; justify-self: center; inline-size: 100%; }
.pron-hero__t { display: grid; gap: var(--s2); justify-items: start; }
.pron-stage { margin-block: var(--s2); }
.pron-stage .stage__aim { margin: 0 var(--s3) var(--s2); }
.pron-soon { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s2); color: var(--slate); font-size: .9375rem; }
.pron-soon b { color: var(--navy); font-weight: 600; }
.pron-step { gap: var(--s3); }
.pron-head { display: flex; align-items: center; gap: var(--s3); }
.pron-head .name { margin: 0; color: var(--slate); }
.pron-diagram { inline-size: 100%; max-inline-size: 22rem; margin-inline: auto; }
.pron-two { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s2); }
.pron-col { display: grid; gap: var(--s2); align-content: start; min-inline-size: 0; }
.pron-col .pron-head { flex-direction: column; align-items: flex-start; gap: 2px; }
@media (max-width: 420px) { .pron-two { gap: var(--s1); } }
.pron-how { margin: 0; padding-inline-start: 1.25rem; display: grid; gap: var(--s1); font-size: 1rem; }
.pron-places { display: flex; flex-wrap: wrap; gap: var(--s1); }
.pron-place-text { margin: 0; min-block-size: 2.75rem; color: var(--ink-soft); }
.pron-legend { margin: 0; padding: 0; list-style: none; display: grid; gap: var(--s1); font-size: .9375rem; }
.pron-legend b { color: var(--gold-deep); }
.pron-miss { font-size: .75rem; color: var(--slate); display: block; }
.pron-round { display: grid; gap: var(--s2); }
.pron-round .opt { display: grid; gap: 2px; }
.pron-watch { background: var(--mint); border-color: var(--mint); }
.pron-done { text-align: center; }
.pron-nav { display: flex; gap: var(--s2); justify-content: space-between; }
.pron-count { text-align: center; margin: 0; }
.pron-say .rec { margin-block-start: var(--s1); }
.pron-bar { display: flex; gap: 4px; block-size: 14px; margin-block-start: var(--s1); }
.pron-seg { background: var(--ivory-2); border: 1px solid var(--line); border-radius: 4px; transition: background .12s; }
.pron-seg.lit { background: var(--gold); border-color: var(--gold-deep); }
/* the mouth picture */
.pmouth { inline-size: 100%; block-size: auto; display: block; }
.pmouth .pm-head { fill: var(--ivory-2); stroke: var(--navy); stroke-width: 2; stroke-linejoin: round; }
.pmouth .pm-cavity { fill: #FFF7EF; }
.pmouth .pm-roof, .pmouth .pm-wall, .pmouth .pm-jaw { stroke: var(--navy); stroke-width: 2.5; stroke-linecap: round; }
.pmouth .pm-velum { fill: #E5B5AE; stroke: var(--navy); stroke-width: 1.5; }
.pmouth .pm-uvula { fill: #E5B5AE; stroke: var(--navy); stroke-width: 1.2; }
.pmouth .pm-tongue { fill: #E58F8A; stroke: #A24A47; stroke-width: 2; stroke-linejoin: round; }
.pmouth .pm-tooth { fill: #fff; stroke: var(--navy); stroke-width: 1.5; }
.pmouth .pm-lip { fill: #D97C7A; stroke: #8E3A3A; stroke-width: 1.5; }
.pmouth .pm-air { stroke: var(--sage); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 3 7; opacity: 0; }
.pmouth.is-held .pm-air:not(.mode-none) { opacity: 1; animation: pm-flow 1s linear infinite; }
.pmouth.is-held .pm-air.mode-burst { stroke-dasharray: 10 6; animation-duration: .7s; }
.pmouth .pm-voice { opacity: 0; }
.pmouth .pm-voice .pm-ring { fill: none; stroke: var(--gold-deep); stroke-width: 2; }
.pmouth.is-held .pm-voice.on { opacity: 1; }
.pmouth.is-held .pm-voice.on .pm-ring { animation: pm-pulse 1.1s ease-out infinite; transform-origin: 200px 205px; }
.pmouth .pm-voice .r1 { animation-delay: .25s; } .pmouth .pm-voice .r2 { animation-delay: .5s; }
.pmouth .pm-fold line { stroke: var(--navy); stroke-width: 3; stroke-linecap: round; }
.pmouth .pm-contact { fill: var(--gold); stroke: var(--gold-deep); stroke-width: 2; }
.pmouth.is-held .pm-contact { animation: pm-dot 1.4s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.pmouth .pm-pull { stroke: var(--gold-deep); stroke-width: 3; stroke-linecap: round; }
.pmouth .pm-arrowhead { fill: var(--gold-deep); }
.pmouth .pm-label { font: 600 13px var(--font-ui, sans-serif); fill: var(--slate); }
@keyframes pm-flow { to { stroke-dashoffset: -20; } }
@keyframes pm-pulse { 0% { opacity: .9; transform: scale(.7); } 100% { opacity: 0; transform: scale(1.6); } }
@keyframes pm-dot { 50% { transform: scale(1.25); } }
@media (prefers-reduced-motion: reduce) { .pmouth * { animation: none !important; } .pmouth .pm-air:not(.mode-none), .pmouth .pm-voice.on { opacity: 1; } }

/* talk topic view (2026-11-20): a card per topic, six step chips in a row */
.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; padding: 4px; border-radius: 999px; background: var(--ivory-2); border: 1px solid var(--line); }
.seg__b { padding: 8px 10px; border: 0; border-radius: 999px; background: transparent; color: var(--slate); font: 600 .875rem var(--font-ui); cursor: pointer; }
.seg__b.is-on { background: var(--navy); color: #fff; }
.topic-view { display: grid; gap: 10px; } .topic-view[hidden], .ladder[hidden], .ladder-body[hidden] { display: none; }
.topic-h { margin: 6px 0 0; font: 600 .75rem var(--font-ui); letter-spacing: .06em; text-transform: uppercase; color: var(--gold-deep); }
.topic-list { display: grid; gap: 10px; padding-block-start: 10px; }
.topic { display: grid; gap: 10px; padding: 12px; border-radius: 18px; background: #fff; border: 1px solid var(--line); }
.topic__head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.topic__t { font: 600 1rem var(--font-display); color: var(--navy); } .topic__c { font-size: .75rem; color: var(--slate); }
.topic__chips { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.topic__chip { display: grid; justify-items: center; gap: 1px; padding: 8px 2px; border-radius: 12px; background: var(--navy); color: #fff; text-decoration: none; min-block-size: 48px; }
.topic__chip.is-done { background: var(--gold); color: var(--navy); }
.topic__chip.is-off { background: var(--ivory-2); color: var(--slate); opacity: .55; border: 1px dashed var(--line); }
.topic__n { font: 600 1rem var(--font-display); line-height: 1; } .topic__l { font: 500 .625rem var(--font-ui); }

.pron-tune { inline-size: 100%; max-inline-size: 16rem; block-size: auto; margin-block-start: 6px; }
.pron-tune polyline { stroke: var(--gold-deep); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.pron-tune circle { fill: var(--navy); }

/* ===== Repair wave 2026-11-20 (qa summary E and B10): phones. Checked in WebKit, iPhone 14 (390 x 664), iPhone SE (320 x 568) and landscape (750 x 340). ===== */
/* Small gold text: the deep gold was 4.17 to 1 on ivory. #876020 is 5.2 to 1 on ivory, 4.8 to 1 on the pale ivory and 5.6 to 1 on white. The large streak number takes the same colour. */
.streak__num { color: var(--gold-deep); }
.cm-class, .eyebrow, .topic-h, .ladder__n { color: var(--gold-deep); }

/* Tap targets: 44 px high at least (live-phone S15 and S9). */
.homelinks a { min-block-size: 44px; block-size: 44px; box-sizing: border-box; display: inline-flex; align-items: center; padding-block: 0; }
.cm-tab, .seg__b, .cm-more, .chip-btn, .tutor-pick .chip-btn, .tm-btn, .tm-item, .lesson-look__chip, .lesson-look__who { min-block-size: 44px; }
.seg__b { padding-block: 0; }
.lesson-look__full { inline-size: 44px; min-inline-size: 44px; min-block-size: 44px; }
.setting__sel, .lesson-look__sel { min-block-size: 44px; block-size: 44px; }
.play--sm { min-block-size: 44px; min-inline-size: 44px; }
.dock-swap { inline-size: 44px; block-size: 44px; }
.dock-handle { min-block-size: 44px; }
.dock-hint .btn { min-block-size: 44px; }
.tutor-card .tutor-full { inline-size: 44px; min-block-size: 44px; }
.tutor-card .tutor-again { min-block-size: 44px; }
.tutor-card.is-full .tutor-full { inline-size: auto; }

/* The dock is solid, so no ghost text shows through it (live-phone B1). */
.talk-panel { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
.tutor-card, .tutor-card[data-look="photo"] { -webkit-backdrop-filter: none; backdrop-filter: none; }

/* Talk page on a short phone screen: a smaller picture, a closer dock, and short bubbles, so the learner's answer and the tutor's new line both sit above the dock. */
@media (max-height: 700px) and (orientation: portrait) {
  .tutor-card .tutor-frame, .tutor-card[data-look="photo"] .tutor-frame { block-size: min(70cqw, 27svh); }
  .tutor-card[data-look="drawn"]:not(.is-full) .tutor-zoom { inset-block-start: -19cqw; }
  .talk-panel { padding: 6px 12px calc(8px + env(safe-area-inset-bottom)); gap: 4px; max-block-size: 38svh; }
  .talk-panel .options { grid-template-columns: repeat(auto-fit, minmax(104px, 1fr)); gap: 6px; }
  .talk-panel .opt { padding: 4px 6px; }
  .talk-panel .opt .ar { font-size: 1.125rem; line-height: 1.5; }
  .talk-panel .mic-btn { min-block-size: 52px; }
}

@media (max-height: 700px) {
  .chat .bubble { padding: 8px 12px; }
  .chat .bubble--you { grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "who ar" "chip chip"; align-items: center; column-gap: 8px; }
  .chat .bubble--you > .who { grid-area: who; margin: 0; }
  .chat .bubble--you > .ar { grid-area: ar; margin: 0; font-size: 1.375rem; line-height: 1.7; }
  .chat .bubble--you > .chip { grid-area: chip; margin: 0; }
  .chat .bubble--tutor { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "who play" "line line"; align-items: center; }
  .chat .bubble--tutor > .who { grid-area: who; margin: 0; }
  .chat .bubble--tutor > .play { grid-area: play; margin: 0; }
  .chat .bubble--tutor > .line { grid-area: line; }
  .chat .bubble--tutor > .line .ar { line-height: 1.7; }
}

/* Lesson header on a phone: one short row (picture, titles, tutor menu, full screen), about 80 px instead of 185 to 247 (live-phone S4). */
@media (max-width: 520px), (orientation: landscape) and (max-height: 520px) {
  .top--lesson { padding-block: 2px 4px; gap: 4px; }
  .top--lesson .top-row--tutor { grid-template-columns: 48px minmax(0, 1fr) auto auto; grid-template-rows: auto; gap: 6px 8px; align-items: center; }
  .top--lesson .lesson-look:not(.is-full), .top--lesson .lesson-look:not(.is-full) .lesson-look__row { display: contents; }
  .top--lesson .lesson-look__frame, .top--lesson .lesson-look[data-look="photo"] .lesson-look__frame { grid-column: 1; grid-row: 1; inline-size: 48px; block-size: 48px; margin: 0; }
  .top--lesson .lesson-look__frame .lesson-tutor { inline-size: 100%; }
  .top--lesson .top-text { grid-column: 2; grid-row: 1; gap: 0; }
  .top--lesson .lesson-look__pick { grid-column: 3; grid-row: 1; }
  .top--lesson .lesson-look__full { grid-column: 4; grid-row: 1; }
  .top--lesson .lesson-look__again { grid-column: 1 / -1; grid-row: 2; }
  .top--lesson .lesson-look__tag { grid-column: 1 / -1; grid-row: 3; }
  .top--lesson .tm-btn { font-size: 0; padding: 0; inline-size: 44px; justify-content: center; }
  .top--lesson .tm-btn::before { content: "Tutor"; font: 600 .6875rem var(--font-ui); }
  .top--lesson .tm-chev { display: none; }
  .top--lesson .tm-pop { inset-inline-start: auto; inset-inline-end: 0; }
  .top--lesson .eyebrow { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; font-size: .6875rem; line-height: 1.3; }
  .top--lesson .title-ar { font-size: 1.5rem; line-height: 1.6; padding-inline: 2px; overflow: visible; }
  .top--lesson .title-en { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .8125rem; line-height: 1.3; }
}

/* Landscape phone (750 x 340): the tutor beside the talk, not above it. The header and the lesson title are not cut at the edge (live-phone S16). */
@media (orientation: landscape) and (max-height: 520px) {
  .title-ar { padding-inline: 6px; overflow: visible; }
  .top--lesson .top-text { padding-inline-end: 8px; }
  .page:has(> #app > .tutor-card), .page:has(#app > .tutor-card) { max-inline-size: 60rem; }
  /* The tutor picture is fixed at the left (not sticky), so the talk code scrolls the learner's line to the top of the right column. */
  #app:has(> .tutor-card) { display: grid; grid-template-columns: 250px minmax(0, 1fr); grid-template-areas: "gap head" "gap chat" "gap dock"; column-gap: 12px; align-items: start; }
  #app:has(> .tutor-card) > .top { grid-area: head; }
  #app:has(> .tutor-card) > .top .help, #app:has(> .tutor-card) > .top .eyebrow { display: none; }
  #app:has(> .tutor-card) > .top .title-en--h1 { font-size: 1.125rem; }
  #app:has(> .tutor-card) { gap: 4px 12px; padding-block-start: 2px; padding-block-end: 8px; }
  #app:has(> .tutor-card) > .tutor-card:not(.is-full) { position: fixed; inset-block-start: 58px; inset-inline-start: max(16px, calc((100vw - 60rem) / 2 + 16px)); inline-size: 250px; margin: 0; border-radius: 18px; z-index: 30; }
  #app:has(> .tutor-card) > .chat { grid-area: chat; min-inline-size: 0; }
  #app:has(> .tutor-card) > .talk-panel { grid-area: dock; margin-inline: 0; min-inline-size: 0; max-block-size: 60svh; padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); gap: 2px; }
  .tutor-card .tutor-frame, .tutor-card[data-look="photo"] .tutor-frame { block-size: min(70cqw, calc(100svh - 80px)); }
  /* the dock in two columns: the replies on the left, the microphone on the right; the fold handle and the sound bars are not shown */
  #app:has(> .tutor-card) > .talk-panel:has(> .dock-speak) { display: grid; grid-template-columns: minmax(0, 1fr) 230px; grid-template-areas: "fold speak" "type type" "fb fb"; column-gap: 10px; align-items: center; }
  .talk-panel > .dock-handle { display: none; }
  .talk-panel > .dock-fold { grid-area: fold; min-inline-size: 0; }
  .talk-panel > .dock-speak { grid-area: speak; }
  .talk-panel > .talk-type { grid-area: type; }
  .talk-panel > .feedback { grid-area: fb; }
  .talk-panel .mic-wave { display: none; }
  .talk-panel .dock-speak { display: grid; grid-template-columns: minmax(0, 1fr) 44px; align-items: center; column-gap: 6px; }
  .talk-panel .dock-swap--pen { position: static; }
  .talk-panel .dock-hint { flex-wrap: wrap; gap: 0 8px; }
  .talk-panel .mic-privacy { order: 5; flex: 1 0 100%; font-size: .5625rem; line-height: 1.25; margin: 0; }
  .talk-panel:has(> .dock-speak) .options { grid-template-columns: repeat(auto-fit, minmax(84px, 1fr)); }
  .talk-panel .options { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); gap: 6px; }
  .talk-panel .opt { padding: 4px 4px; }
  .talk-panel .opt .ar { font-size: 1.0625rem; line-height: 1.5; }
  .talk-panel .mic-btn { min-block-size: 48px; }
  .chat .bubble { padding: 8px 12px; }
}

/* Back and Next stay on screen while a step is longer than the phone (live-phone S3): Next is always in reach after a right answer. */
.screen > .nav, .pron-shell > .nav { position: sticky; inset-block-end: 0; z-index: 20; padding-block: 12px calc(8px + env(safe-area-inset-bottom)); background: linear-gradient(to bottom, rgba(250,246,239,0), var(--cream) 28%); }

/* ===== Student-sim repairs, 2026-11-20 (docs/reports/student-sim-2026-11-20.md) ===== */
/* 1. Room above the fixed Back/Next bar: anything scrolled or focused stops above it, and the last line of a step is never under it. */
html { scroll-padding-block-end: 96px; }
.screen > .nav, .pron-shell > .nav { margin-block-start: 4px; }
.screen, .pron-shell { padding-block-end: 8px; }
/* 5. a tile that is in the wrong place on a build step */
.tile.is-bad { border-color: var(--bad); background: #FBECEA; }
/* 14. the letter on a question about one letter; the letter keys are big and obvious */
.card > .ar--xl[data-glyph] { text-align: center; margin: 0; line-height: 1.4; }
.keys-note { margin: 0; font-weight: 600; color: var(--navy); }
.card .keys .tile { min-inline-size: 56px; min-block-size: 56px; font-size: 1.75rem; border-color: var(--gold-deep); }
/* 10. lesson header: the Arabic title keeps clear of the "step N of M" line above it, and the English title may use two lines instead of a cut ellipsis */
@media (max-width: 520px), (orientation: landscape) and (max-height: 520px) {
  .top--lesson .title-ar { margin-block-start: 2px; line-height: 1.7; }
  .top--lesson .title-en { white-space: normal; overflow: visible; text-overflow: clip; line-height: 1.25; }
}
/* 8. "I am not sure" is not a wrong answer: a quiet line, not a red bubble */
.sys-note[data-note="unsure"] { color: var(--deep); font-weight: 600; }
/* 9. the Arabic letter keys under the typing box of a talk: one row that scrolls sideways, each key a 44 px target */
.talk-keys { display: flex; flex-wrap: nowrap; gap: 6px; overflow-x: auto; overflow-y: hidden; direction: rtl; padding-block: 2px; min-block-size: 52px; flex-shrink: 0; align-self: start; }
.talk-keys .tile { flex: 0 0 auto; min-inline-size: 44px; min-block-size: 44px; font-size: 1.375rem; }
.talk-panel[data-input="speak"] .talk-keys { display: none; }
/* 12. the type and speak swap buttons carry a word, not just a picture */
.dock-swap { inline-size: auto; min-inline-size: 44px; padding-inline: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 6px; border-radius: 999px; }
.dock-swap__t { font: 600 .8125rem var(--font-ui); }
.talk-panel .dock-speak { grid-template-columns: minmax(0, 1fr) auto; }
/* 8. the skip button sits with the other buttons, whole, and looks like a button */
.dock-hint { flex-wrap: wrap; }
.dock-hint .talk-skip { margin: 0; border: 1px solid var(--line); background: #fff; color: var(--navy); font-size: .8125rem; }
@media (orientation: landscape) and (max-height: 520px) {
  #app:has(> .tutor-card) > .talk-panel:has(> .dock-speak) { grid-template-areas: "fold speak" "type type" "keys keys" "fb fb"; }
  .talk-panel > .talk-keys { grid-area: keys; }
}
/* in typing mode the voice notice is not needed, and the dock keeps room for the box, the keys and the note */
.talk-panel[data-input="type"] .mic-privacy { display: none; }
@media (max-width: 359px) { .top--lesson .eb-lesson { display: none; } }
