:root {
  --bg: #f7f4ee; --surface: #ffffff; --surface-2: #f0ebe1; --text: #1f1b16; --muted: #6b6257;
  --line: #e2d9ca; --brand: #1f6f5c; --brand-ink: #ffffff; --brand-soft: #dcefe8;
  --gold: #c8901a; --good: #1e8a4c; --good-soft: #def4e6; --bad: #c0392b; --bad-soft: #fbe3df;
  --shadow: 0 1px 2px rgba(31,27,22,.06), 0 4px 16px rgba(31,27,22,.06);
  --radius: 14px;
  /* Owner, 2026-11-14: Ethiopic letters in Nyala. English keeps the system font (Segoe UI etc. have no
     Ethiopic letters, so Ethiopic in ordinary text falls through to Nyala). Nyala comes with Windows only;
     phones and Macs keep Noto Sans Ethiopic. */
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Nyala", "Noto Sans Ethiopic", sans-serif;
  /* Latin letters first in the system font (Nyala's own Latin letters look odd in English titles); the
     system fonts have no Ethiopic letters, so those fall through to Nyala. */
  --fidel: system-ui, -apple-system, "Segoe UI", Roboto, "Nyala", "Noto Sans Ethiopic", "Abyssinica SIL", "Ebrima", serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14130f; --surface: #1d1b17; --surface-2: #26231e; --text: #f1ece3; --muted: #a59b8d;
    --line: #36322b; --brand: #4fb398; --brand-ink: #0d1f1a; --brand-soft: #1c3a32;
    --gold: #e0ad45; --good: #4cc27f; --good-soft: #17352a; --bad: #ef6b5b; --bad-soft: #3d1f1b;
    --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14130f; --surface: #1d1b17; --surface-2: #26231e; --text: #f1ece3; --muted: #a59b8d;
  --line: #36322b; --brand: #4fb398; --brand-ink: #0d1f1a; --brand-soft: #1c3a32;
  --gold: #e0ad45; --good: #4cc27f; --good-soft: #17352a; --bad: #ef6b5b; --bad-soft: #3d1f1b;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 4px 16px rgba(0,0,0,.25); color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; }
/* Phones and tablets (2026-11-16): iOS must not enlarge text on rotation; 100dvh follows the phone's moving address bar. */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body { background: var(--bg); color: var(--text); font: 16px/1.5 var(--font); min-height: 100vh; min-height: 100dvh; }
button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
/* Hover colours apply only with a mouse (@media (hover: hover)) so they don't stick after a tap.
   On touch screens, small text links get a larger tap area without moving the text. */
@media (pointer: coarse) {
  #view a:not([class]), .foot-links a { display: inline-block; padding: 10px 4px; margin: -10px -4px; }
  #view .btn.linkish { padding: 10px 8px; }
  .switch { min-height: 40px; }
  .switch input[type="checkbox"] { width: 20px; height: 20px; }
}
a { color: var(--brand); }
.fidel { font-family: var(--fidel); }
.wrap { max-width: 960px; margin: 0 auto; padding: 0 16px; }

/* Top bar */
.top { position: sticky; top: 0; z-index: 5; background: var(--bg); border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 12px; height: 60px; }
.logo { display: flex; align-items: baseline; gap: 8px; font-weight: 700; font-size: 19px; text-decoration: none; color: var(--text); }
.logo .fidel { color: var(--brand); font-size: 20px; }
.logo .logo-mark { color: var(--brand); font-size: 19px; font-weight: 800; letter-spacing: .04em; }   /* AZA (owner, 2026-11-10) */
.top nav { margin-left: auto; display: flex; gap: 4px; }
.top nav button { background: none; border: 0; padding: 8px 12px; border-radius: 10px; color: var(--muted); }
.top nav button[aria-current="page"] { background: var(--surface-2); color: var(--text); }
@media (hover: hover) { .top nav button:hover { background: var(--surface-2); color: var(--text); } }

main { padding: 24px 0 64px; }
h1 { font-size: 28px; line-height: 1.2; margin: 0 0 6px; }
h2 { font-size: 20px; margin: 28px 0 12px; }
.sub { color: var(--muted); margin: 0 0 20px; }

/* Cards */
.grid { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px; }
.book { display: flex; gap: 16px; align-items: center; text-align: left; width: 100%; }
.book .cover { width: 72px; height: 92px; border-radius: 10px; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-size: 38px; flex: none; }
.book.locked { opacity: .55; cursor: default; }
.book h3 { margin: 0; font-size: 18px; }
.book p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }

.skill { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 14px; }
@media (hover: hover) { .skill:hover { border-color: var(--brand); } }
.skill .glyph { width: 46px; height: 46px; flex: none; border-radius: 10px; background: var(--brand-soft); color: var(--brand); display: grid; place-items: center; font-size: 24px; }
.skill .name { font-weight: 600; }
.skill .meta { color: var(--muted); font-size: 13px; }
.skill .score { margin-left: auto; text-align: right; font-variant-numeric: tabular-nums; flex: none; }
.skill .score b { font-size: 18px; }
.badge { display: inline-block; font-size: 11px; font-weight: 600; padding: 1px 7px; border-radius: 99px; background: var(--surface-2); color: var(--muted); margin-left: 6px; vertical-align: 2px; }
.badge.pub { background: var(--good-soft); color: var(--good); }
.star { color: var(--gold); }
.week { display: grid; gap: 8px; }

.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 8px; }
.switch { display: inline-flex; gap: 8px; align-items: center; color: var(--muted); font-size: 14px; }
.btn { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 9px 16px; font-weight: 600; }
.btn.primary { background: var(--brand); color: var(--brand-ink); border-color: var(--brand); }
.btn:disabled { opacity: .5; cursor: default; }
.btn.small { padding: 5px 10px; font-size: 14px; }

/* Practice */
.practice { display: grid; grid-template-columns: 1fr 200px; gap: 16px; align-items: start; }
.qcard { padding: 24px; }
.qhead { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 14px; margin-bottom: 14px; }
.prompt { font-size: 24px; font-weight: 600; margin: 0; }
.prompt-amh { font-size: 20px; color: var(--muted); margin: 4px 0 0; }
.audio-btn { display: inline-flex; align-items: center; gap: 8px; margin: 16px 0 4px; border: 0; background: var(--brand-soft); color: var(--brand); padding: 10px 16px; border-radius: 99px; font-weight: 600; }
.audio-btn svg { width: 22px; height: 22px; }
.no-audio { color: var(--muted); font-size: 14px; margin: 12px 0 0; }
.choices { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 20px; }
@media (max-width: 520px) { .choices { grid-template-columns: 1fr; } .choice { min-height: 64px; } }
.choice { border: 2px solid var(--line); background: var(--surface); border-radius: 14px; min-height: 92px; font-family: var(--fidel); font-size: 44px; line-height: 1.1; padding: 10px; transition: transform .08s, border-color .1s; }
.choice.word { font-size: 30px; }
@media (hover: hover) { .choice:hover:not(:disabled) { border-color: var(--brand); } }
.choice:active:not(:disabled) { transform: scale(.98); }
.choice.right { border-color: var(--good); background: var(--good-soft); }
.choice.wrong { border-color: var(--bad); background: var(--bad-soft); }
.choice:disabled { cursor: default; }
.feedback { margin-top: 18px; border-radius: 12px; padding: 14px 16px; }
.feedback.good { background: var(--good-soft); }
.feedback.good h3 { margin: 0 0 4px; color: var(--good); font-size: 17px; }
.why { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 6px; color: var(--text); }
/* The explanation sits under its answer, full width, so long answers don't squeeze it into a narrow column. */
.why li { display: grid; grid-template-columns: 18px 1fr; gap: 2px 10px; align-items: baseline; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; }
.why li.right { border-color: var(--good); }
.why li.wrong { border-color: var(--bad); }
.why-mark { font-weight: 700; color: var(--good); }
.why li.wrong .why-mark { color: var(--bad); }
.why-choice { font-size: 20px; min-width: 2ch; }
.q-pic-wrap { margin: 12px 0 4px; }
.q-pic { width: 112px; height: 112px; object-fit: contain; border-radius: 12px; background: var(--surface-2); padding: 10px; }
.why li > span:last-child { grid-column: 2; }
.feedback.bad { background: var(--bad-soft); }
.feedback.bad h3 { margin: 0 0 4px; color: var(--bad); font-size: 17px; }
.feedback.bad p { margin: 0 0 12px; color: var(--text); }
.side { display: grid; gap: 12px; }
.stat { padding: 14px; text-align: center; }
.stat .label { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.stat .value { font-size: 34px; font-weight: 700; font-variant-numeric: tabular-nums; line-height: 1.2; }
.stat .value.smart { color: var(--brand); }
.meter { height: 8px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--brand); width: 0; transition: width .35s; }
.done { text-align: center; padding: 40px 24px; }
.done .big { font-size: 64px; }

/* Progress table */
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); }
th { color: var(--muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.trouble { color: var(--bad); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.empty { color: var(--muted); padding: 24px; text-align: center; }

/* Pictures and letter book */
.qhead { flex-wrap: wrap; }
.kw-chip { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 99px; padding: 4px 12px 4px 4px; font-size: 14px; color: var(--text); }
.kw-only { margin-left: auto; }
.kw-only .kw-pic { width: 44px; height: 44px; }
.feedback .kw-chip { margin-left: 8px; vertical-align: middle; font-weight: 400; }
.feedback p .kw-chip { margin-left: 0; }
.kw-pic { width: 30px; height: 30px; object-fit: contain; background: #fff; border-radius: 50%; padding: 3px; }
.choice { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; }
.choice-pic { width: 56px; height: 56px; object-fit: contain; }
.fb-pic { float: right; width: 64px; height: 64px; object-fit: contain; margin: 0 0 6px 12px; }
.letters { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.fam { display: grid; gap: 12px; }
.fam-head { display: flex; align-items: center; gap: 14px; }
.fam-base { font-size: 64px; line-height: 1; color: var(--brand); min-width: 70px; text-align: center; }
.fam-word { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; border: 1px solid var(--line); background: var(--surface-2); border-radius: 12px; padding: 8px 12px 8px 8px; flex: 1; }
.fam-pic { grid-row: 1 / 3; width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 10px; padding: 6px; }
.fam-pic.none { display: grid; place-items: center; color: var(--muted); font-size: 28px; }
.fam-w { font-size: 24px; font-weight: 600; }
.forms { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
.form { border: 1px solid var(--line); background: var(--surface); border-radius: 10px; padding: 6px 0 4px; display: grid; justify-items: center; line-height: 1.1; }
.form span { font-size: 26px; }
.form small { color: var(--muted); font-size: 11px; }
@media (hover: hover) { .form:hover, .fam-word:hover, .kw-chip:hover { border-color: var(--brand); } }
.fam .meta { color: var(--muted); font-size: 13px; margin: 0; }
.wgrid { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.wcard { display: grid; justify-items: center; gap: 4px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 12px 8px; }
@media (hover: hover) { .wcard:hover { border-color: var(--brand); } }
.wcard-pic { width: 72px; height: 72px; object-fit: contain; }
.wcard-w { font-size: 24px; font-weight: 600; line-height: 1.2; }
.wcard .meta { color: var(--muted); font-size: 13px; text-align: center; }
.credit { color: var(--muted); font-size: 12px; margin-top: 24px; }
.toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 20px); background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 10px; font-size: 14px; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s; z-index: 20; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Landing: subjects */
/* Amharic books page (owner's mock-up, 2026-11-09) */
.books-page { max-width: 520px; margin: 0 auto; }
.books-bar { position: relative; display: flex; align-items: center; justify-content: center; background: #3a8fd8; color: #fff; border-radius: 0 0 6px 6px; min-height: 64px; padding: 8px 56px; margin: -8px 0 14px; }
.books-bar h1 { margin: 0; font-size: 26px; font-weight: 700; color: #fff; }
.books-back { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px; border: 0; background: none; color: #fff; display: grid; place-items: center; border-radius: 8px; }
.books-back svg { width: 26px; height: 26px; }
@media (hover: hover) { .books-back:hover { background: rgba(255,255,255,.15); } }
.book-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; padding: 0 16px; }   /* minmax: long names wrap on 320 px phones */
.book-btn { position: relative; display: flex; align-items: center; gap: 14px; width: 100%; min-height: 56px; padding: 10px 18px; border: 0; border-radius: 6px;
  background: var(--c); color: #fff; font-size: 20px; font-weight: 600; text-align: left; box-shadow: 0 1px 2px rgba(0,0,0,.15); }
@media (hover: hover) { .book-btn:hover { filter: brightness(1.06); } }
.book-btn:active { transform: scale(.99); }
.book-num { min-width: 1.6em; flex: none; }
.book-amh { min-width: 6.5em; flex: none; white-space: nowrap; }
.books-bar h1.two-line { font-size: 22px; line-height: 1.2; white-space: nowrap; }
@media (max-width: 420px) { .books-bar h1.two-line { font-size: 18px; } }
.book-amh.book-title { flex: 1; min-width: 0; white-space: normal; text-align: left; line-height: 1.3; }
.book-en { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Geez Books: long English names wrap instead of being cut off. */
.book-en.book-en-wrap { white-space: normal; text-align: left; line-height: 1.3; }
.book-stack { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; line-height: 1.3; }
.book-stack .book-amh { min-width: 0; }
.books-meta { text-align: center; color: var(--muted); font-size: 14px; margin: 16px 0 0; }
.books-extra { display: flex; gap: 8px; justify-content: center; margin-top: 10px; }
body.is-books .top { display: none; }
body.is-books main { padding-top: 8px; }
@media (max-width: 520px) {
  .book-btn { font-size: 16px; gap: 8px; padding: 10px 12px; min-height: 52px; }
  .book-amh { min-width: 0; }
  .book-en-long { font-size: 13px; }   /* a long English name stays on 2 lines on a phone */
  .book-en-stack { font-size: 13px; }  /* the English line of a stacked name fits one line on a phone */
  .book-stack > span { max-width: 100%; }
}
@media (max-width: 360px) {
  .book-en-stack { white-space: normal; }   /* small phones (320 px): wrap instead of running off the screen */
  .book-list { padding: 0 8px; gap: 12px; }
  .books-bar h1 { font-size: 23px; }
}

/* Book PDF: cover card on the skills page and the reader (2026-11-09) */
.book-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
.book-top-text { flex: 1; min-width: 0; }
/* 2026-11-10: larger cover with the description on its right (owner's mock-up) */
.pdf-card { flex: none; display: flex; flex-direction: row; align-items: center; gap: 20px; width: 470px; max-width: 100%; margin-top: 8px; padding: 14px 18px 14px 14px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); color: var(--text); text-align: center; }
@media (hover: hover) { .pdf-card:hover { border-color: var(--brand); } }
.pdf-cover { position: relative; display: grid; place-items: center; flex: none; width: 220px; min-height: 285px; background: var(--surface-2); border-radius: 4px; overflow: hidden;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.pdf-cover canvas { display: block; width: 220px; opacity: 0; transition: opacity .2s; }
.pdf-cover.ready canvas { opacity: 1; }
.pdf-cover-fallback { position: absolute; font-size: 34px; color: var(--brand); }
.pdf-cover.ready .pdf-cover-fallback { display: none; }
/* 2026-11-10: light blue card, navy text (contrast: #0b3a66 on #e3f1fc ≈ 10:1, #2c4f6e ≈ 7:1) */
.pdf-card { background: #e3f1fc; border-color: #b6d7f2; }
@media (hover: hover) { .pdf-card:hover { border-color: #4a90d0; } }
.pdf-card-text { flex: 1; display: grid; gap: 14px; justify-items: center; font-size: 18px; color: #0b3a66; }
.pdf-card-text b { font-size: 22px; font-weight: 700; color: #0b3a66; }
.pdf-card-text .pdf-kind { font-size: 20px; font-weight: 600; }
.pdf-card-text .pdf-pages { font-size: 13px; color: #2c4f6e; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .pdf-card { background: #15324d; border-color: #2a5a85; }
  :root:not([data-theme="light"]) .pdf-card-text, :root:not([data-theme="light"]) .pdf-card-text b { color: #e6f2fc; }
  :root:not([data-theme="light"]) .pdf-card-text .pdf-pages { color: #b8d4ec; }
}
@media (max-width: 900px) {
  .book-top { flex-direction: column; gap: 0; }
  .pdf-card { width: 100%; margin: 4px 0 12px; }
}
@media (max-width: 600px) {
  .pdf-card { gap: 14px; padding: 10px 12px 10px 10px; }
  .pdf-cover { width: 130px; min-height: 168px; }
  .pdf-cover canvas { width: 130px !important; height: auto !important; }
  .pdf-card-text { gap: 8px; font-size: 15px; }
  .pdf-card-text b { font-size: 18px; }
  .pdf-card-text .pdf-kind { font-size: 16px; }
}
.reader { max-width: 860px; margin: 0 auto; }
.reader-bar { display: flex; align-items: center; gap: 10px; }
.reader-bar h1 { margin: 0; font-size: 22px; }
.reader-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 8px 0; color: var(--muted); font-size: 14px; }
.reader-page { overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 2px; min-height: 300px; text-align: center;
  -webkit-user-select: none; user-select: none; }
.reader-page canvas { display: inline-block; background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.15); -webkit-touch-callout: none; }
.pdf-card[hidden] { display: none; }
/* Book video on the right of "Read the book" (owner, 2026-11-16) */
/* With a video the title goes on top, then the card and the video side by side. */
.book-top.has-video { flex-direction: column; gap: 0; }
.book-top.has-video .book-top-text { width: 100%; }
/* One light-blue box: [book cover | Read the book | video tile the size of the cover]. Playing: the video fills the box. */
.pdf-box { display: flex; align-items: center; gap: 20px; width: 720px; max-width: 100%; margin: 8px 0 12px; padding: 14px;
  border: 1px solid #b6d7f2; border-radius: var(--radius); background: #e3f1fc; box-shadow: var(--shadow); }
.pdf-box .pdf-card { flex: 1; min-width: 0; width: auto; margin: 0; padding: 0; border: 0; box-shadow: none; background: transparent; }
@media (hover: hover) { .pdf-box .pdf-card:hover .pdf-cover { box-shadow: 0 0 0 2px #4a90d0; } }
.book-video { position: relative; flex: none; width: 220px; height: 285px; border-radius: 4px; overflow: hidden; background: #e3f1fc;
  box-shadow: 0 1px 4px rgba(0,0,0,.18); }
.book-video video { display: block; width: 100%; height: 100%; object-fit: cover; background: #e3f1fc; }
/* The whole tile is the play button; the "▶ Watch" pill sits at the bottom so the cover title stays visible. */
.vid-play { position: absolute; inset: 0; display: flex; align-items: flex-end; justify-content: center; padding: 0 0 14px;
  width: 100%; border: 0; background: transparent; color: #fff; font-family: inherit; font-size: 15px; font-weight: 700; line-height: 1; cursor: pointer; }
/* Over the classroom picture, below "Letters" and above the author's name. */
.vid-play .vid-pill { position: absolute; top: 64%; left: 50%; transform: translate(-50%, -50%); display: inline-flex; align-items: center; gap: 8px;
  padding: 9px 16px 9px 12px; border-radius: 999px; background: #c8102e; box-shadow: 0 2px 8px rgba(0,0,0,.4); white-space: nowrap; }
.vid-play .vid-icon { font-size: 14px; }
@media (hover: hover) { .vid-play:hover .vid-pill, .vid-play:focus-visible .vid-pill { background: #a00d25; transform: translate(-50%, -50%) scale(1.06); } }
.vid-close { position: absolute; top: 8px; right: 8px; display: none; width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(0,0,0,.6); color: #fff; font-size: 16px; cursor: pointer; }
.pdf-box.playing .pdf-card { display: none; }
.pdf-box.playing .book-video { flex: 1; height: auto; aspect-ratio: 16 / 9; background: #000; }
.pdf-box.playing .book-video video { object-fit: contain; background: #000; }
.pdf-box.playing .vid-play { display: none; }
.pdf-box.playing .vid-close { display: block; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .pdf-box { background: #15324d; border-color: #2a5a85; } }
@media (max-width: 600px) {
  .pdf-box { gap: 10px; padding: 10px; }
  .pdf-box .pdf-cover { width: 96px; min-height: 124px; }
  .pdf-box .pdf-cover canvas { width: 96px !important; }
  .book-video { width: 96px; height: 124px; }
  .pdf-box .pdf-card-text { gap: 6px; font-size: 13px; }
  .pdf-box .pdf-card-text b { font-size: 16px; }
  .pdf-box .pdf-card-text .pdf-kind { font-size: 14px; }
  .vid-play { font-size: 12px; padding-bottom: 8px; }
  .vid-play .vid-pill { gap: 5px; padding: 6px 10px 6px 8px; }
  .vid-play .vid-icon { font-size: 11px; }
}
.pdf-cover img { display: block; width: 100%; height: auto; -webkit-user-drag: none; pointer-events: none; }
.pdf-pages { font-size: 12px; }
/* Sign-in and owner page */
.signin { max-width: 440px; margin: 16px auto; display: grid; gap: 10px; }
.google-btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; }
.signin-or { text-align: center; color: var(--muted); font-size: 13px; margin: 4px 0; }
.signin-form { display: grid; gap: 10px; }
.signin-form label { display: grid; gap: 4px; font-size: 14px; color: var(--muted); }
.signin-form input, .admin-row input, .admin-row select { font: inherit; padding: 9px 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); color: var(--text); }
.signin-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.btn.linkish { border: 0; background: none; color: var(--brand); text-decoration: underline; padding: 4px 6px; }
.signin-msg { min-height: 1.2em; margin: 0; font-size: 14px; color: var(--muted); }
.signin-msg.bad { color: var(--bad); }
.signin-title { margin: 0; font-size: 22px; }
.signin-show { display: flex !important; align-items: center; gap: 8px; font-size: 14px; }
.signin-show input { width: auto; }
.signin-hint { margin: 0; font-size: 13px; color: var(--muted); }
.signin-links { margin: 0; text-align: center; font-size: 14px; color: var(--muted); }
.signin-link { color: var(--brand); text-decoration: underline; }
.signin-form .btn.primary { min-height: 44px; }
.account-bar { text-align: right; font-size: 13px; color: var(--muted); margin: 4px 0 8px; }
.admin { max-width: 760px; margin: 0 auto; }
.admin-card { margin-bottom: 16px; }
.admin-card h2 { margin-top: 0; }
.admin-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 8px 0; }
.admin-row input[type="email"] { flex: 1 1 220px; }
/* The book must not be printed (owner, 2026-11-09): printing the reader gives a blank page with a note. */
@media print {
  body.is-reading > * { display: none !important; }
  body.is-reading::after { content: "Printing the book is turned off."; display: block; padding: 40px; font: 16px sans-serif; }
}

/* Skill bar: "7 of 10 questions answered" for a started skill */
.skill-main { flex: 1; min-width: 0; }
.skill.started .skill-status { color: #5b3df0; font-weight: 600; }
.skill-bar { display: block; height: 6px; background: var(--surface-2); border-radius: 99px; overflow: hidden; margin-top: 6px; max-width: 260px; }
.skill-bar i { display: block; height: 100%; background: #5b3df0; }

/* Question screen (owner's mock-up, 2026-11-09) */
body.is-practice { background: #e6f7ec; }
body.is-practice .top { display: none; }
body.is-practice main { padding-top: 12px; }
.qs { max-width: 460px; margin: 0 auto; padding: 0 4px 16px; color: #1f1b16; }
.qs-head { display: flex; align-items: center; gap: 10px; margin: 6px 0 14px; }
.qs-back { width: 44px; height: 44px; flex: none; border: 0; background: none; color: #5b3df0; display: grid; place-items: center; border-radius: 10px; }
.qs-back svg { width: 30px; height: 30px; }
@media (hover: hover) { .qs-back:hover { background: rgba(91,61,240,.08); } }
.qs-title { flex: 1; margin: 0; font-size: 24px; font-weight: 700; color: #ef6a5a; }
.qs-score { flex: none; font-size: 12px; color: #5b5048; text-align: right; line-height: 1.1; }
.qs-score b { display: block; font-size: 20px; color: #1f6f5c; }
.qs-media { position: relative; display: grid; place-items: center; gap: 10px; min-height: 96px; margin: 0 6px 14px; padding: 14px; background: #eef2f6; border: 2px solid #e05a55; border-radius: 4px; }
.qs-media.has-pic { min-height: 150px; }
.qs-pic { width: 120px; height: 120px; object-fit: contain; }
.qs-player { width: 100%; background: #fff; border-radius: 10px; padding: 10px 12px; box-shadow: 0 1px 3px rgba(0,0,0,.12); }
.qs-player-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.qs-player-title { font-size: 17px; font-weight: 600; color: #1f1b16; }
.qs-time { font-size: 12px; color: #6b6257; margin-top: 2px; }
.qs-play { width: 34px; height: 34px; border-radius: 50%; border: 0; background: #5b3df0; color: #fff; display: grid; place-items: center; flex: none; }
.qs-play svg { width: 18px; height: 18px; }
.qs-track { height: 5px; background: #e2e4ea; border-radius: 99px; margin-top: 10px; overflow: hidden; }
.qs-track i { display: block; height: 100%; width: 0; background: #5b3df0; transition: width .1s linear; }
.qs-player.none { text-align: center; }
.qs-prompt { font-size: 20px; line-height: 1.35; margin: 0 6px 16px; }
.qs-prompt-amh { font-size: 19px; color: #5b5048; margin: -10px 6px 16px; }
.qs-choices { display: grid; gap: 12px; justify-items: center; margin-bottom: 18px; }
.qs-choice { width: min(260px, 70%); min-height: 48px; padding: 8px 14px; border: 3px solid transparent; border-radius: 6px; background: #5b3df0; color: #fff;
  font-size: 26px; font-weight: 600; line-height: 1.2; transition: transform .08s, background .1s; }
@media (hover: hover) { .qs-choice:hover:not(:disabled) { background: #4a2fd8; } }
.qs-choice:active:not(:disabled) { transform: scale(.98); }
.qs-choice.selected { background: #fff; color: #5b3df0; border-color: #5b3df0; }
.qs-choice.right { background: #1e8a4c; border-color: #1e8a4c; color: #fff; }
.qs-choice.wrong { background: #c0392b; border-color: #c0392b; color: #fff; }
.qs-choice:disabled { cursor: default; }
/* Book 2 (2026-11-10): the skill's family letters are marked; matching buttons */
mark.lt { background: #ffe066; color: inherit; border-radius: 3px; padding: 0 1px; }
.qs-choice mark.lt { background: #ffd43b; color: #1f1b16; }
.qs-choice.right mark.lt, .qs-choice.wrong mark.lt { background: rgba(255,255,255,.85); color: #1f1b16; }
.qs-note { margin: -8px 6px 14px; font-size: 14px; color: var(--muted); }
.qs-note .fidel { font-size: 17px; letter-spacing: .08em; }
.mt-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin: 4px 6px 10px; }
.mt-col { display: grid; gap: 10px; align-content: start; }
.mt-btn { min-height: 52px; padding: 8px 12px; border: 3px solid transparent; border-radius: 8px; background: #5b3df0; color: #fff; font-size: 20px; cursor: pointer;
  transition: transform .08s, background .12s; }
.mt-btn.en { background: #0b6e99; font-size: 16px; }
@media (hover: hover) { .mt-btn:hover:not(:disabled) { filter: brightness(1.08); } }
.mt-btn.selected { background: #fff; color: #5b3df0; border-color: #5b3df0; }
.mt-btn.ok { background: #1e8a4c; border-color: #1e8a4c; color: #fff; cursor: default; }
.mt-btn.bad { background: #c0392b; border-color: #c0392b; color: #fff; animation: mt-shake .3s; }
.mt-btn mark.lt { background: #ffd43b; color: #1f1b16; }
.mt-status { margin: 0 6px 6px; font-size: 14px; color: var(--muted); min-height: 1.2em; }
@keyframes mt-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (prefers-reduced-motion: reduce) { .mt-btn.bad { animation: none; } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) mark.lt { background: #8a6d00; color: #fff; } }
.qs-choice:disabled:not(.right):not(.wrong) { opacity: .55; }
/* "Re arrange them in order" (Book 1, owner 2026-11-16) */
.ar-card { background: #fff; border-radius: 6px; padding: 14px 10px 16px; margin: 0 0 18px; }
.ar-card .qs-prompt { font-family: Georgia, 'Times New Roman', serif; font-weight: 700; font-size: 24px; margin: 0 6px 16px; color: #1f1b16; }
.ar-slots { display: flex; justify-content: space-between; gap: 6px; }
.ar-slot { flex: 0 1 64px; min-width: 0; height: 56px; border: 3px solid transparent; border-radius: 3px; background: #5b3df0; color: #fff; font-size: 26px; font-weight: 600; padding: 0; }
.ar-slot.full { background: #fff; color: #5b3df0; border-color: #5b3df0; cursor: pointer; }
.ar-slot.ok { background: #1e8a4c; border-color: #1e8a4c; color: #fff; }
.ar-slot.bad { background: #c0392b; border-color: #c0392b; color: #fff; }
.ar-slot:disabled { cursor: default; }
.ar-tiles { display: grid; gap: 18px 36px; justify-content: center; margin: 0 auto 22px; }
.ar-tiles.grid { grid-template-columns: repeat(3, 96px); }
.ar-tiles.col { grid-template-columns: 112px; }
.ar-tiles.wrap { grid-template-columns: repeat(auto-fill, 96px); }
.ar-tile, .ar-gap { height: 78px; }
.ar-tile { border: 0; border-radius: 6px; background: #5b3df0; color: #fff; font-size: 30px; font-weight: 600; cursor: pointer; transition: transform .08s; }
@media (hover: hover) { .ar-tile:hover:not(:disabled) { background: #4a2fd8; } }
.ar-tile:active:not(:disabled) { transform: scale(.97); }
.ar-tile.used { opacity: .35; cursor: default; }
@media (max-width: 420px) { .ar-tiles { gap: 12px 18px; } .ar-tiles.grid { grid-template-columns: repeat(3, 84px); } .ar-slot { height: 46px; font-size: 22px; } }
.qs-submit { display: block; width: min(300px, 80%); margin: 0 auto; min-height: 50px; border: 0; border-radius: 6px; color: #fff; font-size: 22px; font-weight: 700;
  background: linear-gradient(90deg, #9b3de8, #7a3cf0); box-shadow: 0 2px 6px rgba(122,60,240,.3); }
.qs-submit:disabled { opacity: .45; box-shadow: none; }
.qs .feedback { margin: 16px 6px 0; }
.qs-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 22px; }
.qs-arrow { width: 52px; height: 52px; border: 0; border-radius: 8px; color: #fff; display: grid; place-items: center; flex: none; }
.qs-arrow svg { width: 30px; height: 30px; }
.qs-arrow.prev { background: #ec4f9f; }
.qs-arrow.next { background: #7bdc3a; }
.qs-arrow:disabled { opacity: .35; }
.qs-count { font-size: 19px; color: #1f1b16; }
/* Book reader: Home goes back to page 1 (2026-11-11). It sits beside the page count. */
.reader-nav .reader-home { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.reader-nav .reader-home + .qs-count { margin-right: auto; }
.reader-nav .reader-home svg { width: 18px; height: 18px; }
.reader-nav .reader-home:disabled { opacity: .45; }
@media (max-width: 420px) { .reader-nav .reader-home span { display: none; } .qs-count { font-size: 16px; } }
.qs-done { text-align: center; padding: 24px 6px; }
.qs-done-big { font-size: 56px; font-weight: 800; color: #5b3df0; }
.qs-done .qs-submit { margin-top: 18px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-practice { background: #10241a; }
  :root:not([data-theme="light"]) .qs, :root:not([data-theme="light"]) .qs-count { color: var(--text); }
  :root:not([data-theme="light"]) .qs-media { background: #1d2a24; }
  :root:not([data-theme="light"]) .qs-player { background: var(--surface); }
  :root:not([data-theme="light"]) .qs-player-title { color: var(--text); }
  :root:not([data-theme="light"]) .qs-score { color: var(--muted); }
}

body.is-landing { background: #e6f7ec; }
body.is-landing .top { display: none; }
body.is-landing main { padding-top: 16px; }
.landing { max-width: 520px; margin: 0 auto; text-align: center; color: #1f1b16; }
.banner { display: flex; align-items: center; gap: 12px; background: #e3f8f4; border: 12px solid #6ad9c5; padding: 12px 14px; }
.banner-logo { min-width: 36px; height: 36px; display: grid; place-items: center; font-size: 20px; font-weight: 700; letter-spacing: .04em; color: #1f1b16; flex: none; }
.banner-title { flex: 1; font-size: 22px; font-weight: 600; color: #5d4fe0; }
.banner-user { width: 40px; height: 40px; border-radius: 8px; border: 1px solid #b9e6dc; background: #f3fbf9; color: #e2795a; display: grid; place-items: center; flex: none; }
.banner-user svg { width: 22px; height: 22px; }
.tagline { font-size: 24px; color: #ee5a62; margin: 22px 0 28px; }
.subjects { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 14px; padding: 0 16px; }
.subject { background: var(--c); color: #fff; border: 2px solid rgba(255,255,255,.9); border-radius: 12px; min-height: 58px; padding: 8px 10px;
  font-size: 22px; font-weight: 600; line-height: 1.1; box-shadow: 0 2px 6px rgba(0,0,0,.18); transition: transform .08s, filter .1s; }
.subject.wide { grid-column: 1 / -1; }
@media (hover: hover) { .subject:hover { filter: brightness(1.06); } }
.subject:active { transform: scale(.98); }
.landing-foot { margin-top: 28px; border-top: 1px solid #d3eedc; padding-top: 10px; }
.motto { color: #4a3fe0; font-size: 17px; margin: 0 0 12px; }
.books-line { color: #ee5a62; font-size: 18px; margin: 0; padding-bottom: 10px; border-bottom: 1px solid #d3eedc; }
.landing-foot .foot-links { margin-top: 12px; }   /* the "Aznanaw LLC" line above it was removed (owner, 2026-11-16) */
.foot-links { display: flex; justify-content: center; align-items: center; gap: 22px; }
/* "Azanaw LLC" after Contact, on the same line (owner, 2026-11-16) */
.landing-foot .foot-links { flex-wrap: nowrap; white-space: nowrap; }
.foot-llc { color: #6b6257; font-size: 16px; }
@media (max-width: 400px) { .landing-foot .foot-links { gap: 14px; } .landing-foot .foot-links a, .foot-llc { font-size: 14px; } }
.foot-links a { color: #6b6257; text-decoration: none; font-size: 16px; }
@media (hover: hover) { .foot-links a:hover { text-decoration: underline; } }
.prose p { margin: 0 0 12px; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.is-landing { background: #10241a; }
  :root:not([data-theme="light"]) .landing { color: var(--text); }
  :root:not([data-theme="light"]) .banner { background: #173a33; border-color: #2f8f7e; }
  :root:not([data-theme="light"]) .banner-logo { color: var(--text); }
  :root:not([data-theme="light"]) .banner-title { color: #a9a1ff; }
  :root:not([data-theme="light"]) .banner-user { background: #1d453d; border-color: #2f8f7e; }
  :root:not([data-theme="light"]) .motto { color: #a9a1ff; }
  :root:not([data-theme="light"]) .foot-links a, :root:not([data-theme="light"]) .foot-llc { color: var(--muted); }
  :root:not([data-theme="light"]) .landing-foot, :root:not([data-theme="light"]) .books-line { border-color: #24402f; }
}

@media (max-width: 720px) {
  .practice { grid-template-columns: 1fr; }
  .side { grid-template-columns: repeat(3, 1fr); order: -1; }
  .stat { padding: 8px; }
  .stat .value { font-size: 22px; }
  .qcard { padding: 18px; }
  .choice { font-size: 38px; min-height: 80px; }
  .prompt { font-size: 21px; }
  .top nav button { padding: 8px; font-size: 14px; }
}

/* Confetti for a perfect skill round (2026-11-16): a full-screen canvas that lets taps through. */
#confetti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 9999; }

/* ---------- Bottom bar, Student/Teacher, progress line, Favorites, Search, Settings (owner's sketch, 2026-11-16) ---------- */
/* viewport-fit=cover: keep content clear of the iPhone notch (sideways) and the home bar. */
body { padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); }
.tabbar { display: none; }
body.has-tabbar { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
body.has-tabbar .tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; justify-content: center; gap: 4px;
  padding: 6px max(8px, env(safe-area-inset-right)) calc(6px + env(safe-area-inset-bottom)) max(8px, env(safe-area-inset-left));
  background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -2px 10px rgba(31,27,22,.06); }
.tabbar button { flex: 1 1 0; max-width: 130px; min-height: 52px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  border: 0; border-radius: 12px; background: none; color: var(--muted); font-size: 12px; font-weight: 600; padding: 4px 2px; }
.tabbar svg { width: 24px; height: 24px; }
.tabbar button[aria-current="page"] { color: var(--brand); background: var(--brand-soft); }
.tabbar button[data-icon="heart"][aria-current="page"] { color: #d62e4d; background: #fde7ec; }
@media (hover: hover) { .tabbar button:hover { color: var(--text); background: var(--surface-2); } }
body.has-tabbar .toast { bottom: calc(80px + env(safe-area-inset-bottom)); }

.role-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; max-width: 360px; margin: -8px auto 22px; padding: 4px; border-radius: 14px; background: #fff; border: 1px solid #cfe9db; }
.role-switch button { min-height: 46px; border: 0; border-radius: 10px; background: none; font-size: 20px; font-weight: 700; color: #6b6257; }
.role-switch button[data-role="student"][aria-checked="true"] { background: #e5323f; color: #fff; }
.role-switch button[data-role="teacher"][aria-checked="true"] { background: #3d4fc4; color: #fff; }
.my-progress { margin: 14px 0 6px; padding: 12px 14px; border-radius: 12px; background: #fff; border: 1px solid #d3eedc; font-size: 17px; font-weight: 600; color: #1f1b16; }
.my-progress p { margin: 0 0 6px; }
.my-progress .c-books { color: #e5323f; }
.my-progress .c-skills { color: #e97a1b; }
.my-progress .c-q { color: #1e8a4c; }
/* Medals in one line: picture, number, name — "🥇 1 Gold · 🥈 1 Silver · 🥉 1 Bronze" (owner, 2026-11-16). */
.medals { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 4px 6px; margin: 8px 0 4px; }
.medal { display: inline-flex; align-items: center; gap: 4px; white-space: nowrap; line-height: 1; }
.medal-pic { width: 30px; height: 38px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.25)); }
.medal-n { font-size: 20px; font-weight: 800; }
.medal-name { font-size: 17px; font-weight: 800; }
.medal-dot { color: var(--muted); font-size: 20px; font-weight: 700; }
.medal.gold .medal-name, .medal.gold .medal-n { color: #d99a00; }
.medal.silver .medal-name, .medal.silver .medal-n { color: #6f7b88; }
.medal.bronze .medal-name, .medal.bronze .medal-n { color: #b8601f; }
@media (max-width: 480px) { .medals { flex-wrap: nowrap; gap: 3px; } .medal { gap: 3px; } .medal-pic { width: 24px; height: 30px; } .medal-n { font-size: 16px; } .medal-name { font-size: 15px; } .medal-dot { font-size: 16px; } }
@media (max-width: 360px) { .my-progress { padding: 12px 8px; } .medal-pic { width: 20px; height: 25px; } .medal-n { font-size: 14px; } .medal-name { font-size: 13px; } }
.my-progress-link { font-size: 14px; font-weight: 400; margin: 2px 0 0 !important; }
.teacher-card { margin: 14px 0 6px; padding: 12px 16px; border-radius: 12px; background: #fff; border: 1px solid #c9cff3; text-align: left; color: #1f1b16; }
.teacher-card h2 { margin: 0 0 6px; font-size: 19px; color: #3d4fc4; }
.teacher-soon { margin: 0 0 8px; font-weight: 600; }
.teacher-card ul { margin: 0 0 8px; padding-left: 20px; }
.teacher-card .sub { margin: 0; font-size: 14px; }

.qs-head .qs-title { min-width: 0; overflow-wrap: break-word; }
@media (max-width: 420px) { .qs-head .qs-title { font-size: 20px; } }   /* room for the ♥ on phones */
@media (max-width: 360px) { .qs-head { gap: 6px; } .qs-head .qs-fav { width: 38px; margin-left: -4px; } }
.qs-head .qs-fav { width: 44px; height: 44px; flex: none; border: 0; border-radius: 10px; background: none; color: #9a8f84; display: grid; place-items: center; }
.qs-fav svg { width: 26px; height: 26px; }
.qs-fav.on { color: #d62e4d; }
.qs-fav.on svg { fill: currentColor; }
.fav-list { display: grid; gap: 12px; }
.fav-item { padding: 12px 14px; }
.fav-top { display: flex; align-items: center; gap: 8px; }
.fav-skill { flex: 1; min-width: 0; color: var(--muted); font-size: 13px; }
.fav-prompt { margin: 4px 0 8px; font-size: 18px; font-weight: 600; }
.fav-prompt .muted { color: var(--muted); font-weight: 400; }
.fav-item details { margin: 0 0 8px; }
.fav-item summary { cursor: pointer; color: var(--brand); font-weight: 600; min-height: 32px; display: flex; align-items: center; }
.fav-answer { margin: 4px 0 0; font-size: 20px; color: var(--good); font-weight: 600; }
.fav-item p:last-child { margin: 0; }
.fav-demo svg { width: 18px; height: 18px; vertical-align: -3px; color: #d62e4d; }

.search-box { display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 2px solid var(--line); border-radius: 12px; background: var(--surface); }
.search-box:focus-within { border-color: var(--brand); }
.search-box svg { width: 22px; height: 22px; color: var(--muted); flex: none; }
.search-box input { flex: 1; min-width: 0; min-height: 48px; border: 0; background: none; color: var(--text); font: inherit; font-size: 17px; outline: none; }
.result-list { display: grid; gap: 8px; }
.result { display: grid; gap: 2px; width: 100%; text-align: left; padding: 10px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); min-height: 48px; }
.result span { color: var(--muted); font-size: 13px; }
@media (hover: hover) { .result:hover { border-color: var(--brand); } }

.settings { display: grid; gap: 0; padding: 4px 16px; }
.set-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.set-row:last-child { border-bottom: 0; }
.set-row > div:first-child { flex: 1 1 200px; }
.set-row .meta { margin: 2px 0 0; color: var(--muted); font-size: 13px; }
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 12px; background: var(--surface-2); }
.seg button { min-height: 40px; min-width: 64px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--muted); font-weight: 600; }
.seg button[aria-checked="true"] { background: var(--brand); color: var(--brand-ink); }
/* Settings sections (2026-11-16) */
.set-h { margin: 22px 4px 8px; font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-h:first-of-type { margin-top: 8px; }
a.set-row.set-link { color: inherit; text-decoration: none; flex-wrap: nowrap; }
.set-link .chev { font-size: 26px; line-height: 1; color: var(--muted); }
@media (hover: hover) { a.set-link:hover b { text-decoration: underline; } }
.set-inline { display: flex; gap: 8px; flex: 1 1 240px; max-width: 360px; }
.set-inline input { flex: 1; min-width: 0; min-height: 40px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); font: inherit; }
.set-btns { display: inline-flex; gap: 8px; }
a.btn { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.stars { display: inline-flex; gap: 2px; }
.stars button { width: 40px; height: 40px; border: 0; background: none; font-size: 28px; line-height: 1; color: var(--line); padding: 0; }
.stars button.on { color: #f5b301; }
.set-version { margin: 20px 0 8px; text-align: center; color: var(--muted); font-size: 13px; }
#acctBox .signin { box-shadow: none; border: 0; padding: 12px 0; margin: 0; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .role-switch, :root:not([data-theme="light"]) .my-progress, :root:not([data-theme="light"]) .teacher-card { background: var(--surface); border-color: var(--line); color: var(--text); }
  :root:not([data-theme="light"]) .role-switch button { color: var(--muted); }
  :root:not([data-theme="light"]) .tabbar button[data-icon="heart"][aria-current="page"] { background: #3d1f27; color: #ff7d95; }
}
:root[data-theme="dark"] .role-switch, :root[data-theme="dark"] .my-progress, :root[data-theme="dark"] .teacher-card { background: var(--surface); border-color: var(--line); color: var(--text); }
:root[data-theme="dark"] .role-switch button { color: var(--muted); }
:root[data-theme="dark"] .tabbar button[data-icon="heart"][aria-current="page"] { background: #3d1f27; color: #ff7d95; }
/* Settings > Screen > Dark (2026-11-16): the same dark colours as the phone's dark mode. Made from the @media rules above. */
:root[data-theme="dark"] .pdf-card { background: #15324d; border-color: #2a5a85; }
:root[data-theme="dark"] .pdf-card-text, :root[data-theme="dark"] .pdf-card-text b { color: #e6f2fc; }
:root[data-theme="dark"] .pdf-card-text .pdf-pages { color: #b8d4ec; }
:root[data-theme="dark"] .pdf-box { background: #15324d; border-color: #2a5a85; }
:root[data-theme="dark"] mark.lt { background: #8a6d00; color: #fff; }
:root[data-theme="dark"] body.is-practice { background: #10241a; }
:root[data-theme="dark"] .qs, :root[data-theme="dark"] .qs-count { color: var(--text); }
:root[data-theme="dark"] .qs-media { background: #1d2a24; }
:root[data-theme="dark"] .qs-player { background: var(--surface); }
:root[data-theme="dark"] .qs-player-title { color: var(--text); }
:root[data-theme="dark"] .qs-score { color: var(--muted); }
:root[data-theme="dark"] body.is-landing { background: #10241a; }
:root[data-theme="dark"] .landing { color: var(--text); }
:root[data-theme="dark"] .banner { background: #173a33; border-color: #2f8f7e; }
:root[data-theme="dark"] .banner-logo { color: var(--text); }
:root[data-theme="dark"] .banner-title { color: #a9a1ff; }
:root[data-theme="dark"] .banner-user { background: #1d453d; border-color: #2f8f7e; }
:root[data-theme="dark"] .motto { color: #a9a1ff; }
:root[data-theme="dark"] .foot-links a, :root[data-theme="dark"] .foot-llc { color: var(--muted); }
:root[data-theme="dark"] .landing-foot, :root[data-theme="dark"] .books-line { border-color: #24402f; }
.subject .soon { display: block; margin-top: 2px; font-size: 12px; font-weight: 600; opacity: .9; }   /* Spanish, Mathematics (2026-11-16) */
.qs-pic.math { width: 100%; max-width: 400px; height: auto; object-fit: contain; padding: 0; background: #fff; border-radius: 10px; }   /* Mathematics drawings (2026-11-16) */
